Heray-Was-Here
Server : Apache
System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User : ws67451637 ( 67451637)
PHP Version : 8.1.34
Disable Function : NONE
Directory :  /homepages/10/d4299163471/htdocs/wordpress/wp-content/plugins/kubio/build/block-editor/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /homepages/10/d4299163471/htdocs/wordpress/wp-content/plugins/kubio/build/block-editor/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))}}),l=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){l=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function r(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!i.has(e)){var t=null,n=null,o=null,r=function(){e.clientWidth!==n&&d()},s=function(t){window.removeEventListener("resize",r,!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",r,!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 r=l("autosize:resized");try{e.dispatchEvent(r)}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 r(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()}))]}},9996:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)},n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function o(e,t){return!1!==t.clone&&t.isMergeableObject(e)?s((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function i(e,t,n){return e.concat(t).map((function(e){return o(e,n)}))}function l(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function r(e,t){try{return t in e}catch(e){return!1}}function s(e,n,a){(a=a||{}).arrayMerge=a.arrayMerge||i,a.isMergeableObject=a.isMergeableObject||t,a.cloneUnlessOtherwiseSpecified=o;var c=Array.isArray(n);return c===Array.isArray(e)?c?a.arrayMerge(e,n,a):function(e,t,n){var i={};return n.isMergeableObject(e)&&l(e).forEach((function(t){i[t]=o(e[t],n)})),l(t).forEach((function(l){(function(e,t){return r(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,l)||(r(e,l)&&n.isMergeableObject(t[l])?i[l]=function(e,t){if(!t.customMerge)return s;var n=t.customMerge(e);return"function"==typeof n?n:s}(l,n)(e[l],t[l],n):i[l]=o(t[l],n))})),i}(e,n,a):o(n,a)}s.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return s(e,n,t)}),{})};var a=s;e.exports=a},5913:(e,t)=>{"use strict";function n(){}function o(e,t,n,o,i){for(var l=0,r=t.length,s=0,a=0;l<r;l++){var c=t[l];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,l&&t[l-1].added){var u=t[l-1];t[l-1]=t[l],t[l]=u}}else{if(!c.added&&i){var d=n.slice(s,s+c.count);d=d.map((function(e,t){var n=o[a+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(s,s+c.count));s+=c.count,c.added||(a+=c.count)}}var p=t[r-1];return r>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[r-2].value+=p.value,t.pop()),t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.callback;"function"==typeof n&&(i=n,n={}),this.options=n;var l=this;function r(e){return i?(setTimeout((function(){i(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var s=(t=this.removeEmpty(this.tokenize(t))).length,a=e.length,c=1,u=s+a,d=[{newPos:-1,components:[]}],p=this.extractCommon(d[0],t,e,0);if(d[0].newPos+1>=s&&p+1>=a)return r([{value:this.join(t),count:t.length}]);function h(){for(var n=-1*c;n<=c;n+=2){var i=void 0,u=d[n-1],p=d[n+1],h=(p?p.newPos:0)-n;u&&(d[n-1]=void 0);var g=u&&u.newPos+1<s,m=p&&0<=h&&h<a;if(g||m){if(!g||m&&u.newPos<p.newPos?(i={newPos:(f=p).newPos,components:f.components.slice(0)},l.pushComponent(i.components,void 0,!0)):((i=u).newPos++,l.pushComponent(i.components,!0,void 0)),h=l.extractCommon(i,t,e,n),i.newPos+1>=s&&h+1>=a)return r(o(l,i.components,t,e,l.useLongestToken));d[n]=i}else d[n]=void 0}var f;c++}if(i)!function e(){setTimeout((function(){if(c>u)return i();h()||e()}),0)}();else for(;c<=u;){var g=h();if(g)return g}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var i=t.length,l=n.length,r=e.newPos,s=r-o,a=0;r+1<i&&s+1<l&&this.equals(t[r+1],n[s+1]);)r++,s++,a++;return a&&e.components.push({count:a}),e.newPos=r,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},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,l;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=(l=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=o;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,l[i]))return!1;for(i=o;0!=i--;){var r=l[i];if(!e(t[r],n[r]))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,l;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=(l=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=o;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,l[i]))return!1;for(i=o;0!=i--;){var r=l[i];if(!e(t[r],n[r]))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 l=e.nodeName,r=document.createElement(l);r.innerHTML="&nbsp;","TEXTAREA"===l.toUpperCase()&&r.setAttribute("rows","1");var s=o(e,"font-size");r.style.fontSize=s,r.style.padding="0px",r.style.border="0px";var a=document.body;a.appendChild(r),n=r.offsetHeight,a.removeChild(r)}return n}},9588:e=>{e.exports=function(e,t){var n,o,i=0;function l(){var l,r,s=n,a=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(r=0;r<a;r++)if(s.args[r]!==arguments[r]){s=s.next;continue e}return s!==n&&(s===o&&(o=s.prev),s.prev.next=s.next,s.next&&(s.next.prev=s.prev),s.next=n,s.prev=null,n.prev=s,n=s),s.val}s=s.next}for(l=new Array(a),r=0;r<a;r++)l[r]=arguments[r];return s={args:l,val:e.apply(null,l)},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||{},l.clear=function(){n=null,o=null,i=0},l}},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,l,r,s,a,c,u,d,p,h,g,m,f=!1;function v(){if(!f){f=!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),m=/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);r=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),l=v&&v[1]?parseFloat(v[1]):NaN):l=NaN}else t=n=o=l=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()||r>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()||l},windows:function(){return v()||a},osx:function(){return v()||s},linux:function(){return v()||c},iphone:function(){return v()||p},mobile:function(){return v()||p||h||u||m},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,l=n in document;if(!l){var r=document.createElement("div");r.setAttribute(n,"return;"),l="function"==typeof r[n]}return!l&&o&&"wheel"===e&&(l=document.implementation.hasFeature("Events.wheel","3.0")),l}},643:(e,t,n)=>{"use strict";var o=n(4518),i=n(6534);function l(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}}l.getEventType=function(){return o.firefox()?"DOMMouseScroll":i("wheel")?"wheel":"mousewheel"},e.exports=l},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):[],l=e.includeFiles?[].concat(e.includeFiles):[];return function(r){i.length&&r.source.input.file&&t(r.source.input.file,i)||l.length&&r.source.input.file&&!t(r.source.input.file,l)||r.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,r.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 l=!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(),l=!0),!1})),l&&(n.value=o.stringify(i))}}},e.exports.postcss=!0},9254:(e,t,n)=>{var o=n(788),i=n(5959),l=n(1120);function r(e){return this instanceof r?(this.nodes=o(e),this):new r(e)}r.prototype.toString=function(){return Array.isArray(this.nodes)?l(this.nodes):""},r.prototype.walk=function(e,t){return i(this.nodes,e,t),this},r.unit=n(3433),r.walk=i,r.stringify=l,e.exports=r},788:e=>{var t="(".charCodeAt(0),n=")".charCodeAt(0),o="'".charCodeAt(0),i='"'.charCodeAt(0),l="\\".charCodeAt(0),r="/".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,m,f,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),f=S[S.length-1],B===n&&E?M=v:f&&"div"===f.type?(f.after=v,f.sourceEndIndex+=v.length):B===s||B===a||B===r&&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:m=B===o?"'":'"'};do{if(b=!1,~(g=w.indexOf(m,g+1)))for(k=g;w.charCodeAt(k-1)===l;)k-=1,b=!b;else g=(w+=m).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===r&&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!==r&&B!==c||!x||"function"!==x.type||"calc"!==x.value)if(B===r||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)===l;)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===l&&(g+=1),g+=1,B=w.charCodeAt(g)}while(g<I&&!(B<=32||B===o||B===i||B===s||B===a||B===r||B===t||B===c&&x&&"function"===x.type&&"calc"===x.value||B===r&&"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,l=e.type,r=e.value;return t&&void 0!==(i=t(e))?i:"word"===l||"space"===l?r:"string"===l?(o=e.quote||"")+r+(e.unclosed?"":o):"comment"===l?"/*"+r+(e.unclosed?"":"*/"):"div"===l?(e.before||"")+r+(e.after||""):Array.isArray(e.nodes)?(o=n(e.nodes,t),"function"!==l?o:r+"("+(e.before||"")+o+(e.after||"")+(e.unclosed?"":")")):r}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),l="E".charCodeAt(0);e.exports=function(e){var r,s,a,c=0,u=e.length;if(0===u||!function(e){var i,l=e.charCodeAt(0);if(l===n||l===t){if((i=e.charCodeAt(1))>=48&&i<=57)return!0;var r=e.charCodeAt(2);return i===o&&r>=48&&r<=57}return l===o?(i=e.charCodeAt(1))>=48&&i<=57:l>=48&&l<=57}(e))return!1;for((r=e.charCodeAt(c))!==n&&r!==t||c++;c<u&&!((r=e.charCodeAt(c))<48||r>57);)c+=1;if(r=e.charCodeAt(c),s=e.charCodeAt(c+1),r===o&&s>=48&&s<=57)for(c+=2;c<u&&!((r=e.charCodeAt(c))<48||r>57);)c+=1;if(r=e.charCodeAt(c),s=e.charCodeAt(c+1),a=e.charCodeAt(c+2),(r===i||r===l)&&(s>=48&&s<=57||(s===n||s===t)&&a>=48&&a<=57))for(c+=s===n||s===t?3:2;c<u&&!((r=e.charCodeAt(c))<48||r>57);)c+=1;return{number:e.slice(0,c),unit:e.slice(c)}}},5959:e=>{e.exports=function e(t,n,o){var i,l,r,s;for(i=0,l=t.length;i<l;i+=1)r=t[i],o||(s=n(r,i,t)),!1!==s&&"function"===r.type&&Array.isArray(r.nodes)&&e(r.nodes,n,o),o&&n(r,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,l,{isClean:r,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[r]=!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 l(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[r]&&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=>{l=e},e.exports=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,l.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 l extends Error{constructor(e,t,n,o,i,r){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),o&&(this.source=o),r&&(this.plugin=r),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,l)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=o.isColorSupported),i&&e&&(t=i(t));let n,l,r=t.split(/\r?\n/),s=Math.max(this.line-3,0),a=Math.min(this.line+2,r.length),c=String(a).length;if(e){let{bold:e,red:t,gray:i}=o.createColors(!0);n=n=>e(t(n)),l=e=>i(e)}else n=l=e=>e;return r.slice(s,a).map(((e,t)=>{let o=s+1+t,i=" "+(" "+o).slice(-c)+" | ";if(o===this.line){let t=l(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+l(i)+e+"\n "+t+n("^")}return" "+l(i)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}e.exports=l,l.default=l},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,l=n(1019);class r extends l{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new o(new i,this,e).stringify()}}r.registerLazyResult=e=>{o=e},r.registerProcessor=e=>{i=e},e.exports=r,r.default=r},5995:(e,t,n)=>{"use strict";let{SourceMapConsumer:o,SourceMapGenerator:i}=n(209),{fileURLToPath:l,pathToFileURL:r}=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),m=Boolean(s&&a);class f{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!m||/^\w+:\/\//.test(t.from)||a(t.from)?this.file=t.from:this.file=s(t.from)),m&&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,l,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);l=e.line,s=e.col}else l=o.line,s=o.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let a=this.origin(t,n,l,s);return 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===l?t:{line:t,column:n},void 0===l?n:{line:l,column:s},this.css,this.file,o.plugin),i.input={line:t,column:n,endLine:l,endColumn:s,source:this.css},this.file&&(r&&(i.input.url=r(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)?r(u.source):new URL(u.source,this.map.consumer().sourceRoot||r(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(!l)throw new Error("file: protocol is not available in this PostCSS build");d.file=l(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=f,f.default=f,u&&u.registerInput&&u.registerInput(f)},1939:(e,t,n)=>{"use strict";let{isClean:o,my:i}=n(5513),l=n(8505),r=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},m=0;function f(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,m,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,m,n+"Exit"]:[n,n+"Exit"]}function b(e){let t;return t="document"===e.type?["Document",m,"DocumentExit"]:"root"===e.type?["Root",m,"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(f(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[o];)e[o]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=r;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new l(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}walkSync(e){e[o]=!0;let t=v(e);for(let n of t)if(n===m)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(f(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 f(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}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(f(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[o];){e[o]=!0;let t=[b(e)];for(;t.length>0;){let e=this.visitTick(t);if(f(e))try{await e}catch(e){let n=t[t.length-1].node;throw this.handleError(e,n)}}}if(this.listeners.OnceExit)for(let[t,n]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map((e=>n(e,this.helpers)));await Promise.all(t)}else await n(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}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,l=t.iterator;for(;i=n.nodes[n.indexes[l]];)if(n.indexes[l]+=1,!i[o])return i[o]=!0,void e.push(b(i));t.iterator=0,delete n.indexes[l]}let l=t.events;for(;t.eventIndex<l.length;){let e=l[t.eventIndex];if(t.eventIndex+=1,e===m)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="",l=!1,r=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?r+=1:")"===n?r>0&&(r-=1):0===r&&t.includes(n)&&(l=!0),l?(""!==i&&o.push(i.trim()),i="",l=!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:l,resolve:r,relative:s,sep:a}=n(9830),{pathToFileURL:c}=n(7414),u=n(5995),d=Boolean(o&&i),p=Boolean(l&&r&&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||l(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?l(this.opts.to):".";return"string"==typeof this.mapOpts.annotation&&(t=l(r(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,l="<no source>",r={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&&(r.generated.line=n,r.generated.column=o-1,s.source&&s.source.start?(r.source=this.sourcePath(s),r.original.line=s.source.start.line,r.original.column=s.source.start.column-1,this.map.addMapping(r)):(r.source=l,r.original.line=1,r.original.column=0,this.map.addMapping(r))),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?(r.source=this.sourcePath(s),r.original.line=s.source.end.line,r.original.column=s.source.end.column-1,r.generated.line=n,r.generated.column=o-2,this.map.addMapping(r)):(r.source=l,r.original.line=1,r.original.column=0,r.generated.line=n,r.generated.column=o-1,this.map.addMapping(r)))}}))}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),l=(n(2448),n(6939));const r=n(3632);class s{constructor(e,t,n){let l;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let s=i;this.result=new r(this._processor,l,this._opts),this.result.css=t;let a=this;Object.defineProperty(this.result,"root",{get:()=>a.root});let c=new o(s,l,this._opts,t);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}}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=l;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get 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),l=n(2671),r=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],l=typeof i;"parent"===o&&"object"===l?t&&(n[o]=t):"source"===o?n[o]=i:Array.isArray(i)?n[o]=i.map((e=>a(e,n))):("object"===l&&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 l(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 r).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 l=t.get(o.input);null==l&&(l=i,t.set(o.input,i),i++),n[e]={inputId:l,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),l=n(5995);function r(e,t){let n=new l(e,t),o=new i(n);try{o.parse()}catch(e){throw e}return o.root}e.exports=r,r.default=r,o.registerParse(r)},8867:(e,t,n)=>{"use strict";let o=n(4258),i=n(3852),l=n(9932),r=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 l;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,l=[],r=e[1].startsWith("--"),s=[],a=e;for(;a;){if(n=a[0],s.push(a),"("===n||"["===n)i||(i=a),l.push("("===n?")":"]");else if(r&&o&&"{"===n)i||(i=a),l.push("}");else if(0===l.length){if(";"===n){if(o)return void this.decl(s,r);break}if("{"===n)return void this.rule(s);if("}"===n){this.tokenizer.back(s.pop()),t=!0;break}":"===n&&(o=!0)}else n===l[l.length-1]&&(l.pop(),0===l.length&&(i=null));a=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),l.length>0&&this.unclosedBracket(i),t&&o){if(!r)for(;s.length&&(a=s[s.length-1][0],"space"===a||"comment"===a);)this.tokenizer.back(s.pop());this.decl(s,r)}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,l=e[e.length-1];for(";"===l[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(l[3]||l[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],o=n[3]||n[2];if(o)return o}}(e));"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 r,s=[];for(;e.length&&(r=e[0][0],"space"===r||"comment"===r);)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 r;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let l=!1,s=!1,a=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){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()){l=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),l&&(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,l,r,s,a=n.length,u="",d=!0;for(let e=0;e<a;e+=1)i=n[e],l=i[0],"space"!==l||e!==a-1||o?"comment"===l?(s=n[e-1]?n[e-1][0]:"empty",r=n[e+1]?n[e+1][0]:"empty",c[s]||c[r]||","===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[l,r]of e.entries()){if(t=r,n=t[0],"("===n&&(i+=1),")"===n&&(i-=1),0===i&&":"===n){if(o){if("word"===o[0]&&"progid"===o[1])continue;return l}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:l,readFileSync:r}=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),l(e))return this.mapFile=e,r(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),l=n(6461),r=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,r.registerProcessor(s),l.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,l=n(1019);class r extends l{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()}}r.registerLazyResult=e=>{o=e},r.registerProcessor=e=>{i=e},e.exports=r,r.default=r},1675:(e,t,n)=>{"use strict";let o=n(1019),i=n(4715);class l 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=l,l.default=l,o.registerRule(l)},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],l=this.raw(i,"before");l&&this.builder(l),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 l=e.parent;if("before"===o){if(!l||"root"===l.type&&l.first===e)return"";if(l&&"document"===l.type)return""}if(!l)return t[o];let r=e.root();if(r.rawCache||(r.rawCache={}),void 0!==r.rawCache[o])return r.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](r,e):r.walk((e=>{if(i=e.raws[n],void 0!==i)return!1}))}var s;return void 0===i&&(i=t[o]),r.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),l="\n".charCodeAt(0),r=" ".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),m="}".charCodeAt(0),f=";".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,L=e.css.valueOf(),A=w.ignoreErrors,D=L.length,O=0,z=[],V=[];function F(t){throw e.error("Unclosed "+t,O)}return{back:function(e){V.push(e)},nextToken:function(e){if(V.length)return V.pop();if(O>=D)return;let w=!!e&&e.ignoreUnclosed;switch(C=L.charCodeAt(O),C){case l:case r:case a:case c:case s:B=O;do{B+=1,C=L.charCodeAt(B)}while(C===r||C===l||C===a||C===c||C===s);N=["space",L.slice(O,B)],O=B-1;break;case u:case d:case g:case m:case b:case f:case h:{let e=String.fromCharCode(C);N=[e,e,O];break}case p:if(M=z.length?z.pop()[1]:"",R=L.charCodeAt(O+1),"url"===M&&R!==t&&R!==n&&R!==r&&R!==l&&R!==a&&R!==s&&R!==c){B=O;do{if(T=!1,B=L.indexOf(")",B+1),-1===B){if(A||w){B=O;break}F("bracket")}for(P=B;L.charCodeAt(P-1)===o;)P-=1,T=!T}while(T);N=["brackets",L.slice(O,B+1),O,B],O=B}else B=L.indexOf(")",O+1),j=L.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=L.indexOf(I,B+1),-1===B){if(A||w){B=O+1;break}F("string")}for(P=B;L.charCodeAt(P-1)===o;)P-=1,T=!T}while(T);N=["string",L.slice(O,B+1),O,B],O=B;break;case k:_.lastIndex=O+1,_.test(L),B=0===_.lastIndex?L.length-1:_.lastIndex-2,N=["at-word",L.slice(O,B+1),O,B],O=B;break;case o:for(B=O,E=!0;L.charCodeAt(B+1)===o;)B+=1,E=!E;if(C=L.charCodeAt(B+1),E&&C!==i&&C!==r&&C!==l&&C!==a&&C!==c&&C!==s&&(B+=1,S.test(L.charAt(B)))){for(;S.test(L.charAt(B+1));)B+=1;L.charCodeAt(B+1)===r&&(B+=1)}N=["word",L.slice(O,B+1),O,B],O=B;break;default:C===i&&L.charCodeAt(O+1)===v?(B=L.indexOf("*/",O+2)+1,0===B&&(A||w?B=L.length:F("comment")),N=["comment",L.slice(O,B+1),O,B],O=B):(y.lastIndex=O+1,y.test(L),B=0===y.lastIndex?L.length-1:y.lastIndex-2,N=["word",L.slice(O,B+1),O,B],z.push(N),O=B)}return O++,N},endOfFile:function(){return 0===V.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 l(){}l.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,l,r){if(r!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache: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 __)}),l=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},r=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=r(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return s.createElement("textarea",l({},a,{onChange:this.onChange,style:u?l({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),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,l({},e,{innerRef:t}))}))},4042:(e,t,n)=>{"use strict";var o=n(4857);t.Z=o.TextareaAutosize},5251:(e,t,n)=>{"use strict";var o=n(9196),i=Symbol.for("react.element"),l=Symbol.for("react.fragment"),r=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,l={},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)r.call(t,o)&&!a.hasOwnProperty(o)&&(l[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===l[o]&&(l[o]=t[o]);return{$$typeof:i,type:e,key:c,ref:u,props:l,_owner:s.current}}t.Fragment=l,t.jsx=c,t.jsxs=c},5893:(e,t,n)=>{"use strict";e.exports=n(5251)},6654:()=>{function e(e){e.hasAttribute("crossorigin")||e.setAttribute("crossorigin","anonymous")}if(window.crossOriginIsolated){const t=new window.MutationObserver((t=>{t.forEach((t=>{[t.addedNodes,t.target].forEach((t=>{(t instanceof window.NodeList?t:[t]).forEach((t=>{const n=t;n.querySelectorAll&&(n.querySelectorAll("img,source,script,video,link").forEach((t=>{e(t)})),["IMG","SOURCE","SCRIPT","VIDEO","LINK"].includes(n.nodeName)&&e(n))}))}))}))}));document.body?t.observe(document.body,{childList:!0,attributes:!0,subtree:!0}):"loading"===document.readyState&&document.addEventListener("DOMContentLoaded",(()=>{document.body&&t.observe(document.body,{childList:!0,attributes:!0,subtree:!0})}))}},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=r(e,l(n)))}return e}function l(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=r(t,n));return t}function r(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 l=t[o]={exports:{}};return e[o].call(l.exports,l,l.exports,n),l.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";n.r(o),n.d(o,{default:()=>lO});var e={};n.r(e),n.d(e,{getAllBlockBindingsSources:()=>Qn,getAllPatterns:()=>Wn,getBlockBindingsSource:()=>Xn,getBlockRemovalRules:()=>On,getBlockSettings:()=>In,getBlockStyles:()=>co,getBlockWithoutAttributes:()=>Pn,getClosestAllowedInsertionPoint:()=>go,getClosestAllowedInsertionPointForPattern:()=>mo,getContentLockingParent:()=>to,getEditedContentOnlySection:()=>so,getEnabledBlockParents:()=>An,getEnabledClientIdsTree:()=>Ln,getExpandedBlock:()=>eo,getInserterMediaCategories:()=>Hn,getInsertionPoint:()=>fo,getLastFocus:()=>Yn,getLastInsertedBlocksClientIds:()=>Tn,getListViewExpandRevision:()=>To,getOpenedBlockSettingsMenu:()=>zn,getParentSectionBlock:()=>oo,getPatternBySlug:()=>Un,getRegisteredInserterMediaCategories:()=>Fn,getRemovalPromptData:()=>Dn,getRequestedInspectorTab:()=>Mo,getReusableBlocks:()=>qn,getSectionRootClientId:()=>uo,getStyleOverrides:()=>Vn,getTemporarilyEditingAsBlocks:()=>lo,getTemporarilyEditingFocusModeToRevert:()=>ro,getViewportModalClientIds:()=>Po,getZoomLevel:()=>ho,hasAllowedPatterns:()=>Gn,hasBlockSpotlight:()=>So,isBlockHidden:()=>vo,isBlockHiddenAnywhere:()=>bo,isBlockHiddenAtViewport:()=>yo,isBlockHiddenEverywhere:()=>ko,isBlockInterfaceHidden:()=>En,isBlockParentHiddenAtViewport:()=>xo,isBlockParentHiddenEverywhere:()=>_o,isBlockSubtreeDisabled:()=>Mn,isContainerInsertableToInContentOnlyMode:()=>Rn,isDragging:()=>Jn,isEditLockedBlock:()=>wo,isListViewContentPanelOpen:()=>jo,isListViewPanelOpened:()=>Eo,isLockedBlock:()=>Io,isMoveLockedBlock:()=>Co,isRemoveLockedBlock:()=>Bo,isResolvingPatterns:()=>Kn,isSectionBlock:()=>io,isWithinEditedContentOnlySection:()=>ao,isZoomOut:()=>po});var t={};n.r(t),n.d(t,{__experimentalGetActiveBlockIdByBlockNames:()=>er,__experimentalGetAllowedBlocks:()=>Bl,__experimentalGetAllowedPatterns:()=>Pl,__experimentalGetAllowedPatterns65:()=>Nl,__experimentalGetBlockListSettingsForBlocks:()=>$l,__experimentalGetDirectInsertBlock:()=>jl,__experimentalGetGlobalBlocksByName:()=>li,__experimentalGetLastBlockAttributeChanges:()=>Kl,__experimentalGetParsedPattern:()=>El,__experimentalGetPatternTransformItems:()=>zl,__experimentalGetPatternsByBlockTypes:()=>Ol,__experimentalGetReusableBlockTitle:()=>Ul,__experimentalUserPatternCategories:()=>Ml,__unstableGetBlockWithoutInnerBlocks:()=>Qo,__unstableGetClientIdWithClientIdsTree:()=>Jo,__unstableGetClientIdsTree:()=>ei,__unstableGetContentLockingParent:()=>lr,__unstableGetEditorMode:()=>ql,__unstableGetSelectedBlocksWithPartialSelection:()=>Vi,__unstableGetTemporarilyEditingAsBlocks:()=>rr,__unstableGetTemporarilyEditingFocusModeToRevert:()=>sr,__unstableGetVisibleBlocks:()=>ir,__unstableHasActiveBlockOverlayActive:()=>ar,__unstableIsFullySelected:()=>Ai,__unstableIsLastBlockChangeIgnored:()=>Wl,__unstableIsSelectionCollapsed:()=>Di,__unstableIsSelectionMergeable:()=>zi,__unstableIsWithinBlockOverlay:()=>cr,__unstableSelectionHasUnmergeableBlock:()=>Oi,areInnerBlocksControlled:()=>Jl,canEditBlock:()=>fl,canInsertBlockType:()=>ul,canInsertBlocks:()=>dl,canLockBlockType:()=>vl,canMoveBlock:()=>gl,canMoveBlocks:()=>ml,canRemoveBlock:()=>pl,canRemoveBlocks:()=>hl,didAutomaticChange:()=>Ql,getAdjacentBlockClientId:()=>xi,getAllBlockBindingsSources:()=>Qn,getAllPatterns:()=>Wn,getAllowedBlocks:()=>Cl,getBehaviors:()=>Hl,getBlock:()=>Yo,getBlockAttributes:()=>qo,getBlockBindingsSource:()=>Xn,getBlockCount:()=>ai,getBlockEditingMode:()=>ur,getBlockHierarchyRootClientId:()=>_i,getBlockIndex:()=>Hi,getBlockInsertionPoint:()=>ol,getBlockListSettings:()=>Vl,getBlockMode:()=>Yi,getBlockName:()=>Ko,getBlockNamesByClientId:()=>si,getBlockOrder:()=>Fi,getBlockParents:()=>bi,getBlockParentsByBlockName:()=>ki,getBlockRemovalRules:()=>On,getBlockRootClientId:()=>vi,getBlockSelectionEnd:()=>pi,getBlockSelectionStart:()=>di,getBlockSettings:()=>In,getBlockStyles:()=>co,getBlockTransformItems:()=>Sl,getBlockWithoutAttributes:()=>Pn,getBlocks:()=>Xo,getBlocksByClientId:()=>ri,getBlocksByName:()=>ii,getClientIdsOfDescendants:()=>ti,getClientIdsWithDescendants:()=>ni,getClosestAllowedInsertionPoint:()=>go,getClosestAllowedInsertionPointForPattern:()=>mo,getContentLockingParent:()=>to,getDirectInsertBlock:()=>Il,getDraggedBlockClientIds:()=>Ji,getEditedContentOnlySection:()=>so,getEnabledBlockParents:()=>An,getEnabledClientIdsTree:()=>Ln,getExpandedBlock:()=>eo,getFirstMultiSelectedBlockClientId:()=>Ei,getGlobalBlockCount:()=>oi,getHoveredBlockClientId:()=>or,getInserterItems:()=>xl,getInserterMediaCategories:()=>Hn,getInsertionPoint:()=>fo,getLastFocus:()=>Yn,getLastInsertedBlocksClientIds:()=>Tn,getLastMultiSelectedBlockClientId:()=>Ti,getListViewExpandRevision:()=>To,getLowestCommonAncestorWithSelectedBlock:()=>yi,getMultiSelectedBlockClientIds:()=>Ii,getMultiSelectedBlocks:()=>ji,getMultiSelectedBlocksEndClientId:()=>Li,getMultiSelectedBlocksStartClientId:()=>Ni,getNextBlockClientId:()=>wi,getOpenedBlockSettingsMenu:()=>zn,getParentSectionBlock:()=>oo,getPatternBySlug:()=>Un,getPatternsByBlockTypes:()=>Dl,getPreviousBlockClientId:()=>Si,getRegisteredInserterMediaCategories:()=>Fn,getRemovalPromptData:()=>Dn,getRequestedInspectorTab:()=>Mo,getReusableBlocks:()=>qn,getSectionRootClientId:()=>uo,getSelectedBlock:()=>fi,getSelectedBlockClientId:()=>mi,getSelectedBlockClientIds:()=>Bi,getSelectedBlockCount:()=>hi,getSelectedBlocksInitialCaretPosition:()=>Ci,getSelectionEnd:()=>ui,getSelectionStart:()=>ci,getSettings:()=>Fl,getStyleOverrides:()=>Vn,getTemplate:()=>rl,getTemplateLock:()=>sl,getTemporarilyEditingAsBlocks:()=>lo,getTemporarilyEditingFocusModeToRevert:()=>ro,getViewportModalClientIds:()=>Po,getZoomLevel:()=>ho,hasAllowedPatterns:()=>Gn,hasBlockMovingClientId:()=>Yl,hasBlockSpotlight:()=>So,hasDraggedInnerBlock:()=>Ui,hasInserterItems:()=>wl,hasMultiSelection:()=>Ki,hasSelectedBlock:()=>gi,hasSelectedInnerBlock:()=>$i,isAncestorBeingDragged:()=>tl,isAncestorMultiSelected:()=>Ri,isBlockBeingDragged:()=>el,isBlockHidden:()=>vo,isBlockHiddenAnywhere:()=>bo,isBlockHiddenAtViewport:()=>yo,isBlockHiddenEverywhere:()=>ko,isBlockHighlighted:()=>Xl,isBlockInsertionPointVisible:()=>il,isBlockInterfaceHidden:()=>En,isBlockMultiSelected:()=>Mi,isBlockParentHiddenAtViewport:()=>xo,isBlockParentHiddenEverywhere:()=>_o,isBlockSelected:()=>Gi,isBlockSubtreeDisabled:()=>Mn,isBlockValid:()=>Zo,isBlockVisible:()=>nr,isBlockWithinSelection:()=>Wi,isCaretWithinFormattedText:()=>nl,isContainerInsertableToInContentOnlyMode:()=>Rn,isDragging:()=>Jn,isDraggingBlocks:()=>Xi,isEditLockedBlock:()=>wo,isFirstMultiSelectedBlock:()=>Pi,isGroupable:()=>pr,isLastBlockChangePersistent:()=>Gl,isListViewContentPanelOpen:()=>jo,isListViewPanelOpened:()=>Eo,isLockedBlock:()=>Io,isMoveLockedBlock:()=>Co,isMultiSelecting:()=>Zi,isNavigationMode:()=>Zl,isRemoveLockedBlock:()=>Bo,isResolvingPatterns:()=>Kn,isSectionBlock:()=>io,isSelectionEnabled:()=>qi,isTyping:()=>Qi,isUngroupable:()=>dr,isValidTemplate:()=>ll,isWithinEditedContentOnlySection:()=>ao,isZoomOut:()=>po,wasBlockJustInserted:()=>tr,wasBlockJustRemoved:()=>hr});var i={};n.r(i),n.d(i,{__experimentalUpdateSettings:()=>vr,clearBlockRemovalPrompt:()=>xr,clearRequestedInspectorTab:()=>Wr,closeListViewContentPanel:()=>Hr,deleteStyleOverride:()=>Br,editContentOnlySection:()=>Ar,ensureDefaultBlock:()=>yr,expandBlock:()=>Rr,hideBlockInterface:()=>br,hideViewportModal:()=>$r,modifyContentLockBlock:()=>Lr,openListViewContentPanel:()=>Fr,privateRemoveBlocks:()=>_r,registerBlockBindingsSource:()=>Tr,requestInspectorTab:()=>Ur,resetZoomLevel:()=>zr,setBlockRemovalRules:()=>Sr,setInsertionPoint:()=>Nr,setLastFocus:()=>jr,setOpenedBlockSettingsMenu:()=>wr,setStyleOverride:()=>Cr,setZoomLevel:()=>Or,showBlockInterface:()=>kr,showViewportModal:()=>Gr,startDragging:()=>Pr,stopDragging:()=>Mr,stopEditingAsBlocks:()=>Er,stopEditingContentOnlySection:()=>Dr,syncDerivedUpdates:()=>Ir,toggleBlockSpotlight:()=>Vr});var l={};n.r(l),n.d(l,{getFetchedPatterns:()=>Kr});var r={};n.r(r),n.d(r,{__unstableDeleteSelection:()=>Bs,__unstableExpandSelection:()=>js,__unstableMarkAutomaticChange:()=>Ks,__unstableMarkLastChangeAsPersistent:()=>Us,__unstableMarkNextChangeAsNotPersistent:()=>Ws,__unstableSaveReusableBlock:()=>$s,__unstableSetEditorMode:()=>qs,__unstableSetTemporarilyEditingAsBlocks:()=>ia,__unstableSplitSelection:()=>Is,clearSelectedBlock:()=>us,duplicateBlocks:()=>Qs,enterFormattedText:()=>Os,exitFormattedText:()=>zs,flashBlock:()=>ta,hideInsertionPoint:()=>Ss,hoverBlock:()=>is,insertAfterBlock:()=>Js,insertBeforeBlock:()=>Xs,insertBlock:()=>_s,insertBlocks:()=>ys,insertDefaultBlock:()=>Fs,mergeBlocks:()=>Es,moveBlockToPosition:()=>ks,moveBlocksDown:()=>fs,moveBlocksToPosition:()=>bs,moveBlocksUp:()=>vs,multiSelect:()=>cs,receiveBlocks:()=>es,registerInserterMediaCategory:()=>la,removeBlock:()=>Ps,removeBlocks:()=>Ts,replaceBlock:()=>gs,replaceBlocks:()=>hs,replaceInnerBlocks:()=>Ms,resetBlocks:()=>Qr,resetSelection:()=>Jr,selectBlock:()=>os,selectNextBlock:()=>rs,selectPreviousBlock:()=>ls,selectionChange:()=>Vs,setBlockEditingMode:()=>ra,setBlockMovingClientId:()=>Ys,setBlockVisibility:()=>oa,setHasControlledInnerBlocks:()=>na,setNavigationMode:()=>Zs,setTemplateValidity:()=>ws,showInsertionPoint:()=>xs,startDraggingBlocks:()=>As,startMultiSelect:()=>ss,startTyping:()=>Ns,stopDraggingBlocks:()=>Ds,stopMultiSelect:()=>as,stopTyping:()=>Ls,synchronizeTemplate:()=>Cs,toggleBlockHighlight:()=>ea,toggleBlockMode:()=>Rs,toggleSelection:()=>ds,unsetBlockEditingMode:()=>sa,updateBlock:()=>ns,updateBlockAttributes:()=>ts,updateBlockListSettings:()=>Hs,updateSettings:()=>Gs,validateBlocksToTemplate:()=>Xr});var s={};n.r(s),n.d(s,{AdvancedPanel:()=>dR,BackgroundPanel:()=>XT,BorderPanel:()=>AM,ColorPanel:()=>QM,DimensionsPanel:()=>vM,FiltersPanel:()=>sR,GlobalStylesContext:()=>oC,ImageSettingsPanel:()=>cR,TypographyPanel:()=>WP,getBlockCSSSelector:()=>PT,getBlockSelector:()=>sP,getBlockSelectors:()=>yP,getLayoutStyles:()=>gP,toStyles:()=>kP,useGlobalSetting:()=>BT,useGlobalStyle:()=>IT,useGlobalStylesOutput:()=>wP,useGlobalStylesOutputWithConfig:()=>SP,useGlobalStylesReset:()=>CT,useHasBackgroundPanel:()=>qT,useHasBorderPanel:()=>IM,useHasBorderPanelControls:()=>jM,useHasColorPanel:()=>DM,useHasDimensionsPanel:()=>nM,useHasFiltersPanel:()=>eR,useHasImageSettingsPanel:()=>aR,useHasTypographyPanel:()=>MP,useSettingsForBlockElement:()=>jT});var a={};function c(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=c(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}n.r(a),n.d(a,{AlignmentControl:()=>lc,AlignmentToolbar:()=>rc,Autocomplete:()=>Lc,BlockAlignmentControl:()=>Hd,BlockAlignmentToolbar:()=>Gd,BlockBindingsAttributeControl:()=>Yd,BlockBindingsSourceFieldsList:()=>Zd,BlockBreadcrumb:()=>pp,BlockCanvas:()=>wS,BlockColorsStyleSelector:()=>jS,BlockContextProvider:()=>nt,BlockControls:()=>Qy,BlockEdit:()=>Sa,BlockEditorKeyboardShortcuts:()=>lh,BlockEditorProvider:()=>xh,BlockFormatControls:()=>Yy,BlockIcon:()=>Sc,BlockInspector:()=>SN,BlockList:()=>s_,BlockMover:()=>by,BlockNavigationDropdown:()=>aw,BlockPopover:()=>p_,BlockPreview:()=>mg,BlockSelectionClearer:()=>wh,BlockSettingsMenu:()=>Ux,BlockSettingsMenuControls:()=>Lx,BlockStyles:()=>Lw,BlockTitle:()=>lp,BlockToolbar:()=>eS,BlockTools:()=>mS,BlockVerticalAlignmentControl:()=>sC,BlockVerticalAlignmentToolbar:()=>aC,ButtonBlockAppender:()=>lm,ButtonBlockerAppender:()=>im,ColorPalette:()=>CC,ColorPaletteControl:()=>MC,ContrastChecker:()=>RC,CopyHandler:()=>CN,DefaultBlockAppender:()=>tm,DimensionControl:()=>wB,EditorStyles:()=>rg,FontSizePicker:()=>qa,GlobalStylesContext:()=>oC,HeadingLevelDropdown:()=>Vw,HeightControl:()=>BB,InnerBlocks:()=>Mm,Inserter:()=>Jg,InspectorAdvancedControls:()=>O_,InspectorControls:()=>z_,JustifyContentControl:()=>xI,JustifyToolbar:()=>SI,LineHeightControl:()=>_j,LinkControl:()=>ZN,MediaPlaceholder:()=>hE,MediaReplaceFlow:()=>Ej,MediaUpload:()=>wj,MediaUploadCheck:()=>Cj,MultiSelectScrollIntoView:()=>jN,NavigableToolbar:()=>Qx,ObserveTyping:()=>Am,PanelColorSettings:()=>gE,PlainText:()=>QE,RecursionProvider:()=>LN,ReusableBlocksRenameHint:()=>jg,RichText:()=>ZE,RichTextShortcut:()=>DE,RichTextToolbarButton:()=>OE,SETTINGS_DEFAULTS:()=>St,SkipToSelectedBlock:()=>vN,ToolSelector:()=>KN,ToolsPanelContext:()=>UN,Typewriter:()=>RN,URLInput:()=>rE,URLInputButton:()=>tT,URLPopover:()=>cE,Warning:()=>ya,WritingFlow:()=>Jh,__experimentalBlockAlignmentMatrixControl:()=>np,__experimentalBlockContentOverlay:()=>hp,__experimentalBlockFullHeightAligmentControl:()=>Xd,__experimentalBlockPatternSetup:()=>Qw,__experimentalBlockPatternsList:()=>xg,__experimentalBlockVariationPicker:()=>Hw,__experimentalBlockVariationTransforms:()=>nC,__experimentalBorderRadiusControl:()=>SC,__experimentalColorGradientControl:()=>PC,__experimentalColorGradientSettingsDropdown:()=>sB,__experimentalDateFormatPicker:()=>AC,__experimentalDuotoneControl:()=>zC,__experimentalFontAppearanceControl:()=>FC,__experimentalFontFamilyControl:()=>HC,__experimentalGetBorderClassesAndStyles:()=>MD,__experimentalGetColorClassesAndStyles:()=>LD,__experimentalGetElementClassName:()=>HD,__experimentalGetGapCSSValue:()=>du,__experimentalGetGradientClass:()=>Ma,__experimentalGetGradientObjectByGradientValue:()=>Na,__experimentalGetMatchingVariation:()=>De,__experimentalGetShadowClassesAndStyles:()=>ND,__experimentalGetSpacingClassesAndStyles:()=>DD,__experimentalImageEditor:()=>mI,__experimentalImageSizeControl:()=>kI,__experimentalImageURLInputUI:()=>cT,__experimentalInspectorPopoverHeader:()=>zN,__experimentalLayoutStyle:()=>Pd,__experimentalLetterSpacingControl:()=>GC,__experimentalLibrary:()=>IN,__experimentalLinkControl:()=>kj,__experimentalLinkControlSearchInput:()=>ej,__experimentalLinkControlSearchItem:()=>zI,__experimentalLinkControlSearchResults:()=>KI,__experimentalListView:()=>rw,__experimentalPanelColorGradientSettings:()=>pB,__experimentalPreviewOptions:()=>yT,__experimentalPublishDateTimePicker:()=>FN,__experimentalRecursionProvider:()=>DN,__experimentalResponsiveBlockControl:()=>JE,__experimentalSpacingSizesControl:()=>_T,__experimentalTextDecorationControl:()=>ZC,__experimentalTextTransformControl:()=>JC,__experimentalUnitControl:()=>eT,__experimentalUseBlockOverlayActive:()=>hp,__experimentalUseBlockPreview:()=>fg,__experimentalUseBorderProps:()=>RD,__experimentalUseColorProps:()=>AD,__experimentalUseCustomSides:()=>vA,__experimentalUseGradient:()=>Aa,__experimentalUseHasRecursion:()=>ON,__experimentalUseMultipleOriginColorsAndGradients:()=>aB,__experimentalUseResizeCanvas:()=>xT,__experimentalWritingModeControl:()=>oB,__unstableBlockNameContext:()=>Zx,__unstableBlockSettingsMenuFirstItem:()=>zx,__unstableBlockToolbarLastItem:()=>ex,__unstableEditorStyles:()=>rg,__unstableIframe:()=>ig,__unstableInserterMenuExtension:()=>Rg,__unstableRichTextInputEvent:()=>AE,__unstableUseBlockSelectionClearer:()=>Sh,__unstableUseClipboardHandler:()=>wN,__unstableUseMouseMoveTypingReset:()=>Nm,__unstableUseTypewriter:()=>MN,__unstableUseTypingObserver:()=>Lm,createCustomColorsHOC:()=>Ta,getColorClassName:()=>Qe,getColorObjectByAttributeValues:()=>qe,getColorObjectByColorValue:()=>Ye,getComputedFluidTypographyValue:()=>Wa,getCustomValueFromPreset:()=>su,getDimensionsClassesAndStyles:()=>PD,getFontSize:()=>Da,getFontSizeClass:()=>za,getFontSizeObjectByValue:()=>Oa,getGradientSlugByValue:()=>La,getGradientValueBySlug:()=>Ra,getPxFromCssUnit:()=>Oe,getSpacingPresetCssVar:()=>cu,getTypographyClassesAndStyles:()=>OD,isValueSpacingPreset:()=>ru,kebabCase:()=>Ze,lock:()=>me,observableMap:()=>Ve,privateApis:()=>iO,store:()=>ba,storeConfig:()=>va,transformStyles:()=>Le,unlock:()=>fe,useBlockBindingsUtils:()=>Ud,useBlockCommands:()=>kS,useBlockDisplayInformation:()=>F_,useBlockEditContext:()=>B,useBlockEditingMode:()=>HN,useBlockProps:()=>jk,useCachedTruthy:()=>zD,useClipboardHandler:()=>wN,useHasRecursion:()=>AN,useInnerBlocksProps:()=>Pm,useObservableValue:()=>ze,useSetting:()=>Ca,useSettings:()=>wa,useStyleOverride:()=>JN,withColorContext:()=>wC,withColors:()=>Pa,withFontSizes:()=>Xa});const u=function(){for(var e,t,n=0,o="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=c(e))&&(o&&(o+=" "),o+=t);return o},d=window.wp.blocks,p=window.wp.element,h=window.wp.data,g=window.wp.compose,m=window.wp.hooks,f=Symbol("mayDisplayControls"),v=Symbol("mayDisplayParentControls"),b=Symbol("mayDisplayPatternEditingControls"),k=Symbol("blockEditingMode"),y=Symbol("blockBindings"),x=Symbol("isPreviewMode"),S=(Symbol("isInListViewBlockSupportTree"),{name:"",isSelected:!1}),w=(0,p.createContext)(S);w.displayName="BlockEditContext";const{Provider:C}=w;function B(){return(0,p.useContext)(w)}var I={grad:.9,turn:360,rad:360/(2*Math.PI)},j=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},E=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},T=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},P=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},M=function(e){return{r:T(e.r,0,255),g:T(e.g,0,255),b:T(e.b,0,255),a:T(e.a)}},R=function(e){return{r:E(e.r),g:E(e.g),b:E(e.b),a:E(e.a,3)}},N=/^#([0-9a-f]{3,8})$/i,L=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},A=function(e){var t=e.r,n=e.g,o=e.b,i=e.a,l=Math.max(t,n,o),r=l-Math.min(t,n,o),s=r?l===t?(n-o)/r:l===n?2+(o-t)/r:4+(t-n)/r:0;return{h:60*(s<0?s+6:s),s:l?r/l*100:0,v:l/255*100,a:i}},D=function(e){var t=e.h,n=e.s,o=e.v,i=e.a;t=t/360*6,n/=100,o/=100;var l=Math.floor(t),r=o*(1-n),s=o*(1-(t-l)*n),a=o*(1-(1-t+l)*n),c=l%6;return{r:255*[o,s,r,r,a,o][c],g:255*[a,o,o,s,r,r][c],b:255*[r,r,a,o,o,s][c],a:i}},O=function(e){return{h:P(e.h),s:T(e.s,0,100),l:T(e.l,0,100),a:T(e.a)}},z=function(e){return{h:E(e.h),s:E(e.s),l:E(e.l),a:E(e.a,3)}},V=function(e){return D((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},F=function(e){return{h:(t=A(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},H=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,G=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,$=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,U=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,W={string:[[function(e){var t=N.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?E(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?E(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=$.exec(e)||U.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:M({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=H.exec(e)||G.exec(e);if(!t)return null;var n,o,i=O({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(I[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return V(i)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,i=e.a,l=void 0===i?1:i;return j(t)&&j(n)&&j(o)?M({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,i=e.a,l=void 0===i?1:i;if(!j(t)||!j(n)||!j(o))return null;var r=O({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return V(r)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,i=e.a,l=void 0===i?1:i;if(!j(t)||!j(n)||!j(o))return null;var r=function(e){return{h:P(e.h),s:T(e.s,0,100),v:T(e.v,0,100),a:T(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return D(r)},"hsv"]]},K=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]},Z=function(e,t){var n=F(e);return{h:n.h,s:T(n.s+100*t,0,100),l:n.l,a:n.a}},q=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Y=function(e,t){var n=F(e);return{h:n.h,s:n.s,l:T(n.l+100*t,0,100),a:n.a}},Q=function(){function e(e){this.parsed=function(e){return"string"==typeof e?K(e.trim(),W.string):"object"==typeof e&&null!==e?K(e,W.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 E(q(this.rgba),2)},e.prototype.isDark=function(){return q(this.rgba)<.5},e.prototype.isLight=function(){return q(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=R(this.rgba)).r,n=e.g,o=e.b,l=(i=e.a)<1?L(E(255*i)):"","#"+L(t)+L(n)+L(o)+l;var e,t,n,o,i,l},e.prototype.toRgb=function(){return R(this.rgba)},e.prototype.toRgbString=function(){return t=(e=R(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 z(F(this.rgba))},e.prototype.toHslString=function(){return t=(e=z(F(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=A(this.rgba),{h:E(e.h),s:E(e.s),v:E(e.v),a:E(e.a,3)};var e},e.prototype.invert=function(){return X({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),X(Z(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),X(Z(this.rgba,-e))},e.prototype.grayscale=function(){return X(Z(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),X(Y(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),X(Y(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?X({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):E(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=F(this.rgba);return"number"==typeof e?X({h:e,s:t.s,l:t.l,a:t.a}):E(t.h)},e.prototype.isEqual=function(e){return this.toHex()===X(e).toHex()},e}(),X=function(e){return e instanceof Q?e:new Q(e)},J=[],ee=function(e){e.forEach((function(e){J.indexOf(e)<0&&(e(Q,W),J.push(e))}))};function te(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 l={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var i,r,s=o[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var a=this.toRgb(),c=1/0,u="black";if(!l.length)for(var d in n)l[d]=new e(n[d]).toRgb();for(var p in n){var h=(i=a,r=l[p],Math.pow(i.r-r.r,2)+Math.pow(i.g-r.g,2)+Math.pow(i.b-r.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 ne=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},oe=function(e){return.2126*ne(e.r)+.7152*ne(e.g)+.0722*ne(e.b)};function ie(e){e.prototype.luminance=function(){return e=oe(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,l,r,s,a,c=t instanceof e?t:new e(t);return l=this.rgba,r=c.toRgb(),n=(s=oe(l))>(a=oe(r))?(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)>=(r=void 0===(l=(n=t).size)?"normal":l,"AAA"===(i=void 0===(o=n.level)?"AA":o)&&"normal"===r?7:"AA"===i&&"large"===r?3:4.5);var n,o,i,l,r}}const le=window.wp.components,re=window.kubio.utils;let se,ae=(0,re.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,re.wpVersionCompare)("6.6",">=")&&(ae="I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.");try{se=process.env.ALLOW_EXPERIMENT_REREGISTRATION??!1}catch(e){se=!1}new WeakMap,Symbol("Private API ID");const ce=window.lodash;var ue,de,pe=n.n(ce);const he=()=>({lock:ce.identity,unlock:ce.identity}),{__dangerousOptInToUnstableAPIsOnlyForCoreModules:ge=he}=(null===(ue=top.wp)||void 0===ue?void 0:ue.experiments)||(null===(de=top.wp)||void 0===de?void 0:de.privateApis)||{},{lock:me,unlock:fe}=ge(ae,"@wordpress/block-editor"),ve={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},be=new Set(["combinator","comma"]),ke=(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(ve[e].source.replace("(?<argument>¶*)","(?<argument>.*)"),"gu");default:return ve[e]}});function _e(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 ye=/(['"])([^\\\n]*?)\1/g,xe=/\\./g;function Se(e,t=ve){if(""===(e=e.trim()))return[];const n=[];e=e.replace(xe,((e,t)=>(n.push({value:e,offset:t}),"".repeat(e.length)))),e=e.replace(ye,((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=_e(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=ve){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 l=o.exec(i);if(!l)continue;const r=l.index-1,s=[],a=l[0],c=i.slice(0,r+1);c&&s.push(c),s.push({...l.groups,type:e,content:a});const u=i.slice(r+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],be.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:l}=t,r=n-t.pos[0];t.content=l.slice(0,r)+o+l.slice(r+o.length),t.content!==l&&i.add(t)}for(const e of i){const t=ke(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 we(e){if(Array.isArray(e))return e.map((e=>e.content)).join("");switch(e.type){case"list":return e.list.map(we).join(",");case"relative":return e.combinator+we(e.right);case"complex":return we(e.left)+e.combinator+we(e.right);case"compound":return e.list.map(we).join("");default:return e.content}}var Ce=n(1723),Be=n.n(Ce),Ie=n(2671),je=n.n(Ie),Ee=n(1119),Te=n.n(Ee),Pe=n(3418),Me=n.n(Pe);const Re=new Map,Ne=[{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 Le=(e,t="",n)=>{let o=Re.get(t);return o||(o=new WeakMap,Re.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{const l=[...t,...(null==i?void 0:i.ignoredSelectors)??[],o];return new(Be())([o&&Te()({prefix:o,transform:(e,t,n)=>l.some((e=>e instanceof RegExp?t.match(e):t.includes(e)))?t:Ne.some((e=>t.startsWith(e.content)))?function(e,t){const n=Se(t);let o=-1;for(let e=n.findLastIndex((({content:e,type:t})=>Ne.some((n=>e===n.content&&t===n.type))))+1;e<n.length;e++)if("combinator"===n[e].type){o=e;break}const i=Se(e);return n.splice(-1===o?n.length:o,0,{type:"combinator",content:" "},...i),we(n)}(e,t):n}),n&&Me()({rootUrl:n})].filter(Boolean)).process(e,{}).css}catch(e){return e instanceof je()?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 Ae(e,t){return Object.entries(t).every((([t,n])=>"object"==typeof n&&"object"==typeof e[t]?Ae(e[t],n):e[t]===n))}const De=(e,t)=>{if(!t||!e)return;const n=t.filter((({attributes:t})=>!(!t||!Object.keys(t).length)&&Ae(e,t)));return 1===n.length?n[0]:void 0},Oe=()=>"";function ze(e,t){const[n,o]=(0,p.useMemo)((()=>[n=>e.subscribe(t,n),()=>e.get(t)]),[e,t]);return(0,p.useSyncExternalStore)(n,o,o)}function Ve(){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 Fe=function(e,t){return Fe=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])},Fe(e,t)};var He=function(){return He=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},He.apply(this,arguments)};function Ge(e){return e.toLowerCase()}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var $e=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],Ue=/[^A-Z0-9]+/gi;function We(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}function Ke(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?$e:n,i=t.stripRegexp,l=void 0===i?Ue:i,r=t.transform,s=void 0===r?Ge:r,a=t.delimiter,c=void 0===a?" ":a,u=We(We(e,o,"$1\0$2"),l,"\0"),d=0,p=u.length;"\0"===u.charAt(d);)d++;for(;"\0"===u.charAt(p-1);)p--;return u.slice(d,p).split("\0").map(s).join(c)}(e,He({delimiter:"."},t))}(e,He({delimiter:"-"},t))}function Ze(e){var t;let n=(null==e||null===(t=e.toString)||void 0===t?void 0:t.call(e))??"";return n=n.replace(/['\u2019]/,""),Ke(n,{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]})}ee([te,ie]);const qe=(e,t,n)=>{if(t){const n=null==e?void 0:e.find((e=>e.slug===t));if(n)return n}return{color:n}},Ye=(e,t)=>null==e?void 0:e.find((e=>e.color===t));function Qe(e,t){if(e&&t)return`has-${Ze(t)}-${e}`}const Xe=window.wp.deprecated;var Je=n.n(Xe),et=n(5893);const tt=(0,p.createContext)({});function nt({value:e,children:t}){const n=(0,p.useContext)(tt),o=(0,p.useMemo)((()=>({...n,...e})),[n,e]);return(0,et.jsx)(tt.Provider,{value:o,children:t})}tt.displayName="BlockContext";const ot=tt,it=window.wp.url;function lt(e){return(null==e?void 0:e.startsWith("#"))&&(0,it.isValidFragment)(e)}function rt(e){return(null==e?void 0:e.startsWith("/"))||(null==e?void 0:e.startsWith("./"))||(null==e?void 0:e.startsWith("../"))}function st(e){if(e.includes(" "))return!1;const t=(0,it.getProtocol)(e),n=(0,it.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.");return n||i||lt(e)||o||rt(e)}const at="__default",ct="core/pattern-overrides",ut={"core/paragraph":["content"],"core/heading":["content"],"core/image":["id","url","title","alt"],"core/button":["url","text","linkTarget","rel"]};function dt(e){var t;return(null==e||null===(t=e[at])||void 0===t?void 0:t.source)===ct}function pt(e,t){if(dt(e)){const t=ut[blockName],n={};for(const o of t){const t=e[o]?e[o]:{source:ct};n[o]=t}return n}return e}const ht=(0,p.createContext)({}),gt={},mt=(0,le.withFilters)("editor.BlockEdit")((e=>{const{name:t}=e,n=(0,d.getBlockType)(t);if(!n)return null;const o=n.edit||n.save;return(0,et.jsx)(o,{...e})})),ft=e=>{var t;const{name:n,clientId:o,attributes:i,setAttributes:l}=e,r=(0,h.useRegistry)(),s=(0,d.getBlockType)(n),a=(0,p.useContext)(ot),c=(0,h.useSelect)((e=>fe(e(d.store)).getAllBlockBindingsSources()),[]),{bindableAttributes:g}=(0,p.useContext)(ht),{blockBindings:m,context:f,hasPatternOverrides:v}=(0,p.useMemo)((()=>{var e,t,n;const o=null!=s&&s.usesContext?Object.fromEntries(Object.entries(a).filter((([e])=>s.usesContext.includes(e)))):gt;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=c[null==e?void 0:e.source])||void 0===t||null===(n=t.usesContext)||void 0===n||n.forEach((e=>{o[e]=a[e]}))})),{blockBindings:pt(null==i||null===(t=i.metadata)||void 0===t?void 0:t.bindings),context:o,hasPatternOverrides:dt(null==i||null===(n=i.metadata)||void 0===n?void 0:n.bindings)}}),[null==s?void 0:s.usesContext,a,null==i||null===(t=i.metadata)||void 0===t?void 0:t.bindings,g,c]),b=(0,h.useSelect)((e=>{if(!m)return i;const t={},n=new Map;for(const[e,t]of Object.entries(m)){const{source:o,args:i}=t,l=c[o];l&&null!=g&&g.includes(e)&&n.set(l,{...n.get(l),[e]:{args:i}})}if(n.size)for(const[i,l]of n){let n={};i.getValues?n=i.getValues({select:e,context:f,clientId:o,bindings:l}):Object.keys(l).forEach((e=>{n[e]=i.label}));for(const[e,o]of Object.entries(n))"url"!==e||o&&st(o)?t[e]=o:t[e]=null}return{...i,...t}}),[i,g,m,o,f,c]),k=(0,p.useCallback)((e=>{m?r.batch((()=>{const t={...e},n=new Map;for(const[e,o]of Object.entries(t)){if(!m[e]||null==g||!g.includes(e))continue;const i=m[e],l=c[null==i?void 0:i.source];null!=l&&l.setValues&&(n.set(l,{...n.get(l),[e]:{args:i.args,newValue:o}}),delete t[e])}if(n.size)for(const[e,t]of n)e.setValues({select:r.select,dispatch:r.dispatch,context:f,clientId:o,bindings:t});const i=!!f["pattern/overrides"];v&&i||!Object.keys(t).length||(v&&delete t.href,l(t))})):l(e)}),[g,m,o,f,v,l,c,r]);if(!s)return null;if(s.apiVersion>1)return(0,et.jsx)(mt,{...e,attributes:b,context:f,setAttributes:k});const _=(0,d.hasBlockSupport)(s,"className",!0)?(0,d.getBlockDefaultClassName)(n):null,y=u(_,null==i?void 0:i.className,e.className);return(0,et.jsx)(mt,{...e,attributes:b,className:y,context:f,setAttributes:k})},vt=window.wp.i18n;var bt=n(2991),kt=n.n(bt);function _t(e,t,n){return[...e.slice(0,n),...Array.isArray(t)?t:[t],...e.slice(n)]}function yt(e,t,n,o=1){const i=[...e];return i.splice(t,o),_t(i,e.slice(t,t+o),n)}const xt={insertUsage:{}},St={alignWide:!1,supportsLayout:!0,colors:[{name:(0,vt.__)("Black","kubio"),slug:"black",color:"#000000"},{name:(0,vt.__)("Cyan bluish gray","kubio"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,vt.__)("White","kubio"),slug:"white",color:"#ffffff"},{name:(0,vt.__)("Pale pink","kubio"),slug:"pale-pink",color:"#f78da7"},{name:(0,vt.__)("Vivid red","kubio"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,vt.__)("Luminous vivid orange","kubio"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,vt.__)("Luminous vivid amber","kubio"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,vt.__)("Light green cyan","kubio"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,vt.__)("Vivid green cyan","kubio"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,vt.__)("Pale cyan blue","kubio"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,vt.__)("Vivid cyan blue","kubio"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,vt.__)("Vivid purple","kubio"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,vt._x)("Small","font size name","kubio"),size:13,slug:"small"},{name:(0,vt._x)("Normal","font size name","kubio"),size:16,slug:"normal"},{name:(0,vt._x)("Medium","font size name","kubio"),size:20,slug:"medium"},{name:(0,vt._x)("Large","font size name","kubio"),size:36,slug:"large"},{name:(0,vt._x)("Huge","font size name","kubio"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,vt.__)("Thumbnail","kubio")},{slug:"medium",name:(0,vt.__)("Medium","kubio")},{slug:"large",name:(0,vt.__)("Large","kubio")},{slug:"full",name:(0,vt.__)("Original Size","kubio")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,canEditCSS:!1,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,vt.__)("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,vt.__)("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,vt.__)("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,vt.__)("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,vt.__)("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,vt.__)("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,vt.__)("Blush light purple","kubio"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,vt.__)("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,vt.__)("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,vt.__)("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,vt.__)("Electric grass","kubio"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,vt.__)("Midnight","kubio"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}},wt=Symbol("globalStylesDataKey"),Ct=Symbol("globalStylesLinks"),Bt=Symbol("selectBlockPatternsKey"),It=Symbol("reusableBlocksSelect"),jt=Symbol("sectionRootClientIdKey"),Et=Symbol("mediaEditKey"),Tt=Symbol("essentialFormat"),Pt=Symbol("getMediaSelect"),Mt=Symbol("isIsolatedEditor"),Rt=Symbol("deviceTypeKey"),Nt=Symbol("isNavigationOverlayContext");let Lt=!1;const At=(0,re.wpVersionCompare)("6.8",">=");if(d.privateApis){const e=fe(d.privateApis);Lt=null==e?void 0:e.blockPrivateApis}const Dt=e=>e;function Ot(e,t=""){const n=new Map,o=[];return n.set(t,o),e.forEach((e=>{const{clientId:t,innerBlocks:i}=e;o.push(t),Ot(i,t).forEach(((e,t)=>{n.set(t,e)}))})),n}function zt(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 Vt(e,t=Dt){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 Ft(e){return Vt(e,(e=>{const{attributes:t,...n}=e;return n}))}function Ht(e){return Vt(e,(e=>e.attributes))}function Gt(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 $t(e,t,n=!1){const o=e.tree,i=new Set([]),l=new Set;for(const o of t){let t=n?o:e.parents.get(o);do{if(e.controlledInnerBlocks[t]){l.add(t);break}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 l)o.set("controlled||"+t,{innerBlocks:(e.order.get(t)||[]).map((e=>o.get(e)))})}const Ut=(0,g.pipe)(h.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:l}=t.byClientId.get(i);"core/block"===l&&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),Gt(o,n.blocks),$t(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)}),$t(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)})})),$t(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)})),Gt(o,n.blocks),$t(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));$t(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)})),$t(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),$t(o,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=new Map(o.tree),$t(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})})),$t(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 l=i;if(n.blocks.length){l=e(l,{...n,type:"INSERT_BLOCKS",index:0});const i=new Map(l.order);Object.keys(o).forEach((e=>{t.order.get(e)&&i.set(e,t.order.get(e))})),l.order=i,l.tree=new Map(l.tree),Object.keys(o).forEach((e=>{const n=`controlled||${e}`;t.tree.has(n)&&l.tree.set(n,t.tree.get(n))}))}return l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:new Map(Ft(n.blocks)),attributes:new Map(Ht(n.blocks)),order:Ot(n.blocks),parents:new Map(zt(n.blocks)),controlledInnerBlocks:{}};return e.tree=new Map(null==t?void 0:t.tree),Gt(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,l)=>{let r,s=e(i,l);if("SET_EXPLICIT_PERSISTENT"===l.type&&(n=l.isPersistentChange,r=i.isPersistentChange??!0),void 0!==n)return r=n,r===s.isPersistentChange?s:{...s,isPersistentChange:r};const a="MARK_LAST_CHANGE_AS_PERSISTENT"===l.type||o;return i!==s||a?(s={...s,isPersistentChange:!a||!o},t=l,o="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===l.type,s):(o="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===l.type,r=(null==i?void 0:i.isPersistentChange)??!0,i.isPersistentChange===r?i:{...s,isPersistentChange:r})}}),(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 Ft(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)})),Ft(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 Ht(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 n=!1;const o=new Map(e);for(const i of t.clientIds){const l=Object.entries(t.uniqueByBlock?t.attributes[i]:t.attributes??{});if(0===l.length)continue;let r=!1;const s=e.get(i),a={};l.forEach((([e,t])=>{s[e]!==t&&(r=!0,a[e]=t)})),n=n||r,r&&o.set(i,{...s,...a})}return n?o: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)})),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},order(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{const n=Ot(t.blocks),o=new Map(e);return n.forEach(((e,t)=>{""!==t&&o.set(t,e)})),o.set("",(e.get("")??[]).concat(n[""])),o}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e.get(n)||[],i=Ot(t.blocks,n),{index:l=o.length}=t,r=new Map(e);return i.forEach(((e,t)=>{r.set(t,e)})),r.set(n,_t(o,i.get(n),l)),r}case"MOVE_BLOCKS_TO_POSITION":{var n;const{fromRootClientId:o="",toRootClientId:i="",clientIds:l}=t,{index:r=e.get(i).length}=t;if(o===i){const t=e.get(i).indexOf(l[0]),n=new Map(e);return n.set(i,yt(e.get(i),t,r,l.length)),n}const s=new Map(e);return s.set(o,(null===(n=e.get(o))||void 0===n?void 0:n.filter((e=>!l.includes(e))))??[]),s.set(i,_t(e.get(i),l,r)),s}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,i=n[0],l=e.get(o);if(!l.length||i===l[0])return e;const r=l.indexOf(i),s=new Map(e);return s.set(o,yt(l,r,r-1,n.length)),s}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,i=n[0],l=n[n.length-1],r=e.get(o);if(!r.length||l===r[r.length-1])return e;const s=r.indexOf(i),a=new Map(e);return a.set(o,yt(r,s,s+1,n.length)),a}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=Ot(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 l=Object.values(e).reduce(((e,t)=>t===n[0]?[...e,...o.get("")]:(-1===n.indexOf(t)&&e.push(t),e)),[]);i.set(t,l)})),i}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n.forEach(((e,o)=>{const i=(null==e?void 0:e.filter((e=>!t.removedClientIds.includes(e))))??[];i.length!==e.length&&n.set(o,i)})),n}}return e},parents(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{const n=new Map(e);return zt(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"INSERT_BLOCKS":{const n=new Map(e);return zt(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)})),zt(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 Wt(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,h.combineReducers)({blocks:Ut,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,l;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:r,selectionEnd:s}=t;return{selectionStart:r,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===(l=e.selectionEnd)||void 0===l?void 0:l.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 r=Wt(e.selectionStart,t),s=Wt(e.selectionEnd,t);return r===e.selectionStart&&s===e.selectionEnd?e:{selectionStart:r,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":{const n=new Set,o=[...t.blocks];for(;o.length;){const e=o.shift();n.add(e.clientId),o.push(...e.innerBlocks)}return Object.fromEntries(Object.entries(e).filter((([e])=>!t.clientIds.includes(e)||n.has(e))))}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]?kt()(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:l,nearestSide:r,kubioInsertionEdge:s}=t,a={rootClientId:n,index:o,__unstableWithInserter:i,operation:l,nearestSide:r,kubioInsertionEdge:s};return kt()(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=St,t){if("UPDATE_SETTINGS"===t.type){const n=t.reset?{...St,...t.settings}:{...e,...t.settings};return Object.defineProperty(n,"__unstableIsPreviewMode",{get(){return Je()("__unstableIsPreviewMode",{since:"6.8",alternative:"isPreviewMode"}),this.isPreviewMode}}),n}return e},preferences:function(e=xt,t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:i}=n;let l=i;const r=(0,h.select)(d.store).getActiveBlockVariation(i,o);return null!=r&&r.name&&(l+="/"+r.name),"core/block"===i&&(l+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[l]:{time:t.time,count:e.insertUsage[l]?e.insertUsage[l].count+1:1}}}}),e)}return e},lastBlockAttributesChange:function(e=null,t){switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return e},lastFocus:function(e=!1,t){return"LAST_FOCUS"===t.type?t.lastFocus:e},editorMode:function(e="edit",t){return"INSERT_BLOCKS"===t.type&&"navigation"===e?"edit":"SET_EDITOR_MODE"===t.type?t.mode:e},hasBlockMovingClientId:function(e=null,t){return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_EDITOR_MODE"===t.type?null:e},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(e={},t){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},editedContentOnlySection:function(e,t){return"EDIT_CONTENT_ONLY_SECTION"===t.type?t.clientId:e},blockVisibility:function(e={},t){return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e},viewportModalClientIds:function(e=null,t){switch(t.type){case"SHOW_VIEWPORT_MODAL":return t.clientIds;case"HIDE_VIEWPORT_MODAL":return null}return 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){return"SET_OPENED_BLOCK_SETTINGS_MENU"===t.type?(null==t?void 0:t.clientId)??null:e},hoveredBlockClientId:function(e=!1,t){return"HOVER_BLOCK"===t.type?t.clientId:e},hasBlockSpotlight:function(e,t){var n,o;switch(t.type){case"TOGGLE_BLOCK_SPOTLIGHT":const{clientId:i,hasBlockSpotlight:l}=t;return l?i:e===i?null:e;case"SELECT_BLOCK":return t.clientId!==e?null:e;case"SELECTION_CHANGE":return(null===(n=t.start)||void 0===n?void 0:n.clientId)!==e||(null===(o=t.end)||void 0===o?void 0:o.clientId)!==e?null:e;case"CLEAR_SELECTED_BLOCK":return null}return 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,ce.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},openedListViewPanels:function(e={allOpen:!1,panels:{}},t){switch(t.type){case"SET_OPEN_LIST_VIEW_PANEL":return{allOpen:!1,panels:t.clientId?{[t.clientId]:!0}:{}};case"SET_ALL_LIST_VIEW_PANELS_OPEN":return{allOpen:!0,panels:{}};case"TOGGLE_LIST_VIEW_PANEL":return{allOpen:!1,panels:{...e.panels,[t.clientId]:t.isOpen}};case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":{if(!t.clientIds||0===t.clientIds.length)return e;const n={...e.panels};let o=!1;return t.clientIds.forEach((e=>{e in n&&(delete n[e],o=!0)})),o?{...e,panels:n}:e}case"RESET_BLOCKS":return{allOpen:!1,panels:{}}}return e},listViewExpandRevision:function(e=0,t){return"INCREMENT_LIST_VIEW_EXPAND_REVISION"===t.type?e+1:e},listViewContentPanelOpen:function(e=!1,t){switch(t.type){case"OPEN_LIST_VIEW_CONTENT_PANEL":return!0;case"CLOSE_LIST_VIEW_CONTENT_PANEL":case"CLEAR_SELECTED_BLOCK":return!1}return e},requestedInspectorTab:function(e=null,t){switch(t.type){case"REQUEST_INSPECTOR_TAB":return{tabName:t.tabName,options:t.options};case"CLEAR_REQUESTED_INSPECTOR_TAB":return null}return e}});function Zt(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 qt(e,t,n){var o;const i=Zt(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)qt(e,t.clientId,n)}function Yt(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 Qt(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 Xt(e,t=!1,n=""){var o;const i=(null==e?void 0:e.zoomLevel)<100||"auto-scaled"===(null==e?void 0:e.zoomLevel),l=new Map,r=null===(o=e.settings)||void 0===o?void 0:o[jt],s=e.blocks.order.get(r),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)})),qt(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&&(l.has(n)?t=l.get(n):e.blockEditingModes.has(n)&&(t=e.blockEditingModes.get(n)),!t);)n=e.blocks.parents.get(n);if("disabled"===t)return void l.set(o,"disabled")}if(i||t){if(o===r)return void l.set(o,"contentOnly");if(null==s||!s.length)return void l.set(o,"disabled");if(s.includes(o))return void l.set(o,"contentOnly");if(i)return void l.set(o,"disabled");if(!Yt(e,o,s)){if(""===o)return void l.set(o,"disabled");if("core/template-part"===d)return void l.set(o,"contentOnly");if(!Yt(e,o,c)&&!Lt(d)&&At)return void l.set(o,"disabled")}if(u.length){const t=Yt(e,o,u);if(t)return Yt(e,t,u)?void l.set(o,"disabled"):Qt(n)?void l.set(o,"contentOnly"):void l.set(o,"disabled")}return d&&Lt(d)&&At?void l.set(o,"contentOnly"):void l.set(o,"disabled")}if(u.length){if(u.includes(o))return Yt(e,o,u)?void l.set(o,"disabled"):void 0;const t=Yt(e,o,u);if(t){if(Yt(e,t,u))return void l.set(o,"disabled");if(Qt(n))return void l.set(o,"contentOnly");l.set(o,"disabled")}}}})),l}function Jt({prevState:e,nextState:t,addedBlocks:n,removedClientIds:o,isNavMode:i=!1}){const l=i?e.derivedNavModeBlockEditingModes:e.derivedBlockEditingModes;let r;return null==o||o.forEach((t=>{qt(e,t,(e=>{l.has(e.clientId)&&(r||(r=new Map(l)),r.delete(e.clientId))}))})),null==n||n.forEach((e=>{qt(t,e.clientId,(e=>{const n=Xt(t,i,e.clientId);var o;n.size&&(r=r?new Map([...null!==(o=r)&&void 0!==o&&o.size?r:[],...n]):new Map([...null!=l&&l.size?l:[],...n]))}))})),r}const en=(0,g.pipe)((function(e){return(t,n)=>{const o=e(t,n);if("SET_EDITOR_MODE"!==n.type&&o===t)return t;switch(n.type){case"REMOVE_BLOCKS":{const e=Jt({prevState:t,nextState:o,removedClientIds:n.clientIds,isNavMode:!1}),i=Jt({prevState:t,nextState:o,removedClientIds:n.clientIds,isNavMode:!0});if(e||i)return{...o,derivedBlockEditingModes:e??t.derivedBlockEditingModes,derivedNavModeBlockEditingModes:i??t.derivedNavModeBlockEditingModes};break}case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=Jt({prevState:t,nextState:o,addedBlocks:n.blocks,isNavMode:!1}),i=Jt({prevState:t,nextState:o,addedBlocks:n.blocks,isNavMode:!0});if(e||i)return{...o,derivedBlockEditingModes:e??t.derivedBlockEditingModes,derivedNavModeBlockEditingModes:i??t.derivedNavModeBlockEditingModes};break}case"SET_BLOCK_EDITING_MODE":case"UNSET_BLOCK_EDITING_MODE":case"SET_HAS_CONTROLLED_INNER_BLOCKS":{const e=Zt(o,n.clientId);if(!e)break;const i=Jt({prevState:t,nextState:o,removedClientIds:[n.clientId],addedBlocks:[e],isNavMode:!1}),l=Jt({prevState:t,nextState:o,removedClientIds:[n.clientId],addedBlocks:[e],isNavMode:!0});if(i||l)return{...o,derivedBlockEditingModes:i??t.derivedBlockEditingModes,derivedNavModeBlockEditingModes:l??t.derivedNavModeBlockEditingModes};break}case"REPLACE_BLOCKS":{const e=Jt({prevState:t,nextState:o,addedBlocks:n.blocks,removedClientIds:n.clientIds,isNavMode:!1}),i=Jt({prevState:t,nextState:o,addedBlocks:n.blocks,removedClientIds:n.clientIds,isNavMode:!0});if(e||i)return{...o,derivedBlockEditingModes:e??t.derivedBlockEditingModes,derivedNavModeBlockEditingModes:i??t.derivedNavModeBlockEditingModes};break}case"REPLACE_INNER_BLOCKS":{const e=t.blocks.order.get(n.rootClientId),i=Jt({prevState:t,nextState:o,addedBlocks:n.blocks,removedClientIds:e,isNavMode:!1}),l=Jt({prevState:t,nextState:o,addedBlocks:n.blocks,removedClientIds:e,isNavMode:!0});if(i||l)return{...o,derivedBlockEditingModes:i??t.derivedBlockEditingModes,derivedNavModeBlockEditingModes:l??t.derivedNavModeBlockEditingModes};break}case"MOVE_BLOCKS_TO_POSITION":{const e=n.clientIds.map((e=>o.blocks.byClientId.get(e))),i=Jt({prevState:t,nextState:o,addedBlocks:e,removedClientIds:n.clientIds,isNavMode:!1}),l=Jt({prevState:t,nextState:o,addedBlocks:e,removedClientIds:n.clientIds,isNavMode:!0});if(i||l)return{...o,derivedBlockEditingModes:i??t.derivedBlockEditingModes,derivedNavModeBlockEditingModes:l??t.derivedNavModeBlockEditingModes};break}case"UPDATE_SETTINGS":var i,l;if((null==t||null===(i=t.settings)||void 0===i?void 0:i[jt])!==(null==o||null===(l=o.settings)||void 0===l?void 0:l[jt]))return{...o,derivedBlockEditingModes:Xt(o,!1),derivedNavModeBlockEditingModes:Xt(o,!0)};break;case"RESET_BLOCKS":case"EDIT_CONTENT_ONLY_SECTION":case"SET_EDITOR_MODE":case"RESET_ZOOM_LEVEL":case"SET_ZOOM_LEVEL":return{...o,derivedBlockEditingModes:Xt(o,!1),derivedNavModeBlockEditingModes:Xt(o,!0)}}return o.derivedBlockEditingModes=(null==t?void 0:t.derivedBlockEditingModes)??new Map,o.derivedNavModeBlockEditingModes=(null==t?void 0:t.derivedNavModeBlockEditingModes)??new Map,o}}),(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 tn,nn;function on(e){return[e]}function ln(){var e={clear:function(){e.head=null}};return e}function rn(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 sn(e,t){var n,o;function i(){n=nn?new WeakMap:ln()}function l(){var n,i,l,r,s,a=arguments.length;for(r=new Array(a),l=0;l<a;l++)r[l]=arguments[l];for(s=t.apply(null,r),(n=o(s)).isUniqueByDependants||(n.lastDependants&&!rn(s,n.lastDependants,0)&&n.clear(),n.lastDependants=s),i=n.head;i;){if(rn(i.args,r,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,r)},r[0]=null,i.args=r,n.head&&(n.head.prev=i,i.next=n.head),n.head=i,i.val}return t||(t=on),o=nn?function(e){var t,o,i,l,r,s=n,a=!0;for(t=0;t<e.length;t++){if(!(r=o=e[t])||"object"!=typeof r){a=!1;break}s.has(o)?s=s.get(o):(i=new WeakMap,s.set(o,i),s=i)}return s.has(tn)||((l=ln()).isUniqueByDependants=a,s.set(tn,l)),s.get(tn)}:function(){return n},l.getDependants=t,l.clear=i,i(),l}tn={},nn="undefined"!=typeof WeakMap;const an=window.wp.primitives;var cn=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})});const un=window.wp.richText;function dn(e,t,n="asc"){return e.concat().sort(((e,t,n)=>(o,i)=>{let l,r;if("function"==typeof e?(l=e(o),r=e(i)):(l=o[e],r=i[e]),l>r)return"asc"===n?1:-1;if(r>l)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 pn="core/block-editor",hn=window.wp.blockSerializationDefaultParser,gn="user";(0,vt.__)("All","kubio"),(0,vt.__)("My patterns","kubio");var mn=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"})}),fn=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M17 4H7c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12zm-7.5-.5h4V16h-4v1.5z"})}),vn=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z"})});const bn={desktop:{label:(0,vt.__)("Desktop"),icon:mn,key:"desktop"},tablet:{label:(0,vt.__)("Tablet"),icon:fn,key:"tablet"},mobile:{label:(0,vt.__)("Mobile"),icon:vn,key:"mobile"}},kn=(Object.entries(bn),window.kubio.constants);function yn(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 xn=(e,t,n)=>{const o=Array.isArray(t)?t:t.split(".");let i=e;return o.forEach((e=>{var t;i=null===(t=i)||void 0===t?void 0:t[e]})),i??n},Sn=["color","border","dimensions","typography","spacing"],wn={"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},Cn={"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"},Bn=e=>Cn[e]||e;function In(e,t,...n){const o=Ko(e,t),i=[];if(t){let n=t;do{const t=Ko(e,n);(0,d.hasBlockSupport)(t,"__experimentalSettings",!1)&&i.push(n)}while(n=e.blocks.parents.get(n))}return n.map((n=>{var l;if(Sn.includes(n))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let r=(0,m.applyFilters)("blockEditor.useSetting.before",void 0,n,t,o);if(void 0!==r)return r;const s=Bn(n);for(const t of i){var a,c;const n=qo(e,t);if(r=xn(null===(a=n.settings)||void 0===a||null===(c=a.blocks)||void 0===c?void 0:c[o],s)??xn(n.settings,s),void 0!==r)break}const u=Fl(e);var d,p;if(void 0===r&&o&&(r=xn(null===(d=u.__experimentalFeatures)||void 0===d||null===(p=d.blocks)||void 0===p?void 0:p[o],s)),void 0===r&&(r=xn(u.__experimentalFeatures,s)),void 0!==r)return kn.__EXPERIMENTAL_PATHS_WITH_OVERRIDE[s]?r.custom??r.theme??r.default:r;const h=null===(l=wn[s])||void 0===l?void 0:l.call(wn,u);return void 0!==h?h:"typography.dropCap"===s||void 0}))}const jn=h.createSelector?h.createSelector:sn;function En(e){return e.isBlockInterfaceHidden}function Tn(e){var t;return null==e||null===(t=e.lastBlockInserted)||void 0===t?void 0:t.clientIds}function Pn(e,t){return e.blocks.byClientId.get(t)}const Mn=(e,t)=>{const n=t=>"disabled"===ur(e,t)&&Fi(e,t).every(n);return Fi(e,t).every(n)};function Rn(e,t,n){return!1}function Nn(e,t){const n=Fi(e,t),o=[];for(const t of n){const n=Nn(e,t);"disabled"!==ur(e,t)?o.push({clientId:t,innerBlocks:n}):o.push(...n)}return o}const Ln=(0,h.createRegistrySelector)((e=>jn(Nn,(t=>[t.blocks.order,t.derivedBlockEditingModes,t.derivedNavModeBlockEditingModes,t.blockEditingModes,t.settings.templateLock,t.blockListSettings,e(pn).__unstableGetEditorMode(t)])))),An=jn(((e,t,n=!1)=>bi(e,t,n).filter((t=>"disabled"!==ur(e,t)))),(e=>[e.blocks.parents,e.blockEditingModes,e.settings.templateLock,e.blockListSettings]));function Dn(e){return e.removalPromptData}function On(e){return e.blockRemovalRules}function zn(e){return e.openedBlockSettingsMenu}const Vn=jn((e=>{const t=ni(e).reduce(((e,t,n)=>(e[t]=n,e)),{});return[...e.styleOverrides].sort(((e,n)=>{const[,{clientId:o}]=e,[,{clientId:i}]=n;return(t[o]??-1)-(t[i]??-1)}))}),(e=>[e.blocks.order,e.styleOverrides]));function Fn(e){return e.registeredInserterMediaCategories}const Hn=jn((e=>{const{settings:{inserterMediaCategories:t,allowedMimeTypes:n,enableOpenverseMediaCategory:o},registeredInserterMediaCategories:i}=e;if(!t&&!i.length||!n)return;const l=(null==t?void 0:t.map((({name:e})=>e)))||[];return[...t||[],...(i||[]).filter((({name:e})=>!l.includes(e)))].filter((e=>!(!o&&"openverse"===e.name)&&Object.values(n).some((t=>t.startsWith(`${e.mediaType}/`)))))}),(e=>[e.settings.inserterMediaCategories,e.settings.allowedMimeTypes,e.settings.enableOpenverseMediaCategory,e.registeredInserterMediaCategories])),Gn=(0,h.createRegistrySelector)((e=>jn(((t,n=null)=>{const{getAllPatterns:o,__experimentalGetParsedPattern:i}=fe(e(pn)),l=o(),{allowedBlockTypes:r}=Fl(t);return l.some((({name:e,inserter:o=!0})=>{if(!o)return!1;const{blocks:l}=i(e);return Oo(l,r)&&l.every((({name:e})=>ul(t,e,n)))}))}),((t,n)=>[...zo(e)(t),...Vo(e)(t,n)]))));function $n(e,t=[]){var n;return{name:`core/block/${e.id}`,id:e.id,type:gn,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 Un=(0,h.createRegistrySelector)((e=>jn(((t,n)=>{var o,i;if(null!=n&&n.startsWith("core/block/")){const o=parseInt(n.slice(11),10),i=fe(e(pn)).getReusableBlocks().find((({id:e})=>e===o));return i?$n(i,t.settings.__experimentalUserPatternCategories):null}return[...t.settings.__experimentalBlockPatterns??[],...(null===(o=(i=t.settings)[Bt])||void 0===o?void 0:o.call(i,e))??[]].find((({name:e})=>e===n))}),((t,n)=>{var o,i;return null!=n&&n.startsWith("core/block/")?[fe(e(pn)).getReusableBlocks(),t.settings.__experimentalReusableBlocks]:[t.settings.__experimentalBlockPatterns,null===(o=(i=t.settings)[Bt])||void 0===o?void 0:o.call(i,e)]})))),Wn=(0,h.createRegistrySelector)((e=>jn((t=>{var n,o;return[...fe(e(pn)).getReusableBlocks().map((e=>$n(e,t.settings.__experimentalUserPatternCategories))),...t.settings.__experimentalBlockPatterns??[],...(null===(n=(o=t.settings)[Bt])||void 0===n?void 0:n.call(o,e))??[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name))))}),zo(e)))),Kn=(0,h.createRegistrySelector)((e=>jn((t=>{const n=t.settings[Bt],o=t.settings[It];return!!n&&void 0===n(e)||!!o&&void 0===o(e)}),zo(e)))),Zn=[],qn=(0,h.createRegistrySelector)((e=>t=>{const n=t.settings[It];return n?n(e):t.settings.__experimentalReusableBlocks??Zn}));function Yn(e){return e.lastFocus}function Qn(e){return e.blockBindingsSources}function Xn(e,t){return e.blockBindingsSources[t]}function Jn(e){return e.isDragging}function eo(e){return e.expandedBlock}const to=(e,t)=>{let n,o=t;for(;!n&&(o=e.blocks.parents.get(o));)"contentOnly"===sl(e,o)&&(n=o);return n};function no(e,t){var n,o,i;const l=Ko(e,t);if("core/block"===l)return!0;const r=qo(e,t),s="core/template-part"===l,a=null===(n=e.settings)||void 0===n?void 0:n[Mt];if((!(null===(o=e.settings)||void 0===o?void 0:o.disableContentOnlyForUnsyncedPatterns)&&null!=r&&null!==(i=r.metadata)&&void 0!==i&&i.patternName||s)&&!a)return!0;const c="contentOnly"===sl(e,t),u="contentOnly"===sl(e,vi(e,t));return!(!c||u)}const oo=(e,t)=>{if(ao(e,t))return;let n,o=t;for(;o=e.blocks.parents.get(o);)no(e,o)&&(n=o);return n};function io(e,t){return!ao(e,t)&&!oo(e,t)&&no(e,t)}function lo(e){return e.temporarilyEditingAsBlocks}function ro(e){return e.temporarilyEditingFocusModeRevert}function so(e){return e.editedContentOnlySection}function ao(e,t){if(!e.editedContentOnlySection)return!1;if(e.editedContentOnlySection===t)return!0;let n=t;for(;n=e.blocks.parents.get(n);)if(e.editedContentOnlySection===n)return!0;return!1}const co=jn(((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 uo(e){var t;return null===(t=e.settings)||void 0===t?void 0:t[jt]}function po(e){return"auto-scaled"===e.zoomLevel||e.zoomLevel<100}function ho(e){return e.zoomLevel}function go(e,t,n=""){const o=Array.isArray(t)?t:[t],i=t=>o.every((n=>ul(e,n,t)));if(!n){if(i(n))return n;const t=uo(e);return t&&i(t)?t:null}let l=n;for(;null!==l&&!i(l);)l=vi(e,l);return l}function mo(e,t,n){const{allowedBlockTypes:o}=Fl(e);return Oo(Ao(t),o)?go(e,Ao(t).map((({blockName:e})=>e)),n):null}function fo(e){return e.insertionPoint}const vo=(e,t)=>{var n;const o=Ko(e,t);if(!(0,d.hasBlockSupport)(e,o,"blockVisibility",!0))return!1;const i=e.blocks.attributes.get(t);return!1===(null==i||null===(n=i.metadata)||void 0===n?void 0:n.blockVisibility)},bo=(e,t)=>{var n;const o=Ko(e,t);if(!(0,d.hasBlockSupport)(o,"visibility",!0))return!1;const i=e.blocks.attributes.get(t),l=null==i||null===(n=i.metadata)||void 0===n?void 0:n.blockVisibility;return!1===l||"object"==typeof(null==l?void 0:l.viewport)&&null!==(null==l?void 0:l.viewport)&&Object.values(bn).some((e=>{var t;return!1===(null==l||null===(t=l.viewport)||void 0===t?void 0:t[e.key])}))},ko=(e,t)=>{var n;const o=Ko(e,t);if(!(0,d.hasBlockSupport)(o,"visibility",!0))return!1;const i=e.blocks.attributes.get(t);return!1===(null==i||null===(n=i.metadata)||void 0===n?void 0:n.blockVisibility)},_o=(e,t)=>bi(e,t).some((t=>ko(e,t))),yo=(e,t,n)=>{var o,i;if(ko(e,t))return!0;const l=e.blocks.attributes.get(t),r=null==l||null===(o=l.metadata)||void 0===o||null===(i=o.blockVisibility)||void 0===i?void 0:i.viewport;return"object"==typeof r&&null!==r&&"string"==typeof n&&!1===(null==r?void 0:r[n.toLowerCase()])},xo=(e,t,n)=>bi(e,t).some((t=>yo(e,t,n)));function So(e){return!!e.hasBlockSpotlight||!!e.editedContentOnlySection}function wo(e,t){var n;const o=qo(e,t);return!(null==o||null===(n=o.lock)||void 0===n||!n.edit)}function Co(e,t){var n;const o=qo(e,t);var i;return void 0!==(null==o||null===(n=o.lock)||void 0===n?void 0:n.move)?!(null==o||null===(i=o.lock)||void 0===i||!i.move):"all"===sl(e,vi(e,t))}function Bo(e,t){var n;const o=qo(e,t);var i;if(void 0!==(null==o||null===(n=o.lock)||void 0===n?void 0:n.remove))return!(null==o||null===(i=o.lock)||void 0===i||!i.remove);const l=sl(e,vi(e,t));return"all"===l||"insert"===l}function Io(e,t){return wo(e,t)||Co(e,t)||Bo(e,t)}function jo(e){return e.listViewContentPanelOpen}function Eo(e,t){var n,o,i;return!(null===(n=e.openedListViewPanels)||void 0===n||!n.allOpen)||!0===(null===(o=e.openedListViewPanels)||void 0===o||null===(i=o.panels)||void 0===i?void 0:i[t])}function To(e){return e.listViewExpandRevision||0}function Po(e){return e.viewportModalClientIds}function Mo(e){return e.requestedInspectorTab}Symbol("withRootClientId");const Ro=Symbol("isFiltered"),No=new WeakMap,Lo=new WeakMap;function Ao(e){const t=Lo.get(e);if(!t){let t=[];t=e.isGutentagPattern?null!=e&&e.isProOnFree?[]:[(0,re.transformTemplateToBlock)(e.content)]:(0,hn.parse)(e.content),t=t.filter((e=>null!==e.blockName)),Lo.set(e,t)}return t}const Do=(e,t,n=null)=>"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n,Oo=(e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!Do(t,e.name||e.blockName,!0))return!1;null===(o=e.innerBlocks)||void 0===o||o.forEach((e=>{n.push(e)}))}return!0},zo=e=>t=>{var n,o;return[t.settings.__experimentalBlockPatterns,t.settings.__experimentalUserPatternCategories,t.settings.__experimentalReusableBlocks,null===(n=(o=t.settings)[Bt])||void 0===n?void 0:n.call(o,e),t.blockPatterns,fe(e(pn)).getReusableBlocks()]},Vo=e=>(t,n)=>[t.blockListSettings[n],t.blocks.byClientId.get(n),t.blocks.order.get(n||""),t.settings.allowedBlockTypes,t.settings.templateLock,t.blockEditingModes,e(pn).__unstableGetEditorMode(t),uo(t)],Fo=window.wp.preferences,Ho=[],Go=new Set,$o={[Ro]:!0},Uo={move:!0,remove:!0},Wo=["core/post-content","kubio/header","kubio/footer","kubio/query-layout","kubio/menu-offscreen","kubio/menu-offscreen-content"];function Ko(e,t){const n=e.blocks.byClientId.get(t),o="core/social-link";if("web"!==p.Platform.OS&&(null==n?void 0:n.name)===o){const n=e.blocks.attributes.get(t),{service:i}=n??{};return i?`${o}-${i}`:o}return n?n.name:null}function Zo(e,t){const n=e.blocks.byClientId.get(t);return!!n&&n.isValid}const qo=(0,h.createRegistrySelector)((e=>(t,n)=>{const o=t.blocks.byClientId.get(n);if(!o)return null;const i=t.blocks.attributes.get(n),l=Ko(t,n),r=(0,m.applyFilters)("kubio.default_locked_blocks",Wo),s=(0,m.applyFilters)("kubio.is_block_locked",!1,o,e);return s?(0,ce.isObject)(s)?i.lock=s:i.lock=Uo:r.includes(l)&&(i.lock=i.lock||Uo),i}));function Yo(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}const Qo=sn(((e,t)=>{const n=e.blocks.byClientId.get(t);return n?{...n,attributes:qo(e,t)}:null}),((e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]));function Xo(e,t){var n;if(!(0,ce.isEmpty)(t)&&(0,ce.isEmpty)(e.blocks.order.get(t)))return Ho;const o=t&&Jl(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree.get(o))||void 0===n?void 0:n.innerBlocks)||Ho}const Jo=sn(((e,t)=>(Je()("wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree",{since:"6.3",version:"6.5"}),{clientId:t,innerBlocks:ei(e,t)})),(e=>[e.blocks.order])),ei=sn(((e,t="")=>(Je()("wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree",{since:"6.3",version:"6.5"}),Fi(e,t).map((t=>Jo(e,t))))),(e=>[e.blocks.order])),ti=sn(((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])),ni=e=>ti(e,""),oi=sn(((e,t)=>{const n=ni(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])),ii=sn(((e,t)=>{if(!t)return Ho;const n=Array.isArray(t)?t:[t],o=ni(e).filter((t=>{const o=e.blocks.byClientId.get(t);return n.includes(o.name)}));return o.length>0?o:Ho}),(e=>[e.blocks.order,e.blocks.byClientId]));function li(e,t){return Je()("wp.data.select( 'core/block-editor' ).__experimentalGetGlobalBlocksByName",{since:"6.5",alternative:"wp.data.select( 'core/block-editor' ).getBlocksByName"}),ii(e,t)}const ri=sn(((e,t)=>(Array.isArray(t)?t:[t]).map((t=>Yo(e,t)))),((e,t)=>(Array.isArray(t)?t:[t]).map((t=>e.blocks.tree.get(t))))),si=sn(((e,t)=>ri(e,t).filter(Boolean).map((e=>e.name))),((e,t)=>ri(e,t)));function ai(e,t){return Fi(e,t).length}function ci(e){return e.selection.selectionStart}function ui(e){return e.selection.selectionEnd}function di(e){const t=e.selection.selectionStart.clientId;return e.blocks.byClientId.get(t)?t:null}function pi(e){const t=e.selection.selectionEnd.clientId;return e.blocks.byClientId.get(t)?t:null}function hi(e){return Ii(e).length||(e.selection.selectionStart.clientId?1:0)}function gi(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function mi(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId&&e.blocks.byClientId.get(o)?o:null}function fi(e){const t=mi(e);return t?Yo(e,t):null}function vi(e,t){return e.blocks.parents.get(t)??null}const bi=sn(((e,t,n=!1)=>{const o=[];let i=(0,ce.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():Ho}),(e=>[e.blocks.parents])),ki=sn(((e,t,n,o=!1)=>{const i=bi(e,t,o),l=Array.isArray(n)?e=>n.includes(e):e=>n===e;return i.filter((t=>l(Ko(e,t))))}),(e=>[e.blocks.parents]));function _i(e,t){let n,o=t;do{n=o,o=e.blocks.parents.get(o)}while(o);return n}function yi(e,t){const n=mi(e),o=[...bi(e,t),t],i=[...bi(e,n),n];let l;const r=Math.min(o.length,i.length);for(let e=0;e<r&&o[e]===i[e];e++)l=o[e];return l}function xi(e,t,n=1){if(void 0===t&&(t=mi(e)),void 0===t&&(t=n<0?Ei(e):Ti(e)),!t)return null;const o=vi(e,t);if(null===o)return null;const{order:i}=e.blocks,l=i.get(o),r=l.indexOf(t)+1*n;return r<0||r===l.length?null:l[r]}function Si(e,t){return xi(e,t,-1)}function wi(e,t){return xi(e,t,1)}function Ci(e){return e.initialPosition}const Bi=sn((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return Ho;if(t.clientId===n.clientId)return[t.clientId];const o=vi(e,t.clientId);if(null===o)return Ho;const i=Fi(e,o),l=i.indexOf(t.clientId),r=i.indexOf(n.clientId);return l>r?i.slice(r,l+1):i.slice(l,r+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Ii(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?Ho:Bi(e)}const ji=sn((()=>[]),(()=>[]));function Ei(e){return Ii(e)[0]||null}function Ti(e){const t=Ii(e);return t[t.length-1]||null}function Pi(e,t){return Ei(e)===t}function Mi(e,t){return-1!==Ii(e).indexOf(t)}const Ri=sn(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=vi(e,n),o=Mi(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Ni(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Li(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Ai(e){const t=ci(e),n=ui(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Di(e){const t=ci(e),n=ui(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Oi(e){return Bi(e).some((t=>{const n=Ko(e,t);return!(0,d.getBlockType)(n).merge}))}function zi(e,t){const n=ci(e),o=ui(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=vi(e,n.clientId);if(i!==vi(e,o.clientId))return!1;const l=Fi(e,i);let r,s;l.indexOf(n.clientId)>l.indexOf(o.clientId)?(r=o,s=n):(r=n,s=o);const a=t?s.clientId:r.clientId,c=t?r.clientId:s.clientId,u=Ko(e,a);if(!(0,d.getBlockType)(u).merge)return!1;const p=Yo(e,c);if(p.name===u)return!0;const h=(0,d.switchToBlockType)(p,u);return h&&h.length}const Vi=e=>{const t=ci(e),n=ui(e);if(t.clientId===n.clientId)return Ho;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return Ho;const o=vi(e,t.clientId);if(o!==vi(e,n.clientId))return Ho;const i=Fi(e,o),l=i.indexOf(t.clientId),r=i.indexOf(n.clientId),[s,a]=l>r?[n,t]:[t,n],c=Yo(e,s.clientId),u=Yo(e,a.clientId),d=c.attributes[s.attributeKey],p=u.attributes[a.attributeKey];let h=(0,un.create)({html:d}),g=(0,un.create)({html:p});return h=(0,un.remove)(h,0,s.offset),g=(0,un.remove)(g,a.offset,g.text.length),[{...c,attributes:{...c.attributes,[s.attributeKey]:(0,un.toHTMLString)({value:h})}},{...u,attributes:{...u.attributes,[a.attributeKey]:(0,un.toHTMLString)({value:g})}}]};function Fi(e,t){return e.blocks.order.get(t||"")||Ho}function Hi(e,t){return Fi(e,vi(e,t)).indexOf(t)}function Gi(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function $i(e,t,n=!1){const o=Bi(e);return!!o.length&&(n?o.some((n=>bi(e,n,!0).includes(t))):o.some((n=>vi(e,n)===t)))}function Ui(e,t,n=!1){return Fi(e,t).some((t=>el(e,t)||n&&Ui(e,t,n)))}function Wi(e,t){if(!t)return!1;const n=Ii(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Ki(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Zi(e){return e.isMultiSelecting}function qi(e){return e.isSelectionEnabled}function Yi(e,t){return e.blocksMode[t]||"visual"}function Qi(e){return e.isTyping}function Xi(e){return!!e.draggedBlocks.length}function Ji(e){return e.draggedBlocks}function el(e,t){return e.draggedBlocks.includes(t)}function tl(e,t){return!!Xi(e)&&bi(e,t).some((t=>el(e,t)))}function nl(){return Je()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}const ol=sn((e=>{let t,n;const{insertionCue:o,selection:{selectionEnd:i}}=e;if(null!==o)return o;const{clientId:l}=i;return l?(t=vi(e,l)||void 0,n=Hi(e,i.clientId)+1):n=Fi(e).length,{rootClientId:t,index:n}}),(e=>[e.insertionCue,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]));function il(e){return null!==e.insertionCue}function ll(e){return e.template.isValid}function rl(e){return e.settings.template}function sl(e,t){var n;return t?(null===(n=Vl(e,t))||void 0===n?void 0:n.templateLock)??!1:e.settings.templateLock??!1}const al=(e,t,n=null)=>{let o,i;if(t&&"object"==typeof t?(o=t,i=t.name):(o=(0,d.getBlockType)(t),i=t),!o)return!1;const{allowedBlockTypes:l}=Fl(e);if(!Do(l,i,!0))return!1;const r=(Array.isArray(o.parent)?o.parent:[]).concat(Array.isArray(o.ancestor)?o.ancestor:[]);if(r.length>0){if(r.includes("core/post-content"))return!0;let t=n,o=!1;do{if(r.includes(Ko(e,t))){o=!0;break}t=e.blocks.parents.get(t)}while(t);return o}return!0},cl=(e,t,n=null)=>{if(!al(e,t,n))return!1;let o;if(t&&"object"==typeof t?(o=t,t=o.name):o=(0,d.getBlockType)(t),sl(e,n))return!1;if(io(e,n))return!1;if("disabled"===ur(e,n??""))return!1;const i=Vl(e,n);if(n&&void 0===i)return!1;const l=Ko(e,n),r=(0,d.getBlockType)(l),s=null==r?void 0:r.allowedBlocks,a=Do(s,t),c=o.parent,u=Do(c,l);let p=!0;const h=o.ancestor;h&&(p=[n,...bi(e,n)].some((t=>Do(h,Ko(e,t)))));const g=p&&(null===a&&null===u||!0===a||!0===u);return g?(0,m.applyFilters)("blockEditor.__unstableCanInsertBlockType",g,o,n,{getBlock:Yo.bind(null,e),getBlockParentsByBlockName:ki.bind(null,e)}):g},ul=(0,h.createRegistrySelector)((e=>sn(cl,((t,n,o)=>Vo(e)(t,o)))));function dl(e,t,n=null){return t.every((t=>ul(e,Ko(e,t),n)))}function pl(e,t){var n;const o=qo(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=vi(e,t);return!sl(e,i)&&(!oo(e,t)&&"disabled"!==ur(e,i))}function hl(e,t){return t.every((t=>pl(e,t)))}function gl(e,t){var n;const o=qo(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=vi(e,t);return"all"!==sl(e,i)&&"disabled"!==ur(e,i)}function ml(e,t){return t.every((t=>gl(e,t)))}function fl(e,t){const n=qo(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function vl(e,t){var n;return!!(0,d.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function bl(e,t){var n;return(null===(n=e.preferences.insertUsage)||void 0===n?void 0:n[t])??null}const kl=(e,t,n)=>!!(0,d.hasBlockSupport)(t,"inserter",!0)&&cl(e,t.name,n),_l=(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}},yl=(e,{buildScope:t="inserter"})=>n=>{const o=n.name;let i=!1;(0,d.hasBlockSupport)(n.name,"multiple",!0)||(i=ri(e,ni(e)).some((({name:e})=>e===n.name)));const{time:l,count:r=0}=bl(e,o)||{},s={id:o,name:n.name,title:n.title,icon:n.icon,isDisabled:i,frecency:_l(l,r)};if("transform"===t)return s;const a=(0,d.getBlockVariations)(n.name,"inserter");return(0,d.getBlockVariations)(n.name,"block").filter((e=>"core/heading"===n.name&&["h1","h2","h3","h4","h5","h6"].includes(e.name))).map((e=>({...e,isSearchOnly:!0}))),{...s,initialAttributes:{},description:n.description,category:n.category,keywords:n.keywords,parent:n.parent,ancestor:n.ancestor,variations:a,example:n.example,utility:1}},xl=(0,h.createRegistrySelector)((e=>sn(((t,n=null,o=$o)=>{const i=cl(t,"core/block",n)?fe(e(pn)).getReusableBlocks().map((e=>{var n,o;const i=e.wp_pattern_sync_status?cn:{src:cn,foreground:"var(--wp-block-synced-color)"},l=`core/block/${e.id}`,{time:r,count:s=0}=bl(t,l)||{},a=_l(r,s);return{id:l,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}})):[],l=yl(t,{buildScope:"inserter"});let r=(0,d.getBlockTypes)().filter((e=>(0,d.hasBlockSupport)(e,"inserter",!0))).map(l);r=!1!==o[Ro]?r.filter((e=>kl(t,e,n))):r.filter((e=>al(t,e,n))).map((e=>({...e,isAllowedInCurrentRoot:kl(t,e,n)})));const s=r.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:l=0}=bl(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:_l(i,l),isSearchOnly:n.isSearchOnly}})(t,n);o.forEach((t=>{!t.isDefault&&(0,re.isGutentagPrefixed)(n.name)||e.push(i(t))}))}return e}),[]),{core:a,noncore:c}=s.reduce(((e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e}),{core:[],noncore:[]});return[...a,...c,...i]}),((t,n)=>[(0,d.getBlockTypes)(),fe(e(pn)).getReusableBlocks(),t.blocks.order,t.preferences.insertUsage,...Vo(e)(t,n)])))),Sl=(0,h.createRegistrySelector)((e=>sn(((e,t,n=null)=>{const o=Array.isArray(t)?t:[t],i=yl(e,{buildScope:"transform"}),l=(0,d.getBlockTypes)().filter((t=>kl(e,t,n))).map(i),r=Object.fromEntries(Object.entries(l).map((([,e])=>[e.name,e]))),s=(0,d.getPossibleBlockTransformations)(o).reduce(((e,t)=>(r[null==t?void 0:t.name]&&e.push(r[t.name]),e)),[]);return dn(s,(e=>r[e.name].frecency),"desc")}),((t,n,o)=>[(0,d.getBlockTypes)(),t.preferences.insertUsage,...Vo(e)(t,o)])))),wl=(0,h.createRegistrySelector)((e=>(t,n=null)=>!!(0,d.getBlockTypes)().some((e=>kl(t,e,n)))||cl(t,"core/block",n)&&fe(e(pn)).getReusableBlocks().length>0)),Cl=(0,h.createRegistrySelector)((e=>sn(((t,n=null)=>{if(!n)return;const o=(0,d.getBlockTypes)().filter((e=>kl(t,e,n)));return cl(t,"core/block",n)&&fe(e(pn)).getReusableBlocks().length>0&&o.push("core/block"),o}),((t,n)=>[(0,d.getBlockTypes)(),fe(e(pn)).getReusableBlocks(),...Vo(e)(t,n)])))),Bl=sn(((e,t=null)=>(Je()('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',{alternative:'wp.data.select( "core/block-editor" ).getAllowedBlocks',since:"6.2",version:"6.4"}),Cl(e,t))),((e,t)=>Cl.getDependants(e,t)));function Il(e,t=null){if(!t)return;const{defaultBlock:n,directInsert:o}=e.blockListSettings[t]??{};return n&&o?n:void 0}function jl(e,t=null){return Je()('wp.data.select( "core/block-editor" ).__experimentalGetDirectInsertBlock',{alternative:'wp.data.select( "core/block-editor" ).getDirectInsertBlock',since:"6.3",version:"6.4"}),Il(e,t)}const El=(0,h.createRegistrySelector)((e=>sn(((t,n)=>{const o=fe(e(pn)).getPatternBySlug(n);if(!o)return null;let i=o.content;var l;return(0,ce.isString)(i)&&(i=(0,d.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===(l=i[0].attributes.metadata)||void 0===l?void 0:l.name)||o.title}}),{...o,blocks:i}}),((t,n)=>[fe(e(pn)).getPatternBySlug(n)])))),Tl=e=>(t,n)=>[...zo(e)(t),...Vo(e)(t,n)],Pl=(0,h.createRegistrySelector)((e=>sn(((t,n=null,o=$o)=>{const{getAllPatterns:i}=fe(e(pn)),l=i(),{allowedBlockTypes:r}=Fl(t),s=l.filter((({inserter:e=!0})=>!!e)).map((e=>({...e,get blocks(){return function(e){let t=No.get(e);return t||(t=function(e){const t=(0,d.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),No.set(e,t)),t}(e).blocks}})));return s.filter((e=>Oo(Ao(e),r))).filter((e=>Ao(e).every((({blockName:e})=>!1!==o[Ro]?ul(t,e,n):al(t,e,n)))))}),Tl(e)))),Ml=sn((e=>{var t;return null==e||null===(t=e.settings)||void 0===t?void 0:t.__experimentalUserPatternCategories}),(e=>[e.settings.__experimentalUserPatternCategories])),Rl=sn((e=>{const t=e.settings.__experimentalBlockPatterns,n=getUserPatterns(e),{allowedBlockTypes:o}=Fl(e),i=[...n,...t].filter((({inserter:e=!0})=>!!e)).map((({name:t})=>El(e,t))),l=i.filter((({blocks:e})=>Oo(e,o)));return l}),(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]})),Nl=sn(((e,t=null)=>{const n=Rl(e).filter((({blocks:n})=>n.every((({name:n})=>ul(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)])),Ll=sn(((e,t,n=null)=>{if(!t)return Ho;const o=Nl(e,n),i=Array.isArray(t)?t:[t],l=o.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>i.includes(e)))}));return 0===l.length?Ho:l}),((e,t,n)=>[...Nl.getDependants(e,n)])),Al=(0,h.createRegistrySelector)((e=>sn(((t,n,o=null)=>{if(!n)return Ho;const i=e(pn).__experimentalGetAllowedPatterns(o),l=Array.isArray(n)?n:[n],r=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=>l.includes(e)))}));return 0===r.length?Ho:r}),((t,n,o)=>Tl(e)(t,o))))),Dl=(0,re.wpVersionCompare)("6.4","<=")?Ll:Al,Ol=(0,h.createRegistrySelector)((e=>(Je()('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',{alternative:'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',since:"6.2",version:"6.4"}),e(pn).getPatternsByBlockTypes))),zl=(0,h.createRegistrySelector)((e=>sn(((t,n,o=null)=>{if(!n)return Ho;if(n.some((({clientId:e,innerBlocks:n})=>n.length||Jl(t,e))))return Ho;const i=Array.from(new Set(n.map((({name:e})=>e))));return e(pn).getPatternsByBlockTypes(i,o)}),((t,n,o)=>Tl(e)(t,o)))));function Vl(e,t){return e.blockListSettings[t]}function Fl(e){return e.settings}function Hl(e){return e.settings.behaviors}function Gl(e){return e.blocks.isPersistentChange}const $l=sn(((e,t=[])=>t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})),(e=>[e.blockListSettings])),Ul=(0,h.createRegistrySelector)((e=>sn(((t,n)=>{var o;Je()("wp.data.select( 'core/block-editor' ).__experimentalGetReusableBlockTitle",{since:"6.6",version:"6.8"});const i=fe(e(pn)).getReusableBlocks().find((e=>e.id===n));return i?null===(o=i.title)||void 0===o?void 0:o.raw:null}),(()=>[fe(e(pn)).getReusableBlocks()]))));function Wl(e){return e.blocks.isIgnoredChange}function Kl(e){return e.lastBlockAttributesChange}function Zl(e){return"navigation"===ql(e)}const ql=(0,h.createRegistrySelector)((e=>t=>{var n;return null!==(n=window)&&void 0!==n&&n.__experimentalEditorWriteMode?t.settings.editorTool??e(Fo.store).get("core","editorTool"):"edit"}));function Yl(){return Je()('wp.data.select( "core/block-editor" ).hasBlockMovingClientId',{since:"6.7",hint:"Block moving mode feature has been removed"}),!1}function Ql(e){return!!e.automaticChangeStatus}function Xl(e,t){return e.highlightedBlock===t}function Jl(e,t){return!!e.blocks.controlledInnerBlocks[t]}const er=sn(((e,t)=>{if(!t.length)return null;const n=mi(e);if(t.includes(Ko(e,n)))return n;const o=Ii(e),i=ki(e,n||o[0],t);return i?i[i.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function tr(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 nr(e,t){var n;return(null===(n=e.blockVisibility)||void 0===n?void 0:n[t])??!0}function or(e){return e.hoveredBlockClientId}const ir=sn((e=>{const t=new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])));return 0===t.size?Go:t}),(e=>[e.blockVisibility])),lr=sn(((e,t)=>{let n,o=t;for(;o=e.blocks.parents.get(o);)"core/block"!==Ko(e,o)&&"contentOnly"!==sl(e,o)||(n=o);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function rr(e){return e.temporarilyEditingAsBlocks}function sr(e){return e.temporarilyEditingFocusModeRevert}function ar(e,t){if("default"!==ur(e,t))return!1;if(!fl(e,t))return!0;if(po(e)){const n=uo(e);if(n){const o=Fi(e,n);if(null!=o&&o.includes(t))return!0}else if(t&&!vi(e,t))return!0}return!(0,d.hasBlockSupport)(Ko(e,t),"__experimentalDisableBlockOverlay",!1)&&Jl(e,t)&&!Gi(e,t)&&!$i(e,t,!0)}function cr(e,t){let n=e.blocks.parents.get(t);for(;n;){if(ar(e,n))return!0;n=e.blocks.parents.get(n)}return!1}const ur=(0,h.createRegistrySelector)((e=>(t,n="")=>{var o,i;null===n&&(n="");const l=Zl(t);if(!l&&null!==(o=t.derivedBlockEditingModes)&&void 0!==o&&o.has(n))return t.derivedBlockEditingModes.get(n);if(l&&null!==(i=t.derivedNavModeBlockEditingModes)&&void 0!==i&&i.has(n))return t.derivedNavModeBlockEditingModes.get(n);const r=t.blockEditingModes.get(n);if(r)return r;if(""===n)return"default";if("contentOnly"===sl(t,vi(t,n))){const o=Ko(t,n),{hasContentRoleAttribute:i}=fe(e(d.store));return i(o)?"contentOnly":"disabled"}return"default"})),dr=(0,h.createRegistrySelector)((e=>(t,n="")=>{var o,i;const l=n||mi(t);if(!l)return!1;const{getGroupingBlockName:r}=e(d.store),s=Yo(t,l),a=r();return s&&(s.name===a||(null===(o=(0,d.getBlockType)(s.name))||void 0===o||null===(i=o.transforms)||void 0===i?void 0:i.ungroup))&&!!s.innerBlocks.length&&pl(t,l)})),pr=(0,h.createRegistrySelector)((e=>(t,n=Ho)=>{const{getGroupingBlockName:o}=e(d.store),i=o(),l=null!=n&&n.length?n:Bi(t),r=null!=l&&l.length?vi(t,l[0]):void 0;return ul(t,i,r)&&l.length&&hl(t,l)}));function hr(e,t){var n;const{lastBlockRemoved:o}=e;return null===(n=o.clientIds)||void 0===n?void 0:n.includes(t)}const gr=window.wp.a11y,mr=new WeakSet,fr=["inserterMediaCategories","blockInspectorAnimation"];function vr(e,{stripExperimentalSettings:t=!1,reset:n=!1}={}){let o=e;Object.hasOwn(o,"__unstableIsPreviewMode")&&(Je()("__unstableIsPreviewMode argument in wp.data.dispatch('core/block-editor').updateSettings",{since:"6.8",alternative:"isPreviewMode"}),o={...o},o.isPreviewMode=o.__unstableIsPreviewMode,delete o.__unstableIsPreviewMode);const i=o;if(t&&"web"===p.Platform.OS)for(const e in o)fr.includes(e)&&delete i[e];return{type:"UPDATE_SETTINGS",settings:i,reset:n}}function br(){return{type:"HIDE_BLOCK_INTERFACE"}}function kr(){return{type:"SHOW_BLOCK_INTERFACE"}}const _r=(e,t=!0,n=!1)=>({select:o,dispatch:i,registry:l})=>{if(!e||!e.length)return;var r;r=e,e=Array.isArray(r)?r:[r];const s=o.getBlockRootClientId(e[0]);if(!o.canRemoveBlocks(e,s))return;const a=!n&&o.getBlockRemovalRules();if(a){const n=new Set,l=[...e];let r="templates";for(;l.length;){const e=l.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 l=o.getBlockAttributes(e);null!=l&&null!==(c=l.metadata)&&void 0!==c&&c.bindings&&JSON.stringify(l.metadata.bindings).includes("core/pattern-overrides")&&(n.add(t),r="patternOverrides")}const i=o.getBlockOrder(e);l.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),r))}t&&i.selectPreviousBlock(e[0],t),l.batch((()=>{i({type:"REMOVE_BLOCKS",clientIds:e}),i(yr())}))},yr=()=>({select:e,dispatch:t})=>{if(e.getBlockCount()>0)return;const{__unstableHasCustomAppender:n}=e.getSettings();n||t.insertDefaultBlock()};function xr(){return{type:"CLEAR_BLOCK_REMOVAL_PROMPT"}}function Sr(e=!1){return{type:"SET_BLOCK_REMOVAL_RULES",rules:e}}function wr(e){return{type:"SET_OPENED_BLOCK_SETTINGS_MENU",clientId:e}}function Cr(e,t){return{type:"SET_STYLE_OVERRIDE",id:e,style:t}}function Br(e){return{type:"DELETE_STYLE_OVERRIDE",id:e}}function Ir(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();mr.add(o)}))}}function jr(e=null){return{type:"LAST_FOCUS",lastFocus:e}}function Er(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 Tr(e){return{type:"REGISTER_BLOCK_BINDINGS_SOURCE",sourceName:e.name,sourceLabel:e.label,useSource:e.useSource,lockAttributesEditing:e.lockAttributesEditing}}function Pr(){return{type:"START_DRAGGING"}}function Mr(){return{type:"STOP_DRAGGING"}}function Rr(e){return{type:"SET_BLOCK_EXPANDED_IN_LIST_VIEW",clientId:e}}function Nr(e){return{type:"SET_INSERTION_POINT",value:e}}const Lr=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)};function Ar(e){return{type:"EDIT_CONTENT_ONLY_SECTION",clientId:e}}function Dr(){return{type:"EDIT_CONTENT_ONLY_SECTION"}}const Or=(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,gr.speak)((0,vt.__)("You are currently in zoom-out mode.","kubio"))}}n({type:"SET_ZOOM_LEVEL",zoom:e})};function zr(){return{type:"RESET_ZOOM_LEVEL"}}function Vr(e,t){return{type:"TOGGLE_BLOCK_SPOTLIGHT",clientId:e,hasBlockSpotlight:t}}function Fr(){return{type:"OPEN_LIST_VIEW_CONTENT_PANEL"}}function Hr(){return{type:"CLOSE_LIST_VIEW_CONTENT_PANEL"}}function Gr(e){return{type:"SHOW_VIEWPORT_MODAL",clientIds:e}}function $r(){return{type:"HIDE_VIEWPORT_MODAL"}}function Ur(e,t={}){return{type:"REQUEST_INSPECTOR_TAB",tabName:e,options:t}}function Wr(){return{type:"CLEAR_REQUESTED_INSPECTOR_TAB"}}const Kr=()=>async({dispatch:e,select:t})=>{const{__experimentalFetchBlockPatterns:n}=t.getSettings();if(!n)return[];e({type:"RECEIVE_BLOCK_PATTERNS",patterns:await n()})};Kr.shouldInvalidate=e=>"UPDATE_SETTINGS"===e.type&&!!e.settings.__experimentalFetchBlockPatterns;const Zr="†";function qr(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return("string"==typeof n||n instanceof un.RichTextData)&&-1!==n.toString().indexOf(Zr)}))}const Yr=e=>Array.isArray(e)?e:[e],Qr=e=>({dispatch:t})=>{t({type:"RESET_BLOCKS",blocks:e}),t(Xr(e))},Xr=e=>({select:t,dispatch:n})=>{const o=t.getTemplate(),i=t.getTemplateLock(),l=!o||"all"!==i||(0,d.doBlocksMatchTemplate)(e,o);if(l!==t.isValidTemplate())return n.setTemplateValidity(l),l};function Jr(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function es(e){return Je()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function ts(e,t,n=!1){var o;return"object"==typeof n&&(n=null===(o=n)||void 0===o?void 0:o.uniqueByBlock),{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:Yr(e),attributes:t,uniqueByBlock:n}}function ns(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}const os=(e,t=0)=>({select:n,dispatch:o})=>{const i=n.getBlock(e);if((0,m.applyFilters)("kubio.can_select_block",!0,i,n))return o({type:"SELECT_BLOCK",initialPosition:t,clientId:e})};function is(e){return{type:"HOVER_BLOCK",clientId:e}}const ls=(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);if(t)o.selectBlock(t,-1);else{const t=n.getNextBlockClientId(e);t&&o.selectBlock(t,0)}}},rs=e=>({select:t,dispatch:n})=>{const o=t.getNextBlockClientId(e);o&&n.selectBlock(o)};function ss(){return{type:"START_MULTI_SELECT"}}function as(){return{type:"STOP_MULTI_SELECT"}}const cs=(e,t,n=0)=>({select:e,dispatch:t})=>{};function us(){return{type:"CLEAR_SELECTED_BLOCK"}}function ds(e=!0){return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function ps(e,t){var n;const o=(null==t||null===(n=t.__experimentalPreferredStyleVariations)||void 0===n?void 0:n.value)??{};return e.map((e=>{var t;const n=e.name;if(!(0,d.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!o[n])return e;const i=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=i&&i.includes("is-style-"))return e;const{attributes:l={}}=e,r=o[n];return{...e,attributes:{...l,className:`${i||""} is-style-${r}`.trim()}}}))}const hs=(e,t,n,o=0,i)=>({select:l,dispatch:r,registry:s})=>{e=Yr(e),t=ps(Yr(t),l.getSettings());const a=l.getBlockRootClientId(e[0]);for(let e=0;e<t.length;e++){const n=t[e];if(!l.canInsertBlockType(n.name,a))return}s.batch((()=>{r({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:i}),r.ensureDefaultBlock()}))};function gs(e,t){return hs(e,t)}const ms=e=>(t,n)=>({select:o,dispatch:i})=>{o.canMoveBlocks(t,n)&&i({type:e,clientIds:Yr(t),rootClientId:n})},fs=ms("MOVE_BLOCKS_DOWN"),vs=ms("MOVE_BLOCKS_UP"),bs=(e,t="",n="",o)=>({select:i,dispatch:l})=>{if(i.canMoveBlocks(e)){if(t!==n){if(!i.canRemoveBlocks(e))return;if(!i.canInsertBlocks(e,n))return}l({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}};function ks(e,t="",n="",o){return bs([e],t,n,o)}function _s(e,t,n,o,i,l){return ys([e],t,n,o,i,l)}const ys=(e,t,n,o=!0,i=0,l)=>({select:r,dispatch:s})=>{null!==i&&"object"==typeof i&&(l=i,i=0,Je()("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=ps(Yr(e),r.getSettings());const a=[];for(const t of e)r.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:l})};function xs(e,t,n={}){const{__unstableWithInserter:o,operation:i,kubioInsertionEdge:l}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o,operation:i,kubioInsertionEdge:l}}const Ss=()=>({select:e,dispatch:t})=>{e.isBlockInsertionPointVisible()&&t({type:"HIDE_INSERTION_POINT"})};function ws(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const Cs=()=>({select:e,dispatch:t})=>{t({type:"SYNCHRONIZE_TEMPLATE"});const n=e.getBlocks(),o=e.getTemplate(),i=(0,d.synchronizeBlocksWithTemplate)(n,o);t.resetBlocks(i)},Bs=e=>({registry:t,select:n,dispatch:o})=>{const i=n.getSelectionStart(),l=n.getSelectionEnd();if(i.clientId===l.clientId)return;if(!i.attributeKey||!l.attributeKey||void 0===i.offset||void 0===l.offset)return!1;const r=n.getBlockRootClientId(i.clientId);if(r!==n.getBlockRootClientId(l.clientId))return;const s=n.getBlockOrder(r);let a,c;s.indexOf(i.clientId)>s.indexOf(l.clientId)?(a=l,c=i):(a=i,c=l);const u=e?c:a,p=n.getBlock(u.clientId),h=(0,d.getBlockType)(p.name);if(!h.merge)return;const g=a,m=c,f=n.getBlock(g.clientId),v=n.getBlock(m.clientId),b=f.attributes[g.attributeKey],k=v.attributes[m.attributeKey];let _=(0,un.create)({html:b}),y=(0,un.create)({html:k});_=(0,un.remove)(_,g.offset,_.text.length),y=(0,un.insert)(y,Zr,0,m.offset);const x=(0,d.cloneBlock)(f,{[g.attributeKey]:(0,un.toHTMLString)({value:_})}),S=(0,d.cloneBlock)(v,{[m.attributeKey]:(0,un.toHTMLString)({value:y})}),w=e?x:S,C=f.name===v.name?[w]:(0,d.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=qr(B),j=B[I],E=(0,un.create)({html:j}),T=E.text.indexOf(Zr),P=(0,un.remove)(E,T,T+1),M=(0,un.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())}))},Is=(e=[])=>({registry:t,select:n,dispatch:o})=>{var i;const l=n.getSelectionStart(),r=n.getSelectionEnd(),s=n.getBlockRootClientId(l.clientId),a=n.getBlockRootClientId(r.clientId);if(s!==a)return;const c=n.getBlockOrder(s);let u,p;c.indexOf(l.clientId)>c.indexOf(r.clientId)?(u=r,p=l):(u=l,p=r);const h=u,g=p,m=n.getBlock(h.clientId),f=n.getBlock(g.clientId),v=(0,d.getBlockType)(m.name),b=(0,d.getBlockType)(f.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,vt.__)("Blocks can't be inserted into other blocks with bindings","kubio"),{type:"snackbar"})}return void o.insertAfterBlock(h.clientId)}if(!k||!_||void 0===l.offset||void 0===r.offset)return;if(h.clientId===g.clientId&&k===_&&h.offset===g.offset)if(e.length){if((0,d.isUnmodifiedDefaultBlock)(m))return void o.replaceBlocks([h.clientId],e,e.length-1,-1)}else if(!n.getBlockOrder(h.clientId).length){function z(){const e=(0,d.getDefaultBlockName)();return n.canInsertBlockType(e,s)?(0,d.createBlock)(e):(0,d.createBlock)(n.getBlockName(h.clientId))}const V=y[k].length;if(0===h.offset&&V)return void o.insertBlocks([z()],n.getBlockIndex(h.clientId),s,!1);if(h.offset===V)return void o.insertBlocks([z()],n.getBlockIndex(h.clientId)+1,s)}const S=m.attributes[k],w=f.attributes[_];let C=(0,un.create)({html:S}),B=(0,un.create)({html:w});C=(0,un.remove)(C,h.offset,C.text.length),B=(0,un.remove)(B,0,g.offset);let I={...m,innerBlocks:m.clientId===f.clientId?[]:m.innerBlocks,attributes:{...m.attributes,[k]:(0,un.toHTMLString)({value:C})}},j={...f,clientId:m.clientId===f.clientId?(0,d.createBlock)(f.name).clientId:f.clientId,attributes:{...f.attributes,[_]:(0,un.toHTMLString)({value:B})}};const E=(0,d.getDefaultBlockName)();if(m.clientId===f.clientId&&E&&j.name!==E&&n.canInsertBlockType(E,s)){const F=(0,d.switchToBlockType)(j,E);1===(null==F?void 0:F.length)&&(j=F[0])}if(!e.length)return void o.replaceBlocks(n.getSelectedBlockClientIds(),[I,j]);let T;const P=[],M=[...e],R=M.shift(),N=(0,d.getBlockType)(I.name),L=N.merge&&R.name===N.name?[R]:(0,d.switchToBlockType)(R,N.name);if(null!=L&&L.length){const H=L.shift();I={...I,attributes:{...I.attributes,...N.merge(I.attributes,H.attributes)}},P.push(I),T={clientId:I.clientId,attributeKey:k,offset:(0,un.create)({html:I.attributes[k]}).text.length},M.unshift(...L)}else(0,d.isUnmodifiedBlock)(I)||P.push(I),P.push(R);const A=M.pop(),D=(0,d.getBlockType)(j.name);if(M.length&&P.push(...M),A){const G=D.merge&&D.name===A.name?[A]:(0,d.switchToBlockType)(A,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,un.create)({html:$.attributes[_]}).text.length}}else P.push(A),(0,d.isUnmodifiedBlock)(j)||P.push(j)}else(0,d.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)}))},js=()=>({select:e,dispatch:t})=>{const n=e.getSelectionStart(),o=e.getSelectionEnd();t.selectionChange({start:{clientId:n.clientId},end:{clientId:o.clientId}})},Es=(e,t)=>({registry:n,select:o,dispatch:i})=>{const l=e,r=t,s=o.getBlock(l),a=(0,d.getBlockType)(s.name);if(!a)return;const c=o.getBlock(r);if(!a.merge&&(0,d.getBlockSupport)(s.name,"__experimentalOnMerge")){const e=(0,d.switchToBlockType)(c,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,l),i.removeBlock(r),i.selectBlock(t.innerBlocks[0].clientId);const e=o.getNextBlockClientId(l);if(e&&o.getBlockName(l)===o.getBlockName(e)){const t=o.getBlockAttributes(l),n=o.getBlockAttributes(e);Object.keys(t).every((e=>t[e]===n[e]))&&(i.moveBlocksToPosition(o.getBlockOrder(e),e,l),i.removeBlock(e,!1))}}))}if((0,d.isUnmodifiedDefaultBlock)(s))return void i.removeBlock(l,o.isBlockSelected(l));if((0,d.isUnmodifiedDefaultBlock)(c))return void i.removeBlock(r,o.isBlockSelected(r));if(!a.merge)return void i.selectBlock(s.clientId);const u=(0,d.getBlockType)(c.name),{clientId:p,attributeKey:h,offset:g}=o.getSelectionStart(),m=(p===l?a:u).attributes[h],f=(p===l||p===r)&&void 0!==h&&void 0!==g&&!!m;m||("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,d.cloneBlock)(s),b=(0,d.cloneBlock)(c);if(f){const e=p===l?v:b,t=e.attributes[h],n=(0,un.insert)((0,un.create)({html:t}),Zr,g,g);e.attributes[h]=(0,un.toHTMLString)({value:n})}const k=s.name===c.name?[b]:(0,d.switchToBlockType)(b,s.name);if(!k||!k.length)return;const _=a.merge(v.attributes,k[0].attributes);if(f){const e=qr(_),t=_[e],n=(0,un.create)({html:t}),o=n.text.indexOf(Zr),l=(0,un.remove)(n,o,o+1),r=(0,un.toHTMLString)({value:l});_[e]=r,i.selectionChange(s.clientId,e,o,o)}i.replaceBlocks([s.clientId,c.clientId],[{...s,attributes:{...s.attributes,..._}},...k.slice(1)],0)},Ts=(e,t=!0)=>_r(e,t);function Ps(e,t){return Ts([e],t)}function Ms(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 Rs(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Ns(){return{type:"START_TYPING"}}function Ls(){return{type:"STOP_TYPING"}}function As(e=[]){return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Ds(){return{type:"STOP_DRAGGING_BLOCKS"}}function Os(){return Je()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function zs(){return Je()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Vs(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const Fs=(e,t,n)=>({dispatch:o})=>{const i=(0,d.getDefaultBlockName)();if(!i)return;const l=(0,d.createBlock)(i,e);return o.insertBlock(l,n,t)};function Hs(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Gs(e){return top.wp.experiments?vr(e,{stripExperimentalSettings:!0}):{type:"UPDATE_SETTINGS",settings:e}}function $s(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Us(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Ws(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Ks=()=>({dispatch:e})=>{e({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:t=(e=>setTimeout(e,100))}=window;t((()=>{e({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},Zs=(e=!0)=>({dispatch:t})=>{t.__unstableSetEditorMode(e?"navigation":"edit")},qs=e=>({registry:t})=>{t.dispatch(Fo.store).set("core","editorTool",e),"navigation"===e?(0,gr.speak)((0,vt.__)("You are currently in Write mode.","kubio")):"edit"===e&&(0,gr.speak)((0,vt.__)("You are currently in Design mode.","kubio"))};function Ys(){return Je()('wp.data.dispatch( "core/block-editor" ).setBlockMovingClientId',{since:"6.7",hint:"Block moving mode feature has been removed"}),{type:"DO_NOTHING"}}const Qs=(e,t=!0)=>({select:n,dispatch:o})=>{if(!e||!e.length)return;const i=n.getBlocksByClientId(e);if(i.some((e=>!e)))return;const l=i.map((e=>e.name));if(l.some((e=>!(0,d.hasBlockSupport)(e,"multiple",!0))))return;const r=n.getBlockRootClientId(e[0]),s=Yr(e),a=n.getBlockIndex(s[s.length-1]),c=i.map((e=>(0,d.__experimentalCloneSanitizedBlock)(e)));return c.forEach((e=>{var t;const n=null==e||null===(t=e.attributes)||void 0===t?void 0:t.anchor;if(n){const t=(0,re.getUniqueBlockAnchor)(n);pe().set(e,"attributes.anchor",t)}})),o.insertBlocks(c,a+1,r,t),c.length>1&&t&&o.multiSelect(c[0].clientId,c[c.length-1].clientId),c.map((e=>e.clientId))},Xs=e=>({select:t,dispatch:n})=>{if(!e)return;const o=t.getBlockRootClientId(e);if(t.getTemplateLock(o))return;const i=t.getBlockIndex(e),l=o?t.getDirectInsertBlock(o):null;if(!l)return n.insertDefaultBlock({},o,i);const r={};if(l.attributesToCopy){const n=t.getBlockAttributes(e);l.attributesToCopy.forEach((e=>{n[e]&&(r[e]=n[e])}))}const s=(0,d.createBlock)(l.name,{...l.attributes,...r});return n.insertBlock(s,i,o)},Js=e=>({select:t,dispatch:n})=>{if(!e)return;const o=t.getBlockRootClientId(e);if(t.getTemplateLock(o))return;const i=t.getBlockIndex(e),l=o?t.getDirectInsertBlock(o):null;if(!l)return n.insertDefaultBlock({},o,i+1);const r={};if(l.attributesToCopy){const n=t.getBlockAttributes(e);l.attributesToCopy.forEach((e=>{n[e]&&(r[e]=n[e])}))}const s=(0,d.createBlock)(l.name,{...l.attributes,...r});return n.insertBlock(s,i+1,o)};function ea(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const ta=(e,t=150)=>async({dispatch:n})=>{n(ea(e,!0)),await new Promise((e=>setTimeout(e,t))),n(ea(e,!1))};function na(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function oa(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function ia(e,t){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e,focusModeToRevert:t}}const la=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 ra(e="",t){return{type:"SET_BLOCK_EDITING_MODE",clientId:e,mode:t}}function sa(e=""){return{type:"UNSET_BLOCK_EDITING_MODE",clientId:e}}var aa,ca,ua,da,pa,ha,ga,ma;const fa=(0,re.wpVersionCompare)("6.2",">="),va={reducer:en,resolvers:l,selectors:fa?t:{...t,...e},actions:fa?r:{...r,...i}},ba=(0,h.createReduxStore)(pn,{...va,persist:["preferences"]}),ka=(0,h.registerStore)(pn,{...va,persist:["preferences"]});null===(aa=fe(ka))||void 0===aa||null===(ca=aa.registerPrivateActions)||void 0===ca||ca.call(aa,i),null===(ua=fe(ka))||void 0===ua||null===(da=ua.registerPrivateSelectors)||void 0===da||da.call(ua,e),null===(pa=fe(ba))||void 0===pa||null===(ha=pa.registerPrivateActions)||void 0===ha||ha.call(pa,i),null===(ga=fe(ba))||void 0===ga||null===(ma=ga.registerPrivateSelectors)||void 0===ma||ma.call(ga,e);var _a=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});const ya=function({className:e,actions:t,children:n,secondaryActions:o}){return(0,et.jsx)("div",{style:{display:"contents",all:"initial"},children:(0,et.jsx)("div",{className:u(e,"block-editor-warning"),children:(0,et.jsxs)("div",{className:"block-editor-warning__contents",children:[(0,et.jsx)("p",{className:"block-editor-warning__message",children:n}),((null==t?void 0:t.length)>0||o)&&(0,et.jsxs)("div",{className:"block-editor-warning__actions",children:[(null==t?void 0:t.length)>0&&t.map(((e,t)=>(0,et.jsx)("span",{className:"block-editor-warning__action",children:e},t))),o&&(0,et.jsx)(le.DropdownMenu,{className:"block-editor-warning__secondary",icon:_a,label:(0,vt.__)("More options"),popoverProps:{placement:"bottom-end",className:"block-editor-warning__dropdown"},noIcons:!0,children:()=>(0,et.jsx)(le.MenuGroup,{children:o.map(((e,t)=>(0,et.jsx)(le.MenuItem,{onClick:e.onClick,children:e.title},t)))})})]})]})})})};function xa({originalBlockClientId:e,name:t,onReplace:n}){const{selectBlock:o}=(0,h.useDispatch)(ba),i=(0,d.getBlockType)(t);return(0,et.jsxs)(ya,{actions:[(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>o(e),children:(0,vt.__)("Find original")},"find-original"),(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>n([]),children:(0,vt.__)("Remove")},"remove")],children:[(0,et.jsxs)("strong",{children:[null==i?void 0:i.title,": "]}),(0,vt.__)("This block can only be used once.")]})}function Sa({mayDisplayControls:e,mayDisplayParentControls:t,blockEditingMode:n,isPreviewMode:o,...i}){const{name:l,isSelected:r,clientId:s,attributes:a={},__unstableLayoutClassNames:c}=i,{layout:u=null,metadata:h={}}=a,{bindings:g}=h,m=(0,d.hasBlockSupport)(l,"layout",!1)||(0,d.hasBlockSupport)(l,"__experimentalLayout",!1),{originalBlockClientId:b}=(0,p.useContext)(ht);return(0,et.jsxs)(C,{value:(0,p.useMemo)((()=>({name:l,isSelected:r,clientId:s,layout:m?u:null,__unstableLayoutClassNames:c,[f]:e,[v]:t,[k]:n,[y]:g,[x]:o})),[l,r,s,m,u,c,e,t,n,g,o]),children:[(0,et.jsx)(ft,{...i}),b&&(0,et.jsx)(xa,{originalBlockClientId:b,name:l,onReplace:i.onReplace})]})}function wa(...e){const{clientId:t=null}=B();return(0,h.useSelect)((n=>fe(n(ba)).getBlockSettings(t,...e)),[t,...e])}function Ca(e){Je()("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]=wa(e);return t}const Ba=([e,...t])=>e.toUpperCase()+t.join(""),Ia=e=>(0,g.createHigherOrderComponent)((t=>function(n){return(0,et.jsx)(t,{...n,colors:e})}),"withCustomColorPalette"),ja=()=>(0,g.createHigherOrderComponent)((e=>function(t){const[n,o,i]=wa("color.palette.custom","color.palette.theme","color.palette.default"),l=(0,p.useMemo)((()=>[...n||[],...o||[],...i||[]]),[n,o,i]);return(0,et.jsx)(e,{...t,colors:l})}),"withEditorColorPalette");function Ea(e,t){const n=e.reduce(((e,t)=>({...e,..."string"==typeof t?{[t]:Ze(t)}:t})),{});return(0,g.compose)([t,e=>class extends p.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=X(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=Ba(t),o=`custom${n}`;return e[`set${n}`]=this.createSetColor(t,o),e}),{})}createSetColor(e,t){return n=>{const o=Ye(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,l])=>{const r=qe(t,e[i],e[`custom${Ba(i)}`]),s=o[i];return(null==s?void 0:s.color)===r.color&&s?n[i]=s:n[i]={...r,class:Qe(l,r.slug)},n}),{})}render(){return(0,et.jsx)(e,{...this.props,colors:void 0,...this.state,...this.setters,colorUtils:this.colorUtils})}}])}function Ta(e){return(...t)=>{const n=Ia(e);return(0,g.createHigherOrderComponent)(Ea(t,n),"withCustomColors")}}function Pa(...e){const t=ja();return(0,g.createHigherOrderComponent)(Ea(e,t),"withColors")}function Ma(e){if(e)return`has-${e}-gradient-background`}function Ra(e,t){const n=null==e?void 0:e.find((e=>e.slug===t));return n&&n.gradient}function Na(e,t){const n=null==e?void 0:e.find((e=>e.gradient===t));return n}function La(e,t){const n=Na(e,t);return n&&n.slug}function Aa({gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}={}){const{clientId:n}=B(),[o,i,l]=wa("color.gradients.custom","color.gradients.theme","color.gradients.default"),r=(0,p.useMemo)((()=>[...o||[],...i||[],...l||[]]),[o,i,l]),{gradient:s,customGradient:a}=(0,h.useSelect)((o=>{const{getBlockAttributes:i}=o(ba),l=i(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:c}=(0,h.useDispatch)(ba),u=(0,p.useCallback)((o=>{const i=La(r,o);c(n,i?{[e]:i,[t]:void 0}:{[e]:void 0,[t]:o})}),[r,n,c]),d=Ma(s);let g;return g=s?Ra(r,s):a,{gradientClass:d,gradientValue:g,setGradient:u}}const Da=(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 Oa(e,t){return(null==e?void 0:e.find((({size:e})=>e===t)))||{size:t}}function za(e){if(e)return`has-${(0,ce.kebabCase)(e)}-font-size`}const Va="1600px",Fa="320px",Ha=1,Ga=.25,$a=.75,Ua="14px";function Wa({minimumFontSize:e,maximumFontSize:t,fontSize:n,minimumViewportWidth:o=Fa,maximumViewportWidth:i=Va,scaleFactor:l=Ha,minimumFontSizeLimit:r}){if(r=Ka(r)?r:Ua,n){const o=Ka(n);if(null==o||!o.unit)return null;const i=Ka(r,{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),Ga),$a),l=Za(o.value*n,3);e=null!=i&&i.value&&l<(null==i?void 0:i.value)?`${i.value}${i.unit}`:`${l}${o.unit}`}}const s=Ka(e),a=(null==s?void 0:s.unit)||"rem",c=Ka(t,{coerceTo:a});if(!s||!c)return null;const u=Ka(e,{coerceTo:"rem"}),d=Ka(i,{coerceTo:a}),p=Ka(o,{coerceTo:a});if(!d||!p||!u)return null;const h=d.value-p.value;if(!h)return null;const g=Za(p.value/100,3),m=Za(g,3)+a,f=Za(((c.value-s.value)/h*100||1)*l,3);return`clamp(${e}, ${u.value}${u.unit} + ((1vw - ${m}) * ${f}), ${t})`}function Ka(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},l=null==i?void 0:i.join("|"),r=new RegExp(`^(\\d*\\.?\\d+)(${l}){1,1}$`),s=e.match(r);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:Za(u,3),unit:c}}function Za(e,t=3){const n=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*n)/n):void 0}const qa=function(e){const[t,n]=wa("typography.fontSizes","typography.customFontSize");return(0,et.jsx)(le.FontSizePicker,{...e,fontSizes:t,disableCustomFontSizes:!n,__next40pxDefaultSize:!0})},Ya=[],Qa=([e,...t])=>e.toUpperCase()+t.join(""),Xa=(...e)=>{const t=e.reduce(((e,t)=>(e[t]=`custom${Qa(t)}`,e)),{});return(0,g.createHigherOrderComponent)((0,g.compose)([(0,g.createHigherOrderComponent)((e=>function(t){const[n]=wa("typography.fontSizes");return(0,et.jsx)(e,{...t,fontSizes:n||Ya})}),"withFontSizes"),e=>class extends p.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return Object.entries(t).reduce(((e,[t,n])=>(e[`set${Qa(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 l=Object.entries(t).filter((([e,t])=>i(t,e))).reduce(((t,[o,i])=>{const l=e[o],r=Da(n,l,e[i]);return t[o]={...r,class:za(l)},t}),{});return{...o,...l}}render(){return(0,et.jsx)(e,{...this.props,fontSizes:void 0,...this.state,...this.setters})}}]),"withFontSizes")};var Ja=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z"})}),ec=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z"})}),tc=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z"})});const nc=[{icon:Ja,title:(0,vt.__)("Align text left"),align:"left"},{icon:ec,title:(0,vt.__)("Align text center"),align:"center"},{icon:tc,title:(0,vt.__)("Align text right"),align:"right"}],oc={placement:"bottom-start"},ic=function({value:e,onChange:t,alignmentControls:n=nc,label:o=(0,vt.__)("Align text"),description:i=(0,vt.__)("Change text alignment"),isCollapsed:l=!0,isToolbar:r}){function s(n){return()=>t(e===n?void 0:n)}const a=n.find((t=>t.align===e)),c=r?le.ToolbarGroup:le.ToolbarDropdownMenu,u=r?{isCollapsed:l}:{toggleProps:{description:i},popoverProps:oc};return(0,et.jsx)(c,{icon:a?a.icon:(0,vt.isRTL)()?tc:Ja,label:o,controls:n.map((t=>{const{align:n}=t,o=e===n;return{...t,isActive:o,role:l?"menuitemradio":void 0,onClick:s(n)}})),...u})},lc=e=>(0,et.jsx)(ic,{...e,isToolbar:!1}),rc=e=>(0,et.jsx)(ic,{...e,isToolbar:!0}),sc=window.kubio.pro,ac=()=>"",cc=e=>e.title,uc=e=>e.description||"",dc=e=>e.keywords||[],pc=()=>"",hc=()=>null;function gc(e=""){return(e=(e=(0,ce.deburr)(e)).replace(/^\//,"")).toLowerCase()}const mc=(e="")=>(0,ce.words)(gc(e)),fc=(e,t,n,o)=>{if(0===mc(o).length)return e;const i={getCategory:e=>{var n;return null===(n=(0,ce.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 vc(e,o,i)},vc=(e=[],t="",n={})=>{if(0===mc(t).length)return e;const o=e.map((e=>[e,bc(e,t,n)])).filter((([,e])=>e>0));return o.sort((([,e],[,t])=>t-e)),o.map((([e])=>e))};function bc(e,t,n={}){const{getName:o=ac,getTitle:i=cc,getDescription:l=uc,getKeywords:r=dc,getCategory:s=pc,getCollection:a=hc}=n,c=o(e),u=i(e),d=l(e),p=r(e),h=s(e),g=a(e),m=gc(t),f=gc(u);let v=0;if(m===f)v+=30;else if(f.startsWith(m))v+=20;else{const e=[c,u,d,...p,h,g].join(" ");0===(b=(0,ce.words)(m),k=e,(0,ce.differenceWith)(b,mc(k),((e,t)=>t.includes(e)))).length&&(v+=10)}var b,k;return 0!==v&&c.startsWith("core/")&&v++,v}const kc=(e,t,n)=>{const{categories:o,collections:i,items:l}=(0,h.useSelect)((t=>{const{getInserterItems:o}=t(ba),{getCategories:i,getCollections:l}=t(d.store);return{categories:i().sort((({isKubio:e},{isKubio:t})=>e&&!t?-1:!e&&t?1:0),[]),collections:l(),items:o(e,n)}}),[e,n]);return[l,o,i,(0,p.useCallback)((({name:e,initialAttributes:n,innerBlocks:o},i)=>{const l=(0,d.createBlock)(e,n,(0,d.createBlocksFromInnerBlocksTemplate)(o));t(l,void 0,i)}),[t])]};var _c=n(3967),yc=n.n(_c),xc=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})});const Sc=(0,p.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:xc});const l=(0,et.jsx)(le.Icon,{icon:e&&e.src?e.src:e,context:o}),r=t?{backgroundColor:e&&e.background,color:e&&e.foreground}:{};return(0,et.jsx)("span",{style:r,className:yc()("block-editor-block-icon",n,{"has-colors":t}),children:l})})),wc=()=>{},Cc={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockId:n,prioritizedBlocks:o,blockTypes:i}=(0,h.useSelect)((e=>{var t;const{getSelectedBlockClientId:n,getBlockName:o,getBlockListSettings:i,getBlockRootClientId:l,getBlock:r}=e(ba),{getBlockTypes:s,getActiveBlockVariation:a}=e(d.store),c=n(),{name:u,attributes:p}=r(c),h=a(u,p),g=l(c);return{selectedBlockId:h?`${u}/${h.name}`:u,rootClientId:g,prioritizedBlocks:null===(t=i(g))||void 0===t?void 0:t.prioritizedInserterBlocks,blockTypes:s()}}),[]),[l,r,s]=kc(t,wc),a=(0,p.useMemo)((()=>pe().keyBy(i,"name")),[i]),c=(0,p.useMemo)((()=>{const t=e.trim()?fc(l,r,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)(dn(l,"frecency","desc"),o);return t.filter((e=>e.id!==n)).slice(0,9).map((e=>{let t=!1;return t=pe().get(a,[e.name,"isPro"],!1),{...e,isProOnFree:t}}))}),[e,n,l,r,s,o,a]);return[(0,p.useMemo)((()=>c.map((e=>{const{title:t,icon:n,isDisabled:o,isProOnFree:i}=e;return{key:`block-${e.id}`,value:e,label:(0,et.jsxs)(sc.ProItem,{className:"kubio-autocomplete-item kubio-pro-item--small",item:i,children:[(0,et.jsx)(Sc,{icon:n,showColors:!0},"icon"),t]}),isDisabled:o}}))),[c])]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o,syncStatus:i,content:l}=e;return{action:"replace",value:"unsynced"===i?(0,d.parse)(l,{__unstableSkipMigrationLogs:!0}):(0,d.createBlock)(t,n,(0,d.createBlocksFromInnerBlocksTemplate)(o))}}},Bc=window.wp.apiFetch;var Ic=n.n(Bc),jc=(0,p.forwardRef)((({icon:e,size:t=24,...n},o)=>(0,p.cloneElement)(e,{width:t,height:t,...n,ref:o}))),Ec=(0,et.jsxs)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,et.jsx)(an.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,et.jsx)(an.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"})]}),Tc=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})});const Pc=window.wp.htmlEntities,Mc={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await Ic()({path:(0,it.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,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(jc,{icon:"page"===e.subtype?Ec:Tc},"icon"),(0,Pc.decodeEntities)(e.title)]}),getOptionCompletion:e=>(0,et.jsx)("a",{href:e.url,children:e.title})},Rc=[];function Nc({completers:e=Rc}){const{name:t}=B();return(0,p.useMemo)((()=>{let n=[...e,Mc];return(t===(0,d.getDefaultBlockName)()||(0,d.getBlockSupport)(t,"__experimentalSlashInserter",!1))&&(n=[...n,Cc]),(0,m.hasFilter)("editor.Autocomplete.completers")&&(n===e&&(n=n.map((e=>({...e})))),n=(0,m.applyFilters)("editor.Autocomplete.completers",n,t)),n}),[e,t])}const Lc=function(e){return(0,et.jsx)(le.Autocomplete,{...e,completers:Nc(e)})};var Ac=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})}),Dc=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z"})}),Oc=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})}),zc=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})}),Vc=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M4 4H5.5V20H4V4ZM7 10L17 10V14L7 14V10ZM20 4H18.5V20H20V4Z"})}),Fc=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})}),Hc=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"})});const Gc={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 $c(e,t=""){return e.split(",").map((e=>`${e}${t?` ${t}`:""}`)).join(",")}function Uc(e,t=Gc,n,o){var i,l;let r="";return null!=t&&null!==(i=t[n])&&void 0!==i&&null!==(l=i.spacingStyles)&&void 0!==l&&l.length&&o&&t[n].spacingStyles.forEach((t=>{r+=`${$c(e,t.selector.trim())} { `,r+=Object.entries(t.rules).map((([e,t])=>`${e}: ${t||o}`)).join("; "),r+="; }"})),r}function Wc(e){const{contentSize:t,wideSize:n,type:o="default"}=e,i={},l=/^(?!0)\d+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i;return l.test(t)&&"constrained"===o&&(// translators: %s: container size (i.e. 600px etc)
i.none=(0,vt.sprintf)((0,vt.__)("Max %s wide","kubio"),t)),l.test(n)&&(// translators: %s: container size (i.e. 600px etc)
i.wide=(0,vt.sprintf)((0,vt.__)("Max %s wide","kubio"),n)),i}var Kc=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z"})}),Zc=(0,et.jsxs)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,et.jsx)(an.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,et.jsx)(an.Path,{d:"m4.5 7.5v9h1.5v-9z"}),(0,et.jsx)(an.Path,{d:"m18 7.5v9h1.5v-9z"})]}),qc=(0,et.jsxs)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,et.jsx)(an.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,et.jsx)(an.Path,{d:"m7.5 6h9v-1.5h-9z"}),(0,et.jsx)(an.Path,{d:"m7.5 19.5h9v-1.5h-9z"})]}),Yc=(0,et.jsxs)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,et.jsx)(an.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,et.jsx)(an.Path,{d:"m16.5 6h-9v-1.5h9z"})]}),Qc=(0,et.jsxs)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,et.jsx)(an.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,et.jsx)(an.Path,{d:"m18 16.5v-9h1.5v9z"})]}),Xc=(0,et.jsxs)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,et.jsx)(an.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,et.jsx)(an.Path,{d:"m16.5 19.5h-9v-1.5h9z"})]}),Jc=(0,et.jsxs)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,et.jsx)(an.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,et.jsx)(an.Path,{d:"m4.5 16.5v-9h1.5v9z"})]});const eu=8,tu=["top","right","bottom","left"],nu={top:void 0,right:void 0,bottom:void 0,left:void 0},ou={custom:Kc,axial:Kc,horizontal:Zc,vertical:qc,top:Yc,right:Qc,bottom:Xc,left:Jc},iu={default:(0,vt.__)("Spacing control"),top:(0,vt.__)("Top"),bottom:(0,vt.__)("Bottom"),left:(0,vt.__)("Left"),right:(0,vt.__)("Right"),mixed:(0,vt.__)("Mixed"),vertical:(0,vt.__)("Vertical"),horizontal:(0,vt.__)("Horizontal"),axial:(0,vt.__)("Horizontal & vertical"),custom:(0,vt.__)("Custom")},lu={axial:"axial",top:"top",right:"right",bottom:"bottom",left:"left",custom:"custom"};function ru(e){return!(null==e||!e.includes)&&("0"===e||e.includes("var:preset|spacing|"))}function su(e,t){if(!ru(e))return e;const n=function(e){if(!e)return;if("0"===e||"default"===e)return e;const t=e.match(/var:preset\|spacing\|(.+)/);return t?t[1]:void 0}(e),o=t.find((e=>String(e.slug)===n));return null==o?void 0:o.size}function au(e,t){if(!e||ru(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 cu(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function uu(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 du(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=cu(null==n?void 0:n.top)||t,i=cu(null==n?void 0:n.left)||t;return o===i?o:`${o} ${i}`}const pu={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},hu={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},gu={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},mu=["wrap","nowrap"],fu={name:"flex",label:(0,vt.__)("Flex"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowOrientation:o=!0,allowJustification:i=!0,allowWrap:l=!0}=n;return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsxs)(le.Flex,{children:[i&&(0,et.jsx)(le.FlexItem,{children:(0,et.jsx)(ku,{layout:e,onChange:t})}),o&&(0,et.jsx)(le.FlexItem,{children:(0,et.jsx)(yu,{layout:e,onChange:t})})]}),l&&(0,et.jsx)(_u,{layout:e,onChange:t})]})},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){const{allowVerticalAlignment:o=!0,allowJustification:i=!0}=n;return i||o?(0,et.jsxs)(Qy,{group:"block",__experimentalShareWithChildBlocks:!0,children:[i&&(0,et.jsx)(ku,{layout:e,onChange:t,isToolbar:!0}),o&&(0,et.jsx)(vu,{layout:e,onChange:t})]}):null},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:o,hasBlockGapSupport:i,globalBlockGapValue:l,layoutDefinitions:r=Gc}){var s,a;const{orientation:c="horizontal"}=t;let u="0.5em";if(l){const e=du(l,"0.5em").split(" ");u=e.length>1?e[1]:e[0]}const d=null!=n&&null!==(s=n.spacing)&&void 0!==s&&s.blockGap&&!QN(o,"spacing","blockGap")?du(null==n||null===(a=n.spacing)||void 0===a?void 0:a.blockGap,u):void 0,p=pu[t.justifyContent],h=mu.includes(t.flexWrap)?t.flexWrap:"wrap",g=gu[t.verticalAlignment],m=hu[t.justifyContent]||hu.left;let f="";const v=[];return h&&"wrap"!==h&&v.push(`flex-wrap: ${h}`),"horizontal"===c?(g&&v.push(`align-items: ${g}`),p&&v.push(`justify-content: ${p}`)):(g&&v.push(`justify-content: ${g}`),v.push("flex-direction: column"),v.push(`align-items: ${m}`)),v.length&&(f=`${$c(e)} {\n\t\t\t\t${v.join("; ")};\n\t\t\t}`),i&&d&&(f+=Uc(e,r,"flex",d)),f},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function vu({layout:e,onChange:t}){const{orientation:n="horizontal"}=e,o="horizontal"===n?"center":"top",{verticalAlignment:i=o}=e;return(0,et.jsx)(sC,{onChange:n=>{t({...e,verticalAlignment:n})},value:i,controls:"horizontal"===n?["top","center","bottom","stretch"]:["top","center","bottom","space-between"]})}const bu={placement:"bottom-start"};function ku({layout:e,onChange:t,isToolbar:n=!1}){const{justifyContent:o="left",orientation:i="horizontal"}=e,l=n=>{t({...e,justifyContent:n})},r=["left","center","right"];if("horizontal"===i?r.push("space-between"):r.push("stretch"),n)return(0,et.jsx)(xI,{allowedControls:r,value:o,onChange:l,popoverProps:bu});const s=[{value:"left",icon:Ac,label:(0,vt.__)("Justify items left")},{value:"center",icon:Dc,label:(0,vt.__)("Justify items center")},{value:"right",icon:Oc,label:(0,vt.__)("Justify items right")}];return"horizontal"===i?s.push({value:"space-between",icon:zc,label:(0,vt.__)("Space between items")}):s.push({value:"stretch",icon:Vc,label:(0,vt.__)("Stretch items")}),(0,et.jsx)(le.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,label:(0,vt.__)("Justification"),value:o,onChange:l,className:"block-editor-hooks__flex-layout-justification-controls",children:s.map((({value:e,icon:t,label:n})=>(0,et.jsx)(le.__experimentalToggleGroupControlOptionIcon,{value:e,icon:t,label:n},e)))})}function _u({layout:e,onChange:t}){const{flexWrap:n="wrap"}=e;return(0,et.jsx)(le.ToggleControl,{label:(0,vt.__)("Allow to wrap to multiple lines"),onChange:n=>{t({...e,flexWrap:n?"wrap":"nowrap"})},checked:"wrap"===n})}function yu({layout:e,onChange:t}){const{orientation:n="horizontal",verticalAlignment:o,justifyContent:i}=e;return(0,et.jsxs)(le.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,vt.__)("Orientation"),value:n,onChange:n=>{let l=o,r=i;return"horizontal"===n?("space-between"===o&&(l="center"),"stretch"===i&&(r="left")):("stretch"===o&&(l="top"),"space-between"===i&&(r="left")),t({...e,orientation:n,verticalAlignment:l,justifyContent:r})},children:[(0,et.jsx)(le.__experimentalToggleGroupControlOptionIcon,{icon:Fc,value:"horizontal",label:(0,vt.__)("Horizontal")}),(0,et.jsx)(le.__experimentalToggleGroupControlOptionIcon,{icon:Hc,value:"vertical",label:(0,vt.__)("Vertical")})]})}const xu={name:"default",label:(0,vt.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,style:t,blockName:n,hasBlockGapSupport:o,layoutDefinitions:i=Gc}){var l;const r=du(null==t||null===(l=t.spacing)||void 0===l?void 0:l.blockGap);let s="";QN(n,"spacing","blockGap")||(null!=r&&r.top?s=du(null==r?void 0:r.top):"string"==typeof r&&(s=du(r)));let a="";return o&&s&&(a+=Uc(e,i,"default",s)),a},getOrientation:()=>"vertical",getAlignments(e,t){const n=Wc(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}};var Su=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM5 9h14v6H5V9Z"})}),wu=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M16 5.5H8V4h8v1.5ZM16 20H8v-1.5h8V20ZM5 9h14v6H5V9Z"})}),Cu="var:",Bu="|",Iu="--",ju=(e,t)=>{let n=e;return t.forEach((e=>{n=n?.[e]})),n};function Eu(e,t,n,o){const i=ju(e,n);return i?[{selector:t?.selector,key:o,value:Pu(i)}]:[]}function Tu(e,t,n,o,i=["top","right","bottom","left"]){const l=ju(e,n);if(!l)return[];const r=[];if("string"==typeof l)r.push({selector:t?.selector,key:o.default,value:Pu(l)});else{const e=i.reduce(((e,n)=>{const i=Pu(ju(l,[n]));return i&&e.push({selector:t?.selector,key:o?.individual.replace("%s",Mu(n)),value:i}),e}),[]);r.push(...e)}return r}function Pu(e){return"string"==typeof e&&e.startsWith(Cu)?`var(--wp--${e.slice(Cu.length).split(Bu).map((e=>Ke(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(Iu)})`:e}function Mu(e){const[t,...n]=e;return t.toUpperCase()+n.join("")}function Ru(e){try{return decodeURI(e)}catch(t){return e}}function Nu(e){return(t,n)=>Eu(t,n,e,function(e){const[t,...n]=e;return t.toLowerCase()+n.map(Mu).join("")}(e))}function Lu(e){return(t,n)=>["color","style","width"].flatMap((o=>Nu(["border",e,o])(t,n)))}var Au={name:"radius",generate:(e,t)=>Tu(e,t,["border","radius"],{default:"borderRadius",individual:"border%sRadius"},["topLeft","topRight","bottomLeft","bottomRight"])},Du={name:"background",generate:(e,t)=>Eu(e,t,["color","background"],"backgroundColor")},Ou={name:"gradient",generate:(e,t)=>Eu(e,t,["color","gradient"],"background")},zu={name:"text",generate:(e,t)=>Eu(e,t,["color","text"],"color")},Vu={name:"height",generate:(e,t)=>Eu(e,t,["dimensions","height"],"height")},Fu={name:"minHeight",generate:(e,t)=>Eu(e,t,["dimensions","minHeight"],"minHeight")},Hu={name:"aspectRatio",generate:(e,t)=>Eu(e,t,["dimensions","aspectRatio"],"aspectRatio")},Gu={name:"width",generate:(e,t)=>Eu(e,t,["dimensions","width"],"width")},$u={name:"backgroundImage",generate:(e,t)=>{const n=e?.background?.backgroundImage;return"object"==typeof n&&n?.url?[{selector:t.selector,key:"backgroundImage",value:`url( '${encodeURI(Ru(n.url))}' )`}]:Eu(e,t,["background","backgroundImage"],"backgroundImage")}},Uu={name:"backgroundPosition",generate:(e,t)=>Eu(e,t,["background","backgroundPosition"],"backgroundPosition")},Wu={name:"backgroundRepeat",generate:(e,t)=>Eu(e,t,["background","backgroundRepeat"],"backgroundRepeat")},Ku={name:"backgroundSize",generate:(e,t)=>Eu(e,t,["background","backgroundSize"],"backgroundSize")},Zu={name:"backgroundAttachment",generate:(e,t)=>Eu(e,t,["background","backgroundAttachment"],"backgroundAttachment")},qu={name:"shadow",generate:(e,t)=>Eu(e,t,["shadow"],"boxShadow")},Yu={name:"color",generate:(e,t,n=["outline","color"],o="outlineColor")=>Eu(e,t,n,o)},Qu={name:"offset",generate:(e,t,n=["outline","offset"],o="outlineOffset")=>Eu(e,t,n,o)},Xu={name:"style",generate:(e,t,n=["outline","style"],o="outlineStyle")=>Eu(e,t,n,o)},Ju={name:"width",generate:(e,t,n=["outline","width"],o="outlineWidth")=>Eu(e,t,n,o)},ed={name:"padding",generate:(e,t)=>Tu(e,t,["spacing","padding"],{default:"padding",individual:"padding%s"})},td={name:"margin",generate:(e,t)=>Tu(e,t,["spacing","margin"],{default:"margin",individual:"margin%s"})},nd={name:"fontSize",generate:(e,t)=>Eu(e,t,["typography","fontSize"],"fontSize")},od={name:"fontStyle",generate:(e,t)=>Eu(e,t,["typography","fontStyle"],"fontStyle")},id={name:"fontWeight",generate:(e,t)=>Eu(e,t,["typography","fontWeight"],"fontWeight")},ld={name:"fontFamily",generate:(e,t)=>Eu(e,t,["typography","fontFamily"],"fontFamily")},rd={name:"letterSpacing",generate:(e,t)=>Eu(e,t,["typography","letterSpacing"],"letterSpacing")},sd={name:"lineHeight",generate:(e,t)=>Eu(e,t,["typography","lineHeight"],"lineHeight")},ad={name:"textColumns",generate:(e,t)=>Eu(e,t,["typography","textColumns"],"columnCount")},cd={name:"textDecoration",generate:(e,t)=>Eu(e,t,["typography","textDecoration"],"textDecoration")},ud={name:"textIndent",generate:(e,t)=>Eu(e,t,["typography","textIndent"],"textIndent")},dd={name:"textTransform",generate:(e,t)=>Eu(e,t,["typography","textTransform"],"textTransform")},pd={name:"writingMode",generate:(e,t)=>Eu(e,t,["typography","writingMode"],"writingMode")},hd=[{name:"color",generate:Nu(["border","color"])},{name:"style",generate:Nu(["border","style"])},{name:"width",generate:Nu(["border","width"])},Au,{name:"borderTop",generate:Lu("top")},{name:"borderRight",generate:Lu("right")},{name:"borderBottom",generate:Lu("bottom")},{name:"borderLeft",generate:Lu("left")},zu,Ou,Du,Vu,Fu,Hu,Gu,Yu,Xu,Qu,Ju,td,ed,ld,nd,od,id,rd,sd,ad,cd,ud,dd,pd,qu,$u,Uu,Wu,Ku,Zu];function gd(e,t={}){const n=md(e,t);if(!t?.selector){const e=[];return n.forEach((t=>{e.push(`${Ke(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=>`${Ke(e.key)}: ${e.value};`)).join(" ")} }`),e)),[]).join("\n")}function md(e,t={}){const n=[];return hd.forEach((o=>{"function"==typeof o.generate&&n.push(...o.generate(e,t))})),n}const fd={name:"constrained",label:(0,vt.__)("Constrained"),inspectorControls:function({layout:e,onChange:t,layoutBlockSupport:n={}}){const{wideSize:o,contentSize:i,justifyContent:l="center"}=e,{allowJustification:r=!0,allowCustomContentAndWideSize:s=!0}=n,a=[{value:"left",icon:Ac,label:(0,vt.__)("Justify items left")},{value:"center",icon:Dc,label:(0,vt.__)("Justify items center")},{value:"right",icon:Oc,label:(0,vt.__)("Justify items right")}],[c]=wa("spacing.units"),u=(0,le.__experimentalUseCustomUnits)({availableUnits:c||["%","px","em","rem","vw"]});return(0,et.jsxs)(le.__experimentalVStack,{spacing:4,className:"block-editor-hooks__layout-constrained",children:[s&&(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(le.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,vt.__)("Content width"),labelPosition:"top",value:i||o||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,contentSize:""!==n?n:void 0})},units:u,prefix:(0,et.jsx)(le.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,et.jsx)(jc,{icon:Su})})}),(0,et.jsx)(le.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,vt.__)("Wide width"),labelPosition:"top",value:o||i||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,wideSize:""!==n?n:void 0})},units:u,prefix:(0,et.jsx)(le.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,et.jsx)(jc,{icon:wu})})}),(0,et.jsx)("p",{className:"block-editor-hooks__layout-constrained-helptext",children:(0,vt.__)("Customize the width for all elements that are assigned to the center or wide columns.")})]}),r&&(0,et.jsx)(le.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,label:(0,vt.__)("Justification"),value:l,onChange:n=>{t({...e,justifyContent:n})},children:a.map((({value:e,icon:t,label:n})=>(0,et.jsx)(le.__experimentalToggleGroupControlOptionIcon,{value:e,icon:t,label:n},e)))})]})},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){const{allowJustification:o=!0}=n;return o?(0,et.jsx)(Qy,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,et.jsx)(bd,{layout:e,onChange:t})}):null},getLayoutStyle:function({selector:e,layout:t={},style:n,blockName:o,hasBlockGapSupport:i,layoutDefinitions:l=Gc}){var r,s;const{contentSize:a,wideSize:c,justifyContent:u}=t,d=du(null==n||null===(r=n.spacing)||void 0===r?void 0:r.blockGap);let p="";QN(o,"spacing","blockGap")||(null!=d&&d.top?p=du(null==d?void 0:d.top):"string"==typeof d&&(p=du(d)));const h="left"===u?"0 !important":"auto !important",g="right"===u?"0 !important":"auto !important";let m=a||c?`\n\t\t\t\t\t${$c(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${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${$c(e,"> .alignwide")}  {\n\t\t\t\t\t\tmax-width: ${c??a};\n\t\t\t\t\t}\n\t\t\t\t\t${$c(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?m+=`${$c(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${h}; }`:"right"===u&&(m+=`${$c(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&&md(n).forEach((t=>{"paddingRight"===t.key?m+=`\n\t\t\t\t\t${$c(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${t.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`:"paddingLeft"===t.key&&(m+=`\n\t\t\t\t\t${$c(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&&(m+=Uc(e,l,"constrained",p)),m},getOrientation:()=>"vertical",getAlignments(e){const t=Wc(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}},vd={placement:"bottom-start"};function bd({layout:e,onChange:t}){const{justifyContent:n="center"}=e;return(0,et.jsx)(xI,{allowedControls:["left","center","right"],value:n,onChange:n=>{t({...e,justifyContent:n})},popoverProps:vd})}const kd={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},_d=[{value:"px",label:"px",default:0},{value:"rem",label:"rem",default:0},{value:"em",label:"em",default:0}],yd={name:"grid",label:(0,vt.__)("Grid"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowSizingOnChildren:o=!1}=n,i=!(null!=e&&e.isManualPlacement)||window.__experimentalEnableGridInteractivity;return(0,et.jsxs)(et.Fragment,{children:[window.__experimentalEnableGridInteractivity&&(0,et.jsx)(wd,{layout:e,onChange:t}),(0,et.jsxs)(le.__experimentalVStack,{spacing:4,children:[(0,et.jsx)(Sd,{layout:e,onChange:t,allowSizingOnChildren:o}),i&&(0,et.jsx)(xd,{layout:e,onChange:t})]})]})},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:o,hasBlockGapSupport:i,globalBlockGapValue:l,layoutDefinitions:r=Gc}){var s,a;const{minimumColumnWidth:c=null,columnCount:u=null,rowCount:d=null}=t;let p="1.2rem";if(l){const e=du(l,"0.5em").split(" ");p=e.length>1?e[1]:e[0]}const h=null!=n&&null!==(s=n.spacing)&&void 0!==s&&s.blockGap&&!QN(o,"spacing","blockGap")?du(null==n||null===(a=n.spacing)||void 0===a?void 0:a.blockGap,p):void 0;let g="";const m=[];if(c&&u>0){let e=h||p;"0"!==e&&0!==e||(e="0px");const t=`max(min( ${c}, 100%), ( 100% - (${e}*${u-1}) ) / ${u})`;m.push(`grid-template-columns: repeat(auto-fill, minmax(${t}, 1fr))`,"container-type: inline-size"),d&&m.push(`grid-template-rows: repeat(${d}, minmax(1rem, auto))`)}else u?(m.push(`grid-template-columns: repeat(${u}, minmax(0, 1fr))`),d&&m.push(`grid-template-rows: repeat(${d}, minmax(1rem, auto))`)):m.push(`grid-template-columns: repeat(auto-fill, minmax(min(${c||"12rem"}, 100%), 1fr))`,"container-type: inline-size");return m.length&&(g=`${$c(e)} { ${m.join("; ")}; }`),i&&h&&(g+=Uc(e,r,"grid",h)),g},getOrientation:()=>"horizontal",getAlignments:()=>[]};function xd({layout:e,onChange:t}){const{minimumColumnWidth:n,columnCount:o,isManualPlacement:i}=e,l=n||(i||o?null:"12rem"),[r,s="rem"]=(0,le.__experimentalParseQuantityAndUnitFromRawValue)(l);return(0,et.jsxs)("fieldset",{className:"block-editor-hooks__grid-layout-minimum-width-control",children:[(0,et.jsx)(le.BaseControl.VisualLabel,{as:"legend",children:(0,vt.__)("Min. column width")}),(0,et.jsxs)(le.Flex,{gap:4,children:[(0,et.jsx)(le.FlexItem,{isBlock:!0,children:(0,et.jsx)(le.__experimentalUnitControl,{size:"__unstable-large",onChange:n=>{t({...e,minimumColumnWidth:""===n?void 0:n})},onUnitChange:n=>{let o;["em","rem"].includes(n)&&"px"===s?o=(r/16).toFixed(2)+n:["em","rem"].includes(s)&&"px"===n&&(o=Math.round(16*r)+n),t({...e,minimumColumnWidth:o})},value:l,units:_d,min:0,label:(0,vt.__)("Minimum column width"),hideLabelFromVision:!0})}),(0,et.jsx)(le.FlexItem,{isBlock:!0,children:(0,et.jsx)(le.RangeControl,{__next40pxDefaultSize:!0,onChange:n=>{t({...e,minimumColumnWidth:[n,s].join("")})},value:r||0,min:0,max:kd[s]||600,withInputField:!1,label:(0,vt.__)("Minimum column width"),hideLabelFromVision:!0})})]}),(0,et.jsx)("p",{className:"components-base-control__help",children:(0,vt.__)("Columns will wrap to fewer per row when they can no longer maintain the minimum width.")})]})}function Sd({layout:e,onChange:t,allowSizingOnChildren:n}){const o=void 0,{columnCount:i=o,rowCount:l,isManualPlacement:r}=e;return(0,et.jsx)(et.Fragment,{children:(0,et.jsxs)("fieldset",{className:"block-editor-hooks__grid-layout-columns-and-rows-controls",children:[!r&&(0,et.jsx)(le.BaseControl.VisualLabel,{as:"legend",children:(0,vt.__)("Max. columns")}),(0,et.jsxs)(le.Flex,{gap:4,children:[(0,et.jsx)(le.FlexItem,{isBlock:!0,children:(0,et.jsx)(le.__experimentalNumberControl,{size:"__unstable-large",onChange:n=>{const o=""===n||"0"===n?r?1:void 0:parseInt(n,10);t({...e,columnCount:o})},value:i,min:1,label:(0,vt.__)("Columns"),hideLabelFromVision:!r})}),(0,et.jsx)(le.FlexItem,{isBlock:!0,children:n&&r?(0,et.jsx)(le.__experimentalNumberControl,{size:"__unstable-large",onChange:n=>{const o=""===n||"0"===n?1:parseInt(n,10);t({...e,rowCount:o})},value:l,min:1,label:(0,vt.__)("Rows")}):(0,et.jsx)(le.RangeControl,{__next40pxDefaultSize:!0,value:i??1,onChange:n=>t({...e,columnCount:""===n||"0"===n?1:n}),min:1,max:16,withInputField:!1,label:(0,vt.__)("Columns"),hideLabelFromVision:!0})})]})]})})}function wd({layout:e,onChange:t}){const{columnCount:n,rowCount:o,minimumColumnWidth:i,isManualPlacement:l}=e,[r,s]=(0,p.useState)(n||3),[a,c]=(0,p.useState)(o),[u,d]=(0,p.useState)(i||"12rem"),h=l?"manual":"auto",g="manual"===h?(0,vt.__)("Grid items can be manually placed in any position on the grid."):(0,vt.__)("Grid items are placed automatically depending on their order.");return(0,et.jsxs)(le.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,label:(0,vt.__)("Grid item position"),value:h,onChange:l=>{"manual"===l?d(i||"12rem"):(s(n||3),c(o)),t({...e,columnCount:r,rowCount:"manual"===l?a:void 0,isManualPlacement:"manual"===l||void 0,minimumColumnWidth:"auto"===l?u:null})},isBlock:!0,help:g,children:[(0,et.jsx)(le.__experimentalToggleGroupControlOption,{value:"auto",label:(0,vt.__)("Auto")},"auto"),(0,et.jsx)(le.__experimentalToggleGroupControlOption,{value:"manual",label:(0,vt.__)("Manual")},"manual")]})}const Cd=[xu,fu,fd,yd];function Bd(e="default"){return Cd.find((t=>t.name===e))}const Id={type:"default"},jd=(0,p.createContext)(Id),Ed=jd.Provider;function Td(){return(0,p.useContext)(jd)}function Pd({layout:e={},css:t,...n}){const o=Bd(e.type),[i]=wa("spacing.blockGap"),l=null!==i;if(o){var r;if(t)return(0,et.jsx)("style",{children:t});const i=null===(r=o.getLayoutStyle)||void 0===r?void 0:r.call(o,{hasBlockGapSupport:l,layout:e,...n});if(i)return(0,et.jsx)("style",{children:i})}return null}const Md=[],Rd=["none","left","center","right","wide","full"],Nd=["wide","full"];function Ld(e=Rd){e.includes("none")||(e=["none",...e]);const t=1===e.length&&"none"===e[0],[n,o,i]=(0,h.useSelect)((e=>{if(t)return[!1,!1,!1];const n=e(ba).getSettings();return[n.alignWide??!1,n.supportsLayout,n.__unstableIsBlockBasedTheme]}),[t]),l=Td();if(t)return Md;const r=Bd(null==l?void 0:l.type);if(o){const t=r.getAlignments(l,i).filter((t=>e.includes(t.name)));return 1===t.length&&"none"===t[0].name?Md:t}if("default"!==r.name&&"constrained"!==r.name)return Md;const s=e.filter((e=>l.alignments?l.alignments.includes(e):!(!n&&Nd.includes(e))&&Rd.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?Md:s}var Ad=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M5 5.5h8V4H5v1.5ZM5 20h8v-1.5H5V20ZM19 9H5v6h14V9Z"})}),Dd=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM7 9h10v6H7V9Z"})}),Od=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M19 5.5h-8V4h8v1.5ZM19 20h-8v-1.5h8V20ZM5 9h14v6H5V9Z"})}),zd=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M5 4h14v11H5V4Zm11 16H8v-1.5h8V20Z"})});const Vd={none:{icon:Su,title:(0,vt._x)("None","Alignment option")},left:{icon:Ad,title:(0,vt.__)("Align left")},center:{icon:Dd,title:(0,vt.__)("Align center")},right:{icon:Od,title:(0,vt.__)("Align right")},wide:{icon:wu,title:(0,vt.__)("Wide width")},full:{icon:zd,title:(0,vt.__)("Full width")}},Fd=function({value:e,onChange:t,controls:n,isToolbar:o,isCollapsed:i=!0}){const l=Ld(n);if(!l.length)return null;function r(n){t([e,"none"].includes(n)?void 0:n)}const s=Vd[e],a=Vd.none,c=o?le.ToolbarGroup:le.ToolbarDropdownMenu,d={icon:s?s.icon:a.icon,label:(0,vt.__)("Align")},p=o?{isCollapsed:i,controls:l.map((({name:t})=>({...Vd[t],isActive:e===t||!e&&"none"===t,role:i?"menuitemradio":void 0,onClick:()=>r(t)})))}:{toggleProps:{description:(0,vt.__)("Change alignment")},children:({onClose:t})=>(0,et.jsx)(et.Fragment,{children:(0,et.jsx)(le.MenuGroup,{className:"block-editor-block-alignment-control__menu-group",children:l.map((({name:n,info:o})=>{const{icon:i,title:l}=Vd[n],s=n===e||!e&&"none"===n;return(0,et.jsx)(le.MenuItem,{icon:i,iconPosition:"left",className:u("components-dropdown-menu__menu-item",{"is-active":s}),isSelected:s,onClick:()=>{r(n),t()},role:"menuitemradio",info:o,children:l},n)}))})})};return(0,et.jsx)(c,{...d,...p})},Hd=e=>(0,et.jsx)(Fd,{...e,isToolbar:!1}),Gd=e=>(0,et.jsx)(Fd,{...e,isToolbar:!0});function $d(e){return!e||0===Object.keys(e).length}function Ud(e){const{clientId:t}=B(),n=e||t,{updateBlockAttributes:o}=(0,h.useDispatch)(ba),{getBlockAttributes:i}=(0,h.useRegistry)().select(ba);return{updateBlockBindings:e=>{const{metadata:{bindings:t,...l}={}}=i(n),r={...t};Object.entries(e).forEach((([e,t])=>{t||!r[e]?r[e]=t:delete r[e]}));const s={...l,bindings:r};$d(s.bindings)&&delete s.bindings,o(n,{metadata:$d(s)?void 0:s})},removeAllBlockBindings:()=>{const{metadata:{bindings:e,...t}={}}=i(n);o(n,{metadata:$d(t)?void 0:t})}}}const{Menu:Wd}=fe(le.privateApis);function Kd({args:e,attribute:t,field:n,source:o,sourceKey:i}){const l=(0,p.useMemo)((()=>({source:i,args:n.args||{key:n.key}})),[n.args,n.key,i]),r=(0,p.useContext)(ot),s=(0,h.useSelect)((e=>o.getValues({select:e,context:r,bindings:{[t]:l}})),[t,r,l,o]),{updateBlockBindings:a}=Ud();return(0,et.jsxs)(Wd.CheckboxItem,{onChange:()=>{const o=kt()(e,n.args)??n.key===(null==e?void 0:e.key);a(o?{[t]:void 0}:{[t]:l})},name:t+"-binding",value:s[t],checked:kt()(e,n.args)??n.key===(null==e?void 0:e.key),children:[(0,et.jsx)(Wd.ItemLabel,{children:n.label}),(0,et.jsx)(Wd.ItemHelpText,{children:s[t]})]})}function Zd({args:e,attribute:t,sourceKey:n,fields:o}){const i=(0,g.useViewportMatch)("medium","<");if(!o||0===o.length)return null;const l=(0,d.getBlockBindingsSource)(n);return(0,et.jsxs)(Wd,{placement:i?"bottom-start":"left-start",children:[(0,et.jsx)(Wd.SubmenuTriggerItem,{children:(0,et.jsx)(Wd.ItemLabel,{children:l.label})}),(0,et.jsx)(Wd.Popover,{gutter:8,children:(0,et.jsx)(Wd.Group,{children:o.map((o=>(0,et.jsx)(Kd,{args:e,attribute:t,field:o,source:l,sourceKey:n},n+JSON.stringify(o.args)||o.key)))})})]},n)}const{Menu:qd}=fe(le.privateApis);function Yd({attribute:e,binding:t,blockName:n}){const{updateBlockBindings:o}=Ud(),i=(0,g.useViewportMatch)("medium","<"),l=(0,p.useContext)(ot),r=(0,h.useSelect)((t=>{var o,i;const{getAllBlockBindingsSources:r,getBlockBindingsSourceFieldsList:s,getBlockType:a}=fe(t(d.store)),c=null===(o=a(n).attributes)||void 0===o||null===(i=o[e])||void 0===i?void 0:i.type,u="rich-text"===c?"string":c,p={};return Object.entries(r()).forEach((([e,t])=>{const n=s(t,l);if(null==n||!n.length)return;const o=n.filter((e=>e.type===u));o.length&&(p[e]=o)})),p}),[e,n,l]),{canUpdateBlockBindings:s}=(0,h.useSelect)((e=>({canUpdateBlockBindings:e(ba).getSettings().canUpdateBlockBindings}))),a=Object.keys(r).length>0,c=!s||!a,{source:u,args:m}=t||{},f=(0,d.getBlockBindingsSource)(u);let v,b=!0;if(void 0===t)v=a?(0,vt.__)("Not connected"):(0,vt.__)("No sources available"),b=!0;else if(f){var k,_;v=(null==r||null===(k=r[u])||void 0===k||null===(_=k.find((e=>kt()(e.args,m))))||void 0===_?void 0:_.label)||(null==f?void 0:f.label)||u}else b=!1,v=(0,vt.__)("Source not registered");return(0,et.jsx)(le.__experimentalToolsPanelItem,{hasValue:()=>!!t,label:e,onDeselect:!!a&&(()=>{o({[e]:void 0})}),children:(0,et.jsxs)(qd,{placement:i?"bottom-start":"left-start",children:[(0,et.jsx)(qd.TriggerButton,{render:(0,et.jsx)(le.__experimentalItem,{}),disabled:!a,children:(0,et.jsxs)(le.__experimentalVStack,{className:"block-editor-bindings__item",spacing:0,children:[(0,et.jsx)(le.__experimentalText,{truncate:!0,children:e}),(0,et.jsx)(le.__experimentalText,{truncate:!0,variant:b?"muted":void 0,isDestructive:!b,children:v})]})}),!c&&(0,et.jsx)(qd.Popover,{gutter:i?8:36,children:(0,et.jsx)(qd,{placement:i?"bottom-start":"left-start",children:Object.entries(r).map((([n,o])=>(0,et.jsx)(Zd,{args:null==t?void 0:t.args,attribute:e,sourceKey:n,fields:o},n)))})})]})})}var Qd=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M12.75 19.45 15 17.5l1 1.1-4 3.4-4-3.4 1-1.1 2.25 1.95V14.5h1.5v4.95ZM19 12.75H5v-1.5h14v1.5ZM16 5.4l-1 1.1-2.25-1.95V9.5h-1.5V4.55L9 6.5 8 5.4 12 2l4 3.4Z"})});const Xd=function({isActive:e,label:t=(0,vt.__)("Full height"),onToggle:n,isDisabled:o}){return(0,et.jsx)(le.ToolbarButton,{isActive:e,icon:Qd,label:t,onClick:()=>n(!e),disabled:o})},Jd=window.wp.keycodes,ep=le.AlignmentMatrixControl||le.__experimentalAlignmentMatrixControl,tp=()=>{},np=function(e){const{label:t=(0,vt.__)("Change matrix alignment"),onChange:n=tp,value:o="center",isDisabled:i}=e,l=(0,et.jsx)(ep.Icon,{value:o});return(0,et.jsx)(le.Dropdown,{position:"bottom right",popoverProps:{placement:"bottom-start"},renderToggle:({onToggle:e,isOpen:n})=>(0,et.jsx)(le.ToolbarButton,{onClick:e,"aria-haspopup":"true","aria-expanded":n,onKeyDown:t=>{n||t.keyCode!==Jd.DOWN||(t.preventDefault(),e())},label:t,icon:l,showTooltip:!0,disabled:i}),renderContent:()=>(0,et.jsx)(ep,{onChange:n,value:o})})};var op=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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 ip({clientId:e,maximumLength:t,context:n}){const o=(0,h.useSelect)((t=>{if(!e)return null;const{getBlockName:o,getBlockAttributes:i}=t(ba),{getBlockType:l,getActiveBlockVariation:r}=t(d.store),s=o(e),a=l(s);if(!a)return null;const c=i(e),u=(0,d.__experimentalGetBlockLabel)(a,c,n);if(u!==a.title)return u;const p=r(s,c);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 lp({clientId:e,maximumLength:t,context:n}){return ip({clientId:e,maximumLength:t,context:n})}const rp=(0,p.createContext)({refsMap:Ve()});function sp({children:e}){const t=(0,p.useMemo)((()=>({refsMap:Ve()})),[]);return(0,et.jsx)(rp.Provider,{value:t,children:e})}function ap(e){const{refsMap:t}=(0,p.useContext)(rp);return(0,g.useRefEffect)((n=>(t.set(e,n),()=>t.delete(e))),[e])}rp.displayName="BlockRefsContext";const cp=function(e){const{refsMap:t}=(0,p.useContext)(rp),n=(0,p.useRef)();return n.current=e,(0,p.useMemo)((()=>({get current(){return t.get(n.current)??null}})),[t])};function up(e){const{refsMap:t}=(0,p.useContext)(rp);return ze(t,e)??null}function dp(e){if(!e)return null;const t=Array.from(document.querySelectorAll('iframe[name="editor-canvas"]').values()).find((t=>(t.contentDocument||t.contentWindow.document)===e.ownerDocument))??e;return(null==t?void 0:t.closest('[role="region"]'))??t}const pp=function({rootLabelText:e}){const{selectBlock:t,clearSelectedBlock:n}=(0,h.useDispatch)(ba),{clientId:o,parents:i,hasSelection:l}=(0,h.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getEnabledBlockParents:o}=fe(e(ba)),i=n();return{parents:o(i),clientId:i,hasSelection:!!t().clientId}}),[]),r=e||(0,vt._x)("Document","noun, breadcrumb"),s=(0,p.useRef)();return cp(o,s),(0,et.jsxs)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,vt.__)("Block breadcrumb"),children:[(0,et.jsxs)("li",{className:l?void 0:"block-editor-block-breadcrumb__current","aria-current":l?void 0:"true",children:[l&&(0,et.jsx)(le.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=dp(o))||void 0===t||t.focus()},children:r}),!l&&(0,et.jsx)("span",{children:r}),!!o&&(0,et.jsx)(jc,{icon:op,className:"block-editor-block-breadcrumb__separator"})]}),i.map((e=>(0,et.jsxs)("li",{children:[(0,et.jsx)(le.Button,{size:"small",className:"block-editor-block-breadcrumb__button",onClick:()=>t(e),children:(0,et.jsx)(lp,{clientId:e,maximumLength:35,context:"breadcrumb"})}),(0,et.jsx)(jc,{icon:op,className:"block-editor-block-breadcrumb__separator"})]},e))),!!o&&(0,et.jsx)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true",children:(0,et.jsx)(lp,{clientId:o,maximumLength:35,context:"breadcrumb"})})]})};function hp(e){return(0,h.useSelect)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(ba);return n(e)}),[e])}var gp=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})});function mp(e){const{currentStep:t}=e,n=pe().get(bp,t);return(0,et.jsx)(n,{...e})}const fp="step1",vp="step2",bp={[fp]:function({areaLabel:e,setStep:t=pe().noop,setApplyTemplateOn:n=pe().noop}){const o=()=>{t(vp)},{currentTemplateLabel:i}=(0,h.useSelect)((e=>{var t;const{getCurrentPageTemplate:n,getCurrentPostType:o,getAvailablePageTemplates:i}=e(kn.STORE_KEY),l=o();let r=n();l===r&&(r="");const s=i();return{currentTemplateLabel:(null===(t=pe().find(s,{value:r}))||void 0===t?void 0:t.label)||""}}),[]);return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)("p",{dangerouslySetInnerHTML:{__html:""===i?(0,vt.sprintf)(// translators: %s - template part name (e.g. header/ footer/ sidebar)
// translators: %s - template part name (e.g. header/ footer/ sidebar)
(0,vt.__)("Would you like to apply this %s to all pages that are using the current template or only for this page?","kubio"),e):(0,vt.sprintf)(// translators: %1$s: area label, %2$s: current template label
// translators: %1$s: area label, %2$s: current template label
(0,vt.__)('Would you like to apply this %1$s to all pages that are using the "%2$s" template?',"kubio"),e,`<strong>${i}</strong>`)}}),(0,et.jsxs)(le.ButtonGroup,{className:"h-template-part-modal__button-group",children:[(0,et.jsx)(le.Button,{isLink:!0,onClick:()=>{n(kp.ALL_PAGES),o()},children:(0,vt.__)("Apply to all pages","kubio")}),(0,et.jsx)(sc.ProItem,{tag:le.Button,isPrimary:!0,onClick:()=>{n(kp.THIS_PAGE),o()},urlArgs:{source:"inserter",content:"create-template"},children:(0,vt.__)("Apply to this page only","kubio")})]})]})},[vp]:function({areaLabel:e,otherAreaLabel:t,onCloseModal:n,onInsert:o,pageTitle:i,isFrontPage:l,applyTemplateOn:r}){const s=(0,vt.sprintf)("%s template",i),[a,c]=(0,p.useState)(s),u=r===kp.ALL_PAGES,d=!l&&!u;return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsxs)("div",{children:[(0,et.jsx)("div",{className:"kubio-classic-theme-create-template-modal__step2__input",children:d&&(0,et.jsx)(le.__experimentalInputControl,{label:(0,vt.__)("Template name","kubio"),value:a,onChange:c,placeholder:(0,vt.__)("Eg. Page name - Template","kubio"),autoFocus:!0})}),(0,et.jsxs)("div",{className:"kubio-classic-theme-create-template-modal__step2__paragraph",children:[(0,et.jsx)("strong",{children:(0,vt.__)("Note: ","kubio")}),(0,et.jsx)("span",{children:(0,vt.sprintf)(// translators: %1$s: area label, %2$s: other area label
// translators: %1$s: area label, %2$s: other area label
(0,vt.__)("Applying this %1$s will also replace the %2$s on this page.","kubio"),e,t)})]}),(0,et.jsx)("div",{className:"kubio-classic-theme-create-template-modal__step2__paragraph",children:(0,vt.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,vt.__)("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,et.jsxs)(le.ButtonGroup,{className:"h-template-part-modal__button-group",children:[(0,et.jsx)(le.Button,{isLink:!0,onClick:n,children:(0,vt.__)("Cancel","kubio")}),(0,et.jsx)(le.Button,{isPrimary:!0,onClick:()=>{o(a)},children:(0,vt.sprintf)(// translators: %s: area label
// translators: %s: area label
(0,vt.__)("Change the %s","kubio"),e)})]})]})}},kp={ALL_PAGES:"allPages",THIS_PAGE:"thisPage"};function _p(e){return e?pe().cloneDeep(e).map((e=>{const t=_p(e.innerBlocks);return{...e,innerBlocks:t}})):e}function yp(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=pe().get(e,"innerBlocks");if(Array.isArray(o)){const e=yp(o,t);e&&(n=e)}})),n)}const xp=window.kubio.editorData,Sp="kubio/templates";const Cp=["header","footer","sidebar"];function Bp({onClose:e=pe().noop,onSuccess:t=pe().noop,area:n,innerBlocks:o,isFSEFrontPageButDoesNotHaveFrontPageTemplate:i=!1}){const[l,r]=(0,p.useState)(kp.THIS_PAGE),s=(0,h.useSelect)((e=>{var t,o;if(Cp.includes(n))return n;const{getBlock:i}=e("core/block-editor"),{getEntityRecord:l,getCurrentTheme:r}=e("core"),s=null===(t=r())||void 0===t?void 0:t.stylesheet,a=i(n),c=l("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:c,isFrontPage:u}=function({type:e,innerBlocks:t,applyTemplateOn:n}){const{storeData:o={},computedData:i={}}=(0,h.useSelect)((e=>e(Sp).getTemplateData()),[]),{currentPage:l={},postId:r,postType:s,templates:a}=o,{configPerType:c={}}=i,{pageTitle:u,isFrontPage:g,getEntityRecords:m}=(0,h.useSelect)((e=>{var t;const{getEntityRecord:n,getEntityRecords:o,getEditedEntityRecord:i}=e("core"),l=n("postType",s,r),a=null==l||null===(t=l.title)||void 0===t?void 0:t.raw,c=i("root","site");return{pageTitle:a,isFrontPage:(null==c?void 0:c.page_on_front)==r,getEntityRecords:o}})),f=(0,p.useRef)(!1),v=(0,p.useRef)(!1),b=["kubio-full-width","full-width"],k=(0,p.useMemo)((()=>a.find((e=>b.includes(e.slug)))),[JSON.stringify(a)]),_=pe().get(c,e,{}),y=pe().get(_,"label","Part"),x=pe().get(_,"blockName"),{editEntityRecord:S,saveEntityRecord:w,saveEditedEntityRecord:C}=(0,h.useDispatch)("core"),{setPage:B}=(0,h.useDispatch)("kubio/edit-site"),{createErrorNotice:I,createSuccessNotice:j}=function(){const{createErrorNotice:e,createSuccessNotice:t}=(0,h.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,p.useRef)(),P=(0,xp.useSetGlobalSessionProp)("ready"),M=()=>{clearTimeout(T.current),T.current=setTimeout((()=>{P(!0)}),3e3)},R=async e=>{const{link:t}=l;let n;try{const e=new URL(t);e.searchParams.append("random",Math.random());const o=e.toString();n=(0,it.getPathAndQueryString)(o)}catch(e){}finally{M()}await B({path:n,context:{postType:s,postId:r}},e)};return{onNewTemplate:async(o=`${u} template`)=>{try{var i;if(f.current)return;f.current=!0,clearTimeout(T.current),P(!1);const l=_p((0,d.parse)(null==k||null===(i=k.content)||void 0===i?void 0:i.raw)),a={};let c,p,h,b=!1;if(g)h=!1,c=(0,vt.__)("Front Page","kubio"),p="front-page",a.kubio_template_source="kubio";else if(n===kp.ALL_PAGES){const e=m("postType","wp_template",{per_page:-1}).find((e=>"page"===e.slug));if(e)return async function(e){var n;const o=yp(_p((0,d.parse)(null==e||null===(n=e.content)||void 0===n?void 0:n.raw)),x),i=pe().get(o,["attributes","slug"]),l=`${pe().get(o,["attributes","theme"])}//${i}`,a={content:(0,d.serialize)(t)};return await S("postType","wp_template_part",l,a),await C("postType","wp_template_part",l),await S("postType",s,r,{template:""}),await R(e),!0}(e);h=!1,c="Page",p="page",a.kubio_template_source="kubio",b=!0}else h=!0,c=o,p=`${s}-${c}`;let _=`${c}-${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=`${u} ${e}`,o={title:n,slug:n,area:e,kubio_template_source:"kubio-custom",content:(0,d.serialize)(t)};return await w("postType","wp_template_part",o)}catch(e){I((0,vt.sprintf)(// translators: %s: type label
// translators: %s: type label
(0,vt.__)("Could not create new %s. Please try again later","kubio"),y))}finally{v.current=!1}}();B||E();const M=pe().get(B,"slug"),N=yp(l,x);pe().set(N,["attributes","slug"],M),h&&(a.kubio_template_source="kubio-custom");const L={title:c,slug:p,content:(0,d.serialize)(l),...a},A=await w("postType","wp_template",L);return A&&null!=A&&A.slug||E(),g||n===kp.ALL_PAGES||await S("postType",s,r,{template:null==A?void 0:A.slug}),(b||g)&&await S("postType",s,r,{template:""}),await R(A),j((0,vt.__)("New template created successfully","kubio")),A}catch(e){M(),I((0,vt.__)("Could not create new template. Please try again later","kubio"))}finally{f.current=!1}},pageTitle:u,isFrontPage:g}}({type:s,innerBlocks:o,isFSEFrontPageButDoesNotHaveFrontPageTemplate:i,applyTemplateOn:l,setApplyTemplateOn:r}),g=u?vp:fp,[m,f]=(0,p.useState)(g),v=()=>{e()},b=async n=>{e(),await a(n)&&t()};if((0,p.useEffect)((()=>{i&&b()}),[i]),i)return null;const k=s,_=s===(0,vt.__)("header","kubio")?(0,vt.__)("footer","kubio"):(0,vt.__)("header","kubio"),y=function(e){switch(e){case fp:return(0,vt.__)("Apply for all pages?","kubio");case vp:return(0,vt.__)("New template required","kubio")}}(m);return(0,et.jsx)(le.Modal,{title:y,onRequestClose:v,children:(0,et.jsx)("div",{className:"kubio-inserter-ignore-click-outisde kubio-classic-theme-create-template-modal",children:(0,et.jsx)(mp,{areaLabel:k,otherAreaLabel:_,onCloseModal:v,onInsert:b,pageTitle:c,applyTemplateOn:l,setApplyTemplateOn:r,currentStep:m,setStep:f,isFrontPage:u})})})}const Ip=[(0,p.createInterpolateElement)((0,vt.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks.","kubio"),{kbd:(0,et.jsx)("kbd",{})}),(0,p.createInterpolateElement)((0,vt.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line.","kubio"),{kbd:(0,et.jsx)("kbd",{})}),(0,p.createInterpolateElement)((0,vt.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line.","kubio"),{kbd:(0,et.jsx)("kbd",{})}),(0,vt.__)("Drag files into the editor to automatically insert media blocks.","kubio"),(0,vt.__)("Change a block's type by pressing the block icon on the toolbar.","kubio")],jp=function(){const[e]=(0,p.useState)(Math.floor(Math.random()*Ip.length));return(0,et.jsx)(le.Tip,{children:Ip[e]})};var Ep=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})}),Tp=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})});const Pp=function e({className:t,onChange:n,value:o,label:i,placeholder:l}){const r=(0,g.useInstanceId)(e),s=(0,p.useRef)();return(0,et.jsxs)("div",{className:yc()("block-editor-inserter__search",t),children:[(0,et.jsx)(le.VisuallyHidden,{as:"label",htmlFor:`block-editor-inserter__search-${r}`,children:i||l}),(0,et.jsx)("input",{autoFocus:!0,ref:s,className:"block-editor-inserter__search-input",id:`block-editor-inserter__search-${r}`,type:"search",placeholder:l,onChange:e=>n(e.target.value),autoComplete:"off",value:o||""}),(0,et.jsxs)("div",{className:"block-editor-inserter__search-icon",children:[!!o&&(0,et.jsx)(le.Button,{icon:Ep,label:(0,vt.__)("Reset search","kubio"),onClick:()=>{n(""),s.current.focus()}}),!o&&(0,et.jsx)(jc,{icon:Tp})]})]})};var Mp=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"})});function Rp({count:e,icon:t,isPattern:n,fadeWhenDisabled:o}){const i=n&&(0,vt.__)("Pattern","kubio");return(0,et.jsx)("div",{className:"block-editor-block-draggable-chip-wrapper",children:(0,et.jsx)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip",children:(0,et.jsxs)(le.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content",children:[(0,et.jsx)(le.FlexItem,{children:t?(0,et.jsx)(Sc,{icon:t}):i||(0,vt.sprintf)(/* translators: %d: Number of blocks. */ /* translators: %d: Number of blocks. */(0,vt._n)("%d block","%d blocks",e>=0?e:1,"kubio"),e>=0?e:1)}),(0,et.jsx)(le.FlexItem,{children:(0,et.jsx)(Sc,{icon:Mp})}),o&&(0,et.jsx)(le.FlexItem,{className:"block-editor-block-draggable-chip__disabled",children:(0,et.jsx)("span",{className:"block-editor-block-draggable-chip__disabled-icon"})})]})})})}const Np=({length:e,icon:t})=>(0,et.jsx)(Rp,{count:e,icon:t}),Lp="kubio-dragging-from-inserter--active",Ap=({isEnabled:e,blocks:t,icon:n,children:o,pattern:i})=>{const l={type:"inserter",blocks:t},{hideInsertionPoint:r}=(0,h.useDispatch)(ba),s=(0,h.useSelect)((e=>{var n;const{getBlockType:o}=e(d.store);return 1===t.length&&(null===(n=o(t[0].name))||void 0===n?void 0:n.icon)}),[t]),{startDragging:a,stopDragging:c}=fe((0,h.useDispatch)(ba));return e?(0,et.jsx)(le.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:l,onDragStart:e=>{a();const n=(null==i?void 0:i.type)===gn&&"unsynced"!==(null==i?void 0:i.syncStatus)?[(0,d.createBlock)("core/block",{ref:i.id})]:t;e.dataTransfer.setData("text/html",(0,d.serialize)(n))},onDragEnd:()=>{c()},__experimentalDragComponent:(0,et.jsx)(Np,{count:t.length,icon:n||!i&&s,isPattern:!!i}),children:({onDraggableStart:t,onDraggableEnd:n})=>o({draggable:e,onDragStart:e?(...e)=>{window.kubioDraggingData=l,r(),t(...e),setTimeout((()=>{const e=top.document.querySelector("body");e.classList.contains(Lp)||e.classList.add(Lp)}),10)}:void 0,onDragEnd:e?(...e)=>{n(...e),top.requestIdleCallback((()=>{setTimeout((()=>top.document.body.classList.remove(Lp)),10)}))}:void 0})}):o({draggable:!1,onDragStart:void 0,onDragEnd:void 0})},Dp=(0,p.createContext)(),Op=(0,p.forwardRef)((function(e,t){const[n,o]=(0,p.useState)(!1);return(0,p.useEffect)((()=>{n&&(0,gr.speak)((0,vt.__)("Use left and right arrow keys to move through blocks","kubio"))}),[n]),(0,et.jsx)("div",{ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)},...e})})),{CompositeGroupV2:zp}=fe(le.privateApis),Vp=(0,p.forwardRef)((function(e,t){const n=zp||le.__unstableCompositeGroup;return(0,et.jsx)(n,{role:"presentation",ref:t,...e})})),{CompositeItemV2:Fp}=fe(le.privateApis),Hp=(0,p.forwardRef)((function({isFirst:e,as:t,children:n,...o},i){const l=Fp||le.__unstableCompositeItem,r=o=>{const i={...o,tabIndex:e?0:o.tabIndex};return t?(0,et.jsx)(t,{...i,children:n}):"function"==typeof n?n(i):(0,et.jsx)(le.Button,{...i,children:n})};return(0,et.jsx)(l,{ref:i,role:"option",accessibleWhenDisabled:!0,...o,render:le.__unstableCompositeItem?void 0:r,children:!!le.__unstableCompositeItem&&r})}));const Gp=(0,p.forwardRef)((function(e,t){const[n,o]=(0,p.useState)(!1);return(0,p.useEffect)((()=>{n&&(0,gr.speak)((0,vt.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,et.jsx)("div",{ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)},...e})})),$p=(0,p.forwardRef)((function(e,t){return(0,et.jsx)(le.Composite.Group,{role:"presentation",ref:t,...e})})),Up=(0,p.forwardRef)((function({isFirst:e,as:t,children:n,...o},i){return(0,et.jsx)(le.Composite.Item,{ref:i,role:"option",accessibleWhenDisabled:!0,...o,render:o=>{const i={...o,tabIndex:e?0:o.tabIndex};return t?(0,et.jsx)(t,{...i,children:n}):"function"==typeof n?n(i):(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,...i,children:n})}})})),Wp=(0,re.wpVersionCompare)("6.7","<"),Kp=Wp?Op:Gp,Zp=Wp?Vp:$p,qp=Wp?Hp:Up,Yp=Wp?function({children:e}){const t=(0,le.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,et.jsx)(Dp.Provider,{value:t,children:e})}:function({children:e}){return(0,et.jsx)(le.Composite,{focusShift:!0,focusWrap:"horizontal",render:(0,et.jsx)(et.Fragment,{}),children:e})},Qp=(0,p.memo)((function({className:e,isFirst:t,item:n,onSelect:o,onHover:i,isDraggable:l,...r}){const s=(0,p.useRef)(!1),a=n.icon?{backgroundColor:n.icon.background,color:n.icon.foreground}:{},c=(0,h.useSelect)((e=>({getClientIdsWithDescendants:e("core/block-editor").getClientIdsWithDescendants,getBlock:e("core/block-editor").getBlock})));n=(0,m.applyFilters)("kubio.beforeInsertBlock",n,c);const g=(0,p.useMemo)((()=>{let e=[];try{e=[(0,d.createBlock)(n.name,n.initialAttributes,(0,d.createBlocksFromInnerBlocksTemplate)(n.innerBlocks))]}catch(e){console.error(e)}return e}),[n.name,n.initialAttributes,n.innerBlocks]),[f,v]=(0,sc.useProModal)(),b=(0,d.isReusableBlock)(n)&&"unsynced"!==n.syncStatus||(0,d.isTemplatePart)(n);return _.isEmpty(g)?(0,et.jsx)(et.Fragment,{}):(0,et.jsx)(Ap,{isEnabled:l&&!n.isDisabled,blocks:g,icon:n.icon,children:({draggable:l,onDragStart:c,onDragEnd:d})=>{var p;return(0,et.jsx)("div",{className:u("block-editor-block-types-list__list-item",{"block-editor-block-types-list__list-item--is-pro-on-free":null===(p=n)||void 0===p?void 0:p.isProOnFree,"is-synced":b}),draggable:l,onDragStart:e=>{s.current=!0,c&&(i(null),c(e))},onDragEnd:e=>{s.current=!1,d&&d(e)},onMouseUp:()=>{!0===n[sc.PRO_ON_FREE_FLAG]&&v(!0,"block-pro-modal-"+n.name)},role:"button",tabIndex:0,children:(0,et.jsxs)(qp,{isFirst:t,className:u("block-editor-block-types-list__item",{"block-editor-block-types-list__item--disabled":n.isDisabled},e,(0,sc.proItemOnFreeClass)(n)),disabled:n.isDisabled,onClick:e=>{n.isDisabled||(e.preventDefault(),o(n,(0,Jd.isAppleOS)()?e.metaKey:e.ctrlKey),i(null))},onKeyDown:e=>{const{keyCode:t}=e;t===Jd.ENTER&&(e.preventDefault(),o(n,(0,Jd.isAppleOS)()?e.metaKey:e.ctrlKey),i(null))},onMouseEnter:()=>{s.current||i(n)},onMouseLeave:()=>i(null),...r,children:[(0,et.jsx)("span",{className:"block-editor-block-types-list__item-icon",style:a,children:(0,et.jsx)(Sc,{icon:n.icon,showColors:!0})}),(0,et.jsx)("span",{className:"block-editor-block-types-list__item-title",children:(0,et.jsx)(le.__experimentalTruncate,{numberOfLines:3,children:n.title})}),(0,et.jsx)(sc.ProBadge,{item:n}),(0,et.jsx)(f,{id:"block-pro-modal-"+n.name,urlArgs:{source:"block-inserter",content:n.name.split("/").pop()}})]})})}})}));function Xp(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 Jp=function e({items:t=[],onSelect:n,onHover:o=(()=>{}),children:i,label:l,isDraggable:r=!0}){const s="block-editor-block-types-list",a=(0,g.useInstanceId)(e,s);return(0,et.jsxs)(Kp,{className:s,"aria-label":l,children:[Xp(t,3).map(((e,t)=>(0,et.jsx)(Zp,{children:e.map(((e,i)=>(0,et.jsx)(Qp,{item:e,className:(0,d.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:r&&!e.isDisabled,isFirst:0===t&&0===i,rowId:`${a}-${t}`},e.id)))},t))),i]})},eh=function({title:e,icon:t,children:n}){return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsxs)("div",{className:"block-editor-inserter__panel-header",children:[(0,et.jsx)("h2",{className:"block-editor-inserter__panel-title",children:e}),(0,et.jsx)(le.Icon,{icon:t})]}),(0,et.jsx)("div",{className:"block-editor-inserter__panel-content",children:n})]})},th=function({rootClientId:e,onInsert:t,onHover:n,showMostUsedBlocks:o}){const[i,l,r,s]=kc(e,t),a=(0,p.useMemo)((()=>(0,ce.orderBy)(i,["frecency"],["desc"]).slice(0,6)),[i]),c=(0,p.useMemo)((()=>i.filter((e=>!e.category))),[i]),u=(0,p.useMemo)((()=>{let e=(0,ce.flow)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,ce.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 l=t[n].indexOf(o.name);return l<0?-1:i-l}));return e}(e),e}),[i]),d=(0,p.useMemo)((()=>{const e={...r};return Object.keys(r).forEach((t=>{e[t]=i.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[i,r]);(0,p.useEffect)((()=>()=>n(null)),[]);const h=(0,p.useMemo)((()=>o&&!!a.length&&(0,et.jsx)(eh,{title:(0,vt._x)("Most used","blocks","kubio"),children:(0,et.jsx)(Jp,{items:a,onSelect:s,onHover:n,label:(0,vt._x)("Most used","blocks","kubio")})})),[a,o,s,n]);return(0,et.jsx)(Yp,{children:(0,et.jsxs)("div",{children:[h,(0,ce.map)(l,(e=>{const t=u[e.slug];return t&&t.length?(0,et.jsx)(eh,{title:e.title,icon:e.icon,children:(0,et.jsx)(Jp,{items:t,onSelect:s,onHover:n,label:e.title})},e.slug):null})),c.length>0&&(0,et.jsx)(eh,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,vt.__)("Uncategorized","kubio"),children:(0,et.jsx)(Jp,{items:c,onSelect:s,onHover:n,label:(0,vt.__)("Uncategorized","kubio")})}),(0,ce.map)(r,((e,t)=>{const o=d[t];return o&&o.length?(0,et.jsx)(eh,{title:e.title,icon:e.icon,children:(0,et.jsx)(Jp,{items:o,onSelect:s,onHover:n,label:e.title})},t):null}))]})})},nh=function({selectedCategory:e,patternCategories:t,onClickCategory:n,children:o}){return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)("div",{className:yc()("block-editor-inserter__panel-header","block-editor-inserter__panel-header-patterns"),children:(0,et.jsx)(le.SelectControl,{className:"block-editor-inserter__panel-dropdown",label:(0,vt.__)("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,et.jsx)("div",{className:"block-editor-inserter__panel-content",children:o})]})},oh=window.wp.keyboardShortcuts;function ih(){return null}ih.Register=function(){const{registerShortcut:e}=(0,h.useDispatch)(oh.store);return(0,p.useEffect)((()=>{e({name:"core/block-editor/copy",category:"block",description:(0,vt.__)("Copy the selected block(s)."),keyCombination:{modifier:"primary",character:"c"}}),e({name:"core/block-editor/cut",category:"block",description:(0,vt.__)("Cut the selected block(s)."),keyCombination:{modifier:"primary",character:"x"}}),e({name:"core/block-editor/paste",category:"block",description:(0,vt.__)("Paste the selected block(s)."),keyCombination:{modifier:"primary",character:"v"}}),e({name:"core/block-editor/duplicate",category:"block",description:(0,vt.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,vt.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/paste-styles",category:"block",description:(0,vt.__)("Paste the copied style to the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"v"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,vt.__)("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,vt.__)("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,vt.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/stop-editing-as-blocks",category:"block",description:(0,vt.__)("Finish editing a design."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/select-all",category:"selection",description:(0,vt.__)("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,vt.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/multi-text-selection",category:"selection",description:(0,vt.__)("Select text across multiple blocks."),keyCombination:{modifier:"shift",character:"arrow"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,vt.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,vt.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,vt.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}}),e({name:"core/block-editor/collapse-list-view",category:"list-view",description:(0,vt.__)("Collapse all other items."),keyCombination:{modifier:"alt",character:"l"}}),e({name:"core/block-editor/group",category:"block",description:(0,vt.__)("Create a group block from the selected multiple blocks."),keyCombination:{modifier:"primary",character:"g"}}),e({name:"core/block-editor/toggle-block-visibility",category:"block",description:(0,vt.__)("Show or hide the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"h"}}),e({name:"core/block-editor/rename",category:"block",description:(0,vt.__)("Rename the selected block."),keyCombination:{modifier:"primaryAlt",character:"r"}})}),[e]),null};const lh=ih,rh=(0,p.createContext)({getSelection:()=>{},onChangeSelection:()=>{}}),sh=()=>{};function ah(e,t){var n;const o=(0,d.cloneBlock)(e);return t.externalToInternal.set(e.clientId,o.clientId),t.internalToExternal.set(o.clientId,e.clientId),null!==(n=e.innerBlocks)&&void 0!==n&&n.length&&(o.innerBlocks=e.innerBlocks.map((e=>ah(e,t)))),o}function ch(e,t){return e.map((e=>{const n=t.internalToExternal.get(e.clientId);return{...e,clientId:n??e.clientId,innerBlocks:ch(e.innerBlocks,t)}}))}function uh(e,t){const{selectionStart:n,selectionEnd:o,initialPosition:i}=e,l=e=>{if(null==e||!e.clientId)return e;const n=t.internalToExternal.get(e.clientId);return{...e,clientId:n??e.clientId}};return{selectionStart:l(n),selectionEnd:l(o),initialPosition:i}}function dh({clientId:e=null,value:t,onChange:n=sh,onInput:o=sh}){const i=(0,h.useRegistry)(),{getSelection:l,onChangeSelection:r}=(0,p.useContext)(rh),{resetBlocks:s,resetSelection:a,replaceInnerBlocks:c,setHasControlledInnerBlocks:u,__unstableMarkNextChangeAsNotPersistent:d}=i.dispatch(ba),{getBlockName:g,getBlocks:m,getSelectionStart:f,getSelectionEnd:v}=i.select(ba),b=(0,p.useRef)({incoming:null,outgoing:[]}),k=(0,p.useRef)(!1),_=(0,p.useRef)({externalToInternal:new Map,internalToExternal:new Map}),y=(0,p.useRef)(null),x=(0,p.useRef)(!1),S=()=>{t&&(e?i.batch((()=>{_.current.externalToInternal.clear(),_.current.internalToExternal.clear();const n=t.map((e=>ah(e,_.current)));u(e,!0),k.current&&(b.current.incoming=n),d(),c(e,n),y.current=null})):(k.current&&(b.current.incoming=t),d(),s(t)))},w=(0,p.useRef)(o),C=(0,p.useRef)(n);(0,p.useEffect)((()=>{w.current=o,C.current=n}),[o,n]),(0,p.useEffect)((()=>{const n=b.current.outgoing.includes(t),o=m(e)===t;n?b.current.outgoing[b.current.outgoing.length-1]===t&&(b.current.outgoing=[]):o||(b.current.outgoing=[],S(),(()=>{var t;const n=l();if(null==n||null===(t=n.selectionStart)||void 0===t||!t.clientId||n===y.current)return;const o=n.selectionStart.clientId;if(e?_.current.externalToInternal.has(o):g(o)){y.current=n;const t=t=>null!=t&&t.clientId&&e?{...t,clientId:_.current.externalToInternal.get(t.clientId)??t.clientId}:t;x.current=!0,a(t(n.selectionStart),t(n.selectionEnd),n.initialPosition),x.current=!1}})())}),[t,e]),(0,p.useEffect)((()=>{const{getSelectedBlocksInitialCaretPosition:t,isLastBlockChangePersistent:n,__unstableIsLastBlockChangeIgnored:o,areInnerBlocksControlled:l,getBlockParents:s}=i.select(ba);let a=m(e),c=n(),u=!1,d=f(),p=v();k.current=!0;const h=i.subscribe((()=>{if(null!==e&&null===g(e))return;const h=n(),k=m(e),y=k!==a;if(a=k,y&&(b.current.incoming||o()))return b.current.incoming=null,void(c=h);const S=y||u&&!y&&h&&!c,B=f(),I=v(),j=B!==d||I!==p;j&&(d=B,p=I),(S||j)&&i.batch((()=>{if(S){c=h;const n=e?ch(a,_.current):a,o={selectionStart:B,selectionEnd:I,initialPosition:t()},i=e?uh(o,_.current):o;b.current.outgoing.push(n),(c?C.current:w.current)(n,{selection:i})}if(j&&!S&&null!=B&&B.clientId&&!x.current&&(e?_.current.internalToExternal.has(B.clientId):!s(B.clientId).some((e=>l(e))))){const n={selectionStart:B,selectionEnd:I,initialPosition:t()};r(e?uh(n,_.current):n)}})),u=y}),ba);return()=>{k.current=!1,h()}}),[i,e]),(0,p.useEffect)((()=>()=>{d(),e?(u(e,!1),d(),c(e,[])):s([])}),[])}var ph=n(9996),hh=n.n(ph);function gh(e){return"[object Object]"===Object.prototype.toString.call(e)}function mh(e){var t,n;return!1!==gh(e)&&(void 0===(t=e.constructor)||!1!==gh(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}const fh=e=>{if(!(0,ce.isObject)(e)||Array.isArray(e))return e;const t=(0,ce.pickBy)((0,ce.mapValues)(e,fh),(e=>!(0,ce.isUndefined)(e)));return(0,ce.isEmpty)(t)?void 0:t};const vh=(0,g.createHigherOrderComponent)((e=>function({useSubRegistry:t=!0,...n}){const o=(0,h.useRegistry)(),[i]=(0,p.useState)((()=>new WeakMap)),l=function(e,t,n){if(!n)return t;let o=e.get(t);return o||(o=(0,h.createRegistry)({},t),o.registerStore(pn,va),e.set(t,o)),o}(i,o,t);return l===o?(0,et.jsx)(e,{registry:o,...n}):(0,et.jsx)(h.RegistryProvider,{value:l,children:(0,et.jsx)(e,{registry:l,...n})})}),"withRegistryProvider"),bh=()=>{};function kh(e){return dh(e),null}const _h=Object.freeze({}),yh=vh((e=>{const{settings:t,stripExperimentalSettings:n=!1}=e,{merged:o}=function(){const[e,t,n]=function(){const{globalStylesId:e,isReady:t,settings:n,styles:o,_links:i}=(0,h.useSelect)((e=>{var t,n,o;const{getEntityRecord:i,getEditedEntityRecord:l,hasFinishedResolution:r,canUser:s}=e("core"),a=e("core").__experimentalGetCurrentGlobalStylesId();let c;const u=a?s("update",{kind:"root",name:"globalStyles",id:a}):null;a&&"boolean"==typeof u&&(c=u?l("root","globalStyles",a):i("root","globalStyles",a,{context:"view"}));let d=!1;return r("__experimentalGetCurrentGlobalStylesId")&&(d=!a||(u?r("getEditedEntityRecord",["root","globalStyles",a]):r("getEntityRecord",["root","globalStyles",a,{context:"view"}]))),{globalStylesId:a,isReady:d,settings:null===(t=c)||void 0===t?void 0:t.settings,styles:null===(n=c)||void 0===n?void 0:n.styles,_links:null===(o=c)||void 0===o?void 0:o._links}}),[]),{getEditedEntityRecord:l}=(0,h.useSelect)("core"),{editEntityRecord:r}=(0,h.useDispatch)("core");return[t,(0,p.useMemo)((()=>({settings:n??{},styles:o??{},_links:i??{}})),[n,o,i]),(0,p.useCallback)(((t,n={})=>{const o=l("root","globalStyles",e),i={styles:(null==o?void 0:o.styles)??{},settings:(null==o?void 0:o.settings)??{},_links:(null==o?void 0:o._links)??{}},s="function"==typeof t?t(i):t;r("root","globalStyles",e,{styles:fh(s.styles)||{},settings:fh(s.settings)||{},_links:fh(s._links)||{}},n)}),[e,r,l])]}(),[o,i]=function(){const e=(0,h.useSelect)((e=>e("core").__experimentalGetCurrentThemeBaseGlobalStyles()),[]);return[!!e,e]}(),l=(0,p.useMemo)((()=>{return i&&t?(e=i,n=t,hh()(e,n,{isMergeableObject:mh,customMerge:e=>{if("backgroundImage"===e)return(e,t)=>t??e}})):{};var e,n}),[t,i]);return(0,p.useMemo)((()=>({isReady:e&&o,user:t,base:i,merged:l,setUserConfig:n})),[l,t,i,n,e,o])}(),i=o.styles??_h,l=o._links??_h,r=(0,p.useMemo)((()=>({...t,[wt]:i,[Ct]:l,_isKubioSettings:!0})),[t,i,l]),{__experimentalUpdateSettings:s}=fe((0,h.useDispatch)(ba));(0,p.useEffect)((()=>{s({...r,__internalIsInitialized:!0},{stripExperimentalSettings:n,reset:!0})}),[r,n,s]);const a=(0,p.useRef)(e.selection);a.current=e.selection;const c=(0,p.useRef)(e.onChangeSelection??bh);c.current=e.onChangeSelection??bh;const u=(0,p.useMemo)((()=>({getSelection:()=>a.current,onChangeSelection:(...e)=>c.current(...e)})),[]),d=(0,et.jsxs)(le.SlotFillProvider,{passthrough:!0,children:[!(null!=r&&r.isPreviewMode)&&(0,et.jsx)(lh.Register,{}),(0,et.jsx)(sp,{children:e.children})]});return(0,et.jsxs)(rh.Provider,{value:u,children:[(0,et.jsx)(kh,{clientId:e.clientId,value:e.value,onChange:e.onChange,onInput:e.onInput}),d]})})),xh=e=>(0,et.jsx)(yh,{...e,stripExperimentalSettings:!0,children:e.children});function Sh(){const{getSettings:e,hasSelectedBlock:t,hasMultiSelection:n}=(0,h.useSelect)(ba),{clearSelectedBlock:o}=(0,h.useDispatch)(ba),{clearBlockSelection:i}=e();return(0,g.useRefEffect)((e=>{if(i)return e.addEventListener("mousedown",l),()=>{e.removeEventListener("mousedown",l)};function l(i){(t()||n())&&i.target===e&&o()}}),[t,n,o,i])}function wh(e){return(0,et.jsx)("div",{ref:Sh(),...e})}function Ch(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:i,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:r}=e(ba);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:i(),initialPosition:l(),isFullSelection:r()}}function Bh(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:i,isFullSelection:l}=(0,h.useSelect)(Ch,[]);return(0,g.useRefEffect)((i=>{const{ownerDocument:r}=i,{defaultView:s}=r;if(null==e)return;if(!o||t)return;const{length:a}=n;a<2||l&&(i.contentEditable=!0,i.focus(),s.getSelection().removeAllRanges())}),[o,t,n,i,e,l])}const Ih=window.wp.dom,jh=".block-editor-block-list__block",Eh=".block-list-appender",Th=".block-editor-button-block-appender";function Ph(e,t){return t.closest([jh,Eh,Th].join(","))===e}function Mh(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(jh);return t?t.id.slice(6):void 0}function Rh(e,t){const n=Math.min(e.left,t.left),o=Math.max(e.right,t.right),i=Math.max(e.bottom,t.bottom),l=Math.min(e.top,t.top);return new window.DOMRectReadOnly(n,l,o-n,i-l)}function Nh(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 Lh(e,t,n,o){let i,l=Ih.focus.focusable.find(n);return t&&l.reverse(),l=l.slice(l.indexOf(e)+1),o&&(i=e.getBoundingClientRect()),l.find((function(e){if(Mh(e)&&0!==Ih.focus.focusable.find(e).filter((e=>!(0,Ih.isFormElement)(e))).length)return!1;if(!Ih.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 Ah(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:i}=(0,h.useSelect)(ba),{selectBlock:l}=(0,h.useDispatch)(ba);return(0,g.useRefEffect)((r=>{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,m=c===Jd.UP,f=c===Jd.DOWN,v=c===Jd.LEFT,b=c===Jd.RIGHT,k=m||v,_=v||b,y=m||f,x=_||y,S=d||p||h||g,w=y?Ih.isVerticalEdge:Ih.isHorizontalEdge,{ownerDocument:C}=r,{defaultView:B}=C;if(!x)return;if(n().isPreviewMode)return;if(o()){if(d)return;if(!i())return;return a.preventDefault(),void(k?l(e()):l(t(),-1))}if(!function(e,t,n){const o=t===Jd.UP||t===Jd.DOWN,{tagName:i}=e,l=e.getAttribute("type");return o&&!n?"INPUT"!==i||!["date","datetime-local","month","number","range","time","week"].includes(l):"INPUT"===i?["button","checkbox","number","color","file","image","radio","reset","submit"].includes(l):"TEXTAREA"!==i}(u,c,S))return;y?s||(s=(0,Ih.computeCaretRect)(B)):s=null;const I=(0,Ih.isRTL)(u)?!k:k,{keepCaretInsideBlock:j}=n();if(d)(function(e,t){const n=Lh(e,t,r);return n&&Mh(n)})(u,k)&&w(u,k)&&(r.contentEditable=!0,r.focus());else if(!y||!(0,Ih.isVerticalEdge)(u,k)||h&&!(0,Ih.isHorizontalEdge)(u,I)||j){if(_&&B.getSelection().isCollapsed&&(0,Ih.isHorizontalEdge)(u,I)&&!j){const e=Lh(u,I,r);(0,Ih.placeCaretAtHorizontalEdge)(e,k),a.preventDefault()}}else{const e=Lh(u,k,r,!0);e&&((0,Ih.placeCaretAtVerticalEdge)(e,h?!k:k,h?void 0:s),a.preventDefault())}}return r.addEventListener("mousedown",a),r.addEventListener("keydown",c),()=>{r.removeEventListener("mousedown",a),r.removeEventListener("keydown",c)}}),[])}function Dh(){const e=(0,h.useSelect)((e=>e(ba).getSettings().isPreviewMode),[]);return(0,g.useRefEffect)((t=>{if(e)return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)};function n(e){const{keyCode:n,shiftKey:o,target:i}=e,l=n===Jd.TAB,r=n===Jd.UP,s=n===Jd.DOWN,a=n===Jd.LEFT,c=n===Jd.RIGHT;if(!l&&!(r||s||a||c))return;const u=l?o:r||a,d=Array.from(t.querySelectorAll("[data-block]"));if(!d.length)return;const p=i.closest("[data-block]"),h=p?d.indexOf(p):-1;if(-1===h)return;if(l){if(u&&0===h)return;if(!u&&h===d.length-1)return}let g;g=u?h<=0?d.length-1:h-1:-1===h||h>=d.length-1?0:h+1,e.preventDefault(),d[g].focus()}}),[e])}function Oh(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,h.useSelect)(ba),{multiSelect:o,selectBlock:i}=(0,h.useDispatch)(ba),l=(0,oh.__unstableUseShortcutEventMatch)();return(0,g.useRefEffect)((r=>{function s(s){if(!l("core/block-editor/select-all",s))return;const a=t();if(a.length<2&&!(0,Ih.isEntirelySelected)(s.target))return;s.preventDefault();const{ownerDocument:c}=s.target,[u]=a,d=Mh(c.activeElement);if(d&&d!==u&&!Ph(c.getElementById("block-"+u),c.activeElement))return void i(d);const p=n(u),h=e(p);a.length!==h.length?o(h[0],h[h.length-1]):p&&(r.ownerDocument.defaultView.getSelection().removeAllRanges(),i(p))}return r.addEventListener("keydown",s),()=>{r.removeEventListener("keydown",s)}}),[])}function zh(e,t){e.contentEditable=t,t&&e.focus()}function Vh(){const{startMultiSelect:e,stopMultiSelect:t}=(0,h.useDispatch)(ba),{getSettings:n,isSelectionEnabled:o,hasSelectedBlock:i,isDraggingBlocks:l,isMultiSelecting:r}=(0,h.useSelect)(ba);return(0,g.useRefEffect)((s=>{const{ownerDocument:a}=s,{defaultView:c}=a;let u,d,p;function h(){t(),c.removeEventListener("mouseup",h),d=c.requestAnimationFrame((()=>{if(!i())return;zh(s,!1);const e=c.getSelection();if(e.rangeCount){const t=e.getRangeAt(0),{commonAncestorContainer:n}=t,o=t.cloneRange();u.contains(n)&&(u.focus(),e.removeAllRanges(),e.addRange(o))}}))}function g({buttons:t,target:i,relatedTarget:a}){i.contains(p)&&(i.contains(a)||l()||1===t&&(r()||s!==i&&("true"===i.getAttribute("contenteditable")||n().isPreviewMode)&&o()&&(u=i,e(),c.addEventListener("mouseup",h),zh(s,!0))))}return s.addEventListener("mouseout",g),s.addEventListener("mousedown",(function({target:e}){p=e})),()=>{try{s.removeEventListener("mouseout",g),c.removeEventListener("mouseup",h),c.cancelAnimationFrame(d)}catch(e){console.error(e)}}}),[e,t,o,i])}function Fh(e,t){e.contentEditable!==String(t)&&(e.contentEditable=t,t&&e.focus())}function Hh(e){const t=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;return null==t?void 0:t.closest("[data-wp-block-attribute-key]")}function Gh(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,h.useDispatch)(ba),{getBlockParents:o,getBlockSelectionStart:i,isMultiSelecting:l}=(0,h.useSelect)(ba);return(0,g.useRefEffect)((r=>{const{ownerDocument:s}=r,{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,Ih.isSelectionForward)(e)?t.previousSibling??t.parentElement:t.childNodes[n]}(c);if(!r.contains(u)||!r.contains(d))return;const p=s.shiftKey&&"mouseup"===s.type;if(c.isCollapsed&&!p){if("true"===r.contentEditable&&!l()){var h,g;Fh(r,!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 m=Mh(u),f=Mh(d);if(p){const e=i(),t=Mh(s.target),n=t!==f;(m===f&&c.isCollapsed||!f||n)&&(f=t),m!==e&&(m=e)}if(void 0!==m||void 0!==f){if("mouseup"===s.type&&!s.shiftKey&&!l()&&m===f){const e=Mh(s.target);if(e&&e!==m)return void c.removeAllRanges()}if(m===f)l()?e(m,m):t(m);else{const t=[...o(m),m],i=[...o(f),f],l=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,i);if(t[l]!==m||i[l]!==f)return void e(t[l],i[l]);const r=Hh(u),s=Hh(d);if(r&&s){const e=c.getRangeAt(0),t=(0,un.create)({element:r,range:e,__unstableIsEditableTree:!0}),o=(0,un.create)({element:s,range:e,__unstableIsEditableTree:!0}),i=t.start??t.end,l=o.start??o.end;n({start:{clientId:m,attributeKey:r.dataset.wpBlockAttributeKey,offset:i},end:{clientId:f,attributeKey:s.dataset.wpBlockAttributeKey,offset:l}})}else e(m,f)}}else Fh(r,!1)}return s.addEventListener("selectionchange",c),a.addEventListener("mouseup",c),()=>{try{s.removeEventListener("selectionchange",c),a.removeEventListener("mouseup",c)}catch(e){console.error(e)}}}),[e,t,n,o])}function $h(){const{selectBlock:e}=(0,h.useDispatch)(ba),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,h.useSelect)(ba);return(0,g.useRefEffect)((i=>{function l(l){if(!t()||0!==l.button)return;const r=n(),s=Mh(l.target);l.shiftKey?r&&r!==s&&(i.contentEditable=!0,i.focus()):o()&&e(s)}return i.addEventListener("mousedown",l),()=>{i.removeEventListener("mousedown",l)}}),[e,t,n,o])}function Uh(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,getSelectedBlockClientId:n,__unstableIsSelectionMergeable:o,hasMultiSelection:i,getBlockName:l,canInsertBlockType:r,getBlockRootClientId:s,getSelectionStart:a,getSelectionEnd:c,getBlockAttributes:u}=(0,h.useSelect)(ba),{replaceBlocks:p,__unstableSplitSelection:m,removeBlocks:f,__unstableDeleteSelection:v,__unstableExpandSelection:b,__unstableMarkAutomaticChange:k}=(0,h.useDispatch)(ba);return(0,g.useRefEffect)((h=>{function g(e){"true"===h.contentEditable&&e.preventDefault()}function _(g){if(!g.defaultPrevented)if(i())g.keyCode===Jd.ENTER?(h.contentEditable=!1,g.preventDefault(),e()?p(t(),(0,d.createBlock)((0,d.getDefaultBlockName)())):m()):g.keyCode===Jd.BACKSPACE||g.keyCode===Jd.DELETE?(h.contentEditable=!1,g.preventDefault(),e()?f(t()):o()?v(g.keyCode===Jd.DELETE):b()):1!==g.key.length||g.metaKey||g.ctrlKey||(h.contentEditable=!1,o()?v(g.keyCode===Jd.DELETE):(g.preventDefault(),h.ownerDocument.defaultView.getSelection().removeAllRanges()));else if(g.keyCode===Jd.ENTER){if(g.shiftKey||e())return;const t=n(),o=l(t),i=a(),h=c();if(i.attributeKey===h.attributeKey){const e=u(t)[i.attributeKey],n=(0,d.getBlockTransforms)("from").filter((({type:e})=>"enter"===e)),o=(0,d.findTransform)(n,(t=>t.regExp.test(e)));if(o)return p(t,o.transform({content:e})),void k()}if(!(0,d.hasBlockSupport)(o,"splitting",!1)&&!g.__deprecatedOnSplit)return;(r((0,d.getDefaultBlockName)(),s(t))||r(o,s(t)))&&(m(),g.preventDefault())}}function y(e){i()&&(h.contentEditable=!1,o()?v():(e.preventDefault(),h.ownerDocument.defaultView.getSelection().removeAllRanges()))}return h.addEventListener("beforeinput",g),h.addEventListener("keydown",_),h.addEventListener("compositionstart",y),()=>{h.removeEventListener("beforeinput",g),h.removeEventListener("keydown",_),h.removeEventListener("compositionstart",y)}}),[])}const Wh=window.wp.notices;function Kh(){const{getBlockName:e}=(0,h.useSelect)(ba),{getBlockType:t}=(0,h.useSelect)(d.store),{createSuccessNotice:n}=(0,h.useDispatch)(Wh.store);return(0,p.useCallback)(((o,i)=>{let l="";if("copyStyles"===o)l=(0,vt.__)("Styles copied to clipboard.");else if(1===i.length){var r;const n=i[0],s=null===(r=t(e(n)))||void 0===r?void 0:r.title;l="copy"===o?(0,vt.sprintf)(// Translators: %s: Name of the block being copied, e.g. "Paragraph".
// Translators: %s: Name of the block being copied, e.g. "Paragraph".
(0,vt.__)('Copied "%s" to clipboard.'),s):(0,vt.sprintf)(// Translators: %s: Name of the block being cut, e.g. "Paragraph".
// Translators: %s: Name of the block being cut, e.g. "Paragraph".
(0,vt.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,vt.sprintf)(// Translators: %d: Number of blocks being copied.
// Translators: %d: Number of blocks being copied.
(0,vt._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",i.length),i.length):(0,vt.sprintf)(// Translators: %d: Number of blocks being moved.
// Translators: %d: Number of blocks being moved.
(0,vt._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",i.length),i.length);n(l,{type:"snackbar"})}),[n,e,t])}function Zh({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,Ih.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 qh=Symbol("requiresWrapperOnCopy");function Yh(e,t,n){let o=t;const[i]=t;if(i&&n.select(d.store).getBlockType(i.name)[qh]){const{getBlockRootClientId:e,getBlockName:t,getBlockAttributes:l}=n.select(ba),r=e(i.clientId),s=t(r);s&&(o=(0,d.createBlock)(s,l(r),o))}const l=(0,d.serialize)(o);var r;e.clipboardData.setData("text/plain",(r=(r=l).replace(/<br>/g,"\n"),(0,Ih.__unstableStripHTML)(r).trim().replace(/\n\n+/g,"\n\n"))),e.clipboardData.setData("text/html",l)}function Qh(){const e=(0,h.useRegistry)(),{getBlocksByClientId:t,getSelectedBlockClientIds:n,hasMultiSelection:o,getSettings:i,getBlockName:l,__unstableIsFullySelected:r,__unstableIsSelectionCollapsed:s,__unstableIsSelectionMergeable:a,__unstableGetSelectedBlocksWithPartialSelection:c,canInsertBlockType:u,getBlockRootClientId:p}=(0,h.useSelect)(ba),{flashBlock:m,removeBlocks:f,replaceBlocks:v,__unstableDeleteSelection:b,__unstableExpandSelection:k,__unstableSplitSelection:_}=(0,h.useDispatch)(ba),y=Kh();return(0,g.useRefEffect)((h=>{function g(g){if(g.defaultPrevented)return;const x=n();if(0===x.length)return;if(!o()){const{target:e}=g,{ownerDocument:t}=e;if("copy"===g.type||"cut"===g.type?(0,Ih.documentHasUncollapsedSelection)(t):(0,Ih.documentHasSelection)(t)&&!t.activeElement.isContentEditable)return}const{activeElement:S}=g.target.ownerDocument;if(!h.contains(S))return;const w=a(),C=s()||r(),B=!C&&!w;if("copy"===g.type||"cut"===g.type)if(g.preventDefault(),1===x.length&&m(x[0]),B)k();else{let n;if(y(g.type,x),C)n=t(x);else{const[e,o]=c();n=[e,...t(x.slice(1,x.length-1)),o]}Yh(g,n,e)}if("cut"===g.type)C&&!B?f(x):(g.target.ownerDocument.activeElement.contentEditable=!1,b());else if("paste"===g.type){const{__experimentalCanUserUseUnfilteredHTML:e,mediaUpload:t}=i();if("true"===g.clipboardData.getData("rich-text"))return;const{plainText:n,html:s,files:a}=Zh(g),c=r();let h=[];if(a.length){if(!t)return void g.preventDefault();const e=(0,d.getBlockTransforms)("from");h=a.reduce(((t,n)=>{const o=(0,d.findTransform)(e,(e=>"files"===e.type&&e.isMatch([n])));return o&&t.push(o.transform([n])),t}),[]).flat()}else h=(0,d.pasteHandler)({HTML:s,plainText:n,mode:c?"BLOCKS":"AUTO",canUserUseUnfilteredHTML:e});if("string"==typeof h)return;if(c)return v(x,h,h.length-1,-1),void g.preventDefault();if(!o()&&!(0,d.hasBlockSupport)(l(x[0]),"splitting",!1)&&!g.__deprecatedOnSplit)return;const[m]=x,f=p(m),b=[];for(const e of h)if(u(e.name,f))b.push(e);else{const t=l(f),n=e.name!==t?(0,d.switchToBlockType)(e,t):[e];if(!n)return;for(const e of n)for(const t of e.innerBlocks)b.push(t)}_(b),g.preventDefault()}}return h.ownerDocument.addEventListener("copy",g),h.ownerDocument.addEventListener("cut",g),h.ownerDocument.addEventListener("paste",g),()=>{h.ownerDocument.removeEventListener("copy",g),h.ownerDocument.removeEventListener("cut",g),h.ownerDocument.removeEventListener("paste",g)}}),[])}function Xh(){const[e,t,n]=function(){const e=(0,p.useRef)(),t=(0,p.useRef)(),n=(0,p.useRef)(),{hasMultiSelection:o,getSelectedBlockClientId:i,getBlockCount:l,getBlockOrder:r,getLastFocus:s,getSectionRootClientId:a,isZoomOut:c}=fe((0,h.useSelect)(ba)),{setLastFocus:u}=fe((0,h.useDispatch)(ba)),d=(0,p.useRef)();function m(t){const n=e.current.ownerDocument===t.target.ownerDocument?e.current:e.current.ownerDocument.defaultView.frameElement;if(d.current)d.current=null;else if(o())e.current.focus();else if(i()){var l;null!==(l=s())&&void 0!==l&&l.current?s().current.focus():e.current.querySelector(`[data-block="${i()}"]`).focus()}else if(c()){const t=a(),o=r(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=Ih.focus.tabbable.find(e.current);i.length&&(o?i[0]:i[i.length-1]).focus()}}const f=(0,et.jsx)("div",{ref:t,tabIndex:"0",onFocus:m}),v=(0,et.jsx)("div",{ref:n,tabIndex:"0",onFocus:m}),b=(0,g.useRefEffect)((o=>{function i(e){if(e.defaultPrevented)return;if(e.keyCode!==Jd.TAB)return;if(!n.current||!t.current)return;const{target:o,shiftKey:i}=e,l=i?"findPrevious":"findNext",r=Ih.focus.tabbable[l](o),s=o.closest("[data-block]"),a=s&&r&&(function(e,t){return e.closest(jh)===t.closest(jh)}(s,r)||Ph(s,r));if((0,Ih.isFormElement)(r)&&a)return;const c=i?t:n;d.current=!0,c.current.focus({preventScroll:!0})}function r(e){u({...s(),current:e.target});const{ownerDocument:t}=o;!e.relatedTarget&&e.target.hasAttribute("data-block")&&t.activeElement===t.body&&0===l()&&o.focus()}function a(o){var i;if(o.keyCode!==Jd.TAB)return;if("region"===(null===(i=o.target)||void 0===i?void 0:i.getAttribute("role")))return;if(e.current===o.target)return;const l=o.shiftKey?"findPrevious":"findNext",r=Ih.focus.tabbable[l](o.target);r!==t.current&&r!==n.current||(o.preventDefault(),r.focus({preventScroll:!0}))}const{ownerDocument:c}=o,{defaultView:p}=c;return p.addEventListener("keydown",a),o.addEventListener("keydown",i),o.addEventListener("focusout",r),()=>{p.removeEventListener("keydown",a),o.removeEventListener("keydown",i),o.removeEventListener("focusout",r)}}),[]);return[f,(0,g.useMergeRefs)([e,b]),v]}(),o=(0,h.useSelect)((e=>e(ba).hasMultiSelection()),[]);return[e,(0,g.useMergeRefs)([t,Qh(),Uh(),Vh(),Gh(),$h(),Bh(),Oh(),Ah(),Dh(),(0,g.useRefEffect)((e=>(e.tabIndex=0,e.dataset.hasMultiSelection=o,o?(e.setAttribute("aria-label",(0,vt.__)("Multiple selected blocks")),()=>{delete e.dataset.hasMultiSelection,e.removeAttribute("aria-label")}):()=>{delete e.dataset.hasMultiSelection})),[o])]),n]}const Jh=(0,p.forwardRef)((function({children:e,...t},n){const[o,i,l]=Xh();return(0,et.jsxs)(et.Fragment,{children:[o,(0,et.jsx)("div",{...t,ref:(0,g.useMergeRefs)([i,n]),className:u(t.className,"block-editor-writing-flow"),children:e}),l]})}));let eg=null;function tg(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 ng(e){return(0,g.useRefEffect)((()=>{const{defaultView:t}=e;if(!t)return;const{frameElement:n}=t,o=e.documentElement,i=["dragover","mousemove"],l={};for(const e of i)l[e]=e=>{const t=Object.getPrototypeOf(e).constructor.name;tg(e,window[t],n)},o.addEventListener(e,l[e]);return()=>{for(const e of i)o.removeEventListener(e,l[e])}}))}function og({contentRef:e,children:t,tabIndex:n=0,scale:o=1,frameSize:i=0,expand:l=!1,readonly:r,forwardedRef:s,...a}){var c,u,d,m;const{resolvedAssets:f,isPreviewMode:v}=(0,h.useSelect)((e=>{const t=e(ba).getSettings();return{resolvedAssets:t.__unstableResolvedAssets,isPreviewMode:t.__unstableIsPreviewMode}}),[]),{styles:b="",scripts:k=""}=f,[_,y]=(0,p.useState)(),[x,S]=(0,p.useState)([]),w=Sh(),[C,B,I]=Xh(),[j,{height:E}]=(0,g.useResizeObserver)(),T=(0,g.useRefEffect)((e=>{let t;function n(e){e.preventDefault()}function o(){const{contentDocument:o,ownerDocument:i}=e,{documentElement:l}=o;t=o,w(l),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 eg||(eg=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}),[]),eg))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,l;delete e._load,e.removeEventListener("load",o),null===(i=t)||void 0===i||i.removeEventListener("dragover",n),null===(l=t)||void 0===l||l.removeEventListener("drop",n)}}),[]),P=(0,g.useDisabled)({isDisabled:!r}),M=(0,g.useMergeRefs)([ng(_),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,L]=(0,p.useMemo)((()=>{const e=URL.createObjectURL(new window.Blob([R],{type:"text/html"}));return[e,()=>URL.revokeObjectURL(e)]}),[R]);(0,p.useEffect)((()=>L),[L]);const A=E*(1-o)/2;return(0,et.jsxs)(et.Fragment,{children:[n>=0&&C,(0,et.jsx)("iframe",{...a,style:{border:0,...a.style,height:l?E:null===(c=a.style)||void 0===c?void 0:c.height,marginTop:1!==o?-A+i:null===(u=a.style)||void 0===u?void 0:u.marginTop,marginBottom:1!==o?-A+i:null===(d=a.style)||void 0===d?void 0:d.marginBottom,transform:1!==o?`scale( ${o} )`:null===(m=a.style)||void 0===m?void 0:m.transform,transition:"all .3s"},ref:(0,g.useMergeRefs)([s,T]),tabIndex:n,src:N,title:(0,vt.__)("Editor canvas","kubio"),onKeyDown:e=>{a.onKeyDown?a.onKeyDown(e):e.currentTarget.ownerDocument!==e.target.ownerDocument&&(e.stopPropagation(),tg(e,window.KeyboardEvent,e.currentTarget))},children:_&&(0,p.createPortal)((0,et.jsxs)("body",{ref:M,className:yc()("block-editor-iframe__body","editor-styles-wrapper",...x),children:[j,(0,et.jsx)(le.__experimentalStyleProvider,{document:_,children:t})]}),_.documentElement)}),n>=0&&I]})}const ig=(0,p.forwardRef)((function(e,t){return(0,h.useSelect)((e=>e(ba).getSettings().__internalIsInitialized),[])?(0,et.jsx)(og,{...e,forwardedRef:t}):null}));function lg(e,t){return(0,p.useCallback)((e=>{if(!e)return;const{ownerDocument:n}=e,{defaultView:o,body:i}=n,l=t?n.querySelector(t):i;let r;if(l)r=null==o?void 0:o.getComputedStyle(l,null).getPropertyValue("background-color");else{const e=n.createElement("div");e.classList.add("editor-styles-wrapper"),i.appendChild(e),r=null==o?void 0:o.getComputedStyle(e,null).getPropertyValue("background-color"),i.removeChild(e)}const s=X(r);s.luminance()>.5||0===s.alpha()?i.classList.remove("is-dark-theme"):i.classList.add("is-dark-theme")}),[e,t])}ee([te,ie]);const rg=(0,p.memo)((function({styles:e,scope:t,transformOptions:n}){const o=(0,h.useSelect)((e=>fe(e(ba)).getStyleOverrides()),[]),[i,l]=(0,p.useMemo)((()=>{const i=Object.values(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[Le(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,et.jsxs)(et.Fragment,{children:[(0,et.jsx)("style",{ref:lg(i,t)}),i.map(((e,t)=>(0,et.jsx)("style",{children:e},t))),(0,et.jsx)(le.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:l}})]})})),sg=(0,p.memo)(s_),ag=2e3,cg=[];function ug({viewportWidth:e,containerWidth:t,minHeight:n,additionalStyles:o=cg}){e||(e=t);const[i,{height:l}]=(0,g.useResizeObserver)(),{styles:r}=(0,h.useSelect)((e=>({styles:e(ba).getSettings().styles})),[]),s=(0,p.useMemo)((()=>r?[...r,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...o]:r),[r,o]),a=t/e,c=l?t/(l*a):0;return(0,et.jsx)(le.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${a})`,aspectRatio:c,maxHeight:l>ag?ag*a:void 0,minHeight:n},children:(0,et.jsxs)(ig,{contentRef:(0,g.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.boxSizing="border-box",e.style.position="absolute",e.style.width="100%"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:e,height:l,pointerEvents:"none",maxHeight:ag,minHeight:0!==a&&a<1&&n?n/a:n},children:[(0,et.jsx)(rg,{styles:s}),i,(0,et.jsx)(sg,{renderAppender:!1})]})})}function dg(e){const[t,{width:n}]=(0,g.useResizeObserver)();return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)("div",{style:{position:"relative",width:"100%",height:0},children:t}),(0,et.jsx)("div",{className:"block-editor-block-preview__container",children:!!n&&(0,et.jsx)(ug,{...e,containerWidth:n})})]})}const pg=(0,window.wp.priorityQueue.createQueue)(),hg=[],gg=(0,p.memo)((function({blocks:e,viewportWidth:t=1200,minHeight:n,additionalStyles:o=hg,__experimentalMinHeight:i,__experimentalPadding:l}){i&&(n=i,Je()("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),l&&(o=[...o,{css:`body { padding: ${l}px; }`}],Je()("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));const r=(0,h.useSelect)((e=>e(ba).getSettings()),[]),s=(0,p.useMemo)((()=>({...r,focusMode:!1,__unstableIsPreviewMode:!0,isPreviewMode:!0})),[r]),a=(0,p.useMemo)((()=>Array.isArray(e)?e:[e]),[e]);return e&&0!==e.length?(0,et.jsx)(yh,{value:a,settings:s,children:(0,et.jsx)(dg,{viewportWidth:t,minHeight:n,additionalStyles:o})}):null}));gg.Async=function({children:e,placeholder:t}){const[n,o]=(0,p.useState)(!1);return(0,p.useEffect)((()=>{const e={};return pg.add(e,(()=>{(0,p.flushSync)((()=>{o(!0)}))})),()=>{pg.cancel(e)}}),[]),n?e:t};const mg=gg;function fg({blocks:e,props:t={},__experimentalLayout:n,layout:o}){const i=(0,h.useSelect)((e=>e(ba).getSettings()),[]),l=(0,p.useMemo)((()=>({...i,styles:void 0,focusMode:!1,isPreviewMode:!0,__unstableIsPreviewMode:!0})),[i]),r=(0,g.useDisabled)(),s=(0,g.useMergeRefs)([t.ref,r]),a=(0,p.useMemo)((()=>Array.isArray(e)?e:[e]),[e]),c=o||n,u=(0,et.jsx)(yh,{value:a,settings:l,children:(0,et.jsx)(c_,{renderAppender:!1,__experimentalLayout:c,layout:c})});return{...t,ref:s,className:yc()(t.className,"block-editor-block-preview__live-content","components-disabled"),children:null!=e&&e.length?u:null}}const vg=window.kubio.icons,bg="__experimentalBlockPatterns",kg=({containerRef:e,pattern:t,onClose:n})=>{const o=(0,p.useRef)();return(0,re.useOnClickOutside)(o,n),(0,et.jsx)(le.Popover,{className:"kubio-options-popover kubio-remove-section-popover",anchorRef:e,position:"top center",offset:6,children:(0,et.jsx)("div",{className:"kubio-remove-section-popover-inner",role:"button",tabIndex:0,ref:o,onMouseDown:e=>{e.stopPropagation()},children:(0,et.jsxs)(le.Placeholder,{className:"wp-block-navigation-placeholder kubio-remove-section-placeholder",children:[(null==t?void 0:t.title)&&(0,et.jsxs)("div",{className:"kubio-remove-section-popover__header",children:[(0,et.jsx)("h1",{className:"kubio-remove-section-popover__header-heading",children:(0,vt.__)("Remove ","kubio")+(null==t?void 0:t.title)+(0,vt.__)(" section?","kubio")}),(0,et.jsx)(le.Button,{onClick:n,icon:Ep})]}),(0,et.jsx)("p",{children:(0,vt.__)("This will permanently delete the custom section.","kubio")}),(0,et.jsxs)(le.ButtonGroup,{className:"kubio-remove-section-popover__button-group",children:[(0,et.jsx)(le.Button,{isLink:!0,onClick:n,children:(0,vt.__)("Cancel","kubio")}),(0,et.jsx)(le.Button,{isPrimary:!0,onClick:async()=>{await _g(null==t?void 0:t.name),n()},children:(0,vt.__)("Delete","kubio")})]})]})})})},_g=e=>{const t=e.split("/").pop();(0,h.dispatch)("core").deleteEntityRecord("postType","kubio_section",parseInt(t));const n=(0,h.select)(kn.STORE_KEY).getSettings(),o=n[bg].filter((t=>t.name!==e)),{updateSettings:i}=(0,h.dispatch)(kn.STORE_KEY);i({...n,[bg]:o})};function yg({pattern:e,onClick:t,composite:n,isFrontPage:o}){const{content:i,viewportWidth:l,isGutentagPattern:r}=e,{currentThemeName:s}=(0,h.useSelect)((e=>{var t;const{getCurrentTheme:n}=e("core");return{currentThemeName:null===(t=n())||void 0===t?void 0:t.stylesheet}}),[]),a=(0,p.useMemo)((()=>e.isGutentagPattern?i:e.blocks?e.blocks:(0,ce.isString)(i)?(0,d.parse)(i):i),[i]),c=`block-editor-block-patterns-list__item-description-${(0,g.useInstanceId)(yg)}`,u=()=>{const n=a[0],o=a[1];["kubio/header","kubio/footer","kubio/sidebar"].includes(n)&&(pe().set(o,"theme",s),pe().unset(o,"slug")),t(e,a)},m=(0,p.useRef)(),[f,v]=(0,p.useState)(!1),b=(0,p.useCallback)((()=>{v(!f)}),[f,v]);let k="section-inserter";if((0,ce.isArray)(e.content)){const t=(0,ce.get)(e,"content.0",null);t&&(k=t.replace("kubio/","")+"-inserter")}const _=(0,p.useMemo)((()=>(0,et.jsx)(et.Fragment,{children:(0,et.jsxs)(sc.ProItem,{tag:le.__unstableCompositeItem,item:e,role:"option",as:"div",...n,className:yc()("block-editor-block-patterns-list__item",e.isCustomSection?"custom-section-item":""),urlArgs:{source:k,content:e.title},onClick:u,children:[r&&(null==e?void 0:e.screenshot)&&(0,et.jsx)(et.Fragment,{children:(0,et.jsx)("img",{alt:e.title,src:null==e?void 0:e.screenshot,draggable:"false",className:"block-editor-block-patterns-list__item__screenshot"})}),r&&(null==e?void 0:e.isCustomSection)&&(0,et.jsx)(et.Fragment,{children:(0,et.jsxs)("div",{className:"block-editor-block-patterns-list__item-title",children:[(0,et.jsx)("span",{className:"title",children:(0,Pc.decodeEntities)(null==e?void 0:e.title)}),(0,et.jsx)(le.Button,{isSmall:!0,icon:vg.DeleteItemIcon,className:"icon-close",onClick:e=>{e.stopPropagation(),b()},showTooltip:!0,tooltipPosition:"top left",label:(0,vt.__)("Remove section","kubio")})]})}),!r&&(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(mg,{blocks:a,viewportWidth:l}),(0,et.jsx)("div",{className:"block-editor-block-patterns-list__item-title",children:e.title}),!!e.description&&(0,et.jsx)(le.VisuallyHidden,{id:c,children:e.description})]})]})})),[]);return(0,et.jsx)(Ap,{isEnabled:!r,blocks:a,children:({draggable:t,onDragStart:n,onDragEnd:o})=>(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(le.Tooltip,{text:e.title,children:(0,et.jsx)("div",{ref:m,className:yc()("block-editor-block-patterns-list__list-item"),"aria-label":e.title,"aria-describedby":e.description?c:void 0,draggable:t,onDragStart:n,onDragEnd:o,children:_})}),f&&(0,et.jsx)(kg,{containerRef:null==m?void 0:m.current,pattern:e,onClose:()=>v(!1)})]})})}const xg=function({blockPatterns:e=[],onClickPattern:t,orientation:n,label:o=(0,vt.__)("Block Patterns","kubio")}){const i=(0,le.__unstableUseCompositeState)({orientation:n}),l=(0,h.useSelect)((e=>{const{getIsFrontPage:t=pe().noop}=e(kn.STORE_KEY)||{};return t()}),[]);return(0,et.jsx)(le.__unstableComposite,{...i,role:"listbox",className:"block-editor-block-patterns-list","aria-label":o,children:e.map((e=>(0,et.jsx)(yg,{pattern:e,onClick:t,composite:i,isFrontPage:l},e.name)))})},Sg=function(){return(0,et.jsxs)("div",{className:"block-editor-inserter__no-results",children:[(0,et.jsx)(jc,{className:"block-editor-inserter__no-results-icon",icon:xc}),(0,et.jsx)("p",{children:(0,vt.__)("No results found.","kubio")})]})};function wg({rootClientId:e,onInsert:t,selectedCategory:n,onClickCategory:o,filterValue:i=""}){const[l,r,s]=((e,t)=>{const{patternCategories:n,patterns:o}=(0,h.useSelect)((e=>{const{getSettings:t}=e(ba);return{patterns:t().__experimentalBlockPatterns.filter((e=>!e.isGutentagPattern&&(!e.scope||e.scope.inserter))),patternCategories:t().__experimentalBlockPatternCategories}}),[t]),i=(0,p.useCallback)(((t,n)=>{e((0,ce.map)(n,(e=>(0,d.cloneBlock)(e))),t.name)}),[]);return[o,n,i]})(t,e),a=(0,p.useMemo)((()=>vc(l,i)),[i,l]),c=(0,p.useMemo)((()=>r.filter((e=>a.some((t=>{var n;return null===(n=t.categories)||void 0===n?void 0:n.includes(e.name)}))))),[a,r]),u=n||c[0];(0,p.useEffect)((()=>{a.some((e=>m(e)===1/0))&&!c.find((e=>"uncategorized"===e.name))&&c.push({name:"uncategorized",label:(0,vt._x)("Uncategorized","kubio","kubio")})}),[c,a]);const m=(0,p.useCallback)((e=>{if(!e.categories||!e.categories.length)return 1/0;const t=(0,ce.fromPairs)(c.map((({name:e},t)=>[e,t])));return Math.min(...e.categories.map((e=>void 0!==t[e]?t[e]:1/0)))}),[c]),f=(0,p.useMemo)((()=>a.filter((e=>"uncategorized"===u.name?m(e)===1/0:e.categories&&e.categories.includes(u.name)))),[a,u]),v=(0,p.useMemo)((()=>f.sort(((e,t)=>m(e)-m(t)))),[f,m]),b=(0,g.useAsyncList)(v);return(0,et.jsxs)(et.Fragment,{children:[!!f.length&&(0,et.jsx)(nh,{selectedCategory:u,patternCategories:c,onClickCategory:o,children:(0,et.jsx)(xg,{shownPatterns:b,blockPatterns:f,onClickPattern:s,label:u.label,orientation:"vertical",isDraggable:!0})}),!f.length&&(0,et.jsx)(Sg,{})]})}const Cg=function({rootClientId:e,onInsert:t,onClickCategory:n,selectedCategory:o,filterValue:i=""}){return(0,et.jsx)(wg,{rootClientId:e,selectedCategory:o,onInsert:t,onClickCategory:n,filterValue:i})};var Bg=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})});const Ig="isResuableBlocksrRenameHintVisible";function jg(){const e=(0,h.useSelect)((e=>e(Fo.store).get("core",Ig)??!0),[]),t=(0,p.useRef)(),{set:n}=(0,h.useDispatch)(Fo.store);return e?(0,et.jsxs)("div",{ref:t,className:"reusable-blocks-menu-items__rename-hint",children:[(0,et.jsx)("div",{className:"reusable-blocks-menu-items__rename-hint-content",children:(0,vt.__)("Reusable blocks are now synced patterns. A synced pattern will behave in exactly the same way as a reusable block.","kubio")}),(0,et.jsx)(le.Button,{className:"reusable-blocks-menu-items__rename-hint-dismiss",icon:Bg,iconSize:"16",label:(0,vt.__)("Dismiss hint","kubio"),onClick:()=>{const e=Ih.focus.tabbable.findPrevious(t.current);null==e||e.focus(),n("core",Ig,!1)},showTooltip:!1})]}):null}function Eg({onHover:e,onInsert:t,rootClientId:n}){const[o,,,i]=kc(n,t),l=(0,p.useMemo)((()=>o.filter((({category:e,syncStatus:t})=>"reusable"===e&&"unsynced"!==t))),[o]);return 0===l.length?(0,et.jsx)(Sg,{}):(0,et.jsx)(eh,{title:(0,vt.__)("Synced patterns","kubio"),children:(0,et.jsx)(Jp,{items:l,onSelect:i,onHover:e,label:(0,vt.__)("Synced patterns","kubio")})})}const Tg=function({rootClientId:e,onInsert:t,onHover:n}){return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)("div",{className:"block-editor-inserter__hint",children:(0,et.jsx)(jg,{})}),(0,et.jsx)(Eg,{onHover:n,onInsert:t,rootClientId:e}),(0,et.jsx)("div",{className:"block-editor-inserter__manage-reusable-blocks-container",children:(0,et.jsx)(le.Button,{className:"block-editor-inserter__manage-reusable-blocks",variant:"secondary",href:(0,it.addQueryArgs)("edit.php",{post_type:"wp_block"}),children:(0,vt.__)("Manage my patterns","kubio")})})]})},{Fill:Pg,Slot:Mg}=(0,le.createSlotFill)("__unstableInserterMenuExtension");Pg.Slot=Mg;const Rg=Pg,Ng=(e,t)=>top.requestIdleCallback((()=>{var n;null===(n=e.querySelector(`[data-block="${t}"]`))||void 0===n||n.scrollIntoView({behavior:"smooth"})})),Lg={header:"kubio/header",footer:"kubio/footer",sidebar:"kubio/sidebar"},Ag=function({rootClientId:e=null,insertionIndex:t=null,clientId:n=null,isAppender:o=!1,onSelect:i,shouldFocusBlock:l=!0,shouldSelectBlock:r=!0,ownerDocument:s,kubioInsertPosition:a}){const[c,u]=(0,p.useState)(!1),[g,m]=(0,p.useState)([]),{destinationRootClientId:f,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,h.useSelect)((i=>{var l,r,s;const{getSelectedBlock:a,getBlockIndex:c,getBlockOrder:u,getClientIdsOfDescendants:d,getBlockRootClientId:p,getClientIdsWithDescendants:h,getBlock:g,getSelectedBlockClientId:m,canInsertBlockType:f}=i(ba);let v,b;const k=m();(e||t||n||o)&&(v=e,(0,ce.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,ce.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=pe().noop,getPage:I=pe().noop,getSettings:j=pe().noop}=i("kubio/edit-site")||{},E=C("root","site"),T=(null==E?void 0:E.page_on_front)===(null===(l=I())||void 0===l||null===(r=l.context)||void 0===r?void 0:r.postId),P=B(),M=null==P?void 0:P.split("//"),R="front-page"===pe().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:f,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:L,replaceBlock:A,hideInsertionPoint:D,updateBlockAttributes:O,replaceInnerBlocks:z,__unstableMarkNextChangeAsNotPersistent:V}=(0,h.useDispatch)(ba),{editEntityRecord:F}=(0,h.useDispatch)("core"),{setOpenInserter:H}=(0,h.useDispatch)("kubio/edit-site");function G(){u(!1)}const $=(0,p.useRef)(_),{createWarningNotice:U}=(0,h.useDispatch)(Wh.store),W=(0,p.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,re.slugify)(e);let l=0,r="";for(;-1!==o.indexOf(`${i}${r}`);)l++,r=`-${l}`;return{name:l?`${e} ${l}`:e,anchor:`${i}${r}`}}),[S,w,_,C]),K=(0,p.useCallback)(((e,t,n=!1)=>{const i=b();if(!o&&i&&(0,d.isUnmodifiedDefaultBlock)(i))M(i.clientId,e,null,l||n?0:null,t);else{let o=f,i=v;const c=(0,ce.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,vt.__)("Please drag the block to the desired location","kubio"),{type:"snackbar"});"begin"===a&&(i=0),"end"===a&&(i=k(o).length),R((0,re.cleanFontFamilyFromBlocks)(e),i,o,r,l||n?0:null,t)}}),[o,b,M,R,f,v,r,l,a,k,I,j]),Z=(0,p.useCallback)(((e,t,n)=>{const r=b();if(!o&&r&&(0,d.isUnmodifiedDefaultBlock)(r))M(r.clientId,e,null,l||n?0:null,t);else{if(!f)return U((0,vt.__)("Please select a container block ( like a column ) before inserting patterns","kubio"),{type:"snackbar"});R(e,v,f,!0,l||n?0:null,t)}i&&i()}),[o,b,M,R,f,v,l]),q=(0,p.useCallback)((async(e,t,n=!1)=>{const{area:o="content",pattern:i={}}=t;if(null!=i&&i.isGutentagPattern){if(!i.isProOnFree)if(e=(0,ce.castArray)(e),-1!==["header","footer"].indexOf(o)){const{attributes:t,innerBlocks:n}=(0,ce.castArray)(e)[0],i=n.map((e=>{let t=(0,vt.__)("Header Section","kubio");switch("footer"===o&&(t=(0,vt.__)("Footer Section","kubio")),e.name){case"kubio/navigation":t=(0,vt.__)("Navigation","kubio");break;case"kubio/hero":t=(0,vt.__)("Hero","kubio")}"kubio/hero"===e.name||(e=(0,re.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 u(!0),void m(i);const l=(0,ce.omit)(t,["kubio.hash","kubio.id","kubio.styleRef","tagName"]);if((0,ce.isEqual)(l,{kubio:{}})||(V(),O(_,t)),Lg[o]&&y&&(null==y?void 0:y.name)!==Lg[o]){const e=["attributes","slug"],t={slug:(0,ce.get)(y,e)},n=(0,d.createBlock)(Lg[o],t);await z(_,i),await A(_,n),N(null==n?void 0:n.clientId),Ng(s,null==n?void 0:n.clientId)}else{const e={blocks:i,content:({blocks:e=[]})=>(0,d.__unstableSerializeAndClean)(e)},{theme:t,slug:n}=y.attributes;F("postType","wp_template_part",`${t}//${n}`,e),Ng(s,_)}}else{var l,r;const{categories:t}=i,n=(null==t?void 0:t[0])??"__undefined__category__",o=(null===(l=(0,ce.find)(x,{name:n}))||void 0===l?void 0:l.label)??"Custom Section",{anchor:a,name:c}=W(o),u=(0,ce.map)(e,(e=>("kubio/section"===e.name&&(e={...e,attributes:{...e.attributes,anchor:a,attrs:{...e.attributes.attrs,name:c}}}),e)));let d=k(_).length;-1!==i.categories.indexOf(kn.HERO_ACCENT_CATEGORY)&&(d=0),T?(M($.current,u),$.current=u[0].clientId):R((0,re.cleanFontFamilyFromBlocks)(u),d,_,!1),P&&H(!1),Ng(s,null===(r=e[0])||void 0===r?void 0:r.clientId)}}else Z(e,t,n)}),[_,y,W,O,z,R,k,x,T]),Y=(0,p.useCallback)(((e,t,n=!1)=>{var o;if((0,re.isGutentagPrefixed)(null===(o=(0,ce.castArray)(e)[0])||void 0===o?void 0:o.name)&&(e=(0,re.refreshBlockStyleRefs)(e)),null!=t&&t.patternName)q(e,t,n);else{if(!f&&!b())return void U((0,vt.__)("Please drag the block to the desired location","kubio"),{type:"snackbar"});K(e,t,n),i&&i()}}),[q,K]),Q=(0,p.useCallback)((e=>{e?L(f,v):D()}),[L,D,f,v,g]);return[f,Y,Q,{showCreateTemplateModal:c,onCloseTemplateModal:G,onCreateTemplate:function(){G(),H(!1)},newTemplateData:g,patternRootClientId:_,isFSEFrontPageButDoesNotHaveFrontPageTemplate:E}]},Dg=({filteredBlockTypes:e,...t})=>{const n=(0,p.useMemo)((()=>e.filter((({name:e})=>(0,re.isGutentagPrefixed)(e)))),[e]),o=(0,p.useMemo)((()=>e.filter((({name:e})=>!(0,ce.find)(n,{name:e})))),[e]);return[{label:(0,vt.__)("Kubio blocks","kubio"),icon:null,blockTypes:n},{label:(0,vt.__)("General blocks","kubio"),icon:null,blockTypes:o}].filter((({blockTypes:e})=>e&&e.length)).map((({icon:e,label:n,blockTypes:o})=>(0,et.jsxs)("div",{children:[(0,et.jsxs)("div",{className:"block-editor-inserter__panel-header",children:[(0,et.jsx)("h2",{className:"block-editor-inserter__panel-title",children:n}),e&&(0,et.jsx)(jc,{icon:e})]},`inserter-${n}-label`),(0,et.jsx)("div",{className:"block-editor-inserter__panel-content",children:(0,et.jsx)(Jp,{items:o,...t})},`inserter-${n}-cotent`)]},`inserter-${n}-container`)))},Og=function({filterValue:e,onSelect:t,onHover:n,rootClientId:o,clientId:i,isAppender:l,maxBlockTypes:r,showBlockDirectory:s=!1,isDraggable:a=!0,shouldFocusBlock:c=!0,shouldSelectBlock:u=!0,isQuick:m=!1,ownerDocument:f,kubioInsertPosition:v}){const b=(0,g.useDebounce)(gr.speak,500),k=(0,h.useSelect)((e=>e(d.store).getBlockType)),[_,y]=Ag({onSelect:t,rootClientId:o,clientId:i,isAppender:l,shouldFocusBlock:c,shouldSelectBlock:u,ownerDocument:f,kubioInsertPosition:v}),[x,S,w,C]=kc(_,y),B=(0,p.useMemo)((()=>{let t=[];if((0,ce.isEmpty)(e)&&m&&(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,ce.isEmpty)(t)){const n=x.sort(((e,t)=>((0,re.isGutentagPrefixed)(e.name)?0:1)-((0,re.isGutentagPrefixed)(t.name)?0:1)));t=fc(n,S,w,e)}return void 0!==r?t.slice(0,r):t}),[e,x,S,w,r]);(0,p.useEffect)((()=>{if(!e)return;const t=B.length,n=(0,vt.sprintf)(/* translators: %d: number of results. */ /* translators: %d: number of results. */(0,vt._n)("%d result found.","%d results found.",t,"kubio"),t);b(n)}),[e,b]);const I=!(0,ce.isEmpty)(B);return(0,et.jsxs)(et.Fragment,{children:[!s&&!I&&(0,et.jsx)(Sg,{}),!!B.length&&(0,et.jsxs)(eh,{title:(0,et.jsx)(le.VisuallyHidden,{children:(0,vt.__)("Blocks","kubio")}),children:[e&&(0,et.jsx)(Dg,{filteredBlockTypes:B,onSelect:C,onHover:n,label:(0,vt.__)("Blocks","kubio"),isDraggable:a}),!e&&(0,et.jsx)(Jp,{items:B,onSelect:C,onHover:n,label:(0,vt.__)("Blocks","kubio"),isDraggable:a})]}),s&&(0,et.jsx)(Rg.Slot,{fillProps:{onSelect:C,onHover:n,filterValue:e,hasItems:I,rootClientId:_},children:e=>e.length?e:I?null:(0,et.jsx)(Sg,{})})]})},zg={name:"blocks",/* translators: Blocks tab title in the block inserter. */title:(0,vt.__)("Blocks","kubio")},Vg={name:"kubio-sections",/* translators: Patterns tab title in the block inserter. */title:(0,vt.__)("Sections","kubio")},Fg={name:"patterns",/* translators: Patterns tab title in the block inserter. */title:(0,vt.__)("Patterns","kubio")},Hg={name:"reusable",/* translators: Locally created Patterns tab title in the block inserter. */title:(0,vt.__)("Synced patterns","kubio")},Gg=function({children:e,showPatterns:t=!1,showReusableBlocks:n=!1,onSelect:o,initialTabName:i}){const l=(0,p.useMemo)((()=>{const e=[zg,Vg];return n&&e.push(Hg),e}),[zg,!1,Fg,n,Hg,Vg]),r=(0,p.useRef)();return(0,p.useLayoutEffect)((()=>{if(r.current&&i&&l.length){const e=setTimeout((()=>{const e=(0,ce.find)(l,{name:i}),t=l.indexOf(e),n=r.current.querySelectorAll(".components-tab-panel__tabs > *");n&&n.length&&n[t].click()}),50);return()=>clearTimeout(e)}}),[r.current,i,l]),(0,et.jsx)("div",{ref:r,children:(0,et.jsx)(le.TabPanel,{className:"block-editor-inserter__tabs",tabs:l,onSelect:o,initialTabName:i,children:e})})},$g=window.kubio.log;function Ug({area:e="content",onInsert:t,filterValue:n=""}){const[o,i,l]=((e,t="content")=>{const{patternCategories:n,patterns:o}=(0,h.useSelect)((e=>{const{getSettings:n}=e(ba);return{patterns:n().__experimentalBlockPatterns.filter((e=>e.isGutentagPattern&&0===e.name.indexOf(`kubio-${t}`))),patternCategories:n().__experimentalBlockPatternCategories}}),[t]),i=(0,p.useCallback)(((t,n)=>{const o=t.isGutentagPattern?(0,re.transformTemplateToBlock)(n):(0,ce.map)(n,(e=>(0,d.cloneBlock)(e)));e(o,t)}),[e]);return[(0,p.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:r}=(0,h.useSelect)((e=>{let t;try{const{getIsFrontPage:n=pe().noop}=e("kubio/edit-site")||{};t=n()}catch(e){$g.Log.error("BlockGutentagSectionsCategory - determine isFrontPage",e)}return{isFrontPage:t}}),[]),s=(0,h.useSelect)((e=>{const{getExcludedSectionCategories:t}=e("kubio/edit-site");return t()})),[a,c]=(0,p.useState)(re.ALL_TAG),{filteredPatterns:u,availableTagSlugs:g}=(0,p.useMemo)((()=>{const e=new Set;return{filteredPatterns:o.filter((t=>{var n;const o=pe().get(t,"categories.0",""),i=o===kn.INNER_HEADERS_CATEGORY;if(s.includes(o))return!1;if(r&&i)return!1;const l=(null==t?void 0:t.publicTags)||[];return l.forEach((t=>{e.add(t)})),!!(a===re.ALL_TAG||null!=l&&null!==(n=l.includes)&&void 0!==n&&n.call(l,a))&&!!(0,re.isPatternAvailableInCurrentTheme)(t)})),availableTagSlugs:[...e]}}),[o,r,a]),m=window.kubioPatternsRegistered?Sg:Wg,f=(0,p.useMemo)((()=>vc(u,n)),[n,u]),v=(0,p.useMemo)((()=>{let e=1;return i.filter((e=>f.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!==kn.HERO_ACCENT_CATEGORY&&e&&(e--,n=!0),{...t,open:n}}))}),[f,i]),b=(0,p.useMemo)((()=>{const e={};return v.forEach((({name:t})=>{const n=f.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}),[f,v]),k=(0,p.useCallback)((e=>{if(!e.categories||!e.categories.length)return 1/0;const t=(0,ce.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,p.useEffect)((()=>{f.some((e=>k(e)===1/0))&&!v.find((e=>"uncategorized"===e.name))&&v.push({name:"uncategorized",label:(0,vt._x)("Uncategorized","kubio","kubio")})}),[v,f,k]);const _=({title:e,slug:t})=>(0,et.jsxs)(et.Fragment,{children:[e,(0,et.jsxs)("span",{className:"kubio-pattern__category-count",children:["(",b[t].length,")"]})]});return(0,et.jsxs)(et.Fragment,{children:[!!g.length&&(0,et.jsx)("div",{className:"kubio-inserter-section-tags__container",children:(0,et.jsx)(re.KubioSectionsTags,{activeTag:a,setActiveTag:c,availableTagSlugs:g})}),!!v.length&&(0,et.jsx)(le.Panel,{className:"kubio-patterns-panel",children:v.map((e=>{let t=e.label;return"kubio-content/blank"===e.name&&(t=(0,vt.__)("Blank section","kubio")),(0,et.jsx)(le.PanelBody,{title:(0,et.jsx)(_,{title:t,slug:e.name}),initialOpen:e.open||!(0,ce.isEmpty)(n),opened:1===v.length||void 0,children:(0,et.jsx)(xg,{blockPatterns:b[e.name],onClickPattern:l,orientation:"vertical"})},`patterns-category-${e.name}`)}))}),!v.length&&(0,et.jsx)(m,{})]})}function Wg(){return(0,et.jsxs)("div",{className:"block-editor-inserter__no-results",children:[(0,et.jsx)(jc,{className:"block-editor-inserter__no-results-icon",icon:xc}),(0,et.jsxs)("div",{className:"block-editor-inserter__no-results__message",children:[(0,et.jsx)(jc,{icon:vg.KubioLoader}),(0,et.jsx)("p",{children:(0,vt.__)("Loading sections…","kubio")})]})]})}const Kg=function({rootClientId:e,onInsert:t,filterValue:n,area:o="content"}){return(0,et.jsx)(Ug,{rootClientId:e,onInsert:t,filterValue:n,area:o})},Zg=function({rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:o,onSelect:i,showInserterHelpPanel:l,showMostUsedBlocks:r,shouldFocusBlock:s=!0,shouldSelectBlock:a=!0,ownerDocument:c}){const[u,d]=(0,p.useState)(""),[g,m]=(0,p.useState)(null),[f,v,b,k]=Ag({rootClientId:e,clientId:t,isAppender:n,insertionIndex:o,shouldFocusBlock:s,shouldSelectBlock:a,ownerDocument:c}),{showPatterns:_,hasReusableBlocks:y,patternsInserterArea:x,showGutentagSectionsTab:S}=(0,h.useSelect)((e=>{var t;const{getSettings:n,__experimentalGetAllowedPatterns:o}=e(ba),i=e("kubio/edit-site").getOpenedInserter();let l="content";return(0,ce.isString)(i)&&(-1!==i.indexOf("pattern-inserter/")&&(l=i.replace("pattern-inserter/","")),-1!==l.indexOf("-blocks")&&(l=l.replace("-blocks","")),-1!==l.indexOf("post-content")&&(l="content")),{showPatterns:!f||!!o(f).length,hasReusableBlocks:!(null===(t=n().__experimentalReusableBlocks)||void 0===t||!t.length),patternsInserterArea:l,showGutentagSectionsTab:(0,ce.isString)(i)&&"block-inserter"!==i&&-1===i.indexOf("blocks")}}),[f]),w=(0,p.useCallback)(((e,t,n)=>{void 0===n&&(n=!0),v(e,t,n),i()}),[v,i]),C=(0,p.useCallback)(((e,t)=>{var n,o;const l=(null===(n=(0,ce.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:l}),i()}),[v,i]),B=(0,p.useRef)(),I=(0,p.useCallback)((t=>{e&&B.current!==t&&(B.current=t,b(!!t))}),[b,e]),j=(0,p.useCallback)((e=>{m(e)}),[m]),E=(0,p.useMemo)((()=>u?(0,et.jsx)(Og,{filterValue:u,onSelect:i,onHover:I,rootClientId:e,clientId:t,isAppender:n,showBlockDirectory:!1,shouldFocusBlock:s,shouldSelectBlock:a}):(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)("div",{className:"block-editor-inserter__block-list",children:(0,et.jsx)(th,{rootClientId:f,onInsert:w,onHover:I,showMostUsedBlocks:r})}),l&&(0,et.jsxs)("div",{className:"block-editor-inserter__tips",children:[(0,et.jsx)(le.VisuallyHidden,{as:"h2",children:(0,vt.__)("A tip for using the block editor","kubio")}),(0,et.jsx)(jp,{})]})]})),[u,f,w,I,r,l,i,e,t,n,!1,s,a]),T=(0,p.useMemo)((()=>(0,et.jsx)(Cg,{rootClientId:f,onInsert:C,onClickCategory:j,selectedCategory:g})),[f,C,j,g]),P=(0,p.useMemo)((()=>(0,et.jsx)(Kg,{rootClientId:f,onInsert:C,filterValue:u,area:x})),[f,C,u,x]),M=(0,p.useRef)(),R=(0,p.useMemo)((()=>(0,et.jsx)(Tg,{rootClientId:f,onInsert:w,onHover:I})),[f,w,I]),[N,L]=(0,p.useState)(),A=(0,p.useCallback)((e=>(N!==e.name&&L(e.name),"blocks"===e.name?E:"kubio-sections"===e.name?P:"patterns"===e.name?T:R)),[N,R,E,P,T]),D=(0,p.useMemo)((()=>S?"kubio-sections":"blocks"),[S]),[O,z]=(0,p.useState)(D),{showCreateTemplateModal:V,onCloseTemplateModal:F,onCreateTemplate:H,newTemplateData:G,patternRootClientId:$,...U}=k;return(0,p.useEffect)((()=>{var e;null!=M&&null!==(e=M.current)&&void 0!==e&&e.scrollTop&&(M.current.scrollTop=0)}),[O]),(0,et.jsxs)("div",{className:"block-editor-inserter__menu",children:[(0,et.jsx)("div",{className:"block-editor-inserter__main-area",ref:M,children:(0,et.jsxs)("div",{className:"block-editor-inserter__content",children:[(0,et.jsx)(Pp,{onChange:e=>{d(e)},value:u,label:(0,vt.__)("Search for blocks and patterns","kubio"),placeholder:(0,vt.__)("Search","kubio")}),(0,et.jsx)(re.KubioSectionsTagsSlotFill.Slot,{}),(0,et.jsx)(Gg,{showPatterns:_,showReusableBlocks:y,initialTabName:O,onSelect:z,children:A})]})}),V&&(0,et.jsx)(Bp,{area:$,innerBlocks:G,onClose:F,onSuccess:H,...U})]})};function qg({onSelect:e,rootClientId:t,clientId:n,isAppender:o,ownerDocument:i,kubioInsertPosition:l,onClickBrowseAll:r}){const[s,a]=(0,p.useState)(""),[c,u]=Ag({onSelect:e,rootClientId:t,clientId:n,isAppender:o,ownerDocument:i,kubioInsertPosition:l}),[d]=kc(c,u),g=d.length>6,{setInserterIsOpened:m,insertionIndex:f,totalInnerBlocks:v}=(0,h.useSelect)((e=>{const{getSettings:o,getBlockIndex:i,getBlockCount:l,getBlockOrder:r}=e(ba),s=i(n,t);return{setInserterIsOpened:o().__experimentalSetIsInserterOpened,insertionIndex:-1===s?l():s,totalInnerBlocks:r(t).length}}),[n,t]);return(0,p.useEffect)((()=>{m&&m(!1)}),[m]),(0,et.jsxs)("div",{className:yc()("block-editor-inserter__quick-inserter",{"has-search":g,"has-expand":m}),children:[g&&(0,et.jsx)(Pp,{value:s,onChange:e=>{a(e)},label:(0,vt.__)("Search for blocks and patterns","kubio"),placeholder:(0,vt.__)("Search","kubio")}),(0,et.jsx)("div",{className:"block-editor-inserter__quick-inserter-results",children:(0,et.jsx)(Og,{filterValue:s,onSelect:e,rootClientId:t,clientId:n,isAppender:o,maxBlockTypes:6,isDraggable:!1,isQuick:!0,kubioInsertPosition:l})}),m&&(0,et.jsx)(le.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:e=>{e.target.blur();let n=f;"begin"===l&&(n=0),"end"===l&&(n=v),m({rootClientId:t,insertionIndex:n,isAppender:!0}),null==r||r()},"aria-label":(0,vt.__)("Browse all. This will open the main inserter panel in the editor toolbar.","kubio"),children:(0,vt.__)("Browse all","kubio")})]})}const Yg=({onToggle:e,disabled:t,isOpen:n,blockTitle:o,hasSingleBlockType:i,toggleProps:l={}})=>{let r;r=i?(0,vt.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,vt._x)("Add %s","directly add the only allowed block","kubio"),o):(0,vt._x)("Add block","Generic label for block inserter button","kubio");const{onClick:s,...a}=l;return(0,et.jsx)(le.Button,{icon:gp,label:r,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 Qg extends p.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:l,toggleProps:r,hasItems:s,renderToggle:a=Yg,prioritizePatterns:c}=this.props;return a({onToggle:e,isOpen:t,disabled:n||!s,blockTitle:o,hasSingleBlockType:i,directInsertBlock:l,toggleProps:r,prioritizePatterns:c})}renderContent({onClose:e}){const{rootClientId:t,clientId:n,isAppender:o,showInserterHelpPanel:i,__experimentalIsQuick:l,ownerDocument:r,prioritizePatterns:s,onSelectOrClose:a,selectBlockOnInsert:c,kubioInsertPosition:u,onClickBrowseAll:d}=this.props;return l?(0,et.jsx)(qg,{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:r,kubioInsertPosition:u,onClickBrowseAll:d}):(0,et.jsx)(Zg,{onSelect:()=>{e()},rootClientId:t,clientId:n,isAppender:o,showInserterHelpPanel:i,ownerDocument:r})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:i,onSelectOrClose:l,anchorRef:r,anchor:s}=this.props;if(t||n)return this.renderToggle({onToggle:o});const a=(0,re.wpVersionCompare)("6.1","<")?{}:{position:e,placement:"bottom",anchorRef:r,anchor:s,shift:!0};return(0,et.jsx)(le.Dropdown,{className:"block-editor-inserter",contentClassName:yc()("block-editor-inserter__popover",{"is-quick":i}),position:e,popoverProps:a,onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,vt.__)("Add a block","kubio"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}const Xg=(0,g.compose)([(0,h.withSelect)(((e,{clientId:t,rootClientId:n,shouldDirectInsert:o=!0})=>{var i;const{getBlockRootClientId:l,hasInserterItems:r,__experimentalGetAllowedBlocks:s,getDirectInsertBlock:a,getAllowedBlocks:c,getSettings:u}=e(ba),{getBlockVariations:p}=e(d.store),h=(c||s)(n=n||l(t)||void 0),g=o&&a(n),m=u(),f=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 f&&(v=h[0]),{hasItems:r(n),hasSingleBlockType:f,blockTitle:v?v.title:"",allowedBlockType:v,directInsertBlock:g,rootClientId:n,prioritizePatterns:m.__experimentalPreferPatternsOnRoot&&!n}})),(0,h.withDispatch)(((e,t,{select:n})=>({insertOnlyAllowedBlock(){const{rootClientId:o,clientId:i,isAppender:l,hasSingleBlockType:r,allowedBlockType:s,directInsertBlock:a,onSelectOrClose:c,selectBlockOnInsert:u,kubioInsertPosition:p}=t;if(!r&&!a)return;const{insertBlock:h}=e(ba);let g;if(a){const e=function(e){const{getBlock:t,getPreviousBlockClientId:l}=n(ba);if(!e||!i&&!o)return{};const r={};let s={};if(i){const e=t(i),n=t(l(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)&&(r[e]=s[e])})),r}(a.attributesToCopy);g=(0,d.createBlock)(a.name,{...a.attributes||{},...e})}else g=(0,d.createBlock)(s.name);var m;h(g,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:r,getBlockRootClientId:s}=n(ba);if("begin"===p)return 0;if("end"===p)return r(o).length;if(i)return e(i,o);const a=t();return!l&&a&&s(a)===o?e(a,o)+1:r(o).length}(),o,u),c&&c({clientId:null===(m=g)||void 0===m?void 0:m.clientId});const f=(0,vt.sprintf)(// translators: %s: the name of the block that has been added
// translators: %s: the name of the block that has been added
(0,vt.__)("%s block added","kubio"),s.title);(0,gr.speak)(f)}}))),(0,g.ifCondition)((({hasItems:e,isAppender:t,rootClientId:n,clientId:o})=>e||!t&&!n&&!o))])(Qg),Jg=(0,p.forwardRef)(((e,t)=>(0,et.jsx)(Xg,{ref:t,...e}))),em="\ufeff";function tm({rootClientId:e}){const{showPrompt:t,isLocked:n,placeholder:o,isManualGrid:i}=(0,h.useSelect)((t=>{var n,o;const{getBlockCount:i,getSettings:l,getTemplateLock:r,getBlockAttributes:s}=t(ba),a=!i(e),{bodyPlaceholder:c}=l();return{showPrompt:a,isLocked:!!r(e),placeholder:c,isManualGrid:null===(n=s(e))||void 0===n||null===(o=n.layout)||void 0===o?void 0:o.isManualPlacement}}),[e]),{insertDefaultBlock:l,startTyping:r}=(0,h.useDispatch)(ba);if(n||i)return null;const s=(0,Pc.decodeEntities)(o)||(0,vt.__)("Type / to choose a block"),a=()=>{l(void 0,e),r()};return(0,et.jsxs)("div",{"data-root-client-id":e||"",className:u("block-editor-default-block-appender",{"has-visible-prompt":t}),children:[(0,et.jsx)("p",{tabIndex:"0",role:"button","aria-label":(0,vt.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{Jd.ENTER!==e.keyCode&&Jd.SPACE!==e.keyCode||a()},onClick:()=>a(),onFocus:()=>{t&&a()},children:t?s:em}),(0,et.jsx)(Jg,{rootClientId:e,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0})]})}const nm=(0,re.wpVersionCompare)("6.4","<");function om({rootClientId:e,className:t,onFocus:n,tabIndex:o},i){const[l,r]=(0,p.useState)(null),s=(0,g.useMergeRefs)([i,r]),a=(0,p.useMemo)((()=>({getBoundingClientRect(){var e;return null==l||null===(e=l.getBoundingClientRect)||void 0===e?void 0:e.call(l)},contextElement:nm?void 0:l,ownerDocument:nm?null==l?void 0:l.ownerDocument:void 0})),[l]);return(0,et.jsx)(Jg,{position:"bottom center",rootClientId:e,__experimentalIsQuick:!0,anchor:a,anchorRef:l,renderToggle:({onToggle:e,disabled:i,isOpen:l,blockTitle:r,hasSingleBlockType:a})=>{let c;c=a?(0,vt.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,vt._x)("Add %s","directly add the only allowed block","kubio"),r):(0,vt._x)("Add block","Generic label for block inserter button","kubio");const u=!a;let d=(0,et.jsxs)(le.Button,{ref:s,onFocus:n,tabIndex:o,className:yc()(t,"block-editor-button-block-appender"),onClick:e,"aria-haspopup":u?"true":void 0,"aria-expanded":u?l:void 0,disabled:i,label:c,children:[!a&&(0,et.jsx)(le.VisuallyHidden,{as:"span",children:c}),(0,et.jsx)(jc,{icon:gp})]});return(u||a)&&(d=(0,et.jsx)(le.Tooltip,{text:c,children:d})),d},isAppender:!0})}const im=(0,p.forwardRef)(((e,t)=>(Je()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),om(e,t)))),lm=(0,p.forwardRef)(om);function rm({rootClientId:e}){return(0,h.useSelect)((t=>t(ba).canInsertBlockType((0,d.getDefaultBlockName)(),e)))?(0,et.jsx)(tm,{rootClientId:e}):(0,et.jsx)(lm,{rootClientId:e,className:"block-list-appender__toggle"})}function sm({rootClientId:e,CustomAppender:t,className:n,tagName:o="div"}){const i=(0,h.useSelect)((t=>{const{getBlockInsertionPoint:n,isBlockInsertionPointVisible:o,getBlockCount:i}=t(ba),l=n();return o()&&e===(null==l?void 0:l.rootClientId)&&0===i(e)}),[e]);return(0,et.jsx)(o,{tabIndex:-1,className:yc()("block-list-appender wp-block",n,{"is-drag-over":i}),contentEditable:!1,"data-block":!0,children:t?(0,et.jsx)(t,{}):(0,et.jsx)(rm,{rootClientId:e})})}const am=window.wp.isShallowEqual;var cm=n.n(am);const um="function"==typeof cm()?cm():cm().isShallowEqual,dm=new WeakMap;function pm(){let e;return t=>(void 0!==e&&um(e,t)||(e=t),e)}function hm(e){const[t]=(0,p.useState)(pm);return t(e)}var gm=n(9588),mm=n.n(gm);function fm(e,t,n=["top","bottom","left","right"]){let o,i;return n.forEach((n=>{const l=function(e,t,n){const o="top"===n||"bottom"===n,{x:i,y:l}=e,r=o?i:l,s=o?l:i,a=o?t.left:t.top,c=o?t.right:t.bottom,u=t[n];let d;return d=r>=a&&r<=c?r:r<c?a:c,Math.sqrt((r-d)**2+(s-u)**2)}(e,t,n);(void 0===o||l<o)&&(o=l,i=n)})),[o,i]}function vm(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const bm=window.kubio.coreHooks;function km(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 _m(e,t,n={}){const{uiVersion:o}=(0,bm.useUIVersion)(),{operation:i="insert",nearestSide:l="right"}=n,{canInsertBlockType:r,getBlockIndex:s,getClientIdsOfDescendants:a,getBlockOrder:c,getBlocksByClientId:u,getSettings:g,getBlock:m}=(0,h.useSelect)(ba),{getGroupingBlockName:f}=(0,h.useSelect)(d.store),{insertBlocks:v,moveBlocksToPosition:b,updateBlockAttributes:k,clearSelectedBlock:_,replaceBlocks:y,removeBlocks:x}=(0,h.useDispatch)(ba),S=(0,h.useRegistry)(),w=(0,p.useCallback)(((n,s=!0,a=0,u=[])=>{Array.isArray(n)||(n=[n]),n=(0,re.cleanFontFamilyFromBlocks)(n);const p=c(e)[t];if("replace"===i)y(p,n,void 0,a);else if("group"===i){const t=m(p);"left"===l?n.push(t):n.unshift(t);const o=n.map((e=>(0,d.createBlock)(e.name,e.attributes,e.innerBlocks))),i=n.every((e=>"core/image"===e.name)),s=r("core/gallery",e),c=(0,d.createBlock)(i&&s?"core/gallery":f(),{layout:{type:"flex",flexWrap:i&&s?null:"nowrap"}},o);y([p,...u],c,void 0,a)}else v(n,t,e,1===o&&s,a)}),[c,e,t,i,y,m,l,r,f,v,o]),C=(0,p.useCallback)(((n,o,l)=>{if("replace"===i){const o=u(n),i=c(e)[t];S.batch((()=>{x(n,!1),y(i,o,void 0,0)}))}else b(n,o,e,l)}),[i,c,u,b,S,x,y,t,e]),B=function(e,t,n,o,i,l,r,s,a,c){return u=>{const{srcRootClientId:p,srcClientIds:h,type:g,blocks:m}=km(u);if("inserter"===g){const e=1===s;1===s&&r();const t=m.map((e=>(0,d.cloneBlock)(e)));l(t,e,null)}if("block"===g){const r=n(h[0]);if(p===e&&r===t)return;if(h.includes(e)||o(h).some((t=>t===e)))return;if("group"===a){const e=h.map((e=>c(e)));return void l(e,!0,null,h)}const s=p===e,u=h.length;i(h,p,s&&r<t?t-u:t)}}}(e,t,s,a,C,w,_,o,i,m),I=function(e,t,n,o,i){return l=>{if(!t().mediaUpload)return;const r=(0,d.findTransform)((0,d.getBlockTransforms)("from"),(t=>"files"===t.type&&o(t.blockName,e)&&t.isMatch(l)));if(r){const e=r.transform(l,n);i(e)}}}(e,g,k,r,w),j=function(e){return t=>{const n=(0,d.pasteHandler)({HTML:t,mode:"BLOCKS"});n.length&&e(n)}}(w);return e=>{const t=(0,Ih.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?j(n):t.length?I(t):B(e)}}const ym=(e,t)=>t<e-20||t>e+20,xm=()=>{top.requestIdleCallback((()=>{setTimeout((()=>top.document.body.classList.remove("kubio-dragging-from-inserter--active")),10)}))},Sm=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 wm(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 l=n.map((t=>e(t))).every((e=>{const[t]=(null==e?void 0:e.parent)||[];return!t||t===o}));return i&&l}const Cm={};function Bm({children:e,clientId:t}){const n=function(e){return(0,h.useSelect)((t=>{const n=t(ba).getBlock(e);if(!n)return;const o=t(d.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,et.jsx)(nt,{value:n,children:e})}const Im=(0,p.memo)(c_);function jm(e){const{clientId:t,allowedBlocks:n,prioritizedInserterBlocks:o,defaultBlock:i,directInsert:l,__experimentalDefaultBlock:r,__experimentalDirectInsert:s,template:a,templateLock:c,wrapperRef:u,templateInsertUpdatesSelection:g,__experimentalCaptureToolbars:m,__experimentalAppenderTagName:f,renderAppender:v,orientation:b,placeholder:k,layout:_,name:y,blockType:x,parentLock:S,defaultLayout:w}=e;!function(e,t,n,o,i,l,r,s,a,c,u,d){const g=(0,h.useRegistry)(),m=hm(n),f=hm(o),v=void 0===a||"contentOnly"===t?t:a;(0,p.useLayoutEffect)((()=>{const t={allowedBlocks:m,prioritizedInserterBlocks:f,templateLock:v};if(void 0!==c&&(t.__experimentalCaptureToolbars=c),void 0!==u)t.orientation=u;else{const e=Bd(null==d?void 0:d.type);t.orientation=e.getOrientation(d)}void 0!==r&&(Je()("__experimentalDefaultBlock",{alternative:"defaultBlock",since:"6.3",version:"6.4"}),t.defaultBlock=r),void 0!==i&&(t.defaultBlock=i),void 0!==s&&(Je()("__experimentalDirectInsert",{alternative:"directInsert",since:"6.3",version:"6.4"}),t.directInsert=s),void 0!==l&&(t.directInsert=l),void 0!==t.directInsert&&"boolean"!=typeof t.directInsert&&Je()("Using `Function` as a `directInsert` argument",{alternative:"`boolean` values",since:"6.5"}),dm.get(g)||dm.set(g,{}),dm.get(g)[e]=t,window.queueMicrotask((()=>{const e=dm.get(g);if(Object.keys(e).length){const{updateBlockListSettings:t}=g.dispatch(ba);t(e),dm.set(g,{})}}))}),[e,m,f,v,i,l,r,s,c,u,d,g])}(t,S,n,o,i,l,r,s,c,m,b,_),function(e,t,n,o){const i=(0,h.useRegistry)(),l=(0,p.useRef)(null);(0,p.useLayoutEffect)((()=>{let r=!1;const{getBlocks:s,getSelectedBlocksInitialCaretPosition:a,isBlockSelected:c}=i.select(ba),{replaceInnerBlocks:u,__unstableMarkNextChangeAsNotPersistent:p}=i.dispatch(ba);return window.queueMicrotask((()=>{if(r)return;const i=s(e),h=0===i.length||"all"===n||"contentOnly"===n,g=!kt()(t,l.current);if(!h||!g)return;l.current=t;const m=(0,d.synchronizeBlocksWithTemplate)(i,t);kt()(m,i)||(p(),u(e,m,0===i.length&&o&&0!==m.length&&c(e),a()))})),()=>{r=!0}}),[t,n,e,i,o])}(t,a,c,g);const C=(0,d.getBlockSupport)(y,"layout")||(0,d.getBlockSupport)(y,"__experimentalLayout")||Cm,{allowSizingOnChildren:B=!1}=C,I=_||C,j=(0,p.useMemo)((()=>({...w,...I,...B&&{allowSizingOnChildren:!0}})),[w,I,B]),E=(0,et.jsx)(Im,{rootClientId:t,renderAppender:v,__experimentalAppenderTagName:f,layout:j,wrapperRef:u,placeholder:k});return null!=x&&x.providesContext&&0!==Object.keys(x.providesContext).length?(0,et.jsx)(Bm,{clientId:t,children:E}):E}function Em(e){return dh(e),(0,et.jsx)(jm,{...e})}const Tm=(0,p.forwardRef)(((e,t)=>{const n=Pm({ref:t},e);return(0,et.jsx)("div",{className:"block-editor-inner-blocks",children:(0,et.jsx)("div",{...n})})}));function Pm(e={},t={}){const{__unstableDisableLayoutClassNames:n,__unstableDisableDropZone:o,dropZoneElement:i}=t,{clientId:l,layout:r=null,__unstableLayoutClassNames:s=""}=B(),a=(0,h.useSelect)((e=>{if(!l)return{};const{getBlockName:t,isZoomOut:n,getTemplateLock:o,getBlockRootClientId:i,getBlockEditingMode:r,getBlockSettings:s,getSectionRootClientId:a}=fe(e(ba));if(!l){const e=a();return{isDropZoneDisabled:n()&&""!==e}}const{hasBlockSupport:c,getBlockType:u}=e(d.store),p=t(l),h=r(l),g=i(l),[m]=s(l,"layout");let f="disabled"===h;if(n()){const e=a();f=l!==e}return{__experimentalCaptureToolbars:c(p,"__experimentalExposeControlsToChildren",!1),name:p,blockType:u(p),parentLock:o(g),parentClientId:g,isDropZoneDisabled:f,defaultLayout:m}}),[l]),{__experimentalCaptureToolbars:c,name:m,blockType:f,parentLock:v,parentClientId:b,isDropZoneDisabled:k,defaultLayout:_}=a,y=function({rootClientId:e=""}={}){const[t,n]=(0,p.useState)(null),o=(0,p.useRef)(null),i=(0,p.useRef)(null);i.current=e;const{isLockedAll:l,orientation:r,noDragInside:s,canInsert:a,isInsertionPointVisible:c}=(0,h.useSelect)((t=>{var n;const{getBlockListSettings:o,getTemplateLock:i,getBlock:l,canInsertBlockType:r,isBlockInsertionPointVisible:s}=t(ba),{getBlockType:a}=t("core/blocks"),c=l(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:r,isInsertionPointVisible:s}}),[e]),{showInsertionPoint:u,hideInsertionPoint:d}=(0,h.useDispatch)(ba),m=()=>{o.current&&c&&(d(),o.current=null)},f=up(e),v=(0,p.useCallback)(mm()(a),[]),b=(0,p.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=_m(e,t),_=(0,p.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,g.useThrottle)((0,p.useCallback)(((t,i)=>{if(!f||!b())return;const l=function(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],i=(0,vt.isRTL)();let l,r;return e.forEach(((n,s)=>{const a=n.getBoundingClientRect(),[c,u]=fm(t,a,o);if(void 0===r||c<r){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,r=c,l=s+n}})),l}(Array.from(i.children).filter((e=>e.classList.contains("wp-block")||e.querySelector(".wp-block"))),{x:t.clientX,y:t.clientY},r),s=void 0===l?0:l;var a;n(s),f&&null!==s&&(Sm(f),a=s,o.current!==e+a&&(o.current=e+a,u(e,a)))}),[f]),200),x=(0,g.useThrottle)((0,p.useCallback)((()=>{f&&(b()?Sm(f):f.classList.remove("is-hovered","kubio-is-hovered-on-drop"))}),[f]),100),S=(0,p.useCallback)((e=>{var t,i,l;f&&null!=f&&null!==(t=f.classList)&&void 0!==t&&t.contains("kubio-is-hovered-on-drop")&&(null==f||f.classList.remove("is-hovered","kubio-is-hovered-on-drop"));const r=null==e||null===(i=e.target)||void 0===i||null===(l=i.closest)||void 0===l?void 0:l.call(i,".wp-block");r&&r.isSameNode(f)||o.current&&(y.cancel(),m(),n(null))}),[f]),w=(0,p.useRef)({x:0,y:0}),C=(0,p.useCallback)((e=>{var i;o.current=null,n(null),w.current={x:0,y:0},xm(),o.current&&(x.cancel(),y.cancel(),m(),null!==t&&n(null),null==f||null===(i=f.classList)||void 0===i||i.remove("is-hovered","kubio-is-hovered-on-drop"))}),[f]),B=(0,p.useCallback)((()=>{xm(),top.document.removeEventListener("dragend",B)}));return(0,g.__experimentalUseDropZone)({isDisabled:l||s,onDragStart:()=>{top.document.addEventListener("dragend",B)},onDrop:(...e)=>{xm(),_(...e)},onDragOver(e){var t;null!==(t=e.currentTarget.closest(".wp-block"))&&void 0!==t&&t.isSameNode(f)&&(ym(w.current.x,e.clientX)||ym(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:l,parentClientId:b}),x=(0,g.useMergeRefs)([e.ref,o||k||null!=r&&r.isManualPlacement&&window.__experimentalEnableGridInteractivity?null:y]),S={__experimentalCaptureToolbars:c,layout:r,name:m,blockType:f,parentLock:v,defaultLayout:_,...t},w=S.value&&S.onChange?Em:jm;return{...e,ref:x,className:u(e.className,"block-editor-block-list__layout",n?"":s),children:l?(0,et.jsx)(w,{...S,clientId:l}):(0,et.jsx)(c_,{...t})}}Pm.save=d.__unstableGetInnerBlocksProps,Tm.DefaultBlockAppender=function(){const{clientId:e}=B();return(0,et.jsx)(tm,{rootClientId:e})},Tm.ButtonBlockAppender=function({showSeparator:e,isFloating:t,onAddBlock:n,isToggle:o}){const{clientId:i}=B();return(0,et.jsx)(lm,{className:u({"block-list-appender__toggle":o}),rootClientId:i,showSeparator:e,isFloating:t,onAddBlock:n})},Tm.Content=()=>Pm.save().children;const Mm=Tm,Rm=new Set([Jd.UP,Jd.RIGHT,Jd.DOWN,Jd.LEFT,Jd.ENTER,Jd.BACKSPACE]);function Nm(){const e=(0,h.useSelect)((e=>e(ba).isTyping()),[]),{stopTyping:t}=(0,h.useDispatch)(ba);return(0,g.useRefEffect)((n=>{if(!e)return;const{ownerDocument:o}=n;let i,l;function r(e){const{clientX:n,clientY:o}=e;i&&l&&(i!==n||l!==o)&&t(),i=n,l=o}return o.addEventListener("mousemove",r),()=>{o.removeEventListener("mousemove",r)}}),[e,t])}function Lm(){const{isTyping:e,hasInlineToolbar:t}=(0,h.useSelect)((e=>{const{isTyping:t,getSettings:n}=e(ba);return{isTyping:t(),hasInlineToolbar:n().hasInlineToolbar}}),[]),{startTyping:n,stopTyping:o}=(0,h.useDispatch)(ba),i=Nm(),l=(0,g.useRefEffect)((i=>{const{ownerDocument:l}=i,{defaultView:r}=l,s=r.getSelection();if(e){let c;function u(e){const{target:t}=e;c=r.setTimeout((()=>{(0,Ih.isTextField)(t)||o()}))}function d(e){const{keyCode:t}=e;t!==Jd.ESCAPE&&t!==Jd.TAB||o()}function p(){s.isCollapsed||o()}return i.addEventListener("focus",u),i.addEventListener("keydown",d),t||l.addEventListener("selectionchange",p),()=>{r.clearTimeout(c),i.removeEventListener("focus",u),i.removeEventListener("keydown",d),l.removeEventListener("selectionchange",p)}}function a(e){const{type:t,target:o}=e;(0,Ih.isTextField)(o)&&i.contains(o)&&("keydown"!==t||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&Rm.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,g.useMergeRefs)([i,l])}const Am=function({children:e}){return(0,et.jsx)("div",{ref:Lm(),children:e})};var Dm=n(7630);function Om({title:e,rawContent:t,renderedContent:n,action:o,actionText:i,className:l}){return(0,et.jsxs)("div",{className:l,children:[(0,et.jsxs)("div",{className:"block-editor-block-compare__content",children:[(0,et.jsx)("h2",{className:"block-editor-block-compare__heading",children:e}),(0,et.jsx)("div",{className:"block-editor-block-compare__html",children:t}),(0,et.jsx)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor",children:(0,et.jsx)(p.RawHTML,{children:(0,Ih.safeHTML)(n)})})]}),(0,et.jsx)("div",{className:"block-editor-block-compare__action",children:(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,variant:"secondary",tabIndex:"0",onClick:o,children:i})})]})}const zm=function({block:e,onKeep:t,onConvert:n,convertor:o,convertButtonText:i}){const l=function(e){const t=(Array.isArray(e)?e:[e]).map((e=>(0,d.getSaveContent)(e.name,e.attributes,e.innerBlocks)));return t.join("")}(o(e)),r=(s=e.originalContent,a=l,(0,Dm.Kx)(s,a).map(((e,t)=>{const n=u({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,et.jsx)("span",{className:n,children:e.value},t)})));var s,a;return(0,et.jsxs)("div",{className:"block-editor-block-compare__wrapper",children:[(0,et.jsx)(Om,{title:(0,vt.__)("Current"),className:"block-editor-block-compare__current",action:t,actionText:(0,vt.__)("Convert to HTML"),rawContent:e.originalContent,renderedContent:e.originalContent}),(0,et.jsx)(Om,{title:(0,vt.__)("After Conversion"),className:"block-editor-block-compare__converted",action:n,actionText:i,rawContent:r,renderedContent:l})]})},Vm=e=>(0,d.rawHandler)({HTML:e.originalContent});function Fm({clientId:e}){const{block:t,canInsertHTMLBlock:n,canInsertClassicBlock:o}=(0,h.useSelect)((t=>{const{canInsertBlockType:n,getBlock:o,getBlockRootClientId:i}=t(ba),l=i(e);return{block:o(e),canInsertHTMLBlock:n("core/html",l),canInsertClassicBlock:n("core/freeform",l)}}),[e]),{replaceBlock:i}=(0,h.useDispatch)(ba),[l,r]=(0,p.useState)(!1),s=(0,p.useCallback)((()=>r(!1)),[]),a=(0,p.useMemo)((()=>({toClassic(){const e=(0,d.createBlock)("core/freeform",{content:t.originalContent});return i(t.clientId,e)},toHTML(){const e=(0,d.createBlock)("core/html",{content:t.originalContent});return i(t.clientId,e)},toBlocks(){const e=Vm(t);return i(t.clientId,e)},toRecoveredBlock(){const e=(0,d.createBlock)(t.name,t.attributes,t.innerBlocks);return i(t.clientId,e)}})),[t,i]),c=(0,p.useMemo)((()=>[{// translators: Button to fix block content
title:(0,vt._x)("Resolve","imperative verb","kubio"),onClick:()=>r(!0)},n&&{title:(0,vt.__)("Convert to HTML","kubio"),onClick:a.toHTML},o&&{title:(0,vt.__)("Convert to Classic Block","kubio"),onClick:a.toClassic}].filter(Boolean)),[n,o,a]);return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(ya,{actions:[(0,et.jsx)(le.Button,{onClick:a.toRecoveredBlock,variant:"primary",children:(0,vt.__)("Attempt Block Recovery","kubio")},"recover")],secondaryActions:c,children:(0,vt.__)("This block contains unexpected or invalid content.","kubio")}),l&&(0,et.jsx)(le.Modal,{title:// translators: Dialog title to fix block content
// translators: Dialog title to fix block content
(0,vt.__)("Resolve Block","kubio"),onRequestClose:s,className:"block-editor-block-compare",children:(0,et.jsx)(zm,{block:t,onKeep:a.toHTML,onConvert:a.toBlocks,convertor:Vm,convertButtonText:(0,vt.__)("Convert to Blocks","kubio")})})]})}const Hm=(0,et.jsx)(ya,{className:"block-editor-block-list__block-crash-warning",children:(0,vt.__)("This block has encountered an error and cannot be previewed.","kubio")}),Gm=()=>Hm;class $m extends p.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 Um=$m;var Wm=n(4042);const Km=function({clientId:e}){const[t,n]=(0,p.useState)(""),o=(0,h.useSelect)((t=>t(ba).getBlock(e)),[e]),{updateBlock:i}=(0,h.useDispatch)(ba);return(0,p.useEffect)((()=>{n((0,d.getBlockContent)(o))}),[o]),(0,et.jsx)(Wm.Z,{className:"block-editor-block-list__block-html-textarea",value:t,onBlur:()=>{const l=(0,d.getBlockType)(o.name);if(!l)return;const r=(0,d.getBlockAttributes)(l,t,o.attributes),s=t||(0,d.getSaveContent)(l,r),[a]=t?(0,d.validateBlock)({...o,attributes:r,originalContent:s}):[!0];i(e,{attributes:r,originalContent:s,isValid:a}),t||n(s)},onChange:e=>n(e.target.value)})},Zm=window.wp.warning;var qm=n.n(Zm);function Ym({clientId:e="",isEnabled:t=!0}={}){const{getEnabledClientIdsTree:n}=fe((0,h.useSelect)(ba));return(0,g.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 Qm=hf();const Xm=e=>cf(e,Qm);let Jm=hf();Xm.write=e=>cf(e,Jm);let ef=hf();Xm.onStart=e=>cf(e,ef);let tf=hf();Xm.onFrame=e=>cf(e,tf);let nf=hf();Xm.onFinish=e=>cf(e,nf);let of=[];Xm.setTimeout=(e,t)=>{let n=Xm.now()+t,o=()=>{let e=of.findIndex((e=>e.cancel==o));~e&&of.splice(e,1),mf.count-=~e?1:0},i={time:n,handler:e,cancel:o};return of.splice(lf(n),0,i),mf.count+=1,uf(),i};let lf=e=>~(~of.findIndex((t=>t.time>e))||~of.length);Xm.cancel=e=>{Qm.delete(e),Jm.delete(e)},Xm.sync=e=>{af=!0,Xm.batchedUpdates(e),af=!1},Xm.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,Xm.onStart(n)}return o.handler=e,o.cancel=()=>{ef.delete(n),t=null},o};let rf="undefined"!=typeof window?window.requestAnimationFrame:()=>{};Xm.use=e=>rf=e,Xm.now="undefined"!=typeof performance?()=>performance.now():Date.now,Xm.batchedUpdates=e=>e(),Xm.catch=console.error,Xm.frameLoop="always",Xm.advance=()=>{"demand"!==Xm.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):pf()};let sf=-1,af=!1;function cf(e,t){af?(t.delete(e),e(0)):(t.add(e),uf())}function uf(){sf<0&&(sf=0,"demand"!==Xm.frameLoop&&rf(df))}function df(){~sf&&(rf(df),Xm.batchedUpdates(pf))}function pf(){let e=sf;sf=Xm.now();let t=lf(sf);t&&(gf(of.splice(0,t),(e=>e.handler())),mf.count-=t),ef.flush(),Qm.flush(e?Math.min(64,sf-e):16.667),tf.flush(),Jm.flush(),nf.flush()}function hf(){let e=new Set,t=e;return{add(n){mf.count+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(mf.count-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,mf.count-=t.size,gf(t,(t=>t(n)&&e.add(t))),mf.count+=e.size,t=e)}}}function gf(e,t){e.forEach((e=>{try{t(e)}catch(e){Xm.catch(e)}}))}const mf={count:0,clear(){sf=-1,of=[],ef=hf(),Qm=hf(),tf=hf(),Jm=hf(),nf=hf(),mf.count=0}};var ff=n(9196);function vf(){}const bf={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 kf(e,t){if(bf.arr(e)){if(!bf.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 _f=(e,t)=>e.forEach(t);function yf(e,t,n){if(bf.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 xf=e=>bf.und(e)?[]:bf.arr(e)?e:[e];function Sf(e,t){if(e.size){const n=Array.from(e);e.clear(),_f(n,t)}}const wf=(e,...t)=>Sf(e,(e=>e(...t)));let Cf,Bf,If=null,jf=!1,Ef=vf;var Tf=Object.freeze({__proto__:null,get createStringInterpolator(){return Cf},get to(){return Bf},get colors(){return If},get skipAnimation(){return jf},get willAdvance(){return Ef},assign:e=>{e.to&&(Bf=e.to),e.now&&(Xm.now=e.now),void 0!==e.colors&&(If=e.colors),null!=e.skipAnimation&&(jf=e.skipAnimation),e.createStringInterpolator&&(Cf=e.createStringInterpolator),e.requestAnimationFrame&&Xm.use(e.requestAnimationFrame),e.batchedUpdates&&(Xm.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Ef=e.willAdvance),e.frameLoop&&(Xm.frameLoop=e.frameLoop)}});const Pf=new Set;let Mf=[],Rf=[],Nf=0;const Lf={get idle(){return!Pf.size&&!Mf.length},start(e){Nf>e.priority?(Pf.add(e),Xm.onStart(Af)):(Df(e),Xm(zf))},advance:zf,sort(e){if(Nf)Xm.onFrame((()=>Lf.sort(e)));else{const t=Mf.indexOf(e);~t&&(Mf.splice(t,1),Of(e))}},clear(){Mf=[],Pf.clear()}};function Af(){Pf.forEach(Df),Pf.clear(),Xm(zf)}function Df(e){Mf.includes(e)||Of(e)}function Of(e){Mf.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(Mf),0,e)}function zf(e){const t=Rf;for(let n=0;n<Mf.length;n++){const o=Mf[n];Nf=o.priority,o.idle||(Ef(o),o.advance(e),o.idle||t.push(o))}return Nf=0,Rf=Mf,Rf.length=0,Mf=t,Mf.length>0}const Vf="[-+]?\\d*\\.?\\d+",Ff=Vf+"%";function Hf(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const Gf=new RegExp("rgb"+Hf(Vf,Vf,Vf)),$f=new RegExp("rgba"+Hf(Vf,Vf,Vf,Vf)),Uf=new RegExp("hsl"+Hf(Vf,Ff,Ff)),Wf=new RegExp("hsla"+Hf(Vf,Ff,Ff,Vf)),Kf=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Zf=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,qf=/^#([0-9a-fA-F]{6})$/,Yf=/^#([0-9a-fA-F]{8})$/;function Qf(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,l=Qf(i,o,e+1/3),r=Qf(i,o,e),s=Qf(i,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*r)<<16|Math.round(255*s)<<8}function Jf(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function ev(e){return(parseFloat(e)%360+360)%360/360}function tv(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function nv(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function ov(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=qf.exec(e))?parseInt(t[1]+"ff",16)>>>0:If&&void 0!==If[e]?If[e]:(t=Gf.exec(e))?(Jf(t[1])<<24|Jf(t[2])<<16|Jf(t[3])<<8|255)>>>0:(t=$f.exec(e))?(Jf(t[1])<<24|Jf(t[2])<<16|Jf(t[3])<<8|tv(t[4]))>>>0:(t=Kf.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Yf.exec(e))?parseInt(t[1],16)>>>0:(t=Zf.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Uf.exec(e))?(255|Xf(ev(t[1]),nv(t[2]),nv(t[3])))>>>0:(t=Wf.exec(e))?(Xf(ev(t[1]),nv(t[2]),nv(t[3]))|tv(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 iv=(e,t,n)=>{if(bf.fun(e))return e;if(bf.arr(e))return iv({range:e,output:t,extrapolate:n});if(bf.str(e.output[0]))return Cf(e);const o=e,i=o.output,l=o.range||[0,1],r=o.extrapolateLeft||o.extrapolate||"extend",s=o.extrapolateRight||o.extrapolate||"extend",a=o.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,l);return function(e,t,n,o,i,l,r,s,a){let c=a?a(e):e;if(c<t){if("identity"===r)return c;"clamp"===r&&(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=l(c),o===-1/0?c=-c:i===1/0?c+=o:c=c*(i-o)+o,c)}(e,l[t],l[t+1],i[t],i[t+1],a,r,s,o.map)}};function lv(){return lv=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},lv.apply(this,arguments)}const rv=Symbol.for("FluidValue.get"),sv=Symbol.for("FluidValue.observers"),av=e=>Boolean(e&&e[rv]),cv=e=>e&&e[rv]?e[rv]():e,uv=e=>e[sv]||null;function dv(e,t){let n=e[sv];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class pv{constructor(e){if(this[rv]=void 0,this[sv]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");hv(this,e)}}const hv=(e,t)=>fv(e,rv,t);function gv(e,t){if(e[rv]){let n=e[sv];n||fv(e,sv,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function mv(e,t){let n=e[sv];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[sv]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const fv=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),vv=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,bv=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,kv=new RegExp(`(${vv.source})(%|[a-z]+)`,"i");let _v;const yv=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,xv=(e,t,n,o,i)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${i})`,Sv=e=>{_v||(_v=If?new RegExp(`(${Object.keys(If).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>cv(e).replace(bv,ov).replace(_v,ov))),n=t.map((e=>e.match(vv).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=>iv(lv({},e,{output:t}))));return e=>{var n;const o=!kv.test(t[0])&&(null==(n=t.find((e=>kv.test(e))))?void 0:n.replace(vv,""));let l=0;return t[0].replace(vv,(()=>`${i[l++](e)}${o||""}`)).replace(yv,xv)}},wv="react-spring: ",Cv=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${wv}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},Bv=Cv(console.warn);function Iv(e){return bf.str(e)&&("#"==e[0]||/\d/.test(e)||e in(If||{}))}Cv(console.warn);const jv=e=>(0,ff.useEffect)(e,Ev),Ev=[];function Tv(){const e={current:!0,unmount:()=>()=>{e.current=!1}};return e}const Pv="undefined"!=typeof window&&window.document&&window.document.createElement?ff.useLayoutEffect:ff.useEffect,Mv=Symbol.for("Animated:node"),Rv=e=>e&&e[Mv],Nv=(e,t)=>{return n=e,o=Mv,i=t,Object.defineProperty(n,o,{value:i,writable:!0,configurable:!0});var n,o,i},Lv=e=>e&&e[Mv]&&e[Mv].getPayload();class Av{constructor(){this.payload=void 0,Nv(this,this)}getPayload(){return this.payload||[]}}class Dv extends Av{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,bf.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new Dv(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return bf.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,bf.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class Ov extends Dv{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=iv({output:[e,e]})}static create(e){return new Ov(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(bf.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=iv({output:[this.getValue(),e]})),this._value=0,super.reset()}}const zv={dependencies:null};class Vv extends Av{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return yf(this.source,((n,o)=>{var i;(i=n)&&i[Mv]===i?t[o]=n.getValue(e):av(n)?t[o]=cv(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&_f(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return yf(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){zv.dependencies&&av(e)&&zv.dependencies.add(e);const t=Lv(e);t&&_f(t,(e=>this.add(e)))}}class Fv extends Vv{constructor(e){super(e)}static create(e){return new Fv(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(Hv)),!0)}}function Hv(e){return(Iv(e)?Ov:Dv).create(e)}function Gv(e){const t=Rv(e);return t?t.constructor:bf.arr(e)?Fv:Iv(e)?Ov:Dv}function $v(){return $v=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},$v.apply(this,arguments)}const Uv=(e,t)=>{const n=!bf.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,ff.forwardRef)(((o,i)=>{const l=(0,ff.useRef)(null),r=n&&(0,ff.useCallback)((e=>{l.current=function(e,t){return e&&(bf.fun(e)?e(t):e.current=t),t}(i,e)}),[i]),[s,a]=function(e,t){const n=new Set;return zv.dependencies=n,e.style&&(e=$v({},e,{style:t.createAnimatedStyle(e.style)})),e=new Vv(e),zv.dependencies=null,[e,n]}(o,t),c=function(){const e=(0,ff.useState)()[1],t=(0,ff.useState)(Tv)[0];return jv(t.unmount),()=>{t.current&&e({})}}(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new Wv(u,a),p=(0,ff.useRef)();Pv((()=>{const e=p.current;p.current=d,_f(a,(e=>gv(e,d))),e&&(_f(e.deps,(t=>mv(t,e))),Xm.cancel(e.update))})),(0,ff.useEffect)(u,[]),jv((()=>()=>{const e=p.current;_f(e.deps,(t=>mv(t,e)))}));const h=t.getComponentProps(s.getValue());return ff.createElement(e,$v({},h,{ref:r}))}))};class Wv{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&Xm.write(this.update)}}const Kv=Symbol.for("AnimatedComponent"),Zv=e=>bf.str(e)?e:e&&bf.str(e.displayName)?e.displayName:bf.fun(e)&&e.name||null;function qv(){return qv=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},qv.apply(this,arguments)}function Yv(e,...t){return bf.fun(e)?e(...t):e}const Qv=(e,t)=>!0===e||!!(t&&e&&(bf.fun(e)?e(t):xf(e).includes(t))),Xv=(e,t)=>bf.obj(e)?t&&e[t]:e,Jv=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,eb=e=>e,tb=(e,t=eb)=>{let n=nb;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);bf.und(n)||(o[i]=n)}return o},nb=["config","onProps","onStart","onChange","onPause","onResume","onRest"],ob={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 ib(e){const t=function(e){const t={};let n=0;if(yf(e,((e,o)=>{ob[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return yf(e,((e,o)=>o in t||(n[o]=e))),n}return qv({},e)}function lb(e){return e=cv(e),bf.arr(e)?e.map(lb):Iv(e)?Tf.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function rb(e){return bf.fun(e)||bf.arr(e)&&bf.obj(e[0])}const sb=qv({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class ab{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,sb)}}function cb(e,t){if(bf.und(t.decay)){const n=!bf.und(t.tension)||!bf.und(t.friction);!n&&bf.und(t.frequency)&&bf.und(t.damping)&&bf.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const ub=[];class db{constructor(){this.changed=!1,this.values=ub,this.toValues=null,this.fromValues=ub,this.to=void 0,this.from=void 0,this.config=new ab,this.immediate=!1}}function pb(e,{key:t,props:n,defaultProps:o,state:i,actions:l}){return new Promise(((r,s)=>{var a;let c,u,d=Qv(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)g();else{bf.und(n.pause)||(i.paused=Qv(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=i.paused||Qv(e,t)),c=Yv(n.delay||0,t),e?(i.resumeQueue.add(h),l.pause()):(l.resume(),h())}function p(){i.resumeQueue.add(h),i.timeouts.delete(u),u.cancel(),c=u.time-Xm.now()}function h(){c>0&&!Tf.skipAnimation?(u=Xm.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{l.start(qv({},n,{callId:e,cancel:d}),r)}catch(e){s(e)}}}))}const hb=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?fb(e.get()):t.every((e=>e.noop))?gb(e.get()):mb(e.get(),t.every((e=>e.finished))),gb=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),mb=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),fb=e=>({value:e,cancelled:!0,finished:!1});function vb(e,t,n,o){const{callId:i,parentId:l,onRest:r}=t,{asyncTo:s,promise:a}=n;return l||e!==s||t.reset?n.promise=(async()=>{n.asyncId=i,n.asyncTo=e;const c=tb(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)&&fb(o)||i!==n.asyncId&&mb(o,!1);if(t)throw e.result=t,d(e),e},g=(e,t)=>{const l=new kb,r=new _b;return(async()=>{if(Tf.skipAnimation)throw bb(n),r.result=mb(o,!1),d(r),r;h(l);const s=bf.obj(e)?qv({},e):qv({},t,{to:e});s.parentId=i,yf(c,((e,t)=>{bf.und(s[t])&&(s[t]=e)}));const a=await o.start(s);return h(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};let m;if(Tf.skipAnimation)return bb(n),mb(o,!1);try{let t;t=bf.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]),m=mb(o.get(),!0,!1)}catch(e){if(e instanceof kb)m=e.result;else{if(!(e instanceof _b))throw e;m=e.result}}finally{i==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return bf.fun(r)&&Xm.batchedUpdates((()=>{r(m,o,o.item)})),m})():a}function bb(e,t){Sf(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class kb 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 _b extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const yb=e=>e instanceof Sb;let xb=1;class Sb extends pv{constructor(...e){super(...e),this.id=xb++,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=Rv(this);return e&&e.getValue()}to(...e){return Tf.to(this,e)}interpolate(...e){return Bv(`${wv}The "interpolate" function is deprecated in v9 (use "to" instead)`),Tf.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){dv(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Lf.sort(this),dv(this,{type:"priority",parent:this,priority:e})}}const wb=Symbol.for("SpringPhase"),Cb=e=>(1&e[wb])>0,Bb=e=>(2&e[wb])>0,Ib=e=>(4&e[wb])>0,jb=(e,t)=>t?e[wb]|=3:e[wb]&=-3,Eb=(e,t)=>t?e[wb]|=4:e[wb]&=-5;class Tb extends Sb{constructor(e,t){if(super(),this.key=void 0,this.animation=new db,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,!bf.und(e)||!bf.und(t)){const n=bf.obj(e)?qv({},e):qv({},t,{from:e});bf.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Bb(this)||this._state.asyncTo)||Ib(this)}get goal(){return cv(this.animation.to)}get velocity(){const e=Rv(this);return e instanceof Dv?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Cb(this)}get isAnimating(){return Bb(this)}get isPaused(){return Ib(this)}advance(e){let t=!0,n=!1;const o=this.animation;let{config:i,toValues:l}=o;const r=Lv(o.to);!r&&av(o.to)&&(l=xf(cv(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==Ov?1:r?r[a].lastPosition:l[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],l=null!=s.v0?s.v0:s.v0=bf.arr(i.velocity)?i.velocity[a]:i.velocity;let r;if(bf.und(i.duration))if(i.decay){const e=!0===i.decay?.998:i.decay,o=Math.exp(-(1-e)*t);d=n+l/(1-e)*(1-o),u=Math.abs(s.lastPosition-d)<.1,r=l*o}else{r=null==s.lastVelocity?l: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=!bf.und(a),h=n==c?s.v0>0:n<c;let g,m=!1;const f=1,v=Math.ceil(e/f);for(let e=0;e<v&&(g=Math.abs(r)>o,g||(u=Math.abs(c-d)<=t,!u));++e)p&&(m=d==c||d>c==h,m&&(r=-r*a,d=c)),r+=(1e-6*-i.tension*(d-c)+.001*-i.friction*r)/i.mass*f,d+=r*f}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),r=(d-s.lastPosition)/e,u=1==o}s.lastVelocity=r,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}r&&!r[a].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,i.round)&&(n=!0)}));const s=Rv(this),a=s.getValue();if(t){const e=cv(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 Xm.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Bb(this)){const{to:e,config:t}=this.animation;Xm.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 bf.und(e)?(n=this.queue||[],this.queue=[]):n=[bf.obj(e)?e:qv({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>hb(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),bb(this._state,e&&this._lastCallId),Xm.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=bf.obj(n)?n[t]:n,(null==n||rb(n))&&(n=void 0),o=bf.obj(o)?o[t]:o,null==o&&(o=void 0);const i={to:n,from:o};return Cb(this)||(e.reverse&&([n,o]=[o,n]),o=cv(o),bf.und(o)?Rv(this)||this._set(n):this._set(o)),i}_update(e,t){let n=qv({},e);const{key:o,defaultProps:i}=this;n.default&&Object.assign(i,tb(n,((e,t)=>/^on/.test(t)?Xv(e,o):e))),Ab(this,n,"onProps"),Db(this,"onProps",n,this);const l=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const r=this._state;return pb(++this._lastCallId,{key:o,props:n,defaultProps:i,state:r,actions:{pause:()=>{Ib(this)||(Eb(this,!0),wf(r.pauseQueue),Db(this,"onPause",mb(this,Pb(this,this.animation.to)),this))},resume:()=>{Ib(this)&&(Eb(this,!1),Bb(this)&&this._resume(),wf(r.resumeQueue),Db(this,"onResume",mb(this,Pb(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=Mb(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(fb(this));const o=!bf.und(e.to),i=!bf.und(e.from);if(o||i){if(!(t.callId>this._lastToId))return n(fb(this));this._lastToId=t.callId}const{key:l,defaultProps:r,animation:s}=this,{to:a,from:c}=s;let{to:u=a,from:d=c}=e;!i||o||t.default&&!bf.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!kf(d,c);p&&(s.from=d),d=cv(d);const h=!kf(u,a);h&&this._focus(u);const g=rb(t.to),{config:m}=s,{decay:f,velocity:v}=m;(o||i)&&(m.velocity=0),t.config&&!g&&function(e,t,n){n&&(cb(n=qv({},n),t),t=qv({},n,t)),cb(e,t),Object.assign(e,t);for(const t in sb)null==e[t]&&(e[t]=sb[t]);let{mass:o,frequency:i,damping:l}=e;bf.und(i)||(i<.01&&(i=.01),l<0&&(l=0),e.tension=Math.pow(2*Math.PI/i,2)*o,e.friction=4*Math.PI*l*o/i)}(m,Yv(t.config,l),t.config!==r.config?Yv(r.config,l):void 0);let b=Rv(this);if(!b||bf.und(u))return n(mb(this,!0));const k=bf.und(t.reset)?i&&!t.default:!bf.und(d)&&Qv(t.reset,l),_=k?d:this.get(),y=lb(u),x=bf.num(y)||bf.arr(y)||Iv(y),S=!g&&(!x||Qv(r.immediate||t.immediate,l));if(h){const e=Gv(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=av(u),B=!1;if(!C){const e=k||!Cb(this)&&p;(h||e)&&(B=kf(lb(_),y),C=!B),(kf(s.immediate,S)||S)&&kf(m.decay,f)&&kf(m.velocity,v)||(C=!0)}if(B&&Bb(this)&&(s.changed&&!k?C=!0:C||this._stop(a)),!g&&((C||av(a))&&(s.values=b.getPayload(),s.toValues=av(u)?null:w==Ov?[1]:xf(y)),s.immediate!=S&&(s.immediate=S,S||k||this._set(a)),C)){const{onRest:e}=s;_f(Lb,(e=>Ab(this,t,e)));const o=mb(this,Pb(this,a));wf(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&Xm.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?Yv(r.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),g?n(vb(t.to,t,this._state,this)):C?this._start():Bb(this)&&!h?this._pendingCalls.add(n):n(gb(_))}_focus(e){const t=this.animation;e!==t.to&&(uv(this)&&this._detach(),t.to=e,uv(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;av(t)&&(gv(t,this),yb(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;av(e)&&mv(e,this)}_set(e,t=!0){const n=cv(e);if(!bf.und(n)){const e=Rv(this);if(!e||!kf(n,e.getValue())){const o=Gv(n);e&&e.constructor==o?e.setValue(n):Nv(this,o.create(n)),e&&Xm.batchedUpdates((()=>{this._onChange(n,t)}))}}return Rv(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,Db(this,"onStart",mb(this,Pb(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Yv(this.animation.onChange,e,this)),Yv(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;Rv(this).reset(cv(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),Bb(this)||(jb(this,!0),Ib(this)||this._resume())}_resume(){Tf.skipAnimation?this.finish():Lf.start(this)}_stop(e,t){if(Bb(this)){jb(this,!1);const n=this.animation;_f(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),dv(this,{type:"idle",parent:this});const o=t?fb(this.get()):mb(this.get(),Pb(this,null!=e?e:n.to));wf(this._pendingCalls,o),n.changed&&(n.changed=!1,Db(this,"onRest",o,this))}}}function Pb(e,t){const n=lb(t);return kf(lb(e.get()),n)}function Mb(e,t=e.loop,n=e.to){let o=Yv(t);if(o){const i=!0!==o&&ib(o),l=(i||e).reverse,r=!i||i.reset;return Rb(qv({},e,{loop:t,default:!1,pause:void 0,to:!l||rb(n)?n:void 0,from:r?e.from:void 0,reset:r},i))}}function Rb(e){const{to:t,from:n}=e=ib(e),o=new Set;return bf.obj(t)&&Nb(t,o),bf.obj(n)&&Nb(n,o),e.keys=o.size?Array.from(o):null,e}function Nb(e,t){yf(e,((e,n)=>null!=e&&t.add(n)))}const Lb=["onStart","onRest","onChange","onPause","onResume"];function Ab(e,t,n){e.animation[n]=t[n]!==Jv(t,n)?Xv(t[n],e.key):void 0}function Db(e,t,...n){var o,i,l,r;null==(o=(i=e.animation)[t])||o.call(i,...n),null==(l=(r=e.defaultProps)[t])||l.call(r,...n)}const Ob=["onStart","onChange","onRest"];let zb=1;class Vb{constructor(e,t){this.id=zb++,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(qv({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];bf.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Rb(e)),this}start(e){let{queue:t}=this;return e?t=xf(e).map(Rb):this.queue=[],this._flush?this._flush(this,t):(Hb(this,t),function(e,t){return Promise.all(t.map((t=>Fb(e,t)))).then((t=>hb(e,t)))}(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;_f(xf(t),(t=>n[t].stop(!!e)))}else bb(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(bf.und(e))this.start({pause:!0});else{const t=this.springs;_f(xf(e),(e=>t[e].pause()))}return this}resume(e){if(bf.und(e))this.start({pause:!1});else{const t=this.springs;_f(xf(e),(e=>t[e].resume()))}return this}each(e){yf(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,Sf(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));const l=!o&&this._started,r=i||l&&n.size?this.get():null;i&&t.size&&Sf(t,(([e,t])=>{t.value=r,e(t,this,this._item)})),l&&(this._started=!1,Sf(n,(([e,t])=>{t.value=r,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)}Xm.onFrame(this._onFrame)}}async function Fb(e,t,n){const{keys:o,to:i,from:l,loop:r,onRest:s,onResolve:a}=t,c=bf.obj(t.default)&&t.default;r&&(t.loop=!1),!1===i&&(t.to=null),!1===l&&(t.from=null);const u=bf.arr(i)||bf.fun(i)?i:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):_f(Ob,(n=>{const o=t[n];if(bf.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,wf(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===Jv(t,"cancel");(u||h&&d.asyncId)&&p.push(pb(++e._lastAsyncId,{props:t,state:d,actions:{pause:vf,resume:vf,start(t,n){h?(bb(d,e._lastAsyncId),n(fb(e))):(t.onRest=s,n(vb(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const g=hb(e,await Promise.all(p));if(r&&g.finished&&(!n||!g.noop)){const n=Mb(t,r,i);if(n)return Hb(e,[n]),Fb(e,n,!0)}return a&&Xm.batchedUpdates((()=>a(g,e,e.item))),g}function Hb(e,t){_f(t,(t=>{!function(e,t,n){t.keys&&_f(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}(e.springs,t,(t=>function(e,t){const n=new Tb;return n.key=e,t&&gv(n,t),n}(t,e)))}))}const Gb=["children"],$b=e=>{let{children:t}=e,n=function(e,t){if(null==e)return{};var n,o,i={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,Gb);const o=(0,ff.useContext)(Ub),i=n.pause||!!o.pause,l=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 l=i;if(l){const n=Boolean(t&&l.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,l.inputs));n||(l={inputs:t,result:e()})}else l=n;return(0,ff.useEffect)((()=>{o.current=l,i==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:i,immediate:l})),[i,l]);const{Provider:r}=Ub;return ff.createElement(r,{value:n},t)},Ub=(Wb=$b,Kb={},Object.assign(Wb,ff.createContext(Kb)),Wb.Provider._context=Wb,Wb.Consumer._context=Wb,Wb);var Wb,Kb;let Zb;$b.Provider=Ub.Provider,$b.Consumer=Ub.Consumer,function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Zb||(Zb={}));class qb extends Sb{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=iv(...t);const n=this._get(),o=Gv(n);Nv(this,o.create(n))}advance(e){const t=this._get();kf(t,this.get())||(Rv(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Qb(this._active)&&Xb(this)}_get(){const e=bf.arr(this.source)?this.source.map(cv):xf(cv(this.source));return this.calc(...e)}_start(){this.idle&&!Qb(this._active)&&(this.idle=!1,_f(Lv(this),(e=>{e.done=!1})),Tf.skipAnimation?(Xm.batchedUpdates((()=>this.advance())),Xb(this)):Lf.start(this))}_attach(){let e=1;_f(xf(this.source),(t=>{av(t)&&gv(t,this),yb(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){_f(xf(this.source),(e=>{av(e)&&mv(e,this)})),this._active.clear(),Xb(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=xf(this.source).reduce(((e,t)=>Math.max(e,(yb(t)?t.priority:0)+1)),0))}}function Yb(e){return!1!==e.idle}function Qb(e){return!e.size||Array.from(e).every(Yb)}function Xb(e){e.idle||(e.idle=!0,_f(Lv(e),(e=>{e.done=!0})),dv(e,{type:"idle",parent:e}))}Tf.assign({createStringInterpolator:Sv,to:(e,t)=>new qb(e,t)}),Lf.advance;const Jb=window.ReactDOM;function ek(e,t){if(null==e)return{};var n,o,i={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(i[n]=e[n]);return i}const tk=["style","children","scrollTop","scrollLeft"],nk=/^--/;function ok(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||nk.test(e)||lk.hasOwnProperty(e)&&lk[e]?(""+t).trim():t+"px"}const ik={};let lk={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 rk=["Webkit","Ms","Moz","O"];lk=Object.keys(lk).reduce(((e,t)=>(rk.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),lk);const sk=["x","y","z"],ak=/^(matrix|translate|scale|rotate|skew)/,ck=/^(translate)/,uk=/^(rotate|skew)/,dk=(e,t)=>bf.num(e)&&0!==e?e+t:e,pk=(e,t)=>bf.arr(e)?e.every((e=>pk(e,t))):bf.num(e)?e===t:parseFloat(e)===t;class hk extends Vv{constructor(e){let{x:t,y:n,z:o}=e,i=ek(e,sk);const l=[],r=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),r.push((e=>[`translate3d(${e.map((e=>dk(e,"px"))).join(",")})`,pk(e,0)]))),yf(i,((e,t)=>{if("transform"===t)l.push([e||""]),r.push((e=>[e,""===e]));else if(ak.test(t)){if(delete i[t],bf.und(e))return;const n=ck.test(t)?"px":uk.test(t)?"deg":"";l.push(xf(e)),r.push("rotate3d"===t?([e,t,o,i])=>[`rotate3d(${e},${t},${o},${dk(i,n)})`,pk(i,0)]:e=>[`${t}(${e.map((e=>dk(e,n))).join(",")})`,pk(e,t.startsWith("scale")?1:0)])}})),l.length&&(i.transform=new gk(l,r)),super(i)}}class gk extends pv{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 _f(this.inputs,((n,o)=>{const i=cv(n[0]),[l,r]=this.transforms[o](bf.arr(i)?i:n.map(cv));e+=" "+l,t=t&&r})),t?"none":e}observerAdded(e){1==e&&_f(this.inputs,(e=>_f(e,(e=>av(e)&&gv(e,this)))))}observerRemoved(e){0==e&&_f(this.inputs,(e=>_f(e,(e=>av(e)&&mv(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),dv(this,e)}}const mk=["scrollTop","scrollLeft"];Tf.assign({batchedUpdates:Jb.unstable_batchedUpdates,createStringInterpolator:Sv,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 fk=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new Vv(e)),getComponentProps:o=(e=>e)}={})=>{const i={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=Zv(e)||"Anonymous";return(e=bf.str(e)?l[e]||(l[e]=Uv(e,i)):e[Kv]||(e[Kv]=Uv(e,i))).displayName=`Animated(${t})`,e};return yf(e,((t,n)=>{bf.arr(e)&&(n=Zv(t)),l[n]=l(t)})),{animated:l}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,o=t,{style:i,children:l,scrollTop:r,scrollLeft:s}=o,a=ek(o,tk),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:ik[t]||(ik[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==l&&(e.textContent=l);for(let t in i)if(i.hasOwnProperty(t)){const n=ok(t,i[t]);nk.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==r&&(e.scrollTop=r),void 0!==s&&(e.scrollLeft=s)},createAnimatedStyle:e=>new hk(e),getComponentProps:e=>ek(e,mk)}),vk=fk.animated;function bk(e){return{top:e.offsetTop,left:e.offsetLeft}}const kk=function({triggerAnimationOnChange:e,clientId:t}){const n=(0,p.useRef)(),{isTyping:o,getGlobalBlockCount:i,isBlockSelected:l,isFirstMultiSelectedBlock:r,isBlockMultiSelected:s,isAncestorMultiSelected:a,isDraggingBlocks:c}=(0,h.useSelect)(ba),{previous:u,prevRect:d}=(0,p.useMemo)((()=>({previous:n.current&&bk(n.current),prevRect:n.current&&n.current.getBoundingClientRect()})),[e]);return(0,p.useLayoutEffect)((()=>{if(!u||!n.current)return;const e=(0,Ih.getScrollContainer)(n.current),p=l(t),h=p||r(t),g=c();function m(){if(!g&&h&&d){const t=n.current.getBoundingClientRect().top-d.top;t&&(e.scrollTop+=t)}}if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||o()||i()>200)return void m();const f=p||s(t)||a(t);if(f&&g)return;const v=f?"1":"",b=new Vb({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,m()}});n.current.style.transform=void 0;const k=bk(n.current),_=Math.round(u.left-k.left),y=Math.round(u.top-k.top);return b.start({x:0,y:0,from:{x:_,y}}),()=>{b.stop(),b.set({x:0,y:0})}}),[u,d,t,o,i,l,r,s,a,c]),n};function _k({clientId:e,initialPosition:t}){const n=(0,p.useRef)(),{isBlockSelected:o,isMultiSelecting:i}=(0,h.useSelect)(ba);return(0,p.useEffect)((()=>{if(!o(e)||i())return;if(null==t)return;if(!n.current)return;const{ownerDocument:l}=n.current;if(Ph(n.current,l.activeElement))return;const r=Ih.focus.tabbable.find(n.current).filter((e=>(0,Ih.isTextField)(e))),s=-1===t,a=r[s?r.length-1:0]||n.current;if(Ph(n.current,a)){if(!n.current.getAttribute("contenteditable")){const e=Ih.focus.tabbable.findNext(n.current);e&&Ph(n.current,e)&&(0,Ih.isFormElement)(e)&&e.focus()}(0,Ih.placeCaretAtHorizontalEdge)(a,s)}else n.current.focus()}),[t,e]),n}function yk(e){const{isBlockSelected:t}=(0,h.useSelect)(ba),{selectBlock:n,selectionChange:o}=(0,h.useDispatch)(ba);return(0,g.useRefEffect)((i=>{function l(l){i.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):Ph(i,l.target)&&n(e))}return i.addEventListener("focusin",l),()=>{i.removeEventListener("focusin",l)}}),[t,n])}function xk(){const e=(0,p.useContext)(n_);return(0,g.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Sk(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function wk({isEnabled:e}){return(0,g.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",Sk),t.addEventListener("mouseover",Sk),()=>{t.removeEventListener("mouseout",Sk),t.removeEventListener("mouseover",Sk),t.classList.remove("is-hovered")}}),[e])}function Ck(e){const{isNavigationMode:t,isBlockSelected:n}=(0,h.useSelect)(ba),{setNavigationMode:o,selectBlock:i}=(0,h.useDispatch)(ba);return(0,g.useRefEffect)((l=>{function r(l){t()&&!l.defaultPrevented&&(l.preventDefault(),n(e)?o(!1):i(e))}return l.addEventListener("mousedown",r),()=>{l.removeEventListener("mousedown",r)}}),[e,t,n,o])}function Bk({isSelected:e}){const t=(0,g.useReducedMotion)();return(0,g.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 Ik({clientId:e,isSelected:t}){const{getBlockRootClientId:n,getBlockIndex:o}=(0,h.useSelect)(ba),{insertDefaultBlock:i,removeBlock:l}=(0,h.useDispatch)(ba);return(0,g.useRefEffect)((r=>{if(t)return r.addEventListener("keydown",s),r.addEventListener("dragstart",a),()=>{r.removeEventListener("keydown",s),r.removeEventListener("dragstart",a)};function s(t){const{keyCode:s,target:a}=t;s!==Jd.ENTER&&s!==Jd.BACKSPACE&&s!==Jd.DELETE||a!==r||(0,Ih.isTextField)(a)||(t.preventDefault(),s===Jd.ENTER?i({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,i,l])}function jk(e={},{__unstableIsHtml:t}={}){var n,o,i,l,r,s,a,c;const{clientId:u,className:d,wrapperProps:h={},isAligned:m,index:f,mode:v,name:b,blockApiVersion:k,blockTitle:_,isSelected:x,isSubtreeDisabled:S,isOutlineEnabled:w,hasOverlay:C,initialPosition:I,blockEditingMode:j,isHighlighted:E,isMultiSelected:T,isPartiallySelected:P,isReusable:M,isDragging:R,hasChildSelected:N,removeOutline:L,isBlockMovingMode:A,canInsertMovingBlock:D,isEditingDisabled:O,hasEditableOutline:z,isTemporarilyEditingAsBlocks:V,defaultClassName:F,templateLock:H}=(0,p.useContext)(ht),G=(0,vt.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc)
// translators: %s: Type of block (i.e. Text, Image etc)
(0,vt.__)("Block: %s","kubio"),_),$="html"!==v||t?"":"-visual",U=(0,g.useMergeRefs)([e.ref,_k({clientId:u,initialPosition:I}),ap(u),yk(u),Ik({clientId:u,isSelected:x}),Ck(u),wk({isEnabled:w}),xk(),kk({triggerAnimationOnChange:f,clientId:u}),(0,g.useDisabled)({isDisabled:!C}),Ym({clientId:u,isEnabled:"core/block"===b||"contentOnly"===H}),Bk({isSelected:x})]),W=B(),K=W[y]&&function(e){return e in ut}(b)?{"--wp-admin-theme-color":"var(--wp-block-synced-color)","--wp-admin-theme-color--rgb":"var(--wp-block-synced-color--rgb)"}:{};k<2&&u===W.clientId&&!0===globalThis.SCRIPT_DEBUG&&qm()(`Block type "${b}" must support API version 2 or higher to work correctly with "useBlockProps" method.`);let Z=!1;return"-"!==(null==h||null===(n=h.style)||void 0===n||null===(o=n.marginTop)||void 0===o?void 0:o.charAt(0))&&"-"!==(null==h||null===(i=h.style)||void 0===i||null===(l=i.marginBottom)||void 0===l?void 0:l.charAt(0))&&"-"!==(null==h||null===(r=h.style)||void 0===r||null===(s=r.marginLeft)||void 0===s?void 0:s.charAt(0))&&"-"!==(null==h||null===(a=h.style)||void 0===a||null===(c=a.marginRight)||void 0===c?void 0:c.charAt(0))||(Z=!0),{tabIndex:"disabled"===j?-1:0,...h,...e,ref:U,id:`block-${u}${$}`,role:"document","aria-label":G,"data-block":u,"data-type":b,"data-title":_,inert:S?"true":void 0,className:yc()("block-editor-block-list__block",{"wp-block":!m,"has-block-overlay":C,"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":L,"is-block-moving-mode":A,"can-insert-moving-block":D,"is-editing-disabled":O,"has-editable-outline":z,"has-negative-margin":Z,"is-content-locked-temporarily-editing-as-blocks":V},d,e.className,h.className,F),style:{...h.style,...e.style,...K}}}function Ek(e={}){var t;const{blockVisibility:n,deviceType:o=bn.desktop.key}=e,i=(0,g.useViewportMatch)("mobile",">="),l=(0,g.useViewportMatch)("medium",">=");let r;return r=o===bn.mobile.key?bn.mobile.key:o===bn.tablet.key?bn.tablet.key:i?i&&!l?bn.tablet.key:bn.desktop.key:bn.mobile.key,{isBlockCurrentlyHidden:!1===n||!1===(null==n||null===(t=n.viewport)||void 0===t?void 0:t[r]),currentViewport:r}}jk.save=d.__unstableGetBlockProps,bn.mobile.key,bn.tablet.key,bn.desktop.key;var Tk=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M20.7 12.7s0-.1-.1-.2c0-.2-.2-.4-.4-.6-.3-.5-.9-1.2-1.6-1.8-.7-.6-1.5-1.3-2.6-1.8l-.6 1.4c.9.4 1.6 1 2.1 1.5.6.6 1.1 1.2 1.4 1.6.1.2.3.4.3.5v.1l.7-.3.7-.3Zm-5.2-9.3-1.8 4c-.5-.1-1.1-.2-1.7-.2-3 0-5.2 1.4-6.6 2.7-.7.7-1.2 1.3-1.6 1.8-.2.3-.3.5-.4.6 0 0 0 .1-.1.2s0 0 .7.3l.7.3V13c0-.1.2-.3.3-.5.3-.4.7-1 1.4-1.6 1.2-1.2 3-2.3 5.5-2.3H13v.3c-.4 0-.8-.1-1.1-.1-1.9 0-3.5 1.6-3.5 3.5s.6 2.3 1.6 2.9l-2 4.4.9.4 7.6-16.2-.9-.4Zm-3 12.6c1.7-.2 3-1.7 3-3.5s-.2-1.4-.6-1.9L12.4 16Z"})}),Pk=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z"})});const{Badge:Mk}=fe(le.privateApis);bn.desktop.value;const Rk=function({clientIds:e}){const{areBlocksHiddenAnywhere:t,shortcut:n}=(0,h.useSelect)((t=>{const{isBlockHiddenAnywhere:n}=fe(t(ba));return{areBlocksHiddenAnywhere:null==e?void 0:e.every((e=>n(e))),shortcut:t(oh.store).getShortcutRepresentation("core/block-editor/toggle-block-visibility")}}),[e]),{showViewportModal:o}=fe((0,h.useDispatch)(ba));return(0,et.jsx)(le.MenuItem,{onClick:()=>o(e),shortcut:n,children:t?(0,vt.__)("Show"):(0,vt.__)("Hide")})},Nk=function({clientIds:e}){const t=(0,p.useRef)(!1),{canToggleBlockVisibility:n,areBlocksHiddenAnywhere:o}=(0,h.useSelect)((t=>{const{getBlocksByClientId:n,getBlockName:o,isBlockHiddenAnywhere:i}=fe(t(ba));return{canToggleBlockVisibility:n(e).every((({clientId:e})=>(0,d.hasBlockSupport)(o(e),"visibility",!0))),areBlocksHiddenAnywhere:null==e?void 0:e.every((e=>i(e)))}}),[e]),i=(0,h.useDispatch)(ba);if((0,p.useEffect)((()=>{o&&(t.current=!0)}),[o]),!o&&!t.current)return null;const{showViewportModal:l}=fe(i);return(0,et.jsx)(le.ToolbarGroup,{className:"block-editor-block-visibility-toolbar",children:(0,et.jsx)(le.ToolbarButton,{disabled:!n,icon:o?Tk:Pk,label:o?(0,vt.__)("Hidden"):(0,vt.__)("Visible"),onClick:()=>l(e),"aria-haspopup":"dialog"})})};function Lk({children:e,isHtml:t,...n}){return(0,et.jsx)("div",{...jk(n,{__unstableIsHtml:t}),children:e})}function Ak({block:{__unstableBlockSource:e},mode:t,isLocked:n,canRemove:o,clientId:i,isSelected:l,isSelectionEnabled:r,className:s,__unstableLayoutClassNames:a,name:c,isValid:h,attributes:g,wrapperProps:m,setAttributes:f,onReplace:v,onRemove:b,onInsertBlocksAfter:k,onMerge:_,toggleSelection:y}){const{mayDisplayControls:x,mayDisplayParentControls:S,isSelectionWithinCurrentSection:w,themeSupportsLayout:C,...B}=(0,p.useContext)(ht),I=Td()||{};let j=(0,et.jsx)(Sa,{name:c,isSelected:l,attributes:g,setAttributes:f,insertBlocksAfter:n?void 0:k,onReplace:o?v:void 0,onRemove:o?b:void 0,mergeBlocks:o?_:void 0,clientId:i,isSelectionEnabled:r,toggleSelection:y,__unstableLayoutClassNames:a,__unstableParentLayout:Object.keys(I).length?I:void 0,mayDisplayControls:x,mayDisplayParentControls:S,mayDisplayPatternEditingControls:w,blockEditingMode:B.blockEditingMode,isPreviewMode:B.isPreviewMode});const E=(0,d.getBlockType)(c);null!=E&&E.getEditWrapperProps&&(m=function(e,t){const n={...e,...t};return null!=e&&e.hasOwnProperty("className")&&null!=t&&t.hasOwnProperty("className")&&(n.className=u(e.className,t.className)),null!=e&&e.hasOwnProperty("style")&&null!=t&&t.hasOwnProperty("style")&&(n.style={...e.style,...t.style}),n}(m,E.getEditWrapperProps(g)));const T=m&&!!m["data-align"]&&!C,P=null==s?void 0:s.includes("is-position-sticky");let M;if(T&&(j=(0,et.jsx)("div",{className:u("wp-block",P&&s),"data-align":m["data-align"],children:j})),h)M="html"===t?(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)("div",{style:{display:"none"},children:j}),(0,et.jsx)(Lk,{isHtml:!0,children:(0,et.jsx)(Km,{clientId:i})})]}):(null==E?void 0:E.apiVersion)>1?j:(0,et.jsx)(Lk,{children:j});else{const t=e?(0,d.serializeRawBlock)(e):(0,d.getSaveContent)(E,g);M=(0,et.jsxs)(Lk,{className:"has-warning",children:[(0,et.jsx)(Fm,{clientId:i}),(0,et.jsx)(p.RawHTML,{children:(0,Ih.safeHTML)(t)})]})}const{"data-align":R,...N}=m??{},L={...N,className:u(N.className,R&&C&&`align${R}`,!(R&&P)&&s)};return(0,et.jsx)(ht.Provider,{value:{wrapperProps:L,isAligned:T,isSelectionWithinCurrentSection:w,...B},children:(0,et.jsx)(Um,{fallback:(0,et.jsx)(Lk,{className:"has-warning",children:(0,et.jsx)(Gm,{})}),children:M})})}const Dk=(0,h.withDispatch)(((e,t,n)=>{const{updateBlockAttributes:o,insertBlocks:i,mergeBlocks:l,replaceBlocks:r,toggleSelection:s,__unstableMarkLastChangeAsPersistent:a,moveBlocksToPosition:c,removeBlock:u,selectBlock:p}=e(ba);return{setAttributes(e){const{getMultiSelectedBlockClientIds:i}=n.select(ba),l=i(),{clientId:r,attributes:s}=t,a=l.length?l:[r],c="function"==typeof e?e(s):e;o(a,c)},onInsertBlocks(e,n){const{rootClientId:o}=t;i(e,n,o)},onInsertBlocksAfter(e){const{clientId:o,rootClientId:l}=t,{getBlockIndex:r}=n.select(ba),s=r(o);i(e,s+1,l)},onMerge(e){const{clientId:o,rootClientId:s}=t,{getPreviousBlockClientId:a,getNextBlockClientId:h,getBlock:g,getBlockAttributes:m,getBlockName:f,getBlockOrder:v,getBlockIndex:b,getBlockRootClientId:k,canInsertBlockType:_}=n.select(ba);function y(){const e=g(o),t=(0,d.getDefaultBlockName)(),i=(0,d.getBlockType)(t);if(f(o)!==t){const n=(0,d.switchToBlockType)(e,t);n&&n.length&&r(o,n)}else if((0,d.isUnmodifiedDefaultBlock)(e)){const e=h(o);e&&n.batch((()=>{u(o),p(e)}))}else if(i.merge){const n=i.merge({},e.attributes);r([o],[(0,d.createBlock)(t,n)])}}function x(e,t=!0){const o=f(e),l="text"===(0,d.getBlockType)(o).category,r=k(e),s=v(e),[a]=s;1===s.length&&(0,d.isUnmodifiedBlock)(g(a))?u(e):l?n.batch((()=>{if(_(f(a),r))c([a],e,r,b(e));else{const n=(0,d.switchToBlockType)(g(a),(0,d.getDefaultBlockName)());n&&n.length&&n.every((e=>_(e.name,r)))?(i(n,b(e),r,t),u(a,!1)):y()}!v(e).length&&(0,d.isUnmodifiedBlock)(g(e))&&u(e,!1)})):y()}if(e){if(s){const e=h(s);if(e){if(f(s)!==f(e))return void l(s,e);{const t=m(s),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{c(v(e),e,s),u(e,!1)}))}}}const e=h(o);if(!e)return;v(e).length?x(e,!1):l(o,e)}else{const e=a(o);if(e)l(e,o);else if(s){const e=a(s);if(e&&f(s)===f(e)){const t=m(s),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{c(v(s),s,e),u(s,!1)}))}x(s)}else y()}},onReplace(e,n,o){e.length&&!(0,d.isUnmodifiedDefaultBlock)(e[e.length-1])&&a();const i=1===(null==e?void 0:e.length)&&Array.isArray(e[0])?e[0]:e;r([t.clientId],i,n,o)},onRemove(){u(t.clientId)},toggleSelection(e){s(e)}}}));Ak=(0,g.compose)(Dk,(0,le.withFilters)("editor.BlockListBlock"))(Ak);const Ok=(0,p.memo)((function(e){const{clientId:t,rootClientId:n}=e,o=(0,h.useSelect)((e=>{var o,i;const{isBlockSelected:l,getBlockMode:r,isSelectionEnabled:s,getTemplateLock:a,isSectionBlock:c,getParentSectionBlock:u,getBlockWithoutAttributes:p,getBlockAttributes:h,canRemoveBlock:g,canMoveBlock:m,getSettings:f,getEditedContentOnlySection:v,getBlockEditingMode:b,getBlockName:k,isFirstMultiSelectedBlock:_,getMultiSelectedBlockClientIds:y,hasSelectedInnerBlock:x,getBlocksByName:S,getBlockIndex:w,isBlockMultiSelected:C,isBlockSubtreeDisabled:B,isBlockHighlighted:I,__unstableIsFullySelected:j,__unstableSelectionHasUnmergeableBlock:E,isBlockBeingDragged:T,isDragging:P,__unstableHasActiveBlockOverlayActive:M,getSelectedBlocksInitialCaretPosition:R}=fe(e(ba)),N=p(t);if(!N)return;const{hasBlockSupport:L,getActiveBlockVariation:A}=e(d.store),D=h(t),{name:O,isValid:z}=N,V=(0,d.getBlockType)(O),F=f(),{supportsLayout:H,isPreviewMode:G,__experimentalBlockBindingsSupportedAttributes:$}=F,U=null==$?void 0:$[O],W=null==D||null===(o=D.metadata)||void 0===o?void 0:o.blockVisibility,K=(null==F||null===(i=F[Rt])||void 0===i?void 0:i.toLowerCase())||"desktop",Z=(null==V?void 0:V.apiVersion)>1,q=C(t),Y=b(t),Q={isPreviewMode:G,blockWithoutAttributes:N,name:O,attributes:D,isValid:z,themeSupportsLayout:H,index:w(t),isReusable:(0,d.isReusableBlock)(V),className:Z?D.className:void 0,defaultClassName:Z?(0,d.getBlockDefaultClassName)(O):void 0,blockTitle:null==V?void 0:V.title,bindableAttributes:U,blockVisibility:W,deviceType:K,isMultiSelected:q,blockEditingMode:Y,isEditingDisabled:"disabled"===Y};if(G)return Q;const X=l(t),J=g(t),ee=m(t),te=A(O,D),ne=x(t,!0),oe=c(t)?t:u(t),ie=(0,d.hasBlockSupport)(O,"multiple",!0)?[]:S(O),le=ie.length&&ie[0]!==t;return{...Q,mode:r(t),isSelectionEnabled:s(),isLocked:!!a(n),isSectionBlock:c(t),isWithinSectionBlock:!!oe,isSelectionWithinCurrentSection:l(oe)||x(oe,!0),blockType:V,canRemove:J,canMove:ee,isSelected:X,isEditingContentOnlySection:v()===t,blockEditingMode:Y,mayDisplayControls:X||_(t)&&y().every((e=>k(e)===O)),mayDisplayParentControls:L(k(t),"__experimentalExposeControlsToChildren",!1)&&x(t),blockApiVersion:(null==V?void 0:V.apiVersion)||1,blockTitle:(null==te?void 0:te.title)||(null==V?void 0:V.title),isSubtreeDisabled:"disabled"===Y&&B(t),hasOverlay:M(t)&&!P(),initialPosition:X?R():void 0,isHighlighted:I(t),isMultiSelected:q,isPartiallySelected:q&&!j()&&!E(),isDragging:T(t),hasChildSelected:ne,isEditingDisabled:"disabled"===Y,hasEditableOutline:"disabled"!==Y&&"disabled"===b(n),originalBlockClientId:!!le&&ie[0],blockVisibility:W,deviceType:K}}),[t,n]),i=(0,g.useRefEffect)((e=>{if(e){const{ownerDocument:t}=e,{defaultView:n}=t;i.current=n}}),[]),{isBlockCurrentlyHidden:l}=Ek({blockVisibility:null==o?void 0:o.blockVisibility,deviceType:null==o?void 0:o.deviceType,view:i.current}),r=(0,p.useMemo)((()=>({...null==o?void 0:o.blockWithoutAttributes,attributes:null==o?void 0:o.attributes})),[null==o?void 0:o.blockWithoutAttributes,null==o?void 0:o.attributes]);if(!o)return null;const{isPreviewMode:s,mode:a="visual",isSelectionEnabled:c=!1,isLocked:u=!1,canRemove:m=!1,canMove:f=!1,name:v,attributes:b,isValid:k,isSelected:_=!1,themeSupportsLayout:y,isEditingContentOnlySection:x,blockEditingMode:S,mayDisplayControls:w,mayDisplayParentControls:C,index:B,blockApiVersion:I,blockType:j,blockTitle:E,isSubtreeDisabled:T,hasOverlay:P,initialPosition:M,isHighlighted:R,isMultiSelected:N,isPartiallySelected:L,isReusable:A,isDragging:D,hasChildSelected:O,isSectionBlock:z,isWithinSectionBlock:V,isSelectionWithinCurrentSection:F,isEditingDisabled:H,hasEditableOutline:G,className:$,defaultClassName:U,originalBlockClientId:W,bindableAttributes:K,blockVisibility:Z,deviceType:q}=o,Y={isPreviewMode:s,clientId:t,className:$,index:B,mode:a,name:v,blockApiVersion:I,blockType:j,blockTitle:E,isSelected:_,isSubtreeDisabled:T,hasOverlay:P,initialPosition:M,blockEditingMode:S,isHighlighted:R,isMultiSelected:N,isPartiallySelected:L,isReusable:A,isDragging:D,hasChildSelected:O,isSectionBlock:z,isWithinSectionBlock:V,isSelectionWithinCurrentSection:F,isEditingDisabled:H,hasEditableOutline:G,isEditingContentOnlySection:x,defaultClassName:U,mayDisplayControls:w,mayDisplayParentControls:C,originalBlockClientId:W,themeSupportsLayout:y,canMove:f,isBlockCurrentlyHidden:l,bindableAttributes:K,blockVisibility:Z,deviceType:q};return!l||_||N||O?(0,et.jsx)(ht.Provider,{value:Y,children:(0,et.jsx)(Ak,{...e,mode:a,isSelectionEnabled:c,isLocked:u,canRemove:m,canMove:f,block:r,name:v,attributes:b,isValid:k,isSelected:_})}):null})),zk=new WeakMap,Vk=function(e){const t=(0,g.useRefEffect)((t=>{function n(n){const{deltaX:o,deltaY:i,target:l}=n,r=e.current;let s=zk.get(r);s||(s=(0,Ih.getScrollContainer)(r),zk.set(r,s));const a=(0,Ih.getScrollContainer)(l);t.contains(a)||s.scrollBy(o,i)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}}),[e]);return e?t:null},Fk=Number.MAX_SAFE_INTEGER,Hk=(0,re.wpVersionCompare)("6.3","<"),Gk=function({previousClientId:e,nextClientId:t,children:n,__unstablePopoverSlot:o,__unstableContentRef:i,kubioInsertionEdge:l,disableInserter:r,...s}){const[a,c]=(0,p.useReducer)((e=>(e+1)%Fk),0),{orientation:u,rootClientId:d,isVisible:g}=(0,h.useSelect)((n=>{var o;const{getBlockListSettings:i,getBlockRootClientId:l,isBlockVisible:r}=n(ba),s=l(e??t);return{orientation:(null===(o=i(s))||void 0===o?void 0:o.orientation)||"vertical",rootClientId:s,isVisible:!(0,ce.isFunction)(r)||r(e)&&r(t)}}),[e,t]),m=up(e),f=up(t),v="vertical"===u,b=(0,p.useMemo)((()=>{if(!m&&!f||!g)return{};if(!m&&!f)return{width:0,height:0};const e=m?m.getBoundingClientRect():null,t=f?f.getBoundingClientRect():null;if(v)return{width:(m||f).closest(".block-editor-block-list__layout").getBoundingClientRect().width,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,vt.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:e?e.height:t.height}}),[m,f,v,g]),k=(0,p.useMemo)((()=>{if(!l&&!m&&!f||!g)return;const e={},t=m||f;return Hk&&(e.ownerDocument=null==t?void 0:t.ownerDocument),{contextElement:t,getBoundingClientRect(){var e,t,n,o,i,r;if(!m&&!f)return new window.DOMRect(0,0,0,0);let s=m?m.getBoundingClientRect():null;const a=f?f.getBoundingClientRect():null;"top"===l&&(s=null),"bottom"===l&&(s=a);const c=null===(e=(m||f).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,vt.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,vt.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===(r=s)||void 0===r?void 0:r.right:null==a?void 0:a.left)||0,new window.DOMRect(u,_,0,0)},...e}}),[l,m,f,g,v]),_=Vk(i);return(0,p.useLayoutEffect)((()=>{if(!m)return;const e=new window.MutationObserver(c);return e.observe(m,{attributes:!0}),()=>{e.disconnect()}}),[m]),(0,p.useLayoutEffect)((()=>{if(!f)return;const e=new window.MutationObserver(c);return e.observe(f,{attributes:!0}),()=>{e.disconnect()}}),[f]),(0,p.useLayoutEffect)((()=>{var e,t,n;if(m)return null===(e=m.ownerDocument)||void 0===e||null===(t=e.defaultView)||void 0===t||null===(n=t.addEventListener)||void 0===n||n.call(t,"resize",c),()=>{var e,t,n;null==m||null===(e=m.ownerDocument)||void 0===e||null===(t=e.defaultView)||void 0===t||null===(n=t.removeEventListener)||void 0===n||n.call(t,"resize",c)}}),[m]),(m||f)&&g?(0,et.jsx)(le.Popover,{ref:_,animate:!1,anchor:k,focusOnMount:!1,__unstableSlotName:o||null,...s,className:yc()("block-editor-block-popover","block-editor-block-popover__inbetween",l?`kubio-editor-block-popover__inbetween-${l}`:"",{"kubio-inserter-popup-disabled":r},s.className),resize:!1,flip:!1,placement:"bottom-start",variant:"unstyled",children:(0,et.jsx)("div",{className:"block-editor-block-popover__inbetween-container",style:b,children:n})},t+"--"+d):null},$k=(0,p.createContext)(),Uk={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}},Wk={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%"}},Kk={start:{scale:0},rest:{scale:1,transition:{delay:0}}};function Zk({__unstablePopoverSlot:e,__unstableContentRef:t}){const{selectBlock:n,hideInsertionPoint:o}=(0,h.useDispatch)(ba),i=(0,p.useContext)($k),l=(0,p.useRef)(),{orientation:r,previousClientId:s,nextClientId:a,rootClientId:c,isInserterShown:u,kubioInsertionEdge:d,kubioEditorModeIsSimple:g,hideDefaultInsertionPoint:m,isDragging:f}=(0,h.useSelect)((e=>{var t;const{getBlock:n,getBlockOrder:o,getBlockListSettings:i,getBlockInsertionPoint:l,isBlockBeingDragged:r,getPreviousBlockClientId:s,getNextBlockClientId:a,isDraggingBlocks:c}=e(ba),u=l(),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(;r(p);)p=s(p);for(;r(h);)h=a(h);const{getKubioEditorModeIsSimple:m=pe().noop}=e("kubio/edit-site")||{},f=m(),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:f,kubioInsertionEdge:null==u?void 0:u.kubioInsertionEdge,hideDefaultInsertionPoint:_,isDragging:g}}),[]),v="vertical"===r,b={start:{...v?Wk.start:Uk.start,opacity:0},rest:{...v?Wk.rest:Uk.rest,opacity:1,borderRadius:"2px",transition:{delay:0}},hover:{...v?Wk.hover:Uk.hover,opacity:1,borderRadius:"2px",transition:{delay:0}}},k=yc()("block-editor-block-list__insertion-point","is-"+r),_=(0,p.useMemo)((()=>{switch(d){case"top":return"begin";case"bottom":return"end"}return d}),[d]);(0,p.useEffect)((()=>{u||(i.current=!1)}),[u,i]);const y=f||!m&&!g,x=u&&!m&&!g;return(0,et.jsx)(Gk,{previousClientId:s,nextClientId:a,__unstablePopoverSlot:e,__unstableContentRef:t,kubioInsertionEdge:d,disableInserter:!x&&!y,children:(0,et.jsxs)(le.__unstableMotion.div,{layout:!0,initial:"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:l,tabIndex:-1,onClick:function(e){e.target===l.current&&a&&n(a,-1)},onFocus:function(e){e.target!==l.current&&(i.current=!0)},className:yc()(k,{"is-with-inserter":u}),onHoverEnd:function(e){e.target!==l.current||i.current||o()},children:[y&&(0,et.jsx)(le.__unstableMotion.div,{variants:b,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),x&&(0,et.jsx)(le.__unstableMotion.div,{variants:Kk,className:yc()("block-editor-block-list__insertion-point-inserter"),children:(0,et.jsx)(Jg,{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 qk(e){return(0,h.useSelect)((e=>e(ba).isBlockInsertionPointVisible()),[])&&(0,et.jsx)(Zk,{...e})}const Yk=15,Qk=5,Xk=e=>null==e?void 0:e.closest("[data-block]"),Jk=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")},e_=e=>{var t;return!!e&&(null!=e&&e.getAttribute("data-type")?e.hasAttribute("data-kubio-disable-inbetween-inserter")||(null===(t=(0,d.getBlockType)(null==e?void 0:e.getAttribute("data-type")))||void 0===t?void 0:t.innerBlocksDisableInBetweenInserter):void 0)};function t_(){const e=(0,p.useContext)($k),t=(0,h.useSelect)((e=>e(ba).getSettings().hasReducedUI||"zoom-out"===e(ba).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:i,isBlockInsertionPointVisible:l,isMultiSelecting:r,getSelectedBlockClientIds:s,getTemplateLock:a}=(0,h.useSelect)(ba),{showInsertionPoint:c,hideInsertionPoint:u}=(0,h.useDispatch)(ba),d=(0,p.useRef)({}),m=(0,p.useCallback)(((e,t,n,o)=>{o&&d.current&&d.current.rootClientId===e&&d.current.index===t||(d.current={rootClientId:e,index:t},c(e,t,n))}),[c]),f=(0,p.useCallback)((()=>{d.current=null,u()}),[u]);return(0,g.useRefEffect)((t=>{const o=(0,ce.throttle)((function(t){var o,s;if(e.current)return;if(r())return;let c=t.target;if(c.closest("[data-kubio-template-overlay]"))return void f();null!==(o=c.classList)&&void 0!==o&&o.contains("block-editor-block-list__layout")||(c=Jk(c));let u,d=Xk(c);for(;c&&e_(d);)c=Jk(d),c&&(d=Xk(c));if(!c)return void(l()&&f());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,ce.first)(b).getBoundingClientRect().top-h.top:null,x=b.length?(0,ce.last)(b).getBoundingClientRect().bottom-h.top:null,S=b.length?Math.min(Math.max(Qk,b[0].offsetHeight/3),Yk):0,w=b.length?Math.min(Math.max(Qk,(0,ce.last)(b).offsetHeight/3),Yk):0;if("vertical"===p&&g<=y+S?(k=b[0],_="top"):"vertical"===p&&g>=x-w?(k=(0,ce.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),Yk),o=n.offsetTop+n.offsetHeight-t,i=e.offsetTop+t;return o<=g&&g<=i}return"horizontal"===p&&e.offsetLeft>v})),!k)return void(l()&&f());if(!k.id&&(k=k.firstElementChild,!k))return void(l()&&f());if(k.classList.contains("is-selected")&&(!_||"top"===_))return void(l()&&f());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(l()&&f());if(!u)return void(l()&&f());const I=i(C,u);m(u,I,{__unstableWithInserter:!0,kubioInsertionEdge:_},l())}),1e3);return t.addEventListener("mousemove",o),()=>{t.removeEventListener("mousemove",o)}}),[n,o,i,l,r,m,f,s,t])}const n_=(0,p.createContext)(),o_=new WeakMap,i_=(0,p.createContext)();function l_({className:e,...t}){const[n,o]=(0,p.useState)(),i=(0,g.useViewportMatch)("medium"),{isOutlineMode:l,isFocusMode:r,editorMode:s}=(0,h.useSelect)((e=>{const{getSettings:t,__unstableGetEditorMode:n}=e(ba),{outlineMode:o,focusMode:i}=t();return{isOutlineMode:o,isFocusMode:i,editorMode:n()}}),[]),a=(0,h.useRegistry)(),{setBlockVisibility:c}=(0,h.useDispatch)(ba),u=(0,g.useDebounce)((0,p.useCallback)((()=>{const e={};o_.get(a).forEach((([t,n])=>{e[t]=n})),c(e)}),[a]),300,{trailing:!0}),d=(0,p.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{o_.get(a)||o_.set(a,[]);for(const t of e){const e=t.target.getAttribute("data-block");o_.get(a).push([e,t.isIntersecting])}u()}))}),[]),m=Pm({ref:(0,g.useMergeRefs)([Sh(),t_(),Lm(),o]),className:yc()("is-root-container",e,{"is-outline-mode":l,"is-focus-mode":r&&i,"is-navigate-mode":"navigation"===s})},t);return(0,et.jsx)(i_.Provider,{value:n,children:(0,et.jsx)(n_.Provider,{value:d,children:(0,et.jsx)("div",{...m})})})}function r_({clientId:e}){const{stopEditingAsBlocks:t}=fe((0,h.useDispatch)(ba)),n=(0,h.useSelect)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=t(ba);return n(e)||o(e,!0)}),[e]);return(0,p.useEffect)((()=>{n||t(e)}),[n,e,t]),null}function s_(e){return(0,et.jsx)(C,{value:S,children:(0,et.jsx)(l_,{...e})})}function a_({placeholder:e,rootClientId:t,renderAppender:n,__experimentalAppenderTagName:o,layout:i=Id}){const l=!1!==n,r=!!n,{order:s,selectedBlocks:a,visibleBlocks:c,temporarilyEditingAsBlocks:u,shouldRenderAppender:d}=(0,h.useSelect)((e=>{const{getBlockOrder:n,getSelectedBlockClientId:o,getSelectedBlockClientIds:i,__unstableGetVisibleBlocks:s,__unstableGetTemporarilyEditingAsBlocks:a,getTemplateLock:c,getBlockEditingMode:u,__unstableGetEditorMode:d}=e(ba),p=o();return{order:n(t),selectedBlocks:i(),visibleBlocks:s(),temporarilyEditingAsBlocks:a(),shouldRenderAppender:l&&(r?!c(t)&&"disabled"!==u(t)&&"zoom-out"!==d():t===p||!t&&!p)}}),[t,l,r]);return(0,et.jsxs)(Ed,{value:i,children:[s.map((e=>(0,et.jsx)(h.AsyncModeProvider,{value:!c.has(e)&&!a.includes(e),children:(0,et.jsx)(Ok,{rootClientId:t,clientId:e})},e))),s.length<1&&e,!!u&&(0,et.jsx)(r_,{clientId:u}),d&&(0,et.jsx)(sm,{tagName:o,rootClientId:t,CustomAppender:n})]})}function c_(e){return(0,et.jsx)(h.AsyncModeProvider,{value:!1,children:(0,et.jsx)(a_,{...e})})}s_.__unstableElementContext=i_;const u_=Number.MAX_SAFE_INTEGER,d_=(0,p.forwardRef)((function({clientId:e,bottomClientId:t,children:n,__unstableRefreshSize:o,__unstableCoverTarget:i=!1,__unstablePopoverSlot:l,__unstableContentRef:r,shift:s=!0,...a},c){let u=up(e);if(!u){const t=document.querySelector("#kubio-iframe-holder iframe"),n=null==t?void 0:t.contentDocument;n&&(u=n.querySelector(`[data-block="${e}"]`))}const d=up(t??e),h=(0,g.useMergeRefs)([c,Vk(r)]),[m,f]=(0,p.useReducer)((e=>(e+1)%u_),0);(0,p.useLayoutEffect)((()=>{if(!u)return;const e=new window.MutationObserver(f);return e.observe(u,{attributes:!0}),()=>{e.disconnect()}}),[u]);const v=(0,p.useMemo)((()=>m<0||!u||d!==u?{}:{position:"absolute",width:u.offsetWidth,height:u.offsetHeight}),[u,d,m]),b=(0,p.useMemo)((()=>{if(!(m<0||!u||t&&!d))return{getBoundingClientRect(){const e=u.getBoundingClientRect(),t=null==d?void 0:d.getBoundingClientRect(),n=Math.min(e.left,(null==t?void 0:t.left)??1/0),o=Math.min(e.top,(null==t?void 0:t.top)??1/0),i=Math.max(e.right,(null==t?void 0:t.right)??-1/0)-n,l=Math.max(e.bottom,(null==t?void 0:t.bottom)??-1/0)-o;return new window.DOMRect(n,o,i,l)},contextElement:u}}),[t,d,u,m]);return!u||t&&!d?null:(0,et.jsxs)(le.Popover,{ref:h,animate:!1,focusOnMount:!1,anchor:b,__unstableSlotName:l||null,inline:!l,placement:"bottom-start",resize:!1,flip:!1,shift:s,...a,className:yc()("block-editor-block-popover",a.className),variant:"unstyled",children:[i&&(0,et.jsx)("div",{style:v,children:n}),!i&&n]})})),p_=(0,p.forwardRef)((({clientId:e,bottomClientId:t,children:n,...o},i)=>(0,et.jsx)(d_,{...o,bottomClientId:t,clientId:e,__unstableContentRef:void 0,__unstablePopoverSlot:void 0,ref:i,children:n})));function h_({selectedElement:e,additionalStyles:t={},children:n}){const[o,i]=(0,p.useState)(e.offsetWidth),[l,r]=(0,p.useState)(e.offsetHeight);(0,p.useEffect)((()=>{const t=new window.ResizeObserver((()=>{i(e.offsetWidth),r(e.offsetHeight)}));return t.observe(e,{box:"border-box"}),()=>t.disconnect()}),[e]);const s=(0,p.useMemo)((()=>({position:"absolute",width:o,height:l,...t})),[o,l,t]);return(0,et.jsx)("div",{style:s,children:n})}const g_=(0,p.forwardRef)((function({clientId:e,bottomClientId:t,children:n,shift:o=!1,additionalStyles:i,...l},r){t??=e;const s=up(e);return(0,et.jsx)(d_,{ref:r,clientId:e,bottomClientId:t,shift:o,...l,children:s&&e===t?(0,et.jsx)(h_,{selectedElement:s,additionalStyles:i,children:n}):n})})),m_=(0,le.createSlotFill)("InspectorControls"),f_=(0,le.createSlotFill)("InspectorAdvancedControls"),v_=(0,le.createSlotFill)("InspectorControlsBindings"),b_=(0,le.createSlotFill)("InspectorControlsBackground"),k_=(0,le.createSlotFill)("InspectorControlsBorder"),y_=(0,le.createSlotFill)("InspectorControlsColor"),x_=(0,le.createSlotFill)("InspectorControlsFilter"),S_=(0,le.createSlotFill)("InspectorControlsDimensions"),w_=(0,le.createSlotFill)("InspectorControlsPosition"),C_=(0,le.createSlotFill)("InspectorControlsTypography"),B_=(0,le.createSlotFill)("InspectorControlsListView"),I_=(0,le.createSlotFill)("InspectorControlsStyles"),j_={default:m_,advanced:f_,background:b_,bindings:v_,border:k_,color:y_,dimensions:S_,effects:(0,le.createSlotFill)("InspectorControlsEffects"),filter:x_,list:B_,position:w_,settings:m_,styles:I_,typography:C_},E_=(0,le.createSlotFill)(Symbol("PrivateInspectorControlsAllowedBlocks"));function T_({children:e,group:t="default",__experimentalGroup:n,resetAllFilter:o}){var i;n&&(Je()("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=n);const l=B(),r=null===(i=j_[t])||void 0===i?void 0:i.Fill;return r?l[f]?(0,et.jsx)(le.__experimentalStyleProvider,{document,children:(0,et.jsx)(r,{children:t=>(0,et.jsx)(M_,{fillProps:t,children:e,resetAllFilter:o})})}):null:(!0===globalThis.SCRIPT_DEBUG&&qm()(`Unknown InspectorControls group "${t}" provided.`),null)}function P_({resetAllFilter:e,children:t}){const{registerResetAllFilter:n,deregisterResetAllFilter:o}=(0,p.useContext)(le.__experimentalToolsPanelContext);return(0,p.useEffect)((()=>{if(e&&n&&o)return n(e),()=>{o(e)}}),[e,n,o]),t}function M_({children:e,resetAllFilter:t,fillProps:n}){const{forwardedContext:o=[]}=n,i=(0,et.jsx)(P_,{resetAllFilter:t,children:e});return o.reduce(((e,[t,n])=>(0,et.jsx)(t,{...n,children:e})),i)}const R_=e=>{var t;let n=!(null===(t=(0,le.__experimentalUseSlot)(e).fills)||void 0===t||!t.length);var o;return(0,ce.isFunction)(le.__experimentalUseSlotFills)&&(n=!(null===(o=(0,le.__experimentalUseSlotFills)(e))||void 0===o||!o.length)),n};function N_({Slot:e,fillProps:t,...n}){const o=(0,p.useContext)(le.__experimentalToolsPanelContext),i=(0,p.useMemo)((()=>({...t??{},forwardedContext:[...(null==t?void 0:t.forwardedContext)??[],[le.__experimentalToolsPanelContext.Provider,{value:o}]]})),[o,t]);return(0,et.jsx)(e,{...n,fillProps:i,bubblesVirtually:!0})}function L_({children:e,group:t,label:n}){const{updateBlockAttributes:o}=(0,h.useDispatch)(ba),{getBlockAttributes:i,getMultiSelectedBlockClientIds:l,getSelectedBlockClientId:r,hasMultiSelection:s}=(0,h.useSelect)(ba),a=r(),c=(0,p.useCallback)(((e=[])=>{const t={},n=s()?l():[a];n.forEach((n=>{const{style:o}=i(n);let l={style:o};e.forEach((e=>{l={...l,...e(l)}})),l={...l,style:qN(l.style)},t[n]=l})),o(n,t,!0)}),[i,l,s,a,o]);return(0,et.jsx)(le.__experimentalToolsPanel,{className:`${t}-block-support-panel`,label:n,resetAll:c,panelId:a,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",children:e},a)}function A_({__experimentalGroup:e,group:t="default",label:n,fillProps:o,...i}){let l,r;if((0,re.wpVersionCompare)("6.8","<")){var s,a;r=null===(s=j_[t])||void 0===s?void 0:s.Slot,l=R_(null===(a=r)||void 0===a?void 0:a.__unstableName)}else{var c;e&&(Je()("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=e);const n=j_[t];l=null===(c=(0,le.__experimentalUseSlotFills)(null==n?void 0:n.name))||void 0===c?void 0:c.length,r=null==n?void 0:n.Slot}return r?l?n?(0,et.jsx)(L_,{group:t,label:n,children:(0,et.jsx)(N_,{...i,fillProps:o,Slot:r})}):(0,et.jsx)(r,{...i,fillProps:o,bubblesVirtually:!0}):null:(!0===globalThis.SCRIPT_DEBUG&&qm()(`Unknown InspectorControls group "${t}" provided.`),null)}const D_=T_;D_.Slot=A_;const O_=e=>(0,et.jsx)(T_,{...e,group:"advanced"});O_.Slot=e=>(0,et.jsx)(A_,{...e,group:"advanced"}),O_.slotName="InspectorAdvancedControls";const z_=D_;function V_(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,vt.__)("Sticky"):"fixed"===o?(0,vt.__)("Fixed"):null}function F_(e){return(0,h.useSelect)((t=>{var n,o,i,l,r,s,a;if(!e)return null;const{getBlockName:c,getBlockAttributes:u,__experimentalGetParsedPattern:p}=t(ba),{getBlockType:h,getActiveBlockVariation:g}=t(d.store),m=c(e),f=h(m);if(!f)return null;const v=u(e),b=null==v||null===(n=v.metadata)||void 0===n?void 0:n.patternName;if(b){var k,_,y;const e=p(b),t=V_(v);return{isSynced:!1,title:(0,vt.__)("Pattern"),icon:cn,description:(null==e?void 0:e.description)||(0,vt.__)("A block pattern."),anchor:null==v?void 0:v.anchor,positionLabel:t,positionType:null==v||null===(k=v.style)||void 0===k||null===(_=k.position)||void 0===_?void 0:_.type,name:(null==e?void 0:e.title)||(null==v||null===(y=v.metadata)||void 0===y?void 0:y.name)}}const x=g(m,v),S=(0,d.isReusableBlock)(f)||(0,d.isTemplatePart)(f),w=(S?(0,d.__experimentalGetBlockLabel)(f,v):void 0)||f.title,C=V_(v),B={isSynced:S,title:w,icon:f.icon,description:f.description,anchor:null==v?void 0:v.anchor,positionLabel:C,positionType:null==v||null===(o=v.style)||void 0===o||null===(i=o.position)||void 0===i?void 0:i.type,name:null==v||null===(l=v.metadata)||void 0===l?void 0:l.name};return x?{isSynced:S,title:x.title||f.title,icon:x.icon||f.icon,description:x.description||f.description,anchor:null==v?void 0:v.anchor,positionLabel:C,positionType:null==v||null===(r=v.style)||void 0===r||null===(s=r.position)||void 0===s?void 0:s.type,name:null==v||null===(a=v.metadata)||void 0===a?void 0:a.name}:B}),[e])}const H_="position",G_={key:"default",value:"",name:(0,vt.__)("Default")},$_={key:"sticky",value:"sticky",name:(0,vt._x)("Sticky","Name for the value of the CSS position property"),hint:(0,vt.__)("The block will stick to the top of the window instead of scrolling.")},U_={key:"fixed",value:"fixed",name:(0,vt._x)("Fixed","Name for the value of the CSS position property"),hint:(0,vt.__)("The block will not move when the page is scrolled.")},W_=["top","right","bottom","left"],K_=["sticky","fixed"];function Z_(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 q_({name:e}={}){const[t,n]=wa("position.fixed","position.sticky"),o=!t&&!n;return i=e,!(0,d.getBlockSupport)(i,H_)||o;var i}function Y_({style:e={},clientId:t,name:n,setAttributes:o}){var i;const l=function(e){const t=(0,d.getBlockSupport)(e,H_);return!!(!0===t||null!=t&&t.fixed)}(n),r=function(e){const t=(0,d.getBlockSupport)(e,H_);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,h.useSelect)((e=>{const{getBlockParents:n}=e(ba),o=n(t);return{firstParentClientId:o[o.length-1]}}),[t]),c=F_(a),u=r&&s===$_.value&&c?(0,vt.sprintf)(/* translators: %s: the name of the parent block. */ /* translators: %s: the name of the parent block. */(0,vt.__)("The block will stick to the scrollable area of the parent %s block."),c.title):null,g=(0,p.useMemo)((()=>{const e=[G_];return(r||s===$_.value)&&e.push($_),(l||s===U_.value)&&e.push(U_),e}),[l,r,s]),m=s&&g.find((e=>e.value===s))||G_;return p.Platform.select({web:g.length>1?(0,et.jsx)(z_,{group:"position",children:(0,et.jsx)(le.BaseControl,{help:u,children:(0,et.jsx)(le.CustomSelectControl,{__next40pxDefaultSize:!0,label:(0,vt.__)("Position"),hideLabelFromVision:!0,describedBy:(0,vt.sprintf)(// translators: %s: Currently selected position.
// translators: %s: Currently selected position.
(0,vt.__)("Currently selected position: %s"),m.name),options:g,value:m,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:qN(n)})})(t.value)},size:"__unstable-large"})})}):null,native:null})}const Q_={edit:function(e){return q_(e)?null:(0,et.jsx)(Y_,{...e})},useBlockProps:function({name:e,style:t}){var n,o;const i=(0,d.hasBlockSupport)(e,H_),l=q_({name:e}),r=i&&!l,s=(0,g.useInstanceId)(X_);let a;r&&(a=function({selector:e,style:t}){let n="";const{type:o}=(null==t?void 0:t.position)||{};return K_.includes(o)?(n+=`${e} {`,n+=`position: ${o};`,W_.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 c=u({[`wp-container-${s}`]:r&&!!a,[`is-position-${null==t||null===(n=t.position)||void 0===n?void 0:n.type}`]:r&&!!a&&!(null==t||null===(o=t.position)||void 0===o||!o.type)});return JN({css:a}),{className:c}},attributeKeys:["style"],hasSupport:e=>(0,d.hasBlockSupport)(e,H_)},X_={},J_={placement:"top-start"},ey={...J_,flip:!1,shift:!0},ty={...J_,flip:!0,shift:!1};function ny(e,t,n,o,i){if(!e||!t)return ey;const l=(null==n?void 0:n.scrollTop)||0,r=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)Nh(e)&&(n=Rh(n,e.getBoundingClientRect()),o.push(e));const l=Math.max(n.left,0),r=Math.min(n.right,t.innerWidth);return n=new window.DOMRectReadOnly(l,n.top,r-l,n.height),n}(t),s=l+e.getBoundingClientRect().top,a=e.ownerDocument.documentElement.clientHeight,c=s+o,u=r.top>c,d=r.height>a-o;return i||!u&&!d?ty:ey}function oy({contentElement:e,clientId:t}){const n=up(t),[o,i]=(0,p.useState)(0),{blockIndex:l,isSticky:r}=(0,h.useSelect)((e=>{const{getBlockIndex:n,getBlockAttributes:o}=e(ba);return{blockIndex:n(t),isSticky:Z_(o(t))}}),[t]),s=(0,p.useMemo)((()=>{if(e)return(0,Ih.getScrollContainer)(e)}),[e]),[a,c]=(0,p.useState)((()=>ny(e,n,s,o,r))),u=(0,g.useRefEffect)((e=>{i(e.offsetHeight)}),[]),d=(0,p.useCallback)((()=>c(ny(e,n,s,o,r))),[e,n,s,o]);return(0,p.useLayoutEffect)(d,[l,d]),(0,p.useLayoutEffect)((()=>{var t,o,i;if(!e||!n)return;const l=null==e||null===(t=e.ownerDocument)||void 0===t?void 0:t.defaultView;let r;null==l||null===(o=l.addEventHandler)||void 0===o||o.call(l,"resize",d);const s=null==n||null===(i=n.ownerDocument)||void 0===i?void 0:i.defaultView;return s.ResizeObserver&&(r=new s.ResizeObserver(d),r.observe(n)),()=>{var e;null==l||null===(e=l.removeEventHandler)||void 0===e||e.call(l,"resize",d),r&&r.disconnect()}}),[d,e,n]),{...a,ref:u}}function iy(e){const t=(0,h.useSelect)((t=>{const{getBlockRootClientId:n,getBlockParents:o,__experimentalGetBlockListSettingsForBlocks:i,isBlockInsertionPointVisible:l,getBlockInsertionPoint:r,getBlockOrder:s,hasMultiSelection:a,getLastMultiSelectedBlockClientId:c}=t(ba),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(l()){const t=r();h=s(t.rootClientId)[t.index]===e}return{capturingClientId:p,isInsertionPointVisible:h,lastClientId:a()?c():null,rootClientId:n(e)}}),[e]);return t}function ly({clientId:e,__unstableContentRef:t}){const{capturingClientId:n,isInsertionPointVisible:o,lastClientId:i,rootClientId:l}=iy(e),r=oy({contentElement:null==t?void 0:t.current,clientId:e});return(0,et.jsx)(g_,{clientId:n||e,bottomClientId:i,className:u("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":o}),__unstableContentRef:t,...r,children:(0,et.jsx)("div",{className:"block-editor-block-list__empty-block-inserter",children:(0,et.jsx)(Jg,{position:"bottom right",rootClientId:l,clientId:e,__experimentalIsQuick:!0})})})}const ry=({appendToOwnerDocument:e,children:t,clientIds:n,cloneClassname:o,elementId:i,onDragStart:l,onDragEnd:r,fadeWhenDisabled:s=!1,dragComponent:a})=>{const{srcRootClientId:c,isDraggable:u,icon:m,visibleInserter:f,getBlockType:v}=(0,h.useSelect)((e=>{var t;const{canMoveBlocks:o,getBlockRootClientId:i,getBlockName:l,getBlockAttributes:r,isBlockInsertionPointVisible:s}=e(ba),{getBlockType:a,getActiveBlockVariation:c}=e(d.store),u=i(n[0]),p=l(n[0]),h=c(p,r(n[0]));return{srcRootClientId:u,isDraggable:o(n,u),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,p.useRef)(!1),[k,_,y]=function(){const e=(0,p.useRef)(null),t=(0,p.useRef)(null),n=(0,p.useRef)(null),o=(0,p.useRef)(null);return(0,p.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,p.useCallback)((i=>{e.current=i.clientY,n.current=(0,Ih.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,p.useCallback)((o=>{if(!n.current)return;const i=n.current.offsetHeight,l=e.current-n.current.offsetTop,r=o.clientY-n.current.offsetTop;if(o.clientY>l){const e=Math.max(i-l-50,0),n=Math.max(r-l-50,0),o=0===e||0===n?0:n/e;t.current=25*o}else if(o.clientY<l){const e=Math.max(l-50,0),n=Math.max(l-r-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,h.useSelect)(ba),{startDraggingBlocks:C,stopDraggingBlocks:B}=(0,h.useDispatch)(ba);(0,p.useEffect)((()=>()=>{b.current&&B()}),[]);const I=up(n[0]),j=null==I?void 0:I.closest("body");if((0,p.useEffect)((()=>{if(!j||!s)return;const e=(0,g.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),l=S([o])[0];let r;if(0===(null==i?void 0:i.length)){const e=w(o),n=S([e])[0],i=x(e);r=wm(v,i,t,n)}else r=wm(v,i,t,l);var s,a,c,u,d,p,h,g;r||f?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,f]),!u)return t({draggable:!1});const E={type:"block",srcClientIds:n,srcRootClientId:c};return(0,et.jsx)(le.Draggable,{appendToOwnerDocument:e,cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:E,onDragStart:e=>{window.requestAnimationFrame((()=>{C(n),b.current=!0,k(e),l&&l()}))},onDragOver:_,onDragEnd:()=>{B(),b.current=!1,y(),r&&r()},__experimentalDragComponent:void 0!==a?a:(0,et.jsx)(Rp,{count:n.length,icon:m,fadeWhenDisabled:!0}),elementId:i,children:({onDraggableStart:e,onDraggableEnd:n})=>t({draggable:!0,onDragStart:e,onDragEnd:n})})};var sy=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})}),ay=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})}),cy=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})}),uy=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})});const dy=(e,t)=>"up"===e?"horizontal"===t?(0,vt.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,vt.isRTL)()?"left":"right":"down":null;function py(e,t,n,o,i,l,r){const s=n+1;if(e>1)return function(e,t,n,o,i,l){const r=t+1;if(n&&o)return(0,vt.__)("All blocks are selected, and cannot be moved","kubio");if(i>0&&!o){const t=dy("down",l);if("down"===t)return(0,vt.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
// translators: 1: Number of selected blocks, 2: Position of selected blocks
(0,vt.__)("Move %1$d blocks from position %2$d down by one place","kubio"),e,r);if("left"===t)return(0,vt.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
// translators: 1: Number of selected blocks, 2: Position of selected blocks
(0,vt.__)("Move %1$d blocks from position %2$d left by one place","kubio"),e,r);if("right"===t)return(0,vt.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
// translators: 1: Number of selected blocks, 2: Position of selected blocks
(0,vt.__)("Move %1$d blocks from position %2$d right by one place","kubio"),e,r)}if(i>0&&o){const e=dy("down",l);if("down"===e)return(0,vt.__)("Blocks cannot be moved down as they are already at the bottom","kubio");if("left"===e)return(0,vt.__)("Blocks cannot be moved left as they are already are at the leftmost position","kubio");if("right"===e)return(0,vt.__)("Blocks cannot be moved right as they are already are at the rightmost position","kubio")}if(i<0&&!n){const t=dy("up",l);if("up"===t)return(0,vt.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
// translators: 1: Number of selected blocks, 2: Position of selected blocks
(0,vt.__)("Move %1$d blocks from position %2$d up by one place","kubio"),e,r);if("left"===t)return(0,vt.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
// translators: 1: Number of selected blocks, 2: Position of selected blocks
(0,vt.__)("Move %1$d blocks from position %2$d left by one place","kubio"),e,r);if("right"===t)return(0,vt.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
// translators: 1: Number of selected blocks, 2: Position of selected blocks
(0,vt.__)("Move %1$d blocks from position %2$d right by one place","kubio"),e,r)}if(i<0&&n){const e=dy("up",l);if("up"===e)return(0,vt.__)("Blocks cannot be moved up as they are already at the top","kubio");if("left"===e)return(0,vt.__)("Blocks cannot be moved left as they are already are at the leftmost position","kubio");if("right"===e)return(0,vt.__)("Blocks cannot be moved right as they are already are at the rightmost position","kubio")}}(e,n,o,i,l,r);if(o&&i)return(0,vt.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc)
// translators: %s: Type of block (i.e. Text, Image etc)
(0,vt.__)("Block %s is the only block, and cannot be moved","kubio"),t);if(l>0&&!i){const e=dy("down",r);if("down"===e)return(0,vt.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,vt.__)("Move %1$s block from position %2$d down to position %3$d","kubio"),t,s,s+1);if("left"===e)return(0,vt.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,vt.__)("Move %1$s block from position %2$d left to position %3$d","kubio"),t,s,s+1);if("right"===e)return(0,vt.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,vt.__)("Move %1$s block from position %2$d right to position %3$d","kubio"),t,s,s+1)}if(l>0&&i){const e=dy("down",r);if("down"===e)return(0,vt.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
// translators: 1: Type of block (i.e. Text, Image etc)
(0,vt.__)("Block %1$s is at the end of the content and can’t be moved down","kubio"),t);if("left"===e)return(0,vt.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
// translators: 1: Type of block (i.e. Text, Image etc)
(0,vt.__)("Block %1$s is at the end of the content and can’t be moved left","kubio"),t);if("right"===e)return(0,vt.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
// translators: 1: Type of block (i.e. Text, Image etc)
(0,vt.__)("Block %1$s is at the end of the content and can’t be moved right","kubio"),t)}if(l<0&&!o){const e=dy("up",r);if("up"===e)return(0,vt.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,vt.__)("Move %1$s block from position %2$d up to position %3$d","kubio"),t,s,s-1);if("left"===e)return(0,vt.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,vt.__)("Move %1$s block from position %2$d left to position %3$d","kubio"),t,s,s-1);if("right"===e)return(0,vt.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,vt.__)("Move %1$s block from position %2$d right to position %3$d","kubio"),t,s,s-1)}if(l<0&&o){const e=dy("up",r);if("up"===e)return(0,vt.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
// translators: 1: Type of block (i.e. Text, Image etc)
(0,vt.__)("Block %1$s is at the beginning of the content and can’t be moved up","kubio"),t);if("left"===e)return(0,vt.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
// translators: 1: Type of block (i.e. Text, Image etc)
(0,vt.__)("Block %1$s is at the beginning of the content and can’t be moved left","kubio"),t);if("right"===e)return(0,vt.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
// translators: 1: Type of block (i.e. Text, Image etc)
(0,vt.__)("Block %1$s is at the beginning of the content and can’t be moved right","kubio"),t)}}const hy=(e,t)=>"up"===e?"horizontal"===t?(0,vt.isRTL)()?sy:ay:cy:"down"===e?"horizontal"===t?(0,vt.isRTL)()?ay:sy:uy:null,gy=(e,t)=>"up"===e?"horizontal"===t?(0,vt.isRTL)()?(0,vt.__)("Move right"):(0,vt.__)("Move left"):(0,vt.__)("Move up"):"down"===e?"horizontal"===t?(0,vt.isRTL)()?(0,vt.__)("Move left"):(0,vt.__)("Move right"):(0,vt.__)("Move down"):null,my=(0,p.forwardRef)((({clientIds:e,direction:t,orientation:n,...o},i)=>{const l=(0,g.useInstanceId)(my),r=Array.isArray(e)?e:[e],s=r.length,{disabled:a}=o,{blockType:c,isDisabled:p,rootClientId:m,isFirst:f,isLast:v,firstIndex:b,orientation:k="vertical"}=(0,h.useSelect)((e=>{const{getBlockIndex:o,getBlockRootClientId:i,getBlockOrder:l,getBlock:s,getBlockListSettings:c}=e(ba),u=r[0],p=i(u),h=o(u),g=o(r[r.length-1]),m=l(p),f=s(u),v=0===h,b=g===m.length-1,{orientation:k}=c(p)||{};return{blockType:f?(0,d.getBlockType)(f.name):null,isDisabled:a||("up"===t?v:b),rootClientId:p,firstIndex:h,isFirst:v,isLast:b,orientation:n||k}}),[e,t]),{moveBlocksDown:_,moveBlocksUp:y}=(0,h.useDispatch)(ba),x="up"===t?y:_,S=`block-editor-block-mover-button__description-${l}`;return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,ref:i,className:u("block-editor-block-mover-button",`is-${t}-button`),icon:hy(t,k),label:gy(t,k),"aria-describedby":S,...o,onClick:p?null:t=>{x(e,m),o.onClick&&o.onClick(t)},disabled:p,accessibleWhenDisabled:!0}),(0,et.jsx)(le.VisuallyHidden,{id:S,children:py(s,c&&c.title,b,f,v,"up"===t?-1:1,k)})]})})),fy=(0,p.forwardRef)(((e,t)=>(0,et.jsx)(my,{direction:"up",ref:t,...e}))),vy=(0,p.forwardRef)(((e,t)=>(0,et.jsx)(my,{direction:"down",ref:t,...e}))),by=function({clientIds:e,hideDragHandle:t,isBlockMoverUpButtonDisabled:n,isBlockMoverDownButtonDisabled:o}){const{canMove:i,rootClientId:l,isFirst:r,isLast:s,orientation:a,isManualGrid:c}=(0,h.useSelect)((t=>{var n;const{getBlockIndex:o,getBlockListSettings:i,canMoveBlocks:l,getBlockOrder:r,getBlockRootClientId:s,getBlockAttributes:a}=t(ba),c=Array.isArray(e)?e:[e],u=c[0],d=s(u),p=o(u),h=o(c[c.length-1]),g=r(d),{layout:m={}}=a(d)??{};return{canMove:l(e),rootClientId:d,isFirst:0===p,isLast:h===g.length-1,orientation:null===(n=i(d))||void 0===n?void 0:n.orientation,isManualGrid:"grid"===m.type&&m.isManualPlacement&&window.__experimentalEnableGridInteractivity}}),[e]);return!i||r&&s&&!l||t&&c?null:(0,et.jsxs)(le.ToolbarGroup,{className:u("block-editor-block-mover",{"is-horizontal":"horizontal"===a}),children:[!t&&(0,et.jsx)(ry,{clientIds:e,fadeWhenDisabled:!0,children:e=>(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,icon:Mp,className:"block-editor-block-mover__drag-handle",label:(0,vt.__)("Drag"),tabIndex:"-1",...e})}),!c&&(0,et.jsxs)("div",{className:"block-editor-block-mover__move-button-container",children:[(0,et.jsx)(le.ToolbarItem,{children:t=>(0,et.jsx)(fy,{disabled:n,clientIds:e,...t})}),(0,et.jsx)(le.ToolbarItem,{children:t=>(0,et.jsx)(vy,{disabled:o,clientIds:e,...t})})]})]})};function ky(){const{selectBlock:e}=(0,h.useDispatch)(ba),{parentClientId:t}=(0,h.useSelect)((e=>{const{getBlockParents:t,getSelectedBlockClientId:n,getParentSectionBlock:o}=fe(e(ba)),i=n(),l=null==o?void 0:o(i),r=t(i);return{parentClientId:l??r[r.length-1]}}),[]),n=F_(t),o=(0,p.useRef)();return t?(0,et.jsx)("div",{className:"block-editor-block-parent-selector",ref:o,children:(0,et.jsx)(le.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(t),label:(0,vt.sprintf)(/* translators: %s: Name of the block's parent. */ /* translators: %s: Name of the block's parent. */(0,vt.__)("Select parent block: %s","kubio"),null==n?void 0:n.title),showTooltip:!0,icon:(0,et.jsx)(Sc,{icon:null==n?void 0:n.icon})})},t):(0,et.jsx)(et.Fragment,{})}var _y=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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 yy({blocks:e}){return(0,g.useViewportMatch)("medium","<")?null:(0,et.jsx)("div",{className:"block-editor-block-switcher__popover-preview-container",children:(0,et.jsx)(le.Popover,{className:"block-editor-block-switcher__popover-preview",placement:"right-start",focusOnMount:!1,offset:16,children:(0,et.jsxs)("div",{className:"block-editor-block-switcher__preview",children:[(0,et.jsx)("div",{className:"block-editor-block-switcher__preview-title",children:(0,vt.__)("Preview")}),(0,et.jsx)(mg,{viewportWidth:601,blocks:e})]})})})}const xy={};function Sy({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:o,icon:i,title:l}=e;return(0,et.jsxs)(le.MenuItem,{className:(0,d.getBlockMenuDefaultClassName)(o),onClick:e=>{e.preventDefault(),t(o)},onMouseLeave:()=>n(null),onMouseEnter:()=>n(o),children:[(0,et.jsx)(Sc,{icon:i,showColors:!0}),l]})}const wy=({transformations:e,onSelect:t,blocks:n})=>{const[o,i]=(0,p.useState)();return(0,et.jsxs)(et.Fragment,{children:[o&&(0,et.jsx)(yy,{blocks:(0,d.cloneBlock)(n[0],e.find((({name:e})=>e===o)).attributes)}),null==e?void 0:e.map((e=>(0,et.jsx)(Sy,{item:e,onSelect:t,setHoveredTransformItemName:i},e.name)))]})};function Cy({restTransformations:e,onSelect:t,setHoveredTransformItemName:n}){return e.map((e=>(0,et.jsx)(By,{item:e,onSelect:t,setHoveredTransformItemName:n},e.name)))}function By({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:o,icon:i,title:l,isDisabled:r}=e;return(0,et.jsxs)(le.MenuItem,{className:(0,d.getBlockMenuDefaultClassName)(o),onClick:e=>{e.preventDefault(),t(o)},disabled:r,onMouseLeave:()=>n(null),onMouseEnter:()=>n(o),children:[(0,et.jsx)(Sc,{icon:i,showColors:!0}),l]})}const Iy=({className:e,possibleBlockTransformations:t,possibleBlockVariationTransformations:n,onSelect:o,onSelectVariation:i,blocks:l})=>{const[r,s]=(0,p.useState)(),{priorityTextTransformations:a,restTransformations:c}=function(e){const t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},n=(0,p.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),u=a.length&&c.length,h=!!c.length&&(0,et.jsx)(Cy,{restTransformations:c,onSelect:o,setHoveredTransformItemName:s});return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsxs)(le.MenuGroup,{label:(0,vt.__)("Transform to"),className:e,children:[r&&(0,et.jsx)(yy,{blocks:(0,d.switchToBlockType)(l,r)}),!(null==n||!n.length)&&(0,et.jsx)(wy,{transformations:n,blocks:l,onSelect:i}),a.map((e=>(0,et.jsx)(By,{item:e,onSelect:o,setHoveredTransformItemName:s},e.name))),!u&&h]}),!!u&&(0,et.jsx)(le.MenuGroup,{className:e,children:h})]})};var jy=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z"})});const Ey=window.wp.tokenList;var Ty=n.n(Ey);function Py(e,t,n){const o=new(Ty())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function My(e){return null==e?void 0:e.find((e=>e.isDefault))}function Ry({clientId:e,onSwitch:t}){const{styles:n,block:o,blockType:i,className:l}=(0,h.useSelect)((t=>{const{getBlock:n}=t(ba),o=n(e);if(!o)return{};const i=(0,d.getBlockType)(o.name),{getBlockStyles:l}=t(d.store);return{block:null!=i&&i.example?null:o,blockType:i,styles:l(o.name),className:o.attributes.className||""}}),[e]),{updateBlockAttributes:r}=(0,h.useDispatch)(ba),s=function(e){return e&&0!==e.length?My(e)?e:[{name:"default",label:(0,vt._x)("Default","block style"),isDefault:!0},...e]:[]}(n),a=function(e,t){for(const n of new(Ty())(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 My(e)}(s,l),c=function(e,t){return(0,p.useMemo)((()=>{const n=null==t?void 0:t.example,o=null==t?void 0:t.name;return n&&o?(0,d.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,d.cloneBlock)(e):void 0}),[e,null==t?void 0:t.example,null==t?void 0:t.name])}(o,i);return{onSelect:n=>{const o=Py(l,a,n);r(e,{className:o}),t()},stylesToRender:s,activeStyle:a,genericPreviewBlock:c,className:l}}const Ny=()=>{};function Ly({clientId:e,onSwitch:t=Ny}){const{onSelect:n,stylesToRender:o,activeStyle:i}=Ry({clientId:e,onSwitch:t});return o&&0!==o.length?(0,et.jsx)(et.Fragment,{children:o.map((e=>{const t=e.label||e.name;return(0,et.jsx)(le.MenuItem,{icon:i.name===e.name?jy:null,onClick:()=>n(e),children:(0,et.jsx)(le.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0,children:t})},e.name)}))}):null}function Ay({hoveredBlock:e,onSwitch:t}){const{clientId:n}=e;return(0,et.jsx)(le.MenuGroup,{label:(0,vt.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup",children:(0,et.jsx)(Ly,{clientId:n,onSwitch:t})})}const Dy=(e,t,n=new Set)=>{const{clientId:o,name:i,innerBlocks:l=[]}=e;if(!n.has(o)){if(i===t)return e;for(const e of l){const o=Dy(e,t,n);if(o)return o}}},Oy=(e,t)=>{const n=((e,t)=>{const n=(0,d.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 zy({patterns:e,onSelect:t}){const n=(0,g.useViewportMatch)("medium","<");return(0,et.jsx)("div",{className:"block-editor-block-switcher__popover-preview-container",children:(0,et.jsx)(le.Popover,{className:"block-editor-block-switcher__popover-preview",placement:n?"bottom":"right-start",offset:16,children:(0,et.jsx)("div",{className:"block-editor-block-switcher__preview is-pattern-list-preview",children:(0,et.jsx)(Vy,{patterns:e,onSelect:t})})})})}function Vy({patterns:e,onSelect:t}){return(0,et.jsx)(le.Composite,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,vt.__)("Patterns list"),children:e.map((e=>(0,et.jsx)(Fy,{pattern:e,onSelect:t},e.name)))})}function Fy({pattern:e,onSelect:t}){const n="block-editor-block-switcher__preview-patterns-container",o=(0,g.useInstanceId)(Fy,`${n}-list__item-description`);return(0,et.jsxs)("div",{className:`${n}-list__list-item`,children:[(0,et.jsxs)(le.Composite.Item,{render:(0,et.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,et.jsx)(mg,{blocks:e.transformedBlocks,viewportWidth:e.viewportWidth||500}),(0,et.jsx)("div",{className:`${n}-list__item-title`,children:e.title})]}),!!e.description&&(0,et.jsx)(le.VisuallyHidden,{id:o,children:e.description})]})}const Hy=function({blocks:e,patterns:t,onSelect:n}){const[o,i]=(0,p.useState)(!1),l=((e,t)=>(0,p.useMemo)((()=>e.reduce(((e,n)=>{const o=((e,t)=>{const n=t.map((e=>(0,d.cloneBlock)(e))),o=new Set;for(const t of e){let e=!1;for(const i of n){const n=Dy(i,t.name,o);if(n){e=!0,o.add(n.clientId),Oy(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]))(t,e);return l.length?(0,et.jsxs)(le.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup",children:[o&&(0,et.jsx)(zy,{patterns:l,onSelect:n}),(0,et.jsx)(le.MenuItem,{onClick:e=>{e.preventDefault(),i(!o)},icon:sy,children:(0,vt.__)("Patterns")})]}):null};function Gy({onClose:e,clientIds:t,hasBlockStyles:n,canRemove:o}){const{replaceBlocks:i,multiSelect:l,updateBlockAttributes:r}=(0,h.useDispatch)(ba),{possibleBlockTransformations:s,patterns:a,blocks:c,isUsingBindings:u}=(0,h.useSelect)((e=>{const{getBlockAttributes:n,getBlocksByClientId:o,getBlockRootClientId:i,getBlockTransformItems:l,__experimentalGetPatternTransformItems:r}=e(ba),s=i(t[0]),a=o(t);return{blocks:a,possibleBlockTransformations:l(a,s),patterns:r(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,h.useSelect)((n=>{const{getBlockAttributes:o,canRemoveBlocks:i}=n(ba),{getActiveBlockVariation:l,getBlockVariations:r}=n(d.store),s=i(e);if(1!==t.length||!s)return xy;const[a]=t;return{blockVariationTransformations:r(a.name,"transform"),activeBlockVariation:l(a.name,o(a.clientId))}}),[e,t]);return(0,p.useMemo)((()=>null==o?void 0:o.filter((({name:e})=>e!==(null==n?void 0:n.name)))),[o,n])}({clientIds:t,blocks:c});function m(e){e.length>1&&l(e[0].clientId,e[e.length-1].clientId)}const f=1===c.length,v=f&&(0,d.isTemplatePart)(c[0]),b=!!s.length&&o&&!v,k=!(null==g||!g.length),_=!(null==a||!a.length)&&o,y=b||k;if(!(n||y||_))return(0,et.jsx)("p",{className:"block-editor-block-switcher__no-transforms",children:(0,vt.__)("No transforms.","kubio")});const x=f?(0,vt._x)("This block is connected.","block toolbar button label and description","kubio"):(0,vt._x)("These blocks are connected.","block toolbar button label and description","kubio");return(0,et.jsxs)("div",{className:"block-editor-block-switcher__container",children:[_&&(0,et.jsx)(Hy,{blocks:c,patterns:a,onSelect:n=>{!function(e){i(t,e),m(e)}(n),e()}}),y&&(0,et.jsx)(Iy,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:s,possibleBlockVariationTransformations:g,blocks:c,onSelect:n=>{!function(e){const n=(0,d.switchToBlockType)(c,e);i(t,n),m(n)}(n),e()},onSelectVariation:t=>{!function(e){r(c[0].clientId,{...g.find((({name:t})=>t===e)).attributes})}(t),e()}}),n&&(0,et.jsx)(Ay,{hoveredBlock:c[0],onSwitch:e}),u&&(0,et.jsx)(le.MenuGroup,{children:(0,et.jsx)(le.__experimentalText,{className:"block-editor-block-switcher__binding-indicator",children:x})})]})}const $y=({clientIds:e})=>{const{hasContentOnlyLocking:t,canRemove:n,hasBlockStyles:o,icon:i,invalidBlocks:l,isReusable:r,isTemplate:s,isDisabled:a,hasKubioBlock:c}=(0,h.useSelect)((t=>{var n;const{getTemplateLock:o,getBlocksByClientId:i,getBlockAttributes:l,canRemoveBlocks:r,getBlockEditingMode:s}=t(ba),{getBlockStyles:a,getBlockType:c,getActiveBlockVariation:u}=t(d.store),p=i(e);if(!p.length||p.some((e=>!e)))return{invalidBlocks:!0};const[{name:h}]=p,g=1===p.length,m=c(h),f=s(e[0]);let v,b;if(g){const t=u(h,l(e[0]));v=(null==t?void 0:t.icon)||m.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?m.icon:_y}return{canRemove:r(e),hasBlockStyles:g&&!(null===(n=a(h))||void 0===n||!n.length),icon:v,isReusable:g&&(0,d.isReusableBlock)(p[0]),isTemplate:g&&(0,d.isTemplatePart)(p[0]),hasContentOnlyLocking:b,isDisabled:"default"!==f,hasKubioBlock:p.some((e=>e.name.includes("kubio/")))}}),[e]),u=ip({clientId:null==e?void 0:e[0],maximumLength:35}),p=(0,h.useSelect)((e=>e(Fo.store).get("core","showIconLabels")),[]);if(l)return null;const g=1===e.length,m=g?u:(0,vt.__)("Multiple blocks selected","kubio"),f=(r||s)&&!p&&u?u:void 0;if(c||a||!o&&!n||t)return(0,et.jsx)(le.ToolbarGroup,{children:(0,et.jsx)(le.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:m,icon:(0,et.jsx)(Sc,{className:"block-editor-block-switcher__toggle",icon:i,showColors:!0}),text:f})});const v=g?(0,vt.__)("Change block type or style","kubio"):(0,vt.sprintf)(/* translators: %d: number of blocks. */ /* translators: %d: number of blocks. */(0,vt._n)("Change type of %d block","Change type of %d blocks",e.length,"kubio"),e.length);return(0,et.jsx)(le.ToolbarGroup,{children:(0,et.jsx)(le.ToolbarItem,{children:t=>(0,et.jsx)(le.DropdownMenu,{className:"block-editor-block-switcher",label:m,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:(0,et.jsx)(Sc,{className:"block-editor-block-switcher__toggle",icon:i,showColors:!0}),text:f,toggleProps:{description:v,...t},menuProps:{orientation:"both"},children:({onClose:t})=>(0,et.jsx)(Gy,{onClose:t,clientIds:e,hasBlockStyles:o,canRemove:n})})})})},Uy={default:(0,le.createSlotFill)("BlockControls"),block:(0,le.createSlotFill)("BlockControlsBlock"),inline:(0,le.createSlotFill)("BlockFormatControls"),other:(0,le.createSlotFill)("BlockControlsOther"),parent:(0,le.createSlotFill)("BlockControlsParent")};function Wy({group:e="default",controls:t,children:n,__experimentalShareWithChildBlocks:o=!1}){const i=function(e,t){const n=B();var o;return n[f]?null===(o=Uy[e])||void 0===o?void 0:o.Fill:n[v]&&t?Uy.parent.Fill:null}(e,o);if(!i)return null;const l=(0,et.jsxs)(et.Fragment,{children:["default"===e&&(0,et.jsx)(le.ToolbarGroup,{controls:t}),n]});return(0,et.jsx)(le.__experimentalStyleProvider,{document,children:(0,et.jsx)(i,{children:e=>{const{forwardedContext:t=[]}=e;return t.reduce(((e,[t,n])=>(0,et.jsx)(t,{...n,children:e})),l)}})})}const{ComponentsContext:Ky}=fe(le.privateApis||{});function Zy({group:e="default",...t}){const n=(0,p.useContext)(le.__experimentalToolbarContext);let o,i,l,r;if(Ky?(o=(0,p.useContext)(Ky),i=(0,p.useMemo)((()=>({forwardedContext:[[le.__experimentalToolbarContext.Provider,{value:n}],[Ky.Provider,{value:o}]]})),[n,o])):i=(0,p.useMemo)((()=>({forwardedContext:[[le.__experimentalToolbarContext.Provider,{value:n}]]})),[n]),(0,re.wpVersionCompare)("6.8","<")){var s;l=null===(s=Uy[e])||void 0===s?void 0:s.Slot,r=R_(l.__unstableName)}else{var a;const t=Uy[e];r=null===(a=(0,le.__experimentalUseSlotFills)(t.name))||void 0===a?void 0:a.length,l=t.Slot}if(!l)return!0===globalThis.SCRIPT_DEBUG&&qm()(`Unknown BlockControls group "${e}" provided.`),null;if(!r)return null;const c=(0,et.jsx)(l,{...t,bubblesVirtually:!0,fillProps:i});return"default"===e?c:(0,et.jsx)(le.ToolbarGroup,{children:c})}const qy=Wy;qy.Slot=Zy;const Yy=e=>(0,et.jsx)(Wy,{group:"inline",...e});Yy.Slot=function(e){return(0,et.jsx)(Zy,{group:"inline",...e})};const Qy=qy,{Fill:Xy,Slot:Jy}=(0,le.createSlotFill)("__unstableBlockToolbarLastItem");Xy.Slot=Jy;const ex=Xy,tx="__experimentalBorder",nx="color",ox="typography.__experimentalFontFamily",ix="typography.fontSize",lx="typography.textAlign",rx=["shadow","typography.lineHeight",ix,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",ox,lx,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalWritingMode","typography.__experimentalLetterSpacing",tx,nx,"spacing"],sx={align:e=>(0,d.hasBlockSupport)(e,"align"),borderColor:e=>function(e,t="any"){if("web"!==p.Platform.OS)return!1;const n=(0,d.getBlockSupport)(e,tx);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,d.getBlockSupport)(e,nx);return t&&!1!==t.background},textAlign:e=>(0,d.hasBlockSupport)(e,lx),textColor:e=>{const t=(0,d.getBlockSupport)(e,nx);return t&&!1!==t.text},gradient:e=>{const t=(0,d.getBlockSupport)(e,nx);return null!==t&&"object"==typeof t&&!!t.gradients},className:e=>(0,d.hasBlockSupport)(e,"customClassName",!0),fontFamily:e=>(0,d.hasBlockSupport)(e,ox),fontSize:e=>(0,d.hasBlockSupport)(e,ix),layout:e=>(0,d.hasBlockSupport)(e,"layout"),style:e=>rx.some((t=>(0,d.hasBlockSupport)(e,t)))};function ax(e,t){return Object.entries(sx).reduce(((n,[o,i])=>(i(e.name)&&i(t.name)&&(n[o]=e.attributes[o]),n)),{})}function cx(e,t,n){for(let o=0;o<Math.min(t.length,e.length);o+=1)n(e[o].clientId,ax(t[o],e[o])),cx(e[o].innerBlocks,t[o].innerBlocks,n)}function ux({clientIds:e,children:t,__experimentalUpdateSelection:n}){const{canCopyStyles:o,canDuplicate:i,canInsertDefaultBlock:l,canRemove:r,getGroupingBlockName:s,rootClientId:a,blocks:c}=(0,h.useSelect)((t=>{const{canInsertBlockType:n,getBlockRootClientId:o,getBlocksByClientId:i,canRemoveBlocks:l}=t(ba),{getDefaultBlockName:r,getGroupingBlockName:s}=t(d.store),a=i(e),c=o(e[0]),u=a.every((e=>!!e&&((0,d.hasBlockSupport)(e.name,"color")||(0,d.hasBlockSupport)(e.name,"typography")))),p=a.every((e=>!!e&&(0,d.hasBlockSupport)(e.name,"multiple",!0)&&n(e.name,c)));return{canCopyStyles:u,canDuplicate:p,canInsertDefaultBlock:n(r(),c),canRemove:l(e,c),getGroupingBlockName:s,rootClientId:c,blocks:a}}),[e]),{removeBlocks:u,replaceBlocks:g,duplicateBlocks:m,insertAfterBlock:f,insertBeforeBlock:v,flashBlock:b,setBlockMovingClientId:k,setNavigationMode:_,selectBlock:y}=(0,h.useDispatch)(ba),x=(Kh(),function(){const e=(0,h.useRegistry)(),{updateBlockAttributes:t}=(0,h.useDispatch)(ba),{createSuccessNotice:n,createWarningNotice:o,createErrorNotice:i}=(0,h.useDispatch)(Wh.store);return(0,p.useCallback)((async l=>{let r="";try{if(!window.navigator.clipboard)return void i((0,vt.__)("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers.","kubio"),{type:"snackbar"});r=await window.navigator.clipboard.readText()}catch(e){return void i((0,vt.__)("Unable to paste styles. Please allow browser clipboard permissions before continuing.","kubio"),{type:"snackbar"})}if(!r||!function(e){try{const t=(0,d.parse)(e,{__unstableSkipMigrationLogs:!0,__unstableSkipAutop:!0});return 1!==t.length||"core/freeform"!==t[0].name}catch(e){return!1}}(r))return void o((0,vt.__)("Unable to paste styles. Block styles couldn't be found within the copied content.","kubio"),{type:"snackbar"});const s=(0,d.parse)(r);if(1===s.length?e.batch((()=>{cx(l,l.map((()=>s[0])),t)})):e.batch((()=>{cx(l,s,t)})),1===l.length){var a;const e=null===(a=(0,d.getBlockType)(l[0].name))||void 0===a?void 0:a.title;n((0,vt.sprintf)(// Translators: %s: Name of the block being pasted, e.g. "Paragraph".
// Translators: %s: Name of the block being pasted, e.g. "Paragraph".
(0,vt.__)("Pasted styles to %s."),e),{type:"snackbar"})}else n((0,vt.sprintf)(// Translators: %d: The number of the blocks.
// Translators: %d: The number of the blocks.
(0,vt.__)("Pasted styles to %d blocks."),l.length),{type:"snackbar"})}),[e.batch,t,n,o,i])}());return t({canCopyStyles:o,canDuplicate:i,canInsertDefaultBlock:l,canRemove:r,rootClientId:a,blocks:c,onDuplicate:()=>m(e,n),onRemove:()=>u(e,n),onInsertBefore(){const t=Array.isArray(e)?e[0]:t;v(t)},onInsertAfter(){const t=Array.isArray(e)?e[e.length-1]:t;f(t)},onGroup(){if(!c.length)return;const t=s(),n=(0,d.switchToBlockType)(c,t);n&&g(e,n)},onUngroup(){if(!c.length)return;const t=c[0].innerBlocks;t.length&&g(e,t)},onCopy(){const e=c.map((({clientId:e})=>e));1===c.length&&b(e[0])},async onPasteStyles(){await x(c)}})}function dx(e){return(0,h.useSelect)((t=>{var n,o;const{getBlocksByClientId:i,getSelectedBlockClientIds:l,isUngroupable:r,isGroupable:s}=t(ba),{getGroupingBlockName:a,getBlockType:c}=t(d.store),u=null!=e&&e.length?e:l(),p=i(u),[h]=p,g=1===u.length&&r(u[0]);return{clientIds:u,isGroupable:s(u),isUngroupable:g,blocksSelection:p,groupingBlockName:a(),onUngroup:g&&(null===(n=c(h.name))||void 0===n||null===(o=n.transforms)||void 0===o?void 0:o.ungroup)}}),[e])}var px=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})}),hx=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})}),gx=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})}),mx=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{fillRule:"evenodd",clipRule:"evenodd",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"})});const fx={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"},grid:{type:"grid"}},vx=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=dx(),{replaceBlocks:i}=(0,h.useDispatch)(ba),{canRemove:l,variations:r}=(0,h.useSelect)((e=>{const{canRemoveBlocks:o}=e(ba),{getBlockVariations:i}=e(d.store);return{canRemove:o(t),variations:i(n,"transform")}}),[t,n]),s=o=>{const l=(0,d.switchToBlockType)(e,n);"string"!=typeof o&&(o="group"),l&&l.length>0&&(l[0].attributes.layout=fx[o],i(t,l))};if(!o||!l)return null;const a=!!r.find((({name:e})=>"group-row"===e)),c=!!r.find((({name:e})=>"group-stack"===e)),u=!!r.find((({name:e})=>"group-grid"===e));return(0,et.jsxs)(le.ToolbarGroup,{children:[(0,et.jsx)(le.ToolbarButton,{icon:px,label:(0,vt._x)("Group","action: convert blocks to group"),onClick:s}),a&&(0,et.jsx)(le.ToolbarButton,{icon:hx,label:(0,vt._x)("Row","action: convert blocks to row"),onClick:()=>s("row")}),c&&(0,et.jsx)(le.ToolbarButton,{icon:gx,label:(0,vt._x)("Stack","action: convert blocks to stack"),onClick:()=>s("stack")}),u&&(0,et.jsx)(le.ToolbarButton,{icon:mx,label:(0,vt._x)("Grid","action: convert blocks to grid"),onClick:()=>s("grid")})]})};function bx({clientIds:e,isGroupable:t,isUngroupable:n,onUngroup:o,blocksSelection:i,groupingBlockName:l,onClose:r=(()=>{})}){var s;const{getSelectedBlockClientIds:a,getBlock:c}=(0,h.useSelect)(ba),{replaceBlocks:u}=(0,h.useDispatch)(ba);if(!t&&!n)return null;const p=(e||[]).map((e=>c(e))),g=null==p||null===(s=p.find)||void 0===s?void 0:s.call(p,(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")})),m=a();return g?(0,et.jsx)(et.Fragment,{}):(0,et.jsxs)(et.Fragment,{children:[t&&(0,et.jsx)(le.MenuItem,{shortcut:m.length>1?Jd.displayShortcut.primary("g"):void 0,onClick:()=>{(()=>{const t=(0,d.switchToBlockType)(i,l);t&&u(e,t)})(),r()},children:(0,vt._x)("Group","verb","kubio")}),n&&(0,et.jsx)(le.MenuItem,{onClick:()=>{(()=>{let t=i[0].innerBlocks;t.length&&(o&&(t=o(i[0].attributes,i[0].innerBlocks)),u(e,t))})(),r()},children:(0,vt._x)("Ungroup","Ungrouping blocks from within a grouping block back into individual blocks within the Editor","kubio")})]})}var kx=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})}),yx=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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 xx(e){return(0,h.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:i,canLockBlockType:l,getBlockName:r,getBlockRootClientId:s,getTemplateLock:a}=t(ba),c=s(e),u=n(e),d=o(e,c),p=i(e,c);return{canEdit:u,canMove:d,canRemove:p,canLock:l(r(e)),isContentLocked:"contentOnly"===a(e),isLocked:!u||!d||!p}}),[e])}var Sx=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"})});const wx=["core/navigation"];function Cx(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function Bx({clientId:e,onClose:t}){const[n,o]=(0,p.useState)({move:!1,remove:!1}),{canEdit:i,canMove:l,canRemove:r}=xx(e),{allowsEditLocking:s,templateLock:a,hasTemplateLock:c}=(0,h.useSelect)((t=>{var n,o;const{getBlockName:i,getBlockAttributes:l}=t(ba),r=i(e),s=(0,d.getBlockType)(r);return{allowsEditLocking:wx.includes(r),templateLock:null===(n=l(e))||void 0===n?void 0:n.templateLock,hasTemplateLock:!(null==s||null===(o=s.attributes)||void 0===o||!o.templateLock)}}),[e]),[u,g]=(0,p.useState)(!!a),{updateBlockAttributes:m}=(0,h.useDispatch)(ba),f=F_(e);(0,p.useEffect)((()=>{o({move:!l,remove:!r,...s?{edit:!i}:{}})}),[i,l,r,s]);const v=Object.values(n).every(Boolean),b=Object.values(n).some(Boolean)&&!v;return(0,et.jsx)(le.Modal,{title:(0,vt.sprintf)(/* translators: %s: Name of the block. */ /* translators: %s: Name of the block. */(0,vt.__)("Lock %s"),f.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:t,size:"small",children:(0,et.jsxs)("form",{onSubmit:o=>{o.preventDefault(),m([e],{lock:n,templateLock:u?Cx(n):void 0}),t()},children:[(0,et.jsxs)("fieldset",{className:"block-editor-block-lock-modal__options",children:[(0,et.jsx)("legend",{children:(0,vt.__)("Select the features you want to lock")}),(0,et.jsx)("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:(0,et.jsxs)("li",{children:[(0,et.jsx)(le.CheckboxControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__options-all",label:(0,vt.__)("Lock all"),checked:v,indeterminate:b,onChange:e=>o({move:e,remove:e,...s?{edit:e}:{}})}),(0,et.jsxs)("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:[s&&(0,et.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,et.jsx)(le.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,vt.__)("Lock editing"),checked:!!n.edit,onChange:e=>o((t=>({...t,edit:e})))}),(0,et.jsx)(le.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.edit?Sx:kx})]}),(0,et.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,et.jsx)(le.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,vt.__)("Lock movement"),checked:n.move,onChange:e=>o((t=>({...t,move:e})))}),(0,et.jsx)(le.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.move?Sx:kx})]}),(0,et.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,et.jsx)(le.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,vt.__)("Lock removal"),checked:n.remove,onChange:e=>o((t=>({...t,remove:e})))}),(0,et.jsx)(le.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.remove?Sx:kx})]})]})]})}),c&&(0,et.jsx)(le.ToggleControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__template-lock",label:(0,vt.__)("Apply to all blocks inside"),checked:u,disabled:n.move&&!n.remove,onChange:()=>g(!u)})]}),(0,et.jsxs)(le.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,et.jsx)(le.FlexItem,{children:(0,et.jsx)(le.Button,{variant:"tertiary",onClick:t,__next40pxDefaultSize:!0,children:(0,vt.__)("Cancel")})}),(0,et.jsx)(le.FlexItem,{children:(0,et.jsx)(le.Button,{variant:"primary",type:"submit",__next40pxDefaultSize:!0,children:(0,vt.__)("Apply")})})]})]})})}function Ix({clientId:e}){const{canLock:t,isLocked:n}=xx(e),[o,i]=(0,p.useReducer)((e=>!e),!1);if(!t)return null;const l=n?(0,vt.__)("Unlock"):(0,vt.__)("Lock");return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(le.MenuItem,{icon:n?kx:yx,onClick:i,"aria-expanded":o,"aria-haspopup":"dialog",children:l}),o&&(0,et.jsx)(Bx,{clientId:e,onClose:i})]})}function jx({clientId:e}){const{canLock:t,isLocked:n}=xx(e),[o,i]=(0,p.useReducer)((e=>!e),!1),l=(0,p.useRef)(!1);if((0,p.useEffect)((()=>{n&&(l.current=!0)}),[n]),!n&&!l.current)return null;let r=n?(0,vt.__)("Unlock"):(0,vt.__)("Lock");return!t&&n&&(r=(0,vt.__)("Locked")),(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(le.ToolbarGroup,{className:"block-editor-block-lock-toolbar",children:(0,et.jsx)(le.ToolbarButton,{disabled:!t,icon:n?Sx:kx,label:r,onClick:i,"aria-expanded":o,"aria-haspopup":"dialog"})}),o&&(0,et.jsx)(Bx,{clientId:e,onClose:i})]})}const Ex=()=>{};function Tx({clientId:e,onToggle:t=Ex}){const{blockType:n,mode:o,enabled:i}=(0,h.useSelect)((t=>{const{getBlock:n,getBlockMode:o,getSettings:i}=t(ba),l=n(e);return{mode:o(e),blockType:l?(0,d.getBlockType)(l.name):null,enabled:i().codeEditingEnabled&&!(null==l||!l.isValid)}}),[e]),{toggleBlockMode:l}=(0,h.useDispatch)(ba);if(!n||!(0,d.hasBlockSupport)(n,"html",!0)||!i)return null;const r="visual"===o?(0,vt.__)("Edit as HTML"):(0,vt.__)("Edit visually");return(0,et.jsx)(le.MenuItem,{onClick:()=>{l(e),t()},children:r})}function Px({clientId:e,onClose:t}){const{templateLock:n,isLockedByParent:o,isEditingAsBlocks:i}=(0,h.useSelect)((t=>{const{getContentLockingParent:n,getTemplateLock:o,getTemporarilyEditingAsBlocks:i}=fe(t(ba));return{templateLock:o(e),isLockedByParent:!!n(e),isEditingAsBlocks:i()===e}}),[e]),l=(0,h.useDispatch)(ba),r=!o&&"contentOnly"===n;if(!r&&!i)return null;const{modifyContentLockBlock:s}=fe(l);return!i&&r&&(0,et.jsx)(le.MenuItem,{onClick:()=>{s(e),t()},children:(0,vt._x)("Modify","Unlock content locked blocks")})}const{Fill:Mx,Slot:Rx}=(0,le.createSlotFill)("BlockSettingsMenuControls");function Nx({...e}){return(0,et.jsx)(le.__experimentalStyleProvider,{document,children:(0,et.jsx)(Mx,{...e})})}Nx.Slot=({fillProps:e,clientIds:t=null,__unstableDisplayLocation:n,canToggleSelectedBlocksVisibility:o})=>{const{selectedBlocks:i,selectedClientIds:l,isContentOnly:r}=(0,h.useSelect)((e=>{const{getBlockNamesByClientId:n,getSelectedBlockClientIds:o,getBlockEditingMode:i,getBlocksByClientId:l}=e(ba),r=null!==t?t:o();return{selectedBlocks:n(r),selectedClientIds:r,isContentOnly:"contentOnly"===i(r[0]),canToggleSelectedBlocksVisibility:l(r).every((e=>(0,d.hasBlockSupport)(e.name,"blockVisibility",!0)))}}),[t]),{canLock:s}=xx(l[0]),a=1===l.length&&s&&!r,c=o&&!r,u=dx(l),{isGroupable:p,isUngroupable:g}=u,m=p||g;return(0,et.jsx)(Rx,{fillProps:{...e,__unstableDisplayLocation:n,selectedBlocks:i,selectedClientIds:l},children:t=>!(null!=t&&t.length)>0&&!m&&!a?null:(0,et.jsxs)(et.Fragment,{children:[(0,et.jsxs)(le.MenuGroup,{children:[m&&(0,et.jsx)(bx,{...u,onClose:null==e?void 0:e.onClose}),a&&(0,et.jsx)(Ix,{clientId:l[0]})]}),(0,et.jsxs)(le.MenuGroup,{children:[!1,c&&(0,et.jsx)(Rk,{clientIds:l}),t,1===l.length&&(0,et.jsx)(Px,{clientId:l[0],onClose:null==e?void 0:e.onClose}),1===(null==e?void 0:e.count)&&(0,et.jsx)(Tx,{clientId:null==e?void 0:e.firstBlockClientId,onToggle:null==e?void 0:e.onClose})]})]})})};const Lx=Nx,Ax=function({clientId:e}){const t=(0,h.useSelect)((t=>t(ba).getBlock(e)),[e]),{replaceBlocks:n}=(0,h.useDispatch)(ba);return t&&"core/html"===t.name?(0,et.jsx)(le.MenuItem,{onClick:()=>n(e,(0,d.rawHandler)({HTML:(0,d.getBlockContent)(t)})),children:(0,vt.__)("Convert to Blocks","kubio")}):null},{Fill:Dx,Slot:Ox}=(0,le.createSlotFill)("__unstableBlockSettingsMenuFirstItem");Dx.Slot=Ox;const zx=Dx,Vx={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"};function Fx({blocks:e,onCopy:t,label:n}){const o=(0,g.useCopyToClipboard)((()=>(0,d.serialize)(e)),t),i=n||(0,vt.__)("Copy","kubio");return(0,et.jsx)(le.MenuItem,{ref:o,children:i})}function Hx({parentClientId:e,parentBlockType:t}){const{selectBlock:n}=(0,h.useDispatch)(ba),o=(0,p.useRef)();return(0,et.jsx)(le.MenuItem,{ref:o,icon:(0,et.jsx)(Sc,{icon:t.icon}),onClick:()=>n(e),children:(0,vt.sprintf)(/* translators: %s: Name of the block's parent. */ /* translators: %s: Name of the block's parent. */(0,vt.__)("Select parent block (%s)","kubio"),t.title)})}function Gx({block:e,clientIds:t,__experimentalSelectBlock:n,children:o,__unstableDisplayLocation:i,...l}){const r=null==e?void 0:e.clientId,s=Array.isArray(t)?t:[t],a=s.length,c=s[0],{firstParentClientId:u,onlyBlock:m,parentBlockType:f,previousBlockClientId:v,selectedBlockClientIds:b}=(0,h.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockRootClientId:o,getPreviousBlockClientId:i,getSelectedBlockClientIds:l,getBlockAttributes:r}=e(ba),{getActiveBlockVariation:s}=e(d.store),a=o(c),u=a&&n(a);return{firstParentClientId:a,onlyBlock:1===t(a),parentBlockType:a&&(s(u,r(a))||(0,d.getBlockType)(u)),previousBlockClientId:i(c),selectedBlockClientIds:l()}}),[c]),{getBlockOrder:k,getSelectedBlockClientIds:_}=(0,h.useSelect)(ba),y=(0,h.useSelect)((e=>fe(e(ba)).getOpenedBlockSettingsMenu()),[]),{setOpenedBlockSettingsMenu:x}=fe((0,h.useDispatch)(ba)),S=(0,h.useSelect)((e=>{const{getShortcutRepresentation:t}=e(oh.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,oh.__unstableUseShortcutEventMatch)(),C=b.length>0,B=(0,p.useCallback)((async e=>{if(n){const t=await e;t&&t[0]&&n(t[0],!1)}}),[n]),I=(0,p.useCallback)((()=>{if(n){let e=v||u;e||(e=k()[0]);const t=C&&0===_().length;n(e,t)}}),[n,v,u,k,C,_]),j=null==b?void 0:b.includes(u);return(0,p.useCallback)((e=>{e&&y!==r?x(r):!e&&y&&y===r&&x(void 0)}),[r,y,x]),(0,et.jsx)(ux,{clientIds:t,__experimentalUpdateSelection:!n,children:({canCopyStyles:e,canDuplicate:n,canInsertDefaultBlock:r,canMove:s,canRemove:d,onDuplicate:h,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,et.jsx)(le.DropdownMenu,{icon:_a,label:(0,vt.__)("Options","kubio"),className:"block-editor-block-settings-menu",popoverProps:Vx,noIcons:!0,menuProps:{onKeyDown(e){e.defaultPrevented||(w("core/block-editor/remove",e)&&d?(e.preventDefault(),I(k())):w("core/block-editor/duplicate",e)&&n?(e.preventDefault(),B(h())):w("core/block-editor/insert-after",e)&&r?(e.preventDefault(),x(void 0),v()):w("core/block-editor/insert-before",e)&&r&&(e.preventDefault(),x(void 0),b()))}},...l,children:({onClose:l})=>(0,et.jsxs)(et.Fragment,{children:[(0,et.jsxs)(le.MenuGroup,{children:[(0,et.jsx)(zx.Slot,{fillProps:{onClose:l}}),!j&&!!u&&(0,et.jsx)(Hx,{parentClientId:u,parentBlockType:f}),1===a&&(0,et.jsx)(Ax,{clientId:c}),n&&(0,et.jsx)(le.MenuItem,{onClick:(0,g.pipe)(l,h,B),shortcut:S.duplicate,children:(0,vt.__)("Duplicate","kubio")}),r&&(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(le.MenuItem,{onClick:(0,g.pipe)(l,b),shortcut:S.insertBefore,children:(0,vt.__)("Add before","kubio")}),(0,et.jsx)(le.MenuItem,{onClick:(0,g.pipe)(l,v),shortcut:S.insertAfter,children:(0,vt.__)("Add after","kubio")})]})]}),e&&!T&&(0,et.jsxs)(le.MenuGroup,{children:[(0,et.jsx)(Fx,{blocks:E,onCopy:_,label:(0,vt.__)("Copy styles","kubio")}),(0,et.jsx)(le.MenuItem,{onClick:y,children:(0,vt.__)("Paste styles","kubio")})]}),(0,et.jsx)(Lx.Slot,{fillProps:{onClose:l,canMove:s,onMoveTo:C,onlyBlock:m,count:a,firstBlockClientId:c},clientIds:t,__unstableDisplayLocation:i}),"function"==typeof o?o({onClose:l}):p.Children.map((e=>(0,p.cloneElement)(e,{onClose:l}))),d&&(0,et.jsx)(le.MenuGroup,{children:(0,et.jsx)(le.MenuItem,{onClick:(0,g.pipe)(l,k,I),shortcut:S.remove,children:(0,vt.__)("Delete","kubio")})})]})})}})}const $x=Gx,Ux=function({clientIds:e,...t}){return(0,et.jsx)(le.ToolbarGroup,{children:(0,et.jsx)(le.ToolbarItem,{children:n=>(0,et.jsx)($x,{clientIds:e,toggleProps:n,...t})})})};function Wx({clientIds:e}){const t=1===e.length?e[0]:void 0,n=(0,h.useSelect)((e=>!!t&&"html"===e(ba).getBlockMode(t)),[t]),{toggleBlockMode:o}=(0,h.useDispatch)(ba);return n?(0,et.jsx)(le.ToolbarGroup,{children:(0,et.jsx)(le.ToolbarButton,{onClick:()=>{o(t)},children:(0,vt.__)("Edit visually","kubio")})}):null}const Kx=(0,p.createContext)("");Kx.displayName="__unstableBlockNameContext";const Zx=Kx;function qx(e){return Array.from(e.querySelectorAll("[data-toolbar-item]:not([disabled])"))}function Yx(e){return e.contains(e.ownerDocument.activeElement)}function Qx({children:e,focusOnMount:t,focusEditorOnEscape:n=!1,shouldUseKeyboardFocusShortcut:o=!0,__experimentalInitialIndex:i,__experimentalOnIndexChange:l,orientation:r="horizontal",...s}){const a=(0,p.useRef)(),c=function(e){const[t,n]=(0,p.useState)(!0),o=(0,p.useCallback)((()=>{const t=!Ih.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||Je()("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,p.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:l,focusEditorOnEscape:r}){const[s]=(0,p.useState)(t),[a]=(0,p.useState)(o),c=(0,p.useCallback)((()=>{!function(e){const[t]=Ih.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[e]);(0,oh.useShortcut)("core/block-editor/focus-toolbar",(()=>{l&&c()})),(0,p.useEffect)((()=>{s&&c()}),[n,s,c]),(0,p.useEffect)((()=>{const t=e.current;let n=0;return s||Yx(t)||(n=window.requestAnimationFrame((()=>{const e=qx(t),n=a||0;e[n]&&Yx(t)&&e[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(n),!i||!t)return;const e=qx(t).findIndex((e=>0===e.tabIndex));i(e)}}),[a,s,i,e]);const{getLastFocus:u}=fe((0,h.useSelect)(ba));(0,p.useEffect)((()=>{const t=e.current;if(r){const e=e=>{const t=u();e.keyCode===Jd.ESCAPE&&null!=t&&t.current&&(e.preventDefault(),t.current.focus())};return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}}),[r,u,e])}({toolbarRef:a,focusOnMount:t,defaultIndex:i,onIndexChange:l,isAccessibleToolbar:c,shouldUseKeyboardFocusShortcut:o,focusEditorOnEscape:n}),c?(0,et.jsx)(le.Toolbar,{label:s["aria-label"],ref:a,orientation:r,...s,children:e}):(0,et.jsx)(le.NavigableMenu,{orientation:r,role:"toolbar",ref:a,...s,children:e})}function Xx(e="default"){var t;const n=null===(t=Uy[e])||void 0===t?void 0:t.Slot,o=(0,le.__experimentalUseSlotFills)(null==n?void 0:n.__unstableName);return n?!(null==o||!o.length):(!0===globalThis.SCRIPT_DEBUG&&qm()(`Unknown BlockControls group "${e}" provided.`),null)}function Jx({hideDragHandle:e,focusOnMount:t,__experimentalInitialIndex:n,__experimentalOnIndexChange:o,variant:i="unstyled",isSimpleMode:l=!1}){const{blockClientId:r,blockClientIds:s,isContentOnlyEditingMode:a,isDefaultEditingMode:c,blockType:m,toolbarKey:f,shouldShowVisualToolbar:v,showParentSelector:b,isUsingBindings:k,hasParentPattern:_,hasContentOnlyLocking:y,showBlockVisibilityButton:x}=(0,h.useSelect)((e=>{var t,n;const{getBlockName:o,getBlockMode:i,getBlockParents:l,getSelectedBlockClientIds:r,isBlockValid:s,getBlockEditingMode:a,getBlockAttributes:c,getBlockParentsByBlockName:u,getTemplateLock:p}=e(ba),h=r(),g=h[0],m=l(g),f=m[m.length-1],v=o(f),b=(0,d.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=c(e))||void 0===t||null===(n=t.metadata)||void 0===n||!n.bindings)})),C=h.every((e=>u(e,"core/block",!0).length>0)),B=(null===(t=e(kn.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,d.getBlockType)(y),shouldShowVisualToolbar:x&&S,toolbarKey:`${g}${f}`,showParentSelector:!B&&b&&"default"===a(f)&&(0,d.hasBlockSupport)(b,"__experimentalParentSelector",!0)&&1===h.length&&_,isUsingBindings:w,hasParentPattern:C,hasContentOnlyLocking:I,showBlockVisibilityButton:!0}}),[]),S=(0,p.useRef)(null),w=(0,p.useRef)(),C=!(0,g.useViewportMatch)("medium","<");if(!function(){const{isToolbarEnabled:e,isDefaultEditingMode:t}=(0,h.useSelect)((e=>{const{getBlockEditingMode:t,getBlockName:n,getBlockSelectionStart:o}=e(ba),i=o(),l=i&&(0,d.getBlockType)(n(i));return{isToolbarEnabled:l&&(0,d.hasBlockSupport)(l,"__experimentalToolbar",!0),isDefaultEditingMode:"default"===t(i)}}),[]),n=function(){let e=!1;for(const t in Uy)Xx(t)&&(e=!0);return e}();return!(!e||!t&&!n)}())return null;const B=s.length>1,I=(0,d.isReusableBlock)(m)||(0,d.isTemplatePart)(m),j=u("block-editor-block-contextual-toolbar",{"has-parent":b}),E=u("block-editor-block-toolbar",{"is-synced":I,"is-connected":k});return(0,et.jsx)(Qx,{focusEditorOnEscape:!0,className:j/* translators: accessibility text for the block toolbar */,"aria-label":(0,vt.__)("Block tools","kubio"),variant:"toolbar"===i?void 0:i,focusOnMount:t,__experimentalInitialIndex:n,__experimentalOnIndexChange:o,children:(0,et.jsxs)("div",{ref:S,className:E,children:[!B&&C&&c&&!l&&(0,et.jsx)(ky,{}),(v||B)&&(c||a&&!_||I)&&(0,et.jsx)("div",{ref:w,children:(0,et.jsxs)(le.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls",children:[(0,et.jsx)($y,{clientIds:s,disabled:!c,isUsingBindings:k}),c&&x&&(0,et.jsx)(Nk,{clientIds:s}),c&&(0,et.jsxs)(et.Fragment,{children:[!B&&(0,et.jsx)(jx,{clientId:r}),(0,et.jsx)(by,{clientIds:s,hideDragHandle:e})]})]})}),!y&&v&&B&&(0,et.jsx)(vx,{}),v&&(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(Qy.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,et.jsx)(Qy.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,et.jsx)(Qy.Slot,{className:"block-editor-block-toolbar__slot"}),(0,et.jsx)(Qy.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,et.jsx)(Qy.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,et.jsx)(Zx.Provider,{value:null==m?void 0:m.name,children:(0,et.jsx)(ex.Slot,{})})]}),(0,et.jsx)(Wx,{clientIds:s}),c&&(0,et.jsx)(Ux,{clientIds:s})]})},f)}function eS({hideDragHandle:e,variant:t,isSimpleMode:n}){return(0,et.jsx)(Jx,{hideDragHandle:e,variant:t,focusOnMount:void 0,__experimentalInitialIndex:void 0,__experimentalOnIndexChange:void 0,isSimpleMode:n})}function tS({clientId:e,isTyping:t,__unstableContentRef:n}){const{capturingClientId:o,isInsertionPointVisible:i,lastClientId:l}=iy(e),r=(0,p.useRef)();(0,p.useEffect)((()=>{r.current=void 0}),[e]);const{stopTyping:s}=(0,h.useDispatch)(ba),a=(0,p.useRef)(!1);(0,oh.useShortcut)("core/block-editor/focus-toolbar",(()=>{a.current=!0,s(!0)})),(0,p.useEffect)((()=>{a.current=!1}));const c=o||e,d=oy({contentElement:null==n?void 0:n.current,clientId:c}),{isSimpleMode:g}=(0,h.useSelect)((e=>{var t,n;return{isSimpleMode:(null===(t=e(kn.STORE_KEY))||void 0===t||null===(n=t.getKubioEditorModeIsSimple)||void 0===n?void 0:n.call(t))||!1}}),[]);return(0,et.jsx)(p_,{clientId:c,bottomClientId:l,className:u("block-editor-block-list__block-popover",{"is-insertion-point-visible":i}),resize:!1,...d,children:(0,et.jsx)(Jx,{focusOnMount:a.current,__experimentalInitialIndex:r.current,__experimentalOnIndexChange:e=>{r.current=e},isSimpleMode:g,variant:"toolbar"})})}const nS=(0,p.forwardRef)((function({clientId:e,rootClientId:t},n){const o=(0,h.useSelect)((n=>{var o;const{getBlock:i,getBlockIndex:l,hasBlockMovingClientId:r,getBlockListSettings:s,__unstableGetEditorMode:a,getNextBlockClientId:c,getPreviousBlockClientId:u,canMoveBlock:p}=n(ba),{getActiveBlockVariation:h,getBlockType:g}=n(d.store),m=l(e),{name:f,attributes:v}=i(e),b=g(f),k=null===(o=s(t))||void 0===o?void 0:o.orientation,_=h(f,v);return{blockMovingMode:r(),editorMode:a(),icon:(null==_?void 0:_.icon)||b.icon,label:(0,d.__experimentalGetAccessibleBlockLabel)(b,v,m+1,k),canMove:p(e,t),getNextBlockClientId:c,getPreviousBlockClientId:u}}),[e,t]),{label:i,icon:l,blockMovingMode:r,editorMode:s,canMove:a}=o,{setNavigationMode:c,removeBlock:g}=(0,h.useDispatch)(ba);(0,p.useEffect)((()=>{"navigation"===s&&(n.current.focus(),(0,gr.speak)(i))}),[i,s]);const m=up(e),{hasBlockMovingClientId:f,getBlockIndex:v,getBlockRootClientId:b,getClientIdsOfDescendants:k,getSelectedBlockClientId:_,getMultiSelectedBlocksEndClientId:y,getPreviousBlockClientId:x,getNextBlockClientId:S}=(0,h.useSelect)(ba),{selectBlock:w,clearSelectedBlock:C,setBlockMovingClientId:B,moveBlockToPosition:I}=(0,h.useDispatch)(ba),j=u("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!r}),E=(0,vt.__)("Drag"),T=a&&"navigation"===s;return(0,et.jsx)("div",{className:j,children:(0,et.jsxs)(le.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content",children:[(0,et.jsx)(le.FlexItem,{children:(0,et.jsx)(Sc,{icon:l,showColors:!0})}),T&&(0,et.jsx)(le.FlexItem,{children:(0,et.jsx)(ry,{clientIds:[e],children:e=>(0,et.jsx)(le.Button,{__next40pxDefaultSize:!1,icon:Mp,className:"block-selection-button_drag-handle",label:E,tabIndex:"-1",...e})})}),"navigation"===s&&(0,et.jsx)(le.FlexItem,{children:(0,et.jsx)(le.Button,{__next40pxDefaultSize:!1,ref:n,onClick:"navigation"===s?()=>c(!1):void 0,onKeyDown:function(t){const{keyCode:n}=t,o=n===Jd.UP,i=n===Jd.DOWN,l=n===Jd.LEFT,r=n===Jd.RIGHT,s=n===Jd.TAB,a=n===Jd.ESCAPE,c=n===Jd.ENTER,u=n===Jd.SPACE,d=t.shiftKey;if(n===Jd.BACKSPACE||n===Jd.DELETE)return g(e),void t.preventDefault();const p=_(),h=y(),j=x(h||p),E=S(h||p),T=s&&d||o,P=s&&!d||i,M=l,R=r;let N;T?N=j:P?N=E:M?N=b(p)??p:R&&(N=k(p)[0]??p);const L=f();if(a&&L&&!t.defaultPrevented&&(B(null),t.preventDefault()),(c||u)&&L){const e=b(L),t=b(p),n=v(L);let o=v(p);n<o&&e===t&&(o-=1),I(L,e,t,o),w(L),B(null)}if((!L||p!==L||!R)&&(P||T||M||R))if(N)t.preventDefault(),w(N);else if(s&&p){let e;if(P){e=m;do{e=Ih.focus.tabbable.findNext(e)}while(e&&m.contains(e));e||(e=m.ownerDocument.defaultView.frameElement,e=Ih.focus.tabbable.findNext(e))}else e=Ih.focus.tabbable.findPrevious(m);e&&(t.preventDefault(),e.focus(),C())}},label:i,showTooltip:!1,className:"block-selection-button_select-button",children:(0,et.jsx)(lp,{clientId:e,maximumLength:35})})})]})})})),oS=(0,p.forwardRef)((function({clientId:e,__unstableContentRef:t},n){const{capturingClientId:o,isInsertionPointVisible:i,lastClientId:l,rootClientId:r}=iy(e),s=oy({contentElement:null==t?void 0:t.current,clientId:e});return(0,et.jsx)(d_,{clientId:o||e,bottomClientId:l,className:u("block-editor-block-list__block-popover",{"is-insertion-point-visible":i}),resize:!1,...s,children:(0,et.jsx)(nS,{ref:n,clientId:e,rootClientId:r})})}));var iS=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})}),lS=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})}),rS=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})});const sS=[];function aS(e){return(0,et.jsx)(le.ToolbarGroup,{children:(0,et.jsx)(le.ToolbarButton,{...e})})}function cS({clientId:e,as:t=aS}){const{categories:n,patterns:o,patternName:i}=(0,h.useSelect)((t=>{var n,o;const{getBlockAttributes:i,getBlockRootClientId:l,__experimentalGetAllowedPatterns:r}=t(ba),s=i(e),a=(null==s||null===(n=s.metadata)||void 0===n?void 0:n.categories)||sS,c=null==s||null===(o=s.metadata)||void 0===o?void 0:o.patternName,u=l(e);return{categories:a,patterns:a.length>0?r(u):sS,patternName:c}}),[e]),{replaceBlocks:l}=(0,h.useDispatch)(ba),r=(0,p.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)})):sS),[n,o]);if(r.length<2)return null;const s=t;return(0,et.jsx)(s,{label:(0,vt.__)("Shuffle"),icon:rS,className:"block-editor-block-toolbar-shuffle",onClick:()=>{const t=function(){const e=r.length,t=r.findIndex((({name:e})=>e===i));return r[t+1<e?t+1:0]}();t.blocks[0].attributes={...t.blocks[0].attributes,metadata:{...t.blocks[0].attributes.metadata,categories:n}},l(e,t.blocks)}})}function uS({clientId:e,__unstableContentRef:t}){const n=(0,h.useSelect)((t=>{const{getBlock:n,hasBlockMovingClientId:o,getNextBlockClientId:i,getPreviousBlockClientId:l,canRemoveBlock:r,canMoveBlock:s,getSettings:a}=t(ba),{__experimentalSetIsInserterOpened:c}=a(),{getBlockType:u}=t(d.store),{name:p}=n(e),h=u(p),g="core/template-part"===(null==h?void 0:h.name);let m=!1;const f=i();if(f){const{name:e}=n(f),t=u(e);m="core/template-part"===(null==t?void 0:t.name)}let v=!1;const b=l();if(b){const{name:e}=n(b),t=u(e);v="core/template-part"===(null==t?void 0:t.name)}return{blockMovingMode:o(),isBlockTemplatePart:g,isNextBlockTemplatePart:m,isPrevBlockTemplatePart:v,canRemove:r(e),canMove:s(e),setIsInserterOpened:c}}),[e]),{blockMovingMode:o,isBlockTemplatePart:i,isNextBlockTemplatePart:l,isPrevBlockTemplatePart:r,canRemove:s,canMove:a,setIsInserterOpened:c}=n,{removeBlock:p,__unstableSetEditorMode:g,resetZoomLevel:m}=fe((0,h.useDispatch)(ba)),f=u("zoom-out-toolbar",{"is-block-moving-mode":!!o}),v=a&&!i;return(0,et.jsxs)(Qx,{className:f/* translators: accessibility text for the block toolbar */,"aria-label":(0,vt.__)("Block tools","kubio"),variant:"unstyled",orientation:"vertical",children:[v&&(0,et.jsx)(ry,{clientIds:[e],children:e=>(0,et.jsx)(le.Button,{icon:Mp,className:"block-selection-button_drag-handle zoom-out-toolbar-button",label:(0,vt.__)("Drag","kubio"),iconSize:24,size:"compact",tabIndex:"-1",...e})}),!i&&(0,et.jsx)(by,{clientIds:[e],hideDragHandle:!0,isBlockMoverUpButtonDisabled:r,isBlockMoverDownButtonDisabled:l,iconSize:24,size:"compact"}),a&&s&&(0,et.jsx)(cS,{clientId:e,as:le.ToolbarButton}),!i&&(0,et.jsx)(le.ToolbarButton,{className:"zoom-out-toolbar-button",icon:iS,label:(0,vt.__)("Edit","kubio"),onClick:()=>{var e;"function"==typeof c&&c(!1),g("pencil"),m(),null===(e=t.current)||void 0===e||e.focus()}}),s&&!i&&(0,et.jsx)(le.ToolbarButton,{className:"zoom-out-toolbar-button",icon:lS,label:(0,vt.__)("Delete","kubio"),onClick:()=>{p(e)}})]})}function dS({clientId:e,__unstableContentRef:t}){const{capturingClientId:n,isInsertionPointVisible:o,lastClientId:i}=iy(e),l={...oy({contentElement:null==t?void 0:t.current,clientId:e}),placement:"left-start",flip:!1,shift:!0};return(0,et.jsx)(p_,{clientId:n||e,bottomClientId:i,className:u("zoom-out-toolbar-popover",{"is-insertion-point-visible":o}),resize:!1,...l,children:(0,et.jsx)(uS,{__unstableContentRef:t,clientId:e})})}const pS=function({isVisible:e,onClick:t}){const[n,o]=(0,p.useState)(!1);return(0,et.jsx)(le.Button,{variant:"primary",icon:gp,size:"compact",className:u("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,vt._x)("Add pattern","Generic label for pattern inserter button")})},hS=function(){const[e,t]=(0,p.useState)(!1),{hasSelection:n,blockInsertionPoint:o,blockOrder:i,blockInsertionPointVisible:l,setInserterIsOpened:r,sectionRootClientId:s,selectedBlockClientId:a,hoveredBlockClientId:c}=(0,h.useSelect)((e=>{const{getSettings:t,getBlockInsertionPoint:n,getBlockOrder:o,getSelectionStart:i,getSelectedBlockClientId:l,getHoveredBlockClientId:r,isBlockInsertionPointVisible:s,getSectionRootClientId:a}=fe(e(ba)),c=a();return{hasSelection:!!i().clientId,blockInsertionPoint:n(),blockOrder:o(c),blockInsertionPointVisible:s(),sectionRootClientId:c,setInserterIsOpened:t().__experimentalSetIsInserterOpened,selectedBlockClientId:l(),hoveredBlockClientId:r()}}),[]),{showInsertionPoint:u}=(0,h.useDispatch)(ba);return(0,p.useEffect)((()=>{const e=setTimeout((()=>{t(!0)}),500);return()=>{clearTimeout(e)}}),[]),e?[void 0,...i].map(((e,t)=>{const d=l&&o.index===t,p=e,h=i[t],g=n&&(a===p||a===h),m=c===p||c===h;return(0,et.jsx)(Gk,{previousClientId:p,nextClientId:h,children:!d&&(0,et.jsx)(pS,{isVisible:g||m,onClick:()=>{r({rootClientId:s,insertionIndex:t,tab:"patterns",category:"all"}),u(s,t,{operation:"insert"})}})},t)})):null};function gS(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getSettings:o,__unstableGetEditorMode:i,isTyping:l}=e(ba),r=t()||n(),s=i();return{clientId:r,hasFixedToolbar:o().hasFixedToolbar,isTyping:l(),isZoomOutMode:"zoom-out"===s}}function mS({children:e,__unstableContentRef:t,...n}){const{clientId:o,hasFixedToolbar:i,isTyping:l,isZoomOutMode:r}=(0,h.useSelect)(gS,[]),s=(0,oh.__unstableUseShortcutEventMatch)(),{getBlocksByClientId:a,getSelectedBlockClientIds:c,getBlockRootClientId:u,isGroupable:g}=(0,h.useSelect)(ba),{getGroupingBlockName:m}=(0,h.useSelect)(d.store),{showEmptyBlockSideInserter:f,showBreadcrumb:v,showBlockToolbarPopover:b,showZoomOutToolbar:k}=(0,h.useSelect)((e=>{const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlock:o,getBlockMode:i,getSettings:l,hasMultiSelection:r,__unstableGetEditorMode:s,isTyping:a}=e(ba),c=t()||n(),u=o(c),p=s(),h=!!c&&!!u,g=h&&(0,d.isUnmodifiedDefaultBlock)(u)&&"html"!==i(c),m=c&&!a()&&"edit"===p&&g,f=h&&!r()&&"navigation"===p;return{showEmptyBlockSideInserter:m,showBreadcrumb:!m&&f,showBlockToolbarPopover:h&&!f,showZoomOutToolbar:!1}}),[]),{clearSelectedBlock:_,duplicateBlocks:y,removeBlocks:x,replaceBlocks:S,insertAfterBlock:w,insertBeforeBlock:C,selectBlock:B,moveBlocksUp:I,moveBlocksDown:j,expandBlock:E}=fe((0,h.useDispatch)(ba)),T=(0,p.useRef)(),P=Vk(t),M=Vk(t);return(0,et.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=c();if(t.length){e.preventDefault();const n=u(t[0]);I(t,n)}}else if(s("core/block-editor/move-down",e)){const t=c();if(t.length){e.preventDefault();const n=u(t[0]);j(t,n)}}else if(s("core/block-editor/duplicate",e)){const t=c();t.length&&(e.preventDefault(),y(t))}else if(s("core/block-editor/remove",e)){const t=c();t.length&&(e.preventDefault(),x(t))}else if(s("core/block-editor/insert-after",e)){const t=c();t.length&&(e.preventDefault(),w(t[t.length-1]))}else if(s("core/block-editor/insert-before",e)){const t=c();t.length&&(e.preventDefault(),C(t[0]))}else if(s("core/block-editor/unselect",e)){if(e.target.closest("[role=toolbar]"))return;const n=c();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=dp(t.current))||void 0===i||i.focus()}}else if(s("core/block-editor/collapse-list-view",e)){var l,r,p;if((0,Ih.isTextField)(e.target)||(0,Ih.isTextField)(null===(l=e.target)||void 0===l||null===(r=l.contentWindow)||void 0===r||null===(p=r.document)||void 0===p?void 0:p.activeElement))return;e.preventDefault(),E(o)}else if(s("core/block-editor/group",e)){const t=c();if(t.length>1&&g(t)){e.preventDefault();const n=a(t),o=m(),i=(0,d.switchToBlockType)(n,o);S(t,i),(0,gr.speak)((0,vt.__)("Selected blocks are grouped."))}}},children:(0,et.jsxs)($k.Provider,{value:(0,p.useRef)(!1),children:[!l&&!r&&(0,et.jsx)(qk,{__unstableContentRef:t}),f&&(0,et.jsx)(ly,{__unstableContentRef:t,clientId:o}),b&&(0,et.jsx)(tS,{__unstableContentRef:t,clientId:o,isTyping:l}),v&&(0,et.jsx)(oS,{ref:T,__unstableContentRef:t,clientId:o}),k&&(0,et.jsx)(dS,{__unstableContentRef:t,clientId:o}),!r&&!i&&(0,et.jsx)(le.Popover.Slot,{name:"block-toolbar",ref:P}),e,(0,et.jsx)(le.Popover.Slot,{name:"__unstable-block-tools-after",ref:M}),r&&(0,et.jsx)(hS,{__unstableContentRef:t})]})})}const fS=window.wp.commands;var vS=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7zm-5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h1V9H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-1h-1.5v1z"})});const bS=()=>function(){const{replaceBlocks:e,multiSelect:t}=(0,h.useDispatch)(ba),{blocks:n,clientIds:o,canRemove:i,possibleBlockTransformations:l,invalidSelection:r}=(0,h.useSelect)((e=>{const{getBlockRootClientId:t,getBlockTransformItems:n,getSelectedBlockClientIds:o,getBlocksByClientId:i,canRemoveBlocks:l}=e(ba),r=o(),s=i(r);return s.filter((e=>!e)).length>0?{invalidSelection:!0}:{blocks:s,clientIds:r,possibleBlockTransformations:n(s,t(r[0])),canRemove:l(r),invalidSelection:!1}}),[]);if(r)return{isLoading:!1,commands:[]};const s=1===n.length&&(0,d.isTemplatePart)(n[0]);const a=!!l.length&&i&&!s;return!o||o.length<1||!a?{isLoading:!1,commands:[]}:{isLoading:!1,commands:l.map((i=>{const{name:l,title:r,icon:s}=i,a=null!=s&&s.src&&"block-default"!==(null==s?void 0:s.src)?s:{src:xc};return{name:"core/block-editor/transform-to-"+l.replace("/","-"),/* translators: %s: Block or block variation name. */label:(0,vt.sprintf)((0,vt.__)("Transform to %s"),r),icon:null==a?void 0:a.src,category:"command",callback:({close:i})=>{(function(i){const l=(0,d.switchToBlockType)(n,i);var r;e(o,l),(r=l).length>1&&t(r[0].clientId,r[r.length-1].clientId)})(l),i()}}}))}},kS=()=>{(0,fS.useCommandLoader)({name:"core/block-editor/blockTransforms",hook:bS()}),(0,fS.useCommandLoader)({name:"core/block-editor/blockQuickActions",hook:function(){const{clientIds:e,isUngroupable:t,isGroupable:n}=(0,h.useSelect)((e=>{const{getSelectedBlockClientIds:t,isUngroupable:n,isGroupable:o}=e(ba);return{clientIds:t(),isUngroupable:n(),isGroupable:o()}}),[]),{canInsertBlockType:o,getBlockRootClientId:i,getBlocksByClientId:l,canRemoveBlocks:r,isBlockHiddenAnywhere:s}=fe((0,h.useSelect)(ba)),{getBlockEditingMode:a}=(0,h.useSelect)(ba),{getDefaultBlockName:c,getGroupingBlockName:u}=(0,h.useSelect)(d.store),p=l(e),g=(0,h.useDispatch)(ba),{removeBlocks:m,replaceBlocks:f,duplicateBlocks:v,insertAfterBlock:b,insertBeforeBlock:k}=g;if(!e||e.length<1)return{isLoading:!1,commands:[]};const{showViewportModal:_}=fe(g),y=i(e[0]),x=o(c(),y),S=p.every((e=>!!e&&(0,d.hasBlockSupport)(e.name,"multiple",!0)&&o(e.name,y))),w=r(e),C=[];S&&C.push({name:"duplicate",label:(0,vt.__)("Duplicate"),callback:()=>v(e,!0),icon:_y}),x&&C.push({name:"add-before",label:(0,vt.__)("Add before"),callback:()=>{const t=Array.isArray(e)?e[0]:t;k(t)},icon:gp},{name:"add-after",label:(0,vt.__)("Add after"),callback:()=>{const t=Array.isArray(e)?e[e.length-1]:t;b(t)},icon:gp}),n&&C.push({name:"Group",label:(0,vt.__)("Group"),callback:()=>{if(!p.length)return;const t=u(),n=(0,d.switchToBlockType)(p,t);n&&f(e,n)},icon:px}),t&&C.push({name:"ungroup",label:(0,vt.__)("Ungroup"),callback:()=>{if(!p.length)return;const t=p[0].innerBlocks;t.length&&f(e,t)},icon:vS}),w&&C.push({name:"remove",label:(0,vt.__)("Delete"),callback:()=>m(e,!0),icon:lS});const B=p.every((e=>!!e&&(0,d.hasBlockSupport)(e.name,"visibility",!0))),I=e.every((e=>"default"===a(e)));if(B&&I){const t=e.some((e=>s(e)));C.push({name:"toggle-visibility",label:t?(0,vt.__)("Show"):(0,vt.__)("Hide"),callback:()=>_(e),icon:t?Pk:Tk})}return{isLoading:!1,commands:C.map((e=>({...e,name:"core/block-editor/action-"+e.name,category:"command",callback:({close:t})=>{e.callback(),t()}})))}},context:"block-selection-edit"})},_S=(0,le.createSlotFill)(Symbol("BlockCanvasCover"));function yS({children:e}){return(0,et.jsx)("div",{className:"block-canvas-cover",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none"},children:e})}const xS={ignoredSelectors:[/\.editor-styles-wrapper/gi]};function SS({shouldIframe:e=!0,height:t="300px",children:n=(0,et.jsx)(s_,{}),styles:o,contentRef:i,iframeProps:l}){kS();const r=(0,g.useViewportMatch)("medium","<"),s=Nm(),a=Sh(),c=(0,p.useRef)(),u=(0,g.useMergeRefs)([i,a,c]),d=(0,h.useSelect)((e=>fe(e(ba)).getZoomLevel()),[]),m=100===d||r?{}:{scale:d,frameSize:"40px"};return e?(0,et.jsx)(mS,{__unstableContentRef:c,style:{height:t,display:"flex"},children:(0,et.jsxs)(ig,{...l,...m,ref:s,contentRef:u,style:{...null==l?void 0:l.style},name:"editor-canvas",children:[(0,et.jsx)(_S.Slot,{fillProps:{containerRef:c},children:e=>e.map(((e,t)=>(0,et.jsx)(yS,{children:e},t)))}),(0,et.jsx)(rg,{styles:o}),n]})}):(0,et.jsxs)(mS,{__unstableContentRef:c,style:{height:t,display:"flex"},children:[(0,et.jsx)(_S.Slot,{fillProps:{containerRef:c},children:e=>e.map(((e,t)=>(0,et.jsx)(yS,{children:e},t)))}),(0,et.jsx)(rg,{styles:o,scope:":where(.editor-styles-wrapper)",transformOptions:xS}),(0,et.jsx)(Jh,{ref:u,className:"editor-styles-wrapper",tabIndex:-1,style:{height:"100%",width:"100%",overflow:"auto"},children:n})]})}const wS=function({children:e,height:t,styles:n}){return(0,et.jsx)(SS,{height:t,styles:n,children:e})},CS=()=>(0,et.jsx)(le.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:(0,et.jsx)(le.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"})}),BS=({style:e,className:t})=>(0,et.jsx)("div",{className:"block-library-colors-selector__icon-container",children:(0,et.jsx)("div",{className:`${t} block-library-colors-selector__state-selection`,style:e,children:(0,et.jsx)(CS,{})})}),IS=({TextColor:e,BackgroundColor:t})=>function({onToggle:n,isOpen:o}){return(0,et.jsx)(le.ToolbarGroup,{children:(0,et.jsx)(le.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,vt.__)("Open Colors Selector","kubio"),onClick:n,onKeyDown:e=>{o||e.keyCode!==Jd.DOWN||(e.preventDefault(),n())},icon:(0,et.jsx)(t,{children:(0,et.jsx)(e,{children:(0,et.jsx)(BS,{})})})})})},jS=({children:e,...t})=>(Je()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,et.jsx)(le.Dropdown,{popoverProps:{placement:"bottom-start"},className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:IS(t),renderContent:()=>e}));var ES=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})});const TS=(0,p.createContext)({}),PS=()=>(0,p.useContext)(TS);function MS({children:e,...t}){const n=(0,p.useRef)();return(0,p.useEffect)((()=>{n.current&&(n.current.textContent=n.current.textContent)}),[e]),(0,et.jsx)("div",{hidden:!0,...t,ref:n,children:e})}const RS=(0,p.forwardRef)((({nestingLevel:e,blockCount:t,clientId:n,...o},i)=>{const{insertedBlock:l,setInsertedBlock:r}=PS(),s=(0,g.useInstanceId)(RS),a=(0,h.useSelect)((e=>{const{getTemplateLock:t,__unstableGetEditorMode:o}=e(ba);return!!t(n)||"zoom-out"===o()}),[n]),c=ip({clientId:n,context:"list-view"}),u=ip({clientId:null==l?void 0:l.clientId,context:"list-view"});if((0,p.useEffect)((()=>{null!=u&&u.length&&(0,gr.speak)((0,vt.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,vt.__)("%s block inserted"),u),"assertive")}),[u]),a)return null;const d=`list-view-appender__${s}`,m=(0,vt.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,vt.__)("Append to %1$s block at position %2$d, Level %3$d"),c,t+1,e);return(0,et.jsxs)("div",{className:"list-view-appender",children:[(0,et.jsx)(Jg,{ref:i,rootClientId:n,position:"bottom right",isAppender:!0,selectBlockOnInsert:!1,shouldDirectInsert:!1,__experimentalIsQuick:!0,...o,toggleProps:{"aria-describedby":d},onSelectOrClose:e=>{null!=e&&e.clientId&&r(e)}}),(0,et.jsx)(MS,{id:d,children:m})]})})),NS=vk(le.__experimentalTreeGridRow),LS=(0,p.forwardRef)((({isDragged:e,isSelected:t,position:n,level:o,rowCount:i,children:l,className:r,path:s,...a},c)=>{const d=kk({clientId:a["data-block"],enableAnimation:!0,triggerAnimationOnChange:s}),p=(0,g.useMergeRefs)([c,d]);return(0,et.jsx)(NS,{ref:p,className:u("block-editor-list-view-leaf",r),level:o,positionInSet:n,setSize:i,isExpanded:void 0,...a,children:l})})),AS=LS;var DS=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})}),OS=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})}),zS=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})});function VS({onClick:e}){return(0,et.jsx)("span",{className:"block-editor-list-view__expander",onClick:t=>e(t,{forceToggle:!0}),"aria-hidden":"true","data-testid":"list-view-expander",children:(0,et.jsx)(jc,{icon:(0,vt.isRTL)()?zS:op})})}function FS(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 HS=(0,p.forwardRef)((function({className:e,block:{clientId:t},onClick:n,onContextMenu:o,onMouseDown:i,onToggleExpanded:l,tabIndex:r,onFocus:s,onDragStart:a,onDragEnd:c,draggable:d,isExpanded:g,ariaDescribedBy:m},f){const v=F_(t),b=ip({clientId:t,context:"list-view"}),{isLocked:k}=xx(t),{isContentOnly:_}=(0,h.useSelect)((e=>({isContentOnly:"contentOnly"===e(ba).getBlockEditingMode(t)})),[t]),y=k&&!_,x="sticky"===(null==v?void 0:v.positionType),S=function({clientId:e,isExpanded:t}){const{block:n}=(0,h.useSelect)((t=>({block:t(ba).getBlock(e)})),[e]);return(0,p.useMemo)((()=>function(e,t){const n=FS(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=FS(n);if(e&&t.push(e),t.length>=3)return t}return t}(e)}(n,t)),[n,t])}({clientId:t,isExpanded:g});return(0,et.jsxs)(le.Button,{__next40pxDefaultSize:!1,className:u("block-editor-list-view-block-select-button",e),onClick:n,onContextMenu:o,onKeyDown:function(e){e.keyCode!==Jd.ENTER&&e.keyCode!==Jd.SPACE||n(e)},onMouseDown:i,ref:f,tabIndex:r,onFocus:s,onDragStart:e=>{e.dataTransfer.clearData(),null==a||a(e)},onDragEnd:c,draggable:d,href:`#block-${t}`,"aria-describedby":m,"aria-expanded":g,children:[(0,et.jsx)(VS,{onClick:l}),(0,et.jsx)(Sc,{icon:null==v?void 0:v.icon,showColors:!0,context:"list-view"}),(0,et.jsxs)(le.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:[(0,et.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,et.jsx)(le.__experimentalTruncate,{ellipsizeMode:"auto",children:b})}),(null==v?void 0:v.anchor)&&(0,et.jsx)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper",children:(0,et.jsx)(le.__experimentalTruncate,{className:"block-editor-list-view-block-select-button__anchor",ellipsizeMode:"auto",children:v.anchor})}),x&&(0,et.jsx)("span",{className:"block-editor-list-view-block-select-button__sticky",children:(0,et.jsx)(jc,{icon:DS})}),S.length?(0,et.jsx)("span",{className:"block-editor-list-view-block-select-button__images","aria-hidden":!0,children:S.map(((e,t)=>(0,et.jsx)("span",{className:"block-editor-list-view-block-select-button__image",style:{backgroundImage:`url(${e.url})`,zIndex:S.length-t}},e.clientId)))}):null,y&&(0,et.jsx)("span",{className:"block-editor-list-view-block-select-button__lock",children:(0,et.jsx)(jc,{icon:OS})})]})]})})),GS=(0,p.forwardRef)((({onClick:e,onToggleExpanded:t,block:n,isSelected:o,position:i,siblingBlockCount:l,level:r,isExpanded:s,selectedClientIds:a,...c},d)=>{const{clientId:p}=n,{blockMovingClientId:g,selectedBlockInBlockEditor:m}=(0,h.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(ba);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[]),{AdditionalBlockContent:f,insertedBlock:v,setInsertedBlock:b}=PS(),k=u("block-editor-list-view-block-contents",{"is-dropping-before":g&&m===p}),_=a.includes(p)?a:[p];return(0,et.jsxs)(et.Fragment,{children:[f&&(0,et.jsx)(f,{block:n,insertedBlock:v,setInsertedBlock:b}),(0,et.jsx)(ry,{appendToOwnerDocument:!0,clientIds:_,cloneClassname:"block-editor-list-view-draggable-chip",children:({draggable:a,onDragStart:u,onDragEnd:p})=>(0,et.jsx)(HS,{ref:d,className:k,block:n,onClick:e,onToggleExpanded:t,isSelected:o,position:i,siblingBlockCount:l,level:r,draggable:a,onDragStart:u,onDragEnd:p,isExpanded:s,...c})})]})})),$S=GS;function US(e,t){const n=()=>{const n=null==t?void 0:t.querySelector(`[role=row][data-block="${e}"]`);return n?Ih.focus.focusable.find(n)[0]:null};let o=n();o?o.focus():window.requestAnimationFrame((()=>{o=n(),o&&o.focus()}))}const WS="function"==typeof cm()?cm():cm().isShallowEqual,KS=(0,p.memo)((function e({block:{clientId:t},displacement:n,isAfterDraggedBlocks:o,isDragged:i,isNesting:l,isSelected:r,isBranchSelected:s,selectBlock:a,position:c,level:m,rowCount:f,siblingBlockCount:v,showBlockMovers:b,path:k,isExpanded:_,selectedClientIds:y,isSyncedBranch:x}){const S=(0,p.useRef)(null),w=(0,p.useRef)(null),C=(0,p.useRef)(null),[B,I]=(0,p.useState)(!1),[j,E]=(0,p.useState)(),{isLocked:T,canEdit:P,canMove:M}=xx(t),R=r&&y[0]===t,N=r&&y[y.length-1]===t,{toggleBlockHighlight:L,duplicateBlocks:A,multiSelect:D,replaceBlocks:O,removeBlocks:z,insertAfterBlock:V,insertBeforeBlock:F,setOpenedBlockSettingsMenu:H}=fe((0,h.useDispatch)(ba)),{canInsertBlockType:G,getSelectedBlockClientIds:$,getPreviousBlockClientId:U,getBlockRootClientId:W,getBlockOrder:K,getBlockParents:Z,getBlocksByClientId:q,canRemoveBlocks:Y,isGroupable:Q}=(0,h.useSelect)(ba),{getGroupingBlockName:X}=(0,h.useSelect)(d.store),J=F_(t),{block:ee,blockName:te,allowRightClickOverrides:ne}=(0,h.useSelect)((e=>{const{getBlock:n,getBlockName:o,getSettings:i}=e(ba);return{block:n(t),blockName:o(t),allowRightClickOverrides:i().allowRightClickOverrides}}),[t]),oe=(0,d.hasBlockSupport)(te,"__experimentalToolbar",!0),ie=`list-view-block-select-button__description-${(0,g.useInstanceId)(e)}`,{expand:re,collapse:se,collapseAll:ae,BlockSettingsMenu:ce,listViewInstanceId:ue,expandedState:de,setInsertedBlock:pe,treeGridElementRef:he,rootClientId:ge}=PS(),me=(0,oh.__unstableUseShortcutEventMatch)();function ve(){const e=$(),n=e.includes(t),o=n?e[0]:t,i=W(o);return{blocksToUpdate:n?e:[t],firstBlockClientId:o,firstBlockRootClientId:i,selectedBlockClientIds:e}}const be=(0,p.useCallback)((()=>{I(!0),L(t,!0)}),[t,I,L]),ke=(0,p.useCallback)((()=>{I(!1),L(t,!1)}),[t,I,L]),_e=(0,p.useCallback)((e=>{a(e,t),e.preventDefault()}),[t,a]),ye=(0,p.useCallback)(((e,t)=>{t&&a(void 0,e,null,null),US(e,null==he?void 0:he.current)}),[a,he]),xe=(0,p.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===_?se(t):!1===_&&re(t)}),[t,re,se,_]),Se=(0,p.useCallback)((e=>{var t;oe&&ne&&(null===(t=C.current)||void 0===t||t.click(),E(new window.DOMRect(e.clientX,e.clientY,0,0)),e.preventDefault())}),[ne,C,oe]),we=(0,p.useCallback)((e=>{ne&&2===e.button&&e.preventDefault()}),[ne]),Ce=(0,p.useMemo)((()=>{const{ownerDocument:e}=(null==w?void 0:w.current)||{};if(j&&e)return{ownerDocument:e,getBoundingClientRect:()=>j}}),[j]),Be=(0,p.useCallback)((()=>{E(void 0)}),[E]);if(function({isSelected:e,selectedClientIds:t,rowItemRef:n}){const o=1===t.length;(0,p.useLayoutEffect)((()=>{if(!e||!o||!n.current)return;const t=(0,Ih.getScrollContainer)(n.current),{ownerDocument:i}=n.current;if(t===i.body||t===i.documentElement||!t)return;const l=n.current.getBoundingClientRect(),r=t.getBoundingClientRect();(l.top<r.top||l.bottom>r.bottom)&&n.current.scrollIntoView()}),[e,o,n])}({isSelected:r,rowItemRef:w,selectedClientIds:y}),!ee)return null;const Ie=((e,t,n)=>(0,vt.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,vt.__)("Block %1$d of %2$d, Level %3$d."),e,t,n))(c,v,m),je=((e,t)=>[null!=e&&e.positionLabel?`${(0,vt.sprintf)(// translators: %s: Position of selected block, e.g. "Sticky" or "Fixed".
// translators: %s: Position of selected block, e.g. "Sticky" or "Fixed".
(0,vt.__)("Position: %s"),e.positionLabel)}.`:void 0,t?(0,vt.__)("This block is locked."):void 0].filter(Boolean).join(" "))(J,T),Ee=b&&v>0,Te=u("block-editor-list-view-block__mover-cell",{"is-visible":B||r}),Pe=u("block-editor-list-view-block__menu-cell",{"is-visible":B||R});let Me;Ee?Me=2:oe||(Me=3);const Re=u({"is-selected":r,"is-first-selected":R,"is-last-selected":N,"is-branch-selected":s,"is-synced-branch":x,"is-dragging":i,"has-single-cell":!oe,"is-synced":null==J?void 0:J.isSynced,"is-draggable":M,"is-displacement-normal":"normal"===n,"is-displacement-up":"up"===n,"is-displacement-down":"down"===n,"is-after-dragged-blocks":o,"is-nesting":l}),Ne=y.includes(t)?y:[t],Le=r&&1===y.length;return(0,et.jsxs)(AS,{className:Re,isDragged:i,onKeyDown:async function(e){if(e.defaultPrevented)return;if(e.target.closest("[role=dialog]"))return;const t=[Jd.BACKSPACE,Jd.DELETE].includes(e.keyCode);if(me("core/block-editor/unselect",e)&&y.length>0)e.stopPropagation(),e.preventDefault(),a(e,void 0);else if(t||me("core/block-editor/remove",e)){const{blocksToUpdate:e,firstBlockClientId:t,firstBlockRootClientId:n,selectedBlockClientIds:o}=ve();if(!Y(e))return;let i=U(t)??n;z(e,!1);const l=o.length>0&&0===$().length;i||(i=K()[0]),ye(i,l)}else if(me("core/block-editor/duplicate",e)){e.preventDefault();const{blocksToUpdate:t,firstBlockRootClientId:n}=ve();if(q(t).every((e=>!!e&&(0,d.hasBlockSupport)(e.name,"multiple",!0)&&G(e.name,n)))){const e=await A(t,!1);null!=e&&e.length&&ye(e[0],!1)}}else if(me("core/block-editor/insert-before",e)){e.preventDefault();const{blocksToUpdate:t}=ve();await F(t[0]);const n=$();H(void 0),ye(n[0],!1)}else if(me("core/block-editor/insert-after",e)){e.preventDefault();const{blocksToUpdate:t}=ve();await V(t.at(-1));const n=$();H(void 0),ye(n[0],!1)}else if(me("core/block-editor/select-all",e)){e.preventDefault();const{firstBlockRootClientId:t,selectedBlockClientIds:n}=ve(),o=K(t);if(!o.length)return;if(WS(n,o)&&t&&t!==ge)return void ye(t,!0);D(o[0],o[o.length-1],null)}else if(me("core/block-editor/collapse-list-view",e)){e.preventDefault();const{firstBlockClientId:t}=ve(),n=Z(t,!1);ae(),re(n)}else if(me("core/block-editor/group",e)){const{blocksToUpdate:t}=ve();if(t.length>1&&Q(t)){e.preventDefault();const n=q(t),o=X(),i=(0,d.switchToBlockType)(n,o);O(t,i),(0,gr.speak)((0,vt.__)("Selected blocks are grouped.","kubio"));const l=$();H(void 0),ye(l[0],!1)}}},onMouseEnter:be,onMouseLeave:ke,onFocus:be,onBlur:ke,level:m,position:c,rowCount:f,path:k,id:`list-view-${ue}-block-${t}`,"data-block":t,"data-expanded":P?_:void 0,ref:w,children:[(0,et.jsx)(le.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:Me,ref:S,"aria-selected":!!r,children:({ref:e,tabIndex:t,onFocus:n})=>(0,et.jsxs)("div",{className:"block-editor-list-view-block__contents-container",children:[(0,et.jsx)($S,{block:ee,onClick:_e,onContextMenu:Se,onMouseDown:we,onToggleExpanded:xe,isSelected:r,position:c,siblingBlockCount:v,level:m,ref:e,tabIndex:Le?0:t,onFocus:n,isExpanded:P?_:void 0,selectedClientIds:y,ariaDescribedBy:ie}),(0,et.jsx)(MS,{id:ie,children:[Ie,je].filter(Boolean).join(" ")})]})}),Ee&&(0,et.jsx)(et.Fragment,{children:(0,et.jsxs)(le.__experimentalTreeGridCell,{className:Te,withoutGridItem:!0,children:[(0,et.jsx)(le.__experimentalTreeGridItem,{children:({ref:e,tabIndex:n,onFocus:o})=>(0,et.jsx)(fy,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:o})}),(0,et.jsx)(le.__experimentalTreeGridItem,{children:({ref:e,tabIndex:n,onFocus:o})=>(0,et.jsx)(vy,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:o})})]})}),oe&&ce&&(0,et.jsx)(le.__experimentalTreeGridCell,{className:Pe,"aria-selected":!!r,ref:C,children:({ref:e,tabIndex:t,onFocus:n})=>(0,et.jsx)(ce,{clientIds:Ne,block:ee,icon:_a,label:(0,vt.__)("Options","kubio"),popoverProps:{anchor:Ce},toggleProps:{ref:e,className:"block-editor-list-view-block__menu",tabIndex:t,onClick:Be,onFocus:n},disableOpenOnArrowDown:!0,expand:re,expandedState:de,setInsertedBlock:pe,__experimentalSelectBlock:ye})})]})}));function ZS(e,t,n,o){return(null==n?void 0:n.includes(e.clientId))?0:t[e.clientId]??o?1+e.innerBlocks.reduce(qS(t,n,o),0):1}const qS=(e,t,n)=>(o,i)=>(null==t?void 0:t.includes(i.clientId))?o:(e[i.clientId]??n)&&i.innerBlocks.length>0?o+ZS(i,e,t,n):o+1,YS=()=>{},QS=(0,p.memo)((function e(t){const{blocks:n,selectBlock:o=YS,showBlockMovers:i,selectedClientIds:l,level:r=1,path:s="",isBranchSelected:a=!1,listPosition:c=0,fixedListWindow:u,isExpanded:d,parentId:p,shouldShowInnerBlocks:g=!0,isSyncedBranch:m=!1,showAppender:f=!0}=t,v=F_(p),b=m||!(null==v||!v.isSynced),k=(0,h.useSelect)((e=>!p||e(ba).canEditBlock(p)),[p]),{blockDropPosition:_,blockDropTargetIndex:y,firstDraggedBlockIndex:x,blockIndexes:S,expandedState:w,draggedClientIds:C}=PS();if(!k)return null;const B=f&&1===r,I=n.filter(Boolean),j=I.length,E=B?j+1:j;let T=c;return(0,et.jsxs)(et.Fragment,{children:[I.map(((t,n)=>{const{clientId:c,innerBlocks:p}=t;n>0&&(T+=ZS(I[n-1],w,C,d));const m=!(null==C||!C.includes(c)),{displacement:f,isAfterDraggedBlocks:v,isNesting:k}=function({blockIndexes:e,blockDropTargetIndex:t,blockDropPosition:n,clientId:o,firstDraggedBlockIndex:i,isDragged:l}){let r,s,a;if(!l){s=!1;const l=e[o];a=l>i,null!=t&&void 0!==i?void 0!==l&&(r=l>=i&&l<t?"up":l<i&&l>=t?"down":"normal",s="number"==typeof t&&t-1===l&&"inside"===n):null===t&&void 0!==i?r=void 0!==l&&l>=i?"up":"normal":null!=t&&void 0===i?void 0!==l&&(r=l<t?"normal":"down"):null===t&&(r="normal")}return{displacement:r,isNesting:s,isAfterDraggedBlocks:a}}({blockIndexes:S,blockDropTargetIndex:y,blockDropPosition:_,clientId:c,firstDraggedBlockIndex:x,isDragged:m}),{itemInView:B}=u,P=B(T),M=n+1,R=s.length>0?`${s}_${M}`:`${M}`,N=!(null==p||!p.length),L=N&&g?w[c]??d:void 0,A=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(c,l),D=a||A&&N,O=m||P||A&&c===l[0]||0===n||n===j-1;return(0,et.jsxs)(h.AsyncModeProvider,{value:!A,children:[O&&(0,et.jsx)(KS,{block:t,selectBlock:o,isSelected:A,isBranchSelected:D,isDragged:m,level:r,position:M,rowCount:E,siblingBlockCount:j,showBlockMovers:i,path:R,isExpanded:!m&&L,listPosition:T,selectedClientIds:l,isSyncedBranch:b,displacement:f,isAfterDraggedBlocks:v,isNesting:k}),!O&&(0,et.jsx)("tr",{children:(0,et.jsx)("td",{className:"block-editor-list-view-placeholder"})}),N&&L&&!m&&(0,et.jsx)(e,{parentId:c,blocks:p,selectBlock:o,showBlockMovers:i,level:r+1,path:R,listPosition:T+1,fixedListWindow:u,isBranchSelected:D,selectedClientIds:l,isExpanded:d,isSyncedBranch:b})]},c)})),B&&(0,et.jsx)(le.__experimentalTreeGridRow,{level:r,setSize:E,positionInSet:E,isExpanded:!0,children:(0,et.jsx)(le.__experimentalTreeGridCell,{children:e=>(0,et.jsx)(RS,{clientId:p,nestingLevel:r,blockCount:j,...e})})})]})}));function XS({draggedBlockClientId:e,listViewRef:t,blockDropTarget:n}){const o=F_(e),i=ip({clientId:e,context:"list-view"}),{rootClientId:l,clientId:r,dropPosition:s}=n||{},[a,c]=(0,p.useMemo)((()=>t.current?[l?t.current.querySelector(`[data-block="${l}"]`):void 0,r?t.current.querySelector(`[data-block="${r}"]`):void 0]:[]),[t,l,r]),d=c||a,h=(0,vt.isRTL)(),g=(0,p.useCallback)(((e,t)=>{if(!d)return 0;let n=d.offsetWidth;const o=(0,Ih.getScrollContainer)(d,"horizontal"),i=d.ownerDocument,l=o===i.body||o===i.documentElement;if(o&&!l){const i=o.getBoundingClientRect(),l=(0,vt.isRTL)()?i.right-e.right:e.left-i.left,r=o.clientWidth;if(r<n+l&&(n=r-l),!h&&e.left+t<i.left)return n-=i.left-e.left,n;if(h&&e.right-t>i.right)return n-=e.right-i.right,n}return n-t}),[h,d]),m=(0,p.useMemo)((()=>{if(!d)return{};const e=d.getBoundingClientRect();return{width:g(e,0)}}),[g,d]),f=(0,p.useMemo)((()=>{if(!d)return{};const e=(0,Ih.getScrollContainer)(d),t=d.ownerDocument,n=e===t.body||e===t.documentElement;if(e&&!n){const t=e.getBoundingClientRect(),n=d.getBoundingClientRect(),o=h?t.right-n.right:n.left-t.left;if(!h&&t.left>n.left)return{transform:`translateX( ${o}px )`};if(h&&t.right<n.right)return{transform:`translateX( ${-1*o}px )`}}return{}}),[h,d]),v=(0,p.useMemo)((()=>{if(!a)return 1;const e=parseInt(a.getAttribute("aria-level"),10);return e?e+1:1}),[a]),b=(0,p.useMemo)((()=>!!d&&d.classList.contains("is-branch-selected")),[d]),k=(0,p.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,Ih.getScrollContainer)(d,"horizontal"),i=d.ownerDocument,l=o===i.body||o===i.documentElement;if(o&&!l){const e=o.getBoundingClientRect(),n=h?o.offsetWidth-o.clientWidth:0;t<e.left+n&&(t=e.left+n)}n="top"===s?e.top-2*e.height:e.top;const r=g(e,0),a=e.height;return new window.DOMRect(t,n,r,a)}}}),[d,s,g,h]);return d?(0,et.jsx)(le.Popover,{animate:!1,anchor:k,focusOnMount:!1,className:"block-editor-list-view-drop-indicator--preview",variant:"unstyled",flip:!1,resize:!0,children:(0,et.jsx)("div",{style:m,className:u("block-editor-list-view-drop-indicator__line",{"block-editor-list-view-drop-indicator__line--darker":b}),children:(0,et.jsxs)("div",{className:"block-editor-list-view-leaf","aria-level":v,children:[(0,et.jsxs)("div",{className:u("block-editor-list-view-block-select-button","block-editor-list-view-block-contents"),style:f,children:[(0,et.jsx)(VS,{onClick:()=>{}}),(0,et.jsx)(Sc,{icon:null==o?void 0:o.icon,showColors:!0,context:"list-view"}),(0,et.jsx)(le.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:(0,et.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,et.jsx)(le.__experimentalTruncate,{ellipsizeMode:"auto",children:i})})})]}),(0,et.jsx)("div",{className:"block-editor-list-view-block__menu-cell"})]})})}):null}const JS=24;function ew(e,t){const n=e[t+1];return n&&n.isDraggedBlock?ew(e,t+1):n}const tw=["top","bottom"];function nw(e,t,n=!1){let o,i,l,r,s;for(let n=0;n<e.length;n++){const a=e[n];if(a.isDraggedBlock)continue;const c=a.element.getBoundingClientRect(),[u,d]=fm(t,c,tw),p=vm(t,c);if(void 0===l||u<l||p){l=u;const t=e.indexOf(a),n=e[t-1];if("top"===d&&n&&n.rootClientId===a.rootClientId&&!n.isDraggedBlock?(i=n,o="bottom",r=n.element.getBoundingClientRect(),s=t-1):(i=a,o=d,r=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*JS:t.left+n*JS;return(o?e.x<i-JS:e.x>i+JS)&&e.y<t.bottom}(t,r,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*JS:t.left+n*JS;return o?e.x>i:e.x<i}(t,r,a.length,n)){const l=ew(e,s),c=i.nestingLevel,u=l?l.nestingLevel:1;if(c&&u){const d=function(e,t,n=1,o=!1){const i=o?t.right-n*JS:t.left+n*JS,l=o?i-e.x:e.x-i,r=Math.round(l/JS);return Math.abs(r)}(t,r,a.length,n),p=Math.max(Math.min(d,c-u),0);if(a[p]){let t=i.blockIndex;if(a[p].nestingLevel===(null==l?void 0:l.nestingLevel))t=null==l?void 0:l.blockIndex;else for(let n=s;n>=0;n--){const o=e[n];if(o.rootClientId===a[p].rootClientId){t=o.blockIndex+1;break}}return{rootClientId:a[p].rootClientId,clientId: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 ow={leading:!1,trailing:!0};const iw=(e,t)=>"clear"===t.type?{}:Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e,lw=(0,p.forwardRef)((function e({id:t,blocks:n,dropZoneElement:o,showBlockMovers:i=!1,isExpanded:l=!1,showAppender:r=!1,blockSettingsMenu:s=Gx,rootClientId:a,description:c,onSelect:m,additionalBlockContent:f},v){n&&Je()("`blocks` property in `wp.blockEditor.__experimentalListView`",{since:"6.3",alternative:"`rootClientId` property"});const b=(0,g.useInstanceId)(e),{clientIdsTree:k,draggedClientIds:_,selectedClientIds:y}=function({blocks:e,rootClientId:t}){return(0,h.useSelect)((n=>{const{getDraggedBlockClientIds:o,getSelectedBlockClientIds:i,getEnabledClientIdsTree:l}=fe(n(ba));return{selectedClientIds:i(),draggedClientIds:o(),clientIdsTree:e??l(t)}}),[e,t])}({blocks:n,rootClientId:a}),x=function(e){const t=(0,p.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}(k),{getBlock:S}=(0,h.useSelect)(ba),{visibleBlockCount:w}=(0,h.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(ba),o=(null==_?void 0:_.length)>0?n(_).length+1:0;return{visibleBlockCount:t()-o}}),[_]),{updateBlockSelection:C}=function(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,h.useDispatch)(ba),{getBlockName:o,getBlockParents:i,getBlockSelectionStart:l,getSelectedBlockClientIds:r,hasMultiSelection:s,hasSelectedBlock:a}=(0,h.useSelect)(ba),{getBlockType:c}=(0,h.useSelect)(d.store),u=(0,p.useCallback)((async(u,d,p,h)=>{if((null==u||!u.shiftKey)&&(null==u?void 0:u.keyCode)!==Jd.ESCAPE)return void n(d,h);u.preventDefault();const g="keydown"===u.type&&u.keyCode===Jd.ESCAPE,m="keydown"===u.type&&(u.keyCode===Jd.UP||u.keyCode===Jd.DOWN||u.keyCode===Jd.HOME||u.keyCode===Jd.END);if(!m&&!a()&&!s())return void n(d,null);const f=r(),v=[...i(d),d];if((g||m&&!f.some((e=>v.includes(e))))&&await e(),!g){let e=l(),n=d;m&&(a()||s()||(e=d),p&&(n=p));const o=i(e),r=i(n),{start:c,end:u}=function(e,t,n,o){const i=[...n,e],l=[...o,t],r=Math.min(i.length,l.length)-1;return{start:i[r],end:l[r]}}(e,n,o,r);await t(c,u,null)}const b=r();if((u.keyCode===Jd.HOME||u.keyCode===Jd.END)&&b.length>1)return;const k=f.filter((e=>!b.includes(e)));let _;if(1===k.length){var y;const e=null===(y=c(o(k[0])))||void 0===y?void 0:y.title;e&&(_=(0,vt.sprintf)(/* translators: %s: block name */ /* translators: %s: block name */(0,vt.__)("%s deselected."),e))}else k.length>1&&(_=(0,vt.sprintf)(/* translators: %s: number of deselected blocks */ /* translators: %s: number of deselected blocks */(0,vt.__)("%s blocks deselected."),k.length));_&&(0,gr.speak)(_,"assertive")}),[e,o,c,i,l,r,s,a,t,n]);return{updateBlockSelection:u}}(),[B,I]=(0,p.useReducer)(iw,{}),[j,E]=(0,p.useState)(null),{setSelectedTreeId:T}=function({firstSelectedBlockClientId:e,setExpandedState:t}){const[n,o]=(0,p.useState)(null),{selectedBlockParentClientIds:i}=(0,h.useSelect)((t=>{const{getBlockParents:n}=t(ba);return{selectedBlockParentClientIds:n(e,!1)}}),[e]);return(0,p.useEffect)((()=>{n!==e&&null!=i&&i.length&&t({type:"expand",clientIds:i})}),[e,i,n,t]),{setSelectedTreeId:o}}({firstSelectedBlockClientId:y[0],setExpandedState:I}),P=(0,p.useCallback)(((e,t,n)=>{C(e,t,null,n),T(t),m&&m(S(t))}),[T,C,m,S]),{ref:M,target:R}=function({dropZoneElement:e,expandedState:t,setExpandedState:n}){const{getBlockRootClientId:o,getBlockIndex:i,getBlockCount:l,getDraggedBlockClientIds:r,canInsertBlocks:s}=(0,h.useSelect)(ba),[a,c]=(0,p.useState)(),{rootClientId:u,blockIndex:d}=a||{},m=_m(u,d),f=(0,vt.isRTL)(),v=(0,g.usePrevious)(u),b=(0,p.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,g.useThrottle)(b,500,ow);(0,p.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 _=r(),y=(0,g.useThrottle)((0,p.useCallback)(((e,t)=>{const n={x:e.clientX,y:e.clientY},r=!(null==_||!_.length),a=nw(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:!!r&&a,innerBlockCount:l(t),canInsertDraggedBlocksAsSibling:!r||s(_,u),canInsertDraggedBlocksAsChild:!r||s(_,t)}})),n,f);a&&c(a)}),[s,_,l,i,o,f]),50);return{ref:(0,g.__experimentalUseDropZone)({dropZoneElement:e,onDrop(e){y.cancel(),a&&m(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:B,setExpandedState:I}),N=(0,p.useRef)(),L=function({selectBlock:e}){const t=(0,h.useRegistry)(),{getBlockOrder:n,getBlockRootClientId:o,getBlocksByClientId:i,getPreviousBlockClientId:l,getSelectedBlockClientIds:r,getSettings:s,canInsertBlockType:a,canRemoveBlocks:c}=(0,h.useSelect)(ba),{flashBlock:u,removeBlocks:p,replaceBlocks:m,insertBlocks:f}=(0,h.useDispatch)(ba),v=Kh();return(0,g.useRefEffect)((h=>{function g(t,n){n&&e(void 0,t,null,null),US(t,h)}function b(e){var b,k;if(e.defaultPrevented)return;if(!h.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=r(),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&&u(x[0]),v(e.type,x),Yh(e,i(x),t)),"cut"===e.type){if(!c(x))return;let e=l(S)??w;p(x,!1);const t=C.length>0&&0===r().length;e||(e=n()[0]),g(e,t)}else if("paste"===e.type){var B;const{__experimentalCanUserUseUnfilteredHTML:t}=s(),n=function(e,t){const{plainText:n,html:o,files:i}=Zh(e);let l=[];if(i.length){const e=(0,d.getBlockTransforms)("from");l=i.reduce(((t,n)=>{const o=(0,d.findTransform)(e,(e=>"files"===e.type&&e.isMatch([n])));return o&&t.push(o.transform([n])),t}),[]).flat()}else l=(0,d.pasteHandler)({HTML:o,plainText:n,mode:"BLOCKS",canUserUseUnfilteredHTML:t});return l}(e,t);if(1===x.length){const[e]=x;var I;if(n.every((t=>a(t.name,e))))return f(n,void 0,e),void g(null===(I=n[0])||void 0===I?void 0:I.clientId,!1)}m(x,n,n.length-1,-1),g(null===(B=n[0])||void 0===B?void 0:B.clientId,!1)}}return h.ownerDocument.addEventListener("copy",b),h.ownerDocument.addEventListener("cut",b),h.ownerDocument.addEventListener("paste",b),()=>{h.ownerDocument.removeEventListener("copy",b),h.ownerDocument.removeEventListener("cut",b),h.ownerDocument.removeEventListener("paste",b)}}),[])}({selectBlock:P}),A=(0,g.useMergeRefs)([L,N,M,v]);(0,p.useEffect)((()=>{null!=y&&y.length&&US(y[0],null==N?void 0:N.current)}),[]);const D=(0,p.useCallback)((e=>{if(!e)return;const t=Array.isArray(e)?e:[e];I({type:"expand",clientIds:t})}),[I]),O=(0,p.useCallback)((e=>{e&&I({type:"collapse",clientIds:[e]})}),[I]),z=(0,p.useCallback)((()=>{I({type:"clear"})}),[I]),V=(0,p.useCallback)((e=>{var t;D(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[D]),F=(0,p.useCallback)((e=>{var t;O(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[O]),H=(0,p.useCallback)(((e,t,n)=>{var o,i;e.shiftKey&&C(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)}),[C]);!function({collapseAll:e,expand:t}){const{expandedBlock:n,getBlockParents:o}=(0,h.useSelect)((e=>{const{getBlockParents:t,getExpandedBlock:n}=fe(e(ba));return{expandedBlock:n(),getBlockParents:t}}),[]);(0,p.useEffect)((()=>{if(n){const i=o(n,!1);e(),t(i)}}),[e,t,n,o])}({collapseAll:z,expand:D});const G=null==_?void 0:_[0],{blockDropTargetIndex:$,blockDropPosition:U,firstDraggedBlockIndex:W}=(0,p.useMemo)((()=>{let e,t;if(null!=R&&R.clientId){const t=x[R.clientId];e=void 0===t||"top"===(null==R?void 0:R.dropPosition)?t:t+1}else null===R&&(e=null);if(G){const e=x[G];t=void 0===e||"top"===(null==R?void 0:R.dropPosition)?e:e+1}return{blockDropTargetIndex:e,blockDropPosition:null==R?void 0:R.dropPosition,firstDraggedBlockIndex:t}}),[R,x,G]),K=(0,p.useMemo)((()=>({blockDropPosition:U,blockDropTargetIndex:$,blockIndexes:x,draggedClientIds:_,expandedState:B,expand:D,firstDraggedBlockIndex:W,collapse:O,collapseAll:z,BlockSettingsMenu:s,listViewInstanceId:b,AdditionalBlockContent:f,insertedBlock:j,setInsertedBlock:E,treeGridElementRef:N,rootClientId:a})),[U,$,x,_,B,D,W,O,z,s,b,f,j,E,a]),[Z]=(0,g.__experimentalUseFixedWindowList)(N,32,w,{expandedState:B,useWindowing:!0,windowOverscan:40});if(!k.length&&!r)return null;const q=c&&`block-editor-list-view-description-${b}`;return(0,et.jsxs)(h.AsyncModeProvider,{value:!0,children:[(0,et.jsx)(XS,{draggedBlockClientId:G,listViewRef:N,blockDropTarget:R}),c&&(0,et.jsx)(le.VisuallyHidden,{id:q,children:c}),(0,et.jsx)(le.__experimentalTreeGrid,{id:t,className:u("block-editor-list-view-tree",{"is-dragging":(null==_?void 0:_.length)>0&&void 0!==$}),"aria-label":(0,vt.__)("Block navigation structure"),ref:A,onCollapseRow:F,onExpandRow:V,onFocusRow:H,applicationAriaLabel:(0,vt.__)("Block navigation structure"),"aria-describedby":q,style:{"--wp-admin--list-view-dragged-items-height":null!=_&&_.length?32*(_.length-1)+"px":null},children:(0,et.jsx)(TS.Provider,{value:K,children:(0,et.jsx)(QS,{blocks:k,parentId:a,selectBlock:P,showBlockMovers:i,fixedListWindow:Z,selectedClientIds:y,isExpanded:l,showAppender:r})})})]})})),rw=(0,p.forwardRef)(((e,t)=>(0,et.jsx)(lw,{ref:t,...e,showAppender:!1,rootClientId:null,onSelect:null,additionalBlockContent:null,blockSettingsMenu:void 0})));function sw({isEnabled:e,onToggle:t,isOpen:n,innerRef:o,...i}){return(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,...i,ref:o,icon:ES,"aria-expanded":n,"aria-haspopup":"true",onClick:e?t:void 0/* translators: button label text should, if possible, be under 16 characters. */,label:(0,vt.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!e})}const aw=(0,p.forwardRef)((function({isDisabled:e,...t},n){Je()("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});const o=(0,h.useSelect)((e=>!!e(ba).getBlockCount()),[])&&!e;return(0,et.jsx)(le.Dropdown,{contentClassName:"block-editor-block-navigation__popover",popoverProps:{placement:"bottom-start"},renderToggle:({isOpen:e,onToggle:i})=>(0,et.jsx)(sw,{...t,innerRef:n,isOpen:e,onToggle:i,isEnabled:o}),renderContent:()=>(0,et.jsxs)("div",{className:"block-editor-block-navigation__container",children:[(0,et.jsx)("p",{className:"block-editor-block-navigation__label",children:(0,vt.__)("List view")}),(0,et.jsx)(rw,{})]})})}));var cw=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})});const{Badge:uw}=fe(le.privateApis);function dw({children:e,onClick:t}){return t?(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,className:"block-editor-block-card__parent-select-button",onClick:t,children:e}):e}const pw=function({title:e,icon:t,description:n,blockType:o,className:i,name:l,allowParentNavigation:r,parentClientId:s,isChild:a,children:c,clientId:p}){var g;o&&(Je()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:e,icon:t,description:n}=o));const{parentBlockClientId:m,parentBlockName:f}=(0,h.useSelect)((e=>{if(s||a||!r)return{};const{getBlockParents:t,getBlockName:n}=e(ba),o=t(p,!1).find((e=>{const t=n(e);return"core/navigation"===t||(0,d.hasBlockSupport)(t,"listView")}));return{parentBlockClientId:o,parentBlockName:o?n(o):null}}),[p,r,a,s]),{selectBlock:v}=(0,h.useDispatch)(ba),b=s?"div":"h2";return(0,et.jsx)("div",{className:u("block-editor-block-card",{"is-parent":s,"is-child":a},i),children:(0,et.jsxs)(le.__experimentalVStack,{children:[(0,et.jsxs)(le.__experimentalHStack,{justify:"flex-start",spacing:0,children:[m&&(0,et.jsx)(le.Button,{onClick:()=>v(m),label:f?(0,vt.sprintf)(/* translators: %s: The name of the parent block. */ /* translators: %s: The name of the parent block. */(0,vt.__)('Go to "%s" block'),null===(g=(0,d.getBlockType)(f))||void 0===g?void 0:g.title):(0,vt.__)("Go to parent block"),style:{minWidth:24,padding:0},icon:(0,vt.isRTL)()?sy:ay,size:"small"}),a&&(0,et.jsx)("span",{className:"block-editor-block-card__child-indicator-icon",children:(0,et.jsx)(le.Icon,{icon:(0,vt.isRTL)()?cw:Fc})}),(0,et.jsxs)(dw,{onClick:s?()=>{v(s)}:void 0,children:[(0,et.jsx)(Sc,{icon:t,showColors:!0}),(0,et.jsxs)(le.__experimentalVStack,{spacing:1,children:[(0,et.jsxs)(b,{className:"block-editor-block-card__title",children:[(0,et.jsx)("span",{className:"block-editor-block-card__name",children:null!=l&&l.length?l:e}),!s&&!a&&!(null==l||!l.length)&&(0,et.jsx)(uw,{children:e})]}),c]})]})]}),!s&&!a&&n&&(0,et.jsx)(le.__experimentalText,{className:"block-editor-block-card__description",children:n})]})})},hw=function({item:e}){var t;const{name:n,title:o,icon:i,description:l,initialAttributes:r}=e,s=(0,d.getBlockType)(n),a=(0,d.isReusableBlock)(e);return(0,et.jsxs)("div",{className:"block-editor-inserter__preview-container",children:[(0,et.jsx)("div",{className:"block-editor-inserter__preview",children:a||s.example?(0,et.jsx)("div",{className:"block-editor-inserter__preview-content",children:(0,et.jsx)(mg,{__experimentalPadding:16,viewportWidth:(null===(t=s.example)||void 0===t?void 0:t.viewportWidth)??500,blocks:s.example?(0,d.getBlockFromExample)(e.name,{attributes:{...s.example.attributes,...r},innerBlocks:s.example.innerBlocks}):(0,d.createBlock)(n,r)})}):(0,et.jsx)("div",{className:"block-editor-inserter__preview-content-missing",children:(0,vt.__)("No Preview Available.","kubio")})}),!a&&(0,et.jsx)(pw,{title:o,icon:i,description:l})]})};function gw({genericPreviewBlock:e,style:t,className:n,activeStyle:o}){const i=Py(n,o,t),l=(0,p.useMemo)((()=>({name:e.name,title:t.label||t.name,description:t.description,initialAttributes:{...e.attributes,className:i+" block-editor-block-styles__block-preview-container"},example:e})),[e,t,i]);return(0,et.jsx)(hw,{item:l})}function mw(e){if(!e)return{};if("object"==typeof e)return e;let t;switch(e){case"normal":case"400":t=(0,vt._x)("Regular","font weight");break;case"bold":case"700":t=(0,vt._x)("Bold","font weight");break;case"100":t=(0,vt._x)("Thin","font weight");break;case"200":t=(0,vt._x)("Extra Light","font weight");break;case"300":t=(0,vt._x)("Light","font weight");break;case"500":t=(0,vt._x)("Medium","font weight");break;case"600":t=(0,vt._x)("Semi Bold","font weight");break;case"800":t=(0,vt._x)("Extra Bold","font weight");break;case"900":t=(0,vt._x)("Black","font weight");break;case"1000":t=(0,vt._x)("Extra Black","font weight");break;default:t=e}return{name:t,value:e}}const fw=[{name:(0,vt._x)("Regular","font style"),value:"normal"},{name:(0,vt._x)("Italic","font style"),value:"italic"}],vw=[{name:(0,vt._x)("Thin","font weight"),value:"100"},{name:(0,vt._x)("Extra Light","font weight"),value:"200"},{name:(0,vt._x)("Light","font weight"),value:"300"},{name:(0,vt._x)("Regular","font weight"),value:"400"},{name:(0,vt._x)("Medium","font weight"),value:"500"},{name:(0,vt._x)("Semi Bold","font weight"),value:"600"},{name:(0,vt._x)("Bold","font weight"),value:"700"},{name:(0,vt._x)("Extra Bold","font weight"),value:"800"},{name:(0,vt._x)("Black","font weight"),value:"900"},{name:(0,vt._x)("Extra Black","font weight"),value:"1000"}];function bw(e){let t=[],n=[];const o=[],i=!e||0===(null==e?void 0:e.length);let l=!1;return null==e||e.forEach((e=>{if("string"==typeof e.fontWeight&&/\s/.test(e.fontWeight.trim())){l=!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(mw(t))}}const o=mw("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,vt._x)("Regular","font style");break;case"italic":t=(0,vt._x)("Italic","font style");break;case"oblique":t=(0,vt._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))||l||n.push(o))})),n.some((e=>e.value>="600"))||n.push({name:(0,vt._x)("Bold","font weight"),value:"700"}),t.some((e=>"italic"===e.value))||t.push({name:(0,vt._x)("Italic","font style"),value:"italic"}),i&&(t=fw,n=vw),t=0===t.length?fw:t,n=0===n.length?vw:n,t.forEach((({name:e,value:t})=>{n.forEach((({name:n,value:i})=>{const l="normal"===t?n:(0,vt.sprintf)(/* translators: 1: Font weight name. 2: Font style name. */ /* translators: 1: Font weight name. 2: Font style name. */(0,vt.__)("%1$s %2$s"),n,e);o.push({key:`${t}-${i}`,name:l,style:{fontStyle:t,fontWeight:i}})}))})),{fontStyles:t,fontWeights:n,combinedStyleAndWeightOptions:o,isSystemFont:i,isVariableFont:l}}function kw(e,t){var n,o,i,l,r,s,a;const{size:c}=e;if(!c||"0"===c||!1===(null==e?void 0:e.fluid))return c;if(!_w(null==t?void 0:t.typography)&&!_w(e))return c;let u=function(e){const t=null==e?void 0:e.typography,n=null==e?void 0:e.layout,o=Ka(null==n?void 0:n.wideSize)?null==n?void 0:n.wideSize:null;return _w(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 Wa({minimumFontSize:null==e||null===(i=e.fluid)||void 0===i?void 0:i.min,maximumFontSize:null==e||null===(l=e.fluid)||void 0===l?void 0:l.max,fontSize:c,minimumFontSizeLimit:null===(r=u)||void 0===r?void 0:r.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 _w(e){const t=null==e?void 0:e.fluid;return!0===t||t&&"object"==typeof t&&Object.keys(t).length>0}function yw(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 xw="body",Sw=":root",ww=[{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)=>kw(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:[]},{path:["border","radiusSizes"],valueKey:"size",cssVarInfix:"border-radius",classes:[]}],Cw={"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"},Bw={popoverProps:{placement:"right-start",offset:25}},Iw={popoverProps:{placement:"right-start",offset:300}};function jw(){return(0,g.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}}}function Ew(e,t,n,o,i){const l=[xn(e,["blocks",t,...n]),xn(e,n)];for(const r of l)if(r){const l=["custom","theme","default"];for(const s of l){const l=r[s];if(l){const r=l.find((e=>e[o]===i));if(r)return"slug"===o||Ew(e,t,n,"slug",r.slug)[o]===r[o]?r:void 0}}}}function Tw(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=xn(e,n.ref))||null!==(i=n)&&void 0!==i&&i.ref)return n}let l;if(n.startsWith("var:"))l=n.slice(4).split("|");else{if(!n.startsWith("var(--wp--")||!n.endsWith(")"))return n;l=n.slice(10,-1).split("--")}const[r,...s]=l;return"preset"===r?function(e,t,n,[o,i]){const l=ww.find((e=>e.cssVarInfix===o));if(!l)return n;const r=Ew(e.settings,t,l.path,"slug",i);if(r){const{valueKey:n}=l;return Tw(e,t,r[n])}return n}(e,t,n,s):"custom"===r?function(e,t,n,o){const i=xn(e.settings,["blocks",t,"custom",...o])??xn(e.settings,["custom",...o]);return i?Tw(e,t,i):n}(e,t,n,s):n}function Pw(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 Mw(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(",")}function Rw(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=Pu(xn(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 Nw=()=>{},Lw=function({clientId:e,onSwitch:t=Nw,onHoverClassName:n=Nw}){const{onSelect:o,stylesToRender:i,activeStyle:l,genericPreviewBlock:r,className:s}=Ry({clientId:e,onSwitch:t}),[a,c]=(0,p.useState)(null),d=(0,g.useViewportMatch)("medium","<"),h=jw();if(!i||0===i.length)return null;const m=(0,g.debounce)(c,250),f=e=>{o(e),n(null),c(null),m.cancel()},v=e=>{a!==e?(m(e),n((null==e?void 0:e.name)??null)):m.cancel()},b=My(i),k=()=>{f(b)};return(0,et.jsx)(le.__experimentalToolsPanel,{label:(0,vt.__)("Styles"),resetAll:k,panelId:e,hasInnerWrapper:!0,dropdownMenuProps:h,children:(0,et.jsx)(le.__experimentalToolsPanelItem,{hasValue:()=>(null==l?void 0:l.name)!==(null==b?void 0:b.name),label:(0,vt.__)("Variation"),onDeselect:k,isShownByDefault:!0,panelId:e,children:(0,et.jsxs)("div",{className:"block-editor-block-styles",children:[(0,et.jsx)("div",{className:"block-editor-block-styles__variants",children:i.map((e=>{const t=e.label||e.name;return(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,className:u("block-editor-block-styles__item",{"is-active":l.name===e.name}),variant:"secondary",label:t,onMouseEnter:()=>v(e),onFocus:()=>v(e),onMouseLeave:()=>v(null),onBlur:()=>v(null),onClick:()=>f(e),"aria-current":l.name===e.name,children:(0,et.jsx)(le.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text",children:t})},e.name)}))}),a&&!d&&(0,et.jsx)(le.Popover,{placement:"left-start",offset:34,focusOnMount:!1,children:(0,et.jsx)("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>v(null),children:(0,et.jsx)(gw,{activeStyle:l,className:s,genericPreviewBlock:r,style:a})})})]})})})},Aw={0:(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M17.6 7c-.6.9-1.5 1.7-2.6 2v1h2v7h2V7h-1.4zM11 11H7V7H5v10h2v-4h4v4h2V7h-2v4z"})}),2:(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M20 13V7h-3l-4 6v2h5v2h2v-2h1v-2h-1zm-2 0h-2.8L18 9v4zm-9-2H5V7H3v10h2v-4h4v4h2V7H9v4z"})}),5:(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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 Dw({level:e}){return Aw[e]?(0,et.jsx)(le.Icon,{icon:Aw[e]}):null}const Ow=[1,2,3,4,5,6],zw={className:"block-library-heading-level-dropdown"};function Vw({options:e=Ow,value:t,onChange:n}){const o=e.filter((e=>0===e||Ow.includes(e))).sort(((e,t)=>e-t));return(0,et.jsx)(le.ToolbarDropdownMenu,{popoverProps:zw,icon:(0,et.jsx)(Dw,{level:t}),label:(0,vt.__)("Change level"),controls:o.map((e=>{const o=e===t;return{icon:(0,et.jsx)(Dw,{level:e}),title:0===e?(0,vt.__)("Paragraph"):(0,vt.sprintf)(// translators: %d: heading level e.g: "1", "2", "3"
// translators: %d: heading level e.g: "1", "2", "3"
(0,vt.__)("Heading %d"),e),isActive:o,onClick(){n(e)},role:"menuitemradio"}}))})}var Fw=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})});const Hw=function({icon:e=Fw,label:t=(0,vt.__)("Choose variation"),instructions:n=(0,vt.__)("Select a variation to start with:"),variations:o,onSelect:i,allowSkip:l}){const r=u("block-editor-block-variation-picker",{"has-many-variations":o.length>4});return(0,et.jsxs)(le.Placeholder,{icon:e,label:t,instructions:n,className:r,children:[(0,et.jsx)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,vt.__)("Block variations"),children:o.map((e=>(0,et.jsxs)("li",{children:[(0,et.jsx)(le.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,et.jsx)("span",{className:"block-editor-block-variation-picker__variation-label",children:e.title})]},e.name)))}),l&&(0,et.jsx)("div",{className:"block-editor-block-variation-picker__skip",children:(0,et.jsx)(le.Button,{__next40pxDefaultSize:!1,variant:"link",onClick:()=>i(),children:(0,vt.__)("Skip")})})]})},Gw="carousel",$w="grid",Uw=({onBlockPatternSelect:e})=>(0,et.jsx)("div",{className:"block-editor-block-pattern-setup__actions",children:(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:e,children:(0,vt.__)("Choose")})}),Ww=({handlePrevious:e,handleNext:t,activeSlide:n,totalSlides:o})=>(0,et.jsxs)("div",{className:"block-editor-block-pattern-setup__navigation",children:[(0,et.jsx)(le.Button,{size:"compact",icon:(0,vt.isRTL)()?sy:ay,label:(0,vt.__)("Previous pattern"),onClick:e,disabled:0===n,accessibleWhenDisabled:!0}),(0,et.jsx)(le.Button,{size:"compact",icon:(0,vt.isRTL)()?ay:sy,label:(0,vt.__)("Next pattern"),onClick:t,disabled:n===o-1,accessibleWhenDisabled:!0})]}),Kw=({viewMode:e,setViewMode:t,handlePrevious:n,handleNext:o,activeSlide:i,totalSlides:l,onBlockPatternSelect:r})=>{const s=e===Gw,a=(0,et.jsxs)("div",{className:"block-editor-block-pattern-setup__display-controls",children:[(0,et.jsx)(le.Button,{size:"compact",icon:zd,label:(0,vt.__)("Carousel view"),onClick:()=>t(Gw),isPressed:s}),(0,et.jsx)(le.Button,{size:"compact",icon:mx,label:(0,vt.__)("Grid view"),onClick:()=>t($w),isPressed:e===$w})]});return(0,et.jsxs)("div",{className:"block-editor-block-pattern-setup__toolbar",children:[s&&(0,et.jsx)(Ww,{handlePrevious:n,handleNext:o,activeSlide:i,totalSlides:l}),a,s&&(0,et.jsx)(Uw,{onBlockPatternSelect:r})]})},Zw=({viewMode:e,activeSlide:t,patterns:n,onBlockPatternSelect:o,showTitles:i})=>{const l="block-editor-block-pattern-setup__container";if(e===Gw){const e=new Map([[t,"active-slide"],[t-1,"previous-slide"],[t+1,"next-slide"]]);return(0,et.jsx)("div",{className:"block-editor-block-pattern-setup__carousel",children:(0,et.jsx)("div",{className:l,children:(0,et.jsx)("div",{className:"carousel-container",children:n.map(((n,o)=>(0,et.jsx)(Yw,{active:o===t,className:e.get(o)||"",pattern:n},n.name)))})})})}return(0,et.jsx)("div",{className:"block-editor-block-pattern-setup__grid",children:(0,et.jsx)(le.Composite,{role:"listbox",className:l,"aria-label":(0,vt.__)("Patterns list"),children:n.map((e=>(0,et.jsx)(qw,{pattern:e,onSelect:o,showTitles:i},e.name)))})})};function qw({pattern:e,onSelect:t,showTitles:n}){const o="block-editor-block-pattern-setup-list",{blocks:i,description:l,viewportWidth:r=700}=e,s=(0,g.useInstanceId)(qw,`${o}__item-description`);return(0,et.jsx)("div",{className:`${o}__list-item`,children:(0,et.jsxs)(le.Composite.Item,{render:(0,et.jsx)("div",{"aria-describedby":l?s:void 0,"aria-label":e.title,className:`${o}__item`}),id:`${o}__pattern__${e.name}`,role:"option",onClick:()=>t(i),children:[(0,et.jsx)(mg,{blocks:i,viewportWidth:r}),n&&(0,et.jsx)("div",{className:`${o}__item-title`,children:e.title}),!!l&&(0,et.jsx)(le.VisuallyHidden,{id:s,children:l})]})})}function Yw({active:e,className:t,pattern:n,minHeight:o}){const{blocks:i,title:l,description:r}=n,s=(0,g.useInstanceId)(Yw,"block-editor-block-pattern-setup-list__item-description");return(0,et.jsxs)("div",{"aria-hidden":!e,role:"img",className:`pattern-slide ${t}`,"aria-label":l,"aria-describedby":r?s:void 0,children:[(0,et.jsx)(mg,{blocks:i,minHeight:o}),!!r&&(0,et.jsx)(le.VisuallyHidden,{id:s,children:r})]})}const Qw=({clientId:e,blockName:t,filterPatternsFn:n,onBlockPatternSelect:o,initialViewMode:i=Gw,showTitles:l=!1})=>{const[r,s]=(0,p.useState)(i),[a,c]=(0,p.useState)(0),{replaceBlock:u}=(0,h.useDispatch)(ba),g=function(e,t,n){return(0,h.useSelect)((o=>{const{getBlockRootClientId:i,getPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:r}=o(ba),s=i(e);return n?r(s).filter(n):l(t,s)}),[e,t,n])}(e,t,n);if(null==g||!g.length)return null;const m=o||(t=>{const n=t.map((e=>(0,d.cloneBlock)(e)));u(e,n)});return(0,et.jsx)(et.Fragment,{children:(0,et.jsxs)("div",{className:`block-editor-block-pattern-setup view-mode-${r}`,children:[(0,et.jsx)(Zw,{viewMode:r,activeSlide:a,patterns:g,onBlockPatternSelect:m,showTitles:l}),(0,et.jsx)(Kw,{viewMode:r,setViewMode:s,activeSlide:a,totalSlides:g.length,handleNext:()=>{c((e=>Math.min(e+1,g.length-1)))},handlePrevious:()=>{c((e=>Math.max(e-1,0)))},onBlockPatternSelect:()=>{m(g[a].blocks)}})]})})},{Menu:Xw}=fe(le.privateApis);function Jw({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return(0,et.jsxs)("fieldset",{className:e,children:[(0,et.jsx)(le.VisuallyHidden,{as:"legend",children:(0,vt.__)("Transform to variation")}),o.map((e=>(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,size:"compact",icon:(0,et.jsx)(Sc,{icon:e.icon,showColors:!0}),isPressed:n===e.name,label:n===e.name?e.title:(0,vt.sprintf)(/* translators: %s: Block or block variation name. */ /* translators: %s: Block or block variation name. */(0,vt.__)("Transform to %s"),e.title),onClick:()=>t(e.name),"aria-label":e.title,showTooltip:!0},e.name)))]})}function eC({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return(0,et.jsx)("div",{className:e,children:(0,et.jsxs)(Xw,{children:[(0,et.jsx)(Xw.TriggerButton,{render:(0,et.jsx)(le.Button,{className:"block-editor-block-variation-transforms__button",__next40pxDefaultSize:!0,variant:"secondary",children:(0,vt.__)("Transform to variation")})}),(0,et.jsx)(Xw.Popover,{position:"bottom",children:(0,et.jsx)(Xw.Group,{children:o.map((e=>(0,et.jsxs)(Xw.RadioItem,{value:e.name,checked:n===e.name,onChange:()=>t(e.name),children:[(0,et.jsx)(Xw.ItemLabel,{children:e.title}),e.description&&(0,et.jsx)(Xw.ItemHelpText,{children:e.description})]},e.name)))})})]})})}function tC({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return(0,et.jsx)("div",{className:e,children:(0,et.jsx)(le.__experimentalToggleGroupControl,{label:(0,vt.__)("Transform to variation"),value:n,hideLabelFromVision:!0,onChange:t,__next40pxDefaultSize:!0,children:o.map((e=>(0,et.jsx)(le.__experimentalToggleGroupControlOptionIcon,{icon:(0,et.jsx)(Sc,{icon:e.icon,showColors:!0}),value:e.name,label:n===e.name?e.title:(0,vt.sprintf)(/* translators: %s: Block or block variation name. */ /* translators: %s: Block or block variation name. */(0,vt.__)("Transform to %s"),e.title)},e.name)))})})}const nC=function({blockClientId:e}){const{updateBlockAttributes:t}=(0,h.useDispatch)(ba),{activeBlockVariation:n,variations:o,isContentOnly:i,isSection:l}=(0,h.useSelect)((t=>{const{getActiveBlockVariation:n,getBlockVariations:o}=t(d.store),{getBlockName:i,getBlockAttributes:l,getBlockEditingMode:r,isSectionBlock:s}=fe(t(ba)),a=e&&i(e),{hasContentRoleAttribute:c}=fe(t(d.store)),u=c(a);return{activeBlockVariation:n(a,l(e),"transform"),variations:a&&o(a,"transform"),isContentOnly:"contentOnly"===r(e)&&!u,isSection:s(e)}}),[e]),r=null==n?void 0:n.name,s=(0,p.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||l)return null;const a=o.length>6,c=s?a?Jw:tC:eC;return(0,et.jsx)(c,{className:"block-editor-block-variation-transforms",onSelectVariation:n=>{t(e,{...o.find((({name:e})=>e===n)).attributes})},selectedValue:r,variations:o})},oC=(0,p.createContext)({user:{},base:{},merged:{},setUserConfig:()=>{}});oC.displayName="GlobalStylesContext";const iC={top:{icon:Ac,title:(0,vt._x)("Align top","Block vertical alignment setting")},center:{icon:Dc,title:(0,vt._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Oc,title:(0,vt._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:Vc,title:(0,vt._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:zc,title:(0,vt._x)("Space between","Block vertical alignment setting")}},lC=["top","center","bottom"],rC=function({value:e,onChange:t,controls:n=lC,isCollapsed:o=!0,isToolbar:i}){function l(n){return()=>t(e===n?void 0:n)}const r=iC[e],s=iC.top,a=i?le.ToolbarGroup:le.ToolbarDropdownMenu,c=i?{isCollapsed:o}:{};return(0,et.jsx)(a,{icon:r?r.icon:s.icon,label:(0,vt._x)("Change vertical alignment","Block vertical alignment setting label"),controls:n.map((t=>({...iC[t],isActive:e===t,role:o?"menuitemradio":void 0,onClick:l(t)}))),...c})},sC=e=>(0,et.jsx)(rC,{...e,isToolbar:!1}),aC=e=>(0,et.jsx)(rC,{...e,isToolbar:!0});function cC(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function uC(e={}){const{flat:t,...n}=e;return t||cC(Object.values(n).filter(Boolean))||"px"}function dC(e={}){if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,le.__experimentalParseQuantityAndUnitFromRawValue)(e))),n=t.map((e=>e[0]??"")),o=t.map((e=>e[1])),i=n.every((e=>e===n[0]))?n[0]:"",l=cC(o);return 0===i||i?`${i}${l}`:void 0}function pC(e={}){const t=dC(e);return"string"!=typeof e&&isNaN(parseFloat(t))}function hC(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function gC({onChange:e,selectedUnits:t,setSelectedUnits:n,values:o,...i}){let l=dC(o);void 0===l&&(l=uC(t));const r=hC(o)&&pC(o),s=r?(0,vt.__)("Mixed"):null;return(0,et.jsx)(le.__experimentalUnitControl,{...i,"aria-label":(0,vt.__)("Border radius"),disableUnits:r,isOnly:!0,value:l,onChange:t=>{const n=!isNaN(parseFloat(t));e(n?t:void 0)},onUnitChange:e=>{n({topLeft:e,topRight:e,bottomLeft:e,bottomRight:e})},placeholder:s,size:"__unstable-large"})}const mC={topLeft:(0,vt.__)("Top left"),topRight:(0,vt.__)("Top right"),bottomLeft:(0,vt.__)("Bottom left"),bottomRight:(0,vt.__)("Bottom right")};function fC({onChange:e,selectedUnits:t,setSelectedUnits:n,values:o,...i}){const l=t=>n=>{if(!e)return;const o=isNaN(parseFloat(n))?void 0:n;e({...r,[t]:o})},r="string"!=typeof o?o:{topLeft:o,topRight:o,bottomLeft:o,bottomRight:o};return(0,et.jsx)("div",{className:"components-border-radius-control__input-controls-wrapper",children:Object.entries(mC).map((([e,o])=>{const[s,a]=(0,le.__experimentalParseQuantityAndUnitFromRawValue)(r[e]),c=r[e]?a:t[e]||t.flat;return(0,et.jsx)(le.Tooltip,{text:o,placement:"top",children:(0,et.jsx)("div",{className:"components-border-radius-control__tooltip-wrapper",children:(0,et.jsx)(le.__experimentalUnitControl,{...i,"aria-label":o,value:[s,c].join(""),onChange:l(e),onUnitChange:(u=e,e=>{const o={...t};o[u]=e,n(o)}),size:"__unstable-large"})})},e);var u}))})}var vC=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})}),bC=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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 kC({isLinked:e,...t}){const n=e?(0,vt.__)("Unlink radii"):(0,vt.__)("Link radii");return(0,et.jsx)(le.Button,{...t,className:"component-border-radius-control__linked-button",size:"small",icon:e?vC:bC,iconSize:24,label:n})}const _C={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},yC=0,xC={px:100,em:20,rem:20};function SC({onChange:e,values:t}){const[n,o]=(0,p.useState)(!hC(t)||!pC(t)),[i,l]=(0,p.useState)({flat:"string"==typeof t?(0,le.__experimentalParseQuantityAndUnitFromRawValue)(t)[1]:void 0,topLeft:(0,le.__experimentalParseQuantityAndUnitFromRawValue)(null==t?void 0:t.topLeft)[1],topRight:(0,le.__experimentalParseQuantityAndUnitFromRawValue)(null==t?void 0:t.topRight)[1],bottomLeft:(0,le.__experimentalParseQuantityAndUnitFromRawValue)(null==t?void 0:t.bottomLeft)[1],bottomRight:(0,le.__experimentalParseQuantityAndUnitFromRawValue)(null==t?void 0:t.bottomRight)[1]}),[r]=wa("spacing.units"),s=(0,le.__experimentalUseCustomUnits)({availableUnits:r||["px","em","rem"]}),a=uC(i),c=s&&s.find((e=>e.value===a)),u=(null==c?void 0:c.step)||1,[d]=(0,le.__experimentalParseQuantityAndUnitFromRawValue)(dC(t));return(0,et.jsxs)("fieldset",{className:"components-border-radius-control",children:[(0,et.jsx)(le.BaseControl.VisualLabel,{as:"legend",children:(0,vt.__)("Radius")}),(0,et.jsxs)("div",{className:"components-border-radius-control__wrapper",children:[n?(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(gC,{className:"components-border-radius-control__unit-control",values:t,min:yC,onChange:e,selectedUnits:i,setSelectedUnits:l,units:s}),(0,et.jsx)(le.RangeControl,{__next40pxDefaultSize:!0,label:(0,vt.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:d??"",min:yC,max:xC[a],initialPosition:0,withInputField:!1,onChange:t=>{e(void 0!==t?`${t}${a}`:void 0)},step:u,__nextHasNoMarginBottom:!0})]}):(0,et.jsx)(fC,{min:yC,onChange:e,selectedUnits:i,setSelectedUnits:l,values:t||_C,units:s}),(0,et.jsx)(kC,{onClick:()=>o(!n),isLinked:n})]})]})}const wC=(0,g.createHigherOrderComponent)((e=>t=>{const[n,o,i,l,r]=wa("color.palette.default","color.palette.theme","color.palette.custom","color.custom","color.defaultPalette"),s=r?[...o||[],...n||[],...i||[]]:[...o||[],...i||[]],{colors:a=s,disableCustomColors:c=!l}=t,u=a&&a.length>0||!c;return(0,et.jsx)(e,{...t,colors:a,disableCustomColors:c,hasColorsToChoose:u})}),"withColorContext"),CC=wC(le.ColorPalette),{Tabs:BC}=fe(le.privateApis),IC=["colors","disableCustomColors","gradients","disableCustomGradients"],jC={color:"color",gradient:"gradient"};function EC({colors:e,gradients:t,disableCustomColors:n,disableCustomGradients:o,__experimentalIsRenderedInSidebar:i,className:l,label:r,onColorChange:s,onGradientChange:a,colorValue:c,gradientValue:d,clearable:p,showTitle:h=!0,enableAlpha:g,headingLevel:m}){const f=s&&(e&&e.length>0||!n),v=a&&(t&&t.length>0||!o);if(!f&&!v)return null;const b={[jC.color]:(0,et.jsx)(le.ColorPalette,{value:c,onChange:v?e=>{s(e),a()}:s,colors:e,disableCustomColors:n,__experimentalIsRenderedInSidebar:i,clearable:p,enableAlpha:g,headingLevel:m}),[jC.gradient]:(0,et.jsx)(le.GradientPicker,{value:d,onChange:f?e=>{a(e),s()}:a,gradients:t,disableCustomGradients:o,__experimentalIsRenderedInSidebar:i,clearable:p,headingLevel:m})},k=e=>(0,et.jsx)("div",{className:"block-editor-color-gradient-control__panel",children:b[e]});return(0,et.jsx)(le.BaseControl,{className:u("block-editor-color-gradient-control",l),children:(0,et.jsx)("fieldset",{className:"block-editor-color-gradient-control__fieldset",children:(0,et.jsxs)(le.__experimentalVStack,{spacing:1,children:[h&&(0,et.jsx)("legend",{children:(0,et.jsx)("div",{className:"block-editor-color-gradient-control__color-indicator",children:(0,et.jsx)(le.BaseControl.VisualLabel,{children:r})})}),f&&v&&(0,et.jsx)("div",{children:(0,et.jsxs)(BC,{defaultTabId:d?jC.gradient:!!f&&jC.color,children:[(0,et.jsxs)(BC.TabList,{children:[(0,et.jsx)(BC.Tab,{tabId:jC.color,children:(0,vt.__)("Color")}),(0,et.jsx)(BC.Tab,{tabId:jC.gradient,children:(0,vt.__)("Gradient")})]}),(0,et.jsx)(BC.TabPanel,{tabId:jC.color,className:"block-editor-color-gradient-control__panel",focusable:!1,children:b.color}),(0,et.jsx)(BC.TabPanel,{tabId:jC.gradient,className:"block-editor-color-gradient-control__panel",focusable:!1,children:b.gradient})]})}),!v&&k(jC.color),!f&&k(jC.gradient)]})})})}function TC(e){const[t,n,o,i]=wa("color.palette","color.gradients","color.custom","color.customGradient");return(0,et.jsx)(EC,{colors:t,gradients:n,disableCustomColors:!o,disableCustomGradients:!i,...e})}const PC=function(e){return IC.every((t=>e.hasOwnProperty(t)))?(0,et.jsx)(EC,{...e}):(0,et.jsx)(TC,{...e})};function MC({onChange:e,value:t,...n}){return(0,et.jsx)(PC,{...n,onColorChange:e,colorValue:t,gradients:[],disableCustomGradients:!0})}ee([te,ie]);const RC=function({backgroundColor:e,fallbackBackgroundColor:t,fallbackTextColor:n,fallbackLinkColor:o,fontSize:i,isLargeText:l,textColor:r,linkColor:s,enableAlphaChecker:a=!1}){const c=e||t;if(!c)return null;const u=r||n,d=s||o;if(!u&&!d)return null;const p=[{color:u,description:(0,vt.__)("text color")},{color:d,description:(0,vt.__)("link color")}],h=X(c),g=h.alpha()<1,m=h.brightness(),f={level:"AA",size:l||!1!==l&&i>=24?"large":"small"};let v="",b="";for(const e of p){if(!e.color)continue;const t=X(e.color),n=t.isReadable(h,f),o=t.alpha()<1;if(!n){if(g||o)continue;v=m<t.brightness()?(0,vt.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,vt.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,vt.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,vt.__)("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,vt.__)("This color combination may be hard for people to read.");break}o&&a&&(v=(0,vt.__)("Transparent text may be hard for people to read."),b=(0,vt.__)("Transparent text may be hard for people to read."))}return v?((0,gr.speak)(b),(0,et.jsx)("div",{className:"block-editor-contrast-checker",children:(0,et.jsx)(le.Notice,{spokenMessage:null,status:"warning",isDismissible:!1,children:v})})):null},NC=window.wp.date,LC=new Date;function AC({format:e,defaultFormat:t,onChange:n}){return(0,et.jsxs)(le.__experimentalVStack,{as:"fieldset",spacing:4,className:"block-editor-date-format-picker",children:[(0,et.jsx)(le.VisuallyHidden,{as:"legend",children:(0,vt.__)("Date format")}),(0,et.jsx)(le.ToggleControl,{label:(0,vt.__)("Default format"),help:`${(0,vt.__)("Example:")}  ${(0,NC.dateI18n)(t,LC)}`,checked:!e,onChange:e=>n(e?null:t)}),e&&(0,et.jsx)(DC,{format:e,onChange:n})]})}function DC({format:e,onChange:t}){const n=[...[...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,vt._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,vt._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,vt._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,vt._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,vt._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,vt._x)("M j","short date format without the year")])].map(((e,t)=>({key:`suggested-${t}`,name:(0,NC.dateI18n)(e,LC),format:e}))),{key:"human-diff",name:(0,NC.humanTimeDiff)(LC),format:"human-diff"}],o={key:"custom",name:(0,vt.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",hint:(0,vt.__)("Enter your own date format")},[i,l]=(0,p.useState)((()=>!!e&&!n.some((t=>t.format===e))));return(0,et.jsxs)(le.__experimentalVStack,{children:[(0,et.jsx)(le.CustomSelectControl,{__next40pxDefaultSize:!0,label:(0,vt.__)("Choose a format"),options:[...n,o],value:i?o:n.find((t=>t.format===e))??o,onChange:({selectedItem:e})=>{e===o?l(!0):(l(!1),t(e.format))}}),i&&(0,et.jsx)(le.TextControl,{__next40pxDefaultSize:!0,label:(0,vt.__)("Custom format"),hideLabelFromVision:!0,help:(0,p.createInterpolateElement)((0,vt.__)("Enter a date or time <Link>format string</Link>."),{Link:(0,et.jsx)(le.ExternalLink,{href:(0,vt.__)("https://wordpress.org/documentation/article/customize-date-and-time-format/")})}),value:e,onChange:e=>t(e)})]})}LC.setDate(20),LC.setMonth(LC.getMonth()-3),4===LC.getMonth()&&LC.setMonth(3);var OC=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"})});const zC=function e({id:t,colorPalette:n,duotonePalette:o,disableCustomColors:i,disableCustomDuotone:l,value:r,onChange:s}){let a;a="unset"===r?(0,et.jsx)(le.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):r?(0,et.jsx)(le.DuotoneSwatch,{values:r}):(0,et.jsx)(jc,{icon:OC});const c=(0,vt.__)("Apply duotone filter"),u=`${(0,g.useInstanceId)(e,"duotone-control",t)}__description`;return(0,et.jsx)(le.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,vt.__)("Duotone")},renderToggle:({isOpen:e,onToggle:t})=>(0,et.jsx)(le.ToolbarButton,{showTooltip:!0,onClick:t,"aria-haspopup":"true","aria-expanded":e,onKeyDown:n=>{e||n.keyCode!==Jd.DOWN||(n.preventDefault(),t())},label:c,icon:a}),renderContent:()=>(0,et.jsxs)(le.MenuGroup,{label:(0,vt.__)("Duotone"),children:[(0,et.jsx)("p",{children:(0,vt.__)("Create a two-tone color effect without losing your original image.")}),(0,et.jsx)(le.DuotonePicker,{"aria-label":c,"aria-describedby":u,colorPalette:n,duotonePalette:o,disableCustomColors:i,disableCustomDuotone:l,value:r,onChange:s})]})})},VC=(e,t)=>e?t?(0,vt.__)("Appearance"):(0,vt.__)("Font style"):(0,vt.__)("Font weight");function FC(e){const{__next40pxDefaultSize:t=!1,onChange:n,hasFontStyles:o=!0,hasFontWeights:i=!0,fontFamilyFaces:l,value:{fontStyle:r,fontWeight:s},...a}=e,c=o||i,u=VC(o,i),d={key:"default",name:(0,vt.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},{fontStyles:h,fontWeights:g,combinedStyleAndWeightOptions:m}=bw(l),f=(0,p.useMemo)((()=>o&&i?(()=>{const e=[d];return m&&e.push(...m),e})():o?(()=>{const e=[d];return h.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:n,fontWeight:void 0}})})),e})():(()=>{const e=[d];return g.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:void 0,fontWeight:n}})})),e})()),[e.options,h,g,m]),v=f.find((e=>e.style.fontStyle===r&&e.style.fontWeight===s))||f[0];return t||void 0!==a.size&&"default"!==a.size||Je()("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,et.jsx)(le.CustomSelectControl,{...a,className:"components-font-appearance-control",__next40pxDefaultSize:t,__shouldNotWarnDeprecated36pxSize:!0,label:u,describedBy:v?o?i?(0,vt.sprintf)(// translators: %s: Currently selected font appearance.
// translators: %s: Currently selected font appearance.
(0,vt.__)("Currently selected font appearance: %s"),v.name):(0,vt.sprintf)(// translators: %s: Currently selected font style.
// translators: %s: Currently selected font style.
(0,vt.__)("Currently selected font style: %s"),v.name):(0,vt.sprintf)(// translators: %s: Currently selected font weight.
// translators: %s: Currently selected font weight.
(0,vt.__)("Currently selected font weight: %s"),v.name):(0,vt.__)("No selected font appearance"),options:f,value:v,onChange:({selectedItem:e})=>n(e.style)})}function HC({__next40pxDefaultSize:e=!1,value:t="",onChange:n,fontFamilies:o,className:i,...l}){const[r]=wa("typography.fontFamilies");if(o||(o=r),!o||0===o.length)return null;const s=[{key:"",name:(0,vt.__)("Default")},...o.map((({fontFamily:e,name:t})=>({key:e,name:t||e,style:{fontFamily:e}})))];e||void 0!==l.size&&"default"!==l.size||Je()("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 a=s.find((e=>e.key===t))??"";return(0,et.jsx)(le.CustomSelectControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,label:(0,vt.__)("Font"),value:a,onChange:({selectedItem:e})=>n(e.key),options:s,className:u("block-editor-font-family-control",i),...l})}function GC({__next40pxDefaultSize:e=!1,value:t,onChange:n,__unstableInputWidth:o="60px",...i}){const[l]=wa("spacing.units"),r=(0,le.__experimentalUseCustomUnits)({availableUnits:l||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return e||void 0!==i.size&&"default"!==i.size||Je()("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,et.jsx)(le.__experimentalUnitControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,...i,label:(0,vt.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n})}var $C=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M7 11.5h10V13H7z"})}),UC=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})}),WC=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"})});const KC=[{label:(0,vt.__)("None"),value:"none",icon:$C},{label:(0,vt.__)("Underline"),value:"underline",icon:UC},{label:(0,vt.__)("Strikethrough"),value:"line-through",icon:WC}];function ZC({value:e,onChange:t,className:n}){return(0,et.jsx)(le.__experimentalToggleGroupControl,{isDeselectable:!0,__next40pxDefaultSize:!0,label:(0,vt.__)("Decoration"),className:u("block-editor-text-decoration-control",n),value:e,onChange:n=>{t(n===e?void 0:n)},children:KC.map((e=>(0,et.jsx)(le.__experimentalToggleGroupControlOptionIcon,{value:e.value,icon:e.icon,label:e.label},e.value)))})}var qC=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})}),YC=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})}),QC=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"})});const XC=[{label:(0,vt.__)("None"),value:"none",icon:$C},{label:(0,vt.__)("Uppercase"),value:"uppercase",icon:qC},{label:(0,vt.__)("Lowercase"),value:"lowercase",icon:YC},{label:(0,vt.__)("Capitalize"),value:"capitalize",icon:QC}];function JC({className:e,value:t,onChange:n}){return(0,et.jsx)(le.__experimentalToggleGroupControl,{isDeselectable:!0,__next40pxDefaultSize:!0,label:(0,vt.__)("Letter case"),className:u("block-editor-text-transform-control",e),value:t,onChange:e=>{n(e===t?void 0:e)},children:XC.map((e=>(0,et.jsx)(le.__experimentalToggleGroupControlOptionIcon,{value:e.value,icon:e.icon,label:e.label},e.value)))})}var eB=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})}),tB=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M7 5.6v1.7l2.6.9v3.9L7 13v1.7L17.5 11V9.3L7 5.6zm4.2 6V8.8l4 1.4-4 1.4zm-5.7 5.6V5.5H4v14.3l3.6-2.2-.8-1.3-1.3.9z"})});const nB=[{label:(0,vt.__)("Horizontal"),value:"horizontal-tb",icon:eB},{label:(0,vt.__)("Vertical"),value:(0,vt.isRTL)()?"vertical-lr":"vertical-rl",icon:tB}];function oB({className:e,value:t,onChange:n}){return(0,et.jsx)(le.__experimentalToggleGroupControl,{isDeselectable:!0,__next40pxDefaultSize:!0,label:(0,vt.__)("Orientation"),className:u("block-editor-writing-mode-control",e),value:t,onChange:e=>{n(e===t?void 0:e)},children:nB.map((e=>(0,et.jsx)(le.__experimentalToggleGroupControlOptionIcon,{value:e.value,icon:e.icon,label:e.label},e.value)))})}const iB=({setting:e,children:t,panelId:n,...o})=>(0,et.jsx)(le.__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}),lB=({colorValue:e,label:t})=>(0,et.jsxs)(le.__experimentalHStack,{justify:"flex-start",children:[(0,et.jsx)(le.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:e}),(0,et.jsx)(le.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:t,children:t})]}),rB=e=>function({onToggle:t,isOpen:n}){const{clearable:o,colorValue:i,gradientValue:l,onColorChange:r,onGradientChange:s,label:a}=e,c=(0,p.useRef)(void 0),d={onClick:t,className:u("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n,ref:c},h=i??l;return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,...d,children:(0,et.jsx)(lB,{colorValue:h,label:a})}),o&&h&&(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,label:(0,vt.__)("Reset"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:$C,onClick:()=>{var e;i?r():l&&s(),n&&t(),null===(e=c.current)||void 0===e||e.focus()}})]})};function sB({colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:o,gradients:i,settings:l,__experimentalIsRenderedInSidebar:r,...s}){let a;return r&&(a={placement:"left-start",offset:36,shift:!0}),(0,et.jsx)(et.Fragment,{children:l.map(((l,c)=>{const u={clearable:!1,colorValue:l.colorValue,colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:o,gradientValue:l.gradientValue,gradients:i,label:l.label,onColorChange:l.onColorChange,onGradientChange:l.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:r,...l},d={clearable:l.clearable,label:l.label,colorValue:l.colorValue,gradientValue:l.gradientValue,onColorChange:l.onColorChange,onGradientChange:l.onGradientChange};return l&&(0,et.jsx)(iB,{setting:l,...s,children:(0,et.jsx)(le.Dropdown,{popoverProps:a,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:rB(d),renderContent:()=>(0,et.jsx)(le.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,et.jsx)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:(0,et.jsx)(PC,{...u})})})})},c)}))})}function aB(){const[e,t,n,o,i,l,r,s,a,c]=wa("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"),u={disableCustomColors:!e,disableCustomGradients:!l};return u.colors=(0,p.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,vt._x)("Theme","Indicates this palette comes from the theme."),slug:"theme",colors:n}),i&&o&&o.length&&e.push({name:(0,vt._x)("Default","Indicates this palette comes from WordPress."),slug:"default",colors:o}),t&&t.length&&e.push({name:(0,vt._x)("Custom","Indicates this palette is created by the user."),slug:"custom",colors:t}),e}),[t,n,o,i]),u.gradients=(0,p.useMemo)((()=>{const e=[];return s&&s.length&&e.push({name:(0,vt._x)("Theme","Indicates this palette comes from the theme."),slug:"theme",gradients:s}),c&&a&&a.length&&e.push({name:(0,vt._x)("Default","Indicates this palette comes from WordPress."),slug:"default",gradients:a}),r&&r.length&&e.push({name:(0,vt._x)("Custom","Indicates this palette is created by the user."),slug:"custom",gradients:r}),e}),[r,s,a,c]),u.hasColorsOrGradients=!!u.colors.length||!!u.gradients.length,u}const cB=["colors","disableCustomColors","gradients","disableCustomGradients"],uB=({className:e,colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:i,children:l,settings:r,title:s,showTitle:a=!0,__experimentalIsRenderedInSidebar:c,enableAlpha:d})=>{const p=(0,g.useInstanceId)(uB),{batch:m}=(0,h.useRegistry)();return t&&0!==t.length||n&&0!==n.length||!o||!i||null==r||!r.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,et.jsxs)(le.__experimentalToolsPanel,{className:u("block-editor-panel-color-gradient-settings",e),label:a?s:void 0,resetAll:()=>{m((()=>{r.forEach((({colorValue:e,gradientValue:t,onColorChange:n,onGradientChange:o})=>{e?n():t&&o()}))}))},panelId:p,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",children:[(0,et.jsx)(sB,{settings:r,panelId:p,colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:i,__experimentalIsRenderedInSidebar:c,enableAlpha:d}),!!l&&(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(le.__experimentalSpacer,{marginY:4})," ",l]})]}):null},dB=e=>{const t=aB();return(0,et.jsx)(uB,{...t,...e})},pB=e=>cB.every((t=>e.hasOwnProperty(t)))?(0,et.jsx)(uB,{...e}):(0,et.jsx)(dB,{...e});var hB=(0,et.jsxs)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,et.jsx)(an.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,et.jsx)(an.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})]});const gB=24,mB=8,fB={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rem:{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}},vB=(e,t)=>!(null==e||!e.includes)&&("0"===e||e.includes(`var:preset|${t}|`));function bB(e,t){if(!e)return;if("0"===e||"default"===e)return e;const n=e.match(new RegExp(`var:preset\\|${t}\\|(.+)`));return n?n[1]:void 0}function kB(e,t,n){if(!vB(e,n))return e;const o=0===parseFloat(e,10)?"0":bB(e,n),i=t.find((e=>String(e.slug)===o));return null==i?void 0:i.size}function _B({allowNegativeOnDrag:e,ariaLabel:t,allPlaceholder:n,minValue:o,parsedQuantity:i,computedUnit:l,units:r,isMixed:s,step:a,max:c,showTooltip:u,value:d,minimumCustomValue:p,onCustomValueChange:h,onCustomValueSliderChange:g,onUnitChange:m,onMouseOut:f,onMouseOver:v,setMinValue:b}){const k=(0,et.jsx)(le.__experimentalUnitControl,{className:"preset-input-control__unit-control",disableUnits:s,hideLabelFromVision:!0,label:t,min:o,onChange:h,onUnitChange:m,onBlur:f,onFocus:v,onMouseOut:f,onMouseOver:v,size:"__unstable-large",units:r,value:[i,l].join(""),placeholder:n,onDragStart:()=>{e&&"-"===(null==d?void 0:d.charAt(0))&&b(0)},onDrag:()=>{e&&"-"===(null==d?void 0:d.charAt(0))&&b(0)},onDragEnd:()=>{e&&b(p)}}),_=u?(0,et.jsx)(le.Tooltip,{text:t,placement:"top",children:(0,et.jsx)("div",{className:"preset-input-control__tooltip-wrapper",children:k})}):k;return(0,et.jsxs)(et.Fragment,{children:[_,(0,et.jsx)(le.RangeControl,{className:"preset-input-control__custom-value-range",hideLabelFromVision:!0,initialPosition:0,label:t,max:c,min:0,onBlur:f,onChange:g,onFocus:v,onMouseOut:f,onMouseOver:v,step:a,value:i,withInputField:!1,__next40pxDefaultSize:!0})]})}function yB({allowNegativeOnDrag:e=!1,ariaLabel:t,className:n,customValueSettings:o=fB,disableCustomValues:i,icon:l,isMixed:r,value:s,minimumCustomValue:a,onChange:c,onMouseOut:u,onMouseOver:d,onUnitChange:h,presets:m=[],presetType:f,selectedUnit:v,showTooltip:b,units:k}){var _,y,x;const S=(0,p.useMemo)((()=>function(e,t,n){if(!e||vB(e,n)||"0"===e)return e;const o=t.find((t=>String(t.size)===String(e)));return null!=o&&o.slug?`var:preset|${n}|${o.slug}`:e}(s,m,f)),[s,m,f]),w=n??"preset-input-control",C=m.slice(1,m.length-1).map(((e,t)=>({value:t+1,label:void 0}))),B=C.length>0,I=m.length<=mB,j=r?(0,vt.__)("Mixed"):null,[E,T]=(0,p.useState)(a),[P,M]=(0,p.useState)(!i&&void 0!==S&&!vB(S,f));let R=null;const N=(0,g.usePrevious)(S);(0,p.useEffect)((()=>{S&&N!==S&&!vB(S,f)&&!0!==P&&M(!0)}),[S,N,f,P]);const L=!I&&!P&&void 0!==S&&(!vB(S,f)||vB(S,f)&&r);let A=m;L?(A=[...m,{name:r?(0,vt.__)("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,vt.sprintf)((0,vt.__)("Custom (%s)"),S),slug:"custom",size:S}],R=A.length-1):r||(R=P?kB(S,m,f):function(e,t,n){if(void 0===e)return 0;const o=0===parseFloat(e,10)?"0":bB(e,n),i=t.findIndex((e=>String(e.slug)===o));return-1!==i?i:NaN}(S,m,f));const D=A.map(((e,t)=>({key:t,name:e.name}))),O=vB(S,f)?kB(S,m,f):S,[z,V]=(0,le.__experimentalParseQuantityAndUnitFromRawValue)(O),F=V||v||"px",H=null==k?void 0:k.find((e=>e.value===F)),G=(null==H?void 0:H.step)??(null===(_=o[F])||void 0===_?void 0:_.steps)??.1,$=(null==H?void 0:H.max)??(null===(y=o[F])||void 0===y?void 0:y.max)??10,U=(e,t)=>{var n;const o=parseInt(e,10);if("selectList"===t){var i;if(0===o&&"0"===(null===(i=m[0])||void 0===i?void 0:i.slug))return"0";if(0===o)return}else if(0===o)return"0";return`var:preset|${f}|${null===(n=m[e])||void 0===n?void 0:n.slug}`};return(0,et.jsxs)(le.__experimentalHStack,{className:`preset-input-control__wrapper ${w}__wrapper`,children:[l&&(0,et.jsx)(le.Icon,{className:"preset-input-control__icon",icon:l,size:gB}),(!B||P)&&(0,et.jsx)(_B,{allowNegativeOnDrag:e,ariaLabel:t,allPlaceholder:j,minValue:E,parsedQuantity:z,computedUnit:F,units:k,isMixed:r,step:G,max:$,showTooltip:b,value:S,minimumCustomValue:a,onCustomValueChange:e=>{const t=isNaN(parseFloat(e))?void 0:e;void 0!==t&&c(t)},onCustomValueSliderChange:e=>{c([e,F].join(""))},onUnitChange:h,onMouseOut:u,onMouseOver:d,setMinValue:T}),B&&I&&!P&&(0,et.jsx)(le.RangeControl,{"aria-valuenow":R,"aria-valuetext":null===(x=m[R])||void 0===x?void 0:x.name,className:"preset-input-control__preset-range",hideLabelFromVision:!0,initialPosition:0,label:t,max:m.length-1,marks:C,min:0,onBlur:u,onChange:e=>c(U(e)),onFocus:d,onMouseDown:e=>{var t;(null==e||null===(t=e.nativeEvent)||void 0===t?void 0:t.offsetX)<35&&void 0===S&&c("0")},onMouseOut:u,onMouseOver:d,renderTooltipContent:e=>{var t;return void 0===S||null===(t=m[e])||void 0===t?void 0:t.name},step:1,value:R,withInputField:!1,__next40pxDefaultSize:!0}),B&&!I&&!P&&(0,et.jsx)(le.CustomSelectControl,{className:"preset-input-control__custom-select-control",hideLabelFromVision:!0,label:t,onBlur:u,onChange:e=>{L&&e.selectedItem.key===D.length-1?M(!0):c(U(e.selectedItem.key,"selectList"))},onFocus:d,onMouseOut:u,onMouseOver:d,options:D,size:"__unstable-large",value:D.find((e=>e.key===R))||""}),B&&!i&&(0,et.jsx)(le.Button,{className:"preset-input-control__custom-toggle",icon:hB,iconSize:gB,isPressed:P,label:P?(0,vt.__)("Use preset"):(0,vt.__)("Set custom value"),onClick:()=>{M(!P)},size:"small"})]})}const xB=[],SB={...fB,px:{max:1e3,steps:1},em:{max:50,steps:.1},rem:{max:50,steps:.1}};function wB({label:e=(0,vt.__)("Dimension"),onChange:t,value:n}){const[o,i]=wa("dimensions.dimensionSizes","spacing.units"),l=(0,le.__experimentalUseCustomUnits)({availableUnits:i||["%","px","em","rem","vh","vw"]}),r=function(e){const t=(null==e?void 0:e.default)??xB,n=(null==e?void 0:e.custom)??xB,o=(null==e?void 0:e.theme)??xB;return(0,p.useMemo)((()=>[{name:(0,vt.__)("None"),slug:"0",size:0},...n,...o,...t]),[n,o,t])}(o),[s,a]=(0,p.useState)((()=>{var e;const[,t]=(0,le.__experimentalParseQuantityAndUnitFromRawValue)(n);return t||(null===(e=l[0])||void 0===e?void 0:e.value)||"px"}));return(0,et.jsxs)("fieldset",{className:"block-editor-dimension-control",children:[(0,et.jsx)(le.BaseControl.VisualLabel,{as:"legend",children:e}),(0,et.jsx)(yB,{ariaLabel:e,className:"block-editor-dimension-control",customValueSettings:SB,minimumCustomValue:0,onChange:t,onUnitChange:e=>{const[o,i]=(0,le.__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),a(e)},presets:r,presetType:"dimension",selectedUnit:s,showTooltip:!0,units:l,value:n})]})}const CB={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 BB({label:e=(0,vt.__)("Height"),onChange:t,value:n}){var o,i,l;Je()("wp.blockEditor.HeightControl",{since:"7.0",version:"7.2",alternative:"wp.blockEditor.DimensionControl"});const r=parseFloat(n),[s]=wa("spacing.units"),a=(0,le.__experimentalUseCustomUnits)({availableUnits:s||["%","px","em","rem","vh","vw"]}),c=(0,p.useMemo)((()=>(0,le.__experimentalParseQuantityAndUnitFromRawValue)(n)),[n])[1]||(null===(o=a[0])||void 0===o?void 0:o.value)||"px";return(0,et.jsxs)("fieldset",{className:"block-editor-height-control",children:[(0,et.jsx)(le.BaseControl.VisualLabel,{as:"legend",children:e}),(0,et.jsxs)(le.Flex,{children:[(0,et.jsx)(le.FlexItem,{isBlock:!0,children:(0,et.jsx)(le.__experimentalUnitControl,{value:n,units:a,onChange:t,onUnitChange:e=>{const[o,i]=(0,le.__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,et.jsx)(le.FlexItem,{isBlock:!0,children:(0,et.jsx)(le.__experimentalSpacer,{marginX:2,marginBottom:0,children:(0,et.jsx)(le.RangeControl,{__next40pxDefaultSize:!0,value:r,min:0,max:(null===(i=CB[c])||void 0===i?void 0:i.max)??100,step:(null===(l=CB[c])||void 0===l?void 0:l.step)??.1,withInputField:!1,onChange:e=>{t([e,c].join(""))},label:e,hideLabelFromVision:!0})})})]})]})}var IB=n(2796),jB=n.n(IB);function EB(e,t,n,o,i){void 0===i&&(i=0);var l=AB(t.width,t.height,i),r=l.width,s=l.height;return{x:TB(e.x,r,n.width,o),y:TB(e.y,s,n.height,o)}}function TB(e,t,n,o){var i=t*o/2-n/2;return DB(e,-i,i)}function PB(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function MB(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function RB(e,t){return Math.min(e,Math.max(0,t))}function NB(e,t){return t}function LB(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function AB(e,t,n){var o=n*Math.PI/180;return{width:Math.abs(Math.cos(o)*e)+Math.abs(Math.sin(o)*t),height:Math.abs(Math.sin(o)*e)+Math.abs(Math.cos(o)*t)}}function DB(e,t,n){return Math.min(Math.max(e,t),n)}function OB(){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 zB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.cropperRef=ff.createRef(),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.previousCropSize=null,n.isInitialized=!1,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("gesturechange",n.onGestureChange),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.previousCropSize=e,n.emitCropData(),n.setInitialCrop(e),n.isInitialized=!0),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(e){if(n.props.initialCroppedAreaPercentages){var t=function(e,t,n,o,i,l){var r=AB(t.width,t.height,n),s=DB(o.width/r.width*(100/e.width),i,l);return{crop:{x:s*r.width/2-o.width/2-r.width*s*(e.x/100),y:s*r.height/2-o.height/2-r.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 l=function(e,t,n,o,i,l){void 0===n&&(n=0);var r=AB(t.naturalWidth,t.naturalHeight,n),s=DB(function(e,t,n){var o=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return n.height>n.width?n.height/(e.height*o):n.width/(e.width*o)}(e,t,o),i,l),a=o.height>o.width?o.height/e.height:o.width/e.width;return{crop:{x:((r.width-e.width)/2-e.x)*a,y:((r.height-e.height)/2-e.y)*a},zoom:s}}(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom);o=l.crop,i=l.zoom,n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(i)}},n.computeSizes=function(){var e,t,o,i,l,r,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=He(He({},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,l){void 0===l&&(l=0);var r=AB(e,t,l),s=r.width,a=r.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===(l=n.state.cropSize)||void 0===l?void 0:l.height)===h.height&&(null===(r=n.state.cropSize)||void 0===r?void 0:r.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.onGestureChange),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureChange=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 l=n.gestureRotationStart+e.rotation;n.props.onRotationChange(l)}}},n.onGestureEnd=function(e){n.cleanEvents()},n.onDragStart=function(e){var t,o,i=e.x,l=e.y;n.dragStartPosition={x:i,y:l},n.dragStartCrop=He({},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,l={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+i},r=n.props.restrictPosition?EB(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(r)}})))},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=jB()(e).pixelY,l=n.props.zoom-i*n.props.zoomSpeed/200;n.setNewZoom(l,o,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)}},n.getPointOnContainer=function(e,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,l=i.crop,r=i.zoom;return{x:(t+l.x)/r,y:(o+l.y)/r}},n.setNewZoom=function(e,t,o){var i=(void 0===o?{}:o).shouldUpdatePosition,l=void 0===i||i;if(n.state.cropSize&&n.props.onZoomChange){var r=DB(e,n.props.minZoom,n.props.maxZoom);if(l){var s=n.getPointOnContainer(t,n.containerPosition),a=n.getPointOnMedia(s),c={x:a.x*r-s.x,y:a.y*r-s.y},u=n.props.restrictPosition?EB(c,n.mediaSize,n.state.cropSize,r,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(r)}},n.getCropData=function(){return n.state.cropSize?function(e,t,n,o,i,l,r){void 0===l&&(l=0),void 0===r&&(r=!0);var s=r?RB:NB,a=AB(t.width,t.height,l),c=AB(t.naturalWidth,t.naturalHeight,l),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:He(He({},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?EB(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(){var e,t;if(n.state.cropSize){var o=n.props.crop;if(n.isInitialized&&(null===(e=n.previousCropSize)||void 0===e?void 0:e.width)&&(null===(t=n.previousCropSize)||void 0===t?void 0:t.height)&&(Math.abs(n.previousCropSize.width-n.state.cropSize.width)>1e-6||Math.abs(n.previousCropSize.height-n.state.cropSize.height)>1e-6)){var i=n.state.cropSize.width/n.previousCropSize.width,l=n.state.cropSize.height/n.previousCropSize.height;o={x:n.props.crop.x*i,y:n.props.crop.y*l}}var r=n.props.restrictPosition?EB(o,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):o;n.previousCropSize=n.state.cropSize,n.props.onCropChange(r),n.emitCropData()}},n.onKeyDown=function(e){var t,o,i=n.props,l=i.crop,r=i.onCropChange,s=i.keyboardStep,a=i.zoom,c=i.rotation,u=s;if(n.state.cropSize){e.shiftKey&&(u*=.2);var d=He({},l);switch(e.key){case"ArrowUp":d.y-=u,e.preventDefault();break;case"ArrowDown":d.y+=u,e.preventDefault();break;case"ArrowLeft":d.x-=u,e.preventDefault();break;case"ArrowRight":d.x+=u,e.preventDefault();break;default:return}n.props.restrictPosition&&(d=EB(d,n.mediaSize,n.state.cropSize,a,c)),e.repeat||null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t),r(d)}},n.onKeyUp=function(e){var t,o;switch(e.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":e.preventDefault();break;default:return}n.emitCropData(),null===(o=(t=n.props).onInteractionEnd)||void 0===o||o.call(t)},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}Fe(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),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},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,l,r,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===(l=e.crop)||void 0===l?void 0:l.x)===(null===(r=this.props.crop)||void 0===r?void 0:r.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=PB(n,o),this.lastPinchRotation=MB(n,o),this.onDragStart(LB(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]),l=LB(o,i);this.onDrag(l),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=PB(o,i),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var r=MB(o,i),s=n.props.rotation+(r-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(s),n.lastPinchRotation=r}))}},t.prototype.render=function(){var e,t=this,n=this.props,o=n.image,i=n.video,l=n.mediaProps,r=n.cropperProps,s=n.transform,a=n.crop,c=a.x,u=a.y,d=n.rotation,p=n.zoom,h=n.cropShape,g=n.showGrid,m=n.roundCropAreaPixels,f=n.style,v=f.containerStyle,b=f.cropAreaStyle,k=f.mediaStyle,_=n.classes,y=_.containerClassName,x=_.cropAreaClassName,S=_.mediaClassName,w=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:v,className:OB("reactEasyCrop_Container",y)},o?ff.createElement("img",He({alt:"",className:OB("reactEasyCrop_Image","contain"===w&&"reactEasyCrop_Contain","horizontal-cover"===w&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===w&&"reactEasyCrop_Cover_Vertical",S)},l,{src:o,ref:this.imageRef,style:He(He({},k),{transform:s||"translate(".concat(c,"px, ").concat(u,"px) rotate(").concat(d,"deg) scale(").concat(p,")")}),onLoad:this.onMediaLoad})):i&&ff.createElement("video",He({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:OB("reactEasyCrop_Video","contain"===w&&"reactEasyCrop_Contain","horizontal-cover"===w&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===w&&"reactEasyCrop_Cover_Vertical",S)},l,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:He(He({},k),{transform:s||"translate(".concat(c,"px, ").concat(u,"px) rotate(").concat(d,"deg) scale(").concat(p,")")}),controls:!1}),(Array.isArray(i)?i:[{src:i}]).map((function(e){return ff.createElement("source",He({key:e.src},e))}))),this.state.cropSize&&ff.createElement("div",He({ref:this.cropperRef,style:He(He({},b),{width:m?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:m?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:OB("reactEasyCrop_CropArea","round"===h&&"reactEasyCrop_CropAreaRound",g&&"reactEasyCrop_CropAreaGrid",x)},r)))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:1},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),VB=Object.prototype.hasOwnProperty;function FB(e,t,n){for(n of e.keys())if(HB(n,t))return n}function HB(e,t){var n,o,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((o=e.length)===t.length)for(;o--&&HB(e[o],t[o]););return-1===o}if(n===Set){if(e.size!==t.size)return!1;for(o of e){if((i=o)&&"object"==typeof i&&!(i=FB(t,i)))return!1;if(!t.has(i))return!1}return!0}if(n===Map){if(e.size!==t.size)return!1;for(o of e){if((i=o[0])&&"object"==typeof i&&!(i=FB(t,i)))return!1;if(!HB(o[1],t.get(i)))return!1}return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((o=e.byteLength)===t.byteLength)for(;o--&&e.getInt8(o)===t.getInt8(o););return-1===o}if(ArrayBuffer.isView(e)){if((o=e.byteLength)===t.byteLength)for(;o--&&e[o]===t[o];);return-1===o}if(!n||"object"==typeof e){for(n in o=0,e){if(VB.call(e,n)&&++o&&!VB.call(t,n))return!1;if(!(n in t)||!HB(e[n],t[n]))return!1}return Object.keys(t).length===o}}return e!=e&&t!=t}const GB=1,$B=5,UB=e=>e>=0?e%360:(360+e%360)%360,WB=e=>new Promise(((t,n)=>{const o=new Image;o.addEventListener("load",(()=>t(o))),o.addEventListener("error",(e=>n(e))),o.setAttribute("crossOrigin","anonymous"),o.src=e}));function KB(e){return e*Math.PI/180}const ZB={crop:{x:0,y:0,width:100,height:100},zoom:GB,rotation:0,aspectRatio:1,flip:{horizontal:!1,vertical:!1}},qB={crop:{x:0,y:0},croppedArea:ZB.crop,croppedAreaPixels:null,zoom:ZB.zoom,rotation:ZB.rotation,flip:ZB.flip,aspectRatio:ZB.aspectRatio,mediaSize:null},YB=(0,p.createContext)({cropperState:{crop:{x:0,y:0},croppedArea:{x:0,y:0,width:100,height:100},croppedAreaPixels:null,zoom:GB,rotation:0,aspectRatio:1,flip:{horizontal:!1,vertical:!1},mediaSize:null},setCropperState:()=>{},resetState:null,setResetState:()=>{},isDirty:!1,reset:()=>{},getCroppedImage:()=>Promise.resolve(null)});function QB({children:e}){const t=function(){const[e,t]=(0,p.useState)(qB),[n,o]=(0,p.useState)(null),i=(0,p.useCallback)((e=>{t((t=>{const n={..."function"==typeof e?e(t):e};return"rotation"in n&&void 0!==n.rotation&&(n.rotation=UB(n.rotation)),{...t,...n}}))}),[]),l=(0,p.useCallback)((e=>{if(!e)return o(null),void i(qB);if("object"==typeof e){const t={...ZB,...e};o(t),i(t)}}),[i,o]),r=(0,p.useCallback)((()=>{if(n){const e={crop:{x:0,y:0},croppedAreaPixels:null};n.crop&&(e.croppedArea=n.crop),void 0!==n.zoom&&(e.zoom=n.zoom),void 0!==n.rotation&&(e.rotation=n.rotation),void 0!==n.aspectRatio&&(e.aspectRatio=n.aspectRatio),void 0!==n.flip&&(e.flip=n.flip),i(e)}else i({...qB})}),[n,i]),s=(0,p.useMemo)((()=>n?!1===HB({crop:e.croppedAreaPixels||e.croppedArea,zoom:e.zoom,rotation:UB(e.rotation),aspectRatio:e.aspectRatio,flip:e.flip},n):!1===HB({crop:e.croppedArea,zoom:e.zoom,rotation:UB(e.rotation),aspectRatio:e.aspectRatio,flip:e.flip},ZB)),[e,n]),a=(0,p.useCallback)((async t=>e.croppedAreaPixels?async function(e,t,n=0,o={horizontal:!1,vertical:!1}){try{const i=await WB(e),l=document.createElement("canvas"),r=l.getContext("2d");if(!r)return null;const s=KB(n),{width:a,height:c}=function(e,t,n){const o=KB(n);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)}}(i.width,i.height,n);l.width=a,l.height=c,r.translate(a/2,c/2),r.rotate(s),r.scale(o.horizontal?-1:1,o.vertical?-1:1),r.translate(-i.width/2,-i.height/2),r.drawImage(i,0,0);const u=document.createElement("canvas"),d=u.getContext("2d");return d?(u.width=t.width,u.height=t.height,d.drawImage(l,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise((e=>{u.toBlob((t=>{t&&e(URL.createObjectURL(t))}),"image/jpeg")}))):null}catch{return null}}(t,e.croppedAreaPixels,e.rotation,e.flip):null),[e.croppedAreaPixels,e.rotation,e.flip]);return(0,p.useMemo)((()=>({cropperState:e,setCropperState:i,resetState:n,setResetState:l,isDirty:s,reset:r,getCroppedImage:a})),[e,i,n,l,s,r,a])}(),n=(0,p.useMemo)((()=>({...t})),[t]);return(0,et.jsx)(YB.Provider,{value:n,children:e})}const XB=()=>{const e=(0,p.useContext)(YB);if(!e)throw new Error("Missing ImageCropperContext");return e};function JB({src:e,onLoad:t,minZoom:n=GB,maxZoom:o=$B,...i}){const{cropperState:l,setCropperState:r}=XB(),{crop:s,zoom:a,rotation:c,aspectRatio:u,flip:d}=l,h=(0,p.useCallback)(((e,t)=>{r({croppedArea:e,croppedAreaPixels:t})}),[r]);return(0,et.jsx)(zB,{classes:{containerClassName:"image-cropper__container",cropAreaClassName:"image-cropper__crop-area",mediaClassName:"image-cropper__image"},minZoom:n,maxZoom:o,rotation:c,image:e,setMediaSize:e=>r({mediaSize:e}),crop:s,zoom:a,aspect:u,onCropChange:e=>r({crop:e}),onZoomChange:e=>r({zoom:e}),onCropComplete:h,onMediaLoaded:e=>{null==t||t(e)},onRotationChange:e=>r({rotation:e}),transform:[`translate(${s.x}px, ${s.y}px)`,`rotateZ(${c}deg)`,`rotateY(${d.horizontal?180:0}deg)`,`rotateX(${d.vertical?180:0}deg)`,`scale(${a})`].join(" "),...i})}const eI={crop:(0,vt.__)("Image cropped."),rotate:(0,vt.__)("Image rotated."),cropAndRotate:(0,vt.__)("Image cropped and rotated.")},tI=(0,p.createContext)({});tI.displayName="ImageEditingContext";const nI=()=>(0,p.useContext)(tI);function oI({id:e,url:t,naturalWidth:n,naturalHeight:o,onFinishEditing:i,onSaveImage:l,children:r}){const s=function({url:e,naturalWidth:t,naturalHeight:n}){const[o,i]=(0,p.useState)(),{cropperState:l,setCropperState:r}=XB(),{zoom:s,aspectRatio:a,crop:c,croppedArea:u}=l,d=(0,p.useCallback)((e=>{r({zoom:e})}),[r]),h=(0,p.useCallback)((e=>{r({aspectRatio:e})}),[r]),g=t/n,f=n/t;(0,p.useEffect)((()=>{h(g)}),[]);const[v,b]=(0,p.useState)(0),k=(0,p.useCallback)((()=>{const t=(v+90)%360;let n=g;const o=1!==s||!(g===a||f===a);if(v%180==90&&(n=1/g),0===t)return i(),b(t),void r({aspectRatio:o?a:g,crop:{x:-c.y*n,y:c.x*n}});const l=new window.Image;l.src=e,l.onload=function(e){const l=document.createElement("canvas");let s=0,u=0;t%180?(l.width=e.target.height,l.height=e.target.width):(l.width=e.target.width,l.height=e.target.height),90!==t&&180!==t||(s=l.width),270!==t&&180!==t||(u=l.height);const d=l.getContext("2d");d.translate(s,u),d.rotate(t*Math.PI/180),d.drawImage(e.target,0,0),l.toBlob((e=>{i(URL.createObjectURL(e)),b(t);const s=o?a:l.width/l.height;r({aspectRatio:s,crop:{x:-c.y*n,y:c.x*n}})}))};const u=(0,m.applyFilters)("media.crossOrigin",void 0,e);"string"==typeof u&&(l.crossOrigin=u)}),[v,g,e,r,c,s,a,f,b]);return(0,p.useMemo)((()=>({editedUrl:o,setEditedUrl:i,crop:u,zoom:s,setZoom:d,rotation:v,rotateClockwise:k,aspect:a,setAspect:h,defaultAspect:g})),[o,u,s,d,v,k,a,h,g])}({url:t,naturalWidth:n,naturalHeight:o}),a=function({crop:e,rotation:t,url:n,id:o,onSaveImage:i,onFinishEditing:l}){const{createErrorNotice:r,createSuccessNotice:s}=(0,h.useDispatch)(Wh.store),[a,c]=(0,p.useState)(!1),u=(0,p.useCallback)((()=>{c(!1),l()}),[l]),d=(0,p.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 l();const u=1===a.length?a[0].type:"cropAndRotate";Ic()({path:`/wp/v2/media/${o}/edit`,method:"POST",data:{src:n,modifiers:a}}).then((e=>{i({id:e.id,url:e.source_url}),s(eI[u],{type:"snackbar",actions:[{label:(0,vt.__)("Undo"),onClick:()=>{i({id:o,url:n})}}]})})).catch((e=>{r((0,vt.sprintf)(/* translators: %s: Error message. */ /* translators: %s: Error message. */(0,vt.__)("Could not edit image. %s"),(0,Ih.__unstableStripHTML)(e.message)),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{c(!1),l()}))}),[e,t,o,n,i,r,s,l]);return(0,p.useMemo)((()=>({isInProgress:a,apply:d,cancel:u})),[a,d,u])}({id:e,url:t,onSaveImage:l,onFinishEditing:i,...s}),c=(0,p.useMemo)((()=>({...s,...a})),[s,a]);return(0,et.jsx)(tI.Provider,{value:c,children:r})}function iI({url:e,width:t,height:n,clientWidth:o,naturalHeight:i,naturalWidth:l,borderProps:r}){const{isInProgress:s,editedUrl:a,rotation:c}=nI();o||(o=l);let d=n||o*i/l;return c%180==90&&(d=o*l/i),(0,et.jsxs)("div",{className:u("wp-block-image__crop-area",null==r?void 0:r.className,{"is-applying":s}),style:{...null==r?void 0:r.style,width:t||o,height:d},children:[(0,et.jsx)(JB,{src:a||e}),s&&(0,et.jsx)(le.Spinner,{})]})}const lI=100,rI=300,sI={placement:"bottom-start"};function aI(){const{isInProgress:e,zoom:t,setZoom:n}=nI();return(0,et.jsx)(le.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:sI,renderToggle:({isOpen:t,onToggle:n})=>(0,et.jsx)(le.ToolbarButton,{icon:Tp,label:(0,vt.__)("Zoom"),onClick:n,"aria-expanded":t,disabled:e}),renderContent:()=>(0,et.jsx)(le.__experimentalDropdownContentWrapper,{paddingSize:"medium",children:(0,et.jsx)(le.RangeControl,{__next40pxDefaultSize:!0,label:(0,vt.__)("Zoom"),min:lI,max:rI,value:Math.round(100*t),onChange:e=>n(e/100)})})})}var cI=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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 uI({aspectRatios:e,isDisabled:t,label:n,onClick:o,value:i}){return(0,et.jsx)(le.MenuGroup,{label:n,children:e.map((({title:e,aspect:n})=>(0,et.jsx)(le.MenuItem,{disabled:t,onClick:()=>{o(n)},role:"menuitemradio",isSelected:n===i,icon:n===i?jy:void 0,children:e},n)))})}function dI({toggleProps:e}){const{isInProgress:t,aspect:n,setAspect:o,defaultAspect:i}=nI();return(0,et.jsx)(le.DropdownMenu,{icon:cI,label:(0,vt.__)("Aspect Ratio","kubio"),popoverProps:sI,toggleProps:e,className:"wp-block-image__aspect-ratio",children:({onClose:e})=>(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(uI,{isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{title:(0,vt.__)("Original","kubio"),aspect:i},{title:(0,vt.__)("Square","kubio"),aspect:1}]}),(0,et.jsx)(uI,{label:(0,vt.__)("Landscape","kubio"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{title:(0,vt.__)("16:9","kubio"),aspect:16/9,ratio:16/9},{title:(0,vt.__)("4:3","kubio"),aspect:4/3,ratio:4/3},{title:(0,vt.__)("3:2","kubio"),aspect:1.5,ratio:1.5}]}),(0,et.jsx)(uI,{label:(0,vt.__)("Portrait","kubio"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{title:(0,vt.__)("9:16","kubio"),aspect:9/16},{title:(0,vt.__)("3:4","kubio"),aspect:3/4},{title:(0,vt.__)("2:3","kubio"),aspect:2/3}]})]})})}var pI=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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 hI(){const{isInProgress:e,rotateClockwise:t}=nI();return(0,et.jsx)(le.ToolbarButton,{icon:pI,label:(0,vt.__)("Rotate","kubio"),onClick:t,disabled:e})}function gI(){const{isInProgress:e,apply:t,cancel:n}=nI();return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(le.ToolbarButton,{onClick:t,disabled:e,children:(0,vt.__)("Apply","kubio")}),(0,et.jsx)(le.ToolbarButton,{onClick:n,children:(0,vt.__)("Cancel","kubio")})]})}function mI({id:e,url:t,width:n,height:o,clientWidth:i,naturalHeight:l,naturalWidth:r,onSaveImage:s,onFinishEditing:a,borderProps:c}){const{clientId:u}=B(),d=(0,p.useMemo)((()=>{var e;if(i)return i;const t=document.querySelector("iframe"),n=null==t||null===(e=t.contentWindow)||void 0===e?void 0:e.document;if(!n)return null;const o=n.querySelector(`[data-block="${u}"] img`);return o?o.offsetWidth:null}),[]);return(0,et.jsx)(QB,{children:(0,et.jsxs)(oI,{id:e,url:t,naturalWidth:r,naturalHeight:l,onSaveImage:s,onFinishEditing:a,children:[(0,et.jsx)(iI,{borderProps:c,url:t,width:n,height:o,clientWidth:d,naturalHeight:l,naturalWidth:r}),(0,et.jsxs)(Qy,{children:[(0,et.jsxs)(le.ToolbarGroup,{children:[(0,et.jsx)(aI,{}),(0,et.jsx)(le.ToolbarItem,{children:e=>(0,et.jsx)(dI,{toggleProps:e})}),(0,et.jsx)(hI,{})]}),(0,et.jsx)(le.ToolbarGroup,{children:(0,et.jsx)(gI,{})})]})]})})}const fI=[25,50,75,100],vI=()=>{};function bI(e,t,n){return{scaledWidth:Math.round(t*(e/100)),scaledHeight:Math.round(n*(e/100))}}function kI({imageSizeHelp:e,imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:i=!0,slug:l,width:r,height:s,onChange:a,onChangeImage:c=vI}){const{currentHeight:u,currentWidth:d,updateDimension:h,updateDimensions:g}=function(e,t,n,o,i){const[l,r]=(0,p.useState)(t??o??""),[s,a]=(0,p.useState)(e??n??"");return(0,p.useEffect)((()=>{void 0===t&&void 0!==o&&r(o),void 0===e&&void 0!==n&&a(n)}),[o,n]),(0,p.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(l)&&r(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(s)&&a(e)}),[t,e]),{currentHeight:s,currentWidth:l,updateDimension:(e,t)=>{const n=""===t?void 0:parseInt(t,10);"width"===e?r(n):a(n),i({[e]:n})},updateDimensions:(e,t)=>{a(e??n),r(t??o),i({height:e,width:t})}}}(s,r,n,t,a),m=fI.find((e=>{const{scaledWidth:o,scaledHeight:i}=bI(e,t,n);return d===o&&u===i}));return(0,et.jsxs)(le.__experimentalVStack,{className:"block-editor-image-size-control",spacing:"4",children:[o&&o.length>0&&(0,et.jsx)(le.SelectControl,{label:(0,vt.__)("Resolution"),value:l,options:o,onChange:c,help:e,size:"__unstable-large"}),i&&(0,et.jsxs)(et.Fragment,{children:[(0,et.jsxs)(le.__experimentalHStack,{align:"baseline",spacing:"4",children:[(0,et.jsx)(le.__experimentalNumberControl,{label:(0,vt.__)("Width"),value:d,min:1,onChange:e=>h("width",e),size:"__unstable-large"}),(0,et.jsx)(le.__experimentalNumberControl,{label:(0,vt.__)("Height"),value:u,min:1,onChange:e=>h("height",e),size:"__unstable-large"})]}),(0,et.jsx)(le.__experimentalToggleGroupControl,{label:(0,vt.__)("Image size presets"),hideLabelFromVision:!0,onChange:e=>{if(void 0===e)return void g();const{scaledWidth:o,scaledHeight:i}=bI(e,t,n);g(i,o)},value:m,isBlock:!0,__next40pxDefaultSize:!0,children:fI.map((e=>(0,et.jsx)(le.__experimentalToggleGroupControlOption,{value:e,label:(0,vt.sprintf)(/* translators: %d: Percentage value. */ /* translators: %d: Percentage value. */(0,vt.__)("%d%%"),e)},e)))})]})]})}const _I={left:Ac,center:Dc,right:Oc,"space-between":zc,stretch:Vc},yI=function({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:n,value:o,popoverProps:i,isToolbar:l}){const r=e=>{n(e===o?void 0:e)},s=o?_I[o]:_I.left,a=[{name:"left",icon:Ac,title:(0,vt.__)("Justify items left","kubio"),isActive:"left"===o,onClick:()=>r("left")},{name:"center",icon:Dc,title:(0,vt.__)("Justify items center","kubio"),isActive:"center"===o,onClick:()=>r("center")},{name:"right",icon:Oc,title:(0,vt.__)("Justify items right","kubio"),isActive:"right"===o,onClick:()=>r("right")},{name:"space-between",icon:zc,title:(0,vt.__)("Space between items","kubio"),isActive:"space-between"===o,onClick:()=>r("space-between")},{name:"stretch",icon:Vc,title:(0,vt.__)("Stretch items","kubio"),isActive:"stretch"===o,onClick:()=>r("stretch")}],c=l?le.ToolbarGroup:le.ToolbarDropdownMenu,u=l?{isCollapsed:t}:{};return(0,et.jsx)(c,{icon:s,popoverProps:i,label:(0,vt.__)("Change items justification","kubio"),controls:a.filter((t=>e.includes(t.name))),...u})},xI=e=>(0,et.jsx)(yI,{...e,isToolbar:!1}),SI=e=>(0,et.jsx)(yI,{...e,isToolbar:!0});var wI=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})});const CI=function e({children:t,settingsOpen:n,setSettingsOpen:o}){const i=(0,g.useReducedMotion)(),l=i?p.Fragment:le.__unstableAnimatePresence,r=i?"div":le.__unstableMotion.div,s=`link-control-settings-drawer-${(0,g.useInstanceId)(e)}`;return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,className:"block-editor-link-control__drawer-toggle","aria-expanded":n,onClick:()=>o(!n),icon:(0,vt.isRTL)()?zS:op,"aria-controls":s,children:(0,vt._x)("Advanced","Additional link settings")}),(0,et.jsx)(l,{children:n&&(0,et.jsx)(r,{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,et.jsx)("div",{className:"block-editor-link-control__drawer-inner",children:t})})})]})},BI=({searchTerm:e,onClick:t,itemProps:n,buttonText:o})=>{if(!e)return null;let i;return i=o?"function"==typeof o?o(e):o:(0,p.createInterpolateElement)((0,vt.sprintf)(/* translators: %s: search term. */ /* translators: %s: search term. */(0,vt.__)("Create: <mark>%s</mark>"),e),{mark:(0,et.jsx)("mark",{})}),(0,et.jsx)(le.MenuItem,{...n,iconPosition:"left",icon:gp,className:"block-editor-link-control__search-item",onClick:t,children:i})};var II=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})}),jI=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})}),EI=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{fillRule:"evenodd",clipRule:"evenodd",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"})}),TI=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})}),PI=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8Zm6.5 8c0 .6 0 1.2-.2 1.8h-2.7c0-.6.2-1.1.2-1.8s0-1.2-.2-1.8h2.7c.2.6.2 1.1.2 1.8Zm-.9-3.2h-2.4c-.3-.9-.7-1.8-1.1-2.4-.1-.2-.2-.4-.3-.5 1.6.5 3 1.6 3.8 3ZM12.8 17c-.3.5-.6 1-.8 1.3-.2-.3-.5-.8-.8-1.3-.3-.5-.6-1.1-.8-1.7h3.3c-.2.6-.5 1.2-.8 1.7Zm-2.9-3.2c-.1-.6-.2-1.1-.2-1.8s0-1.2.2-1.8H14c.1.6.2 1.1.2 1.8s0 1.2-.2 1.8H9.9ZM11.2 7c.3-.5.6-1 .8-1.3.2.3.5.8.8 1.3.3.5.6 1.1.8 1.7h-3.3c.2-.6.5-1.2.8-1.7Zm-1-1.2c-.1.2-.2.3-.3.5-.4.7-.8 1.5-1.1 2.4H6.4c.8-1.4 2.2-2.5 3.8-3Zm-1.8 8H5.7c-.2-.6-.2-1.1-.2-1.8s0-1.2.2-1.8h2.7c0 .6-.2 1.1-.2 1.8s0 1.2.2 1.8Zm-2 1.4h2.4c.3.9.7 1.8 1.1 2.4.1.2.2.4.3.5-1.6-.5-3-1.6-3.8-3Zm7.4 3c.1-.2.2-.3.3-.5.4-.7.8-1.5 1.1-2.4h2.4c-.8 1.4-2.2 2.5-3.8 3Z"})}),MI=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})}),RI=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"})});const NI={post:{icon:II,label:(0,vt.__)("Post")},page:{icon:Ec,label:(0,vt.__)("Page")},post_tag:{icon:jI,label:(0,vt.__)("Tag")},category:{icon:EI,label:(0,vt.__)("Category")},attachment:{icon:TI,label:(0,vt.__)("Attachment")}};function LI({isURL:e,suggestion:t}){let n=null;return e?n=PI:t.type in NI&&(n=NI[t.type].icon,"page"===t.type&&(t.isFrontPage&&(n=MI),t.isBlogHome&&(n=RI))),n?(0,et.jsx)(jc,{className:"block-editor-link-control__search-item-icon",icon:n}):null}function AI(e){const t=null==e?void 0:e.trim();return null!=t&&t.length?null==e?void 0:e.replace(/^\/?/,"/"):e}function DI(e){const t=null==e?void 0:e.trim();return null!=t&&t.length?null==e?void 0:e.replace(/\/$/,""):e}function OI(e){return e.isFrontPage?(0,vt.__)("Front page"):e.isBlogHome?(0,vt.__)("Blog home"):e.type in NI?NI[e.type].label:e.type}const zI=({itemProps:e,suggestion:t,searchTerm:n,onClick:o,isURL:i=!1,shouldShowType:l=!1})=>{const r=i?(0,vt.__)("Press ENTER to add this link"):(s=t.url)?(0,g.pipe)(it.safeDecodeURI,it.getPath,(e=>null==e||e!=e?"":e),((e,...t)=>(...n)=>e(...n,...t))(it.filterURLForDisplay,24),DI,AI)(s):s;var s;return(0,et.jsx)(le.MenuItem,{...e,info:r,iconPosition:"left",icon:(0,et.jsx)(LI,{suggestion:t,isURL:i}),onClick:o,shortcut:l&&OI(t),className:"block-editor-link-control__search-item",children:(0,et.jsx)(le.TextHighlight,{text:(0,Ih.__unstableStripHTML)(t.title),highlight:n})})},VI="__CREATE__",FI="tel",HI="link",GI="mailto",$I="internal",UI=[HI,GI,FI,$I],WI=[{id:"opensInNewTab",title:(0,vt.__)("Open in new tab")}];const KI=function({withCreateSuggestion:e,currentInputValue:t,handleSuggestionClick:n,suggestionsListProps:o,buildSuggestionItemProps:i,suggestions:l,selectedSuggestion:r,isLoading:s,isInitialSuggestions:a,createSuggestionButtonText:c,suggestionsQuery:d}){const p=u("block-editor-link-control__search-results",{"is-loading":s}),h=1===l.length&&UI.includes(l[0].type),g=e&&!h&&!a,m=!(null!=d&&d.type),f=a?(0,vt.__)("Suggestions"):(0,vt.sprintf)(/* translators: %s: search term. */ /* translators: %s: search term. */(0,vt.__)('Search results for "%s"'),t);return(0,et.jsx)("div",{className:"block-editor-link-control__search-results-wrapper",children:(0,et.jsx)("div",{...o,className:p,"aria-label":f,children:(0,et.jsx)(le.MenuGroup,{children:l.map(((e,o)=>g&&VI===e.type?(0,et.jsx)(BI,{searchTerm:t,buttonText:c,onClick:()=>n(e),itemProps:i(e,o),isSelected:o===r},e.type):VI===e.type?null:(0,et.jsx)(zI,{itemProps:i(e,o),suggestion:e,index:o,onClick:()=>{n(e)},isSelected:o===r,isURL:UI.includes(e.type),searchTerm:t,shouldShowType:m,isFrontPage:null==e?void 0:e.isFrontPage,isBlogHome:null==e?void 0:e.isBlogHome},`${e.id}-${e.type}`)))})})})};function ZI(e){const t=null==e?void 0:e.trim();if(!t)return{url:t,type:HI};let n=HI;const o=(0,it.getProtocol)(t)||"";return o.includes("mailto")?n=GI:o.includes("tel")?n=FI:null!=t&&t.startsWith("#")&&(n=$I),lt(t)||rt(t)||t.startsWith("?")||o?{url:t,type:n}:{url:(0,it.prependHTTPS)(t),type:n}}const qI=()=>Promise.resolve([]),YI=e=>{const{url:t,type:n}=ZI(e);return Promise.resolve([{id:e,title:e,url:t,type:n}])};const QI=()=>Promise.resolve([]),XI=()=>{},JI=(0,p.forwardRef)((({value:e,children:t,currentLink:n={},className:o=null,placeholder:i=null,withCreateSuggestion:l=!1,onCreateSuggestion:r=XI,onChange:s=XI,onSelect:a=XI,showSuggestions:c=!0,renderSuggestions:u=(e=>(0,et.jsx)(KI,{...e})),fetchSuggestions:d=null,allowDirectEntry:g=!0,showInitialSuggestions:m=!1,suggestionsQuery:f={},withURLSuggestion:v=!0,createSuggestionButtonText:b,hideLabelFromVision:k=!1,suffix:_,isEntity:y=!1,customValidity:x},S)=>{const w=function(e,t,n){const{fetchSearchSuggestions:o,pageOnFront:i,pageForPosts:l}=(0,h.useSelect)((e=>{const{getSettings:t}=e(ba);return{pageOnFront:t().pageOnFront,pageForPosts:t().pageForPosts,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),r=t?YI:qI;return(0,p.useCallback)(((t,{isInitialSuggestions:s})=>st(t)?r(t,{isInitialSuggestions:s}):(async(e,t,n,o,i,l)=>{const{isInitialSuggestions:r}=t,s=await n(e,t);return s.map((e=>Number(e.id)===i?(e.isFrontPage=!0,e):Number(e.id)===l?(e.isBlogHome=!0,e):e)),r||st(e)||!o?s:s.concat({title:e,url:e,type:VI})})(t,{...e,isInitialSuggestions:s},o,n,i,l)),[r,o,i,l,e,n])}(f,g,l),C=c?d||w:QI,[B,I]=(0,p.useState)(),j=async e=>{let t=e;if(VI!==e.type){if(g||t&&Object.keys(t).length>=1){const{id:e,url:o,kind:i,type:l,...r}=n??{};a({...r,...t},t)}}else try{var o;t=await r(e.title),null!==(o=t)&&void 0!==o&&o.url&&a(t)}catch(e){}},E=i??(0,vt.__)("Search or type URL"),T=k&&""!==i?E:(0,vt.__)("Link");return(0,et.jsxs)("div",{className:"block-editor-link-control__search-input-container",children:[(0,et.jsx)(rE,{disableSuggestions:(null==n?void 0:n.url)===e,label:T,hideLabelFromVision:k,className:o,value:e,onChange:(e,t)=>{s(e),I(t)},placeholder:E,__experimentalRenderSuggestions:c?e=>u({...e,withCreateSuggestion:l,createSuggestionButtonText:b,suggestionsQuery:f,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),j(t)}}):null,__experimentalFetchLinkSuggestions:C,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:m,customValidity:x,required:!1,onSubmit:(t,n)=>{var o;const i=t||B;i||null!=e&&null!==(o=e.trim())&&void 0!==o&&o.length?j(i||{url:e}):n.preventDefault()},inputRef:S,suffix:_,disabled:y}),t]})})),ej=JI;var tj=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})}),nj=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})});const{Slot:oj,Fill:ij}=(0,le.createSlotFill)("BlockEditorLinkControlViewer");function lj(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 rj=function(e){const[t,n]=(0,p.useReducer)(lj,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,h.useSelect)((e=>{const{getSettings:t}=e(ba);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,p.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},{Badge:sj}=fe(le.privateApis);function aj({value:e,onEditClick:t,hasRichPreviews:n=!1,hasUnlinkControl:o=!1,onRemove:i}){var l,r;const s=(0,h.useSelect)((e=>e(Fo.store).get("core","showIconLabels")),[]),a=n?null==e?void 0:e.url:null,{richData:c,isFetching:d}=rj(a),p=c&&Object.keys(c).length,m=e&&(0,it.filterURLForDisplay)((0,it.safeDecodeURI)(e.url),24)||"",f=!(null!=e&&null!==(l=e.url)&&void 0!==l&&l.length),v=!f&&(0,Ih.__unstableStripHTML)((null==c?void 0:c.title)||(null==e?void 0:e.title)||m);let b;b=null!=c&&c.icon?(0,et.jsx)("img",{src:null==c?void 0:c.icon,alt:""}):f?(0,et.jsx)(jc,{icon:tj,size:32}):(0,et.jsx)(jc,{icon:PI});const{createNotice:k}=(0,h.useDispatch)(Wh.store),_=(0,g.useCopyToClipboard)(e.url,(()=>{k("info",(0,vt.__)("Link copied to clipboard."),{isDismissible:!0,type:"snackbar"})}));return(0,et.jsx)(le.Flex,{role:"group","aria-label":(0,vt.__)("Manage link"),className:u("block-editor-link-control__preview",{"is-current":!0,"is-rich":p,"is-fetching":!!d,"is-preview":!0,"is-error":f,"is-url-title":v===m}),children:(0,et.jsxs)(le.Flex,{gap:0,align:"flex-start",children:[(0,et.jsxs)(le.Flex,{className:"block-editor-link-control__link-information",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,vt.__)("Link information"),justify:"start",align:"flex-start",children:[null!=e&&e.image?(0,et.jsx)(le.Flex,{className:"block-editor-link-control__preview-image",justify:"center",children:(0,et.jsx)("img",{src:null==e?void 0:e.image,alt:""})}):(0,et.jsx)(le.Flex,{className:u("block-editor-link-control__preview-icon",{"is-image":null==c?void 0:c.icon}),justify:"center",children:b}),(0,et.jsx)(le.Flex,{className:"block-editor-link-control__preview-details",direction:"column",gap:2,children:f?(0,et.jsx)("span",{className:"block-editor-link-control__preview-error-notice",children:(0,vt.__)("Link is empty")}):(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(le.ExternalLink,{className:"block-editor-link-control__preview-title",href:e.url,children:(0,et.jsx)(le.__experimentalTruncate,{numberOfLines:1,children:v})}),(0,et.jsx)("span",{className:"block-editor-link-control__preview-info",children:(0,et.jsx)(le.__experimentalTruncate,{numberOfLines:1,children:m})}),(null==e||null===(r=e.badges)||void 0===r?void 0:r.length)>0&&(0,et.jsx)(le.__experimentalHStack,{className:"block-editor-link-control__preview-badges",alignment:"left",gap:1,children:e.badges.map(((e,t)=>(0,et.jsx)(sj,{intent:e.intent,children:e.label},`${e.label}|${e.intent}|${t}`)))})]})})]}),(0,et.jsx)(le.Button,{icon:iS,label:(0,vt.__)("Edit link"),onClick:t,size:"compact",showTooltip:!s}),o&&(0,et.jsx)(le.Button,{icon:bC,label:(0,vt.__)("Remove link"),onClick:i,size:"compact",showTooltip:!s}),(0,et.jsx)(le.Button,{icon:nj,label:(0,vt.__)("Copy link"),ref:_,accessibleWhenDisabled:!0,disabled:f,size:"compact",showTooltip:!s}),(0,et.jsx)(oj,{fillProps:e})]})})}const cj=()=>{},uj=({value:e,onChange:t=cj,settings:n})=>{if(!n||!n.length)return null;const o=n=>o=>{t({...e,[n.id]:o})},i=n.map((n=>{if("render"in n){if("function"==typeof n.render){const o=n.render(n,e,t);return(0,et.jsx)("div",{className:"block-editor-link-control__setting",children:o},n.id)}return null}return(0,et.jsx)(le.CheckboxControl,{className:"block-editor-link-control__setting",label:n.title,onChange:o(n),checked:!!e&&!!e[n.id],help:null==n?void 0:n.help},n.id)})).filter(Boolean);return(0,et.jsxs)("fieldset",{className:"block-editor-link-control__settings",children:[(0,et.jsx)(le.VisuallyHidden,{as:"legend",children:(0,vt.__)("Currently selected link settings")}),i]})};var dj=n(4063),pj=n.n(dj);const hj=()=>{},gj="core/block-editor",mj="linkControlSettingsDrawer";function fj({searchInputPlaceholder:e,value:t,settings:n=WI,onChange:o=hj,onInputChange:i,onRemove:l,onCancel:r,noDirectEntry:s=!1,showSuggestions:a=!0,showInitialSuggestions:c,forceIsEditingLink:d,createSuggestion:m,withCreateSuggestion:f,inputValue:v="",suggestionsQuery:b={},noURLSuggestion:k=!1,createSuggestionButtonText:_,hasRichPreviews:y=!1,hasTextControl:x=!1,renderControlBottom:S=null,handleEntities:w=!1}){var C,B,I;void 0===f&&m&&(f=!0);const[j,E]=(0,p.useState)(!1),[T,P]=(0,p.useState)(void 0),{advancedSettingsPreference:M}=(0,h.useSelect)((e=>({advancedSettingsPreference:e(Fo.store).get(gj,mj)??!1})),[]),{set:R}=(0,h.useDispatch)(Fo.store),N=M||j,L=(0,p.useRef)(!0),A=(0,p.useRef)(),D=(0,p.useRef)(),O=(0,p.useRef)(),z=(0,p.useRef)(),V=n.map((({id:e})=>e)),[F,H,G,$,U]=function(e){const[t,n]=(0,p.useState)(e||{}),[o,i]=(0,p.useState)(e);return pj()(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),W=w&&!(null==F||!F.id),K=(0,g.useInstanceId)(fj,"link-control"),Z=W?`${K}__help`:null,q=t&&!(0,am.isShallowEqualObjects)(F,t),[Y,Q]=(0,p.useState)(void 0!==d?d:!t||!t.url),{createPage:X,isCreatingPage:J,errorMessage:ee}=function(e){const t=(0,p.useRef)(),[n,o]=(0,p.useState)(!1),[i,l]=(0,p.useState)(null);return(0,p.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){o(!0),l(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 l(e.message||(0,vt.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:i}}(m);(0,p.useEffect)((()=>{void 0!==d&&Q(d)}),[d]),(0,p.useEffect)((()=>{L.current||(Ih.focus.focusable.find(A.current)[0]||A.current).focus()}),[Y,J]),(0,p.useEffect)((()=>(L.current=!1,()=>{L.current=!0})),[]);const te=(0,p.useRef)();(0,p.useEffect)((()=>{void 0!==te.current?te.current!==v&&(console.warn("LinkControl: The inputValue prop is uncontrolled and only sets the initial value. onInputChange is an observer for the input value. Changes to inputValue from the parent will not update the search input."),te.current=v):te.current=v}),[v]),(0,p.useEffect)((()=>{if("invalid"===(null==T?void 0:T.type)){const e=O.current;e&&"function"==typeof e.reportValidity&&e.reportValidity()}}),[T]);const ne=(null==t||null===(C=t.url)||void 0===C||null===(B=C.trim())||void 0===B?void 0:B.length)>0,oe=()=>{Q(!1)},ie=e=>{const t={type:"invalid",message:(0,vt.__)("Please enter a valid URL.")},n={type:"valid"},o=null==e?void 0:e.trim();if(null==o||!o.length||!st(o))return t;if(lt(o)||rt(o))return n;const i=(0,it.prependHTTPS)(o);return(0,it.isURL)(i)?n:t},re=()=>{(()=>{if(ue)return!1;const e=ce.trim(),n=F&&F.id&&F.type&&!UI.includes(F.type),o=(null==t?void 0:t.url)===e;if(n&&o)return P(void 0),!0;const i=ie(ce);return"invalid"===i.type?(P(i),!1):(P(void 0),!0)})()&&(q&&o({...t,...F,url:ZI(ce).url}),oe(),P(void 0))},[se,ae]=(0,p.useState)(!1);(0,p.useEffect)((()=>{var e;se&&(null===(e=O.current)||void 0===e||e.focus(),ae(!1))}),[se]);const ce=void 0!==(null==F?void 0:F.url)?F.url:v||"",ue=!(null!=ce&&null!==(I=ce.trim())&&void 0!==I&&I.length);(0,p.useEffect)((()=>{P(void 0)}),[ce]);const de=l&&t&&!Y&&!J,pe=Y&&ne,he=ne&&x,ge=(Y||!t)&&!J,me=ue||!!T||t&&!q,fe=!(null==n||!n.length)&&Y&&ne,ve=(0,p.useMemo)((()=>"taxonomy"!==(null==t?void 0:t.kind)||null!=t&&t.url||!z.current?t:{...t,url:z.current}),[t]);return(0,et.jsxs)("div",{tabIndex:-1,ref:A,className:"block-editor-link-control",children:[J&&(0,et.jsxs)("div",{className:"block-editor-link-control__loading",children:[(0,et.jsx)(le.Spinner,{})," ",(0,vt.__)("Creating"),"…"]}),ge&&(0,et.jsxs)(et.Fragment,{children:[(0,et.jsxs)("div",{className:u({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":he,"has-actions":pe}),children:[he&&(0,et.jsx)(le.TextControl,{ref:D,className:"block-editor-link-control__field block-editor-link-control__text-content",label:(0,vt.__)("Text"),value:null==F?void 0:F.title,onChange:$,onKeyDown:e=>{const{keyCode:t}=e;t!==Jd.ENTER||ue||(e.preventDefault(),re())},__next40pxDefaultSize:!0}),(0,et.jsx)(ej,{ref:O,currentLink:t,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:e,value:ce,withCreateSuggestion:f,onCreateSuggestion:X,onChange:e=>{G(e),null==i||i(e)},onSelect:e=>{var t,n,i;if(!(e&&e.id&&e.type)||UI.includes(e.type)){var l;const t=(null===(l=e)||void 0===l?void 0:l.url)||ce,n=ie(t);if("invalid"===n.type)return void P(n);const{url:o}=ZI(t);e={...e,url:o}}"taxonomy"===(null===(t=e)||void 0===t?void 0:t.kind)&&null!==(n=e)&&void 0!==n&&n.url&&(z.current=e.url);const r=Object.keys(e).reduce(((t,n)=>(V.includes(n)||(t[n]=e[n]),t)),{});o({...F,...r,title:(null==F?void 0:F.title)||(null===(i=e)||void 0===i?void 0:i.title)}),P(void 0),oe()},showInitialSuggestions:c,allowDirectEntry:!s,showSuggestions:a,suggestionsQuery:b,withURLSuggestion:!k,createSuggestionButtonText:_,hideLabelFromVision:!he,isEntity:W,customValidity:T,suffix:(0,et.jsx)(vj,{isEntity:W,showActions:pe,isDisabled:me,onUnlink:()=>{const{id:e,kind:t,type:n,...o}=F;H({...o,id:void 0,kind:void 0,type:void 0,url:void 0}),ae(!0)},onSubmit:re,helpTextId:Z})}),W&&Z&&(0,et.jsx)("p",{id:Z,className:"block-editor-link-control__help",children:(0,vt.sprintf)(/* translators: %s: entity type (e.g., page, post) */ /* translators: %s: entity type (e.g., page, post) */(0,vt.__)("Synced with the selected %s."),(null==F?void 0:F.type)||"item")})]}),ee&&(0,et.jsx)(le.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1,children:ee})]}),t&&!Y&&!J&&(0,et.jsx)(aj,{value:ve,onEditClick:()=>Q(!0),hasRichPreviews:y,hasUnlinkControl:de,onRemove:()=>{l(),Q(!0)}},null==ve?void 0:ve.url),fe&&(0,et.jsx)("div",{className:"block-editor-link-control__tools",children:!ue&&(0,et.jsx)(CI,{settingsOpen:N,setSettingsOpen:e=>{R&&R(gj,mj,e),E(e)},children:(0,et.jsx)(uj,{value:F,settings:n,onChange:U(V)})})}),pe&&(0,et.jsxs)(le.__experimentalHStack,{justify:"right",className:"block-editor-link-control__search-actions",children:[(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:e=>{e.preventDefault(),e.stopPropagation(),H(t),P(void 0),ne?oe():null==l||l(),null==r||r()},children:(0,vt.__)("Cancel")}),(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:me?hj:re,className:"block-editor-link-control__search-submit","aria-disabled":me,children:(0,vt.__)("Apply")})]}),!J&&S&&S()]})}function vj({isEntity:e,showActions:t,isDisabled:n,onUnlink:o,onSubmit:i,helpTextId:l}){return e?(0,et.jsx)(le.Button,{icon:bC,onClick:o,"aria-describedby":l,showTooltip:!0,label:(0,vt.__)("Unsync and edit"),__next40pxDefaultSize:!0}):t?void 0:(0,et.jsx)(le.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,et.jsx)(le.Button,{onClick:n?hj:i,label:(0,vt.__)("Submit"),icon:wI,className:"block-editor-link-control__search-submit","aria-disabled":n,size:"small"})})}fj.ViewerFill=ij,fj.DEFAULT_LINK_SETTINGS=WI;const bj=e=>(Je()("wp.blockEditor.__experimentalLinkControl",{since:"6.8",alternative:"wp.blockEditor.LinkControl"}),(0,et.jsx)(fj,{...e}));bj.ViewerFill=fj.ViewerFill,bj.DEFAULT_LINK_SETTINGS=fj.DEFAULT_LINK_SETTINGS;const kj=fj,_j=({__next40pxDefaultSize:e=!1,value:t,onChange:n,__unstableInputWidth:o="60px",...i})=>{const l=function(e){return void 0!==e&&""!==e}(t),r=(e,t)=>{if(l)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=l?t:"";return e||void 0!==i.size&&"default"!==i.size||Je()("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,et.jsx)("div",{className:"block-editor-line-height-control",children:(0,et.jsx)(le.__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=r(e.value,o);return{...e,value:i}},onChange:(e,{event:t})=>{""!==e?"click"!==t.type?n(`${e}`):n(r(`${e}`,!1)):n()},label:(0,vt.__)("Line height","kubio"),placeholder:1.5,step:.01,spinFactor:10,value:s,min:0,spinControls:"custom"})})};var yj=(0,et.jsxs)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,et.jsx)(an.Path,{d:"m7 6.5 4 2.5-4 2.5z"}),(0,et.jsx)(an.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"})]}),xj=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})}),Sj=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"})});const wj=(0,le.withFilters)("editor.MediaUpload")((()=>null)),Cj=function({fallback:e=null,children:t}){const n=(0,h.useSelect)((e=>{const{getSettings:t}=e(ba);return!!t().mediaUpload}),[]);return n?t:e};function Bj(e,t,n){if(n)return n;if(!t||"object"!=typeof t||0===Object.keys(t).length)return e&&e.length>0?e.map((e=>`${e}/*`)).join(","):void 0;if(!e||0===e.length)return;const o=[];for(const[,n]of Object.entries(t))e.some((e=>e.includes("/")?n===e:n.startsWith(`${e}/`)))&&o.push(n);return o.length>0?o.join(","):e.map((e=>`${e}/*`)).join(",")}const Ij=()=>{};let jj=0;const Ej=(0,g.compose)([(0,h.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(Wh.store);return{createNotice:t,removeNotice:n}})),(0,le.withFilters)("editor.MediaReplaceFlow")])((({mediaURL:e,mediaId:t,mediaIds:n,allowedTypes:o,accept:i,onError:l,onSelect:r,onSelectURL:s,onReset:a,onToggleFeaturedImage:c,useFeaturedImage:d,onFilesUpload:g=Ij,name:m=(0,vt.__)("Replace"),createNotice:f,removeNotice:v,children:b,multiple:k=!1,addToGallery:_,handleUpload:y=!0,variant:x,popoverProps:S,renderToggle:w,className:C})=>{const{mediaUpload:B,allowedMimeTypes:I}=(0,h.useSelect)((e=>{const{getSettings:t}=e(ba),n=t();return{mediaUpload:n.mediaUpload,allowedMimeTypes:n.allowedMimeTypes}}),[]),j="block-editor/media-replace-flow/error-notice/"+ ++jj,E=(0,p.useMemo)((()=>Bj(o,I,i)),[o,I,i]),T=e=>{const t=(0,Ih.__unstableStripHTML)(e);l?l(t):setTimeout((()=>{f("error",t,{speak:!0,id:j,isDismissible:!0})}),1e3)},P=(e,t)=>{d&&c&&c(),t(),r(e),(0,gr.speak)((0,vt.__)("The media file has been replaced")),v(j)},M=e=>{e.keyCode===Jd.DOWN&&(e.preventDefault(),e.target.click())},R=k&&!(!o||0===o.length)&&o.every((e=>"image"===e||e.startsWith("image/"))),N={...S,variant:x};return(0,et.jsx)(le.Dropdown,{popoverProps:N,className:C,contentClassName:u("block-editor-media-replace-flow__options",x&&`is-variant-${x}`),renderToggle:({isOpen:e,onToggle:t})=>w?w({"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:M,children:m}):(0,et.jsx)(le.ToolbarButton,{"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:M,children:m}),renderContent:({onClose:i})=>(0,et.jsxs)(et.Fragment,{children:[(0,et.jsxs)(le.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu",children:[(0,et.jsxs)(Cj,{children:[(0,et.jsx)(wj,{gallery:R,addToGallery:_,multiple:k,value:k?n:t,onSelect:e=>P(e,i),allowedTypes:o,render:({open:e})=>(0,et.jsx)(le.MenuItem,{icon:yj,onClick:e,children:(0,vt.__)("Open Media Library")})}),(0,et.jsx)(le.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!y)return t(),r(n);g(n),B({allowedTypes:o,filesList:n,onFileChange:([e])=>{P(e,t)},onError:T})})(e,i)},accept:E,multiple:!!k,render:({openFileDialog:e})=>(0,et.jsx)(le.MenuItem,{icon:xj,onClick:()=>{e()},children:(0,vt._x)("Upload","verb")})})]}),c&&(0,et.jsx)(le.MenuItem,{icon:Sj,onClick:c,isPressed:d,children:(0,vt.__)("Use featured image")}),"function"==typeof b?b({onClose:i}):b,e&&a&&(0,et.jsx)(le.MenuItem,{onClick:()=>{a(),i()},children:(0,vt.__)("Reset")})]}),s&&(0,et.jsxs)("form",{className:"block-editor-media-flow__url-input",children:[(0,et.jsx)("span",{className:"block-editor-media-replace-flow__image-url-label",children:(0,vt.__)("Current media URL:")}),(0,et.jsx)(kj,{value:{url:e},settings:[],showSuggestions:!1,onChange:({url:e})=>{s(e)},searchInputPlaceholder:(0,vt.__)("Paste or type URL")})]})]})})}));function Tj({url:e,urlLabel:t,className:n}){const o=u(n,"block-editor-url-popover__link-viewer-url");return e?(0,et.jsx)(le.ExternalLink,{className:o,href:e,children:t||(0,it.filterURLForDisplay)((0,it.safeDecodeURI)(e))}):(0,et.jsx)("span",{className:o})}function Pj(e){return Pj="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},Pj(e)}function Mj(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rj(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 Nj(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 Lj(e){return Nj(e)}function Aj(e){return Nj(e,!0)}function Dj(e){var t=function(e){var t,n,o,i=e.ownerDocument,l=i.body,r=i&&i.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=r.clientLeft||l.clientLeft||0,top:o-=r.clientTop||l.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=Lj(o),t.top+=Aj(o),t}var Oj,zj=new RegExp("^(".concat(/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,")(?!px)[a-z%]+$"),"i"),Vj=/^(top|right|bottom|left)$/,Fj="currentStyle",Hj="runtimeStyle",Gj="left";function $j(e,t){for(var n=0;n<e.length;n++)t(e[n])}function Uj(e){return"border-box"===Oj(e,"boxSizing")}"undefined"!=typeof window&&(Oj=window.getComputedStyle?function(e,t,n){var o="",i=e.ownerDocument,l=n||i.defaultView.getComputedStyle(e,null);return l&&(o=l.getPropertyValue(t)||l[t]),o}:function(e,t){var n=e[Fj]&&e[Fj][t];if(zj.test(n)&&!Vj.test(t)){var o=e.style,i=o[Gj],l=e[Hj][Gj];e[Hj][Gj]=e[Fj][Gj],o[Gj]="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o[Gj]=i,e[Hj][Gj]=l}return""===n?"auto":n});var Wj=["margin","border","padding"],Kj=-1,Zj=2,qj=1;function Yj(e,t,n){var o,i,l,r=0;for(i=0;i<t.length;i++)if(o=t[i])for(l=0;l<n.length;l++){var s;s="border"===o?"".concat(o+n[l],"Width"):o+n[l],r+=parseFloat(Oj(e,s))||0}return r}function Qj(e){return null!=e&&e==e.window}var Xj={};function Jj(e,t,n){if(Qj(e))return"width"===t?Xj.viewportWidth(e):Xj.viewportHeight(e);if(9===e.nodeType)return"width"===t?Xj.docWidth(e):Xj.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],i="width"===t?e.offsetWidth:e.offsetHeight,l=(Oj(e),Uj(e)),r=0;(null==i||i<=0)&&(i=void 0,(null==(r=Oj(e,t))||Number(r)<0)&&(r=e.style[t]||0),r=parseFloat(r)||0),void 0===n&&(n=l?qj:Kj);var s=void 0!==i||l,a=i||r;if(n===Kj)return s?a-Yj(e,["border","padding"],o):r;if(s){var c=n===Zj?-Yj(e,["border"],o):Yj(e,["margin"],o);return a+(n===qj?0:c)}return r+Yj(e,Wj.slice(n),o)}$j(["Width","Height"],(function(e){Xj["doc".concat(e)]=function(t){var n=t.document;return Math.max(n.documentElement["scroll".concat(e)],n.body["scroll".concat(e)],Xj["viewport".concat(e)](n))},Xj["viewport".concat(e)]=function(t){var n="client".concat(e),o=t.document,i=o.body,l=o.documentElement[n];return"CSS1Compat"===o.compatMode&&l||i&&i[n]||l}}));var eE={position:"absolute",visibility:"hidden",display:"block"};function tE(e){var t,n=arguments;return 0!==e.offsetWidth?t=Jj.apply(void 0,n):function(e,o,i){var l,r={},s=e.style;for(l in o)o.hasOwnProperty(l)&&(r[l]=s[l],s[l]=o[l]);for(l in function(){t=Jj.apply(void 0,n)}.call(e),o)o.hasOwnProperty(l)&&(s[l]=r[l])}(e,eE),t}function nE(e,t,n){var o=n;if("object"!==Pj(t))return void 0!==o?("number"==typeof o&&(o+="px"),void(e.style[t]=o)):Oj(e,t);for(var i in t)t.hasOwnProperty(i)&&nE(e,i,t[i])}$j(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);Xj["outer".concat(t)]=function(t,n){return t&&tE(t,e,n?0:qj)};var n="width"===e?["Left","Right"]:["Top","Bottom"];Xj[e]=function(t,o){return void 0===o?t&&tE(t,e,Kj):t?(Oj(t),Uj(t)&&(o+=Yj(t,["padding","border"],n)),nE(t,e,o)):void 0}}));var oE=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rj(n,!0).forEach((function(t){Mj(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rj(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 Dj(e);!function(e,t){"static"===nE(e,"position")&&(e.style.position="relative");var n,o,i=Dj(e),l={};for(o in t)t.hasOwnProperty(o)&&(n=parseFloat(nE(e,o))||0,l[o]=n+t[o]-i[o]);nE(e,l)}(e,t)},isWindow:Qj,each:$j,css:nE,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(Qj(e)){if(void 0===t)return Lj(e);window.scrollTo(t,Aj(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(Qj(e)){if(void 0===t)return Aj(e);window.scrollTo(Lj(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},Xj);function iE(e){return"function"==typeof e}class lE extends p.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,p.createRef)(),this.inputRef=e.inputRef||(0,p.createRef)(),this.updateSuggestions=(0,g.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=oE.getWindow(t));var o=n.allowHorizontalScroll,i=n.onlyScrollIfNeeded,l=n.alignWithTop,r=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,m,f,v,b,k,_,y=oE.isWindow(t),x=oE.offset(e),S=oE.outerHeight(e),w=oE.outerWidth(e);y?(v=t,_=oE.height(v),k=oE.width(v),b={left:oE.scrollLeft(v),top:oE.scrollTop(v)},m={left:x.left-b.left-a,top:x.top-b.top-s},f={left:x.left+w-(b.left+k)+u,top:x.top+S-(b.top+_)+c},g=b):(d=oE.offset(t),p=t.clientHeight,h=t.clientWidth,g={left:t.scrollLeft,top:t.scrollTop},m={left:x.left-(d.left+(parseFloat(oE.css(t,"borderLeftWidth"))||0))-a,top:x.top-(d.top+(parseFloat(oE.css(t,"borderTopWidth"))||0))-s},f={left:x.left+w-(d.left+h+(parseFloat(oE.css(t,"borderRightWidth"))||0))+u,top:x.top+S-(d.top+p+(parseFloat(oE.css(t,"borderBottomWidth"))||0))+c}),m.top<0||f.top>0?!0===l?oE.scrollTop(t,g.top+m.top):!1===l?oE.scrollTop(t,g.top+f.top):m.top<0?oE.scrollTop(t,g.top+m.top):oE.scrollTop(t,g.top+f.top):i||((l=void 0===l||!!l)?oE.scrollTop(t,g.top+m.top):oE.scrollTop(t,g.top+f.top)),o&&(m.left<0||f.left>0?!0===r?oE.scrollLeft(t,g.left+m.left):!1===r?oE.scrollLeft(t,g.left+f.left):m.left<0?oE.scrollLeft(t,g.left+m.left):oE.scrollLeft(t,g.left+f.left):i||((r=void 0===r||!!r)?oE.scrollLeft(t,g.left+m.left):oE.scrollLeft(t,g.left+f.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 l,r;if(e=e.trim(),!i&&(e.length<2||!o&&(0,it.isURL)(e)))return null===(l=this.suggestionsRequest)||void 0===l||null===(r=l.cancel)||void 0===r||r.call(l),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,vt.sprintf)(/* translators: %s: number of results. */ /* translators: %s: number of results. */(0,vt._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,vt.__)("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;const 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:l,loading:r}=this.state;if(!o||!l.length||r){switch(e.keyCode){case Jd.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case Jd.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case Jd.ENTER:this.props.onSubmit&&(e.preventDefault(),this.props.onSubmit(null,e))}return}const s=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case Jd.UP:{e.preventDefault();const t=i?i-1:l.length-1;this.setState({selectedSuggestion:t});break}case Jd.DOWN:{e.preventDefault();const t=null===i||i===l.length-1?0:i+1;this.setState({selectedSuggestion:t});break}case Jd.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(s),this.props.speak((0,vt.__)("Link selected.","kubio")));break;case Jd.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 l=i;const r=e&&e.length;return o||r||(l=!1),!0===n&&(l=!1),{showSuggestions:l,suggestionsListboxId:`block-editor-url-input-suggestions-${t}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${t}`}}render(){return(0,et.jsxs)(et.Fragment,{children:[this.renderControl(),this.renderSuggestions()]})}renderControl(){const{label:e=null,className:t,isFullWidth:n,instanceId:o,placeholder:i=(0,vt.__)("Paste URL or type to search","kubio"),__experimentalRenderControl:l,value:r="",hideLabelFromVision:s=!1,help:a=null,disabled:c=!1}=this.props,{loading:d,showSuggestions:p,selectedSuggestion:h,suggestionsListboxId:g,suggestionOptionIdPrefix:m}=this.state,f=`url-input-control-${o}`,v={id:f,label:e,className:u("block-editor-url-input",t,{"is-full-width":n}),hideLabelFromVision:s},b={id:f,value:r,required:!0,className:"block-editor-url-input__input",type:"text",onChange:c?()=>{}:this.onChange,onFocus:c?()=>{}:this.onFocus,placeholder:i,onKeyDown:c?()=>{}:this.onKeyDown,role:"combobox","aria-label":e?void 0:(0,vt.__)("URL","kubio"),"aria-expanded":p,"aria-autocomplete":"list","aria-owns":g,"aria-activedescendant":null!==h?`${m}-${h}`:void 0,ref:this.inputRef,disabled:c,suffix:this.props.suffix,help:a};return l?l(v,b,d):(0,et.jsxs)(le.BaseControl,{__nextHasNoMarginBottom:!0,...v,children:[(0,et.jsx)(le.__experimentalInputControl,{...b,__next40pxDefaultSize:!0}),d&&(0,et.jsx)(le.Spinner,{})]})}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:n,suggestions:o,suggestionsValue:i,selectedSuggestion:l,suggestionsListboxId:r,suggestionOptionIdPrefix:s,loading:a}=this.state;if(!n||0===o.length)return null;const c={id:r,ref:this.autocompleteRef,role:"listbox"},d=(e,t)=>({role:"option",tabIndex:"-1",id:`${s}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===l||void 0});return iE(t)?t({suggestions:o,selectedSuggestion:l,suggestionsListProps:c,buildSuggestionItemProps:d,isLoading:a,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!(null!=i&&i.length),currentInputValue:i}):(0,et.jsx)(le.Popover,{placement:"bottom",focusOnMount:!1,children:(0,et.jsx)("div",{...c,className:u("block-editor-url-input__suggestions",{[`${e}__suggestions`]:e}),children:o.map(((e,t)=>(0,ff.createElement)(le.Button,{__next40pxDefaultSize:!0,...d(0,t),key:e.id,className:u("block-editor-url-input__suggestion",{"is-selected":t===l}),onClick:()=>this.handleOnClick(e)},e.title)))})})}}const rE=(0,g.compose)(g.withSafeTimeout,le.withSpokenMessages,g.withInstanceId,(0,h.withSelect)(((e,t)=>{if(iE(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(ba);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(lE),{__experimentalPopoverLegacyPositionToPlacement:sE}=fe(le.privateApis),aE=(0,p.forwardRef)((({additionalControls:e,children:t,renderSettings:n,placement:o,focusOnMount:i="firstElement",position:l,...r},s)=>{let a;void 0!==l&&Je()("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"}),void 0!==o?a=o:void 0!==l&&(a=sE(l)),a=a||"bottom";const[c,u]=(0,p.useState)(!1),d=!!n&&c;return(0,et.jsxs)(le.Popover,{ref:s,role:"dialog","aria-modal":"true","aria-label":(0,vt.__)("Edit URL"),className:"block-editor-url-popover",focusOnMount:i,placement:a,shift:!0,variant:"toolbar",...r,children:[(0,et.jsx)("div",{className:"block-editor-url-popover__input-container",children:(0,et.jsxs)("div",{className:"block-editor-url-popover__row",children:[t,!!n&&(0,et.jsx)(le.Button,{className:"block-editor-url-popover__settings-toggle",icon:uy,label:(0,vt.__)("Link settings"),onClick:()=>{u(!c)},"aria-expanded":c,size:"compact"})]})}),d&&(0,et.jsx)("div",{className:"block-editor-url-popover__settings",children:n()}),e&&!d&&(0,et.jsx)("div",{className:"block-editor-url-popover__additional-controls",children:e})]})}));aE.LinkEditor=function({autocompleteRef:e,className:t,onChangeInputValue:n,value:o,...i}){return(0,et.jsxs)("form",{className:u("block-editor-url-popover__link-editor",t),...i,children:[(0,et.jsx)(rE,{value:o,onChange:n,autocompleteRef:e}),(0,et.jsx)(le.Button,{icon:wI,label:(0,vt.__)("Apply"),type:"submit",size:"compact"})]})},aE.LinkViewer=function({className:e,linkClassName:t,onEditLinkClick:n,url:o,urlLabel:i,...l}){return(0,et.jsxs)("div",{className:u("block-editor-url-popover__link-viewer",e),...l,children:[(0,et.jsx)(Tj,{url:o,urlLabel:i,className:t}),n&&(0,et.jsx)(le.Button,{icon:iS,label:(0,vt.__)("Edit"),onClick:n,size:"compact"})]})};const cE=aE,uE=()=>{},dE=({src:e,onChange:t,onSubmit:n,onClose:o,popoverAnchor:i})=>(0,et.jsx)(cE,{anchor:i,onClose:o,children:(0,et.jsx)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:n,children:(0,et.jsx)(le.__experimentalInputControl,{__next40pxDefaultSize:!0,label:(0,vt.__)("URL"),type:"text",hideLabelFromVision:!0,placeholder:(0,vt.__)("Paste or type URL"),onChange:t,value:e,suffix:(0,et.jsx)(le.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,et.jsx)(le.Button,{size:"small",icon:wI,label:(0,vt.__)("Apply"),type:"submit"})})})})}),pE=({src:e,onChangeSrc:t,onSelectURL:n})=>{const[o,i]=(0,p.useState)(null),[l,r]=(0,p.useState)(!1),s=()=>{r(!1),null==o||o.focus()};return(0,et.jsxs)("div",{className:"block-editor-media-placeholder__url-input-container",children:[(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__button",onClick:()=>{r(!0)},isPressed:l,variant:"secondary","aria-haspopup":"dialog",ref:i,children:(0,vt.__)("Insert from URL")}),l&&(0,et.jsx)(dE,{src:e,onChange:t,onSubmit:t=>{t.preventDefault(),e&&n&&(n(e),s())},onClose:s,popoverAnchor:o})]})},hE=(0,le.withFilters)("editor.MediaPlaceholder")((function({value:e={},allowedTypes:t,className:n,icon:o,labels:i={},mediaPreview:l,notices:r,isAppender:s,accept:a,addToGallery:c,multiple:d=!1,handleUpload:g=!0,disableDropZone:m,disableMediaButtons:f,onError:v,onSelect:b,onCancel:k,onSelectURL:_,onToggleFeaturedImage:y,onDoubleClick:x,onFilesPreUpload:S=uE,onHTMLDrop:w,children:C,mediaLibraryButton:B,placeholder:I,style:j}){w&&Je()("wp.blockEditor.MediaPlaceholder onHTMLDrop prop",{since:"6.2",version:"6.4"});const{mediaUpload:E,allowedMimeTypes:T}=(0,h.useSelect)((e=>{const{getSettings:t}=e(ba),n=t();return{mediaUpload:n.mediaUpload,allowedMimeTypes:n.allowedMimeTypes}}),[]),[P,M]=(0,p.useState)("");(0,p.useEffect)((()=>{M((null==e?void 0:e.src)??"")}),[null==e?void 0:e.src]);const R=(0,p.useMemo)((()=>Bj(t,T,a)),[t,T,a]),N=n=>{if(!g||"function"==typeof g&&!g(n))return b(n);let o;if(S(n),d)if(c){let t=[];o=n=>{const o=(e??[]).filter((e=>e.id?!t.some((({id:t})=>Number(t)===Number(e.id))):!t.some((({urlSlug:t})=>e.url.includes(t)))));b(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=b;else o=([e])=>b(e);E({allowedTypes:t,filesList:n,onFileChange:o,onError:v,multiple:d})};async function L(e){const{blocks:n}=km(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((l=>E({filesList:[l],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=>v(e)));null!=o&&o.length&&b(d?o:o[0])}const A=e=>{N(e.target.files)},D=I??(e=>{let{instructions:a,title:c}=i;if(E||_||(a=(0,vt.__)("To edit this block, you need permission to upload media.")),void 0===a||void 0===c){const e=t??[],[n]=e,o=1===e.length,i=o&&"audio"===n,l=o&&"image"===n,r=o&&"video"===n;void 0===a&&E&&(a=(0,vt.__)("Drag and drop an image or video, upload, or choose from your library."),i?a=(0,vt.__)("Drag and drop an audio file, upload, or choose from your library."):l?a=(0,vt.__)("Drag and drop an image, upload, or choose from your library."):r&&(a=(0,vt.__)("Drag and drop a video, upload, or choose from your library."))),void 0===c&&(c=(0,vt.__)("Media"),i?c=(0,vt.__)("Audio"):l?c=(0,vt.__)("Image"):r&&(c=(0,vt.__)("Video")))}const d=u("block-editor-media-placeholder",n,{"is-appender":s});return(0,et.jsxs)(le.Placeholder,{icon:o,label:c,instructions:a,className:d,notices:r,onDoubleClick:x,preview:l,style:j,children:[e,C]})}),O=()=>m?null:(0,et.jsx)(le.DropZone,{onFilesDrop:N,onDrop:L,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)))&&(!!d||1===n.length)}}),z=()=>k&&(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__cancel-button",title:(0,vt.__)("Cancel"),variant:"link",onClick:k,children:(0,vt.__)("Cancel")}),V=()=>_&&(0,et.jsx)(pE,{src:P,onChangeSrc:M,onSelectURL:_}),F=()=>y&&(0,et.jsx)("div",{className:"block-editor-media-placeholder__url-input-container",children:(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__button",onClick:y,variant:"secondary",children:(0,vt.__)("Use featured image")})});return f?(0,et.jsx)(Cj,{children:O()}):(0,et.jsx)(Cj,{fallback:D(V()),children:(()=>{const n=B??(({open:e})=>(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{e()},children:(0,vt.__)("Media Library")})),o=(0,et.jsx)(wj,{addToGallery:c,gallery:d&&!(!t||0===t.length)&&t.every((e=>"image"===e||e.startsWith("image/"))),multiple:d,onSelect:b,allowedTypes:t,mode:"browse",value:Array.isArray(e)?e.map((({id:e})=>e)):e.id,render:n});if(E&&s)return(0,et.jsxs)(et.Fragment,{children:[O(),(0,et.jsx)(le.FormFileUpload,{onChange:A,accept:R,multiple:!!d,render:({openFileDialog:e})=>{const t=(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,variant:"primary",className:u("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:e,children:(0,vt._x)("Upload","verb")}),o,V(),F(),z()]});return D(t)}})]});if(E){const e=(0,et.jsxs)(et.Fragment,{children:[O(),(0,et.jsx)(le.FormFileUpload,{render:({openFileDialog:e})=>(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,onClick:e,variant:"primary",className:u("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),children:(0,vt._x)("Upload","verb")}),onChange:A,accept:R,multiple:!!d}),o,V(),F(),z()]});return D(e)}return D(o)})()})})),gE=({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,et.jsx)(pB,{settings:n,gradients:[],disableCustomGradients:!0,...t})};function mE(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function fE({allowedFormats:e,disableFormats:t}){return t?fE.EMPTY_ARRAY:e}function vE(e,t){if(ZE.isEmpty(e)){const e=mE(t);return e?`<${e}></${e}>`:""}return Array.isArray(e)?(Je()("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/"}),d.children.toHTML(e)):"string"==typeof e?e:e.toHTMLString()}function bE({value:e,tagName:t,multiline:n,format:o,...i}){return e=(0,et.jsx)(p.RawHTML,{children:vE(e,n)}),t?(0,et.jsx)(t,{...i,children:e}):e}fE.EMPTY_ARRAY=[];const kE=["`",'"',"'","“”","‘’"];function _E(e){let t=e.length;for(;t--;){const n=qr(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].toString().replace(Zr,""),[e[t].clientId,n,0,0];const o=_E(e[t].innerBlocks);if(o)return o}return[]}const yE=[e=>t=>{function n(n){const{inputType:o,data:i}=n,{value:l,onChange:r,registry:s}=e.current;if("insertText"!==o)return;if((0,un.isCollapsed)(l))return;const a=(0,m.applyFilters)("blockEditor.wrapSelectionSettings",kE).find((([e,t])=>e===i||t===i));if(!a)return;const[c,u=c]=a,d=l.start,p=l.end+c.length;let h=(0,un.insert)(l,c,d,d);h=(0,un.insert)(h,u,p,p);const{__unstableMarkLastChangeAsPersistent:g,__unstableMarkAutomaticChange:f}=s.dispatch(ba);g(),r(h),f();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 l=t(),{start:r,text:s}=l;if(" "!==s.slice(r-1,r))return;const a=s.slice(0,r).trim(),c=(0,d.getBlockTransforms)("from").filter((({type:e})=>"prefix"===e)),u=(0,d.findTransform)(c,(({prefix:e})=>a===e));if(!u)return;const p=(0,un.toHTMLString)({value:(0,un.insert)(l,Zr,0,r)}),h=u.transform(p);return o(..._E([h])),n([h]),i.dispatch(ba).__unstableMarkAutomaticChange(),!0}function o(t){const{inputType:o,type:i}=t,{getValue:l,onChange:r,__unstableAllowPrefixTransformations:s,formatTypes:a,registry:c,onReplace:u}=e.current;if("insertText"!==o&&"compositionend"!==i)return;if(s&&n())return;const p=l(),h=(0,d.getBlockTransforms)("from").filter((e=>"input"===e.type)),g=(0,d.findTransform)(h,(e=>e.regExp.test(p.text)));if(g)return u(g.transform()),void c.dispatch(ba).__unstableMarkAutomaticChange();const m=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,un.insert)(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️")}(p)),{__unstableMarkLastChangeAsPersistent:f,__unstableMarkAutomaticChange:v}=c.dispatch(ba);m!==p&&(f(),r({...m,activeFormats:p.activeFormats}),v())}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(ba).__unstableMarkLastChangeAsPersistent()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}},()=>e=>{function t(e){(Jd.isKeyboardEvent.primary(e,"z")||Jd.isKeyboardEvent.primary(e,"y")||Jd.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!==Jd.BACKSPACE&&n!==Jd.ESCAPE)return;const{registry:o}=e.current,{didAutomaticChange:i,getSettings:l}=o.select(ba),{__experimentalUndo:r}=l();r&&i()&&(t.preventDefault(),r())}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{function n(n){const{disableFormats:o,onChange:i,value:l,formatTypes:r,tagName:s,onReplace:a,__unstableEmbedURLOnPaste:c,preserveWhiteSpace:u,pastePlainText:p}=e.current;if(!t.contains(n.target))return;if(n.defaultPrevented)return;const{plainText:h,html:g}=Zh(n);if(n.preventDefault(),window.console.log("Received HTML (RichText):\n\n",g),window.console.log("Received plain text (RichText):\n\n",h),o)return void i((0,un.insert)(l,h));function m(e){const t=r.reduce(((e,{__unstablePasteRule:t})=>(t&&e===l&&(e=t(l,{html:g,plainText:h})),e)),l);if(t!==l)i(t);else{const t=(0,un.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,l.activeFormats),i((0,un.insert)(l,t))}}if("true"===n.clipboardData.getData("rich-text"))return void m(g);if(p)return void i((0,un.insert)(l,(0,un.create)({text:h})));let f="INLINE";const v=h.trim();c&&(0,un.isEmpty)(l)&&(0,it.isURL)(v)&&/^https?:/.test(v)&&(f="BLOCKS");const b=(0,d.pasteHandler)({HTML:g,plainText:h,mode:f,tagName:s,preserveWhiteSpace:u});"string"==typeof b?m(b):b.length>0&&a&&(0,un.isEmpty)(l)&&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}=t;if(t.defaultPrevented)return;const{value:o,onMerge:i,onRemove:l}=e.current;if(n===Jd.DELETE||n===Jd.BACKSPACE){const{start:e,end:r,text:s}=o,a=n===Jd.BACKSPACE,c=o.activeFormats&&!!o.activeFormats.length;if(!(0,un.isCollapsed)(o)||c||a&&0!==e||!a&&r!==s.length)return;i?i(!a):l&&(0,un.isEmpty)(o)&&a&&l(!a),t.preventDefault()}}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{function n(t){if(t.keyCode!==Jd.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!==Jd.ENTER)return;const{value:o,onChange:i,disableLineBreaks:l,onSplitAtEnd:r,onSplitAtDoubleLineEnd:s,registry:a}=e.current;n.preventDefault();const{text:c,start:u,end:d}=o;n.shiftKey?l||i((0,un.insert)(o,"\n")):r&&u===d&&d===c.length?r():s&&u===d&&d===c.length&&"\n\n"===c.slice(-2)?a.batch((()=>{const e={...o};e.start=e.end-2,i((0,un.remove)(e)),s()})):l||i((0,un.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(ba).isMultiSelecting())return;const o=t.parentElement.closest('[contenteditable="true"]');o&&o.focus()}return t.addEventListener("focus",n),()=>{t.removeEventListener("focus",n)}}];function xE(e){const t=(0,p.useRef)(e);(0,p.useInsertionEffect)((()=>{t.current=e}));const n=(0,p.useMemo)((()=>yE.map((e=>e(t)))),[t]);return(0,g.useRefEffect)((t=>{if(!e.isSelected)return;const o=n.map((e=>e(t)));return()=>{o.forEach((e=>e()))}}),[n,e.isSelected])}const SE={},wE=Symbol("usesContext");function CE({onChange:e,onFocus:t,value:n,forwardedRef:o,settings:i,isVisible:l}){const{name:r,edit:s,[wE]:a}=i,c=(0,p.useContext)(ot),u=(0,p.useMemo)((()=>a?Object.fromEntries(Object.entries(c).filter((([e])=>a.includes(e)))):SE),[a,c]);if(!s)return null;const d=(0,un.getActiveFormat)(n,r),h=void 0!==d,g=(0,un.getActiveObject)(n),m=void 0!==g&&g.type===r;return(0,et.jsx)(s,{isActive:h,isVisible:l,activeAttributes:h&&d.attributes||{},isObjectActive:m,activeObjectAttributes:m&&g.attributes||{},value:n,onChange:e,onFocus:t,contentRef:o,context:u},r)}function BE({formatTypes:e,...t}){var n;return null==e||null===(n=e.map)||void 0===n?void 0:n.call(e,(e=>(0,ff.createElement)(CE,{settings:e,...t,key:e.name})))}const IE={placement:"bottom-start"},jE=()=>(0,et.jsxs)(et.Fragment,{children:[["bold","italic","link","unknown"].map((e=>(0,et.jsx)(le.Slot,{name:`RichText.ToolbarControls.${e}`},e))),(0,et.jsx)(le.Slot,{name:"RichText.ToolbarControls",children:e=>{if(!e.length)return null;const t=e.map((([{props:e}])=>e)).some((({isActive:e})=>e));return(0,et.jsx)(le.ToolbarItem,{children:n=>(0,et.jsx)(le.DropdownMenu,{icon:uy/* translators: button label text should, if possible, be under 16 characters. */,label:(0,vt.__)("More"),toggleProps:{...n,className:u(n.className,{"is-pressed":t}),description:(0,vt.__)("Displays more block tools")},controls:dn(e.map((([{props:e}])=>e)),"title"),popoverProps:IE})})}})]});function EE({popoverAnchor:e}){return(0,et.jsx)(le.Popover,{placement:"top",focusOnMount:!1,anchor:e,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar",children:(0,et.jsx)(Qx,{className:"block-editor-rich-text__inline-format-toolbar-group"/* translators: accessibility text for the inline format toolbar */,"aria-label":(0,vt.__)("Format tools"),children:(0,et.jsx)(le.ToolbarGroup,{children:(0,et.jsx)(jE,{})})})})}const TE=({inline:e,editableContentElement:t})=>e?(0,et.jsx)(EE,{popoverAnchor:t}):(0,et.jsx)(Qy,{group:"inline",children:(0,et.jsx)(jE,{})}),PE=(0,p.forwardRef)((function({children:e,identifier:t,tagName:n="div",value:o="",onChange:i,multiline:l,...r},s){Je()("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}=B(),{getSelectionStart:c,getSelectionEnd:u}=(0,h.useSelect)(ba),{selectionChange:d}=(0,h.useDispatch)(ba),p=mE(l),g=`</${p}>${o=o||`<${p}></${p}>`}<${p}>`.split(`</${p}><${p}>`);function m(e){i(`<${p}>${e.join(`</${p}><${p}>`)}</${p}>`)}return g.shift(),g.pop(),(0,et.jsx)(n,{ref:s,children:g.map(((e,n)=>(0,et.jsx)($E,{identifier:`${t}-${n}`,tagName:p,value:e,onChange:e=>{const t=g.slice();t[n]=e,m(t)},isSelected:void 0,onKeyDown:o=>{if(o.keyCode!==Jd.ENTER)return;o.preventDefault();const{offset:i}=c(),{offset:l}=u();if("number"!=typeof i||"number"!=typeof l)return;const r=(0,un.create)({html:e});r.start=i,r.end=l;const s=(0,un.split)(r).map((e=>(0,un.toHTMLString)({value:e}))),p=g.slice();p.splice(n,1,...s),m(p),d(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}m(o),d(a,`${t}-${n-(e?0:1)}`,i,i)},...r},n)))})}));function ME(e){return e(un.store).getFormatTypes()}const RE=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function NE(e,t){return"object"!=typeof e?{[t]:e}:Object.fromEntries(Object.entries(e).map((([e,n])=>[`${t}.${e}`,n])))}function LE(e,t){return e[t]?e[t]:Object.keys(e).filter((e=>e.startsWith(t+"."))).reduce(((n,o)=>(n[o.slice(t.length+1)]=e[o],n)),{})}function AE({inputType:e,onInput:t}){const n=(0,p.useContext)(FE),o=(0,p.useRef)();return o.current=t,(0,p.useEffect)((()=>{function t(t){t.inputType===e&&(o.current(),t.preventDefault())}return n.current.add(t),()=>{n.current.delete(t)}}),[e]),null}function DE({character:e,type:t,onUse:n}){const o=(0,p.useContext)(VE),i=(0,p.useRef)();return i.current=n,(0,p.useEffect)((()=>{function n(n){Jd.isKeyboardEvent[t](n,e)&&(i.current(),n.preventDefault())}return o.current.add(n),()=>{o.current.delete(n)}}),[e,t]),null}function OE({name:e,shortcutType:t,shortcutCharacter:n,...o}){let i,l="RichText.ToolbarControls";return e&&(l+=`.${e}`),t&&n&&(i=Jd.displayShortcut[t](n)),(0,et.jsx)(le.Fill,{name:l,children:(0,et.jsx)(le.ToolbarButton,{...o,shortcut:i})})}let zE;if(un.privateApis){const e=fe(un.privateApis);zE=e.useRichText}else zE=e=>{const{richTextIdentifier:t,blockClientId:n}=e.__unstableFormatTypeHandlerContext,{withoutInteractiveFormatting:o,allowedFormats:i}=e,{formatTypes:l,prepareHandlers:r,valueHandlers:s,changeHandlers:a,dependencies:c}=function({clientId:e,identifier:t,allowedFormats:n,withoutInteractiveFormatting:o,disableNoneEssentialFormatting:i=!1}){const l=(0,h.useSelect)(ME,[]),r=(0,p.useMemo)((()=>l.filter((({name:e,interactive:t,tagName:l,[Tt]:r})=>!(n&&!n.includes(e)||i&&!r||o&&(t||RE.has(l)))))),[l,n,i,o]),s=(0,h.useSelect)((n=>r.reduce(((o,i)=>i.__experimentalGetPropsForEditableTreePreparation?{...o,...NE(i.__experimentalGetPropsForEditableTreePreparation(n,{richTextIdentifier:t,blockClientId:e}),i.name)}:o),{})),[r,e,t]),a=(0,h.useDispatch)(),c=[],u=[],d=[],g=[];for(const e in s)g.push(s[e]);return r.forEach((n=>{if(n.__experimentalCreatePrepareEditableTree){const o=n.__experimentalCreatePrepareEditableTree(LE(s,n.name),{richTextIdentifier:t,blockClientId:e});n.__experimentalCreateOnChangeEditableValue?u.push(o):c.push(o)}if(n.__experimentalCreateOnChangeEditableValue){let o={};n.__experimentalGetPropsForEditableTreeChangeHandler&&(o=n.__experimentalGetPropsForEditableTreeChangeHandler(a,{richTextIdentifier:t,blockClientId:e}));const i=LE(s,n.name);d.push(n.__experimentalCreateOnChangeEditableValue({..."object"==typeof i?i:{},...o},{richTextIdentifier:t,blockClientId:e}))}})),{formatTypes:r,prepareHandlers:c,valueHandlers:u,changeHandlers:d,dependencies:g}}({clientId:n,identifier:t,withoutInteractiveFormatting:o,allowedFormats:i});return{...(0,un.__unstableUseRichText)({...e,__unstableDependencies:[...c,...e.__unstableDependencies],__unstableAfterParse:function(e){return s.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:function(e){return l.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,un.removeFormat)(e,t.name,0,e.text.length))})),e.formats},__unstableAddInvisibleFormats:function(e){return r.reduce(((t,n)=>n(t,e.text)),e.formats)},onChange(t,{__unstableFormats:n,__unstableText:o}){e.onChange(t,{__unstableFormats:n,__unstableText:o}),Object.values(a).forEach((e=>{e(n,o)}))}}),formatTypes:l}};const VE=(0,p.createContext)();VE.displayName="keyboardShortcutContext";const FE=(0,p.createContext)();FE.displayName="inputEventContext";const HE=Symbol("instanceId");function GE(e){const{__unstableMobileNoFocusOnMount:t,deleteEnter:n,placeholderTextColor:o,textAlign:i,selectionColor:l,tagsToEliminate:r,disableEditingMenu:s,fontSize:a,fontFamily:c,fontWeight:u,fontStyle:d,minWidth:p,maxWidth:h,disableSuggestions:g,disableAutocorrection:m,...f}=e;return f}function $E({children:e,tagName:t="div",value:n="",onChange:o,isSelected:i,multiline:l,inlineToolbar:r,wrapperClassName:s,autocompleters:a,onReplace:c,placeholder:m,allowedFormats:f,withoutInteractiveFormatting:v,onRemove:b,onMerge:k,onSplit:_,__unstableOnSplitAtEnd:x,__unstableOnSplitAtDoubleLineEnd:S,identifier:w,preserveWhiteSpace:C,__unstablePastePlainText:I,__unstableEmbedURLOnPaste:j,__unstableDisableFormats:E,disableLineBreaks:T,__unstableAllowPrefixTransformations:P,readOnly:M,...R},N){var L;R=GE(R),_&&Je()("wp.blockEditor.RichText onSplit prop",{since:"6.4",alternative:'block.json support key: "splitting"'});const A=(0,g.useInstanceId)($E),D=(0,p.useRef)(),[O,z]=(0,p.useState)(null),V=B(),{clientId:F,isSelected:H,name:G}=V,$=V[y],U=(0,p.useContext)(ot),W=(0,h.useRegistry)(),{selectionStart:K,selectionEnd:Z,isSelected:q}=(0,h.useSelect)((e=>{if(!H)return{isSelected:!1};const{getSelectionStart:t,getSelectionEnd:n}=e(ba),o=t(),l=n();let r;return void 0===i?r=o.clientId===F&&l.clientId===F&&(w?o.attributeKey===w:o[HE]===A):i&&(r=o.clientId===F),{selectionStart:r?o.offset:void 0,selectionEnd:r?l.offset:void 0,isSelected:r}}),[F,w,A,i,H]),{disableBoundBlock:Y,bindingsPlaceholder:Q,bindingsLabel:X}=(0,h.useSelect)((e=>{var t,o,i,l;if(null==$||!$[w])return{};const{__experimentalBlockBindingsSupportedAttributes:r}=e(ba).getSettings();if(!(null==r?void 0:r[G]))return{};const s=$[w],a=(0,d.getBlockBindingsSource)(s.source),c={};if(null!=a&&null!==(t=a.usesContext)&&void 0!==t&&t.length)for(const e of a.usesContext)c[e]=U[e];const u=!(null!=a&&null!==(o=a.canUserEditValue)&&void 0!==o&&o.call(a,{select:e,context:c,args:s.args}));if(n.length>0)return{disableBoundBlock:u,bindingsPlaceholder:null,bindingsLabel:null};const{getBlockAttributes:p}=e(ba),h=p(F);let g=null;if(null!=a&&a.getFieldsList){var m;const t=a.getFieldsList({select:e,context:c});g=null==t||null===(m=t.find((e=>kt()(e.args,null==s?void 0:s.args))))||void 0===m?void 0:m.label}const f=g??(null==a?void 0:a.label),v=u?f:(0,vt.sprintf)(/* translators: %s: connected field label or source label */ /* translators: %s: connected field label or source label */(0,vt.__)("Add %s","kubio"),f),b=u?(null==s||null===(i=s.args)||void 0===i?void 0:i.key)||(null==a?void 0:a.label):(0,vt.sprintf)(/* translators: %s: source label or key */ /* translators: %s: source label or key */(0,vt.__)("Empty %s; start writing to edit its value","kubio"),(null==s||null===(l=s.args)||void 0===l?void 0:l.key)||(null==a?void 0:a.label));return{disableBoundBlock:u,bindingsPlaceholder:(null==h?void 0:h.placeholder)||v,bindingsLabel:b}}),[$,w,G,n,F,U]),J=!(null==U||!U["pattern/overrides"]),ee="core/pattern-overrides"===(null==$||null===(L=$.__default)||void 0===L?void 0:L.source),te=M||Y||J&&!ee,{getSelectionStart:ne,getSelectionEnd:oe,getBlockRootClientId:ie}=(0,h.useSelect)(ba),{selectionChange:re}=(0,h.useDispatch)(ba),se=fE({allowedFormats:f,disableFormats:E}),ae=!se||se.length>0,ce=(0,p.useCallback)(((e,t)=>{const n={},o=void 0===e&&void 0===t,i={clientId:F,[w?"attributeKey":HE]:w||A};if("number"==typeof e||o){if(void 0===t&&ie(F)!==ie(oe().clientId))return;n.start={...i,offset:e}}if("number"==typeof t||o){if(void 0===e&&ie(F)!==ie(ne().clientId))return;n.end={...i,offset:t}}re(n)}),[F,ie,oe,ne,w,A,re]),{value:ue,getValue:de,onChange:pe,ref:he,formatTypes:ge}=zE({value:n,onChange:o,selectionStart:K,selectionEnd:Z,onSelectionChange:ce,placeholder:Q||m,__unstableIsSelected:q,__unstableDisableFormats:E,preserveWhiteSpace:C,__unstableDependencies:[t],allowedFormats:se,withoutInteractiveFormatting:v,__unstableFormatTypeHandlerContext:(0,p.useMemo)((()=>({richTextIdentifier:w,blockClientId:F})),[w,F])}),me=function(e){return(0,le.__unstableUseAutocompleteProps)({...e,completers:Nc(e)})}({onReplace:c,completers:a,record:ue,onChange:pe});!function({html:e,value:t}){var n;const o=(0,p.useRef)(),i=!(null===(n=t.activeFormats)||void 0===n||!n.length),{__unstableMarkLastChangeAsPersistent:l}=(0,h.useDispatch)(ba);(0,p.useLayoutEffect)((()=>{if(o.current){if(o.current!==t.text){const e=window.setTimeout((()=>{l()}),1e3);return o.current=t.text,()=>{window.clearTimeout(e)}}l()}else o.current=t.text}),[e,i])}({html:n,value:ue});const fe=(0,p.useRef)(new Set),ve=(0,p.useRef)(new Set);function be(){var e;null===(e=D.current)||void 0===e||e.focus()}const ke=t;return(0,et.jsxs)(et.Fragment,{children:[q&&(0,et.jsx)(VE.Provider,{value:fe,children:(0,et.jsx)(FE.Provider,{value:ve,children:(0,et.jsxs)(le.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after",children:[e&&e({value:ue,onChange:pe,onFocus:be}),(0,et.jsx)(BE,{value:ue,onChange:pe,onFocus:be,formatTypes:ge,forwardedRef:D})]})})}),q&&ae&&(0,et.jsx)(TE,{inline:r,editableContentElement:O}),(0,et.jsx)(ke,{role:"textbox","aria-multiline":!T,"aria-readonly":te,...R,draggable:void 0,"aria-label":X||R["aria-label"]||m,...me,ref:(0,g.useMergeRefs)([he,N,me.ref,R.ref,xE({registry:W,getValue:de,onChange:pe,__unstableAllowPrefixTransformations:P,formatTypes:ge,onReplace:c,selectionChange:re,isSelected:q,disableFormats:E,value:ue,tagName:t,onSplit:_,__unstableEmbedURLOnPaste:j,pastePlainText:I,onMerge:k,onRemove:b,disableLineBreaks:T,onSplitAtEnd:x,onSplitAtDoubleLineEnd:S,keyboardShortcuts:fe,inputEvents:ve}),D,z]),contentEditable:!te,suppressContentEditableWarning:!0,className:u("block-editor-rich-text__editable",R.className,"rich-text"),tabIndex:0!==R.tabIndex||te?R.tabIndex:null,"data-wp-block-attribute-key":w})]})}const UE=(WE=(0,p.forwardRef)($E),(0,p.forwardRef)(((e,t)=>{let n=e.value,o=e.onChange;Array.isArray(n)&&(Je()("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=d.children.toHTML(e.value),o=t=>e.onChange(d.children.fromDOM((0,un.__unstableCreateElement)(document,t).childNodes)));const i=e.multiline?PE:WE;return(0,et.jsx)(i,{...e,value:n,onChange:o,ref:t})})));var WE;UE.Content=bE,UE.isEmpty=e=>!e||0===e.length;const KE=(0,p.forwardRef)(((e,t)=>{if(B()[x]){const{children:n,tagName:o="div",value:i,onChange:l,isSelected:r,multiline:s,inlineToolbar:a,wrapperClassName:c,autocompleters:u,onReplace:d,placeholder:p,allowedFormats:h,withoutInteractiveFormatting:g,onRemove:m,onMerge:f,onSplit:v,__unstableOnSplitAtEnd:b,__unstableOnSplitAtDoubleLineEnd:k,identifier:_,preserveWhiteSpace:y,__unstablePastePlainText:x,__unstableEmbedURLOnPaste:S,__unstableDisableFormats:w,disableLineBreaks:C,__unstableAllowPrefixTransformations:B,readOnly:I,...j}=GE(e);return(0,et.jsx)(o,{ref:t,...j,dangerouslySetInnerHTML:{__html:vE(i,s)||"<br>"}})}return(0,et.jsx)(UE,{ref:t,...e,readOnly:!1})}));KE.Content=bE,KE.isEmpty=e=>!e||0===e.length;const ZE=KE,qE=(0,p.forwardRef)(((e,t)=>(0,et.jsx)(ZE,{ref:t,...e,__unstableDisableFormats:!0})));qE.Content=function({value:e="",tagName:t="div",...n}){return(0,et.jsx)(t,{...n,children:e})};const YE=qE,QE=(0,p.forwardRef)((({__experimentalVersion:e,...t},n)=>{if(2===e)return(0,et.jsx)(YE,{ref:n,...t});const{className:o,onChange:i,...l}=t;return(0,et.jsx)(Wm.Z,{ref:n,className:u("block-editor-plain-text",o),onChange:e=>i(e.target.value),...l})}));function XE({property:e,viewport:t,desc:n}){const o=(0,g.useInstanceId)(XE),i=n||(0,vt.sprintf)(/* translators: 1: property name. 2: viewport name. */ /* translators: 1: property name. 2: viewport name. */(0,vt._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,et.jsxs)(et.Fragment,{children:[(0,et.jsx)("span",{"aria-describedby":`rbc-desc-${o}`,children:t.label}),(0,et.jsx)(le.VisuallyHidden,{as:"span",id:`rbc-desc-${o}`,children:i})]})}const JE=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:i,renderDefaultControl:l,renderResponsiveControls:r,isResponsive:s=!1,defaultLabel:a={id:"all",label:(0,vt._x)("All","screen sizes")},viewports:c=[{id:"small",label:(0,vt.__)("Small screens")},{id:"medium",label:(0,vt.__)("Medium screens")},{id:"large",label:(0,vt.__)("Large screens")}]}=e;if(!t||!n||!l)return null;const d=o||(0,vt.sprintf)(/* translators: %s: Property value for the control (eg: margin, padding, etc.). */ /* translators: %s: Property value for the control (eg: margin, padding, etc.). */(0,vt.__)("Use the same %s on all screen sizes."),n),h=(0,vt.__)("Choose whether to use the same value for all screen sizes or a unique value for each screen size."),g=l((0,et.jsx)(XE,{property:n,viewport:a}),a);return(0,et.jsxs)("fieldset",{className:"block-editor-responsive-block-control",children:[(0,et.jsx)("legend",{className:"block-editor-responsive-block-control__title",children:t}),(0,et.jsxs)("div",{className:"block-editor-responsive-block-control__inner",children:[(0,et.jsx)(le.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:d,checked:!s,onChange:i,help:h}),(0,et.jsxs)("div",{className:u("block-editor-responsive-block-control__group",{"is-responsive":s}),children:[!s&&g,s&&(r?r(c):c.map((e=>(0,et.jsx)(p.Fragment,{children:l((0,et.jsx)(XE,{property:n,viewport:e}),e)},e.id))))]})]})]})};function eT({units:e,...t}){const[n]=wa("spacing.units"),o=(0,le.__experimentalUseCustomUnits)({availableUnits:n||["%","px","em","rem","vw"],units:e});return(0,et.jsx)(le.__experimentalUnitControl,{units:o,...t})}const tT=function({url:e,onChange:t}){const[n,o]=(0,p.useReducer)((e=>!e),!1);return(0,et.jsxs)("div",{className:"block-editor-url-input__button",children:[(0,et.jsx)(le.Button,{size:"compact",icon:vC,label:e?(0,vt.__)("Edit link"):(0,vt.__)("Insert link"),onClick:o,className:"components-toolbar__control",isPressed:!!e}),n&&(0,et.jsx)("form",{className:"block-editor-url-input__button-modal",onSubmit:e=>{e.preventDefault(),o()},children:(0,et.jsxs)("div",{className:"block-editor-url-input__button-modal-line",children:[(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,className:"block-editor-url-input__back",icon:cw,label:(0,vt.__)("Close"),onClick:o}),(0,et.jsx)(rE,{value:e||"",onChange:t,suffix:(0,et.jsx)(le.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,et.jsx)(le.Button,{size:"small",icon:wI,label:(0,vt.__)("Submit"),type:"submit"})})})]})})]})};var nT=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})}),oT=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z"})});const iT="none",lT="custom",rT="media",sT="attachment",aT=["noreferrer","noopener"],cT=({linkDestination:e,onChangeUrl:t,url:n,mediaType:o="image",mediaUrl:i,mediaLink:l,linkTarget:r,linkClass:s,rel:a,showLightboxSetting:c,lightboxEnabled:u,onSetLightbox:d,resetLightbox:h})=>{const[g,m]=(0,p.useState)(!1),[f,v]=(0,p.useState)(null),[b,k]=(0,p.useState)(!1),[_,y]=(0,p.useState)(null),x=(0,p.useRef)(null),S=(0,p.useRef)();(0,p.useEffect)((()=>{S.current&&(Ih.focus.focusable.find(S.current)[0]||S.current).focus()}),[b,n,u]);const w=()=>{k(!1)},C=()=>{const e=[{linkDestination:rT,title:(0,vt.__)("Link to image file"),url:"image"===o?i:void 0,icon:nT}];return"image"===o&&l&&e.push({linkDestination:sT,title:(0,vt.__)("Link to attachment page"),url:"image"===o?l:void 0,icon:Ec}),e},B=(0,et.jsxs)(le.__experimentalVStack,{spacing:"3",children:[(0,et.jsx)(le.ToggleControl,{label:(0,vt.__)("Open in new tab"),onChange:e=>{const n=(e=>{const t=e?"_blank":void 0;let n;if(t){const e=(a??"").split(" ");aT.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(a??"").split(" ").filter((e=>!1===aT.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);t(n)},checked:"_blank"===r}),(0,et.jsx)(le.TextControl,{__next40pxDefaultSize:!0,label:(0,vt.__)("Link relation"),value:a??"",onChange:e=>{t({rel:e})},help:(0,p.createInterpolateElement)((0,vt.__)("The <a>Link Relation</a> attribute defines the relationship between a linked resource and the current document."),{a:(0,et.jsx)(le.ExternalLink,{href:"https://developer.mozilla.org/docs/Web/HTML/Attributes/rel"})})}),(0,et.jsx)(le.TextControl,{__next40pxDefaultSize:!0,label:(0,vt.__)("Link CSS class"),value:s||"",onChange:e=>{t({linkClass:e})}})]}),I=null!==_?_:n,j=!u||u&&!c,E=!I&&j,T=(C().find((t=>t.linkDestination===e))||{}).title;return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(le.ToolbarButton,{icon:vC,className:"components-toolbar__control",label:(0,vt.__)("Link"),"aria-expanded":g,onClick:()=>{m(!0)},ref:v,isActive:!!n||u&&c}),g&&(0,et.jsx)(cE,{ref:S,anchor:f,onFocusOutside:e=>{const t=x.current;t&&t.contains(e.target)||(m(!1),y(null),w())},onClose:()=>{y(null),w(),m(!1)},renderSettings:j?()=>B:null,additionalControls:E&&(0,et.jsxs)(le.NavigableMenu,{children:[C().map((e=>(0,et.jsx)(le.MenuItem,{icon:e.icon,iconPosition:"left",onClick:()=>{y(null),(e=>{const n=C();let o;o=e?(n.find((t=>t.url===e))||{linkDestination:lT}).linkDestination:iT,t({linkDestination:o,href:e})})(e.url),w()},children:e.title},e.linkDestination))),c&&(0,et.jsx)(le.MenuItem,{className:"block-editor-url-popover__expand-on-click",icon:oT,info:(0,vt.__)("Scale the image with a lightbox effect."),iconPosition:"left",onClick:()=>{y(null),t({linkDestination:iT,href:""}),null==d||d(!0),w()},children:(0,vt.__)("Enlarge on click")},"expand-on-click")]}),offset:13,children:u&&c&&!n&&!b?(0,et.jsxs)("div",{className:"block-editor-url-popover__expand-on-click",children:[(0,et.jsx)(jc,{icon:oT}),(0,et.jsxs)("div",{className:"text",children:[(0,et.jsx)("p",{children:(0,vt.__)("Enlarge on click")}),(0,et.jsx)("p",{className:"description",children:(0,vt.__)("Scales the image with a lightbox effect")})]}),(0,et.jsx)(le.Button,{icon:bC,label:(0,vt.__)("Disable enlarge on click"),onClick:()=>{null==d||d(!1)},size:"compact"})]}):!n||b?(0,et.jsx)(cE.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)||lT;t({href:(0,it.prependHTTPS)(_),linkDestination:e,lightbox:{enabled:!1}})}w(),y(null),e.preventDefault()},autocompleteRef:x}):n&&!b?(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(cE.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:n,onEditLinkClick:()=>{e!==rT&&e!==sT||y(""),k(!0)},urlLabel:T}),(0,et.jsx)(le.Button,{icon:bC,label:(0,vt.__)("Remove link"),onClick:()=>{t({linkDestination:iT,href:""}),null==h||h()},size:"compact"})]}):void 0})]})},uT=[],dT=new Intl.Collator("und",{numeric:!0}).compare;function pT(){const[e,t,n,o]=wa("spacing.spacingSizes.custom","spacing.spacingSizes.theme","spacing.spacingSizes.default","spacing.defaultSpacingSizes"),i=e??uT,l=t??uT,r=n&&!1!==o?n:uT;return(0,p.useMemo)((()=>{const e=[{name:(0,vt.__)("None"),slug:"0",size:0},...i,...l,...r];return e.every((({slug:e})=>/^[0-9]/.test(e)))&&e.sort(((e,t)=>dT(e.slug,t.slug))),e.length>eu?[{name:(0,vt.__)("Default"),slug:"default",size:void 0},...e]:e}),[i,l,r])}const hT={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 gT({icon:e,isMixed:t=!1,minimumCustomValue:n,onChange:o,onMouseOut:i,onMouseOver:l,showSideInLabel:r=!0,side:s,spacingSizes:a,type:c,value:u,...d}){var g;const m=(0,h.useSelect)((e=>{const t=e(ba).getSettings();return null==t?void 0:t.disableCustomSpacingSizes})),[f]=wa("spacing.units"),v=(0,le.__experimentalUseCustomUnits)({availableUnits:f||["px","em","rem"]}),b=(0,p.useMemo)((()=>(null==a?void 0:a.map((e=>({name:e.name,slug:e.slug,size:e.size}))))||[]),[a]),k=(tu.includes(s)||["vertical","horizontal"].includes(s))&&r?iu[s]:"",_=r?null==c?void 0:c.toLowerCase():c,y=(0,vt.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,vt._x)("%1$s %2$s","spacing"),k,_).trim(),x=(null===(g=v[0])||void 0===g?void 0:g.value)||"px";return(0,et.jsx)(yB,{allowNegativeOnDrag:n<0,ariaLabel:y,className:"spacing-sizes-control",customValueSettings:hT,disableCustomValues:m,icon:e,isMixed:t,minimumCustomValue:n,onChange:o,onMouseOut:i,onMouseOver:l,presets:b,presetType:"spacing",selectedUnit:x,units:v,value:u,...d})}const mT=["vertical","horizontal"];function fT({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,sides:i,spacingSizes:l,type:r,values:s}){const a=e=>n=>{if(!t)return;const o={...Object.keys(s).reduce(((e,t)=>(e[t]=au(s[t],l),e)),{})};"vertical"===e&&(o.top=n,o.bottom=n),"horizontal"===e&&(o.left=n,o.right=n),t(o)},c=null!=i&&i.length?mT.filter((e=>uu(i,e))):mT;return(0,et.jsx)(et.Fragment,{children:c.map((t=>{const i="vertical"===t?s.top:s.left;return(0,et.jsx)(gT,{icon:ou[t],label:iu[t],minimumCustomValue:e,onChange:a(t),onMouseOut:n,onMouseOver:o,side:t,spacingSizes:l,type:r,value:i,withInputField:!1},`spacing-sizes-control-${t}`)}))})}function vT({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,sides:i,spacingSizes:l,type:r,values:s}){const a=null!=i&&i.length?tu.filter((e=>i.includes(e))):tu,c=e=>n=>{const o={...Object.keys(s).reduce(((e,t)=>(e[t]=au(s[t],l),e)),{})};o[e]=n,t(o)};return(0,et.jsx)(et.Fragment,{children:a.map((t=>(0,et.jsx)(gT,{icon:ou[t],label:iu[t],minimumCustomValue:e,onChange:c(t),onMouseOut:n,onMouseOver:o,side:t,spacingSizes:l,type:r,value:s[t],withInputField:!1},`spacing-sizes-control-${t}`)))})}function bT({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,showSideInLabel:i,side:l,spacingSizes:r,type:s,values:a}){return(0,et.jsx)(gT,{label:iu[l],minimumCustomValue:e,onChange:(c=l,e=>{const n={...Object.keys(a).reduce(((e,t)=>(e[t]=au(a[t],r),e)),{})};n[c]=e,t(n)}),onMouseOut:n,onMouseOver:o,showSideInLabel:i,side:l,spacingSizes:r,type:s,value:a[l],withInputField:!1});var c}function kT({isLinked:e,...t}){const n=e?(0,vt.__)("Unlink sides"):(0,vt.__)("Link sides");return(0,et.jsx)(le.Button,{...t,size:"small",icon:e?vC:bC,iconSize:24,label:n})}function _T({inputProps:e,label:t,minimumCustomValue:n=0,onChange:o,onMouseOut:i,onMouseOver:l,showSideInLabel:r=!0,sides:s=tu,useSelect:a,values:c}){const u=pT(),d=c||nu,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),[m,f]=(0,p.useState)(function(e={},t){const{top:n,right:o,bottom:i,left:l}=e,r=[n,o,i,l].filter(Boolean),s=!(n!==i||l!==o||!n&&!l),a=!r.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(uu(t)&&(s||a))return lu.axial;if(c&&1===r.length){let t;return Object.entries(e).some((([e,n])=>(t=e,void 0!==n))),t}return 1!==(null==t?void 0:t.length)||r.length?lu.custom:t[0]}(d,s)),v={...e,minimumCustomValue:n,onChange:e=>{const t={...c,...e};o(t)},onMouseOut:i,onMouseOver:l,sides:s,spacingSizes:u,type:t,useSelect:a,values:d},b=tu.includes(m)&&r?iu[m]:"",k=(0,vt.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,vt._x)("%1$s %2$s","spacing"),t,b).trim();return(0,et.jsxs)("fieldset",{className:"spacing-sizes-control",children:[(0,et.jsxs)(le.__experimentalHStack,{className:"spacing-sizes-control__header",children:[(0,et.jsx)(le.BaseControl.VisualLabel,{as:"legend",className:"spacing-sizes-control__label",children:k}),!h&&!g&&(0,et.jsx)(kT,{label:t,onClick:()=>{f(m===lu.axial?lu.custom:lu.axial)},isLinked:m===lu.axial})]}),(0,et.jsx)(le.__experimentalVStack,{spacing:.5,children:m===lu.axial?(0,et.jsx)(fT,{...v}):m===lu.custom?(0,et.jsx)(vT,{...v}):(0,et.jsx)(bT,{side:m,...v,showSideInLabel:r})})]})}function yT(){return Je()("wp.blockEditor.PreviewOptions",{version:"6.5"}),null}function xT(e){const[t,n]=(0,p.useState)(window.innerWidth);(0,p.useEffect)((()=>{if("Desktop"===e)return;const t=()=>n(window.innerWidth);return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}}),[e]);const o=(0,p.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,p.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])}const ST={settings:{},styles:{}},wT=["appearanceTools","useRootPaddingAwareAlignments","background.backgroundImage","background.backgroundRepeat","background.backgroundSize","background.backgroundPosition","border.color","border.radius","border.style","border.width","border.radiusSizes","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"],CT=()=>{const{user:e,setUserConfig:t}=(0,p.useContext)(oC),n={settings:e.settings,styles:e.styles};return[!!n&&!fastDeepEqual(n,ST),(0,p.useCallback)((()=>t(ST)),[t])]};function BT(e,t,n="all"){const{setUserConfig:o,...i}=(0,p.useContext)(oC),l=t?".blocks."+t:"",r=e?"."+e:"",s=`settings${l}${r}`,a=`settings${r}`,c="all"===n?"merged":n;return[(0,p.useMemo)((()=>{const t=i[c];if(!t)throw"Unsupported source";if(e)return xn(t,s)??xn(t,a);let n={};return wT.forEach((e=>{const o=xn(t,`settings${l}.${e}`)??xn(t,`settings.${e}`);void 0!==o&&(n=yn(n,e.split("."),o))})),n}),[i,c,e,s,a,l]),e=>{o((t=>yn(t,s.split("."),e)))}]}function IT(e,t,n="all",{shouldDecodeEncode:o=!0}={}){const{merged:i,base:l,user:r,setUserConfig:s}=(0,p.useContext)(oC),a=e?"."+e:"",c=t?`styles.blocks.${t}${a}`:`styles${a}`;let u,d;switch(n){case"all":u=xn(i,c),d=o?Tw(i,t,u):u;break;case"user":u=xn(r,c),d=o?Tw(i,t,u):u;break;case"base":u=xn(l,c),d=o?Tw(l,t,u):u;break;default:throw"Unsupported source"}return[d,n=>{s((l=>yn(l,c.split("."),o?function(e,t,n,o){if(!o)return o;const i=Cw[n],l=ww.find((e=>e.cssVarInfix===i));if(!l)return o;const{valueKey:r,path:s}=l,a=Ew(e,t,s,r,o);return a?`var:preset|${i}|${a.slug}`:o}(i.settings,t,e,n):n)))}]}function jT(e,t,n){const{supportedStyles:o,supports:i}=(0,h.useSelect)((e=>{var o;return{supportedStyles:fe(e(d.store)).getSupportedStyles(t,n),supports:null===(o=e(d.store).getBlockType(t))||void 0===o?void 0:o.supports}}),[t,n]);return(0,p.useMemo)((()=>{var t,l,r,s,a,c;const u={...e};var d;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===(l=u.color)||void 0===l?void 0:l.background)&&(o.includes("background")||o.includes("backgroundColor")),button:(null===(r=u.color)||void 0===r?void 0:r.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","textIndent","writingMode"].forEach((e=>{o.includes(e)||(u.typography={...u.typography,[e]:!1})})),o.includes("textIndent")&&(u.typography={...u.typography,textIndent:(null===(d=u.typography)||void 0===d?void 0:d.textIndent)??"subsequent"}),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,l,r,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===(l=i.spacing)||void 0===l||null===(r=l[e])||void 0===r?void 0:r.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","height","minHeight","width"].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 ET(e){var t,n,o,i,l,r,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,u=null==e||null===(l=e.color)||void 0===l||null===(r=l.palette)||void 0===r?void 0:r.default,d=null==e||null===(s=e.color)||void 0===s?void 0:s.defaultPalette;return(0,p.useMemo)((()=>{const e=[];return c&&c.length&&e.push({name:(0,vt._x)("Theme","Indicates this palette comes from the theme.","kubio"),colors:c}),d&&u&&u.length&&e.push({name:(0,vt._x)("Default","Indicates this palette comes from WordPress.","kubio"),colors:u}),a&&a.length&&e.push({name:(0,vt._x)("Custom","Indicates this palette is created by the user.","kubio"),colors:a}),e}),[a,c,u,d])}function TT(e){var t,n,o,i,l,r,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,u=null==e||null===(l=e.color)||void 0===l||null===(r=l.gradients)||void 0===r?void 0:r.default,d=null==e||null===(s=e.color)||void 0===s?void 0:s.defaultGradients;return(0,p.useMemo)((()=>{const e=[];return c&&c.length&&e.push({name:(0,vt._x)("Theme","Indicates this palette comes from the theme.","kubio"),gradients:c}),d&&u&&u.length&&e.push({name:(0,vt._x)("Default","Indicates this palette comes from WordPress.","kubio"),gradients:u}),a&&a.length&&e.push({name:(0,vt._x)("Custom","Indicates this palette is created by the user.","kubio"),gradients:a}),e}),[a,c,u,d])}function PT(e,t="root",n={}){if(!t)return null;const{fallback:o=!1}=n,{name:i,selectors:l,supports:r}=e,s=l&&Object.keys(l).length>0,a=Array.isArray(t)?t.join("."):t;let c=null;if(c=s&&l.root?null==l?void 0:l.root:null!=r&&r.__experimentalSelector?r.__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 xn(l,`${a}.root`,null)||xn(l,a,null)||e;const t=xn(r,`${a}.__experimentalSelector`,null);return t?Pw(c,t):e}let d;return s&&(d=xn(l,a,null)),d||(o?PT(e,u[0],n):null)}function MT(e){return`${e}{filter:none}`}function RT(e,t){return`${e}{filter:url(#${t})}`}function NT(e,t){const n=function(e=[]){const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=X(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 LT=window.wp.blob,AT="image",DT={placement:"left-start",offset:36,shift:!0,className:"block-editor-global-styles-background-panel__popover"},OT=()=>{},zT=e=>{window.requestAnimationFrame((()=>{const[t]=Ih.focus.tabbable.find(null==e?void 0:e.current);t&&t.focus()}))},VT=e=>{if(!(!e||isNaN(e.x)&&isNaN(e.y)))return`${100*(isNaN(e.x)?.5:e.x)}% ${100*(isNaN(e.y)?.5:e.y)}%`},FT=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 HT({as:e="span",imgUrl:t,toggleProps:n={},filename:o,label:i,onToggleCallback:l=OT}){const{isOpen:r,...s}=n;(0,p.useEffect)((()=>{void 0!==r&&l(r)}),[r,l]);const a=()=>(0,et.jsxs)(le.__experimentalHStack,{className:"block-editor-global-styles-background-panel__inspector-preview-inner",children:[(0,et.jsx)("span",{className:"block-editor-global-styles-background-panel__inspector-image-indicator",style:{backgroundImage:t?`url(${t})`:void 0}}),(0,et.jsxs)(le.FlexBlock,{children:[(0,et.jsx)(le.__experimentalTruncate,{numberOfLines:1,className:"block-editor-global-styles-background-panel__inspector-media-replace-title",children:i}),(0,et.jsx)(le.VisuallyHidden,{as:"span",children:t?(0,vt.sprintf)(/* translators: %s: file name */ /* translators: %s: file name */(0,vt.__)("Background image: %s","kubio"),o||i):(0,vt.__)("No background image selected","kubio")})]})]});return"button"===e?(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,...s,children:a()}):a()}function GT({label:e,filename:t,url:n,children:o,onToggle:i=OT,hasImageValue:l,onReset:r,containerRef:s}){if(!l)return;const a=e||(0,it.getFilename)(n)||(0,vt.__)("Image","kubio");return(0,et.jsx)(le.Dropdown,{popoverProps:DT,renderToggle:({onToggle:e,isOpen:o})=>{const l={onClick:e,className:"block-editor-global-styles-background-panel__dropdown-toggle","aria-expanded":o,"aria-label":(0,vt.__)("Background size, position and repeat options.","kubio"),isOpen:o};return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(HT,{imgUrl:n,filename:t,label:a,toggleProps:l,as:"button",onToggleCallback:i}),r&&(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,label:(0,vt.__)("Reset","kubio"),className:"block-editor-global-styles-background-panel__reset",size:"small",icon:$C,onClick:()=>{r(),o&&e(),zT(s)}})]})},renderContent:()=>(0,et.jsx)(le.__experimentalDropdownContentWrapper,{className:"block-editor-global-styles-background-panel__dropdown-content-wrapper",paddingSize:"medium",children:o})})}function $T(){return(0,et.jsx)(le.Placeholder,{className:"block-editor-global-styles-background-panel__loading",children:(0,et.jsx)(le.Spinner,{})})}function UT({onChange:e,style:t,inheritedValue:n,onRemoveImage:o=OT,onResetImage:i=OT,displayInPanel:l,defaultValues:r,containerRef:s}){var a,c;const[d,g]=(0,p.useState)(!1),{getSettings:m}=(0,h.useSelect)(ba),{id:f,title:v,url:b}=(null==t||null===(a=t.background)||void 0===a?void 0:a.backgroundImage)||{...null==n||null===(c=n.background)||void 0===c?void 0:c.backgroundImage},{createErrorNotice:k}=(0,h.useDispatch)(Wh.store),_=e=>{k(e,{type:"snackbar"}),g(!1)},y=n=>{var o,i;if(!n||!n.url)return e(yn(t,["background","backgroundImage"],void 0)),void g(!1);if((0,LT.isBlobURL)(n.url))return void g(!0);if(n.media_type&&n.media_type!==AT||!n.media_type&&n.type&&n.type!==AT)return void _((0,vt.__)("Only images can be used as a background image.","kubio"));const l=(null==t||null===(o=t.background)||void 0===o?void 0:o.backgroundSize)||(null==r?void 0:r.backgroundSize),a=null==t||null===(i=t.background)||void 0===i?void 0:i.backgroundPosition;e(yn(t,["background"],{...null==t?void 0:t.background,backgroundImage:{url:n.url,id:n.id,source:"file",title:n.title||void 0},backgroundPosition:a||"auto"!==l&&l?a:"50% 0",backgroundSize:l})),g(!1),zT(s)},x=!YT(t)&&YT(n),S=v||(0,it.getFilename)(b)||(0,vt.__)("Image","kubio");return(0,et.jsxs)("div",{className:"block-editor-global-styles-background-panel__image-tools-panel-item",children:[d&&(0,et.jsx)($T,{}),(0,et.jsx)(Ej,{mediaId:f,mediaURL:b,allowedTypes:[AT],accept:"image/*",onSelect:y,popoverProps:{className:u({"block-editor-global-styles-background-panel__media-replace-popover":l})},name:(0,et.jsx)(HT,{imgUrl:b,filename:v,label:S}),renderToggle:e=>(0,et.jsx)(le.Button,{...e,__next40pxDefaultSize:!0}),onError:_,onReset:()=>{zT(s),i()},children:x&&(0,et.jsx)(le.MenuItem,{onClick:()=>{zT(s),e(yn(t,["background"],{backgroundImage:"none"})),o()},children:(0,vt.__)("Remove","kubio")})}),(0,et.jsx)(le.DropZone,{onFilesDrop:e=>{m().mediaUpload({allowedTypes:[AT],filesList:e,onFileChange([e]){y(e)},onError:_,multiple:!1})},label:(0,vt.__)("Drop to upload","kubio")})]})}function WT({onChange:e,style:t,inheritedValue:n,defaultValues:o}){var i,l,r,s,a,c,u,d,p,h,g,m,f,v;const b=(null==t||null===(i=t.background)||void 0===i?void 0:i.backgroundSize)||(null==n||null===(l=n.background)||void 0===l?void 0:l.backgroundSize),k=(null==t||null===(r=t.background)||void 0===r?void 0:r.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===(m=n.background)||void 0===m?void 0:m.backgroundPosition),S=(null==t||null===(f=t.background)||void 0===f?void 0:f.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 l,r;"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!==(l=t.background)&&void 0!==l&&null!==(r=l.backgroundImage)&&void 0!==r&&r.id&&(i="50% 0")),n||"auto"!==w||(n="auto"),e(yn(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,et.jsxs)(le.__experimentalVStack,{spacing:3,className:"single-column",children:[(0,et.jsx)(le.FocalPointPicker,{label:(0,vt.__)("Focal point","kubio"),url:_,value:FT(I),onChange:n=>{e(yn(t,["background","backgroundPosition"],VT(n)))}}),(0,et.jsx)(le.ToggleControl,{label:(0,vt.__)("Fixed background","kubio"),checked:"fixed"===S,onChange:()=>e(yn(t,["background","backgroundAttachment"],"fixed"===S?"scroll":"fixed"))}),(0,et.jsxs)(le.__experimentalToggleGroupControl,{size:"__unstable-large",label:(0,vt.__)("Size","kubio"),value:w,onChange:B,isBlock:!0,help:(j=b||(null==o?void 0:o.backgroundSize),"cover"===j||void 0===j?(0,vt.__)("Image covers the space evenly.","kubio"):"contain"===j?(0,vt.__)("Image is contained without distortion.","kubio"):(0,vt.__)("Image has a fixed width.","kubio")),children:[(0,et.jsx)(le.__experimentalToggleGroupControlOption,{value:"cover",label:(0,vt._x)("Cover","Size option for background image control","kubio")},"cover"),(0,et.jsx)(le.__experimentalToggleGroupControlOption,{value:"contain",label:(0,vt._x)("Contain","Size option for background image control","kubio")},"contain"),(0,et.jsx)(le.__experimentalToggleGroupControlOption,{value:"auto",label:(0,vt._x)("Tile","Size option for background image control","kubio")},"tile")]}),(0,et.jsxs)(le.__experimentalHStack,{justify:"flex-start",spacing:2,as:"span",children:[(0,et.jsx)(le.__experimentalUnitControl,{"aria-label":(0,vt.__)("Background image width","kubio"),onChange:B,value:b,size:"__unstable-large",__unstableInputWidth:"100px",min:0,placeholder:(0,vt.__)("Auto","kubio"),disabled:"auto"!==w||void 0===w}),(0,et.jsx)(le.ToggleControl,{label:(0,vt.__)("Repeat","kubio"),checked:C,onChange:()=>e(yn(t,["background","backgroundRepeat"],!0===C?"no-repeat":"repeat")),disabled:"cover"===w})]})]});var j}function KT({value:e,onChange:t,inheritedValue:n=e,settings:o,defaultValues:i={}}){var l,r,s,a,c,d,g;const{globalStyles:m,_links:f}=(0,h.useSelect)((e=>{const{getSettings:t}=e(ba),n=t();return{globalStyles:n[wt],_links:n[Ct]}}),[]),v=(0,p.useMemo)((()=>{const e={background:{}};return null!=n&&n.background?(Object.entries(null==n?void 0:n.background).forEach((([t,n])=>{e.background[t]=Rw(n,{styles:m,_links:f})})),e):n}),[m,f,n]),b=()=>t(yn(e,["background"],{})),{title:k,url:_}=(null==e||null===(l=e.background)||void 0===l?void 0:l.backgroundImage)||{...null==v||null===(r=v.background)||void 0===r?void 0:r.backgroundImage},y=YT(e)||YT(v),x=(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),S=y&&"none"!==x&&((null==o||null===(c=o.background)||void 0===c?void 0:c.backgroundSize)||(null==o||null===(d=o.background)||void 0===d?void 0:d.backgroundPosition)||(null==o||null===(g=o.background)||void 0===g?void 0:g.backgroundRepeat)),[w,C]=(0,p.useState)(!1),B=(0,p.useRef)();return(0,et.jsx)("div",{ref:B,className:u("block-editor-global-styles-background-panel__inspector-media-replace-container",{"is-open":w}),children:S?(0,et.jsx)(GT,{label:k,filename:k,url:_,onToggle:C,hasImageValue:y,onReset:b,containerRef:B,children:(0,et.jsxs)(le.__experimentalVStack,{spacing:3,className:"single-column",children:[(0,et.jsx)(UT,{onChange:t,style:e,inheritedValue:v,displayInPanel:!0,onResetImage:()=>{C(!1),b()},onRemoveImage:()=>C(!1),defaultValues:i,containerRef:B}),(0,et.jsx)(WT,{onChange:t,style:e,defaultValues:i,inheritedValue:v})]})}):(0,et.jsx)(UT,{onChange:t,style:e,inheritedValue:v,defaultValues:i,onResetImage:()=>{C(!1),b()},onRemoveImage:()=>C(!1),containerRef:B})})}const ZT={backgroundImage:!0};function qT(e){var t;return"web"===p.Platform.OS&&(null==e||null===(t=e.background)||void 0===t?void 0:t.backgroundImage)}function YT(e){var t,n,o,i,l;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===(l=i.backgroundImage)||void 0===l||!l.url)}function QT({resetAllFilter:e,onChange:t,value:n,panelId:o,children:i,headerLabel:l}){const r=jw();return(0,et.jsx)(le.__experimentalToolsPanel,{label:l,resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:r,children:i})}function XT({as:e=QT,value:t,onChange:n,inheritedValue:o,settings:i,panelId:l,defaultControls:r=ZT,defaultValues:s={},headerLabel:a=(0,vt.__)("Background")}){const c=qT(i),u=(0,p.useCallback)((e=>({...e,background:{}})),[]);return(0,et.jsx)(e,{resetAllFilter:u,value:t,onChange:n,panelId:l,headerLabel:a,children:c&&(0,et.jsx)(le.__experimentalToolsPanelItem,{hasValue:()=>!(null==t||!t.background),label:(0,vt.__)("Image"),onDeselect:()=>n(yn(t,["background"],{})),isShownByDefault:r.backgroundImage,panelId:l,children:(0,et.jsx)(KT,{value:t,onChange:n,settings:i,inheritedValue:o,defaultControls:r,defaultValues:s})})})}const JT="background",eP={backgroundSize:"cover",backgroundPosition:"50% 50%"};function tP(e,t="any"){const n=(0,d.getBlockSupport)(e,JT);return!!(!0===n||("any"===t?null!=n&&n.backgroundImage||null!=n&&n.backgroundSize||null!=n&&n.backgroundRepeat:null!=n&&n[t]))}function nP(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:eP.backgroundSize}),"contain"!==(null==e?void 0:e.backgroundSize)||null!=e&&e.backgroundPosition||(n={backgroundPosition:eP.backgroundPosition}),n}function oP(e){return YT(e)?"has-background":""}function iP({children:e}){const t=(0,p.useCallback)((e=>({...e,style:{...e.style,background:void 0}})),[]);return(0,et.jsx)(z_,{group:"background",resetAllFilter:t,children:e})}function lP({clientId:e,name:t,setAttributes:n,settings:o}){var i;const{style:l,inheritedValue:r}=(0,h.useSelect)((n=>{var o,i,l;const{getBlockAttributes:r,getSettings:s}=n(ba),a=s();return{style:null===(o=r(e))||void 0===o?void 0:o.style,inheritedValue:null===(i=a[wt])||void 0===i||null===(l=i.blocks)||void 0===l?void 0:l[t]}}),[e,t]);if(!qT(o)||!tP(t,"backgroundImage"))return null;const s={...o,background:{...o.background,backgroundSize:(null==o||null===(i=o.background)||void 0===i?void 0:i.backgroundSize)&&tP(t,"backgroundSize")}},a=(0,d.getBlockSupport)(t,[JT,"defaultControls"]);return(0,et.jsx)(XT,{inheritedValue:r,as:iP,panelId:e,defaultValues:eP,settings:s,onChange:e=>{n({style:qN(e)})},defaultControls:a,value:l})}const rP={useBlockProps:function({name:e,style:t}){var n;if(!tP(e)||null==t||null===(n=t.background)||void 0===n||!n.backgroundImage)return;const o=nP(null==t?void 0:t.background);return o?{style:{...o}}:void 0},attributeKeys:["style"],hasSupport:tP};function sP(e,t="root",n={}){if(!t)return null;const{fallback:o=!1}=n,{name:i,selectors:l,supports:r}=e,s=l&&Object.keys(l).length>0,a=Array.isArray(t)?t.join("."):t;let c=null;if(c=s&&l.root?null==l?void 0:l.root:null!=r&&r.__experimentalSelector?r.__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 xn(l,`${a}.root`,null)||xn(l,a,null)||e;const t=r?xn(r,`${a}.__experimentalSelector`,null):void 0;return t?Pw(c,t):e}let d;return s&&(d=xn(l,a,null)),d||(o?sP(e,u[0],n):null)}const aP={button:"wp-element-button",caption:"wp-element-caption"},cP={__experimentalBorder:"border",color:"color",spacing:"spacing",typography:"typography"},{kebabCase:uP}=fe(le.privateApis);function dP(e={},t,n){let o=[];return Object.keys(e).forEach((i=>{const l=t+uP(i.replace("/","-")),r=e[i];if(r instanceof Object){const e=l+n;o=[...o,...dP(r,e,n)]}else o.push(`${l}: ${r}`)})),o}const pP=(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 l=hP({[e]:{[o]:t[e][o]}});n[i]=[...n[i]||[],...l],delete t[e][o]})),i||o.root){const l=i?o:o.root,r=hP({[e]:t[e]});n[l]=[...n[l]||[],...r],delete t[e]}})),n};function hP(e={},t="",n,o={},i=!1){const l=xw===t,r=Object.entries(d.__EXPERIMENTAL_STYLE_PROPERTY).reduce(((t,[o,{value:i,properties:r,useEngine:s,rootOnly:a}])=>{if(a&&!l)return t;const c=i;if("elements"===c[0]||s)return t;const u=xn(e,c);if("--wp--style--root--padding"===o&&("string"==typeof u||!n))return t;if(r&&"string"!=typeof u)Object.entries(r).forEach((e=>{const[n,o]=e;if(!xn(u,[o],!1))return;const i=n.startsWith("--")?n:uP(n);t.push(`${i}: ${Pu(xn(u,[o]))}`)}));else if(xn(e,c,!1)){const n=o.startsWith("--")?o:uP(o);t.push(`${n}: ${Pu(xn(e,c))}`)}return t}),[]);var s,a,c;return e.background&&(null!==(s=e.background)&&void 0!==s&&s.backgroundImage&&(e.background.backgroundImage=Rw(e.background.backgroundImage,o)),!l&&null!==(a=e.background)&&void 0!==a&&null!==(c=a.backgroundImage)&&void 0!==c&&c.id&&(e={...e,background:{...e.background,...nP(e.background)}})),md(e).forEach((e=>{if(l&&(n||i)&&e.key.startsWith("padding"))return;const t=e.key.startsWith("--")?e.key:uP(e.key);let s=Rw(e.value,o);"font-size"===t&&(s=kw({size:s},null==o?void 0:o.settings)),"aspect-ratio"===t&&r.push("min-height: unset"),r.push(`${t}: ${s}`)})),r}function gP({layoutDefinitions:e=Gc,style:t,selector:n,hasBlockGapSupport:o,hasFallbackGapSupport:i,fallbackGapValue:l}){var r;let s="",a=o?du(null==t||null===(r=t.spacing)||void 0===r?void 0:r.blockGap):"";if(i&&(n===xw?a=a||"0.5em":!o&&l&&(a=l)),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 l="";l=o?n===xw?`:root :where(.${e})${(null==t?void 0:t.selector)||""}`:`:root :where(${n}-${e})${(null==t?void 0:t.selector)||""}`:n===xw?`:where(.${e}${(null==t?void 0:t.selector)||""})`:`:where(${n}.${e}${(null==t?void 0:t.selector)||""})`,s+=`${l} { ${i.join("; ")}; }`}}))})),n===xw&&o&&(s+=`${Sw} { --wp--style--block-gap: ${a}; }`)),n===xw&&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 mP=["border","color","dimensions","spacing","typography","filter","outline","shadow","background"];function fP(e){if(!e)return{};const t=Object.entries(e).filter((([e])=>mP.includes(e))).map((([e,t])=>[e,JSON.parse(JSON.stringify(t))]));return Object.fromEntries(t)}const vP=(e,t)=>{var n,o;const i=[];if(null==e||!e.settings)return i;const l=e=>{let t={};return ww.forEach((({path:n})=>{const o=xn(e,n,!1);!1!==o&&(t=yn(t,n,o))})),t},r=l(e.settings),s=null===(n=e.settings)||void 0===n?void 0:n.custom;return(Object.keys(r).length>0||s)&&i.push({presets:r,custom:s,selector:Sw}),Object.entries((null===(o=e.settings)||void 0===o?void 0:o.blocks)??{}).forEach((([e,n])=>{const o=l(n),r=n.custom;var s;(Object.keys(o).length>0||r)&&i.push({presets:o,custom:r,selector:null===(s=t[e])||void 0===s?void 0:s.selector})})),i},bP=(e,t)=>{const n=vP(e,t);let o="";return n.forEach((({presets:t,custom:n,selector:i})=>{const l=function(e={},t){return ww.reduce(((n,{path:o,valueKey:i,valueFunc:l,cssVarInfix:r})=>{const s=xn(e,o,[]);return["default","theme","custom"].forEach((e=>{s[e]&&s[e].forEach((e=>{i&&!l?n.push(`--wp--preset--${r}--${uP(e.slug)}: ${e[i]}`):l&&"function"==typeof l&&n.push(`--wp--preset--${r}--${uP(e.slug)}: ${l(e,t)}`)}))})),n}),[])}(t,null==e?void 0:e.settings),r=dP(n,"--wp--custom--","--");r.length>0&&l.push(...r),l.length>0&&(o+=`${i}{${l.join(";")};}`)})),o},kP=(e,t,n,o,i=!1,l=!1,r=void 0)=>{var s,a;const c={blockGap:!0,blockStyles:!0,layoutStyles:!0,marginReset:!0,presets:!0,rootPadding:!0,variationStyles:!1,...r},u=((e,t)=>{var n;const o=[];if(null==e||!e.styles)return o;const i=fP(e.styles);return i&&o.push({styles:i,selector:xw,skipSelectorWrapper:!0}),Object.entries(d.__EXPERIMENTAL_ELEMENTS).forEach((([t,n])=>{var i,l,r,s;null!==(i=e.styles)&&void 0!==i&&null!==(l=i.elements)&&void 0!==l&&l[t]&&o.push({styles:null===(r=e.styles)||void 0===r||null===(s=r.elements)||void 0===s?void 0:s[t],selector:n,skipSelectorWrapper:!aP[t]})})),Object.entries((null===(n=e.styles)||void 0===n?void 0:n.blocks)??{}).forEach((([e,n])=>{var i;const l=fP(n);if(null!=n&&n.variations){const i={};Object.entries(n.variations).forEach((([n,l])=>{var r,s;i[n]=fP(l),null!=l&&l.css&&(i[n].css=l.css);const a=null===(r=t[e])||void 0===r||null===(s=r.styleVariationSelectors)||void 0===s?void 0:s[n];Object.entries((null==l?void 0:l.elements)??{}).forEach((([e,t])=>{t&&d.__EXPERIMENTAL_ELEMENTS[e]&&o.push({styles:t,selector:Pw(a,d.__EXPERIMENTAL_ELEMENTS[e])})})),Object.entries((null==l?void 0:l.blocks)??{}).forEach((([e,n])=>{var i,l,r,s,c;const u=Pw(a,null===(i=t[e])||void 0===i?void 0:i.selector),p=Pw(a,null===(l=t[e])||void 0===l?void 0:l.duotoneSelector),h=function(e,t){if(!e||!t)return;const n={};return Object.entries(t).forEach((([t,o])=>{"string"==typeof o&&(n[t]=Pw(e,o)),"object"==typeof o&&(n[t]={},Object.entries(o).forEach((([o,i])=>{n[t][o]=Pw(e,i)})))})),n}(a,null===(r=t[e])||void 0===r?void 0:r.featureSelectors),g=fP(n);null!=n&&n.css&&(g.css=n.css),o.push({selector:u,duotoneSelector:p,featureSelectors:h,fallbackGapValue:null===(s=t[e])||void 0===s?void 0:s.fallbackGapValue,hasLayoutSupport:null===(c=t[e])||void 0===c?void 0:c.hasLayoutSupport,styles:g}),Object.entries(n.elements??{}).forEach((([e,t])=>{t&&d.__EXPERIMENTAL_ELEMENTS[e]&&o.push({styles:t,selector:Pw(u,d.__EXPERIMENTAL_ELEMENTS[e])})}))}))})),l.variations=i}null!=t&&null!==(i=t[e])&&void 0!==i&&i.selector&&o.push({duotoneSelector:t[e].duotoneSelector,fallbackGapValue:t[e].fallbackGapValue,hasLayoutSupport:t[e].hasLayoutSupport,selector:t[e].selector,styles:l,featureSelectors:t[e].featureSelectors,styleVariationSelectors:t[e].styleVariationSelectors}),Object.entries((null==n?void 0:n.elements)??{}).forEach((([n,i])=>{var l;i&&null!=t&&t[e]&&d.__EXPERIMENTAL_ELEMENTS[n]&&o.push({styles:i,selector:null===(l=t[e])||void 0===l?void 0:l.selector.split(",").map((e=>d.__EXPERIMENTAL_ELEMENTS[n].split(",").map((t=>e+" "+t)))).join(",")})}))})),o})(e,t),p=vP(e,t),h=null==e||null===(s=e.settings)||void 0===s?void 0:s.useRootPaddingAwareAlignments,{contentSize:g,wideSize:m}=(null==e||null===(a=e.settings)||void 0===a?void 0:a.layout)||{},f=c.marginReset||c.rootPadding||c.layoutStyles;let v="";if(c.presets&&(g||m)&&(v+=`${Sw} {`,v=g?v+` --wp--style--global--content-size: ${g};`:v,v=m?v+` --wp--style--global--wide-size: ${m};`:v,v+="}"),f&&(v+=":where(body) {margin: 0;",c.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+="}"),c.blockStyles&&u.forEach((({selector:t,duotoneSelector:r,styles:s,fallbackGapValue:a,hasLayoutSupport:u,featureSelectors:d,styleVariationSelectors:p,skipSelectorWrapper:g})=>{if(d){const e=pP(d,s);Object.entries(e).forEach((([e,t])=>{if(t.length){const n=t.join(";");v+=`:root :where(${e}){${n};}`}}))}if(r){const e={};null!=s&&s.filter&&(e.filter=s.filter,delete s.filter);const t=hP(e);t.length&&(v+=`${r}{${t.join(";")};}`)}i||xw!==t&&!u||(v+=gP({style:s,selector:t,hasBlockGapSupport:n,hasFallbackGapSupport:o,fallbackGapValue:a}));const m=hP(s,t,h,e,l);null!=m&&m.length&&(v+=`${g?t:`:root :where(${t})`}{${m.join(";")};}`),null!=s&&s.css&&(v+=xP(s.css,`:root :where(${t})`)),c.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=pP(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=hP(i,n,h,e);t.length&&(v+=`:root :where(${n}){${t.join(";")};}`),null!=i&&i.css&&(v+=xP(i.css,`:root :where(${n})`))}}));const f=Object.entries(s).filter((([e])=>e.startsWith(":")));null!=f&&f.length&&f.forEach((([e,n])=>{const o=hP(n);if(null==o||!o.length)return;const i=`:root :where(${t.split(",").map((t=>t+e)).join(",")}){${o.join(";")};}`;v+=i}))})),c.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; }"),c.blockGap&&n){var b,k;const t=du(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 c.presets&&p.forEach((({selector:e,presets:t})=>{xw!==e&&Sw!==e||(e="");const n=function(e="*",t={}){return ww.reduce(((n,{path:o,cssVarInfix:i,classes:l})=>{if(!l)return n;const r=xn(t,o,[]);return["default","theme","custom"].forEach((t=>{r[t]&&r[t].forEach((({slug:t})=>{l.forEach((({classSuffix:o,propertyName:l})=>{const r=`.has-${uP(t)}-${o}`,s=e.split(",").map((e=>`${e}${r}`)).join(","),a=`var(--wp--preset--${i}--${uP(t)})`;n+=`${s}{${l}: ${a} !important;}`}))}))})),n}),"")}(e,t);n.length>0&&(v+=n)})),v};const _P=(e,t)=>{if(null!=e&&e.selectors&&Object.keys(e.selectors).length>0)return e.selectors;const n={root:t};return Object.entries(cP).forEach((([t,o])=>{const i=PT(e,t);i&&(n[o]=i)})),n},yP=(e,t,n)=>"string"==typeof t?((e,t)=>{var n;const{getBlockStyles:o}=(0,h.select)(d.store),i={};return null==e||null===(n=e.forEach)||void 0===n||n.call(e,(e=>{var n,l,r,s,a;const c=e.name,u=sP(e);if(!u)return;let p=sP(e,"filter.duotone");if(!p){const t=sP(e),n=(0,d.getBlockSupport)(e,"color.__experimentalDuotone",!1);p=n&&t&&Pw(t,n)}const h=!(null==e||null===(n=e.supports)||void 0===n||!n.layout)||!(null==e||null===(l=e.supports)||void 0===l||!l.__experimentalLayout),g=null==e||null===(r=e.supports)||void 0===r||null===(s=r.spacing)||void 0===s||null===(a=s.blockGap)||void 0===a?void 0:a.__experimentalDefault,m=o(c),f={};null==m||m.forEach((e=>{const n=t?`-${t}`:"",o=`${e.name}${n}`,i=Mw(o,u);f[o]=i}));const v=_P(e,u);i[c]={duotoneSelector:p??void 0,fallbackGapValue:g,featureSelectors:Object.keys(v).length?v:void 0,hasLayoutSupport:h,name:c,selector:u,styleVariationSelectors:null!=m&&m.length?f:void 0}})),i})(e,t):((e,t,n)=>{const o={};return e.forEach((e=>{var i,l,r,s,a,c;const u=e.name,p=PT(e);let h=PT(e,"filter.duotone");if(!h){const t=PT(e),n=(0,d.getBlockSupport)(e,"color.__experimentalDuotone",!1);h=n&&Pw(t,n)}const g=!(null==e||null===(i=e.supports)||void 0===i||!i.layout)||!(null==e||null===(l=e.supports)||void 0===l||!l.__experimentalLayout),m=null==e||null===(r=e.supports)||void 0===r||null===(s=r.spacing)||void 0===s||null===(a=s.blockGap)||void 0===a?void 0:a.__experimentalDefault,f=(null==t?void 0:t(u))||[],v={};null==f||null===(c=f.forEach)||void 0===c||c.call(f,(e=>{const t=n?`-${n}`:"",o=`${e.name}${t}`,i=Mw(o,p);v[o]=i}));const b=_P(e,p);o[u]={duotoneSelector:h,fallbackGapValue:m,featureSelectors:Object.keys(b).length?b:void 0,hasLayoutSupport:g,name:u,selector:p,styleVariationSelectors:null!=f&&f.length?v:void 0}})),o})(e,t,n);function xP(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,l]=o,r=i.match(/([>+~\s]*::[a-zA-Z-]+)/),s=r?r[1]:"",a=r?i.replace(s,"").trim():i.trim();let c;c=""===a?t:i.startsWith(" ")?Pw(t,a):function(e,t){return e.includes(",")?e.split(",").map((e=>e+t)).join(","):e+t}(t,a),n+=`:root :where(${c})${s}{${l.trim()}}`}else n+=`:root :where(${t}){${e.trim()}}`})),n):n}function SP(e={},t){const[n]=BT("spacing.blockGap"),o=null!==n,i=!o,l=(0,h.useSelect)((e=>{const{getSettings:t}=e(ba);return!!t().disableLayoutStyles})),{getBlockStyles:r}=(0,h.useSelect)(d.store);return(0,p.useMemo)((()=>{if(null==e||!e.styles||null==e||!e.settings)return[];const n=!(null===(g=(h=e).styles)||void 0===g||null===(m=g.blocks)||void 0===m?void 0:m["core/separator"])||!(null===(f=h.styles)||void 0===f||null===(v=f.blocks)||void 0===v||null===(b=v["core/separator"].color)||void 0===b?void 0:b.background)||null!==(k=h.styles)&&void 0!==k&&null!==(_=k.blocks)&&void 0!==_&&null!==(y=_["core/separator"].color)&&void 0!==y&&y.text||null!==(x=h.styles)&&void 0!==x&&null!==(S=x.blocks)&&void 0!==S&&null!==(w=S["core/separator"].border)&&void 0!==w&&w.color?h:{...h,styles:{...h.styles,blocks:{...h.styles.blocks,"core/separator":{...h.styles.blocks["core/separator"],color:{...h.styles.blocks["core/separator"].color,text:null===(C=h.styles)||void 0===C?void 0:C.blocks["core/separator"].color.background}}}}},s=yP((0,d.getBlockTypes)(),r),a=bP(n,s),c=kP(n,s,o,i,l,t),u=function(e,t){return vP(e,t).flatMap((({presets:e})=>function(e={}){return ww.filter((e=>"duotone"===e.path.at(-1))).flatMap((t=>{const n=xn(e,t.path,{});return["default","theme"].filter((e=>n[e])).flatMap((e=>n[e].map((e=>NT(`wp-duotone-${e.slug}`,e.colors))))).join("")}))}(e)))}(n,s),p=[{css:a,isGlobalStyles:!0},{css:c,isGlobalStyles:!0},{css:n.styles.css??"",isGlobalStyles:!0},{assets:u,__unstableType:"svg",isGlobalStyles:!0}];var h,g,m,f,v,b,k,_,y,x,S,w,C;return(0,d.getBlockTypes)().forEach((e=>{var t;if(null!==(t=n.styles.blocks[e.name])&&void 0!==t&&t.css){var o;const t=s[e.name].selector;p.push({css:xP(null===(o=n.styles.blocks[e.name])||void 0===o?void 0:o.css,t),isGlobalStyles:!0})}})),[p,n.settings]}),[o,i,e,l,t,r])}function wP(e=!1){const{merged:t}=(0,p.useContext)(oC);return SP(t,e)}var CP=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M4 12.8h16v-1.5H4v1.5zm0 7h12.4v-1.5H4v1.5zM4 4.3v1.5h16V4.3H4z"})});const BP=[{label:(0,vt.__)("Align text left"),value:"left",icon:Ja},{label:(0,vt.__)("Align text center"),value:"center",icon:ec},{label:(0,vt.__)("Align text right"),value:"right",icon:tc},{label:(0,vt.__)("Justify text"),value:"justify",icon:CP}],IP=["left","center","right"];function jP({className:e,value:t,onChange:n,options:o=IP}){const i=(0,p.useMemo)((()=>BP.filter((e=>o.includes(e.value)))),[o]);return i.length?(0,et.jsx)(le.__experimentalToggleGroupControl,{isDeselectable:!0,__next40pxDefaultSize:!0,label:(0,vt.__)("Text alignment"),className:u("block-editor-text-alignment-control",e),value:t,onChange:e=>{n(e===t?void 0:e)},children:i.map((e=>(0,et.jsx)(le.__experimentalToggleGroupControlOptionIcon,{value:e.value,icon:e.icon,label:e.label},e.value)))}):null}function EP({__next40pxDefaultSize:e=!1,value:t,onChange:n,__unstableInputWidth:o="60px",withSlider:i=!1,hasBottomMargin:l=!1,help:r,...s}){const[a]=wa("spacing.units"),c=(0,le.__experimentalUseCustomUnits)({availableUnits:a||["px","em","rem","ch","%","vw","vh"],defaultValues:{px:16,em:2,rem:2,ch:2}}),[u,d]=(0,le.__experimentalParseQuantityAndUnitFromRawValue)(t,c),p=!!d&&["em","rem","%","ch","vw","vh"].includes(d);return i?(0,et.jsxs)(le.__experimentalView,{style:l?{marginBottom:12}:void 0,children:[(0,et.jsx)(le.BaseControl.VisualLabel,{children:(0,vt.__)("Line indent")}),(0,et.jsxs)(le.Flex,{children:[(0,et.jsx)(le.FlexItem,{isBlock:!0,children:(0,et.jsx)(le.__experimentalUnitControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,label:(0,vt.__)("Line indent"),labelPosition:"top",hideLabelFromVision:!0,value:t,onChange:n,size:s.size,units:c,__unstableInputWidth:o,min:0})}),i&&(0,et.jsx)(le.FlexItem,{isBlock:!0,children:(0,et.jsx)(le.__experimentalSpacer,{marginX:2,marginBottom:0,children:(0,et.jsx)(le.RangeControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,label:(0,vt.__)("Line indent"),hideLabelFromVision:!0,value:u,withInputField:!1,onChange:e=>{void 0===e?null==n||n(void 0):null==n||n(e+(d??"px"))},min:0,max:p?10:100,step:p?.1:1,initialPosition:0})})})]}),r&&(0,et.jsx)("p",{className:"components-base-control__help",children:r})]}):(0,et.jsx)(le.__experimentalUnitControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,...s,label:(0,vt.__)("Line indent"),value:t,__unstableInputWidth:o,units:c,onChange:n,help:r})}const TP=1,PP=6;function MP(e){const t=NP(e),n=LP(e),o=AP(e),i=DP(e),l=zP(e),r=OP(e),s=VP(e),a=GP(e),c=FP(e),u=HP(e),d=RP(e);return t||n||o||i||l||r||d||s||a||c||u}function RP(e){var t,n,o,i,l,r,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===(l=e.typography)||void 0===l||null===(r=l.fontSizes)||void 0===r||null===(s=r.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 NP(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 LP(e){var t;return null==e||null===(t=e.typography)||void 0===t?void 0:t.lineHeight}function AP(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 DP(e){var t;return null==e||null===(t=e.typography)||void 0===t?void 0:t.letterSpacing}function OP(e){var t;return null==e||null===(t=e.typography)||void 0===t?void 0:t.textTransform}function zP(e){var t;return null==e||null===(t=e.typography)||void 0===t?void 0:t.textAlign}function VP(e){var t;return null==e||null===(t=e.typography)||void 0===t?void 0:t.textDecoration}function FP(e){var t;return null==e||null===(t=e.typography)||void 0===t?void 0:t.writingMode}function HP(e){var t;return null==e||null===(t=e.typography)||void 0===t?void 0:t.textColumns}function GP(e){var t;return null==e||null===(t=e.typography)||void 0===t?void 0:t.textIndent}function $P({resetAllFilter:e,onChange:t,value:n,panelId:o,children:i}){const l=jw();return(0,et.jsx)(le.__experimentalToolsPanel,{label:(0,vt.__)("Typography","kubio"),resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:l,children:i})}const UP={fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textAlign:!0,textTransform:!0,textDecoration:!0,textIndent:!0,writingMode:!0,textColumns:!0};function WP({as:e=$P,value:t,onChange:n,inheritedValue:o=t,settings:i,panelId:l,defaultControls:r=UP,isGlobalStyles:s=!1}){var a,c,u,d,h,g,m,f,v,b,k,_,y,x,S,w;const C=e=>Tw({settings:i},"",e),B=NP(i),I=C(null==o||null===(a=o.typography)||void 0===a?void 0:a.fontFamily),{fontFamilies:j,fontFamilyFaces:E}=(0,p.useMemo)((()=>function(e,t){var n,o;const i=null==e||null===(n=e.typography)||void 0===n?void 0:n.fontFamilies,l=["default","theme","custom"].flatMap((e=>(null==i?void 0:i[e])??[])),r=(null===(o=l.find((e=>e.fontFamily===t)))||void 0===o?void 0:o.fontFace)??[];return{fontFamilies:l,fontFamilyFaces:r}}(i,I)),[i,I]),T=e=>{var o,i;const l=null==j||null===(o=j.find((({fontFamily:t})=>t===e)))||void 0===o?void 0:o.slug;let r=yn(t,["typography","fontFamily"],l?`var:preset|font-family|${l}`:e||void 0);const s=(null==j||null===(i=j.find((({fontFamily:t})=>t===e)))||void 0===i?void 0:i.fontFace)??[],{fontStyles:a,fontWeights:c}=bw(s),u=null==a?void 0:a.some((({value:e})=>e===F)),d=null==c?void 0:c.some((({value:e})=>(null==e?void 0:e.toString())===(null==H?void 0:H.toString())));if(!u||!d){const{nearestFontStyle:e,nearestFontWeight:t}=function(e,t,n){let o=t,i=n;const{fontStyles:l,fontWeights:r,combinedStyleAndWeightOptions:s}=bw(e),a=null==l?void 0:l.some((({value:e})=>e===t)),c=null==r?void 0:r.some((({value:e})=>(null==e?void 0:e.toString())===(null==n?void 0:n.toString())));var u,d,p,h,g,m;return a||(o=t?(p=l,"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===yw(r,n))))||void 0===u||null===(d=u.style)||void 0===d?void 0:d.fontStyle),c||(i=n?yw(r,n):null==s||null===(g=s.find((e=>e.style.fontStyle===(o||t))))||void 0===g||null===(m=g.style)||void 0===m?void 0:m.fontWeight),{nearestFontStyle:o,nearestFontWeight:i}}(s,F,H);var p;if(e||t)r={...r,typography:{...null===(p=r)||void 0===p?void 0:p.typography,fontStyle:e||void 0,fontWeight:t||void 0}};else if(F||H){var h;r={...r,typography:{...null===(h=r)||void 0===h?void 0:h.typography,fontStyle:void 0,fontWeight:void 0}}}}n(r)},P=RP(i),M=!(null!=i&&null!==(c=i.typography)&&void 0!==c&&c.customFontSize),R=function(e){var t,n;const o=null==e||null===(t=e.typography)||void 0===t?void 0:t.fontSizes,i=!(null==e||null===(n=e.typography)||void 0===n||!n.defaultFontSizes);return[...(null==o?void 0:o.custom)??[],...(null==o?void 0:o.theme)??[],...i?(null==o?void 0:o.default)??[]:[]]}(i),N=C(null==o||null===(u=o.typography)||void 0===u?void 0:u.fontSize),L=(e=>{const t=null==o||null===(e=o.typography)||void 0===e?void 0:e.fontSize;if(!t||"string"!=typeof t)return;if(t.startsWith("var:preset|font-size|"))return t.replace("var:preset|font-size|","");const n=t.match(/^var\(--wp--preset--font-size--([^)]+)\)$/);return n?n[1]:void 0})(),A=(e,o)=>{const i=null!=o&&o.slug?`var:preset|font-size|${null==o?void 0:o.slug}`:e;n(yn(t,["typography","fontSize"],i||void 0))},D=AP(i),O=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,vt.__)("Appearance","kubio"):(0,vt.__)("Font style","kubio"):(0,vt.__)("Font weight","kubio")}(i),z=null==i||null===(d=i.typography)||void 0===d?void 0:d.fontStyle,V=null==i||null===(h=i.typography)||void 0===h?void 0:h.fontWeight,F=C(null==o||null===(g=o.typography)||void 0===g?void 0:g.fontStyle),H=C(null==o||null===(m=o.typography)||void 0===m?void 0:m.fontWeight),G=(0,p.useCallback)((({fontStyle:e,fontWeight:o})=>{e===F&&o===H||n({...t,typography:{...null==t?void 0:t.typography,fontStyle:e||void 0,fontWeight:o||void 0}})}),[F,H,n,t]),$=(0,p.useCallback)((()=>{G({})}),[G]),U=LP(i),W=C(null==o||null===(f=o.typography)||void 0===f?void 0:f.lineHeight),K=e=>{n(yn(t,["typography","lineHeight"],e||void 0))},Z=DP(i),q=C(null==o||null===(v=o.typography)||void 0===v?void 0:v.letterSpacing),Y=e=>{n(yn(t,["typography","letterSpacing"],e||void 0))},Q=GP(i),X=C(null==o||null===(b=o.typography)||void 0===b?void 0:b.textIndent),J="all"===((null==i||null===(k=i.typography)||void 0===k?void 0:k.textIndent)??"subsequent"),ee=J?(0,vt.__)("Indents the first line of all paragraphs.","kubio"):(0,vt.__)("Indents the first line of each paragraph after the first one.","kubio"),te=HP(i),ne=C(null==o||null===(_=o.typography)||void 0===_?void 0:_.textColumns),oe=e=>{n(yn(t,["typography","textColumns"],e||void 0))},ie=OP(i),re=C(null==o||null===(y=o.typography)||void 0===y?void 0:y.textTransform),se=e=>{n(yn(t,["typography","textTransform"],e||void 0))},ae=VP(i),ce=C(null==o||null===(x=o.typography)||void 0===x?void 0:x.textDecoration),ue=e=>{n(yn(t,["typography","textDecoration"],e||void 0))},de=FP(i),pe=C(null==o||null===(S=o.typography)||void 0===S?void 0:S.writingMode),he=e=>{n(yn(t,["typography","writingMode"],e||void 0))},ge=zP(i),me=C(null==o||null===(w=o.typography)||void 0===w?void 0:w.textAlign),fe=e=>{n(yn(t,["typography","textAlign"],e||void 0))},ve=(0,p.useCallback)((e=>({...e,typography:{}})),[]);return(0,et.jsxs)(e,{resetAllFilter:ve,value:t,onChange:n,panelId:l,children:[B&&(0,et.jsx)(le.__experimentalToolsPanelItem,{label:(0,vt.__)("Font","kubio"),hasValue:()=>{var e;return!(null==t||null===(e=t.typography)||void 0===e||!e.fontFamily)},onDeselect:()=>T(void 0),isShownByDefault:r.fontFamily,panelId:l,children:(0,et.jsx)(HC,{fontFamilies:j,value:I,onChange:T,size:"__unstable-large"})}),P&&(0,et.jsx)(le.__experimentalToolsPanelItem,{label:(0,vt.__)("Size","kubio"),hasValue:()=>{var e;return!(null==t||null===(e=t.typography)||void 0===e||!e.fontSize)},onDeselect:()=>A(void 0),isShownByDefault:r.fontSize,panelId:l,children:(0,et.jsx)(le.FontSizePicker,{value:L||N,valueMode:L?"slug":"literal",onChange:A,fontSizes:R,disableCustomFontSizes:M,withReset:!1,withSlider:!0,size:"__unstable-large"})}),D&&(0,et.jsx)(le.__experimentalToolsPanelItem,{label:O,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:$,isShownByDefault:r.fontAppearance,panelId:l,children:(0,et.jsx)(FC,{value:{fontStyle:F,fontWeight:H},onChange:G,hasFontStyles:z,hasFontWeights:V,fontFamilyFaces:E,size:"__unstable-large"})}),U&&(0,et.jsx)(le.__experimentalToolsPanelItem,{className:"single-column",label:(0,vt.__)("Line height","kubio"),hasValue:()=>{var e;return void 0!==(null==t||null===(e=t.typography)||void 0===e?void 0:e.lineHeight)},onDeselect:()=>K(void 0),isShownByDefault:r.lineHeight,panelId:l,children:(0,et.jsx)(_j,{__unstableInputWidth:"auto",value:W,onChange:K,size:"__unstable-large"})}),Z&&(0,et.jsx)(le.__experimentalToolsPanelItem,{className:"single-column",label:(0,vt.__)("Letter spacing","kubio"),hasValue:()=>{var e;return!(null==t||null===(e=t.typography)||void 0===e||!e.letterSpacing)},onDeselect:()=>Y(void 0),isShownByDefault:r.letterSpacing,panelId:l,children:(0,et.jsx)(GC,{value:q,onChange:Y,size:"__unstable-large",__unstableInputWidth:"auto"})}),Q&&(0,et.jsxs)(le.__experimentalToolsPanelItem,{label:(0,vt.__)("Line indent","kubio"),hasValue:()=>{var e;return!(null==t||null===(e=t.typography)||void 0===e||!e.textIndent)},onDeselect:()=>{n(yn(t,["typography","textIndent"],void 0))},isShownByDefault:r.textIndent,panelId:l,children:[(0,et.jsx)(EP,{value:X,onChange:e=>{n(yn(t,["typography","textIndent"],e||void 0))},size:"__unstable-large",__unstableInputWidth:"auto",withSlider:!0,hasBottomMargin:s}),s&&(0,et.jsx)(le.ToggleControl,{label:(0,vt.__)("Indent all paragraphs","kubio"),checked:J,onChange:e=>{n({...t,settings:{typography:{textIndent:e?"all":"subsequent"}}})},help:ee})]}),te&&(0,et.jsx)(le.__experimentalToolsPanelItem,{className:"single-column",label:(0,vt.__)("Columns","kubio"),hasValue:()=>{var e;return!(null==t||null===(e=t.typography)||void 0===e||!e.textColumns)},onDeselect:()=>oe(void 0),isShownByDefault:r.textColumns,panelId:l,children:(0,et.jsx)(le.__experimentalNumberControl,{label:(0,vt.__)("Columns","kubio"),max:PP,min:TP,onChange:oe,size:"__unstable-large",spinControls:"custom",value:ne,initialPosition:1})}),ae&&(0,et.jsx)(le.__experimentalToolsPanelItem,{className:"single-column",label:(0,vt.__)("Decoration","kubio"),hasValue:()=>{var e;return!(null==t||null===(e=t.typography)||void 0===e||!e.textDecoration)},onDeselect:()=>ue(void 0),isShownByDefault:r.textDecoration,panelId:l,children:(0,et.jsx)(ZC,{value:ce,onChange:ue,size:"__unstable-large",__unstableInputWidth:"auto"})}),de&&(0,et.jsx)(le.__experimentalToolsPanelItem,{className:"single-column",label:(0,vt.__)("Orientation","kubio"),hasValue:()=>{var e;return!(null==t||null===(e=t.typography)||void 0===e||!e.writingMode)},onDeselect:()=>he(void 0),isShownByDefault:r.writingMode,panelId:l,children:(0,et.jsx)(oB,{value:pe,onChange:he,size:"__unstable-large"})}),ie&&(0,et.jsx)(le.__experimentalToolsPanelItem,{label:(0,vt.__)("Letter case","kubio"),hasValue:()=>{var e;return!(null==t||null===(e=t.typography)||void 0===e||!e.textTransform)},onDeselect:()=>se(void 0),isShownByDefault:r.textTransform,panelId:l,children:(0,et.jsx)(JC,{value:re,onChange:se,showNone:!0,isBlock:!0,size:"__unstable-large"})}),ge&&(0,et.jsxs)(le.__experimentalToolsPanelItem,{label:(0,vt.__)("Text alignment","kubio"),hasValue:()=>{var e;return!(null==t||null===(e=t.typography)||void 0===e||!e.textAlign)},onDeselect:()=>fe(void 0),isShownByDefault:r.textAlign,panelId:l,children:[(0,et.jsx)(jP,{value:me,onChange:fe,options:["left","center","right","justify"],size:"__unstable-large"}),"justify"===me&&(0,et.jsx)("div",{children:(0,et.jsx)(le.Notice,{status:"warning",isDismissible:!1,children:(0,vt.__)("Justified text can reduce readability. For better accessibility, use left-aligned text instead.","kubio")})})]})]})}function KP(e,t){const{getBlockOrder:n,getBlockAttributes:o}=(0,h.useSelect)(ba);return(i,l)=>{const r=(l-1)*t+i-1;let s=0;for(const i of n(e)){var a;const{columnStart:e,rowStart:n}=(null===(a=o(i).style)||void 0===a?void 0:a.layout)??{};(n-1)*t+e-1<r&&s++}return s}}function ZP(e,t){const{orientation:n="horizontal"}=t;return"fill"===e?(0,vt.__)("Stretch to fill available space."):"fixed"===e&&"horizontal"===n?(0,vt.__)("Specify a fixed width."):"fixed"===e?(0,vt.__)("Specify a fixed height."):(0,vt.__)("Fit contents.")}function qP({value:e={},onChange:t,parentLayout:n,isShownByDefault:o,panelId:i}){const{type:l,default:{type:r="default"}={}}=n??{},s=l||r;return"flex"===s?(0,et.jsx)(YP,{childLayout:e,onChange:t,parentLayout:n,isShownByDefault:o,panelId:i}):"grid"===s?(0,et.jsx)(XP,{childLayout:e,onChange:t,parentLayout:n,isShownByDefault:o,panelId:i}):null}function YP({childLayout:e,onChange:t,parentLayout:n,isShownByDefault:o,panelId:i}){const{selfStretch:l,flexSize:r}=e,{orientation:s="horizontal"}=n??{},a="horizontal"===s?(0,vt.__)("Width"):(0,vt.__)("Height"),[c]=wa("spacing.units"),u=(0,le.__experimentalUseCustomUnits)({availableUnits:c||["%","px","em","rem","vh","vw"]});return(0,p.useEffect)((()=>{"fixed"!==l||r||t({...e,selfStretch:"fit"})}),[]),(0,et.jsxs)(le.__experimentalVStack,{as:le.__experimentalToolsPanelItem,spacing:2,hasValue:()=>!!l,label:a,onDeselect:()=>{t({selfStretch:void 0,flexSize:void 0})},isShownByDefault:o,panelId:i,children:[(0,et.jsxs)(le.__experimentalToggleGroupControl,{size:"__unstable-large",label:QP(n),value:l||"fit",help:ZP(l,n),onChange:e=>{t({selfStretch:e,flexSize:"fixed"!==e?null:r})},isBlock:!0,children:[(0,et.jsx)(le.__experimentalToggleGroupControlOption,{value:"fit",label:(0,vt._x)("Fit","Intrinsic block width in flex layout")},"fit"),(0,et.jsx)(le.__experimentalToggleGroupControlOption,{value:"fill",label:(0,vt._x)("Grow","Block with expanding width in flex layout")},"fill"),(0,et.jsx)(le.__experimentalToggleGroupControlOption,{value:"fixed",label:(0,vt._x)("Fixed","Block with fixed width in flex layout")},"fixed")]}),"fixed"===l&&(0,et.jsx)(le.__experimentalUnitControl,{size:"__unstable-large",units:u,onChange:e=>{t({selfStretch:l,flexSize:e})},value:r,min:0,label:a,hideLabelFromVision:!0})]})}function QP(e){const{orientation:t="horizontal"}=e;return"horizontal"===t?(0,vt.__)("Width"):(0,vt.__)("Height")}function XP({childLayout:e,onChange:t,parentLayout:n,isShownByDefault:o,panelId:i}){const{columnStart:l,rowStart:r,columnSpan:s,rowSpan:a}=e,{columnCount:c,rowCount:u}=n??{},d=(0,h.useSelect)((e=>e(ba).getBlockRootClientId(i))),{moveBlocksToPosition:p,__unstableMarkNextChangeAsNotPersistent:g}=(0,h.useDispatch)(ba),m=KP(d,c||3),f=c?c-(l??1)+1:void 0,v=window.__experimentalEnableGridInteractivity&&u?u-(r??1)+1:void 0;return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsxs)(le.Flex,{as:le.__experimentalToolsPanelItem,hasValue:()=>!!s||!!a,label:(0,vt.__)("Grid span"),onDeselect:()=>{t({columnSpan:void 0,rowSpan:void 0})},isShownByDefault:o,panelId:i,children:[(0,et.jsx)(le.FlexItem,{style:{width:"50%"},children:(0,et.jsx)(le.__experimentalInputControl,{size:"__unstable-large",label:(0,vt.__)("Column span"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10),o=f?Math.min(n,f):n;t({columnStart:l,rowStart:r,rowSpan:a,columnSpan:o})},value:s??1,min:1,max:f})}),(0,et.jsx)(le.FlexItem,{style:{width:"50%"},children:(0,et.jsx)(le.__experimentalInputControl,{size:"__unstable-large",label:(0,vt.__)("Row span"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10),o=v?Math.min(n,v):n;t({columnStart:l,rowStart:r,columnSpan:s,rowSpan:o})},value:a??1,min:1,max:v})})]}),window.__experimentalEnableGridInteractivity&&(0,et.jsxs)(le.Flex,{as:le.__experimentalToolsPanelItem,hasValue:()=>!!l||!!r,label:(0,vt.__)("Grid placement"),onDeselect:()=>{t({columnStart:void 0,rowStart:void 0})},isShownByDefault:!1,panelId:i,children:[(0,et.jsx)(le.FlexItem,{style:{width:"50%"},children:(0,et.jsx)(le.__experimentalInputControl,{size:"__unstable-large",label:(0,vt.__)("Column"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10);t({columnStart:n,rowStart:r,columnSpan:s,rowSpan:a}),g(),p([i],d,d,m(n,r))},value:l??1,min:1,max:c?c-(s??1)+1:void 0})}),(0,et.jsx)(le.FlexItem,{style:{width:"50%"},children:(0,et.jsx)(le.__experimentalInputControl,{size:"__unstable-large",label:(0,vt.__)("Row"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10);t({columnStart:l,rowStart:n,columnSpan:s,rowSpan:a}),g(),p([i],d,d,m(l,n))},value:r??1,min:1,max:u?u-(a??1)+1:void 0})})]})]})}function JP({panelId:e,value:t,onChange:n=(()=>{}),options:o,defaultValue:i="auto",hasValue:l,isShownByDefault:r=!0}){const s=t??"auto",[a,c,u]=wa("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,vt._x)("Original","Aspect ratio option for dimensions control"),value:"auto"},...u?p:[],...d||[],{label:(0,vt._x)("Custom","Aspect ratio option for dimensions control"),value:"custom",disabled:!0,hidden:!0}];return(0,et.jsx)(le.__experimentalToolsPanelItem,{hasValue:l||(()=>s!==i),label:(0,vt.__)("Aspect ratio"),onDeselect:()=>n(void 0),isShownByDefault:r,panelId:e,children:(0,et.jsx)(le.SelectControl,{label:(0,vt.__)("Aspect ratio"),value:s,options:o??h,onChange:n,size:"__unstable-large"})})}const eM=le.BoxControl||le.__experimentalBoxControl,tM=["horizontal","vertical"];function nM(e){const t=oM(e),n=iM(e),o=lM(e),i=rM(e),l=sM(e),r=aM(e),s=cM(e),a=uM(e),c=dM(e),u=pM(e);return"web"===p.Platform.OS&&(t||n||o||i||l||r||s||a||c||u)}function oM(e){var t;return null==e||null===(t=e.layout)||void 0===t?void 0:t.contentSize}function iM(e){var t;return null==e||null===(t=e.layout)||void 0===t?void 0:t.wideSize}function lM(e){var t;return null==e||null===(t=e.spacing)||void 0===t?void 0:t.padding}function rM(e){var t;return null==e||null===(t=e.spacing)||void 0===t?void 0:t.margin}function sM(e){var t;return null==e||null===(t=e.spacing)||void 0===t?void 0:t.blockGap}function aM(e){var t;return null==e||null===(t=e.dimensions)||void 0===t?void 0:t.height}function cM(e){var t;return null==e||null===(t=e.dimensions)||void 0===t?void 0:t.minHeight}function uM(e){var t;return null==e||null===(t=e.dimensions)||void 0===t?void 0:t.width}function dM(e){var t;return null==e||null===(t=e.dimensions)||void 0===t?void 0:t.aspectRatio}function pM(e){const{type:t="default",default:{type:n="default"}={},allowSizingOnChildren:o=!1}=(null==e?void 0:e.parentLayout)??{},i=("flex"===n||"flex"===t||"grid"===n||"grid"===t)&&o;return!(null==e||!e.layout)&&i}function hM(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 gM(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function mM({resetAllFilter:e,onChange:t,value:n,panelId:o,children:i}){const l=jw();return(0,et.jsx)(le.__experimentalToolsPanel,{label:(0,vt.__)("Dimensions","kubio"),resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:l,children:i})}const fM={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,height:!0,minHeight:!0,width:!0,aspectRatio:!0,childLayout:!0};function vM({as:e=mM,value:t,onChange:n,inheritedValue:o=t,settings:i,panelId:l,defaultControls:r=fM,onVisualize:s=(()=>{}),includeLayoutControls:a=!1}){var c,d,h,g,m,f,v,b,k,_,y,x,S,w,C,B,I,j,E,T,P,M;const{dimensions:R,spacing:N}=i,L=e=>e&&"object"==typeof e?Object.keys(e).reduce(((t,n)=>(t[n]=Tw({settings:{dimensions:R,spacing:N}},"",e[n]),t)),{}):Tw({settings:{dimensions:R,spacing:N}},"",e),A=function(e){var t,n,o;const{defaultSpacingSizes:i,spacingSizes:l}=(null==e?void 0:e.spacing)||{};return!1!==i&&(null==l||null===(t=l.default)||void 0===t?void 0:t.length)>0||(null==l||null===(n=l.theme)||void 0===n?void 0:n.length)>0||(null==l||null===(o=l.custom)||void 0===o?void 0:o.length)>0}(i),D=(0,le.__experimentalUseCustomUnits)({availableUnits:(null==i||null===(c=i.spacing)||void 0===c?void 0:c.units)||["%","px","em","rem","vw"]}),O=-1/0,[z,V]=(0,p.useState)(O),F=oM(i)&&a,H=L(null==o||null===(d=o.layout)||void 0===d?void 0:d.contentSize),G=e=>{n(yn(t,["layout","contentSize"],e||void 0))},$=iM(i)&&a,U=L(null==o||null===(h=o.layout)||void 0===h?void 0:h.wideSize),W=e=>{n(yn(t,["layout","wideSize"],e||void 0))},K=lM(i),Z=gM(L(null==o||null===(g=o.spacing)||void 0===g?void 0:g.padding)),q=Array.isArray(null==i||null===(m=i.spacing)||void 0===m?void 0:m.padding)?null==i||null===(f=i.spacing)||void 0===f?void 0:f.padding:null==i||null===(v=i.spacing)||void 0===v||null===(b=v.padding)||void 0===b?void 0:b.sides,Y=q&&q.some((e=>tM.includes(e))),Q=e=>{const o=hM(e,q);n(yn(t,["spacing","padding"],o))},X=()=>s("padding"),J=rM(i),ee=gM(L(null==o||null===(k=o.spacing)||void 0===k?void 0:k.margin)),te=Array.isArray(null==i||null===(_=i.spacing)||void 0===_?void 0:_.margin)?null==i||null===(y=i.spacing)||void 0===y?void 0:y.margin:null==i||null===(x=i.spacing)||void 0===x||null===(S=x.margin)||void 0===S?void 0:S.sides,ne=te&&te.some((e=>tM.includes(e))),oe=e=>{const o=hM(e,te);n(yn(t,["spacing","margin"],o))},ie=()=>s("margin"),re=sM(i),se=Array.isArray(null==i||null===(w=i.spacing)||void 0===w?void 0:w.blockGap)?null==i||null===(C=i.spacing)||void 0===C?void 0:C.blockGap:null==i||null===(B=i.spacing)||void 0===B||null===(I=B.blockGap)||void 0===I?void 0:I.sides,ae=se&&se.some((e=>tM.includes(e))),ce=L(null==o||null===(j=o.spacing)||void 0===j?void 0:j.blockGap),ue=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}(ce,ae),de=e=>{n(yn(t,["spacing","blockGap"],e))},pe=e=>{e||de(null),!ae&&null!=e&&e.hasOwnProperty("top")?de(e.top):de({top:null==e?void 0:e.top,left:null==e?void 0:e.left})},he=cM(i),ge=L(null==o||null===(E=o.dimensions)||void 0===E?void 0:E.minHeight),me=e=>{const o=yn(t,["dimensions","minHeight"],e);n(yn(o,["dimensions","aspectRatio"],void 0))},fe=aM(i),ve=L(null==o||null===(T=o.dimensions)||void 0===T?void 0:T.height),be=e=>{const o=yn(t,["dimensions","height"],e);n(yn(o,["dimensions","aspectRatio"],void 0))},ke=uM(i),_e=L(null==o||null===(P=o.dimensions)||void 0===P?void 0:P.width),ye=e=>{n(yn(t,["dimensions","width"],e))},xe=dM(i),Se=L(null==o||null===(M=o.dimensions)||void 0===M?void 0:M.aspectRatio),we=pM(i),Ce=null==o?void 0:o.layout,Be=(0,p.useCallback)((e=>({...e,layout:qN({...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,height:void 0,minHeight:void 0,aspectRatio:void 0,width:void 0}})),[]),Ie=()=>s(!1);return(0,et.jsxs)(e,{resetAllFilter:Be,value:t,onChange:n,panelId:l,children:[(F||$)&&(0,et.jsx)("span",{className:"span-columns",children:(0,vt.__)("Set the width of the main content area.","kubio")}),F&&(0,et.jsx)(le.__experimentalToolsPanelItem,{label:(0,vt.__)("Content width","kubio"),hasValue:()=>{var e;return!(null==t||null===(e=t.layout)||void 0===e||!e.contentSize)},onDeselect:()=>G(void 0),isShownByDefault:r.contentSize??fM.contentSize,panelId:l,children:(0,et.jsx)(le.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,vt.__)("Content width","kubio"),labelPosition:"top",value:H||"",onChange:e=>{G(e)},units:D,prefix:(0,et.jsx)(le.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,et.jsx)(jc,{icon:Su})})})}),$&&(0,et.jsx)(le.__experimentalToolsPanelItem,{label:(0,vt.__)("Wide width","kubio"),hasValue:()=>{var e;return!(null==t||null===(e=t.layout)||void 0===e||!e.wideSize)},onDeselect:()=>W(void 0),isShownByDefault:r.wideSize??fM.wideSize,panelId:l,children:(0,et.jsx)(le.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,vt.__)("Wide width","kubio"),labelPosition:"top",value:U||"",onChange:e=>{W(e)},units:D,prefix:(0,et.jsx)(le.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,et.jsx)(jc,{icon:wu})})})}),K&&(0,et.jsxs)(le.__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,vt.__)("Padding","kubio"),onDeselect:()=>Q(void 0),isShownByDefault:r.padding??fM.padding,className:u({"tools-panel-item-spacing":A}),panelId:l,children:[!A&&(0,et.jsx)(eM,{__next40pxDefaultSize:!0,values:Z,onChange:Q,label:(0,vt.__)("Padding","kubio"),sides:q,units:D,allowReset:!1,splitOnAxis:Y,inputProps:{onMouseOver:X,onMouseOut:Ie}}),A&&(0,et.jsx)(_T,{values:Z,onChange:Q,label:(0,vt.__)("Padding","kubio"),sides:q,units:D,allowReset:!1,onMouseOver:X,onMouseOut:Ie})]}),J&&(0,et.jsxs)(le.__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,vt.__)("Margin","kubio"),onDeselect:()=>oe(void 0),isShownByDefault:r.margin??fM.margin,className:u({"tools-panel-item-spacing":A}),panelId:l,children:[!A&&(0,et.jsx)(eM,{__next40pxDefaultSize:!0,values:ee,onChange:oe,inputProps:{min:z,onDragStart:()=>{V(0)},onDragEnd:()=>{V(O)},onMouseOver:ie,onMouseOut:Ie},label:(0,vt.__)("Margin","kubio"),sides:te,units:D,allowReset:!1,splitOnAxis:ne}),A&&(0,et.jsx)(_T,{values:ee,onChange:oe,minimumCustomValue:-1/0,label:(0,vt.__)("Margin","kubio"),sides:te,units:D,allowReset:!1,onMouseOver:ie,onMouseOut:Ie})]}),re&&(0,et.jsxs)(le.__experimentalToolsPanelItem,{hasValue:()=>{var e;return!(null==t||null===(e=t.spacing)||void 0===e||!e.blockGap)},label:(0,vt.__)("Block spacing","kubio"),onDeselect:()=>de(void 0),isShownByDefault:r.blockGap??fM.blockGap,className:u({"tools-panel-item-spacing":A,"single-column":!A&&!ae}),panelId:l,children:[!A&&(ae?(0,et.jsx)(eM,{__next40pxDefaultSize:!0,label:(0,vt.__)("Block spacing","kubio"),min:0,onChange:pe,units:D,sides:se,values:ue,allowReset:!1,splitOnAxis:ae}):(0,et.jsx)(le.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,vt.__)("Block spacing","kubio"),min:0,onChange:de,units:D,value:ce})),A&&(0,et.jsx)(_T,{label:(0,vt.__)("Block spacing","kubio"),min:0,onChange:pe,showSideInLabel:!1,sides:ae?se:["top"],values:ue,allowReset:!1})]}),we&&(0,et.jsx)(qP,{value:Ce,onChange:e=>{n({...t,layout:{...e}})},parentLayout:null==i?void 0:i.parentLayout,panelId:l,isShownByDefault:r.childLayout??fM.childLayout}),he&&(0,et.jsx)(le.__experimentalToolsPanelItem,{hasValue:()=>{var e;return!(null==t||null===(e=t.dimensions)||void 0===e||!e.minHeight)},label:(0,vt.__)("Minimum height","kubio"),onDeselect:()=>{me(void 0)},isShownByDefault:r.minHeight??fM.minHeight,panelId:l,children:(0,et.jsx)(wB,{label:(0,vt.__)("Minimum height","kubio"),value:ge,onChange:me})}),fe&&(0,et.jsx)(le.__experimentalToolsPanelItem,{hasValue:()=>{var e;return!(null==t||null===(e=t.dimensions)||void 0===e||!e.height)},label:(0,vt.__)("Height","kubio"),onDeselect:()=>{be(void 0)},isShownByDefault:r.height??fM.height,panelId:l,children:(0,et.jsx)(wB,{label:(0,vt.__)("Height","kubio"),value:ve,onChange:be})}),ke&&(0,et.jsx)(le.__experimentalToolsPanelItem,{hasValue:()=>{var e;return!(null==t||null===(e=t.dimensions)||void 0===e||!e.width)},label:(0,vt.__)("Width","kubio"),onDeselect:()=>{ye(void 0)},isShownByDefault:r.width??fM.width,panelId:l,children:(0,et.jsx)(wB,{label:(0,vt.__)("Width","kubio"),value:_e,onChange:ye})}),xe&&(0,et.jsx)(JP,{hasValue:()=>{var e;return!(null==t||null===(e=t.dimensions)||void 0===e||!e.aspectRatio)},value:Se,onChange:e=>{const o=yn(t,["dimensions","aspectRatio"],e);n(yn(o,["dimensions","minHeight"],void 0))},panelId:l,isShownByDefault:r.aspectRatio??fM.aspectRatio})]})}var bM=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})});const kM=[];function _M({shadow:e,onShadowChange:t,settings:n}){const o=CM(n);return(0,et.jsx)("div",{className:"block-editor-global-styles__shadow-popover-container",children:(0,et.jsxs)(le.__experimentalVStack,{spacing:4,children:[(0,et.jsx)(le.__experimentalHeading,{level:5,children:(0,vt.__)("Drop shadow")}),(0,et.jsx)(yM,{presets:o,activeShadow:e,onSelect:t}),(0,et.jsx)("div",{className:"block-editor-global-styles__clear-shadow",children:(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t(void 0),disabled:!e,accessibleWhenDisabled:!0,children:(0,vt.__)("Clear")})})]})})}function yM({presets:e,activeShadow:t,onSelect:n}){return e?(0,et.jsx)(le.Composite,{role:"listbox",className:"block-editor-global-styles__shadow__list","aria-label":(0,vt.__)("Drop shadows"),children:e.map((({name:e,slug:o,shadow:i})=>(0,et.jsx)(xM,{label:e,isActive:i===t,type:"unset"===o?"unset":"preset",onSelect:()=>n(i===t?void 0:i),shadow:i},o)))}):null}function xM({type:e,label:t,isActive:n,onSelect:o,shadow:i}){return(0,et.jsx)(le.Tooltip,{text:t,children:(0,et.jsx)(le.Composite.Item,{role:"option","aria-label":t,"aria-selected":n,className:u("block-editor-global-styles__shadow__item",{"is-active":n}),render:(0,et.jsx)("button",{className:u("block-editor-global-styles__shadow-indicator",{unset:"unset"===e}),onClick:o,style:{boxShadow:i},"aria-label":t,children:n&&(0,et.jsx)(jc,{icon:jy})})})})}function SM({shadow:e,onShadowChange:t,settings:n}){return(0,et.jsx)(le.Dropdown,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:"block-editor-global-styles__shadow-dropdown",renderToggle:wM(e,t),renderContent:()=>(0,et.jsx)(le.__experimentalDropdownContentWrapper,{paddingSize:"medium",children:(0,et.jsx)(_M,{shadow:e,onShadowChange:t,settings:n})})})}function wM(e,t){return function({onToggle:n,isOpen:o}){const i=(0,p.useRef)(void 0),l={onClick:n,className:u("block-editor-global-styles__shadow-dropdown-toggle",{"is-open":o}),"aria-expanded":o,ref:i},r={onClick:()=>{var e;o&&n(),t(void 0),null===(e=i.current)||void 0===e||e.focus()},className:u("block-editor-global-styles__shadow-editor__remove-button",{"is-open":o}),label:(0,vt.__)("Remove")};return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,...l,children:(0,et.jsxs)(le.__experimentalHStack,{justify:"flex-start",children:[(0,et.jsx)(jc,{className:"block-editor-global-styles__toggle-icon",icon:bM,size:24}),(0,et.jsx)(le.FlexItem,{children:(0,vt.__)("Drop shadow")})]})}),!!e&&(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,size:"small",icon:$C,...r})]})}}function CM(e){return(0,p.useMemo)((()=>{var t,n;if(null==e||!e.shadow)return kM;const o=null==e||null===(t=e.shadow)||void 0===t?void 0:t.defaultPresets,{default:i,theme:l,custom:r}=(null==e||null===(n=e.shadow)||void 0===n?void 0:n.presets)??{},s={name:(0,vt.__)("Unset"),slug:"unset",shadow:"none"},a=[...o&&i||kM,...l||kM,...r||kM];return a.length&&a.unshift(s),a}),[e])}const BM=le.BorderBoxControl||le.__experimentalBorderBoxControl;function IM(e){return Object.values(jM(e)).some(Boolean)}function jM(e){return{hasBorderColor:EM(e),hasBorderRadius:TM(e),hasBorderStyle:PM(e),hasBorderWidth:MM(e),hasShadow:RM(e)}}function EM(e){var t;return null==e||null===(t=e.border)||void 0===t?void 0:t.color}function TM(e){var t;return null==e||null===(t=e.border)||void 0===t?void 0:t.radius}function PM(e){var t;return null==e||null===(t=e.border)||void 0===t?void 0:t.style}function MM(e){var t;return null==e||null===(t=e.border)||void 0===t?void 0:t.width}function RM(e){const t=CM(e);return!(null==e||!e.shadow)&&t.length>0}function NM({resetAllFilter:e,onChange:t,value:n,panelId:o,children:i,label:l}){return(0,et.jsx)(le.__experimentalToolsPanel,{label:l,resetAll:()=>{const o=e(n);t(o)},panelId:o,children:i})}const LM={radius:!0,color:!0,width:!0,shadow:!0};function AM({as:e=NM,value:t,onChange:n,inheritedValue:o=t,settings:i,panelId:l,name:r,defaultControls:s=LM}){var a;const c=ET(i),u=(0,p.useCallback)((e=>Tw({settings:i},"",e)),[i]),d=e=>{const t=c.flatMap((({colors:e})=>e)).find((({color:t})=>t===e));return t?"var:preset|color|"+t.slug:e},h=(0,p.useMemo)((()=>{var e,t;if((0,le.__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:u(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?u(null==o||null===(t=o.border)||void 0===t?void 0:t.color):void 0}}),[null==o?void 0:o.border,u]),g=e=>n({...t,border:e}),m=EM(i),f=PM(i),v=MM(i),b=TM(i),k=u(null==h?void 0:h.radius),_=e=>g({...h,radius:e}),y=()=>{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},x=RM(i),S=u(null==o?void 0:o.shadow),w=(null==i||null===(a=i.shadow)||void 0===a?void 0:a.presets)??{},C=w.custom??w.theme??w.default??[],B=e=>{var o;const i=null==C||null===(o=C.find((({shadow:t})=>t===e)))||void 0===o?void 0:o.slug;n(yn(t,["shadow"],i?`var:preset|shadow|${i}`:e||void 0))},I=(0,p.useCallback)((e=>({...e,border:void 0,shadow:void 0})),[]),j=(null==s?void 0:s.color)||(null==s?void 0:s.width),E=m||f||v||b,T=xR({blockName:r,hasShadowControl:x,hasBorderControl:E});return(0,et.jsxs)(e,{resetAllFilter:I,value:t,onChange:n,panelId:l,label:T,children:[(v||m)&&(0,et.jsx)(le.__experimentalToolsPanelItem,{hasValue:()=>(0,le.__experimentalIsDefinedBorder)(null==t?void 0:t.border),label:(0,vt.__)("Border","kubio"),onDeselect:()=>(()=>{var e;if(y())return g({radius:null==t||null===(e=t.border)||void 0===e?void 0:e.radius});g(void 0)})(),isShownByDefault:j,panelId:l,children:(0,et.jsx)(BM,{colors:c,enableAlpha:!0,enableStyle:f,onChange:e=>{const t={...e};(0,le.__experimentalHasSplitBorders)(t)?["top","right","bottom","left"].forEach((e=>{var n;t[e]&&(t[e]={...t[e],color:d(null===(n=t[e])||void 0===n?void 0:n.color)})})):t&&(t.color=d(t.color)),g({radius:null==h?void 0:h.radius,...t})},popoverOffset:40,popoverPlacement:"left-start",value:h,__experimentalIsRenderedInSidebar:!0,size:"__unstable-large",hideLabelFromVision:!x,label:(0,vt.__)("Border","kubio")})}),b&&(0,et.jsx)(le.__experimentalToolsPanelItem,{hasValue:y,label:(0,vt.__)("Radius","kubio"),onDeselect:()=>_(void 0),isShownByDefault:s.radius,panelId:l,children:(0,et.jsx)(SC,{values:k,onChange:e=>{_(e||void 0)}})}),x&&(0,et.jsxs)(le.__experimentalToolsPanelItem,{label:(0,vt.__)("Shadow","kubio"),hasValue:()=>!(null==t||!t.shadow),onDeselect:()=>B(void 0),isShownByDefault:s.shadow,panelId:l,children:[E?(0,et.jsx)(le.BaseControl.VisualLabel,{as:"legend",children:(0,vt.__)("Shadow","kubio")}):null,(0,et.jsx)(SM,{shadow:S,onShadowChange:B,settings:i})]})]})}function DM(e){const t=OM(e),n=GM(e),o=zM(e),i=FM(e),l=HM(e),r=VM(e);return t||n||o||i||l||r}function OM(e){var t,n;const o=ET(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 zM(e){var t,n;const o=ET(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 VM(e){var t,n;const o=ET(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 FM(e){var t,n,o;const i=ET(e),l=TT(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==l?void 0:l.length)>0||(null==e||null===(o=e.color)||void 0===o?void 0:o.customGradient))}function HM(e){var t,n,o;const i=ET(e),l=TT(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==l?void 0:l.length)>0||(null==e||null===(o=e.color)||void 0===o?void 0:o.customGradient))}function GM(e){var t,n,o;const i=ET(e),l=TT(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==l?void 0:l.length)>0||(null==e||null===(o=e.color)||void 0===o?void 0:o.customGradient))}function $M({resetAllFilter:e,onChange:t,value:n,panelId:o,children:i,label:l}){const r=jw();return(0,et.jsx)(le.__experimentalToolsPanel,{label:l||(0,vt.__)("Elements","kubio"),resetAll:()=>{const o=e(n);t(o)},panelId:o,hasInnerWrapper:!0,headingLevel:3,className:"color-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:r,children:(0,et.jsx)("div",{className:"color-block-support-panel__inner-wrapper",children:i})})}const UM={text:!0,background:!0,link:!0,heading:!0,button:!0,caption:!0},WM={placement:"left-start",offset:36,shift:!0},{Tabs:KM}=fe(le.privateApis),ZM=({indicators:e,label:t})=>(0,et.jsxs)(le.__experimentalHStack,{justify:"flex-start",children:[(0,et.jsx)(le.__experimentalZStack,{isLayered:!1,offset:-8,children:e.map(((e,t)=>(0,et.jsx)(le.Flex,{expanded:!1,children:(0,et.jsx)(le.ColorIndicator,{colorValue:e})},t)))}),(0,et.jsx)(le.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",children:t})]});function qM({isGradient:e,inheritedValue:t,userValue:n,setValue:o,colorGradientControlSettings:i}){return(0,et.jsx)(PC,{...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 YM({label:e,hasValue:t,resetValue:n,isShownByDefault:o,indicators:i,tabs:l,colorGradientControlSettings:r,panelId:s}){const a=l.find((e=>void 0!==e.userValue)),{key:c,...d}=l[0]??{},h=(0,p.useRef)(void 0);return(0,et.jsx)(le.__experimentalToolsPanelItem,{className:"block-editor-tools-panel-color-gradient-settings__item",hasValue:t,label:e,onDeselect:n,isShownByDefault:o,panelId:s,children:(0,et.jsx)(le.Dropdown,{popoverProps:WM,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:o,isOpen:l})=>{const r={onClick:o,className:u("block-editor-panel-color-gradient-settings__dropdown",{"is-open":l}),"aria-expanded":l,ref:h};return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(le.Button,{...r,__next40pxDefaultSize:!0,children:(0,et.jsx)(ZM,{indicators:i,label:e})}),t()&&(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,label:(0,vt.__)("Reset","kubio"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:$C,onClick:()=>{var e;n(),l&&o(),null===(e=h.current)||void 0===e||e.focus()}})]})},renderContent:()=>(0,et.jsx)(le.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,et.jsxs)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:[1===l.length&&(0,et.jsx)(qM,{...d,colorGradientControlSettings:r},c),l.length>1&&(0,et.jsxs)(KM,{defaultTabId:null==a?void 0:a.key,children:[(0,et.jsx)(KM.TabList,{children:l.map((e=>(0,et.jsx)(KM.Tab,{tabId:e.key,children:e.label},e.key)))}),l.map((e=>{const{key:t,...n}=e;return(0,et.jsx)(KM.TabPanel,{tabId:t,focusable:!1,children:(0,et.jsx)(qM,{...n,colorGradientControlSettings:r},t)},t)}))]})]})})})})}function QM({as:e=$M,value:t,onChange:n,inheritedValue:o=t,settings:i,panelId:l,defaultControls:r=UM,label:s,children:a}){var c,u,d,h,g,m,f,v,b,k,_,y,x,S,w,C,B,I,j,E,T,P;const M=ET(i),R=TT(i),N=null==i||null===(c=i.color)||void 0===c?void 0:c.custom,L=null==i||null===(u=i.color)||void 0===u?void 0:u.customGradient,A=M.length>0||N,D=R.length>0||L,O=e=>Tw({settings:i},"",e),z=e=>{const t=M.flatMap((({colors:e})=>e)).find((({color:t})=>t===e));return t?"var:preset|color|"+t.slug:e},V=e=>{const t=R.flatMap((({gradients:e})=>e)).find((({gradient:t})=>t===e));return t?"var:preset|gradient|"+t.slug:e},F=GM(i),H=O(null==o||null===(d=o.color)||void 0===d?void 0:d.background),G=O(null==t||null===(h=t.color)||void 0===h?void 0:h.background),$=O(null==o||null===(g=o.color)||void 0===g?void 0:g.gradient),U=O(null==t||null===(m=t.color)||void 0===m?void 0:m.gradient),W=zM(i),K=O(null==o||null===(f=o.elements)||void 0===f||null===(v=f.link)||void 0===v||null===(b=v.color)||void 0===b?void 0:b.text),Z=O(null==t||null===(k=t.elements)||void 0===k||null===(_=k.link)||void 0===_||null===(y=_.color)||void 0===y?void 0:y.text),q=O(null==o||null===(x=o.elements)||void 0===x||null===(S=x.link)||void 0===S||null===(w=S[":hover"])||void 0===w||null===(C=w.color)||void 0===C?void 0:C.text),Y=O(null==t||null===(B=t.elements)||void 0===B||null===(I=B.link)||void 0===I||null===(j=I[":hover"])||void 0===j||null===(E=j.color)||void 0===E?void 0:E.text),Q=OM(i),X=O(null==o||null===(T=o.color)||void 0===T?void 0:T.text),J=O(null==t||null===(P=t.color)||void 0===P?void 0:P.text),ee=e=>{let o=yn(t,["color","text"],z(e));X===K&&(o=yn(o,["elements","link","color","text"],z(e))),n(o)},te=[{name:"caption",label:(0,vt.__)("Captions","kubio"),showPanel:VM(i)},{name:"button",label:(0,vt.__)("Button","kubio"),showPanel:HM(i)},{name:"heading",label:(0,vt.__)("Heading","kubio"),showPanel:FM(i)},{name:"h1",label:(0,vt.__)("H1","kubio"),showPanel:FM(i)},{name:"h2",label:(0,vt.__)("H2","kubio"),showPanel:FM(i)},{name:"h3",label:(0,vt.__)("H3","kubio"),showPanel:FM(i)},{name:"h4",label:(0,vt.__)("H4","kubio"),showPanel:FM(i)},{name:"h5",label:(0,vt.__)("H5","kubio"),showPanel:FM(i)},{name:"h6",label:(0,vt.__)("H6","kubio"),showPanel:FM(i)}],ne=(0,p.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}},...te.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}}}),{})}}}),[te]),oe=[Q&&{key:"text",label:(0,vt.__)("Text","kubio"),hasValue:()=>!!J,resetValue:()=>ee(void 0),isShownByDefault:r.text,indicators:[X],tabs:[{key:"text",label:(0,vt.__)("Text","kubio"),inheritedValue:X,setValue:ee,userValue:J}]},F&&{key:"background",label:(0,vt.__)("Background","kubio"),hasValue:()=>!!G||!!U,resetValue:()=>{const e=yn(t,["color","background"],void 0);e.color.gradient=void 0,n(e)},isShownByDefault:r.background,indicators:[$??H],tabs:[A&&{key:"background",label:(0,vt.__)("Color","kubio"),inheritedValue:H,setValue:e=>{const o=yn(t,["color","background"],z(e));o.color.gradient=void 0,n(o)},userValue:G},D&&{key:"gradient",label:(0,vt.__)("Gradient","kubio"),inheritedValue:$,setValue:e=>{const o=yn(t,["color","gradient"],V(e));o.color.background=void 0,n(o)},userValue:U,isGradient:!0}].filter(Boolean)},W&&{key:"link",label:(0,vt.__)("Link","kubio"),hasValue:()=>!!Z||!!Y,resetValue:()=>{let e=yn(t,["elements","link",":hover","color","text"],void 0);e=yn(e,["elements","link","color","text"],void 0),n(e)},isShownByDefault:r.link,indicators:[K,q],tabs:[{key:"link",label:(0,vt.__)("Default","kubio"),inheritedValue:K,setValue:e=>{n(yn(t,["elements","link","color","text"],z(e)))},userValue:Z},{key:"hover",label:(0,vt.__)("Hover","kubio"),inheritedValue:q,setValue:e=>{n(yn(t,["elements","link",":hover","color","text"],z(e)))},userValue:Y}]}].filter(Boolean);return te.forEach((({name:e,label:i,showPanel:l})=>{var s,a,c,u,d,p,h,g,m,f,v,b,k,_,y,x,S,w;if(!l)return;const C=O(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=O(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=O(null==o||null===(h=o.elements)||void 0===h||null===(g=h[e])||void 0===g||null===(m=g.color)||void 0===m?void 0:m.text),j=O(null==t||null===(f=t.elements)||void 0===f||null===(v=f[e])||void 0===v||null===(b=v.color)||void 0===b?void 0:b.background),E=O(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=O(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;oe.push({key:e,label:i,hasValue:()=>!!(T||j||E),resetValue:()=>{const o=yn(t,["elements",e,"color","background"],void 0);o.elements[e].color.gradient=void 0,o.elements[e].color.text=void 0,n(o)},isShownByDefault:r[e],indicators:P?[I,B??C]:[I],tabs:[A&&{key:"text",label:(0,vt.__)("Text","kubio"),inheritedValue:I,setValue:o=>{n(yn(t,["elements",e,"color","text"],z(o)))},userValue:T},A&&P&&{key:"background",label:(0,vt.__)("Background","kubio"),inheritedValue:C,setValue:o=>{const i=yn(t,["elements",e,"color","background"],z(o));i.elements[e].color.gradient=void 0,n(i)},userValue:j},D&&P&&{key:"gradient",label:(0,vt.__)("Gradient","kubio"),inheritedValue:B,setValue:o=>{const i=yn(t,["elements",e,"color","gradient"],V(o));i.elements[e].color.background=void 0,n(i)},userValue:E,isGradient:!0}].filter(Boolean)})})),(0,et.jsxs)(e,{resetAllFilter:ne,value:t,onChange:n,panelId:l,label:s,children:[oe.map((e=>{const{key:t,...n}=e;return(0,et.jsx)(YM,{...n,colorGradientControlSettings:{colors:M,disableCustomColors:!N,gradients:R,disableCustomGradients:!L},panelId:l},t)})),a]})}const XM=[];function JM(e,{presetSetting:t,defaultSetting:n}){var o,i,l,r,s,a,c;const u=!(null!=e&&null!==(o=e.color)&&void 0!==o&&o[n]),d=(null==e||null===(i=e.color)||void 0===i||null===(l=i[t])||void 0===l?void 0:l.custom)||XM,h=(null==e||null===(r=e.color)||void 0===r||null===(s=r[t])||void 0===s?void 0:s.theme)||XM,g=(null==e||null===(a=e.color)||void 0===a||null===(c=a[t])||void 0===c?void 0:c.default)||XM;return(0,p.useMemo)((()=>[...d,...h,...u?XM:g]),[u,d,h,g])}function eR(e){return tR(e)}function tR(e){return e.color.customDuotone||e.color.defaultDuotone||e.color.duotone.length>0}function nR({resetAllFilter:e,onChange:t,value:n,panelId:o,children:i}){const l=jw();return(0,et.jsx)(le.__experimentalToolsPanel,{label:(0,vt._x)("Filters","Name for applying graphical effects","kubio"),resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:l,children:i})}const oR={duotone:!0},iR={placement:"left-start",offset:36,shift:!0,className:"block-editor-duotone-control__popover",headerTitle:(0,vt.__)("Duotone","kubio")},lR=({indicator:e,label:t})=>(0,et.jsxs)(le.__experimentalHStack,{justify:"flex-start",children:[(0,et.jsx)(le.__experimentalZStack,{isLayered:!1,offset:-8,children:(0,et.jsx)(le.Flex,{expanded:!1,children:"unset"!==e&&e?(0,et.jsx)(le.DuotoneSwatch,{values:e}):(0,et.jsx)(le.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"})})}),(0,et.jsx)(le.FlexItem,{title:t,children:t})]}),rR=(e,t)=>function({onToggle:n,isOpen:o}){const i=(0,p.useRef)(void 0),l={onClick:n,className:u("block-editor-global-styles-filters-panel__dropdown-toggle",{"is-open":o}),"aria-expanded":o,ref:i},r={onClick:()=>{var e;o&&n(),t(),null===(e=i.current)||void 0===e||e.focus()},className:"block-editor-panel-duotone-settings__reset",label:(0,vt.__)("Reset","kubio")};return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,...l,children:(0,et.jsx)(lR,{indicator:e,label:(0,vt.__)("Duotone","kubio")})}),e&&(0,et.jsx)(le.Button,{size:"small",icon:$C,...r})]})};function sR({as:e=nR,value:t,onChange:n,inheritedValue:o=t,settings:i,panelId:l,defaultControls:r=oR}){var s;const a=tR(i),c=JM(i,{presetSetting:"duotone",defaultSetting:"defaultDuotone"}),u=JM(i,{presetSetting:"palette",defaultSetting:"defaultPalette"}),d=Tw({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(yn(t,["filter","duotone"],i))},g=()=>h(void 0),m=(0,p.useCallback)((e=>({...e,filter:{...e.filter,duotone:void 0}})),[]);return(0,et.jsx)(e,{resetAllFilter:m,value:t,onChange:n,panelId:l,children:a&&(0,et.jsx)(le.__experimentalToolsPanelItem,{label:(0,vt.__)("Duotone","kubio"),hasValue:()=>{var e;return!(null==t||null===(e=t.filter)||void 0===e||!e.duotone)},onDeselect:g,isShownByDefault:r.duotone,panelId:l,children:(0,et.jsx)(le.Dropdown,{popoverProps:iR,className:"block-editor-global-styles-filters-panel__dropdown",renderToggle:rR(d,g),renderContent:()=>(0,et.jsx)(le.__experimentalDropdownContentWrapper,{paddingSize:"small",children:(0,et.jsxs)(le.MenuGroup,{label:(0,vt.__)("Duotone","kubio"),children:[(0,et.jsx)("p",{children:(0,vt.__)("Create a two-tone color effect without losing your original image.","kubio")}),(0,et.jsx)(le.DuotonePicker,{colorPalette:u,duotonePalette:c,disableCustomColors:!0,disableCustomDuotone:!0,value:d,onChange:h})]})})})})})}function aR(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 cR({onChange:e,value:t,inheritedValue:n,panelId:o}){var i;const l=jw(),r=()=>{e(void 0)};let s=!1;return null!=n&&null!==(i=n.lightbox)&&void 0!==i&&i.enabled&&(s=n.lightbox.enabled),(0,et.jsx)(et.Fragment,{children:(0,et.jsx)(le.__experimentalToolsPanel,{label:(0,vt._x)("Settings","Image settings"),resetAll:r,panelId:o,dropdownMenuProps:l,children:(0,et.jsx)(le.__experimentalToolsPanelItem,{hasValue:()=>!(null==t||!t.lightbox),label:(0,vt.__)("Enlarge on click"),onDeselect:r,isShownByDefault:!0,panelId:o,children:(0,et.jsx)(le.ToggleControl,{label:(0,vt.__)("Enlarge on click"),checked:s,onChange:t=>{e({enabled:t})}})})})})}function uR(e){return"string"!=typeof e||!/<\/?\w/.test(e)}function dR({value:e,onChange:t,inheritedValue:n=e,help:o}){const[i,l]=(0,p.useState)(null),r=null==n?void 0:n.css;return(0,et.jsxs)(le.__experimentalVStack,{spacing:3,children:[i&&(0,et.jsx)(le.Notice,{status:"error",onRemove:()=>l(null),children:i}),(0,et.jsx)(le.TextareaControl,{label:(0,vt.__)("Additional CSS"),value:r,onChange:n=>function(n){t({...e,css:n}),uR(n)?i&&l(null):l((0,vt.__)("The custom CSS is invalid. Do not use <> markup."))}(n),onBlur:function(e){var t;const n=null==e||null===(t=e.target)||void 0===t?void 0:t.value;if(!n||!uR(n))return;const[o]=Le([{css:n}],".for-validation-only");l(null===o?(0,vt.__)("There is an error with your CSS structure."):null)},className:"block-editor-global-styles-advanced-panel__custom-css-input",spellCheck:!1,help:o})]})}const pR="__experimentalBorder",hR="shadow",gR=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},mR=({colors:e,namedColor:t,customColor:n})=>{if(t){const n=gR(e,"slug",t);if(n)return n}if(!n)return{color:void 0};return gR(e,"color",n)||{color:n}};function fR(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function vR(e){var t;if((0,le.__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:qN(i),borderColor:o}}function bR(e){var t,n,o,i;return(0,le.__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 kR({label:e,children:t,resetAllFilter:n}){const o=(0,p.useCallback)((e=>{const t=bR(e),o=n(t);return{...e,...vR(o)}}),[n]);return(0,et.jsx)(z_,{group:"border",resetAllFilter:o,label:e,children:t})}function _R({clientId:e,name:t,setAttributes:n,settings:o}){const i=IM(o),{style:l,borderColor:r}=(0,h.useSelect)((t=>{if(!i)return{};const{style:n,borderColor:o}=t(ba).getBlockAttributes(e)||{};return{style:n,borderColor:o}}),[e,i]),s=(0,p.useMemo)((()=>bR({style:l,borderColor:r})),[l,r]);if(!i)return null;const a={...(0,d.getBlockSupport)(t,[pR,"__experimentalDefaultControls"]),...(0,d.getBlockSupport)(t,[hR,"__experimentalDefaultControls"])};return(0,et.jsx)(AM,{as:kR,panelId:e,settings:o,value:s,onChange:e=>{n(vR(e))},defaultControls:a})}function yR(e,t="any"){if("web"!==p.Platform.OS)return!1;const n=(0,d.getBlockSupport)(e,pR);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 xR({blockName:e,hasBorderControl:t,hasShadowControl:n}={}){const o=jM(tL(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,vt.__)("Border & Shadow"):n?(0,vt.__)("Shadow"):(0,vt.__)("Border")}function SR(e,t,n){if(!yR(t,"color")||QN(t,pR,"color"))return e;const o=wR(n),i=u(e.className,o);return e.className=i||void 0,e}function wR(e){var t;const{borderColor:n,style:o}=e,i=Qe("border-color",n);return u({"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color),[i]:!!i})}const CR={useBlockProps:function({name:e,borderColor:t,style:n}){var o,i,l,r,s,a,c,u;const{colors:d}=aB();if(!yR(e,"color")||QN(e,pR,"color"))return{};const{color:p}=mR({colors:d,namedColor:t}),{color:h}=mR({colors:d,namedColor:fR(null==n||null===(o=n.border)||void 0===o||null===(i=o.top)||void 0===i?void 0:i.color)}),{color:g}=mR({colors:d,namedColor:fR(null==n||null===(l=n.border)||void 0===l||null===(r=l.right)||void 0===r?void 0:r.color)}),{color:m}=mR({colors:d,namedColor:fR(null==n||null===(s=n.border)||void 0===s||null===(a=s.bottom)||void 0===a?void 0:a.color)}),{color:f}=mR({colors:d,namedColor:fR(null==n||null===(c=n.border)||void 0===c||null===(u=c.left)||void 0===u?void 0:u.color)});return SR({style:qN({borderTopColor:h||p,borderRightColor:g||p,borderBottomColor:m||p,borderLeftColor:f||p})||{}},e,{borderColor:t,style:n})},addSaveProps:SR,attributeKeys:["borderColor","style"],hasSupport:e=>yR(e,"color")};(0,m.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return yR(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e}));const{createPrivateSlotFill:BR}=fe(le.privateApis||{});let IR;IR=BR?BR("BlockInformation"):(0,le.createSlotFill)("BlockInformation");const{Fill:jR,Slot:ER}=IR,TR=e=>B()[f]?(0,et.jsx)(jR,{...e}):null;TR.Slot=e=>(0,et.jsx)(ER,{...e});const PR=TR;function MR({clientIds:e,onSelect:t,onSwitchToListView:n,hasListViewTab:o}){return e.length?(0,et.jsx)(le.__experimentalVStack,{spacing:1,children:e.map((e=>(0,et.jsx)(RR,{onSelect:t,onSwitchToListView:n,hasListViewTab:o,clientId:e},e)))}):null}function RR({clientId:e,onSelect:t,onSwitchToListView:n,hasListViewTab:o}){const i=F_(e),{isSelected:l,childBlocks:r,hasListViewSupport:s,blockName:a}=(0,h.useSelect)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,getBlockOrder:i,getBlockName:l}=t(ba),r=l(e);return{isSelected:n(e)||o(e,!0),childBlocks:i(e),hasListViewSupport:"core/navigation"===r||(0,d.hasBlockSupport)(r,"listView"),blockName:r}}),[e]),c=(0,d.getBlockType)(a),u=(null==c?void 0:c.title)||a,{selectBlock:p}=(0,h.useDispatch)(ba),g=r&&r.length>0&&o&&s;return(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,className:"block-editor-block-quick-navigation__item",isPressed:l,onClick:async()=>{await p(e),g&&n&&n(e),t&&t(e)},children:(0,et.jsxs)(le.Flex,{children:[(0,et.jsx)(le.FlexItem,{children:(0,et.jsx)(Sc,{icon:null==i?void 0:i.icon})}),(0,et.jsx)(le.FlexBlock,{style:{textAlign:"left"},children:(0,et.jsx)(le.__experimentalTruncate,{children:u})}),g&&(0,et.jsx)(le.FlexItem,{children:(0,et.jsx)(jc,{icon:sy,size:24})})]})})}function NR({blockName:e}){const{preferredStyle:t,onUpdatePreferredStyleVariations:n,styles:o}=(0,h.useSelect)((t=>{var n;const o=t(ba).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:null==o||null===(n=o.value)||void 0===n?void 0:n[e],onUpdatePreferredStyleVariations:(null==o?void 0:o.onChange)??null,styles:t(d.store).getBlockStyles(e)}}),[e]),i=(0,p.useMemo)((()=>[{label:(0,vt.__)("Not set","kubio"),value:""},...o.map((({label:e,name:t})=>({label:e,value:t})))]),[o]),l=(0,p.useMemo)((()=>{var e;return null===(e=My(o))||void 0===e?void 0:e.name}),[o]),r=(0,p.useCallback)((t=>{n(e,t)}),[e,n]);return t&&t!==l?n&&(0,et.jsx)("div",{className:"default-style-picker__default-switcher",children:(0,et.jsx)(le.SelectControl,{__nextHasNoMarginBottom:!0,options:i,value:t||"",label:(0,vt.__)("Default Style","kubio"),onChange:r})}):null}const LR=({initialOpen:e=!1})=>{const t=(0,le.__experimentalUseSlotFills)(O_.slotName),n=(0,le.__experimentalUseSlotFills)(E_.name),o=Boolean(t&&t.length),i=Boolean(n&&n.length);return o||i?(0,et.jsxs)(le.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,vt.__)("Advanced"),initialOpen:e,children:[(0,et.jsx)(z_.Slot,{group:"advanced"}),(0,et.jsx)(E_.Slot,{})]}):null},AR=()=>{const{selectedClientIds:e,selectedBlocks:t,hasPositionAttribute:n}=(0,h.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:n}=e(ba),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,h.useDispatch)(ba);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:qN({...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,et.jsx)(le.__experimentalToolsPanel,{className:"block-editor-block-inspector__position",label:(0,vt.__)("Position","kubio"),resetAll:i,children:(0,et.jsx)(le.__experimentalToolsPanelItem,{isShownByDefault:n,label:(0,vt.__)("Position","kubio"),hasValue:()=>n,onDeselect:i,children:(0,et.jsx)(z_.Slot,{group:"position"})})})},DR=()=>{const e=(0,le.__experimentalUseSlotFills)(j_.position.name);return Boolean(e&&e.length)?(0,et.jsx)(AR,{}):null},OR=({showAdvancedControls:e=!1})=>{const t=(0,le.__experimentalUseSlotFills)(j_.default.name),n=(0,le.__experimentalUseSlotFills)(j_.position.name),o=(0,le.__experimentalUseSlotFills)(j_.bindings.name),i=!(null==t||!t.length)||!(null==n||!n.length)||!(null==o||!o.length);return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(z_.Slot,{}),(0,et.jsx)(DR,{}),(0,et.jsx)(z_.Slot,{group:"bindings"}),e&&(0,et.jsx)("div",{children:(0,et.jsx)(LR,{initialOpen:!i})})]})};function zR(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function VR(e,t){if(!e||!t)return{};const n=yP(t,"color.text",{fallback:!0}),o=yP(t,"color.background",{fallback:!0}),i=e.querySelector(n)||e,l=e.querySelector(o)||e,r=e.querySelector("a"),s=zR(i,"color"),a=r&&r.textContent?zR(r,"color"):void 0;let c=l,u=zR(c,"background-color");for(;"rgba(0, 0, 0, 0)"===u&&c.parentNode&&c.parentNode.nodeType===c.parentNode.ELEMENT_NODE;)c=c.parentNode,u=zR(c,"background-color");return{textColor:s,backgroundColor:u,linkColor:a}}function FR(e,t){return Object.keys(t).some((n=>e[n]!==t[n]))?t:e}function HR({clientId:e,name:t}){const n=up(e),[o,i]=(0,p.useReducer)(FR,{}),l=(0,h.useSelect)((e=>t?e(d.store).getBlockType(t):void 0),[t]);return(0,p.useLayoutEffect)((()=>{n&&l&&window.requestAnimationFrame((()=>window.requestAnimationFrame((()=>i(VR(n,l))))))})),(0,p.useLayoutEffect)((()=>{if(!n||!l)return;const e=new window.MutationObserver((()=>{i(VR(n,l))}));return e.observe(n,{attributes:!0,attributeFilter:["class","style"]}),()=>{e.disconnect()}}),[n,l]),(0,et.jsx)(RC,{backgroundColor:o.backgroundColor,textColor:o.textColor,linkColor:o.linkColor,enableAlphaChecker:!0})}const GR="color",$R=e=>{const t=(0,d.getBlockSupport)(e,GR);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},UR=e=>{if("web"!==p.Platform.OS)return!1;const t=(0,d.getBlockSupport)(e,GR);return null!==t&&"object"==typeof t&&!!t.link},WR=e=>{const t=(0,d.getBlockSupport)(e,GR);return null!==t&&"object"==typeof t&&!!t.gradients},KR=e=>{const t=(0,d.getBlockSupport)(e,GR);return t&&!1!==t.background},ZR=e=>{const t=(0,d.getBlockSupport)(e,GR);return t&&!1!==t.text};function qR(e,t,n){var o,i,l,r,s,a;if(!$R(t)||QN(t,GR))return e;const c=WR(t),{backgroundColor:d,textColor:p,gradient:h,style:g}=n,m=e=>!QN(t,GR,e),f=m("text")?Qe("color",p):void 0,v=m("gradients")?Ma(h):void 0,b=m("background")?Qe("background-color",d):void 0,k=m("background")||m("gradients"),_=d||(null==g||null===(o=g.color)||void 0===o?void 0:o.background)||c&&(h||(null==g||null===(i=g.color)||void 0===i?void 0:i.gradient)),y=u(e.className,f,v,{[b]:!(c&&null!=g&&null!==(l=g.color)&&void 0!==l&&l.gradient||!b),"has-text-color":m("text")&&(p||(null==g||null===(r=g.color)||void 0===r?void 0:r.text)),"has-background":k&&_,"has-link-color":m("link")&&(null==g||null===(s=g.elements)||void 0===s||null===(a=s.link)||void 0===a?void 0:a.color)});return e.className=y||void 0,e}function YR(e){var t,n,o;const i=null==e||null===(t=e.color)||void 0===t?void 0:t.text,l=null!=i&&i.startsWith("var:preset|color|")?i.substring(17):void 0,r=null==e||null===(n=e.color)||void 0===n?void 0:n.background,s=null!=r&&r.startsWith("var:preset|color|")?r.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:l?void 0:i,background:s?void 0:r,gradient:c?void 0:a},{style:qN(u),textColor:l,backgroundColor:s,gradient:c}}function QR(e){var t,n,o,i,l,r,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===(l=i.color)||void 0===l?void 0:l.background,gradient:e.gradient?"var:preset|gradient|"+e.gradient:null===(r=e.style)||void 0===r||null===(s=r.color)||void 0===s?void 0:s.gradient}}}function XR({children:e,resetAllFilter:t}){const n=(0,p.useCallback)((e=>{const n=QR(e),o=t(n);return{...e,...YR(o)}}),[t]);return(0,et.jsx)(z_,{group:"color",resetAllFilter:n,children:e})}function JR({clientId:e,name:t,setAttributes:n,settings:o,asWrapper:i,label:l,defaultControls:r}){var s,a,c;const u=DM(o),{style:g,textColor:m,backgroundColor:f,gradient:v}=(0,h.useSelect)((t=>{if(!u)return{};const{style:n,textColor:o,backgroundColor:i,gradient:l}=t(ba).getBlockAttributes(e)||{};return{style:n,textColor:o,backgroundColor:i,gradient:l}}),[e,u]),b=(0,p.useMemo)((()=>QR({style:g,textColor:m,backgroundColor:f,gradient:v})),[g,m,f,v]);if(!u)return null;r=r||(0,d.getBlockSupport)(t,[GR,"__experimentalDefaultControls"]);const k="web"===p.Platform.OS&&!(null!=b&&null!==(s=b.color)&&void 0!==s&&s.gradient)&&((null==o||null===(a=o.color)||void 0===a?void 0:a.text)||(null==o||null===(c=o.color)||void 0===c?void 0:c.link))&&!1!==(0,d.getBlockSupport)(t,[GR,"enableContrastChecker"]),_=i||XR;return(0,et.jsx)(QM,{as:_,panelId:e,settings:o,value:b,onChange:e=>{n(YR(e))},defaultControls:r,label:l,enableContrastChecker:!1!==(0,d.getBlockSupport)(t,[GR,"enableContrastChecker"]),children:k&&(0,et.jsx)(HR,{clientId:e,name:t})})}const eN={useBlockProps:function({name:e,backgroundColor:t,textColor:n,gradient:o,style:i}){var l,r;const[s,a,c]=wa("color.palette.custom","color.palette.theme","color.palette.default"),d=(0,p.useMemo)((()=>[...s||[],...a||[],...c||[]]),[s,a,c]);if(!$R(e)||QN(e,GR))return{};const h={};var g,m;n&&!QN(e,GR,"text")&&(h.color=null===(g=qe(d,n))||void 0===g?void 0:g.color),t&&!QN(e,GR,"background")&&(h.backgroundColor=null===(m=qe(d,t))||void 0===m?void 0:m.color);const f=qR({style:h},e,{textColor:n,backgroundColor:t,gradient:o,style:i}),v=t||(null==i||null===(l=i.color)||void 0===l?void 0:l.background)||o||(null==i||null===(r=i.color)||void 0===r?void 0:r.gradient);return{...f,className:u(f.className,!v&&oP(i))}},addSaveProps:qR,attributeKeys:["backgroundColor","textColor","gradient","style"],hasSupport:$R},tN={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};function nN({blockName:e,clientId:t,contentClientIds:n}){const o=tL(e),{updateBlockAttributes:i}=(0,h.useDispatch)(ba),{hasButtons:l,hasHeading:r}=(0,h.useSelect)((e=>{const t=e(ba).getBlockNamesByClientId(n);return{hasButtons:t.includes("core/buttons"),hasHeading:t.includes("core/heading")}}),[n]);return(0,et.jsx)(JR,{clientId:t,name:e,settings:o,setAttributes:e=>{i(t,e)},asWrapper:$M,label:(0,vt.__)("Color","kubio"),defaultControls:{text:!0,background:!0,button:l,heading:r}})}(0,m.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return $R(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),WR(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,m.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const i=e.name;return YN({linkColor:UR(i),textColor:ZR(i),backgroundColor:KR(i),gradient:WR(i)},tN,e,t,n,o)}));const oN=({blockName:e,clientId:t,hasBlockStyles:n,isSectionBlock:o,contentClientIds:i})=>{const l=xR({blockName:e});return(0,et.jsxs)(et.Fragment,{children:[n&&(0,et.jsx)(Lw,{clientId:t}),o&&(0,et.jsx)(nN,{blockName:e,clientId:t,contentClientIds:i}),!o&&(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(z_.Slot,{group:"color",label:(0,vt.__)("Color","kubio"),className:"color-block-support-panel__inner-wrapper"}),(0,et.jsx)(z_.Slot,{group:"background",label:(0,vt.__)("Background image","kubio")}),(0,et.jsx)(z_.Slot,{group:"filter"}),(0,et.jsx)(z_.Slot,{group:"typography",label:(0,vt.__)("Typography","kubio")}),(0,et.jsx)(z_.Slot,{group:"dimensions",label:(0,vt.__)("Dimensions","kubio")}),(0,et.jsx)(z_.Slot,{group:"border",label:l}),(0,et.jsx)(z_.Slot,{group:"styles"})]})]})},iN=({contentClientIds:e,onSwitchToListView:t,hasListViewTab:n})=>{var o;if(!e||0===e.length)return null;const i=null===(o=window)||void 0===o?void 0:o.__experimentalContentOnlyInspectorFields;return(0,et.jsx)(et.Fragment,{children:!i&&(0,et.jsx)(le.PanelBody,{title:(0,vt.__)("Content"),children:(0,et.jsx)(MR,{clientIds:e,onSwitchToListView:t,hasListViewTab:n})})})},lN=["core/navigation"],rN=e=>!lN.includes(e);var sN=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{fillRule:"evenodd",clipRule:"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"})}),aN=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.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"})});const cN={name:"settings",title:(0,vt.__)("Settings","kubio"),value:"settings",icon:sN,className:"block-editor-block-inspector__tab-item"},uN={name:"styles",title:(0,vt.__)("Styles","kubio"),value:"styles",icon:aN,className:"block-editor-block-inspector__tab-item"},dN={name:"content",title:(0,vt.__)("Content"),value:"content",icon:Ec},pN={name:"list",title:(0,vt.__)("List View","kubio"),value:"list-view",icon:ES,className:"block-editor-block-inspector__tab-item"};function hN({blockName:e,clientId:t,hasBlockStyles:n,tabs:o}){const i=rN(e)?void 0:pN.name,l=(0,p.useMemo)((()=>o.map((({icon:e,title:t,...n})=>({...n,title:(0,et.jsxs)(le.Flex,{direction:"column",justify:"center",align:"center",gap:0,children:[(0,et.jsx)(le.Icon,{icon:e}),(0,et.jsx)("span",{children:t})]})})))),[o]);return(0,et.jsx)(le.TabPanel,{className:"block-editor-block-inspector__tabs kubio-core-blocks-tabs",tabs:l,initialTabName:i,children:o=>o.name===cN.name?(0,et.jsx)(OR,{showAdvancedControls:!!e}):o.name===dN.name?(0,et.jsx)(iN,{contentClientIds}):o.name===uN.name?(0,et.jsx)(oN,{blockName:e,clientId:t,hasBlockStyles:n}):o.name===pN.name?(0,et.jsx)(z_.Slot,{group:"list"}):void 0},t)}const gN=[];function mN(e,t,n,o){var i,l,r,s,a,c,u,d,p;const g=[],{bindings:m,border:f,color:v,default:b,dimensions:k,list:_,position:y,styles:x,typography:S,effects:w}=j_,C=rN(e),B=(0,le.__experimentalUseSlotFills)((null==_?void 0:_.name)||_.Slot.__unstableName),I=!C&&!!B&&B.length,j=[...(0,le.__experimentalUseSlotFills)((null==f?void 0:f.name)||(null==f||null===(i=f.Slot)||void 0===i?void 0:i.__unstableName))||[],...(0,le.__experimentalUseSlotFills)((null==v?void 0:v.name)||(null==v||null===(l=v.Slot)||void 0===l?void 0:l.__unstableName))||[],...(0,le.__experimentalUseSlotFills)((null==k?void 0:k.name)||(null==k||null===(r=k.Slot)||void 0===r?void 0:r.__unstableName))||[],...(0,le.__experimentalUseSlotFills)((null==x?void 0:x.name)||(null==x||null===(s=x.Slot)||void 0===s?void 0:s.__unstableName))||[],...(0,le.__experimentalUseSlotFills)((null==S?void 0:S.name)||(null==S||null===(a=S.Slot)||void 0===a?void 0:a.__unstableName))||[],...(0,le.__experimentalUseSlotFills)((null==w?void 0:w.name)||(null==w||null===(c=w.Slot)||void 0===c?void 0:c.__unstableName))||[]].length,E=[...(0,le.__experimentalUseSlotFills)(O_.slotName)||[],...(0,le.__experimentalUseSlotFills)((null==m||null===(u=m.Slot)||void 0===u?void 0:u.__unstableName)||(null==m?void 0:m.name))||[]],T=[...(0,le.__experimentalUseSlotFills)(b.name||(null==b||null===(d=b.Slot)||void 0===d?void 0:d.__unstableName))||[],...(0,le.__experimentalUseSlotFills)((null==b?void 0:b.name)||(null==y||null===(p=y.Slot)||void 0===p?void 0:p.__unstableName))||[],...I&&j>1?E:[],...(0,le.__experimentalUseSlotFills)()||[]],P=!!(t&&t.length>0);I&&!n&&g.push(pN),P&&g.push(dN),T.length&&!n&&g.push(cN),(n?o:j)&&g.push(uN);const M=function(e,t={}){return void 0!==t[e]?t[e]:void 0===t.default||t.default}(e,(0,h.useSelect)((e=>e(ba).getSettings().blockInspectorTabs),[]));return M?g:gN}function fN(){const e=(0,h.useSelect)((e=>e(ba).getSelectedBlockCount()),[]);return(0,et.jsxs)(le.__experimentalHStack,{justify:"flex-start",spacing:2,className:"block-editor-multi-selection-inspector__card",children:[(0,et.jsx)(Sc,{icon:_y,showColors:!0}),(0,et.jsx)("div",{className:"block-editor-multi-selection-inspector__card-title",children:(0,vt.sprintf)(/* translators: %d: number of blocks */ /* translators: %d: number of blocks */(0,vt._n)("%d Block","%d Blocks",e),e)})]})}function vN(){const e=(0,h.useSelect)((e=>e(ba).getBlockSelectionStart()),[]),t=(0,p.useRef)();return cp(e,t),e?(0,et.jsx)(le.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,vt.__)("Skip to the selected block")}):null}function bN({clientId:e}){return(0,et.jsx)(le.PanelBody,{title:(0,vt.__)("Styles","kubio"),children:(0,et.jsx)(Lw,{clientId:e})})}function kN({topLevelLockedBlock:e}){const t=(0,h.useSelect)((t=>{const{getClientIdsOfDescendants:n,getBlockName:o,getBlockEditingMode:i}=t(ba);return n(e).filter((e=>"core/list-item"!==o(e)&&"contentOnly"===i(e)))}),[e]),n=(0,h.useSelect)((t=>{var n;const{getBlockName:o}=t(ba),{getBlockStyles:i}=t(d.store);return!(null===(n=i(o(e)))||void 0===n||!n.length)}),[e]),o=F_(e);return(0,et.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,et.jsx)(pw,{...o,className:o.isSynced&&"is-synced"}),(0,et.jsx)(PR.Slot,{}),n&&(0,et.jsx)(bN,{clientId:e}),t.length>0&&(0,et.jsx)(le.PanelBody,{title:(0,vt.__)("Content","kubio"),children:(0,et.jsx)(MR,{clientIds:t})})]})}const _N=({animate:e,wrapper:t,children:n})=>e?t(n):n,yN=({blockInspectorAnimationSettings:e,selectedBlockClientId:t,children:n})=>{const o=e&&"leftToRight"===e.enterDirection?-50:50;return(0,et.jsx)(le.__unstableMotion.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:o,opacity:0},children:n},t)},xN=({clientId:e,blockName:t})=>{const n=mN(t),{hasBlockStyles:o,hasKubioSupport:i}=(0,h.useSelect)((e=>{const{getBlockStyles:n}=e(d.store),o=n(t);return{hasBlockStyles:o&&o.length>0,hasKubioSupport:(0,d.hasBlockSupport)(t,"kubio")}}),[t]),l=!i&&(null==n?void 0:n.length)>1,r=(F_(e),xR({blockName:t}));return(0,et.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,et.jsx)(nC,{blockClientId:e}),(0,et.jsx)(PR.Slot,{}),l&&(0,et.jsx)(hN,{hasBlockStyles:o,clientId:e,blockName:t,tabs:n}),!l&&(0,et.jsxs)(et.Fragment,{children:[o&&(0,et.jsxs)("div",{children:[(0,et.jsx)(bN,{clientId:e}),(0,d.hasBlockSupport)(t,"defaultStylePicker",!0)&&(0,et.jsx)(NR,{blockName:t})]}),(0,et.jsx)(z_.Slot,{}),(0,et.jsx)(z_.Slot,{group:"list"}),(0,et.jsx)(z_.Slot,{group:"color",label:(0,vt.__)("Color","kubio"),className:"color-block-support-panel__inner-wrapper"}),(0,et.jsx)(z_.Slot,{group:"typography",label:(0,vt.__)("Typography","kubio")}),(0,et.jsx)(z_.Slot,{group:"dimensions",label:(0,vt.__)("Dimensions","kubio")}),(0,et.jsx)(z_.Slot,{group:"border",label:r}),(0,et.jsx)(z_.Slot,{group:"styles"}),(0,et.jsx)(DR,{}),(0,et.jsx)(z_.Slot,{group:"bindings"}),!t.startsWith("kubio/")&&"core/post-content"!==t&&(0,et.jsx)("div",{children:(0,et.jsx)(LR,{})})]}),(0,et.jsx)(vN,{},"back")]})},SN=({showNoBlockSelectedMessage:e=!0})=>{const{count:t,selectedBlockName:n,selectedBlockClientId:o,blockType:i,topLevelLockedBlock:l}=(0,h.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o,__unstableGetContentLockingParent:i,getContentLockingParent:l,getTemplateLock:r}=fe(e(ba)),s=t(),a=s&&o(s),c=a&&(0,d.getBlockType)(a),u=l||i;return{count:n(),selectedBlockClientId:s,selectedBlockName:a,blockType:c,topLevelLockedBlock:u(s)||("contentOnly"===r(s)||"core/block"===a?s:void 0)}}),[]),r=mN(null==i?void 0:i.name),s=(null==r?void 0:r.length)>1,a=function(e,t){return(0,h.useSelect)((t=>{if(e){const n=t(ba).getSettings().blockInspectorAnimation,o=null==n?void 0:n.animationParent,{getSelectedBlockClientId:i,getBlockParentsByBlockName:l}=t(ba);return l(i(),o,!0)[0]||e.name===o?null==n?void 0:n[e.name]:null}return null}),[t,e])}(i,o),c=xR({blockName:n});if(t>1)return(0,et.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,et.jsx)(fN,{}),s?(0,et.jsx)(hN,{tabs:r}):(0,et.jsxs)("div",{className:"block-editor-block-inspector__tabs kubio-core-blocks-tabs",children:[(0,et.jsx)(z_.Slot,{}),(0,et.jsx)(z_.Slot,{__experimentalGroup:"color",group:"color",label:(0,vt.__)("Color","kubio"),className:"color-block-support-panel__inner-wrapper"}),(0,et.jsx)(z_.Slot,{group:"background",label:(0,vt.__)("Background image","kubio")}),(0,et.jsx)(z_.Slot,{__experimentalGroup:"typography",group:"typography",label:(0,vt.__)("Typography","kubio")}),(0,et.jsx)(z_.Slot,{__experimentalGroup:"dimensions",group:"dimensions",label:(0,vt.__)("Dimensions","kubio")}),(0,et.jsx)(z_.Slot,{group:"border",__experimentalGroup:"border",label:c}),(0,et.jsx)(z_.Slot,{group:"styles"})]})]});const u=n===(0,d.getUnregisteredTypeHandlerName)();return i&&o&&!u?l?(0,et.jsx)(kN,{topLevelLockedBlock:l}):(0,et.jsx)(_N,{animate:a,wrapper:e=>(0,et.jsx)(yN,{blockInspectorAnimationSettings:a,selectedBlockClientId:o,children:e}),children:(0,et.jsx)(xN,{clientId:o,blockName:i.name})}):e?(0,et.jsx)("span",{className:"block-editor-block-inspector__no-blocks",children:(0,vt.__)("No block selected.","kubio")}):null},wN=()=>(Je()("__unstableUseClipboardHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),Qh());function CN(e){return Je()("CopyHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),(0,et.jsx)("div",{...e,ref:Qh()})}const BN=(0,p.forwardRef)((function({rootClientId:e,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:i=!1,__experimentalInsertionIndex:l,onSelect:r=ce.noop,shouldFocusBlock:s=!1,shouldSelectBlock:a=!0,ownerDocument:c}){const u=(0,h.useSelect)((n=>{const{getBlockRootClientId:o}=n(ba);return e||o(t)||void 0}),[t,e]);return(0,et.jsx)(Zg,{onSelect:r,rootClientId:u,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:i,__experimentalInsertionIndex:l,shouldFocusBlock:s,shouldSelectBlock:a,ownerDocument:c})})),IN=(0,p.forwardRef)((function(e,t){return(0,et.jsx)(BN,{...e,onPatternCategorySelection:void 0,ref:t})}));function jN(){return Je()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const EN=-1!==window.navigator.userAgent.indexOf("Trident"),TN=new Set([Jd.UP,Jd.DOWN,Jd.LEFT,Jd.RIGHT]),PN=.75;function MN(){const e=(0,h.useSelect)((e=>e(ba).hasSelectedBlock()),[]);return(0,g.useRefEffect)((t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let i,l,r;function s(){i||(i=o.requestAnimationFrame((()=>{p(),i=null})))}function a(e){l&&o.cancelAnimationFrame(l),l=o.requestAnimationFrame((()=>{c(e),l=null}))}function c({keyCode:e}){if(!h())return;const i=(0,Ih.computeCaretRect)(o);if(!i)return;if(!r)return void(r=i);if(TN.has(e))return void(r=i);const l=i.top-r.top;if(0===l)return;const s=(0,Ih.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?r.top/o.innerHeight:(r.top-u)/(o.innerHeight-u);if(0===c&&d<PN&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(r=i);const p=a?o.innerHeight:s.clientHeight;r.top+r.height>u+p||r.top<u?r=i:a?o.scrollBy(0,l):s.scrollTop+=l}function u(){n.addEventListener("selectionchange",d)}function d(){n.removeEventListener("selectionchange",d),p()}function p(){h()&&(r=(0,Ih.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),()=>{try{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(l)}catch(e){console.error(e)}}}),[e])}const RN=EN?e=>e.children:function({children:e}){return(0,et.jsx)("div",{ref:MN(),className:"block-editor__typewriter",children:e})},NN=(0,p.createContext)({});function LN({children:e,uniqueId:t,blockName:n=""}){const o=(0,p.useContext)(NN),{name:i}=B();n=n||i;const l=(0,p.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,et.jsx)(NN.Provider,{value:l,children:e})}function AN(e,t=""){var n;const o=(0,p.useContext)(NN),{name:i}=B();return t=t||i,Boolean(null===(n=o[t])||void 0===n?void 0:n.has(e))}NN.displayName="RenderedRefsContext";const DN=e=>(Je()("wp.blockEditor.__experimentalRecursionProvider",{since:"6.5",alternative:"wp.blockEditor.RecursionProvider"}),(0,et.jsx)(LN,{...e})),ON=e=>(Je()("wp.blockEditor.__experimentalUseHasRecursion",{since:"6.5",alternative:"wp.blockEditor.useHasRecursion"}),AN(...e));function zN({title:e,help:t,actions:n=[],onClose:o}){return(0,et.jsxs)(le.__experimentalVStack,{className:"block-editor-inspector-popover-header",spacing:4,children:[(0,et.jsxs)(le.__experimentalHStack,{alignment:"center",children:[(0,et.jsx)(le.__experimentalHeading,{className:"block-editor-inspector-popover-header__heading",level:2,size:13,children:e}),(0,et.jsx)(le.__experimentalSpacer,{}),n.map((({label:e,icon:t,onClick:n})=>(0,et.jsx)(le.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,et.jsx)(le.Button,{__next40pxDefaultSize:!1,className:"block-editor-inspector-popover-header__action",label:(0,vt.__)("Close"),icon:Ep,onClick:o})]}),t&&(0,et.jsx)(le.__experimentalText,{children:t})]})}const VN=(0,p.forwardRef)((function({onClose:e,onChange:t,showPopoverHeaderActions:n,isCompact:o,currentDate:i,title:l,...r},s){const a={startOfWeek:(0,NC.getSettings)().l10n.startOfWeek,onChange:t,currentDate:o?void 0:i,currentTime:o?i:void 0,...r},c=o?le.TimePicker:le.DateTimePicker;return(0,et.jsxs)("div",{ref:s,className:"block-editor-publish-date-time-picker",children:[(0,et.jsx)(zN,{title:l||(0,vt.__)("Publish"),actions:n?[{label:(0,vt.__)("Now"),onClick:()=>null==t?void 0:t(null)}]:void 0,onClose:e}),(0,et.jsx)(c,{...a})]})})),FN=(0,p.forwardRef)((function(e,t){return(0,et.jsx)(VN,{...e,showPopoverHeaderActions:!0,isCompact:!1,ref:t})}));function HN(e){const t=B(),{clientId:n=""}=t,{setBlockEditingMode:o,unsetBlockEditingMode:i}=(0,h.useDispatch)(ba),l=(0,h.useSelect)((e=>n?null:e(ba).getBlockEditingMode()),[n]);return(0,p.useEffect)((()=>(e&&o(n,e),()=>{e&&i(n)})),[n,e,o,i]),n?t[k]:l}const{ComponentsContext:GN}=fe(le.privateApis),$N=GN?GN.Provider:p.Fragment,UN=({children:e})=>{const{uiVersion:t}=(0,bm.useUIVersion)(),n=(0,p.useMemo)((()=>({ToolsPanel:{_overrides:{dropdownMenuProps:1===t?Iw:Bw}}})),[t]);return(0,et.jsx)($N,{value:n,children:e})},WN=(0,et.jsx)(le.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:(0,et.jsx)(le.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"})}),KN=(0,p.forwardRef)((function(e,t){const n=(0,h.useSelect)((e=>e(ba).__unstableGetEditorMode()),[]),{__unstableSetEditorMode:o}=(0,h.useDispatch)(ba);return(0,et.jsx)(le.Dropdown,{renderToggle:({isOpen:o,onToggle:i})=>(0,et.jsx)(le.Button,{size:"compact",...e,ref:t,icon:"navigation"===n?iS:WN,"aria-expanded":o,"aria-haspopup":"true",onClick:i/* translators: button label text should, if possible, be under 16 characters. */,label:(0,vt.__)("Tools","kubio")}),popoverProps:{placement:"bottom-start"},renderContent:()=>(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(le.NavigableMenu,{className:"block-editor-tool-selector__menu",role:"menu","aria-label":(0,vt.__)("Tools","kubio"),children:(0,et.jsx)(le.MenuItemsChoice,{value:"navigation"===n?"navigation":"edit",onSelect:e=>{o(e)},choices:[{value:"navigation",label:(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(jc,{icon:iS}),(0,vt.__)("Write","kubio")]}),info:(0,vt.__)("Focus on content.","kubio"),"aria-label":(0,vt.__)("Write","kubio")},{value:"edit",label:(0,et.jsxs)(et.Fragment,{children:[WN,(0,vt.__)("Design","kubio")]}),info:(0,vt.__)("Edit layout and styles.","kubio"),"aria-label":(0,vt.__)("Design","kubio")}]})}),(0,et.jsx)("div",{className:"block-editor-tool-selector__help",children:(0,vt.__)("Tools provide different sets of interactions for blocks. Choose between simplified content tools (Write) and advanced visual editing tools (Design).","kubio")})]})})})),ZN=kj,qN=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.entries(e).map((([e,t])=>[e,qN(t)])).filter((([,e])=>void 0!==e));return t.length?Object.fromEntries(t):void 0};function YN(e,t,n,o,i,l){var r;if(Object.values(e??{}).every((e=>!e)))return n;if(1===l.length&&n.innerBlocks.length===o.length)return n;let s=null===(r=o[0])||void 0===r?void 0:r.attributes;if(l.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=xn(s,e);t&&(c={...c,attributes:yn(c.attributes,e,t)})}))})),c}function QN(e,t,n){const o=(0,d.getBlockSupport)(e,t),i=null==o?void 0:o.__experimentalSkipSerialization;return Array.isArray(i)?i.includes(n):i}const XN=new WeakMap;function JN({id:e,css:t}){return eL({id:e,css:t})}function eL({id:e,css:t,assets:n,__unstableType:o,variation:i,clientId:l}={}){const{setStyleOverride:r,deleteStyleOverride:s}=fe((0,h.useDispatch)(ba)),a=(0,h.useRegistry)(),c=(0,p.useId)();(0,p.useEffect)((()=>{if(!t&&!n)return;const u=e||c,d={id:e,css:t,assets:n,__unstableType:o,variation:i,clientId:l};return XN.get(a)||XN.set(a,[]),XN.get(a).push([u,d]),window.queueMicrotask((()=>{var e;null!==(e=XN.get(a))&&void 0!==e&&e.length&&a.batch((()=>{XN.get(a).forEach((e=>{r(...e)})),XN.set(a,[])}))})),()=>{var e;(null===(e=XN.get(a))||void 0===e?void 0:e.find((([e])=>e===u)))?XN.set(a,XN.get(a).filter((([e])=>e!==u))):s(u)}}),[e,t,l,n,o,c,r,s,a,i])}function tL(e,t){const[n,o,i,l,r,s,a,c,u,d,h,g,m,f,v,b,k,_,y,x,S,w,C,B,I,j,E,T,P,M,R,N,L,A,D,O,z,V,F,H,G,$,U,W,K,Z,q,Y,Q,X,J,ee,te,ne,oe,ie,le,re,se,ae,ce]=wa("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.textIndent","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.height","dimensions.minHeight","dimensions.width","dimensions.dimensionSizes","layout","border.color","border.radius","border.style","border.width","border.radiusSizes","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 jT((0,p.useMemo)((()=>({background:{backgroundImage:n,backgroundSize:o},color:{palette:{custom:$,theme:W,default:K},gradients:{custom:J,theme:ee,default:te},duotone:{custom:Y,theme:Q,default:X},defaultGradients:ne,defaultPalette:Z,defaultDuotone:q,custom:G,customGradient:oe,customDuotone:U,background:ie,link:le,heading:se,button:ae,text:re},typography:{fontFamilies:{custom:i,default:l,theme:r},fontSizes:{custom:a,default:c,theme:u},customFontSize:d,defaultFontSizes:s,fontStyle:h,fontWeight:g,lineHeight:m,textAlign:f,textColumns:v,textDecoration:b,textIndent:k,textTransform:y,letterSpacing:x,writingMode:_},spacing:{spacingSizes:{custom:j,default:E,theme:T},customSpacingSize:I,defaultSpacingSizes:B,padding:S,margin:w,blockGap:C,units:P},border:{color:O,radius:z,style:V,width:F,radiusSizes:H},dimensions:{aspectRatio:M,height:R,minHeight:N,width:L,dimensionSizes:A},layout:D,parentLayout:t,shadow:ce})),[n,o,i,l,r,s,a,c,u,d,h,g,m,f,v,b,k,y,x,_,S,w,C,B,I,j,E,T,P,M,R,N,L,A,D,t,O,z,V,F,H,G,$,U,W,K,Z,q,Y,Q,X,J,ee,te,ne,oe,ie,le,re,se,ae,ce]),e)}const nL=(0,p.memo)((function({index:e,useBlockProps:t,setAllWrapperProps:n,...o}){const i=t(o),l=t=>n((n=>{const o=[...n];return o[e]=t,o}));return(0,p.useEffect)((()=>(l(i),()=>{l(void 0)}))),null}));(0,m.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,d.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=3),e})),n(6654);const oL=["left","center","right","wide","full"],iL=["wide","full"];function lL(e,t=!0,n=!0){let o;return o=Array.isArray(e)?oL.filter((t=>e.includes(t))):!0===e?[...oL]:[],!n||!0===e&&!t?o.filter((e=>!iL.includes(e))):o}const rL={shareWithChildBlocks:!0,edit:function({name:e,align:t,setAttributes:n}){const o=Ld(lL((0,d.getBlockSupport)(e,"align"),(0,d.hasBlockSupport)(e,"alignWide",!0))).map((({name:e})=>e)),i=HN();return o.length&&"default"===i?(0,et.jsx)(Qy,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,et.jsx)(Hd,{value:t,onChange:t=>{if(!t){var o,i;const n=(0,d.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 Ld(lL((0,d.getBlockSupport)(e,"align"),(0,d.hasBlockSupport)(e,"alignWide",!0))).some((e=>e.name===t))?{"data-align":t}:{}},addSaveProps:function(e,t,n){const{align:o}=n;return lL((0,d.getBlockSupport)(t,"align"),(0,d.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=u(`align${o}`,e.className)),e},attributeKeys:["align"],hasSupport:e=>(0,d.hasBlockSupport)(e,"align",!1)};(0,m.addFilter)("blocks.registerBlockType","core/editor/align/addAttribute",(function(e){var t;return"type"in((null===(t=e.attributes)||void 0===t?void 0:t.align)??{})||(0,d.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...oL,""]}}),e})),(0,m.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){var t;return"type"in((null===(t=e.attributes)||void 0===t?void 0:t.lock)??{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const sL=function({blockTypes:e,value:t,onItemChange:n}){return(0,et.jsx)("ul",{className:"block-editor-block-manager__checklist",children:e.map((e=>(0,et.jsxs)("li",{className:"block-editor-block-manager__checklist-item",children:[(0,et.jsx)(le.CheckboxControl,{label:e.title,checked:t.includes(e.name),onChange:(...t)=>n(e,...t)}),(0,et.jsx)(Sc,{icon:e.icon})]},e.name)))})},aL=function e({title:t,blockTypes:n,selectedBlockTypes:o,onChange:i}){const l=(0,g.useInstanceId)(e),r=(0,p.useCallback)(((e,t)=>{i(t?[...o,e]:o.filter((({name:t})=>t!==e.name)))}),[o,i]),s=(0,p.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=>(o??[]).some((t=>t.name===e)))),c="block-editor-block-manager__category-title-"+l,u=a.length===n.length,d=!u&&a.length>0;return(0,et.jsxs)("div",{role:"group","aria-labelledby":c,className:"block-editor-block-manager__category",children:[(0,et.jsx)(le.CheckboxControl,{checked:u,onChange:s,className:"block-editor-block-manager__category-title",indeterminate:d,label:(0,et.jsx)("span",{id:c,children:t})}),(0,et.jsx)(sL,{blockTypes:n,value:a,onItemChange:r})]})};function cL({blockTypes:e,selectedBlockTypes:t,onChange:n,showSelectAll:o=!0}){const i=(0,g.useDebounce)(gr.speak,500),[l,r]=(0,p.useState)(""),{categories:s,isMatchingSearchTerm:a}=(0,h.useSelect)((e=>({categories:e(d.store).getCategories(),isMatchingSearchTerm:e(d.store).isMatchingSearchTerm})),[]),c=e.filter((e=>!l||a(e,l))),u=t.length>0&&t.length!==e.length,m=e.length>0&&t.length===e.length;return(0,p.useEffect)((()=>{if(!l)return;const e=c.length,t=(0,vt.sprintf)(/* translators: %d: number of results. */ /* translators: %d: number of results. */(0,vt._n)("%d result found.","%d results found.",e),e);i(t)}),[null==c?void 0:c.length,l,i]),(0,et.jsxs)(le.__experimentalVStack,{className:"block-editor-block-manager__content",spacing:4,children:[(0,et.jsx)(le.SearchControl,{label:(0,vt.__)("Search for a block"),placeholder:(0,vt.__)("Search for a block"),value:l,onChange:e=>r(e),className:"block-editor-block-manager__search"}),o&&(0,et.jsx)(le.CheckboxControl,{className:"block-editor-block-manager__select-all",label:(0,vt.__)("Select all"),checked:m,onChange:()=>{n(m?[]:e)},indeterminate:u}),(0,et.jsxs)("div",{tabIndex:"0",role:"region","aria-label":(0,vt.__)("Available block types"),className:"block-editor-block-manager__results",children:[0===c.length&&(0,et.jsx)("p",{className:"block-editor-block-manager__no-results",children:(0,vt.__)("No blocks found.")}),s.map((e=>(0,et.jsx)(aL,{title:e.title,blockTypes:c.filter((t=>t.category===e.slug)),selectedBlockTypes:t,onChange:n},e.slug))),(0,et.jsx)(aL,{title:(0,vt.__)("Uncategorized"),blockTypes:c.filter((({category:e})=>!e)),selectedBlockTypes:t,onChange:n})]})]})}function uL({clientId:e,blockTypes:t,selectedBlockTypes:n,onClose:o}){const[i,l]=(0,p.useState)(n),{updateBlockAttributes:r}=(0,h.useDispatch)(ba);return(0,et.jsx)(le.Modal,{title:(0,vt.__)("Manage allowed blocks"),onRequestClose:o,overlayClassName:"block-editor-block-allowed-blocks-modal",focusOnMount:"firstContentElement",size:"medium",children:(0,et.jsxs)(le.__experimentalVStack,{as:"form",onSubmit:n=>{n.preventDefault(),(()=>{const n=i.length===t.length,l=i.map((({name:e})=>e));r(e,{allowedBlocks:n?void 0:l}),o()})()},spacing:"4",children:[(0,et.jsx)(le.__experimentalText,{children:(0,vt.__)("Select which blocks can be added inside this container.")}),(0,et.jsx)(cL,{blockTypes:t,selectedBlockTypes:i,onChange:e=>{l(e)}}),(0,et.jsxs)(le.Flex,{className:"block-editor-block-allowed-blocks-modal__actions",justify:"flex-end",expanded:!1,children:[(0,et.jsx)(le.FlexItem,{children:(0,et.jsx)(le.Button,{variant:"tertiary",onClick:o,__next40pxDefaultSize:!0,children:(0,vt.__)("Cancel")})}),(0,et.jsx)(le.FlexItem,{children:(0,et.jsx)(le.Button,{variant:"primary",type:"submit",__next40pxDefaultSize:!0,children:(0,vt.__)("Apply")})})]})]})})}function dL({clientId:e}){const[t,n]=(0,p.useState)(!1),{blockTypes:o,selectedBlockNames:i}=(0,h.useSelect)((t=>{var n;const{getBlockAttributes:o}=t(ba);return{blockTypes:t(d.store).getBlockTypes(),selectedBlockNames:null===(n=o(e))||void 0===n?void 0:n.allowedBlocks}}),[e]),l=o.filter((e=>(0,d.hasBlockSupport)(e,"inserter",!0)&&(!e.parent||e.parent.includes("core/post-content"))));if(!l)return null;const r=void 0===i?l:l.filter((e=>i.includes(e.name)));return(0,et.jsxs)("div",{className:"block-editor-block-allowed-blocks-control",children:[(0,et.jsxs)(le.BaseControl,{help:(0,vt.__)("Specify which blocks are allowed inside this container."),children:[(0,et.jsx)(le.BaseControl.VisualLabel,{children:(0,vt.__)("Allowed Blocks")}),(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{n(!0)},className:"block-editor-block-allowed-blocks-control__button",children:(0,vt.__)("Manage allowed blocks")})]}),t&&(0,et.jsx)(uL,{clientId:e,blockTypes:l,selectedBlockTypes:r,onClose:()=>n(!1)})]})}const pL={edit:function({clientId:e}){return"contentOnly"===HN()?null:(0,et.jsx)(E_.Fill,{children:(0,et.jsx)(dL,{clientId:e})})},attributeKeys:["allowedBlocks"],hasSupport:e=>(0,d.hasBlockSupport)(e,"allowedBlocks")};(0,m.addFilter)("blocks.registerBlockType","core/allowedBlocks/attribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.allowedBlocks)&&void 0!==n&&n.type||(0,d.hasBlockSupport)(e,"allowedBlocks")&&(e.attributes={...e.attributes,allowedBlocks:{type:"array"}}),e})),(0,m.addFilter)("blocks.switchToBlockType.transformedBlock","core/allowedBlocks/addTransforms",(function(e,t,n,o){var i,l;if(!(0,d.hasBlockSupport)(e.name,"allowedBlocks"))return e;if(1!==t.length&&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(o.length>1&&t.length>1&&o.length!==t.length)return e;if(e.attributes.allowedBlocks)return e;const r=null===(i=t[n])||void 0===i||null===(l=i.attributes)||void 0===l?void 0:l.allowedBlocks;if(!r)return e;const s=(0,d.getBlockType)(e.name),a=(null==s?void 0:s.allowedBlocks)||[];if(!a.length)return{...e,attributes:{...e.attributes,allowedBlocks:r}};const c=r.filter((e=>a.includes(e)));return{...e,attributes:{...e.attributes,allowedBlocks:c}}}));const hL=/[\s#]/g,gL={type:"string",source:"attribute",attribute:"id",selector:"*"},mL={addSaveProps:function(e,t,n){return(0,d.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e},edit:function({anchor:e,setAttributes:t}){if("default"!==HN())return null;const n="web"===p.Platform.OS;return(0,et.jsx)(z_,{group:"advanced",children:(0,et.jsx)(le.TextControl,{__next40pxDefaultSize:!0,className:"html-anchor-control",label:(0,vt.__)("HTML anchor","kubio"),help:(0,et.jsxs)(et.Fragment,{children:[(0,vt.__)("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,et.jsxs)(et.Fragment,{children:[" ",(0,et.jsx)(le.ExternalLink,{href:(0,vt.__)("https://wordpress.org/documentation/article/page-jumps/","kubio"),children:(0,vt.__)("Learn more about anchors","kubio")})]})]}),value:e||"",placeholder:n?null:(0,vt.__)("Add an anchor","kubio"),onChange:e=>{e=e.replace(hL,"-"),t({anchor:""!==e?e:void 0})},autoCapitalize:"none",autoComplete:"off"})})},attributeKeys:["anchor"],hasSupport:e=>(0,d.hasBlockSupport)(e,"anchor")};(0,m.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){var t;return"type"in((null===(t=e.attributes)||void 0===t?void 0:t.anchor)??{})||(0,d.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:gL}),e}));const fL={addSaveProps:function(e,t,n){return(0,d.hasBlockSupport)(t,"ariaLabel")&&!QN(t,"ariaLabel","ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e},attributeKeys:["ariaLabel"],hasSupport:e=>(0,d.hasBlockSupport)(e,"ariaLabel")};function vL({isControl:e}={isControl:!1}){return(0,g.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:e?35:259}}}function bL({fields:e,visibleFields:t,onToggleField:n}){const{popoverProps:o}=vL();return e&&0!==e.length?(0,et.jsx)(le.DropdownMenu,{icon:_a,label:(0,vt.__)("Options"),popoverProps:o,toggleProps:{size:"small"},children:({onClose:o})=>(0,et.jsx)(le.MenuGroup,{label:(0,vt.__)("Show / Hide"),children:e.map((e=>{const i=t.includes(e.id);return(0,et.jsx)(le.MenuItem,{isSelected:i,onClick:()=>{n(e.id),o()},role:"menuitemcheckbox",icon:i?jy:null,children:e.label},e.id)}))})}):null}let kL;if((0,m.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,d.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:{type:"string"}}),e})),un.privateApis){const e=fe(un.privateApis);kL=e.useRichText}else kL=un.__unstableUseRichText;function _L({data:e,field:t,hideLabelFromVision:n,onChange:o,config:i={}}){const l=(0,h.useRegistry)(),r=t.getValue({item:e}),s=t.config||{},{clientId:a}=i,[c,u]=(0,p.useState)({start:void 0,end:void 0}),[d,m]=(0,p.useState)(!1),f=(0,p.useRef)(),v=(0,p.useRef)(new Set),b=(0,p.useRef)(new Set),k=fE({allowedFormats:null==s?void 0:s.allowedFormats,disableFormats:null==s?void 0:s.disableFormats}),{value:_,getValue:y,onChange:x,ref:S,formatTypes:w}=kL({value:r,onChange(n){o(t.setValue({item:e,value:n}))},selectionStart:c.start,selectionEnd:c.end,onSelectionChange:(e,t)=>u({start:e,end:t}),__unstableIsSelected:d,preserveWhiteSpace:!(null==s||!s.preserveWhiteSpace),placeholder:null==s?void 0:s.placeholder,__unstableDisableFormats:null==s?void 0:s.disableFormats,allowedFormats:k,withoutInteractiveFormatting:null==s?void 0:s.withoutInteractiveFormatting,__unstableFormatTypeHandlerContext:(0,p.useMemo)((()=>({richTextIdentifier:t.id,blockClientId:a})),[t.id,a])}),{baseControlProps:C,controlProps:B}=(0,le.useBaseControlProps)({hideLabelFromVision:n??t.hideLabelFromVision,label:t.label});return(0,et.jsxs)(et.Fragment,{children:[d&&(0,et.jsx)(VE.Provider,{value:b,children:(0,et.jsx)(FE.Provider,{value:v,children:(0,et.jsx)("div",{children:(0,et.jsx)(BE,{value:_,onChange:x,onFocus:function(){var e;null===(e=f.current)||void 0===e||e.focus()},formatTypes:w,forwardedRef:f,isVisible:!1})})})}),(0,et.jsx)(le.BaseControl,{...C,children:(0,et.jsx)("div",{className:"block-editor-content-only-controls__rich-text",role:"textbox","aria-multiline":!(null!=s&&s.disableLineBreaks),ref:(0,g.useMergeRefs)([S,xE({registry:l,getValue:y,onChange:x,formatTypes:w,selectionChange:u,isSelected:d,disableFormats:null==s?void 0:s.disableFormats,value:_,tagName:"div",disableLineBreaks:null==s?void 0:s.disableLineBreaks,keyboardShortcuts:b,inputEvents:v}),f]),onFocus:()=>m(!0),onBlur:()=>m(!1),contentEditable:!0,...B})})]})}var yL=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"})}),xL=(0,et.jsx)(an.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,et.jsx)(an.Path,{d:"M17.7 4.3c-1.2 0-2.8 0-3.8 1-.6.6-.9 1.5-.9 2.6V14c-.6-.6-1.5-1-2.5-1C8.6 13 7 14.6 7 16.5S8.6 20 10.5 20c1.5 0 2.8-1 3.3-2.3.5-.8.7-1.8.7-2.5V7.9c0-.7.2-1.2.5-1.6.6-.6 1.8-.6 2.8-.6h.3V4.3h-.4z"})});function SL({data:e,field:t,attachment:n,config:o}){const{allowedTypes:i=[],multiple:l=!1}=o||{};if(l)return"todo multiple";if("image"===(null==n?void 0:n.media_type)||null!=n&&n.poster)return(0,et.jsx)("div",{className:"block-editor-content-only-controls__media-thumbnail",children:(0,et.jsx)("img",{alt:"",width:24,height:24,src:"image"===n.media_type?n.source_url:n.poster})});if(1===i.length){const n=t.getValue({item:e}),o=null==n?void 0:n.url;if("image"===i[0]&&o)return(0,et.jsx)("div",{className:"block-editor-content-only-controls__media-thumbnail",children:(0,et.jsx)("img",{alt:"",width:24,height:24,src:o})});let l;if(l="image"===i[0]?nT:"video"===i[0]?yL:"audio"===i[0]?xL:yj,l)return(0,et.jsx)(le.Icon,{icon:l,size:24})}return(0,et.jsx)(le.Icon,{icon:yj,size:24})}function wL({data:e,field:t,onChange:n,config:o={}}){const{popoverProps:i}=vL({isControl:!0}),l=t.getValue({item:e}),{allowedTypes:r=[],multiple:s=!1,useFeaturedImage:a=!1}=o,c=null==l?void 0:l.id,u=null==l?void 0:l.url,d=(0,h.useSelect)((e=>{if(!c)return;const t=e(ba).getSettings()[Pt];return t?t(e,c):void 0}),[c]);let p;if(1===r.length){const e=r[0];p="image"===e?(0,vt.__)("Choose an image…"):"video"===e?(0,vt.__)("Choose a video…"):"application"===e?(0,vt.__)("Choose a file…"):(0,vt.__)("Choose a media item…")}else p=(0,vt.__)("Choose a media item…");return(0,et.jsx)(Cj,{children:(0,et.jsx)(Ej,{className:"block-editor-content-only-controls__media-replace-flow",allowedTypes:r,mediaId:c,mediaURL:u,multiple:s,popoverProps:i,onReset:()=>{n(t.setValue({item:e,value:{}}))},...a&&{useFeaturedImage:!(null==l||!l.featuredImage),onToggleFeaturedImage:()=>{n(t.setValue({item:e,value:{featuredImage:!(null!=l&&l.featuredImage)}}))}},onSelect:o=>{if(o.id&&o.url){const i={...o,mediaType:o.media_type};a&&(i.featuredImage=!1),n(t.setValue({item:e,value:i}))}},renderToggle:n=>{var i,l,r;return(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,className:"block-editor-content-only-controls__media",...n,children:(0,et.jsxs)(le.__experimentalGrid,{rowGap:0,columnGap:8,templateColumns:"24px 1fr",className:"block-editor-content-only-controls__media-row",children:[u&&(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(SL,{attachment:d,field:t,data:e,config:o}),(0,et.jsx)("span",{className:"block-editor-content-only-controls__media-title",children:null!=d&&null!==(i=d.title)&&void 0!==i&&i.raw&&""!==(null==d||null===(l=d.title)||void 0===l?void 0:l.raw)?null==d||null===(r=d.title)||void 0===r?void 0:r.raw:u})]}),!u&&(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)("span",{className:"block-editor-content-only-controls__media-placeholder",style:{width:"24px",height:"24px"}}),(0,et.jsx)("span",{className:"block-editor-content-only-controls__media-title",children:p})]})]})})}})})}const CL="noreferrer noopener",BL="_blank",IL="nofollow";function jL({data:e,field:t,onChange:n}){const[o,i]=(0,p.useState)(!1),{popoverProps:l}=vL({isControl:!0}),r=t.getValue({item:e}),s=null==r?void 0:r.url,a=(null==r?void 0:r.rel)||"",c=(null==r?void 0:r.linkTarget)===BL,u=a===IL,d=(0,p.useMemo)((()=>({url:s,opensInNewTab:c,nofollow:u})),[s,c,u]);return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(le.Button,{__next40pxDefaultSize:!0,className:"block-editor-content-only-controls__link",onClick:()=>{i(!0)},children:(0,et.jsxs)(le.__experimentalGrid,{rowGap:0,columnGap:8,templateColumns:"24px 1fr",className:"block-editor-content-only-controls__link-row",children:[s&&(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(le.Icon,{icon:vC,size:24}),(0,et.jsx)("span",{className:"block-editor-content-only-controls__link-title",children:s})]}),!s&&(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(le.Icon,{icon:vC,size:24,style:{opacity:.3}}),(0,et.jsx)("span",{className:"block-editor-content-only-controls__link-title",children:(0,vt.__)("Link")})]})]})}),o&&(0,et.jsx)(le.Popover,{onClose:()=>{i(!1)},...l??{},children:(0,et.jsx)(kj,{value:d,onChange:o=>{const i=function({rel:e="",url:t="",opensInNewTab:n,nofollow:o}){let i,l=e;if(n){var r;i=BL,l=null!==(r=l)&&void 0!==r&&r.includes(CL)?l:l+` ${CL}`}else{var s;const e=new RegExp(`\\b${CL}\\s*`,"g");l=null===(s=l)||void 0===s?void 0:s.replace(e,"").trim()}if(o){var a;l=null!==(a=l)&&void 0!==a&&a.includes(IL)?l:(l+` ${IL}`).trim()}else{var c;const e=new RegExp(`\\b${IL}\\s*`,"g");l=null===(c=l)||void 0===c?void 0:c.replace(e,"").trim()}return{url:(0,it.prependHTTP)(t),linkTarget:i,rel:l||void 0}}({rel:a,...o});n(t.setValue({item:e,value:i}))},onRemove:()=>{n(t.setValue({item:e,value:{}}))}})})]})}const{fieldsKey:EL,formKey:TL}=fe(d.privateApis),PL=p.Fragment;function ML(e,t={}){return function(n){return(0,et.jsx)(e,{...n,config:t})}}function RL({clientId:e,blockType:t,setAttributes:n,isCollapsed:o=!1}){const i=ip({clientId:e,context:"list-view"}),l=F_(e),r=null==t?void 0:t[EL],s=(0,p.useContext)(ot),a=(0,h.useSelect)((t=>{var n;const o=t(ba).getBlockAttributes(e);if(null==o||null===(n=o.metadata)||void 0===n||!n.bindings)return o;const{getBlockBindingsSource:i}=fe(t(d.store));return Object.entries(o.metadata.bindings).reduce(((e,[n,o])=>{const l=i(o.source);if(!l)return e;const r=l.getValues({select:t,context:s,bindings:{[n]:o}});return{...e,...r}}),o)}),[s,e]),c=(0,p.useMemo)((()=>{var e,n;return o?{...null==t?void 0:t[TL],fields:[null==t||null===(e=t[TL])||void 0===e||null===(n=e.fields)||void 0===n?void 0:n[0]]}:null==t?void 0:t[TL]}),[t,o]),[u,g]=(0,p.useState)(c),m=(0,p.useMemo)((()=>null!=r&&r.length?r.map((t=>{const n={...t};return"string"==typeof t.Edit&&"rich-text"===t.Edit?n.Edit=ML(_L,{clientId:e}):"string"==typeof t.Edit&&"link"===t.Edit?n.Edit=ML(jL):"object"==typeof t.Edit&&"media"===t.Edit.control&&(n.Edit=ML(wL,{...t.Edit})),n})):[]),[r,e]);return null!=r&&r.length?(0,et.jsxs)("div",{className:"block-editor-block-fields__container",children:[(0,et.jsx)("div",{className:"block-editor-block-fields__header",children:(0,et.jsxs)(le.__experimentalHStack,{spacing:1,children:[o&&(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(Sc,{className:"block-editor-block-fields__header-icon",icon:null==l?void 0:l.icon}),(0,et.jsx)("h2",{className:"block-editor-block-fields__header-title",children:(0,et.jsx)(le.__experimentalTruncate,{numberOfLines:1,children:i})}),(0,et.jsx)(bL,{fields:m,visibleFields:u.fields,onToggleField:e=>{g((t=>{var n;return null!==(n=t.fields)&&void 0!==n&&n.includes(e)?{...t,fields:t.fields.filter((t=>t!==e))}:{...t,fields:[...t.fields||[],e]}}))}})]}),!o&&(0,et.jsx)("h2",{className:"block-editor-block-fields__header-title",children:(0,vt.__)("Content","kubio")})]})}),(0,et.jsx)(PL,{data:a,fields:m,form:u,onChange:n})]}):null}const NL={edit:function(e){const{blockType:t,isSelectionWithinCurrentSection:n}=(0,p.useContext)(ht);return(0,et.jsx)(T_,{group:"content",children:(0,et.jsx)(RL,{...e,blockType:t,isCollapsed:n})})},hasSupport:function(e){var t,n;return!(null===(t=window)||void 0===t||!t.__experimentalContentOnlyInspectorFields||null===(n=(0,d.getBlockType)(e))||void 0===n||!n[EL])},attributeKeys:[],supportsPatternEditing:!0},LL={edit:function({className:e,setAttributes:t}){return"default"!==HN()?null:(0,et.jsx)(z_,{group:"advanced",children:(0,et.jsx)(le.TextControl,{__next40pxDefaultSize:!0,autoComplete:"off",label:(0,vt.__)("Additional CSS class(es)"),value:e||"",onChange:e=>{t({className:""!==e?e:void 0})},help:(0,vt.__)("Separate multiple classes with spaces.")})})},addSaveProps:function(e,t,n){return(0,d.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=u(e.className,n.className)),e},attributeKeys:["className"],hasSupport:e=>(0,d.hasBlockSupport)(e,"customClassName",!0)};function AL(e,t,n,o){if(!(0,d.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,m.addFilter)("blocks.registerBlockType","core/editor/custom-class-name/attribute",(function(e){return(0,d.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,m.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",AL),(0,m.addFilter)("blocks.switchToBlockType.transformedBlock","core/customClassName/addTransforms",AL),(0,m.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,d.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([(0,d.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,d.getBlockDefaultClassName)(t.name)),e}));const DL="typography.__experimentalFontFamily";function OL(e,t,n){if(!(0,d.hasBlockSupport)(t,DL))return e;if(QN(t,eA,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(Ty())(e.className);o.add(`has-${Ze(null==n?void 0:n.fontFamily)}-font-family`);const i=o.value;return e.className=i||void 0,e}const zL={useBlockProps:function({name:e,fontFamily:t}){return OL({},e,{fontFamily:t})},addSaveProps:OL,attributeKeys:["fontFamily"],hasSupport:e=>(0,d.hasBlockSupport)(e,DL)};(0,m.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,d.hasBlockSupport)(e,DL)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e}));const VL="typography.fontSize";function FL(e,t,n){if(!(0,d.hasBlockSupport)(t,VL))return e;if(QN(t,eA,"fontSize"))return e;const o=new(Ty())(e.className);o.add(za(n.fontSize));const i=o.value;return e.className=i||void 0,e}const HL={useBlockProps:function({name:e,fontSize:t,style:n}){var o,i;const[l,r,s]=wa("typography.fontSizes","typography.fluid","layout");if(!(0,d.hasBlockSupport)(e,VL)||QN(e,eA,"fontSize")||!t&&(null==n||null===(o=n.typography)||void 0===o||!o.fontSize))return;let a;var c;return null!=n&&null!==(i=n.typography)&&void 0!==i&&i.fontSize&&(a={style:{fontSize:kw({size:n.typography.fontSize},{typography:{fluid:r},layout:s})}}),t&&(a={style:{fontSize:Da(l,t,null==n||null===(c=n.typography)||void 0===c?void 0:c.fontSize).size}}),a?FL(a,e,{fontSize:t}):void 0},addSaveProps:FL,attributeKeys:["fontSize","style"],hasSupport:e=>(0,d.hasBlockSupport)(e,VL)},GL={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,m.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,d.hasBlockSupport)(e,VL)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,m.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const i=e.name;return YN({fontSize:(0,d.hasBlockSupport)(i,VL)},GL,e,t,n,o)}));const $L="typography.textAlign",UL=[{icon:Ja,title:(0,vt.__)("Align text left"),align:"left"},{icon:ec,title:(0,vt.__)("Align text center"),align:"center"},{icon:tc,title:(0,vt.__)("Align text right"),align:"right"}],WL=["left","center","right"],KL=[];function ZL(e){return Array.isArray(e)?WL.filter((t=>e.includes(t))):!0===e?WL:KL}const qL={edit:function({style:e,name:t,setAttributes:n}){var o,i;const l=tL(t),r=null==l||null===(o=l.typography)||void 0===o?void 0:o.textAlign,s=HN();if(!r||"default"!==s)return null;const a=ZL((0,d.getBlockSupport)(t,$L));if(!a.length)return null;const c=UL.filter((e=>a.includes(e.align)));return(0,et.jsx)(Qy,{group:"block",children:(0,et.jsx)(lc,{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:qN(o)})},alignmentControls:c})})},useBlockProps:function({name:e,style:t}){var n;if(null==t||null===(n=t.typography)||void 0===n||!n.textAlign)return null;if(!ZL((0,d.getBlockSupport)(e,$L)).length)return null;if(QN(e,eA,"textAlign"))return null;const o=t.typography.textAlign;return{className:u({[`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:l}=n.style.typography;return ZL((0,d.getBlockSupport)(t,$L)).includes(l)&&!QN(t,eA,"textAlign")&&(e.className=u(`has-text-align-${l}`,e.className)),e},attributeKeys:["style"],hasSupport:e=>(0,d.hasBlockSupport)(e,$L,!1)};function YL(e,t){return`${e} { font-size: ${t}px !important; }`}const QL="typography.fitText";(0,m.addFilter)("blocks.registerBlockType","core/fit-text/addAttribute",(function(e){var t;return(0,d.hasBlockSupport)(e,QL)?null!==(t=e.attributes)&&void 0!==t&&t.fitText?e:{...e,attributes:{...e.attributes,fitText:{type:"boolean"}}}:e}));const XL={useBlockProps:function({name:e,fitText:t,clientId:n}){return function({fitText:e,name:t,clientId:n}){const o=(0,d.hasBlockSupport)(t,QL),i=up(n),l=(0,h.useSelect)((t=>{if(n&&o&&e)return t(ba).getBlockAttributes(n)}),[n,o,e]),r=(0,p.useCallback)((()=>{if(!i||!o||!e)return;const t=`fit-text-${n}`;let l=i.ownerDocument.getElementById(t);l||(l=i.ownerDocument.createElement("style"),l.id=t,i.ownerDocument.head.appendChild(l)),function(e,t,n){if(!e)return;n("");const o=function(e,t,n){const o=e.scrollHeight>e.clientHeight;let i=5,l=600,r=i;for(;i<=l;){const s=Math.floor((i+l)/2);n(YL(t,s));const a=e.scrollWidth<=e.clientWidth,c=o||e.scrollHeight<=e.clientHeight;a&&c?(r=s,i=s+1):l=s-1}return r}(e,t,n);n(YL(t,o))}(i,`#block-${n}`,(e=>{l.textContent=e}))}),[i,n,o,e]);(0,p.useEffect)((()=>{if(!(e&&i&&n&&o))return;r();const t=i;let l;return window.ResizeObserver&&t.parentElement&&(l=new window.ResizeObserver(r),l.observe(t.parentElement)),()=>{l&&l.disconnect();const e=`fit-text-${n}`,o=t.ownerDocument.getElementById(e);o&&o.remove()}}),[e,n,r,i,o]),(0,p.useEffect)((()=>{if(e&&i&&o){const e=window.requestAnimationFrame((()=>{i&&r()}));return()=>window.cancelAnimationFrame(e)}}),[l,e,r,i,o])}({fitText:t,name:e,clientId:n}),t&&(0,d.hasBlockSupport)(e,QL)?{className:"has-fit-text"}:{}},addSaveProps:function(e,t,n){if(!(0,d.hasBlockSupport)(t,QL))return e;const{fitText:o}=n;if(!o)return e;const i=e.className?`${e.className} has-fit-text`:"has-fit-text";return{...e,className:i}},attributeKeys:["fitText","fontSize","style"],hasSupport:e=>(0,d.hasBlockSupport)(e,QL),edit:function({clientId:e,fitText:t=!1,setAttributes:n,name:o,fontSize:i,style:l}){return(0,d.hasBlockSupport)(o,QL)?(0,et.jsx)(z_,{group:"typography",children:(0,et.jsx)(le.__experimentalToolsPanelItem,{hasValue:()=>t,label:(0,vt.__)("Fit text"),onDeselect:()=>n({fitText:void 0}),resetAllFilter:()=>({fitText:void 0}),panelId:e,children:(0,et.jsx)(le.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,vt.__)("Fit text"),checked:t,onChange:()=>{const e=!t||void 0,o={fitText:e};var r;e&&(i&&(o.fontSize=void 0),null!=l&&null!==(r=l.typography)&&void 0!==r&&r.fontSize&&(o.style={...l,typography:{...null==l?void 0:l.typography,fontSize:void 0}})),n(o)},help:t?(0,vt.__)("Text will resize to fit its container."):(0,vt.__)("The text will resize to fit its container, resetting other font size settings.")})})}):null}};function JL(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.includes(e))))}const eA="typography",tA=["typography.lineHeight",VL,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",DL,$L,"typography.textColumns","typography.__experimentalTextDecoration","typography.textIndent","typography.__experimentalWritingMode","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing",QL];function nA(e){var t,n,o,i,l;const r={...JL(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="string"==typeof s&&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===(l=a.substring)||void 0===l?void 0:l.call(a,23):void 0;return r.typography={...JL(r.typography,["fontFamily"]),fontSize:c?void 0:s},{style:qN(r),fontFamily:u,fontSize:c}}function oA(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 iA({children:e,resetAllFilter:t}){const n=(0,p.useCallback)((e=>{const n=oA(e),o=t(n);return{...e,...nA(o)}}),[t]);return(0,et.jsx)(z_,{group:"typography",resetAllFilter:n,children:e})}function lA({clientId:e,name:t,setAttributes:n,settings:o}){const i=MP(o),{style:l,fontFamily:r,fontSize:s,fitText:a}=(0,h.useSelect)((t=>{if(!i)return{};const{style:n,fontFamily:o,fontSize:l,fitText:r}=t(ba).getBlockAttributes(e)||{};return{style:n,fontFamily:o,fontSize:l,fitText:r}}),[e,i]),c=(0,p.useMemo)((()=>oA({style:l,fontFamily:r,fontSize:s})),[l,s,r]);if(!i)return null;const u=(0,d.getBlockSupport)(t,[eA,"__experimentalDefaultControls"]);return(0,et.jsx)(WP,{as:iA,panelId:e,settings:o,value:c,onChange:e=>{var t,o;const i=nA(e);(i.fontSize||(null===(t=i.style)||void 0===t||null===(o=t.typography)||void 0===o?void 0:o.fontSize))&&a&&(i.fitText=void 0),n(i)},defaultControls:u})}const rA="function"==typeof cm()?cm():cm().isShallowEqual;function sA({clientId:e,value:t,computeStyle:n,forceShow:o}){const i=up(e),[l,r]=(0,p.useReducer)((()=>n(i)));(0,p.useEffect)((()=>{i&&o&&r()}),[i,o]),(0,p.useEffect)((()=>{if(!i)return;const e=new window.MutationObserver(r);return e.observe(i,{attributes:!0,attributeFilter:["style","class"]}),()=>{e.disconnect()}}),[i]);const s=(0,p.useRef)(t),[a,c]=(0,p.useState)(!1);return(0,p.useEffect)((()=>{if(rA(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,et.jsx)(g_,{clientId:e,__unstablePopoverSlot:"block-toolbar",children:(0,et.jsx)("div",{className:"block-editor__spacing-visualizer",style:l})}):null}function aA(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function cA({clientId:e,value:t,forceShow:n}){var o;return(0,et.jsx)(sA,{clientId:e,value:null==t||null===(o=t.spacing)||void 0===o?void 0:o.margin,computeStyle:e=>{const t=aA(e,"margin-top"),n=aA(e,"margin-right"),o=aA(e,"margin-bottom"),i=aA(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 uA({clientId:e,value:t,forceShow:n}){var o;return(0,et.jsx)(sA,{clientId:e,value:null==t||null===(o=t.spacing)||void 0===o?void 0:o.padding,computeStyle:e=>({borderTopWidth:aA(e,"padding-top"),borderRightWidth:aA(e,"padding-right"),borderBottomWidth:aA(e,"padding-bottom"),borderLeftWidth:aA(e,"padding-left")}),forceShow:n})}const dA="dimensions",pA="spacing";function hA({children:e,resetAllFilter:t}){const n=(0,p.useCallback)((e=>{const n=e.style,o=t(n);return{...e,style:o}}),[t]);return(0,et.jsx)(z_,{group:"dimensions",resetAllFilter:n,children:e})}function gA({clientId:e,name:t,setAttributes:n,settings:o}){var i,l;const r=nM(o),s=(0,h.useSelect)((t=>{var n;if(r)return null===(n=t(ba).getBlockAttributes(e))||void 0===n?void 0:n.style}),[e,r]),[a,c]=function(){const[e,t]=(0,p.useState)(!1),{hideBlockInterface:n,showBlockInterface:o}=fe((0,h.useDispatch)(ba));return(0,p.useEffect)((()=>{e?n():o()}),[e,o,n]),[e,t]}();if(!r)return null;const u={...(0,d.getBlockSupport)(t,[dA,"__experimentalDefaultControls"]),...(0,d.getBlockSupport)(t,[pA,"__experimentalDefaultControls"])};return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(vM,{as:hA,panelId:e,settings:o,value:s,onChange:e=>{n({style:qN(e)})},defaultControls:u,onVisualize:c}),!(null==o||null===(i=o.spacing)||void 0===i||!i.padding)&&"padding"===a&&(0,et.jsx)(uA,{forceShow:"padding"===a,clientId:e,value:s}),!(null==o||null===(l=o.spacing)||void 0===l||!l.margin)&&"margin"===a&&(0,et.jsx)(cA,{forceShow:"margin"===a,clientId:e,value:s})]})}function mA(e,t="any"){if("web"!==p.Platform.OS)return!1;const n=(0,d.getBlockSupport)(e,dA);return!!(!0===n||("any"===t?null!=n&&n.aspectRatio||null!=n&&n.height||null!=n&&n.minHeight||null!=n&&n.width:null!=n&&n[t]))}const fA={useBlockProps:function({name:e,height:t,minHeight:n,style:o}){var i,l,r,s;if(!mA(e,"aspectRatio")||QN(e,dA,"aspectRatio"))return{};const a=u({"has-aspect-ratio":!(null==o||null===(i=o.dimensions)||void 0===i||!i.aspectRatio)}),c={};return null!=o&&null!==(l=o.dimensions)&&void 0!==l&&l.aspectRatio?(c.minHeight="unset",c.height="unset"):(n||null!=o&&null!==(r=o.dimensions)&&void 0!==r&&r.minHeight||t||null!=o&&null!==(s=o.dimensions)&&void 0!==s&&s.height)&&(c.aspectRatio="unset"),{className:a,style:c}},attributeKeys:["height","minHeight","width","style"],hasSupport:e=>mA(e)};function vA(){Je()("wp.blockEditor.__experimentalUseCustomSides",{since:"6.3",version:"6.4"})}const bA=[...tA,pR,GR,dA,JT,pA,hR],kA=e=>bA.some((t=>(0,d.hasBlockSupport)(e,t)));function _A(e={}){const t={};return md(e).forEach((e=>{t[e.key]=e.value})),t}const yA={[`${pR}.__experimentalSkipSerialization`]:["border"],[`${GR}.__experimentalSkipSerialization`]:[GR],[`${eA}.__experimentalSkipSerialization`]:[eA],[`${dA}.__experimentalSkipSerialization`]:[dA],[`${pA}.__experimentalSkipSerialization`]:[pA],[`${hR}.__experimentalSkipSerialization`]:[hR]},xA={...yA,[`${dA}.aspectRatio`]:[`${dA}.aspectRatio`],[`${JT}`]:[JT]},SA={[`${dA}.aspectRatio`]:!0,[`${JT}`]:!0},wA={gradients:"gradient"};function CA(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;CA(o[t],[n],!0)}else 1===e.length&&delete o[e[0]]})),o}function BA(e,t,n,o=xA){if(!kA(t))return e;let{style:i}=n;return Object.entries(o).forEach((([e,n])=>{const o=SA[e]||(0,d.getBlockSupport)(t,e);!0===o&&(i=CA(i,n)),Array.isArray(o)&&o.forEach((e=>{const t=wA[e]||e;i=CA(i,[[...n,t]])}))})),e.style={..._A(i),...e.style},e}const IA={edit:function({clientId:e,name:t,setAttributes:n,__unstableParentLayout:o}){const i=tL(t,o),l=HN(),r={clientId:e,name:t,setAttributes:n,settings:{...i,typography:{...i.typography,textAlign:!1}}};return"default"!==l?null:(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(JR,{...r}),(0,et.jsx)(lP,{...r}),(0,et.jsx)(lA,{...r}),(0,et.jsx)(_R,{...r}),(0,et.jsx)(gA,{...r})]})},hasSupport:kA,addSaveProps:BA,attributeKeys:["style"],useBlockProps:function({name:e,style:t}){const n=(0,g.useInstanceId)(EA,"wp-elements"),o=`.${n}`,i=null==t?void 0:t.elements,l=(0,p.useMemo)((()=>{if(!i)return;const t=[];return jA.forEach((({elementType:n,pseudo:l,elements:r})=>{if(QN(e,GR,n))return;const s=null==i?void 0:i[n];if(s){const e=Pw(o,d.__EXPERIMENTAL_ELEMENTS[n]);t.push(gd(s,{selector:e})),l&&l.forEach((e=>{s[e]&&t.push(gd(s[e],{selector:Pw(o,`${d.__EXPERIMENTAL_ELEMENTS[n]}${e}`)}))}))}r&&r.forEach((e=>{i[e]&&t.push(gd(i[e],{selector:Pw(o,d.__EXPERIMENTAL_ELEMENTS[e])}))}))})),t.length>0?t.join(""):void 0}),[o,i,e]);return JN({css:l}),BA({className:n},e,{style:t},yA)}},jA=[{elementType:"button"},{elementType:"link",pseudo:[":hover"]},{elementType:"heading",elements:["h1","h2","h3","h4","h5","h6"]}],EA={};var TA;(0,m.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return kA(e)||(0,d.hasBlockSupport)(e,"customCSS",!0)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,m.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){var t,n;return n=e,(0,d.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 PA=[],MA=(null===(TA=window)||void 0===TA?void 0:TA.navigator.userAgent)&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&!window.navigator.userAgent.includes("Chromium");function RA({presetSetting:e,defaultSetting:t}){const[n,o,i,l]=wa(t,`${e}.custom`,`${e}.theme`,`${e}.default`);return(0,p.useMemo)((()=>[...o||PA,...i||PA,...n&&l||PA]),[n,o,i,l])}function NA(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}ee([te]);const LA={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,l=tL(n),r=HN(),s=RA({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=RA({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),[c,u]=wa("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"!==r)return null;const h="unset"===i||Array.isArray(i)?i:NA(i,s);return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(z_,{group:"filter",children:(0,et.jsx)(sR,{value:{filter:{duotone:h}},onChange:n=>{const o={...e,color:{...null==n?void 0:n.filter}};t({style:qN(o)})},settings:l})}),(0,et.jsx)(Qy,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,et.jsx)(zC,{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:o??n}};t({style:qN(i)})},settings:l})})]})},useBlockProps:function({clientId:e,name:t,style:n}){var o;const i=(0,g.useInstanceId)(AA),l=(0,p.useMemo)((()=>{const e=(0,d.getBlockType)(t);if(e){if(!(0,d.getBlockSupport)(e,"filter.duotone",!1))return null;const t=(0,d.getBlockSupport)(e,"color.__experimentalDuotone",!1);if(t){const n=sP(e);return"string"==typeof t?Pw(n,t):n}return sP(e,"filter.duotone",{fallback:!0})}}),[t]),r=null==n||null===(o=n.color)||void 0===o?void 0:o.duotone,s=`wp-duotone-${i}`,a=l&&r;return function({clientId:e,id:t,selector:n,attribute:o}){const i=RA({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),l=Array.isArray(o),r=l?void 0:NA(o,i),s="string"==typeof o&&r;let a=null;s?a=r:("string"==typeof o&&!s||l)&&(a=o);const c=n.split(",").map((e=>`.${t}${e.trim()}`)).join(", "),u=Array.isArray(a)||"unset"===a;eL(u?{css:"unset"!==a?RT(c,t):MT(c),__unstableType:"presets"}:void 0),eL(u?{assets:"unset"!==a?NT(t,a):"",__unstableType:"svgs"}:void 0);const d=up(e);(0,p.useEffect)((()=>{if(u&&d&&MA){const e=d.style.display;d.style.setProperty("display","inline-block"),d.offsetHeight,d.style.setProperty("display",e)}}),[u,d,a])}({clientId:e,id:s,selector:l,attribute:r}),{className:a?s:""}},attributeKeys:["style"],hasSupport:e=>(0,d.hasBlockSupport)(e,"filter.duotone")};const AA={};(0,m.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,d.hasBlockSupport)(e,"filter.duotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e}));const DA={},OA={};function zA({blockName:e,setAttributes:t,style:n}){const o=(0,d.getBlockType)(e),i=(0,vt.sprintf)(// translators: %s: is the name of a block e.g., 'Image' or 'Quote'.
// translators: %s: is the name of a block e.g., 'Image' or 'Quote'.
(0,vt.__)("Add your own CSS to customize the appearance of the %s block. You do not need to include a CSS selector, just add the property and value, e.g. color: red;.","kubio"),null==o?void 0:o.title);return(0,et.jsx)(z_,{group:"advanced",children:(0,et.jsx)(dR,{value:n,onChange:function(e){var n;const o=null!=e&&null!==(n=e.css)&&void 0!==n&&n.trim()?e.css:void 0;t({style:qN({...e,css:o})})},inheritedValue:n,help:i})})}const VA={edit:function({clientId:e,name:t,setAttributes:n}){const{style:o,canEditCSS:i}=(0,h.useSelect)((t=>{var n;const{getBlockAttributes:o,getSettings:i}=t(ba);return{style:(null===(n=o(e))||void 0===n?void 0:n.style)||OA,canEditCSS:i().canEditCSS}}),[e]);return i?(0,et.jsx)(zA,{blockName:t,setAttributes:n,style:o}):null},useBlockProps:function({style:e}){const t=null==e?void 0:e.css,n="string"==typeof t&&t.trim().length>0&&uR(t),o=(0,g.useInstanceId)(DA,"wp-custom-css"),i=`.${o}`;return JN({css:(0,p.useMemo)((()=>{if(n)return xP(t,i)}),[t,i,n])}),n?{className:`has-custom-css ${o}`}:{}},addSaveProps:function(e,t,n){var o,i;if(!(0,d.hasBlockSupport)(t,"customCSS",!0))return e;if(null==n||null===(o=n.style)||void 0===o||null===(i=o.css)||void 0===i||!i.trim())return e;const l=e.className?`${e.className} has-custom-css`:"has-custom-css";return{...e,className:l}},attributeKeys:["style"],hasSupport:e=>(0,d.hasBlockSupport)(e,"customCSS",!0)},FA="is-style-";function HA(e){return e?e.split(/\s+/).reduce(((e,t)=>{if(t.startsWith(FA)){const n=t.slice(FA.length);"default"!==n&&e.push(n)}return e}),[]):[]}function GA(e,t=[]){const n=HA(e);if(!n)return null;for(const e of n)if(t.some((t=>t.name===e)))return e;return null}const $A={hasSupport:()=>!0,attributeKeys:["className"],isMatch:({className:e})=>HA(e).length>0,useBlockProps:function({name:e,className:t,clientId:n}){const{getBlockStyles:o}=(0,h.useSelect)(d.store),i=GA(t,o(e)),l=`${FA}${i}-${n}`,{settings:r,styles:s}=function(e,t,n){const{merged:o}=(0,p.useContext)(oC),{globalSettings:i,globalStyles:l}=(0,h.useSelect)((e=>{const t=e(ba).getSettings();return{globalSettings:t.__experimentalFeatures,globalStyles:t[wt]}}),[]);return(0,p.useMemo)((()=>{const r=function(e,t,n){var o,i,l,r;if(null==e||null===(o=e.styles)||void 0===o||null===(i=o.blocks)||void 0===i||null===(l=i[t])||void 0===l||null===(r=l.variations)||void 0===r||!r[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=xn(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==o?void 0:o.settings)??i,styles:(null==o?void 0:o.styles)??l},e,t);return{settings:(null==o?void 0:o.settings)??i,styles:{blocks:{[e]:{variations:{[`${t}-${n}`]:r}}}}}}),[o,i,l,t,n,e])}(e,i,n),a=(0,p.useMemo)((()=>{if(!i)return;const e={settings:r,styles:s},t=yP((0,d.getBlockTypes)(),o,n);return kP(e,t,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0})}),[i,r,s,o,n]);return eL({id:`variation-${n}`,css:a,__unstableType:"variation",variation:i,clientId:n}),i?{className:l}:{}}},UA="layout";function WA(e){return(0,d.hasBlockSupport)(e,"layout")||(0,d.hasBlockSupport)(e,"__experimentalLayout")}function KA(e={},t=""){var n;const{layout:o}=e,{default:i}=(0,d.getBlockSupport)(t,UA)||{},l=null!=o&&o.inherit||null!=o&&o.contentSize||null!=o&&o.wideSize?{...o,type:"constrained"}:o||i||{},r=[];if(null!==(n=Gc[(null==l?void 0:l.type)||"default"])&&void 0!==n&&n.className){var s;const e=null===(s=Gc[(null==l?void 0:l.type)||"default"])||void 0===s?void 0:s.className,n=t.split("/"),o=`wp-block-${"core"===n[0]?n.pop():n.join("-")}-${e}`;r.push(e,o)}return(0,h.useSelect)((e=>{var t;return!!(null!=l&&l.inherit||null!=l&&l.contentSize||"constrained"===(null==l?void 0:l.type))&&(null===(t=e(ba).getSettings().__experimentalFeatures)||void 0===t?void 0:t.useRootPaddingAwareAlignments)}),[null==l?void 0:l.contentSize,null==l?void 0:l.inherit,null==l?void 0:l.type])&&r.push("has-global-padding"),null!=l&&l.orientation&&r.push(`is-${Ze(l.orientation)}`),null!=l&&l.justifyContent&&r.push(`is-content-justification-${Ze(l.justifyContent)}`),null!=l&&l.flexWrap&&"nowrap"===l.flexWrap&&r.push("is-nowrap"),r}const ZA={shareWithChildBlocks:!0,edit:function({layout:e,setAttributes:t,name:n,clientId:o}){const i=tL(n),{layout:l}=i,{themeSupportsLayout:r}=(0,h.useSelect)((e=>{const{getSettings:t}=e(ba);return{themeSupportsLayout:t().supportsLayout}}),[]);if("default"!==HN())return null;const s=(0,d.getBlockSupport)(n,UA,{}),a={...l,...s},{allowSwitching:c,allowEditing:u=!0,allowInheriting:p=!0,default:g}=a;if(!u)return null;const m={...s,...e},{type:f,default:{type:v="default"}={}}=m,b=f||v,k=!(!p||b&&"default"!==b&&"constrained"!==b&&!m.inherit),_=e||g||{},{inherit:y=!1,contentSize:x=null}=_;if(("default"===b||"constrained"===b)&&!r)return null;const S=Bd(b),w=Bd("constrained"),C=!_.type&&(x||y),B=!!y||!!x,I=e=>t({layout:e});return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(z_,{children:(0,et.jsxs)(le.PanelBody,{title:(0,vt.__)("Layout","kubio"),children:[k&&(0,et.jsx)(et.Fragment,{children:(0,et.jsx)(le.ToggleControl,{label:(0,vt.__)("Inner blocks use content width","kubio"),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,vt.__)("Nested blocks use content width with options for full and wide widths.","kubio"):(0,vt.__)("Nested blocks will fill the width of this container.","kubio")})}),!y&&c&&(0,et.jsx)(qA,{type:b,onChange:e=>t({layout:{type:e}})}),S&&"default"!==S.name&&(0,et.jsx)(S.inspectorControls,{layout:_,onChange:I,layoutBlockSupport:a,name:n,clientId:o}),w&&C&&(0,et.jsx)(w.inspectorControls,{layout:_,onChange:I,layoutBlockSupport:a,name:n,clientId:o})]})}),!y&&S&&(0,et.jsx)(S.toolBarControls,{layout:_,onChange:I,layoutBlockSupport:s,name:n,clientId:o})]})},attributeKeys:["layout"],hasSupport:e=>WA(e)};function qA({type:e,onChange:t}){return(0,et.jsx)(le.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,isBlock:!0,label:(0,vt.__)("Layout type","kubio"),hideLabelFromVision:!0,isAdaptiveWidth:!0,value:e,onChange:t,children:Cd.map((({name:e,label:t})=>(0,et.jsx)(le.__experimentalToggleGroupControlOption,{value:e,label:t},e)))})}function YA({block:e,props:t,blockGapSupport:n,globalBlockGapValue:o,layoutClasses:i}){var l;const{name:r,attributes:s}=t,a=(0,g.useInstanceId)(e),{layout:c}=s,{default:p}=(0,d.getBlockSupport)(r,UA)||{},h=null!=c&&c.inherit||null!=c&&c.contentSize||null!=c&&c.wideSize?{...c,type:"constrained"}:c||p||{},m=`wp-container-${Ze(r)}-is-layout-`,f=`.${m}${a}`,v=null!==n,b=Bd((null==h?void 0:h.type)||"default"),k=null==b||null===(l=b.getLayoutStyle)||void 0===l?void 0:l.call(b,{blockName:r,selector:f,layout:h,style:null==s?void 0:s.style,hasBlockGapSupport:v,globalBlockGapValue:o}),_=u({[`${m}${a}`]:!!k},i);return JN({css:k}),(0,et.jsx)(e,{...t,__unstableLayoutClassNames:_})}const QA=(0,g.createHigherOrderComponent)((e=>function(t){const{clientId:n,name:o,attributes:i}=t,l=WA(o),r=KA(i,o),s=(0,h.useSelect)((e=>{var t,r,s,a;if(!l)return;const{getSettings:c,getBlockSettings:u}=fe(e(ba)),p=c(),{disableLayoutStyles:h}=p;if(h)return;const[g]=u(n,"spacing.blockGap"),m=p[wt];let f;const v=null==i?void 0:i.className;if(null!=v&&v.includes("is-style-")){var b,k,_,y,x;const{getBlockStyles:t}=e(d.store),n=GA(v,t(o));f=n?null==m||null===(b=m.blocks)||void 0===b||null===(k=b[o])||void 0===k||null===(_=k.variations)||void 0===_||null===(y=_[n])||void 0===y||null===(x=y.spacing)||void 0===x?void 0:x.blockGap:void 0}return{blockGapSupport:g,globalBlockGapValue:f??(null==m||null===(t=m.blocks)||void 0===t||null===(r=t[o])||void 0===r||null===(s=r.spacing)||void 0===s?void 0:s.blockGap)??(null==m||null===(a=m.spacing)||void 0===a?void 0:a.blockGap)}}),[l,n,null==i?void 0:i.className,o]);return s?(0,et.jsx)(YA,{block:e,props:t,layoutClasses:r,...s}):(0,et.jsx)(e,{...t,__unstableLayoutClassNames:l?r:void 0})}),"withLayoutStyles");function XA(e,t){return Array.from({length:t},((t,n)=>e+n))}(0,m.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){var t;return"type"in((null===(t=e.attributes)||void 0===t?void 0:t.layout)??{})||WA(e)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,m.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",QA);class JA{constructor({columnStart:e,rowStart:t,columnEnd:n,rowEnd:o,columnSpan:i,rowSpan:l}={}){this.columnStart=e??1,this.rowStart=t??1,this.columnEnd=void 0!==i?this.columnStart+i-1:n??this.columnStart,this.rowEnd=void 0!==l?this.rowStart+l-1: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 eD(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function tD(e,t){const n=[];for(const o of e.split(" ")){const e=n[n.length-1],i=e?e.end+t:0,l=i+parseFloat(o);n.push({start:i,end:l})}return n}function nD(e,t,n="start"){return e.reduce(((o,i,l)=>Math.abs(i[n]-t)<Math.abs(e[o][n]-t)?l:o),0)}function oD(e){const t=eD(e,"grid-template-columns"),n=eD(e,"grid-template-rows"),o=eD(e,"border-top-width"),i=eD(e,"border-right-width"),l=eD(e,"border-bottom-width"),r=eD(e,"border-left-width"),s=eD(e,"padding-top"),a=eD(e,"padding-right"),c=eD(e,"padding-bottom"),u=eD(e,"padding-left"),d=t.split(" ").length,p=n.split(" ").length;return{numColumns:d,numRows:p,numItems:d*p,currentColor:eD(e,"color"),style:{gridTemplateColumns:t,gridTemplateRows:n,gap:eD(e,"gap"),inset:`\n\t\t\t\tcalc(${s} + ${o})\n\t\t\t\tcalc(${a} + ${i})\n\t\t\t\tcalc(${c} + ${l})\n\t\t\t\tcalc(${u} + ${r})\n\t\t\t`}}}function iD({clientId:e,contentRef:t,parentLayout:n,childGridClientId:o}){const i=(0,h.useSelect)((e=>e(ba).getSettings().isDistractionFree),[]),l=up(e);if(i||!l)return null;const r=(null==n?void 0:n.isManualPlacement)&&window.__experimentalEnableGridInteractivity;return(0,et.jsx)(lD,{gridClientId:e,gridElement:l,isManualGrid:r,ref:t,childGridClientId:o})}const lD=(0,p.forwardRef)((({gridClientId:e,gridElement:t,isManualGrid:n,childGridClientId:o},i)=>{const[l,r]=(0,p.useState)((()=>oD(t))),[s,a]=(0,p.useState)(!1),c=up(o),d=(0,p.useMemo)((()=>{return c?function(e,t){const n=parseFloat(eD(e,"column-gap")),o=parseFloat(eD(e,"row-gap")),i=tD(eD(e,"grid-template-columns"),n),l=tD(eD(e,"grid-template-rows"),o),r=nD(i,t.left)+1,s=nD(l,t.top)+1,a=nD(i,t.right,"end")+1,c=nD(l,t.bottom,"end")+1;return new JA({columnStart:r,columnEnd:a,rowStart:s,rowEnd:c})}((e=c).parentElement,new window.DOMRect(e.offsetLeft,e.offsetTop,e.offsetWidth,e.offsetHeight)):null;var e}),[c]);return(0,p.useEffect)((()=>{const e=()=>r(oD(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,p.useEffect)((()=>{function e(){a(!0)}function t(){a(!1)}return document.addEventListener("drag",e),document.addEventListener("dragend",t),()=>{document.removeEventListener("drag",e),document.removeEventListener("dragend",t)}}),[]),(0,et.jsx)(g_,{className:u("block-editor-grid-visualizer",{"is-dropping-allowed":s}),clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",children:(0,et.jsx)("div",{ref:i,className:"block-editor-grid-visualizer__grid",style:l.style,children:n?(0,et.jsx)(sD,{gridClientId:e,gridInfo:l,childGridRect:d}):(0,et.jsx)(rD,{gridInfo:l,childGridRect:d})})})}));function rD({gridInfo:e,childGridRect:t}){return XA(1,e.numRows).map((n=>XA(1,e.numColumns).map((o=>{let i=e.currentColor;return null!=t&&t.contains(o,n)&&(i="transparent"),(0,et.jsx)(aD,{color:i},`${n}-${o}`)}))))}function sD({gridClientId:e,gridInfo:t,childGridRect:n}){const[o,i]=(0,p.useState)(null),l=(0,h.useSelect)((t=>{const{getBlockOrder:n,getBlockStyles:o}=fe(t(ba));return o(n(e))}),[e]),r=(0,p.useMemo)((()=>{const e=[];for(const t of Object.values(l)){const{columnStart:n,rowStart:o,columnSpan:i=1,rowSpan:l=1}=(null==t?void 0:t.layout)??{};n&&o&&e.push(new JA({columnStart:n,rowStart:o,columnSpan:i,rowSpan:l}))}return e}),[l]);return XA(1,t.numRows).map((l=>XA(1,t.numColumns).map((s=>{const a=null==n?void 0:n.contains(s,l);let c=t.currentColor;a&&(c="transparent");const u=r.some((e=>e.contains(s,l))),d=(null==o?void 0:o.contains(s,l))??!1;return(0,et.jsx)(aD,{color:c,className:d&&"is-highlighted",children:u&&!a?(0,et.jsx)(uD,{column:s,row:l,gridClientId:e,gridInfo:t,setHighlightedRect:i}):(0,et.jsx)(dD,{column:s,row:l,gridClientId:e,gridInfo:t,setHighlightedRect:i})},`${l}-${s}`)}))))}function aD({color:e,children:t,className:n}){return(0,et.jsx)("div",{className:u("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 cD(e,t,n,o,i){const{getBlockAttributes:l,getBlockRootClientId:r,canInsertBlockType:s,getBlockName:a}=(0,h.useSelect)(ba),{updateBlockAttributes:c,moveBlocksToPosition:u,__unstableMarkNextChangeAsNotPersistent:d}=(0,h.useDispatch)(ba),p=KP(n,o.numColumns);return function({validateDrag:e,onDragEnter:t,onDragLeave:n,onDrop:o}){const{getDraggedBlockClientIds:i}=(0,h.useSelect)(ba);return(0,g.__experimentalUseDropZone)({onDragEnter(){const[n]=i();n&&e(n)&&t(n)},onDragLeave(){n()},onDrop(){const[t]=i();t&&e(t)&&o(t)}})}({validateDrag(i){var r,c,u,d;const p=a(i);if(!s(p,n))return!1;const h=l(i),g=new JA({columnStart:e,rowStart:t,columnSpan:null===(r=h.style)||void 0===r||null===(c=r.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 JA({columnSpan:o.numColumns,rowSpan:o.numRows}).containsRect(g)},onDragEnter(n){var o,r,s,a;const c=l(n);i(new JA({columnStart:e,rowStart:t,columnSpan:null===(o=c.style)||void 0===o||null===(r=o.layout)||void 0===r?void 0:r.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=l(o);c(o,{style:{...a.style,layout:{...null===(s=a.style)||void 0===s?void 0:s.layout,columnStart:e,rowStart:t}}}),d(),u([o],r(o),n,p(e,t))}})}function uD({column:e,row:t,gridClientId:n,gridInfo:o,setHighlightedRect:i}){return(0,et.jsx)("div",{className:"block-editor-grid-visualizer__drop-zone",ref:cD(e,t,n,o,i)})}function dD({column:e,row:t,gridClientId:n,gridInfo:o,setHighlightedRect:i}){const{updateBlockAttributes:l,moveBlocksToPosition:r,__unstableMarkNextChangeAsNotPersistent:s}=(0,h.useDispatch)(ba),a=KP(n,o.numColumns);return(0,et.jsx)(lm,{rootClientId:n,className:"block-editor-grid-visualizer__appender",ref:cD(e,t,n,o,i),style:{color:o.currentColor},onSelect:o=>{o&&(l(o.clientId,{style:{layout:{columnStart:e,rowStart:t}}}),s(),r([o.clientId],n,n,a(e,t)))}})}function pD({clientId:e,bounds:t,onChange:n,parentLayout:o}){const i=up(e),l=null==i?void 0:i.parentElement,{isManualPlacement:r}=o;return i&&l?(0,et.jsx)(hD,{clientId:e,bounds:t,blockElement:i,rootBlockElement:l,onChange:n,isManualGrid:r&&window.__experimentalEnableGridInteractivity}):null}function hD({clientId:e,bounds:t,blockElement:n,rootBlockElement:o,onChange:i,isManualGrid:l}){const[r,s]=(0,p.useState)(null),[a,c]=(0,p.useState)({top:!1,bottom:!1,left:!1,right:!1});(0,p.useEffect)((()=>{const e=new window.ResizeObserver((()=>{const e=n.getBoundingClientRect(),t=o.getBoundingClientRect(),i=e.top>t.top,r=e.bottom<t.bottom,s=e.left>t.left,a=e.right<t.right;c({top:(l||!r)&&i,bottom:r,left:(l||!a)&&s,right:a})}));return e.observe(n),()=>e.disconnect()}),[n,o,l]);const u={right:"left",left:"right"},d={top:"flex-end",bottom:"flex-start"},h={display:"flex",justifyContent:"center",alignItems:"center",...u[r]&&{justifyContent:u[r]},...d[r]&&{alignItems:d[r]}};return(0,et.jsx)(g_,{className:"block-editor-grid-item-resizer",clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",additionalStyles:h,children:(0,et.jsx)(le.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,r)=>{const s=parseFloat(eD(o,"column-gap")),a=parseFloat(eD(o,"row-gap")),c=tD(eD(o,"grid-template-columns"),s),u=tD(eD(o,"grid-template-rows"),a),d=new window.DOMRect(n.offsetLeft+r.offsetLeft,n.offsetTop+r.offsetTop,r.offsetWidth,r.offsetHeight),p=nD(c,d.left)+1,h=nD(u,d.top)+1,g=nD(c,d.right,"end")+1,m=nD(u,d.bottom,"end")+1;i({columnSpan:g-p+1,rowSpan:m-h+1,columnStart:l?p:void 0,rowStart:l?h:void 0})}})})}function gD({layout:e,parentLayout:t,onChange:n,gridClientId:o,blockClientId:i}){const{moveBlocksToPosition:l,__unstableMarkNextChangeAsNotPersistent:r}=(0,h.useDispatch)(ba),s=(null==e?void 0:e.columnStart)??1,a=(null==e?void 0:e.rowStart)??1,c=(null==e?void 0:e.columnSpan)??1,u=(null==e?void 0:e.rowSpan)??1,d=s+c-1,p=a+u-1,g=null==t?void 0:t.columnCount,m=null==t?void 0:t.rowCount,f=KP(o,g);return(0,et.jsx)(Qy,{group:"parent",children:(0,et.jsxs)(le.ToolbarGroup,{className:"block-editor-grid-item-mover__move-button-container",children:[(0,et.jsx)("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-left",children:(0,et.jsx)(mD,{icon:(0,vt.isRTL)()?sy:ay,label:(0,vt.__)("Move left"),description:(0,vt.__)("Move left"),isDisabled:s<=1,onClick:()=>{n({columnStart:s-1}),r(),l([i],o,o,f(s-1,a))}})}),(0,et.jsxs)("div",{className:"block-editor-grid-item-mover__move-vertical-button-container",children:[(0,et.jsx)(mD,{className:"is-up-button",icon:cy,label:(0,vt.__)("Move up"),description:(0,vt.__)("Move up"),isDisabled:a<=1,onClick:()=>{n({rowStart:a-1}),r(),l([i],o,o,f(s,a-1))}}),(0,et.jsx)(mD,{className:"is-down-button",icon:uy,label:(0,vt.__)("Move down"),description:(0,vt.__)("Move down"),isDisabled:m&&p>=m,onClick:()=>{n({rowStart:a+1}),r(),l([i],o,o,f(s,a+1))}})]}),(0,et.jsx)("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-right",children:(0,et.jsx)(mD,{icon:(0,vt.isRTL)()?ay:sy,label:(0,vt.__)("Move right"),description:(0,vt.__)("Move right"),isDisabled:g&&d>=g,onClick:()=>{n({columnStart:s+1}),r(),l([i],o,o,f(s+1,a))}})})]})})}function mD({className:e,icon:t,label:n,isDisabled:o,onClick:i,description:l}){const r=`block-editor-grid-item-mover-button__description-${(0,g.useInstanceId)(mD)}`;return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(le.ToolbarButton,{className:u("block-editor-grid-item-mover-button",e),icon:t,label:n,"aria-describedby":r,onClick:o?null:i,disabled:o,accessibleWhenDisabled:!0}),(0,et.jsx)(le.VisuallyHidden,{id:r,children:l})]})}function fD(e,t,n,o,i=1,l=1){for(let r=l;;r++)for(let s=r===l?i:1;s<=t;s++){const t=new JA({columnStart:s,rowStart:r,columnSpan:n,rowSpan:o});if(!e.some((e=>e.intersectsRect(t))))return[s,r]}}const vD={};function bD({clientId:e,style:t,setAttributes:n,allowSizingOnChildren:o,isManualPlacement:i,parentLayout:l}){const{rootClientId:r,isVisible:s,parentBlockVisibility:a,blockBlockVisibility:c,deviceType:u,isChildBlockAGrid:d}=(0,h.useSelect)((t=>{var n,o,i,l;const{getBlockRootClientId:r,getBlockEditingMode:s,getTemplateLock:a,getBlockAttributes:c,getSettings:u}=t(ba),d=r(e);if(a(d)||"default"!==s(d))return{rootClientId:d,isVisible:!1};const p=c(d),h=c(e),g=u();return{rootClientId:d,isVisible:!0,parentBlockVisibility:null==p||null===(n=p.metadata)||void 0===n?void 0:n.blockVisibility,blockBlockVisibility:null==h||null===(o=h.metadata)||void 0===o?void 0:o.blockVisibility,deviceType:(null==g||null===(i=g[Rt])||void 0===i?void 0:i.toLowerCase())||bn.desktop.value,isChildBlockAGrid:"grid"===(null==h||null===(l=h.layout)||void 0===l?void 0:l.type)}}),[e]),{isBlockCurrentlyHidden:g}=Ek({blockVisibility:a,deviceType:u}),{isBlockCurrentlyHidden:m}=Ek({blockVisibility:c,deviceType:u}),[f,v]=(0,p.useState)(),b=d?e:void 0;if(!s||g)return null;const k=o&&!m;function _(e){n({style:{...t,layout:{...null==t?void 0:t.layout,...e}}})}return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(iD,{clientId:r,contentRef:v,parentLayout:l,childGridClientId:b}),k&&(0,et.jsx)(pD,{clientId:e,bounds:f,onChange:_,parentLayout:l}),i&&window.__experimentalEnableGridInteractivity&&(0,et.jsx)(gD,{layout:null==t?void 0:t.layout,parentLayout:l,onChange:_,gridClientId:r,blockClientId:e})]})}const kD={useBlockProps:function({style:e}){const t=(0,h.useSelect)((e=>!e(ba).getSettings().disableLayoutStyles)),n=(null==e?void 0:e.layout)??{},{selfStretch:o,flexSize:i,columnStart:l,rowStart:r,columnSpan:s,rowSpan:a}=n,c=Td()||{},{columnCount:u,minimumColumnWidth:d}=c,p=(0,g.useInstanceId)(vD),m=`.wp-container-content-${p}`;let f="";if(t&&("fixed"===o&&i?f=`${m} {\n\t\t\t\tflex-basis: ${i};\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`:"fill"===o?f=`${m} {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`:l&&s?f=`${m} {\n\t\t\t\tgrid-column: ${l} / span ${s};\n\t\t\t}`:l?f=`${m} {\n\t\t\t\tgrid-column: ${l};\n\t\t\t}`:s&&(f=`${m} {\n\t\t\t\tgrid-column: span ${s};\n\t\t\t}`),r&&a?f+=`${m} {\n\t\t\t\tgrid-row: ${r} / span ${a};\n\t\t\t}`:r?f+=`${m} {\n\t\t\t\tgrid-row: ${r};\n\t\t\t}`:a&&(f+=`${m} {\n\t\t\t\tgrid-row: span ${a};\n\t\t\t}`),(s||l)&&(d||!u))){let e=parseFloat(d);isNaN(e)&&(e=12);let t=null==d?void 0:d.replace(e,"");["px","rem","em"].includes(t)||(t="rem");let n=2;n=s&&l?s+l-1:s||l;const o="px"===t?24:1.5,i=n*e+(n-1)*o,r=2*e+o-1,a=s&&s>1?"1/-1":"auto";f+=`@container (max-width: ${Math.max(i,r)}${t}) {\n\t\t\t\t${m} {\n\t\t\t\t\tgrid-column: ${a};\n\t\t\t\t\tgrid-row: auto;\n\t\t\t\t}\n\t\t\t}`}if(JN({css:f}),f)return{className:`wp-container-content-${p}`}},edit:function({clientId:e,style:t,setAttributes:n}){const o=Td()||{},{type:i="default",allowSizingOnChildren:l=!1,isManualPlacement:r}=o;return"grid"!==i?null:(0,et.jsx)(bD,{clientId:e,style:t,setAttributes:n,allowSizingOnChildren:l,isManualPlacement:r,parentLayout:o})},attributeKeys:["style"],hasSupport:()=>!0},_D="metadata";(0,m.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t[_D])&&void 0!==n&&n.type||(e.attributes={...e.attributes,[_D]:{type:"object"}}),e})),(0,m.addFilter)("blocks.switchToBlockType.transformedBlock","core/metadata/addTransforms",(function(e,t,n,o){var i,l,r,s,a,c,u,p;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(o.length>1&&t.length>1&&o.length!==t.length)return e;const h=null===(i=t[n])||void 0===i||null===(l=i.attributes)||void 0===l?void 0:l.metadata;if(!h)return e;const g={};return!h.noteId||null!==(r=e.attributes)&&void 0!==r&&null!==(s=r.metadata)&&void 0!==s&&s.noteId||(g.noteId=h.noteId),!h.name||null!==(a=e.attributes)&&void 0!==a&&null!==(c=a.metadata)&&void 0!==c&&c.name||!(0,d.hasBlockSupport)(e.name,"renaming",!0)||(g.name=h.name),void 0===h.blockVisibility||null!==(u=e.attributes)&&void 0!==u&&null!==(p=u.metadata)&&void 0!==p&&p.blockVisibility||!(0,d.hasBlockSupport)(e.name,"visibility",!0)||(g.blockVisibility=h.blockVisibility),Object.keys(g).length>0?{...e,attributes:{...e.attributes,metadata:{...e.attributes.metadata,...g}}}:e}));const yD={},xD={edit:function({name:e,clientId:t,metadata:{ignoredHookedBlocks:n=[]}={}}){const o=(0,h.useSelect)((e=>e(d.store).getBlockTypes()),[]),i=(0,p.useMemo)((()=>null==o?void 0:o.filter((({name:t,blockHooks:o})=>o&&e in o||n.includes(t)))),[o,e,n]),l=(0,h.useSelect)((n=>{const{getBlocks:o,getBlockRootClientId:l,getGlobalBlockCount:r}=n(ba),s=l(t),a=i.reduce(((n,i)=>{var l,a;if(0===r(i.name))return n;let c;switch(null==i||null===(l=i.blockHooks)||void 0===l?void 0:l[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:yD}),[i,e,t]),{getBlockIndex:r,getBlockCount:s,getBlockRootClientId:a}=(0,h.useSelect)(ba),{insertBlock:c,removeBlock:u}=(0,h.useDispatch)(ba);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,et.jsx)(z_,{children:(0,et.jsxs)(le.PanelBody,{className:"block-editor-hooks__block-hooks",title:(0,vt.__)("Plugins"),initialOpen:!0,children:[(0,et.jsx)("p",{className:"block-editor-hooks__block-hooks-helptext",children:(0,vt.__)("Manage the inclusion of blocks added automatically by plugins.")}),Object.keys(g).map((n=>(0,et.jsxs)(p.Fragment,{children:[(0,et.jsx)("h3",{children:n}),g[n].map((n=>{const o=n.name in l;return(0,et.jsx)(le.ToggleControl,{checked:o,label:n.title,onChange:()=>{if(o)u(l[n.name],!1);else{const o=n.blockHooks[e];((e,n)=>{const o=r(t),i=s(t),l=a(t);switch(n){case"before":case"after":c(e,"after"===n?o+1:o,l,!1);break;case"first_child":case"last_child":c(e,"first_child"===n?0:i,t,!1);break;case void 0:c(e,o+1,l,!1)}})((0,d.createBlock)(n.name),o)}}},n.title)}))]},n)))]})})},attributeKeys:["metadata"],hasSupport:()=>!0},SD={edit:({name:e,metadata:t})=>{const n=(0,p.useContext)(ot),{removeAllBlockBindings:o}=Ud(),i=(0,g.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}},{bindableAttributes:l,hasCompatibleFields:r}=(0,h.useSelect)((t=>{const{__experimentalBlockBindingsSupportedAttributes:o}=t(ba).getSettings(),{getAllBlockBindingsSources:i,getBlockBindingsSourceFieldsList:l}=fe(t(d.store));return{bindableAttributes:null==o?void 0:o[e],hasCompatibleFields:Object.values(i()).some((e=>{var t;return(null==l||null===(t=l(e,n))||void 0===t?void 0:t.length)>0}))}}),[e,n]);if(!l||0===l.length)return null;const{bindings:s}=t||{};return void 0!==s||r?(0,et.jsx)(z_,{group:"bindings",children:(0,et.jsxs)(le.__experimentalToolsPanel,{label:(0,vt.__)("Attributes","kubio"),resetAll:()=>{o()},dropdownMenuProps:i,className:"block-editor-bindings__panel",children:[(0,et.jsx)(le.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:l.map((t=>(0,et.jsx)(Yd,{attribute:t,blockName:e,binding:null==s?void 0:s[t]},t)))}),(0,et.jsx)(le.__experimentalText,{as:"div",variant:"muted",children:(0,et.jsx)("p",{children:(0,vt.__)("Attributes connected to custom fields or other dynamic data.","kubio")})})]})}):null},attributeKeys:["metadata"],hasSupport:e=>!["core/post-date","core/navigation-link","core/navigation-submenu"].includes(e)};function wD(e){const{isOpened:t,expandRevision:n}=(0,h.useSelect)((t=>{const{isListViewPanelOpened:n,getListViewExpandRevision:o}=fe(t(ba));return{isOpened:n(e),expandRevision:o()}}),[e]),{__unstableToggleListViewPanel:o}=(0,h.useDispatch)(ba);return{isOpened:t,expandRevision:n,handleToggle:t=>{o(e,t)}}}function CD(e){return(0,d.hasBlockSupport)(e,"listView")}const BD={edit:function({clientId:e,name:t}){const{isSelectionWithinCurrentSection:n}=(0,p.useContext)(ht),{isOpened:o,expandRevision:i,handleToggle:l}=wD(e),{openListViewContentPanel:r}=fe((0,h.useDispatch)(ba)),s=CD(t),{hasChildren:a,isNestedListView:c}=(0,h.useSelect)((t=>{const{getBlockCount:n,getBlockParents:o,getBlockName:i}=t(ba),l=o(e,!1).find((e=>{const t=i(e);return"core/navigation"===t||(0,d.hasBlockSupport)(t,"listView")}));return{hasChildren:!!n(e),isNestedListView:l}}),[e]),u=(0,d.getBlockType)(t),g=(null==u?void 0:u.title)||t;if(!s||c)return null;const m=n;return(0,et.jsx)(T_,{group:"list",children:(0,et.jsxs)(le.PanelBody,{title:m?g:void 0,opened:o,onToggle:l,children:[!a&&(0,et.jsx)("p",{className:"block-editor-block-inspector__no-blocks",children:(0,vt.__)("No items yet.")}),(0,et.jsx)(lw,{rootClientId:e,isExpanded:!0,description:g,showAppender:!0,onSelect:r},`${e}-${i}`)]})})},hasSupport:CD,attributeKeys:[],supportsPatternEditing:!0};function ID(e){!function({clientId:e}){const{gridLayout:t,blockOrder:n,selectedBlockLayout:o}=(0,h.useSelect)((t=>{var n;const{getBlockAttributes:o,getBlockOrder:i}=t(ba),l=t(ba).getSelectedBlock();return{gridLayout:o(e).layout??{},blockOrder:i(e),selectedBlockLayout:null==l||null===(n=l.attributes.style)||void 0===n?void 0:n.layout}}),[e]),{getBlockAttributes:i,getBlockRootClientId:l}=(0,h.useSelect)(ba),{updateBlockAttributes:r,__unstableMarkNextChangeAsNotPersistent:s}=(0,h.useDispatch)(ba),a=(0,p.useMemo)((()=>o?new JA(o):null),[o]),c=(0,g.usePrevious)(a),u=(0,g.usePrevious)(t.isManualPlacement),d=(0,g.usePrevious)(n);(0,p.useEffect)((()=>{const o={};if(t.isManualPlacement){const r=[];for(const e of n){var a;const{columnStart:t,rowStart:n,columnSpan:o=1,rowSpan:l=1}=(null===(a=i(e).style)||void 0===a?void 0:a.layout)??{};t&&n&&r.push(new JA({columnStart:t,rowStart:n,columnSpan:o,rowSpan:l}))}for(const e of n){var p,h;const n=i(e),{columnStart:l,rowStart:s,columnSpan:a=1,rowSpan:u=1}=(null===(p=n.style)||void 0===p?void 0:p.layout)??{};if(l&&s)continue;const[d,g]=fD(r,t.columnCount,a,u,null==c?void 0:c.columnEnd,null==c?void 0:c.rowEnd);r.push(new JA({columnStart:d,rowStart:g,columnSpan:a,rowSpan:u})),o[e]={style:{...n.style,layout:{...null===(h=n.style)||void 0===h?void 0:h.layout,columnStart:d,rowStart:g}}}}const s=Math.max(...r.map((e=>e.rowEnd)));(!t.rowCount||t.rowCount<s)&&(o[e]={layout:{...t,rowCount:s}});for(const e of d??[])if(!n.includes(e)){var g,m;const t=l(e);if(null===t)continue;const n=i(t);if("grid"===(null==n||null===(g=n.layout)||void 0===g?void 0:g.type))continue;const r=i(e),{columnStart:s,rowStart:a,columnSpan:c,rowSpan:u,...d}=(null===(m=r.style)||void 0===m?void 0:m.layout)??{};if(s||a||c||u){const t=0===Object.keys(d).length;o[e]=yn(r,["style","layout"],t?void 0:d)}}}else{if(!0===u)for(const e of n){var f;const t=i(e),{columnStart:n,rowStart:l,...r}=(null===(f=t.style)||void 0===f?void 0:f.layout)??{};if(n||l){const n=0===Object.keys(r).length;o[e]=yn(t,["style","layout"],n?void 0:r)}}t.rowCount&&(o[e]={layout:{...t,rowCount:void 0}})}Object.keys(o).length&&(s(),r(Object.keys(o),o,!0))}),[e,t,d,n,c,u,s,i,l,r])}(e)}function jD({clientId:e,layout:t}){const{isSelected:n,isDragging:o}=(0,h.useSelect)((t=>{const{isBlockSelected:n,isDraggingBlocks:o}=t(ba);return{isSelected:n(e),isDragging:o()}}));return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(ID,{clientId:e}),(n||o)&&(0,et.jsx)(iD,{clientId:e,parentLayout:t})]})}(0,m.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||(0,d.hasBlockSupport)(e,"renaming",!0)&&(e.__experimentalLabel=(e,{context:t})=>{const{metadata:n}=e;if(("list-view"===t||"breadcrumb"===t)&&null!=n&&n.name)return n.name}),e}));const ED=(0,g.createHigherOrderComponent)((e=>t=>{var n;return"grid"!==(null===(n=t.attributes.layout)||void 0===n?void 0:n.type)?(0,et.jsx)(e,{...t},"edit"):(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(jD,{clientId:t.clientId,layout:t.attributes.layout}),(0,et.jsx)(e,{...t},"edit")]})}),"addGridVisualizerToBlockEdit");(0,m.addFilter)("editor.BlockEdit","core/editor/grid-visualizer",ED);const TD=p.Fragment;function PD(e){const{style:t}=e,n=(null==t?void 0:t.dimensions)||{},o=_A({dimensions:n});return{className:n.aspectRatio?"has-aspect-ratio":void 0,style:o}}function MD(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:wR(e)||void 0,style:_A({border:n})}}function RD(e){const{colors:t}=aB(),n=MD(e),{borderColor:o}=e;if(o){const e=mR({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function ND(e){var t;return{style:_A({shadow:(null===(t=e.style)||void 0===t?void 0:t.shadow)||""})}}function LD(e){var t,n,o,i,l,r;const{backgroundColor:s,textColor:a,gradient:c,style:d}=e,p=Qe("background-color",s),h=Qe("color",a),g=Ma(c),m=g||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:u(h,g,{[p]:!m&&!!p,"has-text-color":a||(null==d||null===(n=d.color)||void 0===n?void 0:n.text),"has-background":s||(null==d||null===(o=d.color)||void 0===o?void 0:o.background)||c||(null==d||null===(i=d.color)||void 0===i?void 0:i.gradient),"has-link-color":null==d||null===(l=d.elements)||void 0===l||null===(r=l.link)||void 0===r?void 0:r.color})||void 0,style:_A({color:(null==d?void 0:d.color)||{}})}}function AD(e){const{backgroundColor:t,textColor:n,gradient:o}=e,[i,l,r,s,a,c]=wa("color.palette.custom","color.palette.theme","color.palette.default","color.gradients.custom","color.gradients.theme","color.gradients.default"),u=(0,p.useMemo)((()=>[...i||[],...l||[],...r||[]]),[i,l,r]),d=(0,p.useMemo)((()=>[...s||[],...a||[],...c||[]]),[s,a,c]),h=LD(e);if(t){const e=qe(u,t);h.style.backgroundColor=e.color}if(o&&(h.style.background=Ra(d,o)),n){const e=qe(u,n);h.style.color=e.color}return h}function DD(e){const{style:t}=e;return{style:_A({spacing:(null==t?void 0:t.spacing)||{}})}}function OD(e,t){var n,o,i,l,r,s,a;let c=(null==e||null===(n=e.style)||void 0===n?void 0:n.typography)||{};c={...c,fontSize:kw({size:null==e||null===(o=e.style)||void 0===o||null===(i=o.typography)||void 0===i?void 0:i.fontSize},t)};const d=_A({typography:c}),p=null!=e&&e.fontFamily?`has-${Ze(e.fontFamily)}-font-family`:"",h=null!=e&&null!==(l=e.style)&&void 0!==l&&null!==(r=l.typography)&&void 0!==r&&r.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:u(p,h,za(null==e?void 0:e.fontSize)),style:d}}function zD(e){const[t,n]=(0,p.useState)(e);return(0,p.useEffect)((()=>{e&&n(e)}),[e]),t}var VD;!function(e){e=e.map((e=>({...e,Edit:(0,p.memo)(e.edit)})));const t=(0,g.createHigherOrderComponent)((t=>function(n){const o=B();return[...e.map(((e,t)=>{const{Edit:i,hasSupport:l,attributeKeys:r=[],shareWithChildBlocks:s,supportsPatternEditing:a}=e;if(!(a&&o[b]||o[f]||o[v]&&s)||!l(n.name))return null;const c={};for(const e of r)n.attributes[e]&&(c[e]=n.attributes[e]);return(0,et.jsx)(i,{name:n.name,isSelected:n.isSelected,clientId:n.clientId,setAttributes:n.setAttributes,__unstableParentLayout:n.__unstableParentLayout,...c},t)})),(0,et.jsx)(t,{...n},"edit")]}),"withBlockEditHooks");(0,m.addFilter)("editor.BlockEdit","core/editor/hooks",t)}([rL,qL,mL,LL,IA,VA,LA,XL,Q_,ZA,xD,SD,kD,pL,NL,BD,{edit:function({name:e,clientId:t,setAttributes:n}){const o=HN(),i=(0,h.useSelect)((e=>e(ba).getBlockAttributes(t)),[t]),l=(0,d.getBlockType)(e),{fields:r,form:s}=(0,p.useMemo)((()=>null!=l&&l.attributes?function(e){const t=[],n=[];return Object.entries(e).forEach((([e,o])=>{if(!o.autoGenerateControl)return;const i=function(e,t){const n=t.type,o={id:e,label:t.label||e,type:"string"===n?"text":n};return t.enum&&Array.isArray(t.enum)&&(o.elements=t.enum.map((e=>({value:e,label:String(e)})))),o}(e,o);i&&(t.push(i),n.push(e))})),{fields:t,form:{fields:n}}}(l.attributes):{fields:[],form:{fields:[]}}),[null==l?void 0:l.attributes]);return"default"!==o?null:r&&0!==r.length?(0,et.jsx)(z_,{children:(0,et.jsx)(le.PanelBody,{title:(0,vt.__)("Settings","kubio"),children:(0,et.jsx)(TD,{data:i,fields:r,form:s,onChange:n})})}):null},attributeKeys:[],hasSupport(e){const t=(0,d.getBlockType)(e);return!!(n=null==t?void 0:t.attributes)&&Object.values(n).some((e=>null==e?void 0:e.autoGenerateControl));var n}}].filter(Boolean)),function(e){const t=(0,g.createHigherOrderComponent)((t=>function(n){const[o,i]=(0,p.useState)(Array(e.length).fill(void 0));return[...e.map(((e,t)=>{const{hasSupport:o,attributeKeys:l=[],useBlockProps:r,isMatch:s}=e,a={};for(const e of l)n.attributes[e]&&(a[e]=n.attributes[e]);return!Object.keys(a).length||!o(n.name)||s&&!s(a)?null:(0,et.jsx)(nL,{index:t,useBlockProps:r,setAllWrapperProps:i,name:n.name,clientId:n.clientId,...a},t)})),(0,et.jsx)(t,{...n,wrapperProps:o.filter(Boolean).reduce(((e,t)=>({...e,...t,className:u(e.className,t.className),style:{...e.style,...t.style}})),n.wrapperProps||{})},"edit")]}),"withBlockListBlockHooks");(0,m.addFilter)("editor.BlockListBlock","core/editor/hooks",t)}([rL,qL,rP,IA,eN,fA,LA,zL,HL,XL,CR,VA,Q_,$A,kD]),VD=[rL,qL,mL,fL,LL,CR,VA,XL,eN,IA,zL,HL],(0,m.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",(function(e,t,n){return VD.reduce(((e,o)=>{const{hasSupport:i,attributeKeys:l=[],addSaveProps:r}=o,s={};for(const e of l)n[e]&&(s[e]=n[e]);return Object.keys(s).length&&i(t)?r(e,t,s):e}),e)}),0),(0,m.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",(e=>(e.hasOwnProperty("className")&&!e.className&&delete e.className,e)));const FD={button:"wp-element-button",caption:"wp-element-caption"},HD=e=>FD[e]?FD[e]:"",GD=[{value:"fill",label:(0,vt._x)("Fill","Scale option for dimensions control"),help:(0,vt.__)("Fill the space by stretching the content.")},{value:"contain",label:(0,vt._x)("Contain","Scale option for dimensions control"),help:(0,vt.__)("Fit the content to the space without clipping.")},{value:"cover",label:(0,vt._x)("Cover","Scale option for dimensions control"),help:(0,vt.__)("Fill the space by clipping what doesn't fit.")},{value:"none",label:(0,vt._x)("None","Scale option for dimensions control"),help:(0,vt.__)("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,vt._x)("Scale down","Scale option for dimensions control"),help:(0,vt.__)("Scale down the content to fit the space if it is too big. Content that is too small will have additional padding.")}];function $D({panelId:e,value:t,onChange:n,options:o=GD,defaultValue:i=GD[0].value,isShownByDefault:l=!0}){const r=t??"fill",s=(0,p.useMemo)((()=>o.reduce(((e,t)=>(e[t.value]=t.help,e)),{})),[o]);return(0,et.jsx)(le.__experimentalToolsPanelItem,{label:(0,vt.__)("Scale"),isShownByDefault:l,hasValue:()=>r!==i,onDeselect:()=>n(i),panelId:e,children:(0,et.jsx)(le.__experimentalToggleGroupControl,{label:(0,vt.__)("Scale"),isBlock:!0,help:s[r],value:r,onChange:n,size:"__unstable-large",children:o.map((e=>(0,et.jsx)(le.__experimentalToggleGroupControlOption,{...e},e.value)))})})}function UD({panelId:e,value:t={},onChange:n=(()=>{}),units:o,isShownByDefault:i=!0}){const l="auto"===t.width?"":t.width??"",r="auto"===t.height?"":t.height??"",s=e=>o=>{const i={...t};o?i[e]=o:delete i[e],n(i)};return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(le.__experimentalToolsPanelItem,{style:{gridColumn:"span 1"},label:(0,vt.__)("Width"),isShownByDefault:i,hasValue:()=>""!==l,onDeselect:s("width"),panelId:e,children:(0,et.jsx)(le.__experimentalUnitControl,{label:(0,vt.__)("Width"),placeholder:(0,vt.__)("Auto"),labelPosition:"top",units:o,min:0,value:l,onChange:s("width"),size:"__unstable-large"})}),(0,et.jsx)(le.__experimentalToolsPanelItem,{style:{gridColumn:"span 1"},label:(0,vt.__)("Height"),isShownByDefault:i,hasValue:()=>""!==r,onDeselect:s("height"),panelId:e,children:(0,et.jsx)(le.__experimentalUnitControl,{label:(0,vt.__)("Height"),placeholder:(0,vt.__)("Auto"),labelPosition:"top",units:o,min:0,value:r,onChange:s("height"),size:"__unstable-large"})})]})}const WD=[{label:(0,vt._x)("Thumbnail","Image size option for resolution control"),value:"thumbnail"},{label:(0,vt._x)("Medium","Image size option for resolution control"),value:"medium"},{label:(0,vt._x)("Large","Image size option for resolution control"),value:"large"},{label:(0,vt._x)("Full Size","Image size option for resolution control"),value:"full"}];function KD(e,t,n){if(null==e||!1===e)return;if(Array.isArray(e))return ZD(e,t,n);switch(typeof e){case"string":case"number":return}const{type:o,props:i}=e;switch(o){case p.StrictMode:case p.Fragment:return ZD(i.children,t,n);case p.RawHTML:return;case Mm.Content:return qD(t,n);case bE:return void t.push(i.value)}switch(typeof o){case"string":return void 0!==i.children?ZD(i.children,t,n):void 0;case"function":return KD(o.prototype&&"function"==typeof o.prototype.render?new o(i).render():o(i),t,n)}}function ZD(e,...t){e=Array.isArray(e)?e:[e];for(let n=0;n<e.length;n++)KD(e[n],...t)}function qD(e,t){for(let n=0;n<t.length;n++){const{name:o,attributes:i,innerBlocks:l}=t[n];KD((0,d.getSaveElement)(o,i,(0,et.jsx)(Mm.Content,{})),e,l)}}const YD=(0,le.createSlotFill)(Symbol("CommentIconSlotFill")),QD=(0,le.createSlotFill)(Symbol("CommentIconToolbarSlotFill")),XD={a:(0,vt.__)("The <a> element should be used for links that navigate to a different page or to a different section within the same page."),article:(0,vt.__)("The <article> element should represent a self-contained, syndicatable portion of the document."),aside:(0,vt.__)("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."),button:(0,vt.__)("The <button> element should be used for interactive controls that perform an action on the current page, such as opening a modal or toggling content visibility."),div:(0,vt.__)("The <div> element should only be used if the block is a design element with no semantic meaning."),footer:(0,vt.__)("The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.)."),header:(0,vt.__)("The <header> element should represent introductory content, typically a group of introductory or navigational aids."),main:(0,vt.__)("The <main> element should be used for the primary content of your document only."),nav:(0,vt.__)("The <nav> element should be used to identify groups of links that are intended to be used for website or page content navigation."),section:(0,vt.__)("The <section> element should represent a standalone portion of the document that can't be better represented by another element.")},{Tabs:JD}=fe(le.privateApis),eO=(0,p.forwardRef)((function({defaultTabId:e,onClose:t,onSelect:n,selectedTab:o,tabs:i,closeButtonLabel:l},r){return(0,et.jsx)("div",{className:"block-editor-tabbed-sidebar",children:(0,et.jsxs)(JD,{selectOnMove:!1,defaultTabId:e,onSelect:n,selectedTabId:o,children:[(0,et.jsxs)("div",{className:"block-editor-tabbed-sidebar__tablist-and-close-button",children:[(0,et.jsx)(le.Button,{className:"block-editor-tabbed-sidebar__close-button",icon:Ep,label:l,onClick:()=>t(),size:"compact"}),(0,et.jsx)(JD.TabList,{className:"block-editor-tabbed-sidebar__tablist",ref:r,children:i.map((e=>(0,et.jsx)(JD.Tab,{tabId:e.name,className:"block-editor-tabbed-sidebar__tab",children:e.title},e.name)))})]}),i.map((e=>(0,et.jsx)(JD.TabPanel,{tabId:e.name,focusable:!1,className:"block-editor-tabbed-sidebar__tabpanel",ref:e.panelRef,children:e.panel},e.name)))]})})})),{Badge:tO}=fe(le.privateApis);function nO({title:e,url:t,image:n,badges:o}){return(0,et.jsxs)(le.__experimentalHStack,{justify:"space-between",alignment:"top",children:[(0,et.jsx)(le.FlexItem,{className:"link-preview-button__content",children:(0,et.jsxs)(le.__experimentalHStack,{alignment:"top",children:[n&&(0,et.jsx)(le.FlexItem,{className:"link-preview-button__image-container",children:(0,et.jsx)("img",{className:"link-preview-button__image",src:n,alt:""})}),(0,et.jsxs)(le.__experimentalVStack,{className:"link-preview-button__details",alignment:"topLeft",children:[(0,et.jsx)(le.__experimentalTruncate,{numberOfLines:1,className:"link-preview-button__title",children:e}),t&&(0,et.jsx)(le.__experimentalTruncate,{numberOfLines:1,className:"link-preview-button__hint",children:t}),o&&o.length>0&&(0,et.jsx)(le.__experimentalHStack,{className:"link-preview-button__badges",alignment:"left",children:o.map((e=>(0,et.jsx)(tO,{intent:e.intent,children:e.label},`${e.label}|${e.intent}`)))})]})]})}),(0,et.jsx)(jc,{icon:uy,className:"link-preview-button__icon"})]})}const oO={};me(oO,{...s,ExperimentalBlockCanvas:SS,BlockCanvasCover:_S,ExperimentalBlockEditorProvider:yh,getDuotoneFilter:NT,getRichTextValues:function(e=[]){d.__unstableGetBlockProps.skipFilters=!0;const t=[];qD(t,e),d.__unstableGetBlockProps.skipFilters=!1;const n=null===un.RichTextData||void 0===un.RichTextData?void 0:un.RichTextData.fromHTMLString;return t.map((e=>un.RichTextData&&e instanceof un.RichTextData||!n?e:un.RichTextData.fromHTMLString(e)))},PrivateInserter:Xg,PrivateQuickInserter:qg,PrivateListView:lw,ResizableBoxPopover:function({clientId:e,resizableBoxProps:t,...n}){return(0,et.jsx)(p_,{clientId:e,__unstableCoverTarget:!0,__unstablePopoverSlot:"__unstable-block-tools-after",shift:!1,...n,children:(0,et.jsx)(le.ResizableBox,{...t})})},BlockInfo:PR,useCanBlockToolbarBeFocused:function(){return(0,h.useSelect)((e=>{const{__unstableGetEditorMode:t,getBlock:n,getSettings:o,getSelectedBlockClientId:i,getFirstMultiSelectedBlockClientId:l}=fe(e(ba)),r=l()||i(),s=(0,d.isUnmodifiedDefaultBlock)(n(r)||{});return!!r&&(o().hasFixedToolbar||"edit"===t()&&!s)}),[])},cleanEmptyObject:qN,usePrivateStyleOverride:eL,useStyleOverride:JN,BlockQuickNavigation:MR,LayoutStyle:Pd,BlockManager:cL,BlockRemovalWarningModal:function({rules:e}){const{clientIds:t,selectPrevious:n,blockNamesForPrompt:o,messageType:i,message:l}=(0,h.useSelect)((e=>fe(e(ba)).getRemovalPromptData())),{clearBlockRemovalPrompt:r,setBlockRemovalRules:s,privateRemoveBlocks:a}=fe((0,h.useDispatch)(ba));(0,p.useEffect)((()=>(s(e),()=>{s()})),[e,s]);let c=l;if(!l){if(!o)return;c="templates"===i?(0,vt._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,vt._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,et.jsxs)(le.Modal,{title:(0,vt.__)("Be careful!","kubio"),onRequestClose:r,size:"medium",children:[(0,et.jsx)("p",{children:c}),(0,et.jsxs)(le.__experimentalHStack,{justify:"right",children:[(0,et.jsx)(le.Button,{variant:"tertiary",onClick:r,__next40pxDefaultSize:!0,children:(0,vt.__)("Cancel")}),(0,et.jsx)(le.Button,{variant:"primary",onClick:()=>{a(t,n,!0),r()},__next40pxDefaultSize:!0,children:(0,vt.__)("Delete")})]})]})},useLayoutClasses:KA,useLayoutStyles:function(e={},t,n){var o;const{layout:i={},style:l={}}=e,r=null!=i&&i.inherit||null!=i&&i.contentSize||null!=i&&i.wideSize?{...i,type:"constrained"}:i||{},s=Bd((null==r?void 0:r.type)||"default"),[a]=wa("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:l,hasBlockGapSupport:c})},DimensionsTool:function({panelId:e,value:t={},onChange:n=(()=>{}),aspectRatioOptions:o,defaultAspectRatio:i="auto",scaleOptions:l,defaultScale:r="fill",unitsOptions:s,tools:a=["aspectRatio","widthHeight","scale"]}){const c=void 0===t.width||"auto"===t.width?null:t.width,u=void 0===t.height||"auto"===t.height?null:t.height,d=void 0===t.aspectRatio||"auto"===t.aspectRatio?null:t.aspectRatio,h=void 0===t.scale||"fill"===t.scale?null:t.scale,[g,m]=(0,p.useState)(h),[f,v]=(0,p.useState)(d),b=c&&u?"custom":f,k=d||c&&u;return(0,et.jsxs)(et.Fragment,{children:[a.includes("aspectRatio")&&(0,et.jsx)(JP,{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=r,m(r)):delete o.scale,"custom"!==e&&c&&u&&delete o.height,n(o)}}),a.includes("widthHeight")&&(0,et.jsx)(UD,{panelId:e,units:s,value:{width:c,height:u},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:f&&(i.aspectRatio=f),f||!!e==!!o?g?i.scale=g:(i.scale=r,m(r)):delete i.scale,n(i)}}),a.includes("scale")&&k&&(0,et.jsx)($D,{panelId:e,options:l,defaultValue:r,value:g,onChange:e=>{const o={...t};m(e="fill"===e?null:e),e?o.scale=e:delete o.scale,n(o)}})]})},ResolutionTool:function({panelId:e,value:t,onChange:n,options:o=WD,defaultValue:i=WD[0].value,isShownByDefault:l=!0,resetAllFilter:r}){const s=t??i;return(0,et.jsx)(le.__experimentalToolsPanelItem,{hasValue:()=>s!==i,label:(0,vt.__)("Resolution"),onDeselect:()=>n(i),isShownByDefault:l,panelId:e,resetAllFilter:r,children:(0,et.jsx)(le.SelectControl,{label:(0,vt.__)("Resolution"),value:s,options:o,onChange:n,help:(0,vt.__)("Select the size of the source image."),size:"__unstable-large"})})},TabbedSidebar:eO,TextAlignmentControl:jP,ReusableBlocksRenameHint:jg,useReusableBlocksRenameHint:function(){return(0,h.useSelect)((e=>e(Fo.store).get("core",Ig)??!0),[])},usesContextKey:wE,useFlashEditableBlocks:Ym,HTMLElementControl:function({tagName:e,onChange:t,clientId:n,options:o=[{label:(0,vt.__)("Default (<div>)"),value:"div"},{label:"<header>",value:"header"},{label:"<main>",value:"main"},{label:"<section>",value:"section"},{label:"<article>",value:"article"},{label:"<aside>",value:"aside"},{label:"<footer>",value:"footer"}]}){const i=!!n&&o.some((e=>"main"===e.value)),l=(0,h.useSelect)((e=>{if(!i)return!1;const{getClientIdsWithDescendants:t,getBlockAttributes:o}=e(ba);return t().some((e=>{var t;return e!==n&&"main"===(null===(t=o(e))||void 0===t?void 0:t.tagName)}))}),[n,i]),r=o.map((t=>"main"===t.value&&l&&"main"!==e?{...t,disabled:!0,label:(0,vt.sprintf)(/* translators: %s: HTML element name */ /* translators: %s: HTML element name */(0,vt.__)("%s (Already in use)"),t.label)}:t));return(0,et.jsxs)(le.__experimentalVStack,{spacing:2,className:"block-editor-html-element-control",children:[(0,et.jsx)(le.SelectControl,{__next40pxDefaultSize:!0,label:(0,vt.__)("HTML element"),options:r,value:e,onChange:t,help:XD[e]}),"main"===e&&l&&(0,et.jsx)(le.Notice,{status:"warning",isDismissible:!1,children:(0,vt.__)("Multiple <main> elements detected. The duplicate may be in your content or template. This is not valid HTML and may cause accessibility issues. Please change this HTML element.")})]})},globalStylesDataKey:wt,globalStylesLinksDataKey:Ct,selectBlockPatternsKey:Bt,requiresWrapperOnCopy:qh,PrivateRichText:UE,PrivateInserterLibrary:BN,reusableBlocksSelectKey:It,PrivateBlockPopover:d_,PrivatePublishDateTimePicker:VN,useSpacingSizes:pT,useBlockDisplayTitle:ip,useBlockEditingMode:HN,setBackgroundStyleDefaults:nP,sectionRootClientIdKey:jt,CommentIconSlotFill:YD,CommentIconToolbarSlotFill:QD,mediaEditKey:Et,essentialFormatKey:Tt,getMediaSelectKey:Pt,deviceTypeKey:Rt,isIsolatedEditorKey:Mt,isNavigationOverlayContextKey:Nt,useBlockElement:up,useBlockElementRef:cp,LinkPicker:function({preview:e,onSelect:t,suggestionsQuery:n,label:o,help:i}){const[l,r]=(0,p.useState)(!1),s=(0,p.useId)(),a=`link-picker-title-${s}`,c=`link-picker-description-${s}`,u=(0,p.useRef)(null),{baseControlProps:d,controlProps:h}=(0,le.useBaseControlProps)({help:i});return(0,et.jsxs)(le.BaseControl,{...d,children:[(0,et.jsx)(le.BaseControl.VisualLabel,{children:o}),(0,et.jsxs)(le.Button,{ref:u,onClick:()=>r(!l),"aria-haspopup":"dialog","aria-expanded":l,"aria-describedby":h["aria-describedby"],variant:"secondary",__next40pxDefaultSize:!0,className:"link-preview-button",children:[o&&(0,et.jsxs)(le.VisuallyHidden,{children:[o,":"]}),(0,et.jsx)(nO,{title:e.title||(0,vt.__)("Add link"),url:e.url,image:e.image,badges:e.badges})]}),l&&(0,et.jsx)(le.Popover,{anchor:u.current,onClose:()=>r(!1),placement:"left-start",offset:36,shift:!0,children:(0,et.jsxs)("div",{role:"dialog","aria-labelledby":a,"aria-describedby":c,children:[(0,et.jsxs)(le.VisuallyHidden,{children:[(0,et.jsx)("h2",{id:a,children:(0,vt.__)("Select a link")}),(0,et.jsx)("p",{id:c,children:(0,vt.__)("Search for and add a link to the navigation item.")})]}),(0,et.jsx)(kj,{value:null,onChange:e=>{if(r(!1),e){const n={url:e.url,kind:e.kind,type:e.type,id:e.id,title:e.title};t(n)}},suggestionsQuery:n,showInitialSuggestions:!0,forceIsEditingLink:!0,settings:[]})]})})]})},useRemoteUrlData:rj,PrivateBlockContext:ht,useListViewPanelState:wD,isHashLink:lt,isRelativePath:rt});const iO=oO;wp.blockEditor=a,window.isKubioBlockEditor=!0;const lO=a})(),(window.kubio=window.kubio||{}).blockEditor=o})();

Hry