File: /wordpress/core/beta/wp-includes/js/dist/script-modules/lazy-editor/index.min.js
var We=Object.create;var jt=Object.defineProperty;var Ue=Object.getOwnPropertyDescriptor;var De=Object.getOwnPropertyNames;var Ke=Object.getPrototypeOf,He=Object.prototype.hasOwnProperty;var P=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Je=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of De(e))!He.call(t,n)&&n!==o&&jt(t,n,{get:()=>e[n],enumerable:!(r=Ue(e,n))||r.enumerable});return t};var S=(t,e,o)=>(o=t!=null?We(Ke(t)):{},Je(e||!t||!t.__esModule?jt(o,"default",{value:t,enumerable:!0}):o,t));var ft=P((er,Rt)=>{Rt.exports=window.wp.editor});var N=P((or,Tt)=>{Tt.exports=window.wp.coreData});var M=P((rr,Ct)=>{Ct.exports=window.wp.data});var zt=P((nr,Lt)=>{Lt.exports=window.wp.components});var G=P((sr,Mt)=>{Mt.exports=window.wp.element});var pt=P((ur,Wt)=>{Wt.exports=window.wp.styleEngine});var Xt=P((yr,Jt)=>{Jt.exports=window.wp.i18n});var ht=P((Sr,Yt)=>{Yt.exports=window.wp.blocks});var ve=P((Ur,be)=>{be.exports=window.wp.privateApis});var Pt=P((rn,je)=>{je.exports=window.ReactJSXRuntime});var ze=P((un,Le)=>{Le.exports=window.wp.blockEditor});var Re=S(ft(),1),It=S(N(),1),Vt=S(M(),1),Te=S(zt(),1),Ce=S(G(),1);var Nt=S(N(),1),Gt=S(M(),1);function ot({templateId:t}={}){let{globalStylesId:e,stylesId:o}=(0,Gt.useSelect)(r=>{let n=r(Nt.store),s=t?n.getEntityRecord("postType","wp_template",t):null;return{globalStylesId:n.__experimentalGetCurrentGlobalStylesId(),stylesId:s?.styles_id}},[t]);return o||e}function rt(t,e,o){e=Array.isArray(e)?[...e]:[e],t=Array.isArray(t)?[...t]:{...t};let r=e.pop(),n=t;for(let s of e){let i=n[s];n=n[s]=Array.isArray(i)?[...i]:{...i}}return n[r]=o,t}var v=(t,e,o)=>{let r=Array.isArray(e)?e:e.split("."),n=t;return r.forEach(s=>{n=n?.[s]}),n??o};var Xe=["appearanceTools","useRootPaddingAwareAlignments","background.backgroundImage","background.backgroundRepeat","background.backgroundSize","background.backgroundPosition","background.gradient","border.color","border.radius","border.radiusSizes","border.style","border.width","shadow.presets","shadow.defaultPresets","color.background","color.button","color.caption","color.custom","color.customDuotone","color.customGradient","color.defaultDuotone","color.defaultGradients","color.defaultPalette","color.duotone","color.gradients","color.heading","color.link","color.palette","color.text","custom","dimensions.aspectRatio","dimensions.height","dimensions.minHeight","dimensions.minWidth","dimensions.width","dimensions.dimensionSizes","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.textIndent","typography.textTransform","typography.writingMode","viewport.mobile","viewport.tablet"];function Bt(t,e,o){let r=o?".blocks."+o:"",n=e?"."+e:"",s=`settings${r}${n}`,i=`settings${n}`;if(e)return v(t,s)??v(t,i);let a={};return Xe.forEach(l=>{let c=v(t,`settings${r}.${l}`)??v(t,`settings.${l}`);c!==void 0&&(a=rt(a,l.split("."),c))}),a}var Dt=S(pt(),1);var Ye="1600px",Ze="320px",Qe=1,qe=.25,to=.75,eo="14px";function Ut({minimumFontSize:t,maximumFontSize:e,fontSize:o,minimumViewportWidth:r=Ze,maximumViewportWidth:n=Ye,scaleFactor:s=Qe,minimumFontSizeLimit:i}){if(i=j(i)?i:eo,o){let b=j(o);if(!b?.unit||!b?.value)return null;let E=j(i,{coerceTo:b.unit});if(E?.value&&!t&&!e&&b?.value<=E?.value)return null;if(e||(e=`${b.value}${b.unit}`),!t){let _=b.unit==="px"?b.value:b.value*16,k=Math.min(Math.max(1-.075*Math.log2(_),qe),to),C=U(b.value*k,3);E?.value&&C<E?.value?t=`${E.value}${E.unit}`:t=`${C}${b.unit}`}}let a=j(t),l=a?.unit||"rem",c=j(e,{coerceTo:l});if(!a||!c)return null;let p=j(t,{coerceTo:"rem"}),u=j(n,{coerceTo:l}),f=j(r,{coerceTo:l});if(!u||!f||!p)return null;let d=u.value-f.value;if(!d)return null;let h=U(f.value/100,3),g=U(h,3)+l,m=100*((c.value-a.value)/d),y=U((m||1)*s,3),w=`${p.value}${p.unit} + ((1vw - ${g}) * ${y})`;return`clamp(${t}, ${w}, ${e})`}function j(t,e={}){if(typeof t!="string"&&typeof t!="number")return null;isFinite(t)&&(t=`${t}px`);let{coerceTo:o,rootSizeValue:r,acceptableUnits:n}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...e},s=n?.join("|"),i=new RegExp(`^(\\d*\\.?\\d+)(${s}){1,1}$`),a=t.toString().match(i);if(!a||a.length<3)return null;let[,l,c]=a,p=parseFloat(l);return o==="px"&&(c==="em"||c==="rem")&&(p=p*r,c=o),c==="px"&&(o==="em"||o==="rem")&&(p=p/r,c=o),(o==="em"||o==="rem")&&(c==="em"||c==="rem")&&(c=o),c?{value:U(p,3),unit:c}:null}function U(t,e=3){let o=Math.pow(10,e);return Math.round(t*o)/o}function dt(t){let e=t?.fluid;return e===!0||e&&typeof e=="object"&&Object.keys(e).length>0}function oo(t){let e=t?.typography??{},o=t?.layout,r=j(o?.wideSize)?o?.wideSize:null;return dt(e)&&r?{fluid:{maxViewportWidth:r,...typeof e.fluid=="object"?e.fluid:{}}}:{fluid:e?.fluid}}function nt(t,e){let{size:o}=t;if(!o||o==="0"||t?.fluid===!1||!dt(e?.typography)&&!dt(t))return o;let r=oo(e)?.fluid??{},n=Ut({minimumFontSize:typeof t?.fluid=="boolean"?void 0:t?.fluid?.min,maximumFontSize:typeof t?.fluid=="boolean"?void 0:t?.fluid?.max,fontSize:o,minimumFontSizeLimit:typeof r=="object"?r?.minFontSize:void 0,maximumViewportWidth:typeof r=="object"?r?.maxViewportWidth:void 0,minimumViewportWidth:typeof r=="object"?r?.minViewportWidth:void 0});return n||o}var R="body",K=":root";function D(t){if(!t.includes(","))return[t];let e=[],o="",r=0;for(let n of t){if(n==="(")r++;else if(n===")"&&r>0)r--;else if(n===","&&r===0){e.push(o),o="";continue}o+=n}return e.push(o),e}var H=[{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:t})=>`url( '#wp-duotone-${t}' )`,classes:[]},{path:["shadow","presets"],valueKey:"shadow",cssVarInfix:"shadow",classes:[]},{path:["typography","fontSizes"],valueFunc:(t,e)=>nt(t,e),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:t})=>t,classes:[]},{path:["border","radiusSizes"],valueKey:"size",cssVarInfix:"border-radius",classes:[]},{path:["dimensions","dimensionSizes"],valueKey:"size",cssVarInfix:"dimension",classes:[]}];function I(t,e){if(!t||!e)return e;let o=D(t),r=D(e),n=[];return o.forEach(s=>{r.forEach(i=>{n.push(`${s.trim()} ${i.trim()}`)})}),n.join(", ")}function Kt(t,e){if(!t||!e)return;let o={};return Object.entries(e).forEach(([r,n])=>{typeof n=="string"&&(o[r]=I(t,n)),typeof n=="object"&&(o[r]={},Object.entries(n).forEach(([s,i])=>{o[r][s]=I(t,i)}))}),o}function st(t,e){return t.includes(",")?D(t).map(n=>n+e).join(","):t+e}function gt(t,e){let o=`.is-style-${t}`;if(!e)return o;let r=/[^\s:]+/,n=i=>i+o;return D(e).map(i=>i.replace(r,n)).join(",")}function Ht(t,e){let o=`.is-style-${t}`,r=D(e).map(n=>{let s=n.trim(),i=`${o} `;return s.startsWith(i)?s.slice(i.length):s});return gt(t,r.join(","))}function ro(t,e){if(!t||!e)return t;if(typeof t=="object"&&"ref"in t&&t?.ref){let o=(0,Dt.getCSSValueFromRawStyle)(v(e,t.ref));return typeof o=="object"&&o!==null&&"ref"in o&&o?.ref?void 0:o===void 0?t:o}return t}function no(t,e){if(!t||!e||!Array.isArray(e))return t;let o=e.find(r=>r?.name===t);return o?.href?o?.href:t}function mt(t,e){if(!t||!e)return t;let o=ro(t,e);return typeof o=="object"&&o!==null&&"url"in o&&o?.url&&(o.url=no(o.url,e?._links?.["wp:theme-file"])),o}var $=S(ht(),1),X=S(pt(),1),me=S(M(),1);function B(t,e="root",o={}){if(!e)return null;let{fallback:r=!1}=o,{name:n,selectors:s,supports:i}=t,a=s&&Object.keys(s).length>0,l=Array.isArray(e)?e.join("."):e,c=null;if(a&&s.root?c=s?.root:i?.__experimentalSelector?c=i.__experimentalSelector:c=".wp-block-"+n.replace("core/","").replace("/","-"),l==="root")return c;let p=Array.isArray(e)?e:e.split(".");if(p.length===1){let f=r?c:null;if(a)return v(s,`${l}.root`,null)||v(s,l,null)||f;let d=i?v(i,`${l}.__experimentalSelector`,null):void 0;return d?I(c,d):f}let u;return a&&(u=v(s,l,null)),u||(r?B(t,p[0],o):null)}var so={grad:.9,turn:360,rad:360/(2*Math.PI)},T=function(t){return typeof t=="string"?t.length>0:typeof t=="number"},x=function(t,e,o){return e===void 0&&(e=0),o===void 0&&(o=Math.pow(10,e)),Math.round(o*t)/o+0},O=function(t,e,o){return e===void 0&&(e=0),o===void 0&&(o=1),t>o?o:t>e?t:e},se=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},Zt=function(t){return{r:O(t.r,0,255),g:O(t.g,0,255),b:O(t.b,0,255),a:O(t.a)}},yt=function(t){return{r:x(t.r),g:x(t.g),b:x(t.b),a:x(t.a,3)}},io=/^#([0-9a-f]{3,8})$/i,it=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},ie=function(t){var e=t.r,o=t.g,r=t.b,n=t.a,s=Math.max(e,o,r),i=s-Math.min(e,o,r),a=i?s===e?(o-r)/i:s===o?2+(r-e)/i:4+(e-o)/i:0;return{h:60*(a<0?a+6:a),s:s?i/s*100:0,v:s/255*100,a:n}},ae=function(t){var e=t.h,o=t.s,r=t.v,n=t.a;e=e/360*6,o/=100,r/=100;var s=Math.floor(e),i=r*(1-o),a=r*(1-(e-s)*o),l=r*(1-(1-e+s)*o),c=s%6;return{r:255*[r,a,i,i,l,r][c],g:255*[l,r,r,a,i,i][c],b:255*[i,i,l,r,r,a][c],a:n}},Qt=function(t){return{h:se(t.h),s:O(t.s,0,100),l:O(t.l,0,100),a:O(t.a)}},qt=function(t){return{h:x(t.h),s:x(t.s),l:x(t.l),a:x(t.a,3)}},te=function(t){return ae((o=(e=t).s,{h:e.h,s:(o*=((r=e.l)<50?r:100-r)/100)>0?2*o/(r+o)*100:0,v:r+o,a:e.a}));var e,o,r},J=function(t){return{h:(e=ie(t)).h,s:(n=(200-(o=e.s))*(r=e.v)/100)>0&&n<200?o*r/100/(n<=100?n:200-n)*100:0,l:n/2,a:e.a};var e,o,r,n},ao=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,lo=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,co=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,uo=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ee={string:[[function(t){var e=io.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?x(parseInt(t[3]+t[3],16)/255,2):1}:t.length===6||t.length===8?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:t.length===8?x(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=co.exec(t)||uo.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:Zt({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=ao.exec(t)||lo.exec(t);if(!e)return null;var o,r,n=Qt({h:(o=e[1],r=e[2],r===void 0&&(r="deg"),Number(o)*(so[r]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return te(n)},"hsl"]],object:[[function(t){var e=t.r,o=t.g,r=t.b,n=t.a,s=n===void 0?1:n;return T(e)&&T(o)&&T(r)?Zt({r:Number(e),g:Number(o),b:Number(r),a:Number(s)}):null},"rgb"],[function(t){var e=t.h,o=t.s,r=t.l,n=t.a,s=n===void 0?1:n;if(!T(e)||!T(o)||!T(r))return null;var i=Qt({h:Number(e),s:Number(o),l:Number(r),a:Number(s)});return te(i)},"hsl"],[function(t){var e=t.h,o=t.s,r=t.v,n=t.a,s=n===void 0?1:n;if(!T(e)||!T(o)||!T(r))return null;var i=(function(a){return{h:se(a.h),s:O(a.s,0,100),v:O(a.v,0,100),a:O(a.a)}})({h:Number(e),s:Number(o),v:Number(r),a:Number(s)});return ae(i)},"hsv"]]},oe=function(t,e){for(var o=0;o<e.length;o++){var r=e[o][0](t);if(r)return[r,e[o][1]]}return[null,void 0]},fo=function(t){return typeof t=="string"?oe(t.trim(),ee.string):typeof t=="object"&&t!==null?oe(t,ee.object):[null,void 0]};var St=function(t,e){var o=J(t);return{h:o.h,s:O(o.s+100*e,0,100),l:o.l,a:o.a}},bt=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},re=function(t,e){var o=J(t);return{h:o.h,s:o.s,l:O(o.l+100*e,0,100),a:o.a}},ne=(function(){function t(e){this.parsed=fo(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return this.parsed!==null},t.prototype.brightness=function(){return x(bt(this.rgba),2)},t.prototype.isDark=function(){return bt(this.rgba)<.5},t.prototype.isLight=function(){return bt(this.rgba)>=.5},t.prototype.toHex=function(){return e=yt(this.rgba),o=e.r,r=e.g,n=e.b,i=(s=e.a)<1?it(x(255*s)):"","#"+it(o)+it(r)+it(n)+i;var e,o,r,n,s,i},t.prototype.toRgb=function(){return yt(this.rgba)},t.prototype.toRgbString=function(){return e=yt(this.rgba),o=e.r,r=e.g,n=e.b,(s=e.a)<1?"rgba("+o+", "+r+", "+n+", "+s+")":"rgb("+o+", "+r+", "+n+")";var e,o,r,n,s},t.prototype.toHsl=function(){return qt(J(this.rgba))},t.prototype.toHslString=function(){return e=qt(J(this.rgba)),o=e.h,r=e.s,n=e.l,(s=e.a)<1?"hsla("+o+", "+r+"%, "+n+"%, "+s+")":"hsl("+o+", "+r+"%, "+n+"%)";var e,o,r,n,s},t.prototype.toHsv=function(){return e=ie(this.rgba),{h:x(e.h),s:x(e.s),v:x(e.v),a:x(e.a,3)};var e},t.prototype.invert=function(){return V({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},t.prototype.saturate=function(e){return e===void 0&&(e=.1),V(St(this.rgba,e))},t.prototype.desaturate=function(e){return e===void 0&&(e=.1),V(St(this.rgba,-e))},t.prototype.grayscale=function(){return V(St(this.rgba,-1))},t.prototype.lighten=function(e){return e===void 0&&(e=.1),V(re(this.rgba,e))},t.prototype.darken=function(e){return e===void 0&&(e=.1),V(re(this.rgba,-e))},t.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},t.prototype.alpha=function(e){return typeof e=="number"?V({r:(o=this.rgba).r,g:o.g,b:o.b,a:e}):x(this.rgba.a,3);var o},t.prototype.hue=function(e){var o=J(this.rgba);return typeof e=="number"?V({h:e,s:o.s,l:o.l,a:o.a}):x(o.h)},t.prototype.isEqual=function(e){return this.toHex()===V(e).toHex()},t})(),V=function(t){return t instanceof ne?t:new ne(t)};function po(t=[]){let e={r:[],g:[],b:[],a:[]};return t.forEach(o=>{let r=V(o).toRgb();e.r.push(r.r/255),e.g.push(r.g/255),e.b.push(r.b/255),e.a.push(r.a)}),e}function le(t,e){let o=po(e);return`
<svg
xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 0 0"
width="0"
height="0"
focusable="false"
role="none"
aria-hidden="true"
style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;"
>
<defs>
<filter id="${t}">
<!--
Use sRGB instead of linearRGB so transparency looks correct.
Use perceptual brightness to convert to grayscale.
-->
<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>
<!-- Use sRGB instead of linearRGB to be consistent with how CSS gradients work. -->
<feComponentTransfer color-interpolation-filters="sRGB">
<feFuncR type="table" tableValues="${o.r.join(" ")}"></feFuncR>
<feFuncG type="table" tableValues="${o.g.join(" ")}"></feFuncG>
<feFuncB type="table" tableValues="${o.b.join(" ")}"></feFuncB>
<feFuncA type="table" tableValues="${o.a.join(" ")}"></feFuncA>
</feComponentTransfer>
<!-- Re-mask the image with the original transparency since the feColorMatrix above loses that information. -->
<feComposite in2="SourceGraphic" operator="in"></feComposite>
</filter>
</defs>
</svg>`}function L(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([0-9])([a-zA-Z])/g,"$1-$2").replace(/([a-zA-Z])([0-9])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function vt(t){if(!t)return;let e=t.match(/var:preset\|spacing\|(.+)/);return e?`var(--wp--preset--spacing--${e[1]})`:t}function go(t){if(!t)return null;let e=typeof t=="string";return{top:e?t:t?.top,left:e?t:t?.left}}function wt(t,e="0"){let o=go(t);if(!o)return null;let r=vt(o?.top)||e,n=vt(o?.left)||e;return r===n?r:`${r} ${n}`}var ce={backgroundSize:"cover",backgroundPosition:"50% 50%"};function ue(t){if(!t||!t?.backgroundImage?.url)return;let e;return t?.backgroundSize||(e={backgroundSize:ce.backgroundSize}),t?.backgroundSize==="contain"&&!t?.backgroundPosition&&(e={backgroundPosition:ce.backgroundPosition}),e}var fe={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}}]}};var pe={mobile:"480px",tablet:"782px"},de=/^(\d+|\d*\.\d+)(px|em|rem)$/,mo=16;function ho(t){return"mobile"in t||"tablet"in t}function yo(t){return!t||typeof t!="object"?{}:ho(t)?t:t.settings?.viewport??{}}function So(t){return typeof t=="string"&&de.test(t.trim())}function bo(t){if(typeof t=="number")return t;if(typeof t!="string")return;let e=t.trim().match(de);if(!e)return;let o=Number.parseFloat(e[1]);return e[2]==="px"?o:o*mo}function vo(t){let e=yo(t),o={},r={};Object.keys(pe).forEach(a=>{let l=a,c=e[l],p=bo(c);p!==void 0&&So(c)&&(o[l]=c.trim(),r[l]=p)});let n=Object.keys(o);if(!n.length)return{...pe};if(n.length===1)return o;let s=o.mobile,i=o.tablet;return r.mobile>=r.tablet?{mobile:s}:{mobile:s,tablet:i}}function Et(t){let e=vo(t),o={};return e.mobile&&(o["@mobile"]=`@media (width <= ${e.mobile})`),e.tablet&&(o["@tablet"]=e.mobile?`@media (${e.mobile} < width <= ${e.tablet})`:`@media (width <= ${e.tablet})`),o}var wo={button:"wp-element-button",caption:"wp-element-caption"},Eo={__experimentalBorder:"border",color:"color",dimensions:"dimensions",spacing:"spacing",typography:"typography"},he={"core/button":[":hover",":focus",":focus-visible",":active"],"core/navigation-link":[":hover",":focus",":focus-visible",":active"]},xo={link:[":link",":any-link",":visited",":hover",":focus",":focus-visible",":active"],button:[":link",":any-link",":visited",":hover",":focus",":focus-visible",":active"]};function $o(t="*",e={}){return H.reduce((o,{path:r,cssVarInfix:n,classes:s})=>{if(!s)return o;let i=v(e,r,[]);return["default","theme","custom"].forEach(a=>{i[a]&&i[a].forEach(({slug:l})=>{s.forEach(({classSuffix:c,propertyName:p})=>{let u=`.has-${L(l)}-${c}`,f=t.split(",").map(h=>`${h}${u}`).join(","),d=`var(--wp--preset--${n}--${L(l)})`;o+=`${f}{${p}: ${d} !important;}`})})}),o},"")}function _o(t={}){return H.filter(e=>e.path.at(-1)==="duotone").flatMap(e=>{let o=v(t,e.path,{});return["default","theme"].filter(r=>o[r]).flatMap(r=>o[r].map(n=>le(`wp-duotone-${n.slug}`,n.colors))).join("")})}function ye(t={},e,o){let r=[];return Object.keys(t).forEach(n=>{let s=e+L(n.replace("/","-")),i=t[n];if(i instanceof Object){let a=s+o;r=[...r,...ye(i,a,o)]}else r.push(`${s}: ${i}`)}),r}var ko=(t,e,o)=>{if(o!=="core/paragraph"||(e?.blocks?.["core/paragraph"]?.typography?.textIndent??e?.typography?.textIndent??"subsequent")!=="all")return t;let s=".wp-block-paragraph + .wp-block-paragraph",i=".wp-block-paragraph";if(s in t){let a=t[s],l={...t};return delete l[s],l[i]=a,l}return t},Oo=(t,e)=>{let o=".wp-block-button";if(!(o in t))return t;let r={...t};return r[o]=r[o].map(n=>{let s=n.match(/^width:\s*(.+)$/);if(!s)return n;let i=s[1],a=null;i.endsWith("%")&&(a=parseFloat(i));let l="var(--wp--preset--dimension--";if(a===null&&i.startsWith(l)&&i.endsWith(")")){let c=i.slice(l.length,-1),p={...e?.dimensions?.dimensionSizes??{},...e?.blocks?.["core/button"]?.dimensions?.dimensionSizes??{}};for(let u of Object.values(p))if(Array.isArray(u)){for(let f of u)if(f.slug===c&&typeof f.size=="string"&&f.size.endsWith("%")){a=parseFloat(f.size);break}if(a!==null)break}}return a===null||isNaN(a)?n:`width: calc(${a} * 1% - (var(--wp--style--block-gap, 0.5em) * (1 - ${a} / 100)))`}),r},Po=(t,e)=>{let o={};return Object.entries(t).forEach(([r,n])=>{if(r==="root"||!e?.[r])return;let s=typeof n=="string";if(!s&&typeof n=="object"&&n!==null&&Object.entries(n).forEach(([i,a])=>{if(i==="root"||!e?.[r][i])return;let l={[r]:{[i]:e[r][i]}},c=lt(l);o[a]=[...o[a]||[],...c],delete e[r][i]}),s||typeof n=="object"&&n!==null&&"root"in n){let i=s?n:n.root,a={[r]:e[r]},l=lt(a);o[i]=[...o[i]||[],...l],delete e[r]}}),o};function lt(t={},e="",o,r={},n=!1){let s=R===e,i=Object.entries($.__EXPERIMENTAL_STYLE_PROPERTY).reduce((l,[c,{value:p,properties:u,useEngine:f,rootOnly:d}])=>{if(d&&!s)return l;let h=p;if(h[0]==="elements"||f)return l;let g=v(t,h);if(c==="--wp--style--root--padding"&&(typeof g=="string"||!o))return l;if(u&&typeof g!="string")Object.entries(u).forEach(m=>{let[y,w]=m;if(!v(g,[w],!1))return;let b=y.startsWith("--")?y:L(y);l.push(`${b}: ${(0,X.getCSSValueFromRawStyle)(v(g,[w]))}`)});else if(v(t,h,!1)){let m=c.startsWith("--")?c:L(c);l.push(`${m}: ${(0,X.getCSSValueFromRawStyle)(v(t,h))}`)}return l},[]);return t.background&&(t.background?.backgroundImage&&(t.background.backgroundImage=mt(t.background.backgroundImage,r)),!s&&t.background?.backgroundImage?.id&&(t={...t,background:{...t.background,...ue(t.background)}})),(0,X.getCSSRules)(t).forEach(l=>{if(s&&(o||n)&&l.key.startsWith("padding"))return;let c=l.key.startsWith("--")?l.key:L(l.key),p=mt(l.value,r);c==="font-size"&&(p=nt({name:"",slug:"",size:p},r?.settings)),c==="aspect-ratio"&&i.push("min-height: unset"),i.push(`${c}: ${p}`)}),i}function Io({layoutDefinitions:t=fe,style:e,selector:o,hasBlockGapSupport:r,hasFallbackGapSupport:n,fallbackGapValue:s}){let i="",a=r?wt(e?.spacing?.blockGap):"";if(n&&(o===R?a=a||"0.5em":!r&&s&&(a=s)),a&&t&&(Object.values(t).forEach(({className:l,name:c,spacingStyles:p})=>{!r&&c!=="flex"&&c!=="grid"||p?.length&&p.forEach(u=>{let f=[];if(u.rules&&Object.entries(u.rules).forEach(([d,h])=>{f.push(`${d}: ${h||a}`)}),f.length){let d="";r?d=o===R?`:root :where(.${l})${u?.selector||""}`:`:root :where(${o}-${l})${u?.selector||""}`:d=o===R?`:where(.${l}${u?.selector||""})`:`:where(${o}.${l}${u?.selector||""})`,i+=`${d} { ${f.join("; ")}; }`}})}),o===R&&r&&(i+=`${K} { --wp--style--block-gap: ${a}; }`)),o===R&&t){let l=["block","flex","grid"];Object.values(t).forEach(({className:c,displayMode:p,baseStyles:u})=>{p&&l.includes(p)&&(i+=`${o} .${c} { display:${p}; }`),u?.length&&u.forEach(f=>{let d=[];if(f.rules&&Object.entries(f.rules).forEach(([h,g])=>{d.push(`${h}: ${g}`)}),d.length){let h=`.${c}${f?.selector||""}`;i+=`${h} { ${d.join("; ")}; }`}})})}return i}var Vo=["border","color","dimensions","spacing","typography","filter","outline","shadow","background"];function Fo(t,e){return at(t,void 0,e)}function at(t,e,o){if(!t)return{};let r=Object.entries(t),n=e?he[e]??[]:[],i=r.filter(([a])=>Vo.includes(a)||n.includes(a)||o[a]).map(([a,l])=>[a,JSON.parse(JSON.stringify(l))]);return Object.fromEntries(i)}function ge(t){let{styles:e,selector:o,featureSelectors:r,name:n,elementName:s,mediaQuery:i,variationName:a}=t,l=n?he[n]??[]:xo[s??""]??[];return l.length?l.flatMap(c=>{let p=e?.[c];return!p||typeof p!="object"?[]:[{styles:JSON.parse(JSON.stringify(p)),selector:o,selectorSuffix:c,mediaQuery:i,featureSelectors:r&&typeof r!="string"?r:void 0,name:n,elementName:s,variationName:a}]}):[]}function Ao(t,e){let{styles:o,selector:r,fallbackGapValue:n,featureSelectors:s,hasLayoutSupport:i,layoutHasBlockGapSupport:a,layoutSelector:l,name:c,elementName:p,isStyleVariation:u,variationName:f}=t;return!c&&!p?[]:Object.entries(e).flatMap(([d,h])=>{let g=o?.[d];return!g||typeof g!="object"?[]:[{styles:JSON.parse(JSON.stringify(g)),selector:r,mediaQuery:h,featureSelectors:s&&typeof s!="string"?s:void 0,fallbackGapValue:n,hasLayoutSupport:i,name:c,elementName:p,isStyleVariation:u,variationName:f,layoutSelector:l,layoutHasBlockGapSupport:a}]})}var jo=(t,e)=>{let o=[];if(!t?.styles)return o;let r=Et(t),n=Fo(t.styles,r);return n&&o.push({styles:n,selector:R,skipSelectorWrapper:!0}),Object.entries($.__EXPERIMENTAL_ELEMENTS).forEach(([s,i])=>{t.styles?.elements?.[s]&&o.push({styles:t.styles?.elements?.[s]??{},selector:i,elementName:s,skipSelectorWrapper:!wo[s]})}),Object.entries(t.styles?.blocks??{}).forEach(([s,i])=>{let a=at(i,s,r),l=i,c=[],p=[];l?.variations&&Object.entries(l.variations).forEach(([u,f])=>{let d=f,h=at(d,s,r);d?.css&&(h.css=d.css);let g=typeof e!="string"?e[s]?.styleVariationSelectors?.[u]:void 0;if(g&&typeof e!="string"){let m=e[s];p.push({styles:h,selector:g,featureSelectors:m?.featureSelectors,fallbackGapValue:m?.fallbackGapValue,hasLayoutSupport:m?.hasLayoutSupport,isStyleVariation:!0,variationName:u,layoutSelector:g+m.selector,layoutHasBlockGapSupport:!0,name:s})}Object.entries(d?.elements??{}).forEach(([m,y])=>{y&&$.__EXPERIMENTAL_ELEMENTS[m]&&c.push({styles:y,selector:I(g,$.__EXPERIMENTAL_ELEMENTS[m]),elementName:m,isStyleVariation:!0})}),Object.entries(d?.blocks??{}).forEach(([m,y])=>{let w=typeof e!="string"?I(g,e[m]?.selector):void 0,b=typeof e!="string"?I(g,e[m]?.duotoneSelector):void 0,E=typeof e!="string"?Kt(g,e[m]?.featureSelectors??{}):void 0,_=at(y,m,r);y?.css&&(_.css=y.css),!(!w||typeof e=="string")&&(c.push({selector:w,name:m,isStyleVariation:!0,duotoneSelector:b,featureSelectors:E,fallbackGapValue:e[m]?.fallbackGapValue,hasLayoutSupport:e[m]?.hasLayoutSupport,styles:_}),Object.entries(y.elements??{}).forEach(([k,C])=>{C&&$.__EXPERIMENTAL_ELEMENTS[k]&&c.push({styles:C,selector:I(w,$.__EXPERIMENTAL_ELEMENTS[k]),elementName:k,isStyleVariation:!0})}))})}),typeof e!="string"&&e?.[s]?.selector&&o.push({duotoneSelector:e[s].duotoneSelector,fallbackGapValue:e[s].fallbackGapValue,hasLayoutSupport:e[s].hasLayoutSupport,selector:e[s].selector,styles:a,featureSelectors:e[s].featureSelectors,name:s}),o.push(...p),Object.entries(l?.elements??{}).forEach(([u,f])=>{typeof e!="string"&&f&&e?.[s]&&$.__EXPERIMENTAL_ELEMENTS[u]&&o.push({styles:f,selector:e[s]?.selector.split(",").map(d=>$.__EXPERIMENTAL_ELEMENTS[u].split(",").map(g=>d+" "+g)).join(","),elementName:u})}),o.push(...c)}),o},xt=(t,e)=>{let o=[];if(!t?.settings)return o;let r=i=>{let a={};return H.forEach(({path:l})=>{let c=v(i,l,!1);c!==!1&&(a=rt(a,l,c))}),a},n=r(t.settings),s=t.settings?.custom;return(Object.keys(n).length>0||s)&&o.push({presets:n,custom:s,selector:K}),Object.entries(t.settings?.blocks??{}).forEach(([i,a])=>{let l=a.custom;if(typeof e=="string"||!e[i])return;let c=r(a);(Object.keys(c).length>0||l)&&o.push({presets:c,custom:l,selector:e[i]?.selector,featureSelectors:e[i]?.featureSelectors})}),o};function Ro(t,e,o){if(!t||typeof t=="string")return o;let r=t[e];return typeof r=="string"?r:typeof r=="object"&&r.root?r.root:o}function To(t,e,{path:o,valueKey:r,valueFunc:n,cssVarInfix:s}){let i=v(t,o,[]),a=[];for(let l of["default","theme","custom"])if(i[l])for(let c of i[l]){let p=L(c.slug);r&&!n?a.push(`--wp--preset--${s}--${p}: ${c[r]}`):n&&typeof n=="function"&&a.push(`--wp--preset--${s}--${p}: ${n(c,e)}`)}return a}var Co=(t,e)=>{let o=xt(t,e),r="";for(let{presets:n,custom:s,selector:i,featureSelectors:a}of o){let l=i,c={[l]:[]};if(t?.settings)for(let u of H){let f=To(n,t.settings,u);if(f.length===0)continue;let d=Ro(a,u.path[0],l);c[d]||(c[d]=[]),c[d].push(...f)}let p=ye(s,"--wp--custom--","--");p.length>0&&c[l].push(...p);for(let[u,f]of Object.entries(c))f.length>0&&(r+=`${u}{${f.join(";")};}`)}return r};function Lo(t,{tree:e,useRootPaddingAlign:o,disableLayoutStyles:r,hasBlockGapSupport:n,hasFallbackGapSupport:s,disableRootPadding:i}){let{selector:a,selectorSuffix:l,mediaQuery:c,duotoneSelector:p,styles:u,fallbackGapValue:f,hasLayoutSupport:d,featureSelectors:h,layoutSelector:g,layoutHasBlockGapSupport:m,skipSelectorWrapper:y,name:w,variationName:b}=t,E="",_=l?st(a,l):a;if(h&&typeof h!="string"){let A=Po(h,u);A=ko(A,e.settings,w),A=Oo(A,e.settings),Object.entries(A).forEach(([W,At])=>{if(At.length){let et=b?Ht(b,W):W;et=l?st(et,l):et;let Be=At.join(";");E+=`:root :where(${et}){${Be};}`}})}if(p){let A={};u?.filter&&(A.filter=u.filter,delete u.filter);let W=lt(A);W.length&&(E+=`${p}{${W.join(";")};}`)}let k=g??_;!r&&(R===k||d)&&(E+=Io({style:u,selector:k,hasBlockGapSupport:m??n,hasFallbackGapSupport:s,fallbackGapValue:f}));let Ft=lt(u,_,o,e,i);if(Ft?.length){let A=y?_:`:root :where(${_})`;E+=`${A}{${Ft.join(";")};}`}return u?.css&&(E+=Se(u.css,`:root :where(${_})`)),c&&E?`${c}{${E}}`:E}var zo=(t,e,o,r,n=!1,s=!1,i={})=>{let a={blockGap:!0,blockStyles:!0,layoutStyles:!0,marginReset:!0,presets:!0,rootPadding:!0,variationStyles:!1,...i},l=t,c=jo(l,e),p=xt(l,e),u=l?.settings?.useRootPaddingAwareAlignments,{contentSize:f,wideSize:d}=l?.settings?.layout||{},h=a.marginReset||a.rootPadding||a.layoutStyles,g="";if(a.presets&&(f||d)&&(g+=`${K} {`,g=f?g+` --wp--style--global--content-size: ${f};`:g,g=d?g+` --wp--style--global--wide-size: ${d};`:g,g+="}"),h&&(g+=":where(body) {margin: 0;",a.rootPadding&&u&&(g+=`padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }
.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }
.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }
.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) { padding-right: 0; padding-left: 0; }
.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) > .alignfull { margin-left: 0; margin-right: 0;
`),g+="}"),a.blockStyles){let m=Et(t);c.forEach(y=>{if(y.isStyleVariation&&!a.variationStyles)return;let w=Ao(y,m);[y,...w,...ge(y),...w.flatMap(ge)].forEach(b=>{g+=Lo(b,{tree:l,useRootPaddingAlign:u,disableLayoutStyles:n,hasBlockGapSupport:o,hasFallbackGapSupport:r,disableRootPadding:s})})})}if(a.layoutStyles&&(g=g+".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",g=g+".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",g=g+".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }"),a.blockGap&&o){let m=wt(l?.styles?.spacing?.blockGap)||"0.5em";g=g+`:root :where(.wp-site-blocks) > * { margin-block-start: ${m}; margin-block-end: 0; }`,g=g+":root :where(.wp-site-blocks) > :first-child { margin-block-start: 0; }",g=g+":root :where(.wp-site-blocks) > :last-child { margin-block-end: 0; }"}return a.presets&&p.forEach(({selector:m,presets:y})=>{(R===m||K===m)&&(m="");let w=$o(m,y);w.length>0&&(g+=w)}),g};function Mo(t,e){return xt(t,e).flatMap(({presets:r})=>_o(r))}var No=(t,e)=>{if(t?.selectors&&Object.keys(t.selectors).length>0)return t.selectors;let o={root:e};return Object.entries(Eo).forEach(([r,n])=>{let s=B(t,r);s&&(o[n]=s)}),o},Go=(t,e)=>{let{getBlockStyles:o}=(0,me.select)($.store),r={};return t.forEach(n=>{let s=n.name,i=B(n);if(!i)return;let a=B(n,"filter.duotone");if(!a){let d=B(n),h=(0,$.getBlockSupport)(n,"color.__experimentalDuotone",!1);typeof h=="string"&&d&&(a=I(d,h))}let l=!!n?.supports?.layout||!!n?.supports?.__experimentalLayout,c=n?.supports?.spacing?.blockGap?.__experimentalDefault,p=o(s),u={};p?.forEach(d=>{let h=e?`-${e}`:"",g=`${d.name}${h}`,m=gt(g,i);u[g]=m});let f=No(n,i);r[s]={duotoneSelector:a??void 0,fallbackGapValue:c,featureSelectors:Object.keys(f).length?f:void 0,hasLayoutSupport:l,name:s,selector:i,styleVariationSelectors:p?.length?u:void 0}}),r};function Bo(t){let e=t.styles?.blocks,o=e?.["core/separator"];return o&&o.color?.background&&!o.color?.text&&!o.border?.color?{...t,styles:{...t.styles,blocks:{...e,"core/separator":{...o,color:{...o.color,text:o.color?.background}}}}}:t}function Se(t,e){let o="";return!t||t.trim()===""||t.split("&").forEach(n=>{if(!n||n.trim()==="")return;if(!n.includes("{"))o+=`:root :where(${e}){${n.trim()}}`;else{let i=n.replace("}","").split("{");if(i.length!==2)return;let[a,l]=i,c=a.match(/([>+~\s]*::[a-zA-Z-]+)/),p=c?c[1]:"",u=c?a.replace(p,"").trim():a.trim(),f;u===""?f=e:f=a.startsWith(" ")?I(e,u):st(e,u),o+=`:root :where(${f})${p}{${l.trim()}}`}}),o}function $t(t={},e=[],o={}){let{hasBlockGapSupport:r,hasFallbackGapSupport:n,disableLayoutStyles:s=!1,disableRootPadding:i=!1,styleOptions:a={}}=o,l=e.length>0?e:(0,$.getBlockTypes)(),c=Bt(t,"spacing.blockGap"),p=r??c!==null,u=n??!p;if(!t?.styles||!t?.settings)return[[],{}];let f=Bo(t),d=Go(l),h=Co(f,d),g=zo(f,d,p,u,s,i,a),m=Mo(f,d),y=[{css:h,isGlobalStyles:!0},{css:g,isGlobalStyles:!0},{css:f?.styles?.css??"",isGlobalStyles:!0},{assets:m,__unstableType:"svgs",isGlobalStyles:!0}];return l.forEach(w=>{let b=f?.styles?.blocks?.[w.name];if(b?.css){let{featureSelectors:E}=d[w.name],_=typeof E=="object"?E?.css:void 0,k;typeof _=="string"?k=_:typeof _=="object"&&(k=_?.root);let C=k??d[w.name].selector;y.push({css:Se(b.css,C),isGlobalStyles:!0})}}),[y,f.settings]}var ke=S(N(),1),_t=S(G(),1),Oe=S(M(),1);var we=S(N(),1),Ee=S(M(),1),xe=S(G(),1);function $e(t){let{userGlobalStyles:e}=(0,Ee.useSelect)(o=>{let{getEntityRecord:r,getEditedEntityRecord:n,canUser:s}=o(we.store),i=s("update",{kind:"root",name:"globalStyles",id:t}),a;return typeof i=="boolean"&&(i?a=n("root","globalStyles",t):a=r("root","globalStyles",t,{context:"view"})),{userGlobalStyles:a}},[t]);return(0,xe.useMemo)(()=>e?{user:e}:{user:void 0},[e])}var _e=S(ve(),1),{unlock:F}=(0,_e.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/lazy-editor");function Y({stylesId:t}){let{editorSettings:e}=(0,Oe.useSelect)(i=>({editorSettings:F(i(ke.store)).getEditorSettings()}),[]),{user:o}=$e(t),[r]=$t(o),n=!!e,s=(0,_t.useMemo)(()=>n?[...e?.styles??[],...r]:[],[n,e?.styles,r]);return{isReady:n,editorSettings:(0,_t.useMemo)(()=>({...e??{},styles:s}),[e,s])}}function Wo(t){if(!t||Object.keys(t).length===0)return;let e=document.querySelector("script#wp-importmap[type=importmap]");if(e)try{let o=JSON.parse(e.text);o.imports||(o.imports={}),o.imports={...o.imports,...t},e.text=JSON.stringify(o,null,2)}catch(o){console.error("Failed to parse or update import map:",o)}else{let o=document.createElement("script");o.type="importmap",o.id="wp-importmap",o.text=JSON.stringify({imports:t},null,2),document.head.appendChild(o)}}function Uo(t,e){return new Promise(o=>{if(!e.src){o();return}if(document.getElementById(t+"-css")){o();return}let n=document.createElement("link");n.rel="stylesheet",n.href=e.src+(e.version?"?ver="+e.version:""),n.id=t+"-css",n.media=e.media||"all",n.onload=()=>o(),n.onerror=()=>{console.error(`Failed to load stylesheet: ${t}`),o()},document.head.appendChild(n)})}function Do(t,e){if(!e.src){let r=document.createElement("script");return r.id=t+"-js",r.textContent="// Processed: "+t,r}let o=document.createElement("script");return o.src=e.src+(e.version?"?ver="+e.version:""),o.id=t+"-js",o.async=!1,o}function Pe(t,e,o){let r="";if(Array.isArray(e)?r=e.join(`
`):typeof e=="string"&&(r=e),r&&r.trim()){let n=t+"-"+o+"-inline-css";if(!document.getElementById(n)){let s=document.createElement("style");s.id=n,s.textContent=r.trim(),document.head.appendChild(s)}}}function Ie(t,e,o){let r=e;Array.isArray(r)&&(r=r.join(`
`));let n=document.createElement("script");return n.id=t+"-"+o+"-js",n.textContent=r.trim(),n}function Ve(t){let e=new Set,o=new Set,r=[];function n(s){if(!e.has(s)){if(o.has(s)){console.warn(`Circular dependency detected for handle: ${s}`);return}o.add(s),t[s]&&(t[s].deps||[]).forEach(a=>{t[a]&&n(a)}),o.delete(s),e.add(s),t[s]&&r.push(s)}}return Object.keys(t).forEach(s=>{n(s)}),r}async function Ko(t,e){let o=[];for(let r of t){if(r.src){let n=Promise.withResolvers();r.onload=()=>n.resolve(),r.onerror=()=>{console.error(`Failed to load script: ${r.id}`),n.resolve()},o.push(n.promise)}else await Promise.all(o),o=[];e.appendChild(r)}await Promise.all(o),o=[]}async function Ho(t,e,o,r,n,s){s&&Wo(s);let i=Ve(o),a=Ve(t),l=[];for(let u of i){let f=r.before?.[u];f&&Pe(u,f,"before"),l.push(Uo(u,o[u]));let d=r.after?.[u];d&&Pe(u,d,"after")}let c=[];for(let u of a){let f=e.before?.[u];f&&c.push(Ie(u,f,"before")),c.push(Do(u,t[u]));let d=e.after?.[u];d&&c.push(Ie(u,d,"after"))}let p=Ko(c,document.body);await Promise.all([Promise.all(l),p]),n&&n.length>0&&n.forEach(u=>{let f=u.match(/<script([^>]*)>(.*?)<\/script>/is);if(f){let d=f[1],h=f[2],g=document.createElement("script"),m=d.match(/id=["']([^"']+)["']/);m&&(g.id=m[1]);let y=d.match(/type=["']([^"']+)["']/);y&&(g.type=y[1]),g.textContent=h,document.body.appendChild(g)}})}var Fe=Ho;var Ot=S(N(),1),ct=S(G(),1),ut=S(M(),1);var kt;async function Ae(){return kt||(kt=(async()=>{let e=await F((0,ut.resolveSelect)(Ot.store)).getEditorAssets();await Fe(e.scripts||{},e.inline_scripts||{before:{},after:{}},e.styles||{},e.inline_styles||{before:{},after:{}},e.html_templates||[],e.script_modules||{})})()),kt}function Z(){let t=(0,ut.useSelect)(r=>F(r(Ot.store)).getEditorAssets(),[]),[e,o]=(0,ct.useState)(!1);return(0,ct.useEffect)(()=>{t&&!e&&Ae().then(()=>{o(!0)}).catch(r=>{console.error("Failed to load editor assets:",r)})},[t,e]),{isReady:!!t&&e,assetsLoaded:e}}var Q=S(Pt(),1),{Editor:Jo,BackButton:Xo}=F(Re.privateApis);function Yo({postType:t,postId:e,settings:o,backButton:r}){let n=(0,Vt.useSelect)(d=>{if(t||e)return null;let{getHomePage:h}=F(d(It.store));return h()},[t,e]),s=t||n?.postType,i=e||n?.postId,a=(0,Vt.useSelect)(d=>{if(!(!s||!i))return s==="wp_template"?i:F(d(It.store)).getTemplateId(s,i)},[s,i]),l=ot({templateId:a}),{isReady:c,editorSettings:p}=Y({stylesId:l}),{isReady:u}=Z(),f=(0,Ce.useMemo)(()=>({...p,...o}),[p,o]);return!c||!u?(0,Q.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:(0,Q.jsx)(Te.Spinner,{})}):(0,Q.jsx)(Jo,{postType:s,postId:i,templateId:a,settings:f,styles:f.styles,children:r&&(0,Q.jsx)(Xo,{children:r})})}var Me=S(Xt(),1),tt=S(G(),1),q=S(ze(),1),Ne=S(ft(),1),Ge=S(ht(),1);var z=S(Pt(),1);if(typeof document<"u"&&!document.head.querySelector("style[data-wp-hash='95327475c1']")){let t=document.createElement("style");t.setAttribute("data-wp-hash","95327475c1"),t.appendChild(document.createTextNode(".lazy-editor-block-preview__container{align-items:center;border-radius:4px;display:flex;flex-direction:column;height:100%;justify-content:center}.dataviews-view-grid .lazy-editor-block-preview__container .block-editor-block-preview__container{height:100%}.dataviews-view-table .lazy-editor-block-preview__container{text-wrap:balance;text-wrap:pretty;flex-grow:0;width:96px}")),document.head.appendChild(t)}var{useStyle:Zo}=F(Ne.privateApis);function Qo({blocks:t,content:e,description:o}){let r=(0,tt.useId)(),n=Zo("color.background"),s=(0,tt.useMemo)(()=>t??(0,Ge.parse)(e,{__unstableSkipMigrationLogs:!0}),[e,t]),i=!s?.length;return(0,z.jsxs)("div",{className:"lazy-editor-block-preview__container",style:{backgroundColor:n},"aria-describedby":o?r:void 0,children:[i&&(0,Me.__)("Empty."),!i&&(0,z.jsx)(q.BlockPreview.Async,{children:(0,z.jsx)(q.BlockPreview,{blocks:s})}),!!o&&(0,z.jsx)("div",{hidden:!0,id:r,children:o})]})}function qo({blocks:t,content:e,description:o}){let r=ot(),{isReady:n,editorSettings:s}=Y({stylesId:r}),{isReady:i}=Z(),a=(0,tt.useMemo)(()=>({...s,isPreviewMode:!0}),[s]);return!n||!i?null:(0,z.jsx)(q.BlockEditorProvider,{settings:a,children:(0,z.jsx)(Qo,{blocks:t,content:e,description:o})})}export{Yo as Editor,qo as Preview,Ae as loadEditorAssets,Z as useEditorAssets,Y as useEditorSettings};