M/others Institute for Collaboration and Art (MICA) Presents MICAfest 2024!

We did it! Thank you everyone!

MICAfest Art for Change: The M/others’ View

Northampton, MA, May 1-31, 2024

Visual/Performing/Literary Arts Festival

  • 80 m/other artists
  • Visual Art Exhibition at Northampton Center for the Arts, NEVAmuseum at Anchor House of Artists, and Bombyx Center for Arts and Equity.
  • Interdisciplinary performances at Northampton Center for the Arts at 33 Hawley and New England Visionary Artists Museum at Anchor House of Artists.

More Than Just Art: What Makes MICA Unique? (Watch Now!)

");let r=`${e.styles??""} ${e.scripts??""} ${o}`;return t=URL.createObjectURL(new Blob([r],{type:"text/html"})),rue.set(e,t),b8e?.register(e,t),t}function v8e({contentRef:e,children:t,tabIndex:o=0,scale:r=1,frameSize:n=0,readonly:i,forwardedRef:s,title:a=(0,iue.__)("Editor canvas"),...l}){let{resolvedAssets:u,isPreviewMode:d}=(0,tU.useSelect)(P=>{let O=P(C).getSettings();return{resolvedAssets:O.__unstableResolvedAssets,isPreviewMode:O.isPreviewMode}},[]),[f,p]=(0,ab.useState)(),[h,m]=(0,ab.useState)([]),[g,b,v]=eU(),y=(0,Ad.useRefEffect)(P=>{let O;function N(D){D.preventDefault()}function z(D){D.target.tagName==="A"&&D.target.getAttribute("href")?.startsWith("#")&&(D.preventDefault(),O.defaultView.location.hash=D.target.getAttribute("href").slice(1))}let{ownerDocument:V}=P;m(Array.from(V.body.classList).filter(D=>D.startsWith("admin-color-")||D.startsWith("post-type-")||D==="wp-embed-responsive"));function M(){let{contentDocument:D}=P,{documentElement:L}=D;O=D,p(D),L.classList.add("block-editor-iframe__html"),D.dir=V.dir;for(let j of eue())D.getElementById(j.id)||(D.head.appendChild(j.cloneNode(!0)),d||console.warn(`${j.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,j));O.addEventListener("dragover",N,!1),O.addEventListener("drop",N,!1),O.addEventListener("click",z)}return P.addEventListener("load",M),()=>{p(void 0),P.removeEventListener("load",M),O?.removeEventListener("dragover",N),O?.removeEventListener("drop",N),O?.removeEventListener("click",z)}},[]),{contentResizeListener:k,containerResizeListener:S,isZoomedOut:_,scaleContainerWidth:x}=oue({scale:r,frameSize:parseInt(n),iframeDocument:f}),w=(0,Ad.useDisabled)({isDisabled:!i}),T=(0,Ad.useMergeRefs)([g8e(f),e,b,w]),B=(0,Ad.useRefEffect)(P=>P.ownerDocument.defaultView?(T(P),()=>T(null)):()=>{},[T]),R=y8e(u),I=o>=0&&!d,A=(0,ic.jsxs)(ic.Fragment,{children:[I&&g,(0,ic.jsx)("iframe",{...l,style:{...l.style,height:l.style?.height,border:0},ref:(0,Ad.useMergeRefs)([s,y]),tabIndex:o,src:R,title:a,onKeyDown:P=>{if(l.onKeyDown&&l.onKeyDown(P),P.currentTarget.ownerDocument!==P.target.ownerDocument){let{stopPropagation:O}=P.nativeEvent;P.nativeEvent.stopPropagation=()=>{},P.stopPropagation(),P.nativeEvent.stopPropagation=O,aue(P,window.KeyboardEvent,P.currentTarget)}},children:f&&(0,ab.createPortal)((0,ic.jsxs)("body",{ref:B,className:K("block-editor-iframe__body","editor-styles-wrapper",...h),children:[k,(0,ic.jsx)(sue.__experimentalStyleProvider,{document:f,children:t})]}),f.documentElement)}),I&&v]});return(0,ic.jsxs)("div",{className:"block-editor-iframe__container",children:[S,(0,ic.jsx)("div",{className:K("block-editor-iframe__scale-container",_&&"is-zoomed-out"),style:{"--wp-block-editor-iframe-zoom-out-scale-container-width":_&&`${x}px`},children:A})]})}function S8e(e,t){return(0,tU.useSelect)(r=>r(C).getSettings().__internalIsInitialized,[])?(0,ic.jsx)(v8e,{...e,forwardedRef:t}):null}var LS=(0,ab.forwardRef)(S8e);var tfe=c(U(),1),jS=c(F(),1),ofe=c(Q(),1);var OA={attribute:/\[\s*(?:(?\*|[-\w\P{ASCII}]*)\|)?(?[-\w\P{ASCII}]+)\s*(?:(?\W?=)\s*(?.+?)\s*(\s(?[iIsS]))?\s*)?\]/gu,id:/#(?[-\w\P{ASCII}]+)/gu,class:/\.(?[-\w\P{ASCII}]+)/gu,comma:/\s*,\s*/g,combinator:/\s*[\s>+~]\s*/g,"pseudo-element":/::(?[-\w\P{ASCII}]+)(?:\((?¶*)\))?/gu,"pseudo-class":/:(?[-\w\P{ASCII}]+)(?:\((?¶*)\))?/gu,universal:/(?:(?\*|[-\w\P{ASCII}]*)\|)?\*/gu,type:/(?:(?\*|[-\w\P{ASCII}]*)\|)?(?[-\w\P{ASCII}]+)/gu},k8e=new Set(["combinator","comma"]);var _8e=e=>{switch(e){case"pseudo-element":case"pseudo-class":return new RegExp(OA[e].source.replace("(?\xB6*)","(?.*)"),"gu");default:return OA[e]}};function x8e(e,t){let o=0,r="";for(;t(o.push({value:i,offset:s}),"\uE000".repeat(i.length))),e=e.replace(C8e,(i,s,a,l)=>(o.push({value:i,offset:l}),`${s}${"\uE001".repeat(a.length)}${s}`));{let i=0,s;for(;(s=e.indexOf("(",i))>-1;){let a=x8e(e,s);o.push({value:a,offset:s}),e=`${e.substring(0,s)}(${"\xB6".repeat(a.length-2)})${e.substring(s+a.length)}`,i=s+a.length}}let r=w8e(e,t),n=new Set;for(let i of o.reverse())for(let s of r){let{offset:a,value:l}=i;if(!(s.pos[0]<=a&&a+l.length<=s.pos[1]))continue;let{content:u}=s,d=a-s.pos[0];s.content=u.slice(0,d)+l+u.slice(d+l.length),s.content!==u&&n.add(s)}for(let i of n){let s=_8e(i.type);if(!s)throw new Error(`Unknown token type: ${i.type}`);s.lastIndex=0;let a=s.exec(i.content);if(!a)throw new Error(`Unable to parse content for ${i.type}: ${i.content}`);Object.assign(i,a.groups)}return r}function*IA(e,t){switch(e.type){case"list":for(let o of e.list)yield*IA(o,e);break;case"complex":yield*IA(e.left,e),yield*IA(e.right,e);break;case"compound":yield*e.list.map(o=>[o,e]);break;default:yield[e,t]}}function lue(e){let t;return Array.isArray(e)?t=e:t=[...IA(e)].map(([o])=>o),t.map(o=>o.content).join("")}var Zde=c(Bde(),1),Xde=c(AA(),1),Qde=c(Ode(),1),Jde=c(Yde(),1),qde=new Map,efe=[{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)"}];function zHe(e,t){let o=oU(t),r=o.findLastIndex(({content:s,type:a})=>efe.some(l=>s===l.content&&a===l.type)),n=-1;for(let s=r+1;sd instanceof RegExp?a.match(d):a.includes(d))?a:efe.some(d=>a.startsWith(d.content))?zHe(s,a):l}}),o&&(0,Jde.default)({rootUrl:o})].filter(Boolean)).process(e,{}).css}catch(i){return i instanceof Xde.default?console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",i.message+` `+i.showSourceCode(!1)):console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",i),null}}var HHe=(e,t="",o)=>{let r=qde.get(t);return r||(r=new WeakMap,qde.set(t,r)),e.map(n=>{let i=r.get(n);return i||(i=jHe(n,t,o),r.set(n,i)),i})},zS=HHe;var fm=c(E(),1);Yf([qf,jy]);function UHe(e,t){return(0,jS.useCallback)(o=>{if(!o)return;let{ownerDocument:r}=o,{defaultView:n,body:i}=r,s=t?r.querySelector(t):i,a;if(s)a=n?.getComputedStyle(s,null).getPropertyValue("background-color");else{let u=r.createElement("div");u.classList.add("editor-styles-wrapper"),i.appendChild(u),a=n?.getComputedStyle(u,null).getPropertyValue("background-color"),i.removeChild(u)}let l=Lo(a);l.luminance()>.5||l.alpha()===0?i.classList.remove("is-dark-theme"):i.classList.add("is-dark-theme")},[e,t])}function GHe({styles:e,scope:t,transformOptions:o}){let r=(0,ofe.useSelect)(s=>H(s(C)).getStyleOverrides(),[]),[n,i]=(0,jS.useMemo)(()=>{let s=Object.values(e??[]),a=[...r.filter(([,l])=>l?.__unstableType!=="custom-css"),...r.filter(([,l])=>l?.__unstableType==="custom-css")];for(let[l,u]of a){let d=s.findIndex(({id:p})=>l===p),f={...u,id:l};d===-1?s.push(f):s[d]=f}return[zS(s.filter(l=>l?.css),t,o),s.filter(l=>l.__unstableType==="svgs").map(l=>l.assets).join("")]},[e,r,t,o]);return(0,fm.jsxs)(fm.Fragment,{children:[(0,fm.jsx)("style",{ref:UHe(n,t)}),n.map((s,a)=>(0,fm.jsx)("style",{children:s},a)),(0,fm.jsx)(tfe.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:i}})]})}var Ld=(0,jS.memo)(GHe);var Ka=c(E(),1),WHe=(0,ZA.memo)(HS),VU=2e3,$He=[];function KHe({viewportWidth:e,containerWidth:t,minHeight:o,additionalStyles:r=$He}){e||(e=t);let[n,{height:i}]=(0,RC.useResizeObserver)(),{styles:s}=(0,rfe.useSelect)(d=>({styles:d(C).getSettings().styles}),[]),a=(0,ZA.useMemo)(()=>s&&[...s,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...r],[s,r]),l=t/e,u=i?t/(i*l):0;return(0,Ka.jsx)(nfe.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${l})`,aspectRatio:u,maxHeight:i>VU?VU*l:void 0,minHeight:o},children:(0,Ka.jsxs)(LS,{contentRef:(0,RC.useRefEffect)(d=>{let{ownerDocument:{documentElement:f}}=d;f.classList.add("block-editor-block-preview__content-iframe"),f.style.position="absolute",f.style.width="100%",d.style.boxSizing="border-box",d.style.position="absolute",d.style.width="100%"},[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:e,height:i,pointerEvents:"none",maxHeight:VU,minHeight:l!==0&&l<1&&o?o/l:o},children:[(0,Ka.jsx)(Ld,{styles:a}),n,(0,Ka.jsx)(WHe,{renderAppender:!1})]})})}function ife(e){let[t,{width:o}]=(0,RC.useResizeObserver)();return(0,Ka.jsxs)(Ka.Fragment,{children:[(0,Ka.jsx)("div",{style:{position:"relative",width:"100%",height:0},children:t}),(0,Ka.jsx)("div",{className:"block-editor-block-preview__container",children:!!o&&(0,Ka.jsx)(KHe,{...e,containerWidth:o})})]})}var US=c(F(),1),cfe=c(afe(),1),lfe=(0,cfe.createQueue)();function ufe({children:e,placeholder:t}){let[o,r]=(0,US.useState)(!1);return(0,US.useEffect)(()=>{let n={};return lfe.add(n,()=>{(0,US.flushSync)(()=>{r(!0)})}),()=>{lfe.cancel(n)}},[]),o?e:t}var fb=c(E(),1),YHe=[];function qHe({blocks:e,viewportWidth:t=1200,minHeight:o,additionalStyles:r=YHe,__experimentalMinHeight:n,__experimentalPadding:i}){n&&(o=n,(0,FU.default)("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),i&&(r=[...r,{css:`body { padding: ${i}px; }`}],(0,FU.default)("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));let s=(0,zU.useSelect)(u=>u(C).getSettings(),[]),a=(0,db.useMemo)(()=>({...s,focusMode:!1,isPreviewMode:!0}),[s]),l=(0,db.useMemo)(()=>Array.isArray(e)?e:[e],[e]);return!e||e.length===0?null:(0,fb.jsx)(ES,{value:l,settings:a,children:(0,fb.jsx)(ife,{viewportWidth:t,minHeight:o,additionalStyles:r})})}var dfe=(0,db.memo)(qHe);dfe.Async=ufe;var bs=dfe;function ffe({blocks:e,props:t={},layout:o}){let r=(0,zU.useSelect)(u=>u(C).getSettings(),[]),n=(0,db.useMemo)(()=>({...r,styles:void 0,focusMode:!1,isPreviewMode:!0}),[r]),i=(0,XA.useDisabled)(),s=(0,XA.useMergeRefs)([t.ref,i]),a=(0,db.useMemo)(()=>Array.isArray(e)?e:[e],[e]),l=(0,fb.jsxs)(ES,{value:a,settings:n,children:[(0,fb.jsx)(Ld,{}),(0,fb.jsx)(BC,{renderAppender:!1,layout:o})]});return{...t,ref:s,className:K(t.className,"block-editor-block-preview__live-content","components-disabled"),children:e?.length?l:null}}var pm=c(E(),1);function ZHe({item:e}){let{name:t,title:o,icon:r,description:n,initialAttributes:i,example:s}=e,a=(0,GS.isReusableBlock)(e),l=(0,pfe.useMemo)(()=>s?(0,GS.getBlockFromExample)(t,{attributes:{...s.attributes,...i},innerBlocks:s.innerBlocks,innerContent:s.innerContent}):(0,GS.createBlock)(t,i),[t,s,i]),u=144,d=280,f=s?.viewportWidth??500,p=d/f,h=p!==0&&p<1&&u?u/p:u;return(0,pm.jsxs)("div",{className:"block-editor-inserter__preview-container",children:[(0,pm.jsx)("div",{className:"block-editor-inserter__preview",children:a||s?(0,pm.jsx)("div",{className:"block-editor-inserter__preview-content",children:(0,pm.jsx)(bs,{blocks:l,viewportWidth:f,minHeight:u,additionalStyles:[{css:` body { padding: 24px; min-height:${Math.round(h)}px; display:flex; align-items:center; } .is-root-container { width: 100%; } `}]})}):(0,pm.jsx)("div",{className:"block-editor-inserter__preview-content-missing",children:(0,mfe.__)("No preview available.")})}),!a&&(0,pm.jsx)(cC,{title:o,icon:r,description:n})]})}var hfe=ZHe;var XS=c(G(),1),Dd=c(F(),1),KU=c(fe(),1);var Bfe=c(ue(),1),Pfe=c(fe(),1);var ZS=c(F(),1),mm=c(ue(),1),Tfe=c(U(),1),PC=c(io(),1);var xfe=c(U(),1),wfe=c(F(),1);var WS=c(F(),1),gfe=c(G(),1),bfe=c(Qr(),1),yfe=c(E(),1);function XHe(e,t){let[o,r]=(0,WS.useState)(!1);return(0,WS.useEffect)(()=>{o&&(0,bfe.speak)((0,gfe.__)("Use left and right arrow keys to move through blocks"))},[o]),(0,yfe.jsx)("div",{ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{r(!0)},onBlur:n=>{!n.currentTarget.contains(n.relatedTarget)&&r(!1)},...e})}var jU=(0,WS.forwardRef)(XHe);var vfe=c(F(),1),Sfe=c(U(),1),kfe=c(E(),1);function QHe(e,t){return(0,kfe.jsx)(Sfe.Composite.Group,{role:"presentation",ref:t,...e})}var HU=(0,vfe.forwardRef)(QHe);var JA=c(U(),1),_fe=c(F(),1),QA=c(E(),1);function JHe({isFirst:e,as:t,children:o,...r},n){return(0,QA.jsx)(JA.Composite.Item,{ref:n,role:"option",accessibleWhenDisabled:!0,...r,render:i=>{let s={...i,tabIndex:e?0:i.tabIndex};return t?(0,QA.jsx)(t,{...s,children:o}):typeof o=="function"?o(s):(0,QA.jsx)(JA.Button,{__next40pxDefaultSize:!0,...s,children:o})}})}var UU=(0,_fe.forwardRef)(JHe);var GU=c(E(),1);function e7e({key:e,children:t}){return(0,GU.jsx)(wfe.Fragment,{children:t},e)}function t7e({children:e}){return(0,GU.jsx)(xfe.Composite,{focusShift:!0,focusWrap:"horizontal",render:e7e,children:e})}var $S=t7e;var Cfe=c(U(),1),t2=c(ue(),1),o2=c(Q(),1),Efe=c(F(),1);var YS=c(G(),1),KS=c(U(),1);var ac=c(E(),1);function e2({count:e,icon:t,isPattern:o,fadeWhenDisabled:r}){let n=o&&(0,YS.__)("Pattern");return(0,ac.jsx)("div",{className:"block-editor-block-draggable-chip-wrapper",children:(0,ac.jsx)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip",children:(0,ac.jsxs)(KS.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content",children:[(0,ac.jsx)(KS.FlexItem,{children:t?(0,ac.jsx)(Et,{icon:t}):n||(0,YS.sprintf)((0,YS._n)("%d block","%d blocks",e),e)}),(0,ac.jsx)(KS.FlexItem,{children:(0,ac.jsx)(Et,{icon:Hx})}),r&&(0,ac.jsx)(KS.FlexItem,{className:"block-editor-block-draggable-chip__disabled",children:(0,ac.jsx)("span",{className:"block-editor-block-draggable-chip__disabled-icon"})})]})})})}var WU=c(E(),1),o7e=({isEnabled:e,blocks:t,icon:o,children:r,pattern:n})=>{let i=t.length===1?t[0].name:void 0,s=(0,o2.useSelect)(f=>i&&f(t2.store).getBlockType(i)?.icon,[i]),{startDragging:a,stopDragging:l}=H((0,o2.useDispatch)(C)),u=(0,Efe.useMemo)(()=>n?.type===Yo.user&&n?.syncStatus!=="unsynced"?[(0,t2.createBlock)("core/block",{ref:n.id})]:void 0,[n?.type,n?.syncStatus,n?.id]);if(!e)return r({draggable:!1,onDragStart:void 0,onDragEnd:void 0});let d=u??t;return(0,WU.jsx)(Cfe.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:{type:"inserter",blocks:d},onDragStart:f=>{a();let p=new Set;for(let h of d){let m=`wp-block:${h.name}`;p.has(m)||(f.dataTransfer.items.add("",m),p.add(m))}},onDragEnd:()=>{l()},__experimentalDragComponent:(0,WU.jsx)(e2,{count:t.length,icon:o||!n&&s,isPattern:!!n}),children:({onDraggableStart:f,onDraggableEnd:p})=>r({draggable:!0,onDragStart:f,onDragEnd:p})})},qS=o7e;var Md=c(E(),1);function r7e({className:e,isFirst:t,item:o,onSelect:r,onHover:n,isDraggable:i,...s}){let a=(0,ZS.useRef)(!1),l=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},u=(0,ZS.useMemo)(()=>[(0,mm.createBlock)(o.name,o.initialAttributes,(0,mm.createBlocksFromInnerBlocksTemplate)(o.innerBlocks),o.innerContent)],[o.name,o.initialAttributes,o.innerBlocks,o.innerContent]),d=(0,mm.isReusableBlock)(o)&&o.syncStatus!=="unsynced"||(0,mm.isTemplatePart)(o);return(0,Md.jsx)(qS,{isEnabled:i&&!o.isDisabled,blocks:u,icon:o.icon,children:({draggable:f,onDragStart:p,onDragEnd:h})=>(0,Md.jsx)("div",{className:K("block-editor-block-types-list__list-item",{"is-synced":d}),draggable:f,onDragStart:m=>{a.current=!0,p&&(n(null),p(m))},onDragEnd:m=>{a.current=!1,h&&h(m)},children:(0,Md.jsxs)(UU,{isFirst:t,className:K("block-editor-block-types-list__item",e),disabled:o.isDisabled,onClick:m=>{m.preventDefault(),r(o,(0,PC.isAppleOS)()?m.metaKey:m.ctrlKey),n(null)},onKeyDown:m=>{let{keyCode:g}=m;g===PC.ENTER&&(m.preventDefault(),r(o,(0,PC.isAppleOS)()?m.metaKey:m.ctrlKey),n(null))},onMouseEnter:()=>{a.current||n(o)},onMouseLeave:()=>n(null),...s,children:[(0,Md.jsx)("span",{className:"block-editor-block-types-list__item-icon",style:l,children:(0,Md.jsx)(Et,{icon:o.icon,showColors:!0})}),(0,Md.jsx)("span",{className:"block-editor-block-types-list__item-title",children:(0,Md.jsx)(Tfe.__experimentalTruncate,{numberOfLines:3,children:o.title})})]})})})}var Rfe=(0,ZS.memo)(r7e);var IC=c(E(),1);function n7e(e,t){let o=[];for(let r=0,n=e.length;r{},children:r,label:n,isDraggable:i=!0}){let s="block-editor-block-types-list",a=(0,Pfe.useInstanceId)(Ife,s);return(0,IC.jsxs)(jU,{className:s,"aria-label":n,children:[n7e(e,3).map((l,u)=>(0,IC.jsx)(HU,{children:l.map((d,f)=>(0,IC.jsx)(Rfe,{item:d,className:(0,Bfe.getBlockMenuDefaultClassName)(d.id),onSelect:t,onHover:o,isDraggable:i&&!d.isDisabled,isFirst:u===0&&f===0,rowId:`${a}-${u}`},d.id))},u)),r]})}var pb=Ife;var Ofe=c(U(),1),Nd=c(E(),1);function i7e({title:e,icon:t,children:o}){return(0,Nd.jsxs)(Nd.Fragment,{children:[(0,Nd.jsxs)("div",{className:"block-editor-inserter__panel-header",children:[(0,Nd.jsx)("h2",{className:"block-editor-inserter__panel-title",children:e}),(0,Nd.jsx)(Ofe.Icon,{icon:t})]}),(0,Nd.jsx)("div",{className:"block-editor-inserter__panel-content",children:o})]})}var hm=i7e;var Afe=c(G(),1),$U=c(E(),1);function s7e({children:e=(0,Afe.__)("No results found.")}){return(0,$U.jsx)("div",{className:"block-editor-inserter__no-results",children:(0,$U.jsx)("p",{children:e})})}var lc=s7e;var pn=c(E(),1),a7e=e=>e.name.split("/")[0],l7e=6,c7e=[];function Lfe({items:e,collections:t,categories:o,onSelectItem:r,onHover:n,showMostUsedBlocks:i,className:s}){let a=(0,Dd.useMemo)(()=>Kc(e,"frecency","desc").slice(0,l7e),[e]),l=(0,Dd.useMemo)(()=>e.filter(m=>!m.category),[e]),u=(0,Dd.useMemo)(()=>{let m={...t};return Object.keys(t).forEach(g=>{m[g]=e.filter(b=>a7e(b)===g),m[g].length===0&&delete m[g]}),m},[e,t]);(0,Dd.useEffect)(()=>()=>n(null),[]);let d=(0,KU.useAsyncList)(o),f=o.length===d.length,p=(0,Dd.useMemo)(()=>Object.entries(t),[t]),h=(0,KU.useAsyncList)(f?p:c7e);return(0,pn.jsxs)("div",{className:s,children:[i&&e.length>3&&!!a.length&&(0,pn.jsx)(hm,{title:(0,XS._x)("Most used","blocks"),children:(0,pn.jsx)(pb,{items:a,onSelect:r,onHover:n,label:(0,XS._x)("Most used","blocks")})}),d.map(m=>{let g=e.filter(b=>b.category===m.slug);return!g||!g.length?null:(0,pn.jsx)(hm,{title:m.title,icon:m.icon,children:(0,pn.jsx)(pb,{items:g,onSelect:r,onHover:n,label:m.title})},m.slug)}),f&&l.length>0&&(0,pn.jsx)(hm,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,XS.__)("Uncategorized"),children:(0,pn.jsx)(pb,{items:l,onSelect:r,onHover:n,label:(0,XS.__)("Uncategorized")})}),h.map(([m,g])=>{let b=u[m];return!b||!b.length?null:(0,pn.jsx)(hm,{title:g.title,icon:g.icon,children:(0,pn.jsx)(pb,{items:b,onSelect:r,onHover:n,label:g.title})},m)})]})}function u7e({rootClientId:e,onInsert:t,onHover:o,showMostUsedBlocks:r},n){let[i,s,a,l]=kp(e,t);if(!i.length)return(0,pn.jsx)(lc,{});let u=[],d=[];for(let f of i)f.category!=="reusable"&&(f.isSearchOnly||(f.isAllowedInCurrentRoot?u.push(f):d.push(f)));return(0,pn.jsx)($S,{children:(0,pn.jsxs)("div",{ref:n,children:[!!u.length&&(0,pn.jsx)(pn.Fragment,{children:(0,pn.jsx)(Lfe,{items:u,categories:s,collections:a,onSelectItem:l,onHover:o,showMostUsedBlocks:r,className:"block-editor-inserter__insertable-blocks-at-selection"})}),(0,pn.jsx)(Lfe,{items:d,categories:s,collections:a,onSelectItem:l,onHover:o,showMostUsedBlocks:r,className:"block-editor-inserter__all-blocks"})]})})}var Mfe=(0,Dd.forwardRef)(u7e);var ope=c(F(),1),rpe=c(fe(),1),npe=c(U(),1),ipe=c(G(),1);var Zfe=c(U(),1),JU=c(F(),1),Xfe=c(G(),1);var r2=c(U(),1),YU=c(G(),1),Vd=c(E(),1);function d7e({selectedCategory:e,patternCategories:t,onClickCategory:o}){let r="block-editor-block-patterns-explorer__sidebar";return(0,Vd.jsx)("div",{className:`${r}__categories-list`,children:t.map(({name:n,label:i})=>(0,Vd.jsx)(r2.Button,{__next40pxDefaultSize:!0,label:i,className:`${r}__categories-list__item`,isPressed:e===n,onClick:()=>{o(n)},children:i},n))})}function f7e({searchValue:e,setSearchValue:t}){return(0,Vd.jsx)("div",{className:"block-editor-block-patterns-explorer__search",children:(0,Vd.jsx)(r2.SearchControl,{onChange:t,value:e,label:(0,YU.__)("Search"),placeholder:(0,YU.__)("Search")})})}function p7e({selectedCategory:e,patternCategories:t,onClickCategory:o,searchValue:r,setSearchValue:n}){return(0,Vd.jsxs)("div",{className:"block-editor-block-patterns-explorer__sidebar",children:[(0,Vd.jsx)(f7e,{searchValue:r,setSearchValue:n}),!r&&(0,Vd.jsx)(d7e,{selectedCategory:e,patternCategories:t,onClickCategory:o})]})}var Nfe=p7e;var Fd=c(F(),1),ok=c(G(),1),Wfe=c(fe(),1),$fe=c(U(),1),Kfe=c(Qr(),1);var Dfe=c(ue(),1),hu=c(F(),1),OC=c(U(),1);var Vfe=c(fe(),1),Ffe=c(G(),1);var ys=c(U(),1),Ya=c(G(),1),hi=c(E(),1);function QS({currentPage:e,numPages:t,changePage:o,totalItems:r}){return(0,hi.jsxs)(ys.__experimentalVStack,{className:"block-editor-patterns__grid-pagination-wrapper",children:[(0,hi.jsx)(ys.__experimentalText,{variant:"muted",children:(0,Ya.sprintf)((0,Ya._n)("%s item","%s items",r),r)}),t>1&&(0,hi.jsxs)(ys.__experimentalHStack,{expanded:!1,spacing:3,justify:"flex-start",className:"block-editor-patterns__grid-pagination",children:[(0,hi.jsxs)(ys.__experimentalHStack,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-previous",children:[(0,hi.jsx)(ys.Button,{variant:"tertiary",onClick:()=>o(1),disabled:e===1,"aria-label":(0,Ya.__)("First page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,hi.jsx)("span",{children:"\xAB"})}),(0,hi.jsx)(ys.Button,{variant:"tertiary",onClick:()=>o(e-1),disabled:e===1,"aria-label":(0,Ya.__)("Previous page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,hi.jsx)("span",{children:"\u2039"})})]}),(0,hi.jsx)(ys.__experimentalText,{variant:"muted",children:(0,Ya.sprintf)((0,Ya._x)("%1$s of %2$s","paging"),e,t)}),(0,hi.jsxs)(ys.__experimentalHStack,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-next",children:[(0,hi.jsx)(ys.Button,{variant:"tertiary",onClick:()=>o(e+1),disabled:e===t,"aria-label":(0,Ya.__)("Next page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,hi.jsx)("span",{children:"\u203A"})}),(0,hi.jsx)(ys.Button,{variant:"tertiary",onClick:()=>o(t),disabled:e===t,"aria-label":(0,Ya.__)("Last page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,hi.jsx)("span",{children:"\xBB"})})]})]})]})}var Eo=c(E(),1),m7e=({showTooltip:e,title:t,children:o})=>e?(0,Eo.jsxs)(kt.Root,{children:[(0,Eo.jsx)(kt.Trigger,{render:o}),(0,Eo.jsx)(kt.Popup,{children:t})]}):(0,Eo.jsx)(Eo.Fragment,{children:o});function zfe({id:e,isDraggable:t,pattern:o,onClick:r,onHover:n,showTitlesAsTooltip:i,category:s,isSelected:a}){let[l,u]=(0,hu.useState)(!1),{blocks:d,viewportWidth:f}=o,h=`block-editor-block-patterns-list__item-description-${(0,Vfe.useInstanceId)(zfe)}`,m=o.type===Yo.user,g=(0,hu.useMemo)(()=>!s||!t?d:(d??[]).map(b=>{let v=(0,Dfe.cloneBlock)(b);return v.attributes.metadata?.categories?.includes(s)&&(v.attributes.metadata.categories=[s]),v}),[d,t,s]);return(0,Eo.jsx)(qS,{isEnabled:t,blocks:g,pattern:o,children:({draggable:b,onDragStart:v,onDragEnd:y})=>(0,Eo.jsx)("div",{className:"block-editor-block-patterns-list__list-item",draggable:b,onDragStart:k=>{u(!0),v&&(n?.(null),v(k))},onDragEnd:k=>{u(!1),y&&y(k)},children:(0,Eo.jsx)(m7e,{showTooltip:i&&!m,title:o.title,children:(0,Eo.jsxs)(OC.Composite.Item,{render:(0,Eo.jsx)("div",{role:"option","aria-label":o.title,"aria-describedby":o.description?h:void 0,className:K("block-editor-block-patterns-list__item",{"block-editor-block-patterns-list__list-item-synced":o.type===Yo.user&&!o.syncStatus,"is-selected":a})}),id:e,onClick:()=>{r(o,d),n?.(null)},onMouseEnter:()=>{l||n?.(o)},onMouseLeave:()=>n?.(null),children:[(0,Eo.jsx)(bs.Async,{placeholder:(0,Eo.jsx)(h7e,{}),children:(0,Eo.jsx)(bs,{blocks:d,viewportWidth:f})}),(!i||m)&&(0,Eo.jsxs)(OC.__experimentalHStack,{className:"block-editor-patterns__pattern-details",spacing:2,children:[m&&!o.syncStatus&&(0,Eo.jsx)("div",{className:"block-editor-patterns__pattern-icon-wrapper",children:(0,Eo.jsx)(gt,{className:"block-editor-patterns__pattern-icon",icon:Hc})}),(0,Eo.jsx)(Bd,{render:(0,Eo.jsx)("div",{}),className:"block-editor-block-patterns-list__item-title",variant:"body-sm",children:o.title})]}),!!o.description&&(0,Eo.jsx)(bt,{id:h,children:o.description})]})})})})}function h7e(){return(0,Eo.jsx)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}function g7e({isDraggable:e,blockPatterns:t,onHover:o,onClickPattern:r,orientation:n,category:i,label:s=(0,Ffe.__)("Patterns"),showTitlesAsTooltip:a,pagingProps:l},u){let[d,f]=(0,hu.useState)(void 0),[p,h]=(0,hu.useState)(null);(0,hu.useEffect)(()=>{let g=t[0]?.name;f(g)},[t]);let m=(g,b)=>{h(g.name),r(g,b)};return(0,Eo.jsxs)(OC.Composite,{orientation:n,activeId:d,setActiveId:f,role:"listbox",className:"block-editor-block-patterns-list","aria-label":s,ref:u,children:[t.map(g=>(0,Eo.jsx)(zfe,{id:g.name,pattern:g,onClick:m,onHover:o,isDraggable:e,showTitlesAsTooltip:a,category:i,isSelected:!!p&&p===g.name},g.name)),l&&(0,Eo.jsx)(QS,{...l})]})}var gu=(0,hu.forwardRef)(g7e);var mb=c(Q(),1),Hfe=c(ue(),1),n2=c(G(),1),Ufe=c(Qr(),1),qU=c(F(),1);function jfe({destinationRootClientId:e,destinationIndex:t,rootClientId:o,registry:r}){if(o===e)return t;let n=["",...r.select(C).getBlockParents(e),e],i=n.indexOf(o);return i!==-1?r.select(C).getBlockIndex(n[i+1])+1:r.select(C).getBlockOrder(o).length}function b7e({rootClientId:e="",insertionIndex:t,clientId:o,isAppender:r,onSelect:n,shouldFocusBlock:i=!0,selectBlockOnInsert:s=!0}){let a=(0,mb.useRegistry)(),{getSelectedBlock:l,getClosestAllowedInsertionPoint:u,isBlockInsertionPointVisible:d}=H((0,mb.useSelect)(C)),{destinationRootClientId:f,destinationIndex:p}=(0,mb.useSelect)(S=>{let{getSelectedBlockClientId:_,getBlockRootClientId:x,getBlockIndex:w,getBlockOrder:T,getInsertionPoint:B}=H(S(C)),R=_(),I=e,A,P=B();return t!==void 0?A=t:P&&P.hasOwnProperty("index")?(I=P?.rootClientId?P.rootClientId:e,A=P.index):o?A=w(o):!r&&R?(I=x(R),A=w(R)+1):A=T(I).length,{destinationRootClientId:I,destinationIndex:A}},[e,t,o,r]),{replaceBlocks:h,insertBlocks:m,showInsertionPoint:g,hideInsertionPoint:b,setLastFocus:v}=H((0,mb.useDispatch)(C)),y=(0,qU.useCallback)((S,_,x=!1,w)=>{(x||i||s)&&v(null);let T=l();!r&&T&&(0,Hfe.isUnmodifiedDefaultBlock)(T,"content")?h(T.clientId,S,null,i||x?0:null,_):m(S,r||w===void 0?p:jfe({destinationRootClientId:f,destinationIndex:p,rootClientId:w,registry:a}),r||w===void 0?f:w,s,i||x?0:null,_);let B=Array.isArray(S)?S.length:1,R=(0,n2.sprintf)((0,n2._n)("%d block added.","%d blocks added.",B),B);(0,Ufe.speak)(R),n&&n(S)},[r,l,h,m,f,p,n,i,s,v,a]),k=(0,qU.useCallback)(S=>{if(S&&!d()){let _=u(S.name,f);_!==null&&g(_,jfe({destinationRootClientId:f,destinationIndex:p,rootClientId:_,registry:a}))}else b()},[u,d,g,b,f,p,a]);return[f,y,k]}var gm=b7e;var JS=c(F(),1),i2=c(ue(),1),ek=c(Q(),1),s2=c(G(),1),Gfe=c(as(),1);var y7e=(e,t,o,r)=>{let n=(0,JS.useMemo)(()=>({[mp]:!!r}),[r]),i=(0,ek.useSelect)(m=>{let{getSettings:g}=H(m(C));return g()[mT]??!1},[]),{patternCategories:s,patterns:a,userPatternCategories:l}=(0,ek.useSelect)(m=>{let{getSettings:g,__experimentalGetAllowedPatterns:b}=H(m(C)),v=g(),y=v[id];return{patterns:b(t,n),userPatternCategories:y?y(m):v.__experimentalUserPatternCategories,patternCategories:v.__experimentalBlockPatternCategories}},[t,n]),u=(0,JS.useMemo)(()=>a.filter(m=>!(m.categories?.includes("navigation")&&!i)),[a,i]),{getClosestAllowedInsertionPointForPattern:d}=H((0,ek.useSelect)(C)),f=(0,JS.useMemo)(()=>{let m=[...s];return l?.forEach(g=>{m.find(b=>b.name===g.name)||m.push(g)}),m},[s,l]),{createSuccessNotice:p}=(0,ek.useDispatch)(Gfe.store),h=(0,JS.useCallback)((m,g)=>{let b=r?t:d(m,t);if(b===null)return;let v=m.type===Yo.user&&m.syncStatus!=="unsynced"?[(0,i2.createBlock)("core/block",{ref:m.id})]:g;e((v??[]).map(y=>{let k=(0,i2.cloneBlock)(y);return k.attributes.metadata?.categories?.includes(o)&&(k.attributes.metadata.categories=[o]),k}),m.name,!1,b),p((0,s2.sprintf)((0,s2.__)('Pattern "%s" inserted.'),m.title),{type:"snackbar",id:"inserter-notice"})},[p,e,o,t,d,r]);return[u,f,h]},bm=y7e;var tk=c(F(),1),ZU=c(fe(),1),XU=c(Tt(),1),a2=20;function l2(e,t,o,r=""){let[n,i]=(0,tk.useState)(1),s=(0,ZU.usePrevious)(t),a=(0,ZU.usePrevious)(r);(s!==t||a!==r)&&n!==1&&i(1);let l=e.length,u=n-1,d=(0,tk.useMemo)(()=>e.slice(u*a2,u*a2+a2),[u,e]),f=Math.ceil(e.length/a2),p=h=>{(0,XU.getScrollContainer)(o?.current)?.scrollTo(0,0),i(h)};return(0,tk.useEffect)(function(){(0,XU.getScrollContainer)(o?.current)?.scrollTo(0,0)},[t,o]),{totalItems:l,categoryPatterns:d,numPages:f,changePage:p,currentPage:n}}var cc=c(E(),1);function v7e({filterValue:e,filteredBlockPatternsLength:t}){return e?(0,cc.jsx)($fe.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count",children:(0,ok.sprintf)((0,ok._n)("%d pattern found","%d patterns found",t),t)}):null}function S7e({searchValue:e,selectedCategory:t,patternCategories:o,rootClientId:r,onModalClose:n}){let i=(0,Fd.useRef)(),s=(0,Wfe.useDebounce)(Kfe.speak,500),[a,l]=gm({rootClientId:r,shouldFocusBlock:!0}),[u,,d]=bm(l,a,t),f=(0,Fd.useMemo)(()=>o.map(v=>v.name),[o]),p=(0,Fd.useMemo)(()=>{let v=u.filter(y=>{if(t===hg.name||t===fd.name&&y.type===Yo.user||t===lv.name&&y.blockTypes?.includes("core/post-content"))return!0;if(t==="uncategorized"){let k=y.categories?.some(S=>f.includes(S))??!1;return!y.categories?.length||!k}return y.categories?.includes(t)});return e?Dw(v,e):v},[e,u,t,f]);(0,Fd.useEffect)(()=>{if(!e)return;let v=p.length,y=(0,ok.sprintf)((0,ok._n)("%d result found.","%d results found.",v),v);s(y)},[e,s,p.length]);let h=l2(p,t,i),[m,g]=(0,Fd.useState)(e);e!==m&&(g(e),h.changePage(1));let b=!!p?.length;return(0,cc.jsxs)("div",{className:"block-editor-block-patterns-explorer__list",ref:i,children:[(0,cc.jsx)(v7e,{filterValue:e,filteredBlockPatternsLength:p.length}),(0,cc.jsx)($S,{children:b&&(0,cc.jsxs)(cc.Fragment,{children:[(0,cc.jsx)(gu,{blockPatterns:h.categoryPatterns,onClickPattern:(v,y)=>{d(v,y),n()},isDraggable:!1}),(0,cc.jsx)(QS,{...h})]})})]})}var Yfe=S7e;var QU=c(F(),1),rk=c(G(),1),qfe=c(Qr(),1);function k7e(e,t){return!e.categories||!e.categories.length?!1:e.categories.some(o=>t.some(r=>r.name===o))}function nk(e,t="all"){let[o,r]=bm(void 0,e),n=(0,QU.useMemo)(()=>t==="all"?o:o.filter(s=>!PB(s,t)),[t,o]);return(0,QU.useMemo)(()=>{let s=r.filter(a=>n.some(l=>l.categories?.includes(a.name))).sort((a,l)=>a.label.localeCompare(l.label));return n.some(a=>!k7e(a,r))&&!s.find(a=>a.name==="uncategorized")&&s.push({name:"uncategorized",label:(0,rk._x)("Uncategorized")}),n.some(a=>a.blockTypes?.includes("core/post-content"))&&s.unshift(lv),n.some(a=>a.type===Yo.user)&&s.unshift(fd),n.length>0&&s.unshift({name:hg.name,label:hg.label}),(0,qfe.speak)((0,rk.sprintf)((0,rk._n)("%d category button displayed.","%d category buttons displayed.",s.length),s.length)),s},[r,n])}var hb=c(E(),1);function _7e({initialCategory:e,rootClientId:t,onModalClose:o}){let[r,n]=(0,JU.useState)(""),[i,s]=(0,JU.useState)(e?.name),a=nk(t);return(0,hb.jsxs)("div",{className:"block-editor-block-patterns-explorer",children:[(0,hb.jsx)(Nfe,{selectedCategory:i,patternCategories:a,onClickCategory:s,searchValue:r,setSearchValue:n}),(0,hb.jsx)(Yfe,{searchValue:r,selectedCategory:i,patternCategories:a,rootClientId:t,onModalClose:o})]})}function x7e({onModalClose:e,...t}){return(0,hb.jsx)(Zfe.Modal,{title:(0,Xfe.__)("Patterns"),onRequestClose:e,isFullScreen:!0,children:(0,hb.jsx)(_7e,{onModalClose:e,...t})})}var Qfe=x7e;var ik=c(G(),1),Zo=c(U(),1);var Tn=c(E(),1);function w7e({title:e}){return(0,Tn.jsx)(Zo.__experimentalVStack,{spacing:0,children:(0,Tn.jsx)(Zo.__experimentalView,{children:(0,Tn.jsx)(Zo.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3,children:(0,Tn.jsxs)(Zo.__experimentalHStack,{spacing:2,children:[(0,Tn.jsx)(Zo.Navigator.BackButton,{style:{minWidth:24,padding:0},icon:(0,ik.isRTL)()?un:Ti,size:"small",label:(0,ik.__)("Back")}),(0,Tn.jsx)(Zo.__experimentalSpacer,{children:(0,Tn.jsx)(Zo.__experimentalHeading,{level:5,children:e})})]})})})})}function c2({categories:e,children:t,screenClassName:o}){return(0,Tn.jsxs)(Zo.Navigator,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation",children:[(0,Tn.jsx)(Zo.Navigator.Screen,{path:"/",children:(0,Tn.jsx)(Zo.__experimentalItemGroup,{children:e.map(r=>(0,Tn.jsx)(Zo.Navigator.Button,{path:`/category/${r.name}`,as:Zo.__experimentalItem,isAction:!0,children:(0,Tn.jsxs)(Zo.__experimentalHStack,{children:[(0,Tn.jsx)(Zo.FlexBlock,{children:r.label}),(0,Tn.jsx)(gt,{icon:(0,ik.isRTL)()?Ti:un})]})},r.name))})}),e.map(r=>(0,Tn.jsxs)(Zo.Navigator.Screen,{className:o,path:`/category/${r.name}`,children:[(0,Tn.jsx)(w7e,{title:(0,ik.__)("Back")}),t(r)]},r.name))]})}var qa=c(F(),1),e9=c(G(),1),uc=c(U(),1);var Ss=c(U(),1),vs=c(G(),1);var u2=c(F(),1);var Yn=c(E(),1),Jfe=e=>e!=="all"&&e!=="user",C7e=e=>e.name===fd.name,E7e=[{value:"all",label:(0,vs._x)("All","patterns")},{value:Yo.directory,label:(0,vs.__)("Pattern Directory")},{value:Yo.theme,label:(0,vs.__)("Theme & Plugins")},{value:Yo.user,label:(0,vs.__)("User")}];function epe({setPatternSyncFilter:e,setPatternSourceFilter:t,patternSyncFilter:o,patternSourceFilter:r,scrollContainerRef:n,category:i}){let s=i.name===fd.name?Yo.user:r,a=Jfe(s),l=C7e(i),u=(0,u2.useMemo)(()=>[{value:"all",label:(0,vs._x)("All","patterns")},{value:Cw.full,label:(0,vs._x)("Synced","patterns"),disabled:a},{value:Cw.unsynced,label:(0,vs._x)("Not synced","patterns"),disabled:a}],[a]);function d(f){t(f),Jfe(f)&&e("all")}return(0,Yn.jsx)(Yn.Fragment,{children:(0,Yn.jsx)(Ss.DropdownMenu,{popoverProps:{placement:"right-end"},label:(0,vs.__)("Filter patterns"),toggleProps:{size:"compact"},icon:(0,Yn.jsx)(gt,{icon:(0,Yn.jsx)(Ss.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Yn.jsx)(Ss.Path,{d:"M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z",fill:"currentColor"})})}),children:()=>(0,Yn.jsxs)(Yn.Fragment,{children:[!l&&(0,Yn.jsx)(Ss.MenuGroup,{label:(0,vs.__)("Source"),children:(0,Yn.jsx)(Ss.MenuItemsChoice,{choices:E7e,onSelect:f=>{d(f),n.current?.scrollTo(0,0)},value:s})}),(0,Yn.jsx)(Ss.MenuGroup,{label:(0,vs.__)("Type"),children:(0,Yn.jsx)(Ss.MenuItemsChoice,{choices:u,onSelect:f=>{e(f),n.current?.scrollTo(0,0)},value:o})}),(0,Yn.jsx)("div",{className:"block-editor-inserter__patterns-filter-help",children:(0,u2.createInterpolateElement)((0,vs.__)("Patterns are available from theWordPress.org Pattern Directory, bundled in the active theme, or created by users on this site. Only patterns created on this site can be synced."),{Link:(0,Yn.jsx)(Ss.ExternalLink,{href:(0,vs.__)("https://wordpress.org/patterns/")})})})]})})})}var Fi=c(E(),1),T7e=()=>{};function d2({rootClientId:e,onInsert:t,onHover:o=T7e,category:r,showTitlesAsTooltip:n}){let[i,,s]=bm(t,e,r?.name),[a,l]=(0,qa.useState)("all"),[u,d]=(0,qa.useState)("all"),f=nk(e,u),p=(0,qa.useRef)(),h=(0,qa.useMemo)(()=>i.filter(y=>PB(y,u,a)?!1:r.name===hg.name||r.name===fd.name&&y.type===Yo.user||r.name===lv.name&&y.blockTypes?.includes("core/post-content")?!0:r.name==="uncategorized"?y.categories?!y.categories.some(k=>f.some(S=>S.name===k)):!0:y.categories?.includes(r.name)),[i,f,r.name,u,a]),m=l2(h,r,p),{changePage:g}=m;(0,qa.useEffect)(()=>()=>o(null),[]);let b=(0,qa.useCallback)(y=>{l(y),g(1)},[l,g]),v=(0,qa.useCallback)(y=>{d(y),g(1)},[d,g]);return(0,Fi.jsxs)(Fi.Fragment,{children:[(0,Fi.jsxs)(uc.__experimentalVStack,{spacing:2,className:"block-editor-inserter__patterns-category-panel-header",children:[(0,Fi.jsxs)(uc.__experimentalHStack,{children:[(0,Fi.jsx)(uc.FlexBlock,{children:(0,Fi.jsx)(uc.__experimentalHeading,{className:"block-editor-inserter__patterns-category-panel-title",size:13,level:4,as:"div",children:r.label})}),(0,Fi.jsx)(epe,{patternSyncFilter:a,patternSourceFilter:u,setPatternSyncFilter:b,setPatternSourceFilter:v,scrollContainerRef:p,category:r})]}),!h.length&&(0,Fi.jsx)(uc.__experimentalText,{variant:"muted",className:"block-editor-inserter__patterns-category-no-results",children:(0,e9.__)("No results found")})]}),h.length>0&&(0,Fi.jsxs)(Fi.Fragment,{children:[(0,Fi.jsx)(uc.__experimentalText,{size:"12",as:"p",className:"block-editor-inserter__help-text",children:(0,e9.__)("Drag and drop patterns into the canvas.")}),(0,Fi.jsx)(gu,{ref:p,blockPatterns:m.categoryPatterns,onClickPattern:s,onHover:o,label:r.label,orientation:"vertical",category:r.name,isDraggable:!0,showTitlesAsTooltip:n,patternFilter:u,pagingProps:m})]})]})}var p2=c(fe(),1),m2=c(U(),1),tpe=c(F(),1);var gb=c(E(),1),{Tabs:f2}=H(m2.privateApis);function R7e({categories:e,selectedCategory:t,onSelectCategory:o,children:r}){let s={type:"tween",duration:(0,p2.useReducedMotion)()?0:.25,ease:[.6,0,.4,1]},a=(0,p2.usePrevious)(t),l=t?t.name:null,[u,d]=(0,tpe.useState)(),f=e?.[0]?.name;return l===null&&!u&&f&&d(f),(0,gb.jsxs)(f2,{selectOnMove:!1,selectedTabId:l,orientation:"vertical",onSelect:p=>{o(e.find(h=>h.name===p))},activeTabId:u,onActiveTabIdChange:d,children:[(0,gb.jsx)(f2.TabList,{className:"block-editor-inserter__category-tablist",children:e.map(p=>(0,gb.jsx)(f2.Tab,{tabId:p.name,"aria-current":p===t?"true":void 0,children:p.label},p.name))}),e.map(p=>(0,gb.jsx)(f2.TabPanel,{tabId:p.name,focusable:!1,children:(0,gb.jsx)(m2.__unstableMotion.div,{className:"block-editor-inserter__category-panel",initial:a?"open":"closed",animate:"open",variants:{open:{transform:"translateX( 0 )",transitionEnd:{zIndex:"1"}},closed:{transform:"translateX( -100% )",zIndex:"-1"}},transition:s,children:r})},p.name))]})}var h2=R7e;var Zs=c(E(),1);function B7e({onSelectCategory:e,selectedCategory:t,onInsert:o,rootClientId:r,children:n}){let[i,s]=(0,ope.useState)(!1),a=nk(r),l=(0,rpe.useViewportMatch)("medium","<");return a.length?(0,Zs.jsxs)(Zs.Fragment,{children:[!l&&(0,Zs.jsxs)("div",{className:"block-editor-inserter__block-patterns-tabs-container",children:[(0,Zs.jsx)(h2,{categories:a,selectedCategory:t,onSelectCategory:e,children:n}),(0,Zs.jsx)(npe.Button,{__next40pxDefaultSize:!0,className:"block-editor-inserter__patterns-explore-button",onClick:()=>s(!0),variant:"secondary",children:(0,ipe.__)("Explore all patterns")})]}),l&&(0,Zs.jsx)(c2,{categories:a,children:u=>(0,Zs.jsx)("div",{className:"block-editor-inserter__category-panel",children:(0,Zs.jsx)(d2,{onInsert:o,rootClientId:r,category:u},u.name)})}),i&&(0,Zs.jsx)(Qfe,{initialCategory:t||a[0],patternCategories:a,onModalClose:()=>s(!1),rootClientId:r})]}):(0,Zs.jsx)(lc,{})}var spe=B7e;var Epe=c(G(),1),Tpe=c(fe(),1),Rpe=c(U(),1),sk=c(F(),1);var vu=c(U(),1),fr=c(G(),1),bi=c(F(),1),LC=c(fe(),1),xpe=c(Q(),1),wpe=c(Tt(),1),Cpe=c(as(),1);var mpe=c(U(),1),hpe=c(G(),1);var dr=c(U(),1),gi=c(G(),1),bu=c(F(),1),o9=c(ue(),1);var AC=c(Q(),1),upe=c(as(),1),dpe=c(t9(),1),fpe=c(Fs(),1);var lpe=c(ue(),1),cpe=c(E(),1),P7e={image:"img",video:"video",audio:"audio"};function g2(e,t){let o={id:e.id||void 0,caption:e.caption||void 0},r=e.url,n=e.alt||void 0;t==="image"?(o.url=r,o.alt=n):["video","audio"].includes(t)&&(o.src=r);let i=P7e[t],s=(0,cpe.jsx)(i,{src:e.previewUrl||r,alt:n,controls:t==="audio"?!0:void 0,inert:"true",onError:({currentTarget:a})=>{a.src===e.previewUrl&&(a.src=r)}});return[(0,lpe.createBlock)(`core/${t}`,o),s]}var Yt=c(E(),1),I7e=["image"],O7e={placement:"bottom-end",className:"block-editor-inserter__media-list__item-preview-options__popover"};function A7e({category:e,media:t,onDetach:o}){if(!e.getReportUrl&&!o)return null;let r=e.getReportUrl?.(t);return(0,Yt.jsx)(dr.DropdownMenu,{className:"block-editor-inserter__media-list__item-preview-options",label:(0,gi.__)("Options"),popoverProps:O7e,icon:zs,children:()=>(0,Yt.jsxs)(dr.MenuGroup,{children:[r&&(0,Yt.jsx)(dr.MenuItem,{onClick:()=>window.open(r,"_blank").focus(),icon:w3,children:(0,gi.sprintf)((0,gi.__)("Report %s"),e.mediaType)}),o&&(0,Yt.jsx)(dr.MenuItem,{onClick:()=>o(t),icon:is,children:e.postTypeLabel?(0,gi.sprintf)((0,gi.__)("Detach from %s"),e.postTypeLabel):(0,gi.__)("Detach from post")})]})})}function L7e({onClose:e,onSubmit:t}){return(0,Yt.jsxs)(dr.Modal,{title:(0,gi.__)("Insert external image"),onRequestClose:e,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal",children:[(0,Yt.jsxs)(dr.__experimentalVStack,{spacing:3,children:[(0,Yt.jsx)("p",{children:(0,gi.__)("This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.")}),(0,Yt.jsx)("p",{children:(0,gi.__)("External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation.")})]}),(0,Yt.jsxs)(dr.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,Yt.jsx)(dr.FlexItem,{children:(0,Yt.jsx)(dr.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:e,children:(0,gi.__)("Cancel")})}),(0,Yt.jsx)(dr.FlexItem,{children:(0,Yt.jsx)(dr.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:t,children:(0,gi.__)("Insert")})})]})]})}function ppe({media:e,onClick:t,onDetach:o,category:r}){let[n,i]=(0,bu.useState)(!1),[s,a]=(0,bu.useState)(!1),[l,u]=(0,bu.useState)(!1),[d,f]=(0,bu.useMemo)(()=>g2(e,r.mediaType),[e,r.mediaType]),{createErrorNotice:p,createSuccessNotice:h}=(0,AC.useDispatch)(upe.store),{getSettings:m,getBlock:g}=(0,AC.useSelect)(C),{updateBlockAttributes:b}=(0,AC.useDispatch)(C),v=(0,bu.useCallback)(_=>{if(l)return;let x=m(),w=(0,o9.cloneBlock)(_),{id:T,url:B,caption:R}=w.attributes;if(!T&&!x.mediaUpload){i(!0);return}if(T){t(w);return}u(!0),window.fetch(B).then(I=>I.blob()).then(I=>{let A=(0,fpe.getFilename)(B)||"image.jpg",P=new File([I],A,{type:I.type});x.mediaUpload({filesList:[P],additionalData:{caption:R},onFileChange([O]){(0,dpe.isBlobURL)(O.url)||(g(w.clientId)?b(w.clientId,{...w.attributes,id:O.id,url:O.url}):(t({...w,attributes:{...w.attributes,id:O.id,url:O.url}}),h((0,gi.__)("Image uploaded and inserted."),{type:"snackbar",id:"inserter-notice"})),u(!1))},allowedTypes:I7e,onError(O){p(O,{type:"snackbar",id:"inserter-notice"}),u(!1)}})}).catch(()=>{i(!0),u(!1)})},[l,m,t,h,b,p,g]),y=typeof e.title=="string"?e.title:e.title?.rendered||(0,gi.__)("no title"),k=(0,bu.useCallback)(()=>a(!0),[]),S=(0,bu.useCallback)(()=>a(!1),[]);return(0,Yt.jsxs)(Yt.Fragment,{children:[(0,Yt.jsx)(qS,{isEnabled:!0,blocks:[d],children:({draggable:_,onDragStart:x,onDragEnd:w})=>(0,Yt.jsx)("div",{className:K("block-editor-inserter__media-list__list-item",{"is-hovered":s}),draggable:_,onDragStart:x,onDragEnd:w,children:(0,Yt.jsxs)("div",{onMouseEnter:k,onMouseLeave:S,children:[(0,Yt.jsxs)(kt.Root,{children:[(0,Yt.jsx)(kt.Trigger,{render:(0,Yt.jsx)(dr.Composite.Item,{render:(0,Yt.jsx)("div",{"aria-label":y,role:"option",className:"block-editor-inserter__media-list__item"}),onClick:()=>v(d),children:(0,Yt.jsxs)("div",{className:"block-editor-inserter__media-list__item-preview",children:[f,l&&(0,Yt.jsx)("div",{className:"block-editor-inserter__media-list__item-preview-spinner",children:(0,Yt.jsx)(dr.Spinner,{})})]})})}),(0,Yt.jsx)(kt.Popup,{children:y})]}),!l&&(0,Yt.jsx)(A7e,{category:r,media:e,onDetach:o})]})})}),n&&(0,Yt.jsx)(L7e,{onClose:()=>i(!1),onSubmit:()=>{t((0,o9.cloneBlock)(d)),h((0,gi.__)("Image inserted."),{type:"snackbar",id:"inserter-notice"}),i(!1)}})]})}var r9=c(E(),1);function M7e({mediaList:e,category:t,onClick:o,onDetach:r,label:n=(0,hpe.__)("Media List")}){return(0,r9.jsx)(mpe.Composite,{role:"listbox",className:"block-editor-inserter__media-list","aria-label":n,children:e.map((i,s)=>(0,r9.jsx)(ppe,{media:i,category:t,onClick:o,onDetach:r},i.id||i.sourceId||s))})}var gpe=M7e;var bpe=c(U(),1),N7e=()=>null,yu=(0,bpe.withFilters)("editor.MediaUpload")(N7e);var ype=c(Q(),1);function D7e({fallback:e=null,children:t}){return(0,ype.useSelect)(r=>{let{getSettings:n}=r(C);return!!n().mediaUpload},[])?t:e}var Xs=D7e;var zi=c(F(),1),n9=c(Q(),1);function vpe(e){return Array.isArray(e)?{mediaItems:e}:{mediaItems:e?.mediaItems??[],totalItems:e?.totalItems,totalPages:e?.totalPages}}function Spe(e,t={},o){let[r,n]=(0,zi.useState)(),[i,s]=(0,zi.useState)({}),[a,l]=(0,zi.useState)(!1),u=(0,zi.useRef)(),d=(0,zi.useRef)(),f=(0,zi.useRef)(),p=(0,zi.useRef)();return(0,zi.useEffect)(()=>{(async()=>{let h=JSON.stringify({category:e.name,...t}),m={};u.current=m,l(!0),(d.current!==h||f.current!==e.fetch)&&n([]),(p.current!==e.name||f.current!==e.fetch)&&s({}),d.current=h,f.current=e.fetch,p.current=e.name;let{page:g,...b}=t,v=g>1?t:b,{mediaItems:y,totalItems:k,totalPages:S}=vpe(await e.fetch?.(v));m===u.current&&(n(y),s({totalItems:k,totalPages:S}),l(!1))})()},[e.name,e.fetch,...Object.values(t),o]),{mediaList:r,isLoading:a,totalItems:i.totalItems,totalPages:i.totalPages}}function kpe(e,t=400){let[o,r]=(0,zi.useState)(!1);return(0,zi.useEffect)(()=>{if(!e)return;let n=setTimeout(()=>r(!0),t);return()=>{clearTimeout(n),r(!1)}},[e,t]),o}function _pe(e){let[t,o]=(0,zi.useState)([]),r=(0,n9.useSelect)(a=>H(a(C)).getInserterMediaCategories(),[]),{canInsertImage:n,canInsertVideo:i,canInsertAudio:s}=(0,n9.useSelect)(a=>{let{canInsertBlockType:l}=a(C);return{canInsertImage:l("core/image",e),canInsertVideo:l("core/video",e),canInsertAudio:l("core/audio",e)}},[e]);return(0,zi.useEffect)(()=>{(async()=>{let a=[];if(!r)return;let l=new Map(await Promise.all(r.map(async d=>{if(d.isExternalResource)return[d.name,!0];let f=[];try{let{mediaItems:p}=vpe(await d.fetch({per_page:1}));f=p}catch{}return[d.name,!!f.length]}))),u={image:n,video:i,audio:s};r.forEach(d=>{u[d.mediaType]&&(l.get(d.name)||d.emptyMessage)&&a.push(d)}),a.length&&o(a)})()},[n,i,s,r]),t}var on=c(E(),1),V7e=20,F7e=["image"];function z7e({onSelect:e}){return(0,on.jsx)(Xs,{children:(0,on.jsx)(yu,{multiple:"add",onSelect:e,allowedTypes:F7e,title:(0,fr.__)("Attach images"),render:({open:t})=>(0,on.jsx)(vu.Button,{__next40pxDefaultSize:!0,className:"block-editor-inserter__media-panel-attach","data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal",onClick:o=>{o.target.focus(),t()},variant:"secondary",children:(0,fr.__)("Attach images")})})})}function MC({rootClientId:e,onInsert:t,category:o}){let[r,n,i]=(0,LC.useDebouncedInput)(),[s,a]=(0,bi.useState)(1),l=(0,LC.usePrevious)(o.name),u=(0,LC.usePrevious)(i);(l!==o.name||u!==i)&&s!==1&&a(1);let d=(0,bi.useMemo)(()=>({per_page:V7e,page:s,search:i}),[s,i]),[f,p]=(0,bi.useState)(0),{mediaList:h,isLoading:m,totalItems:g,totalPages:b}=Spe(o,d,f),v=b||1;typeof b=="number"&&s>v&&a(v);let y=!o.isExternalResource,k=y?o.attach:void 0,S=y?o.detach:void 0,_=y?o.subscribe:void 0,x=v>1,w=x||!!k,T=(0,bi.useRef)(),B=(0,bi.useCallback)(q=>{(0,wpe.getScrollContainer)(T.current)?.scrollTo(0,0),a(q)},[]),{createErrorNotice:R,createSuccessNotice:I,createWarningNotice:A}=(0,xpe.useDispatch)(Cpe.store),P=kpe(m),O=(0,bi.useCallback)(()=>{y&&o.invalidate?.(d),p(q=>q+1)},[o,d,y]);(0,bi.useEffect)(()=>{if(_)return _(()=>p(q=>q+1),d)},[_,d]);let N=(0,bi.useCallback)(async q=>{try{let J=await k(q);if(!J){A((0,fr.__)("No images were attached."),{type:"snackbar",id:"inserter-notice"});return}O(),I(o.postTypeLabel?(0,fr.sprintf)((0,fr._n)("%1$d image attached to %2$s.","%1$d images attached to %2$s.",J),J,o.postTypeLabel):(0,fr.sprintf)((0,fr._n)("%d image attached to post.","%d images attached to post.",J),J),{type:"snackbar",id:"inserter-notice"})}catch{R((0,fr.__)("Could not attach images."),{type:"snackbar",id:"inserter-notice"})}},[k,o,O,R,I,A]),z=(0,bi.useCallback)(async q=>{try{await S(q),O(),I(o.postTypeLabel?(0,fr.sprintf)((0,fr.__)("Image detached from %s."),o.postTypeLabel):(0,fr.__)("Image detached from post."),{type:"snackbar",id:"inserter-notice"})}catch{R((0,fr.__)("Could not detach image."),{type:"snackbar",id:"inserter-notice"})}},[S,o,O,R,I]),[V,M]=(0,bi.useState)(),D=(0,bi.useCallback)(()=>{let q=V;M(void 0),z(q)},[z,V]),L="block-editor-inserter__media-panel",j=o.labels.search_items||(0,fr.__)("Search");return(0,on.jsxs)("div",{ref:T,className:K(L,{"has-footer":w}),children:[(0,on.jsx)(vu.SearchControl,{className:`${L}-search`,onChange:n,value:r,label:j,placeholder:j}),m&&!h?.length&&(0,on.jsx)("div",{className:`${L}-spinner`,children:(0,on.jsx)(vu.Spinner,{})}),!m&&!h?.length&&(0,on.jsx)(lc,{children:o.emptyMessage&&!i?o.emptyMessage:(0,fr.__)("No results found.")}),!!h?.length&&(0,on.jsx)("div",{className:K(`${L}-results`,{"is-loading":P}),"aria-busy":P,children:(0,on.jsx)(gpe,{rootClientId:e,onClick:t,onDetach:S?M:void 0,mediaList:h,category:o})}),w&&(0,on.jsxs)(Qe,{direction:"column",gap:"sm",className:`${L}-footer`,children:[x&&(0,on.jsx)(QS,{currentPage:s,numPages:v,changePage:B,totalItems:g}),k&&(0,on.jsx)(z7e,{onSelect:N})]}),V&&(0,on.jsxs)(vu.Modal,{title:(0,fr.__)("Detach image"),onRequestClose:()=>M(void 0),overlayClassName:`${L}-detach-modal`,children:[(0,on.jsx)("p",{children:o.postTypeLabel?(0,fr.sprintf)((0,fr.__)("Detach this image from the current %s? The image will remain in the Media Library."),o.postTypeLabel):(0,fr.__)("Detach this image from the current post? The image will remain in the Media Library.")}),(0,on.jsxs)("div",{className:`${L}-detach-actions`,children:[(0,on.jsx)(vu.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>M(void 0),children:(0,fr.__)("Cancel")}),(0,on.jsx)(vu.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:D,children:(0,fr.__)("Detach")})]})]})]})}var Qs=c(E(),1),j7e=["image","video","audio"];function H7e({rootClientId:e,selectedCategory:t,onSelectCategory:o,onInsert:r,children:n}){let i=_pe(e),s=(0,Tpe.useViewportMatch)("medium","<"),a="block-editor-inserter__media-tabs",l=(0,sk.useCallback)(d=>{if(!d?.url)return;let f=window.__experimentalDataViewsMediaModal&&d.mime_type?d.mime_type.split("/")[0]:d.type,[p]=g2(d,f);r(p)},[r]),u=(0,sk.useMemo)(()=>i.map(d=>({...d,label:d.labels.name})),[i]);return(0,sk.useEffect)(()=>{if(!t)return;let d=u.find(f=>f.name===t.name);d&&d!==t?o(d):d||o(null)},[u,o,t]),u.length?(0,Qs.jsxs)(Qs.Fragment,{children:[!s&&(0,Qs.jsxs)("div",{className:`${a}-container`,children:[(0,Qs.jsx)(h2,{categories:u,selectedCategory:t,onSelectCategory:o,children:n}),(0,Qs.jsx)(Xs,{children:(0,Qs.jsx)(yu,{multiple:!1,onSelect:l,allowedTypes:j7e,render:({open:d})=>(0,Qs.jsx)(Rpe.Button,{__next40pxDefaultSize:!0,onClick:f=>{f.target.focus(),d()},className:"block-editor-inserter__media-library-button",variant:"secondary","data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal",children:(0,Epe.__)("Open Media Library")})})})]}),s&&(0,Qs.jsx)(c2,{categories:u,screenClassName:"block-editor-inserter__media-mobile-screen",children:d=>(0,Qs.jsx)(MC,{onInsert:r,rootClientId:e,category:d})})]}):(0,Qs.jsx)(lc,{})}var i9=H7e;var NC=c(F(),1),ym=c(G(),1);var y2=c(fe(),1),Ipe=c(Qr(),1),Ope=c(Q(),1);var Bpe=c(U(),1),{Fill:Ppe,Slot:U7e}=(0,Bpe.createSlotFill)("__unstableInserterMenuExtension");Ppe.Slot=U7e;var b2=Ppe;var ks=c(E(),1),G7e=9,W7e=[];function $7e({filterValue:e,onSelect:t,onHover:o,onHoverPattern:r,rootClientId:n,clientId:i,isAppender:s,__experimentalInsertionIndex:a,maxBlockPatterns:l,maxBlockTypes:u,showBlockDirectory:d=!1,isDraggable:f=!0,shouldFocusBlock:p=!0,prioritizePatterns:h,selectBlockOnInsert:m,isQuick:g}){let b=(0,y2.useDebounce)(Ipe.speak,500),{prioritizedBlocks:v}=(0,Ope.useSelect)(V=>({prioritizedBlocks:V(C).getBlockListSettings(n)?.prioritizedInserterBlocks||W7e}),[n]),[y,k]=gm({onSelect:t,rootClientId:n,clientId:i,isAppender:s,insertionIndex:a,shouldFocusBlock:p,selectBlockOnInsert:m}),[S,_,x,w]=kp(y,k,g),[T,,B]=bm(k,y,void 0,g),R=(0,NC.useMemo)(()=>{if(l===0)return[];let V=Dw(T,e);return l!==void 0?V.slice(0,l):V},[e,T,l]),I=u;h&&R.length>2&&(I=0);let A=(0,NC.useMemo)(()=>{if(I===0)return[];let V=S.filter(L=>L.name!=="core/block"),M=Kc(V,"frecency","desc");!e&&v.length&&(M=tP(M,v));let D=QB(M,_,x,e);return I!==void 0?D.slice(0,I):D},[e,S,_,x,I,v]);(0,NC.useEffect)(()=>{if(!e)return;let V=A.length+R.length,M=(0,ym.sprintf)((0,ym._n)("%d result found.","%d results found.",V),V);b(M)},[e,b,A,R]);let P=(0,y2.useAsyncList)(A,{step:G7e}),O=A.length>0||R.length>0,N=!!A.length&&(0,ks.jsx)(hm,{title:(0,ks.jsx)(bt,{children:(0,ym.__)("Blocks")}),children:(0,ks.jsx)(pb,{items:P,onSelect:w,onHover:o,label:(0,ym.__)("Blocks"),isDraggable:f})}),z=!!R.length&&(0,ks.jsx)(hm,{title:(0,ks.jsx)(bt,{children:(0,ym.__)("Patterns")}),children:(0,ks.jsx)("div",{className:"block-editor-inserter__quick-inserter-patterns",children:(0,ks.jsx)(gu,{blockPatterns:R,onClickPattern:B,onHover:r,isDraggable:f})})});return(0,ks.jsxs)($S,{children:[!d&&!O&&(0,ks.jsx)(lc,{}),h?z:N,!!A.length&&!!R.length&&(0,ks.jsx)("div",{className:"block-editor-inserter__quick-inserter-separator"}),h?N:z,d&&(0,ks.jsx)(b2.Slot,{fillProps:{onSelect:w,onHover:o,filterValue:e,hasItems:O,rootClientId:y},children:V=>V.length?V:O?null:(0,ks.jsx)(lc,{})})]})}var v2=$7e;var k2=c(U(),1),Ape=c(F(),1);var zd=c(E(),1),{Tabs:S2}=H(k2.privateApis);function K7e({defaultTabId:e,onClose:t,onSelect:o,selectedTab:r,tabs:n,closeButtonLabel:i},s){return(0,zd.jsx)("div",{className:"block-editor-tabbed-sidebar",children:(0,zd.jsxs)(S2,{selectOnMove:!1,defaultTabId:e,onSelect:o,selectedTabId:r,children:[(0,zd.jsxs)("div",{className:"block-editor-tabbed-sidebar__tablist-and-close-button",children:[(0,zd.jsx)(k2.Button,{className:"block-editor-tabbed-sidebar__close-button",icon:eg,label:i,onClick:()=>t(),size:"compact"}),(0,zd.jsx)(S2.TabList,{className:"block-editor-tabbed-sidebar__tablist",ref:s,children:n.map(a=>(0,zd.jsx)(S2.Tab,{tabId:a.name,className:"block-editor-tabbed-sidebar__tab",children:a.title},a.name))})]}),n.map(a=>(0,zd.jsx)(S2.TabPanel,{tabId:a.name,focusable:!1,className:"block-editor-tabbed-sidebar__tabpanel",ref:a.panelRef,children:a.panel},a.name))]})})}var _2=(0,Ape.forwardRef)(K7e);var x2=c(Q(),1),ak=c(F(),1);function DC(e=!0){let{setZoomLevel:t,resetZoomLevel:o}=H((0,x2.useDispatch)(C)),{isZoomedOut:r,isZoomOut:n}=(0,x2.useSelect)(a=>{let{isZoomOut:l}=H(a(C));return{isZoomedOut:l(),isZoomOut:l}},[]),i=(0,ak.useRef)(!1),s=(0,ak.useRef)(e);(0,ak.useEffect)(()=>{r!==s.current&&(i.current=!1)},[r]),(0,ak.useEffect)(()=>(s.current=e,e!==n()&&(i.current=!0,e?t("auto-scaled"):o()),()=>{i.current&&n()&&o()}),[e,n,o,t])}var qt=c(E(),1),Mpe=()=>{};function Y7e({rootClientId:e,clientId:t,isAppender:o,__experimentalInsertionIndex:r,onSelect:n,showInserterHelpPanel:i,showMostUsedBlocks:s,__experimentalFilterValue:a="",shouldFocusBlock:l=!0,onPatternCategorySelection:u,onClose:d,__experimentalInitialTab:f,__experimentalInitialCategory:p},h){let{isZoomOutMode:m,hasSectionRootClientId:g}=(0,Lpe.useSelect)(he=>{let{isZoomOut:ke,getSectionRootClientId:_e}=H(he(C));return{isZoomOutMode:ke(),hasSectionRootClientId:!!_e()}},[]),[b,v,y]=(0,VC.useDebouncedInput)(a),[k,S]=(0,Jt.useState)(null),[_,x]=(0,Jt.useState)(p),[w,T]=(0,Jt.useState)("all"),[B,R]=(0,Jt.useState)(null),I=(0,VC.useViewportMatch)("large"),P=(0,VC.useViewportMatch)("medium","<")?d:Mpe;function O(){return f||(m?"patterns":"blocks")}let[N,z]=(0,Jt.useState)(O());DC(g&&(N==="patterns"||N==="media")&&I);let[M,D,L]=gm({rootClientId:e,clientId:t,isAppender:o,insertionIndex:r,shouldFocusBlock:l}),j=(0,Jt.useRef)(),q=(0,Jt.useCallback)((he,ke,_e,we)=>{D(he,ke,_e,we),n(he),P(),window.requestAnimationFrame(()=>{!l&&!j.current?.contains(h.current.ownerDocument.activeElement)&&j.current?.querySelector("button").focus()})},[D,P,n,h,l]),J=(0,Jt.useCallback)((he,ke,..._e)=>{L(!1),D(he,{patternName:ke},..._e),n(),P()},[D,P,n,L]),te=(0,Jt.useCallback)(he=>{L(he),S(he)},[L,S]),ee=(0,Jt.useCallback)((he,ke)=>{x(he),T(ke),u?.()},[x,u]),$=N==="patterns"&&!y&&!!_,W=N==="media"&&!!B,[Y,Z]=(0,Jt.useState)(!1),oe=(0,Jt.useRef)(null),ne=(0,Jt.useRef)(null),X=(0,Jt.useRef)(null);(0,Jt.useEffect)(()=>{let he=_e=>{Z(_e.currentTarget.scrollTop>0)},ke=[oe.current,ne.current,X.current].filter(Boolean);return ke.forEach(_e=>_e.addEventListener("scroll",he)),()=>{ke.forEach(_e=>_e.removeEventListener("scroll",he))}},[]);let re=(0,Jt.useMemo)(()=>N==="media"?null:(0,qt.jsxs)(qt.Fragment,{children:[(0,qt.jsx)(w2.SearchControl,{className:K("block-editor-inserter__search",{"is-scrolled":Y}),onChange:he=>{k&&S(null),v(he)},value:b,label:(0,vm.__)("Search"),placeholder:(0,vm.__)("Search")}),!!y&&(0,qt.jsx)(v2,{filterValue:y,onSelect:n,onHover:te,rootClientId:e,clientId:t,isAppender:o,__experimentalInsertionIndex:r,showBlockDirectory:!0,shouldFocusBlock:l,prioritizePatterns:N==="patterns"})]}),[N,k,S,v,b,y,n,te,l,t,e,r,o,Y]),ae=(0,Jt.useMemo)(()=>(0,qt.jsxs)(qt.Fragment,{children:[(0,qt.jsx)("div",{className:"block-editor-inserter__block-list",children:(0,qt.jsx)(Mfe,{ref:j,rootClientId:M,onInsert:q,onHover:te,showMostUsedBlocks:s})}),i&&(0,qt.jsxs)("div",{className:"block-editor-inserter__tips",children:[(0,qt.jsx)(bt,{render:(0,qt.jsx)("h2",{}),children:(0,vm.__)("A tip for using the block editor")}),(0,qt.jsx)(jle,{})]})]}),[M,q,te,s,i]),ve=(0,Jt.useMemo)(()=>(0,qt.jsx)(spe,{rootClientId:M,onInsert:J,onSelectCategory:ee,selectedCategory:_,children:$&&(0,qt.jsx)(d2,{rootClientId:M,onInsert:J,category:_,patternFilter:w,showTitlesAsTooltip:!0})}),[M,J,ee,w,_,$]),xe=(0,Jt.useMemo)(()=>(0,qt.jsx)(i9,{rootClientId:M,selectedCategory:B,onSelectCategory:R,onInsert:q,children:W&&(0,qt.jsx)(MC,{rootClientId:M,onInsert:q,category:B})}),[M,q,B,R,W]),ge=he=>{he!=="patterns"&&x(null),z(he)},be=(0,Jt.useRef)();return(0,Jt.useLayoutEffect)(()=>{be.current&&window.requestAnimationFrame(()=>{be.current.querySelector('[role="tab"][aria-selected="true"]')?.focus()})},[]),(0,qt.jsxs)("div",{className:K("block-editor-inserter__menu",{"show-panel":$||W,"is-zoom-out":m}),ref:h,children:[(0,qt.jsx)("div",{className:"block-editor-inserter__main-area",children:(0,qt.jsx)(_2,{ref:be,onSelect:ge,onClose:d,selectedTab:N,closeButtonLabel:(0,vm.__)("Close Block Inserter"),tabs:[{name:"blocks",title:(0,vm.__)("Blocks"),panelRef:oe,panel:(0,qt.jsxs)(qt.Fragment,{children:[re,N==="blocks"&&!y&&ae]})},{name:"patterns",title:(0,vm.__)("Patterns"),panelRef:ne,panel:(0,qt.jsxs)(qt.Fragment,{children:[re,N==="patterns"&&!y&&ve]})},{name:"media",title:(0,vm.__)("Media"),panelRef:X,panel:(0,qt.jsxs)(qt.Fragment,{children:[re,xe]})}]})}),i&&k&&(0,qt.jsx)(w2.Popover,{className:"block-editor-inserter__preview-container__popover",placement:"right-start",offset:16,focusOnMount:!1,animate:!1,children:(0,qt.jsx)(hfe,{item:k})})]})}var s9=(0,Jt.forwardRef)(Y7e);function q7e(e,t){return(0,qt.jsx)(s9,{...e,onPatternCategorySelection:Mpe,ref:t})}var Npe=(0,Jt.forwardRef)(q7e);var C2=c(F(),1),FC=c(G(),1),E2=c(U(),1),Dpe=c(Q(),1);var bb=c(E(),1),Z7e=6,X7e=6,Q7e=2;function T2({onSelect:e,rootClientId:t,clientId:o,isAppender:r,selectBlockOnInsert:n,hasSearch:i=!0}){let[s,a]=(0,C2.useState)(""),[l,u]=gm({onSelect:e,rootClientId:t,clientId:o,isAppender:r,selectBlockOnInsert:n}),[d]=kp(l,u,!0),{setInserterIsOpened:f,insertionIndex:p}=(0,Dpe.useSelect)(g=>{let{getSettings:b,getBlockIndex:v,getBlockCount:y}=g(C),k=b(),S=v(o),_=y();return{setInserterIsOpened:k.__experimentalSetIsInserterOpened,insertionIndex:S===-1?_:S}},[o]),h=i&&d.length>Z7e;(0,C2.useEffect)(()=>{f&&f(!1)},[f]);let m=()=>{f({filterValue:s,onSelect:e,rootClientId:t,insertionIndex:p})};return(0,bb.jsxs)("div",{className:K("block-editor-inserter__quick-inserter",{"has-search":h,"has-expand":f}),children:[h&&(0,bb.jsx)(E2.SearchControl,{className:"block-editor-inserter__search",value:s,onChange:g=>{a(g)},label:(0,FC.__)("Search"),placeholder:(0,FC.__)("Search")}),(0,bb.jsx)("div",{className:"block-editor-inserter__quick-inserter-results",children:(0,bb.jsx)(v2,{filterValue:s,onSelect:e,rootClientId:t,clientId:o,isAppender:r,maxBlockPatterns:s?Q7e:0,maxBlockTypes:X7e,isDraggable:!1,selectBlockOnInsert:n,isQuick:!0})}),f&&(0,bb.jsx)(E2.Button,{__next40pxDefaultSize:!0,className:"block-editor-inserter__quick-inserter-expand",onClick:m,"aria-label":(0,FC.__)("Browse all. This will open the main inserter panel in the editor toolbar."),children:(0,FC.__)("Browse all")})]})}var J7e=50;function Vpe(e,t){if(!e||!e.attributes||!t?.__experimentalLabel)return null;let o=t.__experimentalLabel(e.attributes,{context:"appender"});return typeof o=="string"&&o.length0?o:null}var lk=c(E(),1),eUe=({onToggle:e,disabled:t,isOpen:o,blockTitle:r,hasSingleBlockType:n,appenderLabel:i,toggleProps:s={}},a)=>{let{as:l=R2.Button,label:u,onClick:d,...f}=s,p=u;!p&&i?p=i:!p&&n?p=(0,jd.sprintf)((0,jd._x)("Add %s","directly add the only allowed block"),r.toLowerCase()):p||(p=(0,jd._x)("Add block","Generic label for block inserter button"));function h(m){e&&e(m),d&&d(m)}return(0,lk.jsx)(l,{ref:a,__next40pxDefaultSize:s.as?void 0:!0,icon:Ca,label:p,tooltipPosition:"bottom",onClick:h,className:"block-editor-inserter__toggle","aria-haspopup":n?!1:"true","aria-expanded":n?!1:o,isPressed:!n&&o,disabled:t,...f})},tUe=(0,a9.forwardRef)(eUe),oUe=({clientId:e,rootClientId:t,disabled:o,isAppender:r,position:n,selectBlockOnInsert:i,shouldDirectInsert:s=!0,showInserterHelpPanel:a,__experimentalIsQuick:l,onSelectOrClose:u,onToggle:d,renderToggle:f,toggleProps:p},h)=>{let{hasItems:m,hasSingleBlockType:g,blockTitle:b,allowedBlockType:v,blockToInsert:y,appenderLabel:k,targetRootClientId:S}=(0,ck.useSelect)(V=>{let{getBlockRootClientId:M,hasInserterItems:D,getAllowedBlocks:L,getDirectInsertBlock:j,getBlockListSettings:q}=V(C),{getBlockVariations:J,getBlockType:te}=V(yb.store),ee=t||M(e)||void 0,$=L(ee),W=s&&j(ee),{defaultBlock:Y}=q(ee)??{},Z=$?.length===1&&J($[0].name,"inserter")?.length===0,oe=Z?$[0]:null,ne=W||null;!ne&&Z&&Y?.name===oe.name&&(ne=Y);let X=W?te(W.name):null;return{hasItems:D(ee),hasSingleBlockType:Z,blockTitle:oe?oe.title:"",allowedBlockType:oe,blockToInsert:ne,appenderLabel:Vpe(W,X),targetRootClientId:ee}},[t,e,s]),{insertBlock:_}=(0,ck.useDispatch)(C),{getBlock:x,getBlockIndex:w,getBlockOrder:T,getBlockRootClientId:B,getBlockSelectionEnd:R,getPreviousBlockClientId:I}=(0,ck.useSelect)(C),{getActiveBlockVariation:A,getBlockType:P}=(0,ck.useSelect)(yb.store);if(!m&&(r||S||e))return null;function O(){let V=y?.name??v.name;function M(te){if(!te?.length)return{};let ee;if(e){let $=x(e),W=x(I(e));$?.name===W?.name&&(ee=W?.attributes)}else if(S){let $=x(S)?.innerBlocks?.at(-1);$?.name===V&&(ee=$.attributes)}return ee?Object.fromEntries(te.filter($=>$ in ee).map($=>[$,ee[$]])):{}}function D(){if(e)return w(e);let te=R();return!r&&te&&B(te)===S?w(te)+1:T(S).length}let L=M(y?.attributesToCopy),j=(0,yb.createBlock)(V,{...y?.attributes,...L});_(j,D(),S,i),u?.(j);let q=P(V),J;if(q&&(J=(0,yb.__experimentalGetBlockLabel)(q,j.attributes),J===q.title&&(J=A(V,j.attributes)?.title||J)),J){let te=(0,jd.sprintf)((0,jd.__)("%s block added"),J);(0,Fpe.speak)(te)}}function N({onToggle:V,isOpen:M}){let D={onToggle:V,isOpen:M,disabled:o||!m,blockTitle:b,hasSingleBlockType:g,appenderLabel:k,toggleProps:p};return f?f(D):(0,lk.jsx)(tUe,{ref:h,...D})}function z({onClose:V}){return l?(0,lk.jsx)(T2,{onSelect:M=>{let D=Array.isArray(M)&&M?.length?M[0]:M;u&&typeof u=="function"&&u(D),V()},rootClientId:S,clientId:e,isAppender:r,selectBlockOnInsert:i}):(0,lk.jsx)(Npe,{onSelect:()=>{V()},onClose:V,rootClientId:S,clientId:e,isAppender:r,showInserterHelpPanel:a})}return g||y?N({onToggle:O}):(0,lk.jsx)(R2.Dropdown,{className:"block-editor-inserter",contentClassName:K("block-editor-inserter__popover",{"is-quick":l}),popoverProps:{position:n,shift:!0},onToggle:d,expandOnMobile:!0,headerTitle:(0,jd.__)("Add a block"),renderToggle:N,renderContent:z,onClose:u})},rUe=(0,a9.forwardRef)(oUe),Za=rUe;var zC=c(E(),1),nUe="\uFEFF";function uk({rootClientId:e}){let{showPrompt:t,isLocked:o,placeholder:r,isManualGrid:n}=(0,B2.useSelect)(u=>{let{getBlockCount:d,getSettings:f,getTemplateLock:p,getBlockAttributes:h}=u(C),m=!d(e),{bodyPlaceholder:g}=f();return{showPrompt:m,isLocked:!!p(e),placeholder:g,isManualGrid:h(e)?.layout?.isManualPlacement}},[e]),{insertDefaultBlock:i,startTyping:s}=(0,B2.useDispatch)(C);if(o||n)return null;let a=(0,zpe.decodeEntities)(r)||(0,l9.__)("Type / to choose a block"),l=()=>{i(void 0,e),s()};return(0,zC.jsxs)("div",{"data-root-client-id":e||"",className:K("block-editor-default-block-appender",{"has-visible-prompt":t}),children:[(0,zC.jsx)("p",{tabIndex:"0",role:"button","aria-label":(0,l9.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:u=>{(P2.ENTER===u.keyCode||P2.SPACE===u.keyCode)&&l()},onClick:()=>l(),onFocus:()=>{t&&l()},children:t?a:nUe}),(0,zC.jsx)(Za,{rootClientId:e,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0})]})}var jpe=c(U(),1),c9=c(F(),1),jC=c(G(),1);var Hpe=c(Rt(),1);var I2=c(E(),1);function Upe({rootClientId:e,className:t,onFocus:o,tabIndex:r,onSelect:n},i){return(0,I2.jsx)(Za,{position:"bottom center",rootClientId:e,__experimentalIsQuick:!0,onSelectOrClose:(...s)=>{n&&typeof n=="function"&&n(...s)},renderToggle:({onToggle:s,disabled:a,isOpen:l,blockTitle:u,hasSingleBlockType:d,appenderLabel:f})=>{let p=!d,h;return f?h=f:d?h=(0,jC.sprintf)((0,jC._x)("Add %s","directly add the only allowed block"),u.toLowerCase()):h=(0,jC._x)("Add block","Generic label for block inserter button"),(0,I2.jsx)(jpe.Button,{__next40pxDefaultSize:!0,ref:i,onFocus:o,tabIndex:r,className:K(t,"block-editor-button-block-appender"),onClick:s,"aria-haspopup":p?"true":void 0,"aria-expanded":p?l:void 0,disabled:a,label:h,showTooltip:!0,children:(0,I2.jsx)(gt,{icon:Ca})})},isAppender:!0})}var Gpe=(0,c9.forwardRef)((e,t)=>((0,Hpe.default)("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Upe(e,t))),Sm=(0,c9.forwardRef)(Upe);var dk=c(E(),1);function iUe({rootClientId:e}){return(0,u9.useSelect)(o=>o(C).canInsertBlockType((0,Wpe.getDefaultBlockName)(),e))?(0,dk.jsx)(uk,{rootClientId:e}):(0,dk.jsx)(Sm,{rootClientId:e,className:"block-list-appender__toggle"})}function $pe({rootClientId:e,CustomAppender:t,className:o,tagName:r="div"}){let n=(0,u9.useSelect)(i=>{let{getBlockInsertionPoint:s,isBlockInsertionPointVisible:a,getBlockCount:l}=i(C),u=s();return a()&&e===u?.rootClientId&&l(e)===0},[e]);return(0,dk.jsx)(r,{tabIndex:-1,className:K("block-list-appender wp-block",o,{"is-drag-over":n}),contentEditable:!1,"data-block":!0,children:t?(0,dk.jsx)(t,{}):(0,dk.jsx)(iUe,{rootClientId:e})})}var ame=c(fe(),1),UC=c(Q(),1),lme=c(F(),1),cme=c(G(),1);var fk=c(Q(),1),_m=c(F(),1),L2=c(U(),1),ime=c(fe(),1);var qpe=c(Q(),1),km=c(F(),1),Zpe=c(U(),1),Xpe=c(G(),1);var Ype=c(fe(),1),d9=c(Tt(),1),Kpe=new WeakMap;function sUe(e){let t=(0,Ype.useRefEffect)(o=>{function r(i){let{deltaX:s,deltaY:a,target:l}=i,u=e.current,d=Kpe.get(u);d||(d=(0,d9.getScrollContainer)(u),Kpe.set(u,d));let f=(0,d9.getScrollContainer)(l);o.contains(f)||d.scrollBy(s,a)}let n={passive:!0};return o.addEventListener("wheel",r,n),()=>{o.removeEventListener("wheel",r,n)}},[e]);return e?t:null}var vb=sUe;var f9=c(E(),1),aUe=Number.MAX_SAFE_INTEGER;function lUe({previousClientId:e,nextClientId:t,children:o,__unstablePopoverSlot:r,__unstableContentRef:n,operation:i="insert",nearestSide:s="right",...a}){let[l,u]=(0,km.useReducer)(y=>(y+1)%aUe,0),{orientation:d,rootClientId:f,isVisible:p}=(0,qpe.useSelect)(y=>{let{getBlockListSettings:k,getBlockRootClientId:S,isBlockVisible:_}=y(C),x=S(e??t);return{orientation:k(x)?.orientation||"vertical",rootClientId:x,isVisible:_(e)&&_(t)}},[e,t]),h=Nt(e),m=Nt(t),g=d==="vertical",b=(0,km.useMemo)(()=>l<0||!h&&!m||!p?void 0:{contextElement:i==="group"?m||h:h||m,getBoundingClientRect(){let k=h?h.getBoundingClientRect():null,S=m?m.getBoundingClientRect():null,_=0,x=0,w=0,T=0;if(i==="group"){let B=S||k;x=B.top,w=0,T=B.bottom-B.top,_=s==="left"?B.left-2:B.right-2}else g?(x=k?k.bottom:S.top,w=k?k.width:S.width,T=S&&k?S.top-k.bottom:0,_=k?k.left:S.left):(x=k?k.top:S.top,T=k?k.height:S.height,(0,Xpe.isRTL)()?(_=S?S.right:k.left,w=k&&S?k.left-S.right:0):(_=k?k.right:S.left,w=k&&S?S.left-k.right:0),w=Math.max(w,0));return new window.DOMRect(_,x,w,T)}},[h,m,l,g,p,i,s]),v=vb(n);return(0,km.useLayoutEffect)(()=>{if(!h)return;let y=new window.MutationObserver(u);return y.observe(h,{attributes:!0}),()=>{y.disconnect()}},[h]),(0,km.useLayoutEffect)(()=>{if(!m)return;let y=new window.MutationObserver(u);return y.observe(m,{attributes:!0}),()=>{y.disconnect()}},[m]),(0,km.useLayoutEffect)(()=>{if(h)return h.ownerDocument.defaultView.addEventListener("resize",u),()=>{h.ownerDocument.defaultView?.removeEventListener("resize",u)}},[h]),!h&&!m||!p?null:(0,f9.jsx)(Zpe.Popover,{ref:v,animate:!1,anchor:b,focusOnMount:!1,__unstableSlotName:r,inline:!r,...a,className:K("block-editor-block-popover","block-editor-block-popover__inbetween",a.className),resize:!1,flip:!1,placement:"overlay",variant:"unstyled",children:(0,f9.jsx)("div",{className:"block-editor-block-popover__inbetween-container",children:o})},t+"--"+f)}var O2=lUe;var tme=c(Q(),1),ome=c(fe(),1),rme=c(U(),1);var Ud=c(F(),1);var Qpe=c(fe(),1),Jpe=c(U(),1),Hd=c(F(),1);var p9=c(E(),1),cUe=Number.MAX_SAFE_INTEGER;function uUe({clientId:e,bottomClientId:t,children:o,__unstablePopoverSlot:r,__unstableContentRef:n,shift:i=!0,...s},a){let l=Nt(e),u=Nt(t??e),d=(0,Qpe.useMergeRefs)([a,vb(n)]),[f,p]=(0,Hd.useReducer)(m=>(m+1)%cUe,0);(0,Hd.useLayoutEffect)(()=>{if(!l)return;let m,g=new window.MutationObserver(()=>{m||(m=window.requestAnimationFrame(()=>{m=null,p()}))});return g.observe(l,{attributes:!0}),()=>{g.disconnect(),m&&window.cancelAnimationFrame(m)}},[l]);let h=(0,Hd.useMemo)(()=>{if(!(f<0||!l||t&&!u))return{getBoundingClientRect(){return u?Mj(Nv(l),Nv(u)):Nv(l)},contextElement:l}},[f,l,t,u]);return!l||t&&!u?null:(0,p9.jsx)(Jpe.Popover,{ref:d,animate:!1,focusOnMount:!1,anchor:h,__unstableSlotName:r,inline:!r,placement:"top-start",resize:!1,flip:!1,shift:i,...s,className:K("block-editor-block-popover",s.className),variant:"unstyled",children:o})}var Sb=(0,Hd.forwardRef)(uUe),dUe=({clientId:e,bottomClientId:t,children:o,...r},n)=>(0,p9.jsx)(Sb,{...r,bottomClientId:t,clientId:e,__unstableContentRef:void 0,__unstablePopoverSlot:void 0,ref:n,children:o}),eme=(0,Hd.forwardRef)(dUe);var A2=c(E(),1);function fUe({clientId:e,bottomClientId:t,children:o,shift:r=!1,additionalStyles:n,...i},s){t??=e;let a=Nt(e);return(0,A2.jsx)(Sb,{ref:s,clientId:e,bottomClientId:t,shift:r,...i,children:a&&e===t?(0,A2.jsx)(pUe,{selectedElement:a,additionalStyles:n,children:o}):o})}function pUe({selectedElement:e,additionalStyles:t={},children:o}){let[r,n]=(0,Ud.useState)(e.offsetWidth),[i,s]=(0,Ud.useState)(e.offsetHeight);(0,Ud.useEffect)(()=>{let l=new window.ResizeObserver(()=>{n(e.offsetWidth),s(e.offsetHeight)});return l.observe(e,{box:"border-box"}),()=>l.disconnect()},[e]);let a=(0,Ud.useMemo)(()=>({position:"absolute",width:r,height:i,...t}),[r,i,t]);return(0,A2.jsx)("div",{style:a,children:o})}var Xa=(0,Ud.forwardRef)(fUe);var m9=c(E(),1),HC={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}};function mUe({__unstablePopoverSlot:e,__unstableContentRef:t}){let{clientId:o}=(0,tme.useSelect)(n=>{let{getBlockOrder:i,getBlockInsertionPoint:s}=n(C),a=s(),l=i(a.rootClientId);return l.length?{clientId:l[a.index]}:{}},[]),r=(0,ome.useReducedMotion)();return(0,m9.jsx)(Xa,{clientId:o,__unstablePopoverSlot:e,__unstableContentRef:t,className:"block-editor-block-popover__drop-zone",children:(0,m9.jsx)(rme.__unstableMotion.div,{"data-testid":"block-popover-drop-zone",initial:r?HC.show:HC.hide,animate:HC.show,exit:r?HC.show:HC.exit,className:"block-editor-block-popover__drop-zone-foreground"})})}var nme=mUe;var Gd=c(E(),1),pk=(0,_m.createContext)();pk.displayName="InsertionPointOpenRefContext";function hUe({__unstablePopoverSlot:e,__unstableContentRef:t,operation:o="insert",nearestSide:r="right"}){let{selectBlock:n,hideInsertionPoint:i}=(0,fk.useDispatch)(C),s=(0,_m.useContext)(pk),a=(0,_m.useRef)(),{orientation:l,previousClientId:u,nextClientId:d,rootClientId:f,isInserterShown:p,isDistractionFree:h,isZoomOutMode:m}=(0,fk.useSelect)(B=>{let{getBlockOrder:R,getBlockListSettings:I,getBlockInsertionPoint:A,isBlockBeingDragged:P,getPreviousBlockClientId:O,getNextBlockClientId:N,getSettings:z,isZoomOut:V}=H(B(C)),M=A(),D=R(M.rootClientId);if(!D.length)return{};let L=D[M.index-1],j=D[M.index];for(;P(L);)L=O(L);for(;P(j);)j=N(j);let q=z();return{previousClientId:L,nextClientId:j,orientation:I(M.rootClientId)?.orientation||"vertical",rootClientId:M.rootClientId,isDistractionFree:q.isDistractionFree,isInserterShown:M?.__unstableWithInserter,isZoomOutMode:V()}},[]),{getBlockEditingMode:g}=(0,fk.useSelect)(C),b=(0,ime.useReducedMotion)();function v(B){B.target===a.current&&d&&g(d)!=="disabled"&&n(d,-1)}function y(B){B.target===a.current&&!s.current&&i()}function k(B){B.target!==a.current&&(s.current=!0)}let S=(0,_m.useCallback)(B=>{!B&&s.current&&(s.current=!1)},[s]),_={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:p?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},x={start:{scale:b?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(h||m&&o!=="insert")return null;let T=K("block-editor-block-list__insertion-point",l==="horizontal"||o==="group"?"is-horizontal":"is-vertical");return(0,Gd.jsx)(O2,{previousClientId:u,nextClientId:d,__unstablePopoverSlot:e,__unstableContentRef:t,operation:o,nearestSide:r,children:(0,Gd.jsxs)(L2.__unstableMotion.div,{layout:!b,initial:b?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:a,tabIndex:-1,onClick:v,onFocus:k,className:K(T,{"is-with-inserter":p}),onHoverEnd:y,children:[(0,Gd.jsx)(L2.__unstableMotion.div,{variants:_,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),p&&(0,Gd.jsx)(L2.__unstableMotion.div,{variants:x,className:K("block-editor-block-list__insertion-point-inserter"),children:(0,Gd.jsx)(Za,{ref:S,position:"bottom center",clientId:d,rootClientId:f,__experimentalIsQuick:!0,onToggle:B=>{s.current=B},onSelectOrClose:()=>{s.current=!1}})})]})})}function sme(e){let{insertionPoint:t,isVisible:o,isBlockListEmpty:r}=(0,fk.useSelect)(n=>{let{getBlockInsertionPoint:i,isBlockInsertionPointVisible:s,getBlockCount:a}=n(C),l=i();return{insertionPoint:l,isVisible:s(),isBlockListEmpty:a(l?.rootClientId)===0}},[]);return!o||r?null:t.operation==="replace"?(0,Gd.jsx)(nme,{...e},`${t.rootClientId}-${t.index}`):(0,Gd.jsx)(hUe,{operation:t.operation,nearestSide:t.nearestSide,...e})}function ume(){let e=(0,lme.useContext)(pk),t=(0,UC.useSelect)(g=>{let b=g(C).getSettings();return b.isDistractionFree||b.isPreviewMode||H(g(C)).isZoomOut()},[]),{getBlockListSettings:o,getBlockIndex:r,isMultiSelecting:n,getSelectedBlockClientIds:i,getSettings:s,getTemplateLock:a,__unstableIsWithinBlockOverlay:l,getBlockEditingMode:u,getBlockName:d,getBlockAttributes:f,getParentSectionBlock:p}=H((0,UC.useSelect)(C)),{showInsertionPoint:h,hideInsertionPoint:m}=(0,UC.useDispatch)(C);return(0,ame.useRefEffect)(g=>{if(t)return;function b(v){if(e===void 0||e.current||v.target.nodeType===v.target.TEXT_NODE||n())return;if(!v.target.classList.contains("block-editor-block-list__layout")){m();return}let y;if(v.target.classList.contains("is-root-container")||(y=(v.target.getAttribute("data-block")?v.target:v.target.closest("[data-block]")).getAttribute("data-block")),a(y)||u(y)==="disabled"||d(y)==="core/block"||y&&f(y).layout?.isManualPlacement)return;let k=o(y),S=k?.orientation||"vertical",_=!!k?.__experimentalCaptureToolbars,x=v.clientY,w=v.clientX,B=Array.from(v.target.children).find(P=>{let O=P.getBoundingClientRect();return P.classList.contains("wp-block")&&S==="vertical"&&O.top>x||P.classList.contains("wp-block")&&S==="horizontal"&&((0,cme.isRTL)()?O.rightw)});if(!B){m();return}if(!B.id&&(B=B.firstElementChild,!B)){m();return}let R=B.id.slice(6);if(!R||l(R)||p(R)||i().includes(R)&&S==="vertical"&&!_&&!s().hasFixedToolbar)return;let I=B.getBoundingClientRect();if(S==="horizontal"&&(v.clientY>I.bottom||v.clientYI.right||v.clientX{g.removeEventListener("mousemove",b)}},[e,o,r,n,h,m,i,t])}var M2=c(Q(),1),dme=c(fe(),1);var fme=c(E(),1);function kb(){let{getSettings:e,hasSelectedBlock:t,hasMultiSelection:o}=(0,M2.useSelect)(C),{clearSelectedBlock:r}=(0,M2.useDispatch)(C),{clearBlockSelection:n}=e();return(0,dme.useRefEffect)(i=>{if(!n)return;function s(a){!t()&&!o()||a.target===i&&r()}return i.addEventListener("mousedown",s),()=>{i.removeEventListener("mousedown",s)}},[t,o,r,n])}function pme(e){return(0,fme.jsx)("div",{ref:kb(),...e})}var Lme=c(fe(),1),hk=c(F(),1),Mme=c(Q(),1),Cb=c(ue(),1);var mme=c(E(),1);function hme({showSeparator:e,isFloating:t,onAddBlock:o,isToggle:r}){let{clientId:n}=ht();return(0,mme.jsx)(Sm,{className:K({"block-list-appender__toggle":r}),rootClientId:n,showSeparator:e,isFloating:t,onAddBlock:o})}var gme=c(E(),1);function bme(){let{clientId:e}=ht();return(0,gme.jsx)(uk,{rootClientId:e})}var D2=c(F(),1),Sme=c(Q(),1),N2=c(Rt(),1),kme=c(GC(),1);var WC=new WeakMap;function gUe(){let e;return t=>((e===void 0||!(0,kme.isShallowEqual)(e,t))&&(e=t),e)}function vme(e){let[t]=(0,D2.useState)(gUe);return t(e)}function _me(e,t,o,r,n,i,s,a,l,u,d,f){let p=(0,Sme.useRegistry)(),h=vme(o),m=vme(r),g=l===void 0||t==="contentOnly"?t:l;(0,D2.useLayoutEffect)(()=>{let b={allowedBlocks:h,prioritizedInserterBlocks:m,templateLock:g};if(u!==void 0&&(b.__experimentalCaptureToolbars=u),d!==void 0)b.orientation=d;else{let v=Ba(f?.type);b.orientation=v.getOrientation(f)}s!==void 0&&((0,N2.default)("__experimentalDefaultBlock",{alternative:"defaultBlock",since:"6.3",version:"6.4"}),b.defaultBlock=s),n!==void 0&&(b.defaultBlock=n),a!==void 0&&((0,N2.default)("__experimentalDirectInsert",{alternative:"directInsert",since:"6.3",version:"6.4"}),b.directInsert=a),i!==void 0&&(b.directInsert=i),b.directInsert!==void 0&&typeof b.directInsert!="boolean"&&(0,N2.default)("Using `Function` as a `directInsert` argument",{alternative:"`boolean` values",since:"6.5"}),WC.get(p)||WC.set(p,{}),WC.get(p)[e]=b,window.queueMicrotask(()=>{let v=WC.get(p);if(Object.keys(v).length){let{updateBlockListSettings:y}=p.dispatch(C);y(v),WC.set(p,{})}})},[e,h,m,g,n,i,s,a,u,d,f,p])}var h9=c(Zh(),1),V2=c(F(),1),xme=c(Q(),1),wme=c(ue(),1);function Cme(e,t,o,r){let n=(0,xme.useRegistry)(),i=(0,V2.useRef)(null);(0,V2.useLayoutEffect)(()=>{let s=!1,{getBlocks:a,getSelectedBlocksInitialCaretPosition:l,isBlockSelected:u}=n.select(C),{replaceInnerBlocks:d,__unstableMarkNextChangeAsNotPersistent:f}=n.dispatch(C);return window.queueMicrotask(()=>{if(s)return;let p=a(e),h=p.length===0||o==="all"||o==="contentOnly",m=!(0,h9.default)(t,i.current);if(!h||!m)return;i.current=t;let g=(0,wme.synchronizeBlocksWithTemplate)(p,t);(0,h9.default)(g,p)||(f({history:"ignore"}),d(e,g,p.length===0&&r&&g.length!==0&&u(e),l()))}),()=>{s=!0}},[t,o,e,n,r])}var Eme=c(ue(),1),Tme=c(Q(),1);function Rme(e){return(0,Tme.useSelect)(t=>{let o=t(C).getBlock(e);if(!o)return;let r=t(Eme.store).getBlockType(o.name);if(r&&Object.keys(r.providesContext).length!==0)return Object.fromEntries(Object.entries(r.providesContext).map(([n,i])=>[n,o.attributes[i]]))},[e])}var wb=c(Q(),1),j2=c(F(),1),H2=c(fe(),1),Ome=c(G(),1),mk=c(ue(),1);var g9=c(F(),1),_s=c(ue(),1),_b=c(Q(),1),Bme=c(Tt(),1);function b9(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{return t}return t}function bUe(e,t,o,r,n,i,s,a,l){return u=>{let{srcRootClientId:d,srcClientIds:f,type:p,blocks:h}=b9(u);if(p==="inserter"){s();let m=h.map(g=>(0,_s.cloneBlock)(g));i(m,!0,null)}if(p==="block"){let m=o(f[0]);if(d===e&&m===t||f.includes(e)||r(f).some(y=>y===e))return;if(a==="group"){let y=f.map(k=>l(k));i(y,!0,null,f);return}let g=d===e,b=f.length,v=g&&m{if(!t().mediaUpload)return;let s=(0,_s.findTransform)((0,_s.getBlockTransforms)("from"),a=>a.type==="files"&&r(a.blockName,e)&&a.isMatch(i));if(s){let a=s.transform(i,o);n(a)}}}function vUe(e){return t=>{let o=(0,_s.pasteHandler)({HTML:t,mode:"BLOCKS"});o.length&&e(o)}}function F2(e,t,o={}){let{operation:r="insert",nearestSide:n="right"}=o,{canInsertBlockType:i,getBlockIndex:s,getClientIdsOfDescendants:a,getBlockOrder:l,getBlocksByClientId:u,getSettings:d,getBlock:f}=(0,_b.useSelect)(C),{getGroupingBlockName:p}=(0,_b.useSelect)(_s.store),{insertBlocks:h,moveBlocksToPosition:m,updateBlockAttributes:g,clearSelectedBlock:b,replaceBlocks:v,removeBlocks:y}=(0,_b.useDispatch)(C),k=(0,_b.useRegistry)(),S=(0,g9.useCallback)((B,R=!0,I=0,A=[])=>{Array.isArray(B)||(B=[B]);let O=l(e)[t];if(r==="replace")v(O,B,void 0,I);else if(r==="group"){let N=f(O);n==="left"?B.push(N):B.unshift(N);let z=B.map(L=>(0,_s.cloneSanitizedBlock)(L)),V=B.every(L=>L.name==="core/image"),M=i("core/gallery",e),D=(0,_s.createBlock)(V&&M?"core/gallery":p(),{layout:{type:"flex",flexWrap:V&&M?null:"nowrap"}},z);v([O,...A],D,void 0,I)}else h(B,t,e,R,I)},[l,e,t,r,v,f,n,i,p,h]),_=(0,g9.useCallback)((B,R,I)=>{if(r==="replace"){let A=u(B),O=l(e)[t];k.batch(()=>{y(B,!1),v(O,A,void 0,0)})}else m(B,R,e,I)},[r,l,u,m,k,y,v,t,e]),x=bUe(e,t,s,a,_,S,b,r,f),w=yUe(e,d,g,i,S),T=vUe(S);return B=>{let R=(0,Bme.getFilesFromDataTransfer)(B.dataTransfer),I=B.dataTransfer.getData("text/html");I?T(I):R.length?w(R):x(B)}}function SUe(e,t,o){let r=o==="top"||o==="bottom",{x:n,y:i}=e,s=r?n:i,a=r?i:n,l=r?t.left:t.top,u=r?t.right:t.bottom,d=t[o],f;return s>=l&&s<=u?f=s:s{let s=SUe(e,t,i);(r===void 0||s=e.x&&t.top<=e.y&&t.bottom>=e.y}function Pme(e,t){return t.top<=e.y&&t.bottom>=e.y}var y9=30,kUe=120,_Ue=120;function xUe(e,t,o="vertical",r={}){let n=o==="horizontal"?["left","right"]:["top","bottom"],i=0,s="before",a=1/0,l=null,u="right",{dropZoneElement:d,parentBlockOrientation:f,rootBlockIndex:p=0}=r;if(d&&f!=="horizontal"){let v=d.getBoundingClientRect(),[y,k]=xb(t,v,["top","bottom"]);if(v.height>kUe&&y_Ue&&y{let _=y();if(!_)return;let[x,w]=xb(t,_,n),[T,B]=xb(t,_,["left","right"]),R=z2(t,_);v&&R?x=0:o==="vertical"&&S!=="horizontal"&&(R&&Tl);n=o.every(l=>a?.includes(l))}let s=o.map(a=>e(a)).every(a=>{let[l]=a?.parent||[];return l?l===r:!0});return n&&s}function Ime(e,t){let{defaultView:o}=t;return!!(o&&e instanceof o.HTMLElement&&e.closest("[data-is-insertion-point]"))}function Ame({dropZoneElement:e,rootClientId:t="",parentClientId:o="",isDisabled:r=!1}={}){let n=(0,wb.useRegistry)(),[i,s]=(0,j2.useState)({index:null,operation:"insert"}),{getBlockType:a,getBlockVariations:l,getGroupingBlockName:u}=(0,wb.useSelect)(mk.store),{canInsertBlockType:d,getBlockListSettings:f,getBlocks:p,getBlockIndex:h,getDraggedBlockClientIds:m,getBlockNamesByClientId:g,getAllowedBlocks:b,isDragging:v,isGroupable:y,isZoomOut:k,getSectionRootClientId:S,getBlockParents:_}=H((0,wb.useSelect)(C)),{showInsertionPoint:x,hideInsertionPoint:w,startDragging:T,stopDragging:B}=H((0,wb.useDispatch)(C)),R=F2(i.operation==="before"||i.operation==="after"?o:t,i.index,{operation:i.operation,nearestSide:i.nearestSide}),I=(0,H2.useThrottle)((0,j2.useCallback)((A,P)=>{v()||T();let O=m(),N=[t,..._(t,!0)];if(O.some(Z=>N.includes(Z)))return;let V=b(t),M=g([t])[0],D=g(O);if(!U2(a,V,D,M))return;let j=S();if(k()&&j!==t)return;let q=p(t).filter(Z=>!((0,mk.hasBlockSupport)(Z.name,"visibility",!0)&&Z.attributes?.metadata?.blockVisibility===!1));if(q.length===0){n.batch(()=>{s({index:0,operation:"insert"}),x(t,0,{operation:"insert"})});return}let J=q.map(Z=>{let oe=Z.clientId;return{isUnmodifiedDefaultBlock:(0,mk.isUnmodifiedDefaultBlock)(Z),getBoundingClientRect:()=>{let ne=P.getElementById(`block-${oe}`);return ne?ne.getBoundingClientRect():null},blockIndex:h(oe),blockOrientation:f(oe)?.orientation}}),te=xUe(J,{x:A.clientX,y:A.clientY},f(t)?.orientation,{dropZoneElement:e,parentBlockClientId:o,parentBlockOrientation:o?f(o)?.orientation:void 0,rootBlockIndex:h(t)}),[ee,$,W]=te,Y=J[ee]?.isUnmodifiedDefaultBlock;if(!(k()&&!Y&&$!=="insert")){if($==="group"){let Z=q[ee],oe=[Z.name,...D].every(ve=>ve==="core/image"),ne=d("core/gallery",t),X=y([Z.clientId,m()]),re=l(u(),"block"),ae=re&&re.find(({name:ve})=>ve==="group-row");if(oe&&!ne&&(!X||!ae)||!oe&&(!X||!ae))return}n.batch(()=>{s({index:ee,operation:$,nearestSide:W});let Z=["before","after"].includes($)?o:t;x(Z,ee,{operation:$,nearestSide:W})})}},[v,b,t,g,m,a,S,k,p,f,e,o,h,n,T,x,d,y,l,u]),200);return(0,H2.__experimentalUseDropZone)({dropZoneElement:e,isDisabled:r,onDrop:R,onDragOver(A){I(A,A.currentTarget.ownerDocument)},onDragLeave(A){let{ownerDocument:P}=A.currentTarget;Ime(A.relatedTarget,P)||Ime(A.target,P)||(I.cancel(),w())},onDragEnd(){I.cancel(),B(),w()}})}var Wd=c(E(),1),wUe={};function CUe({children:e,clientId:t}){let o=Rme(t);return(0,Wd.jsx)(sT,{value:o,children:e})}var EUe=(0,hk.memo)(BC);function Nme(e){let{clientId:t,allowedBlocks:o,prioritizedInserterBlocks:r,defaultBlock:n,directInsert:i,__experimentalDefaultBlock:s,__experimentalDirectInsert:a,template:l,templateLock:u,wrapperRef:d,templateInsertUpdatesSelection:f,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:h,renderAppender:m,orientation:g,placeholder:b,layout:v,name:y,blockType:k,parentLock:S,defaultLayout:_}=e;_me(t,S,o,r,n,i,s,a,u,p,g,v),Cme(t,l,u,f);let x=(0,Cb.getBlockSupport)(y,"layout")||(0,Cb.getBlockSupport)(y,"__experimentalLayout")||wUe,{allowSizingOnChildren:w=!1}=x,T=v||x,B=(0,hk.useMemo)(()=>({..._,...T,...w&&{allowSizingOnChildren:!0}}),[_,T,w]),R=(0,Wd.jsx)(EUe,{rootClientId:t,renderAppender:m,__experimentalAppenderTagName:h,layout:B,wrapperRef:d,placeholder:b});return!k?.providesContext||Object.keys(k.providesContext).length===0?R:(0,Wd.jsx)(CUe,{clientId:t,children:R})}function TUe(e){return hA(e),(0,Wd.jsx)(Nme,{...e})}var G2=(0,hk.forwardRef)((e,t)=>{let o=Eb({ref:t},e);return(0,Wd.jsx)("div",{className:"block-editor-inner-blocks",children:(0,Wd.jsx)("div",{...o})})});function Eb(e={},t={}){let{__unstableDisableLayoutClassNames:o,__unstableDisableDropZone:r,dropZoneElement:n}=t,{clientId:i,layout:s=null,__unstableLayoutClassNames:a=""}=ht(),l=(0,Mme.useSelect)(S=>{let{getBlockName:_,isZoomOut:x,getTemplateLock:w,getBlockRootClientId:T,getBlockEditingMode:B,getBlockSettings:R,getSectionRootClientId:I}=H(S(C));if(!i){let D=I();return{isDropZoneDisabled:x()&&D!==""}}let{hasBlockSupport:A,getBlockType:P}=S(Cb.store),O=_(i),N=B(i),z=T(i),[V]=R(i,"layout"),M=N==="disabled";if(x()){let D=I();M=i!==D}return{__experimentalCaptureToolbars:A(O,"__experimentalExposeControlsToChildren",!1),name:O,blockType:P(O),parentLock:w(z),parentClientId:z,isDropZoneDisabled:M,defaultLayout:V}},[i]),{__experimentalCaptureToolbars:u,name:d,blockType:f,parentLock:p,parentClientId:h,isDropZoneDisabled:m,defaultLayout:g}=l,b=Ame({dropZoneElement:n,rootClientId:i,parentClientId:h}),v=(0,Lme.useMergeRefs)([e.ref,r||m||s?.isManualPlacement&&window.__experimentalEnableGridInteractivity?null:b]),y={__experimentalCaptureToolbars:u,layout:s,name:d,blockType:f,parentLock:p,defaultLayout:g,...t},k=y.value&&y.onChange?TUe:Nme;return{...e,ref:v,className:K(e.className,"block-editor-block-list__layout",o?"":a),children:i?(0,Wd.jsx)(k,{...y,clientId:i}):(0,Wd.jsx)(BC,{...t})}}Eb.save=Cb.__unstableGetInnerBlocksProps;G2.DefaultBlockAppender=bme;G2.ButtonBlockAppender=hme;G2.Content=()=>Eb.save().children;var $C=G2;var KC=c(U(),1),Dme=c(fe(),1),Vme=c(Q(),1),Fme=c(F(),1),zme=c(G(),1);var W2=c(E(),1);function v9({clientId:e,rootClientId:t="",position:o="top"}){let[r,n]=(0,Fme.useState)(!1),{sectionRootClientId:i,sectionClientIds:s,insertionPoint:a,blockInsertionPointVisible:l,blockInsertionPoint:u,blocksBeingDragged:d}=(0,Vme.useSelect)(_=>{let{getInsertionPoint:x,getBlockOrder:w,getSectionRootClientId:T,isBlockInsertionPointVisible:B,getBlockInsertionPoint:R,getDraggedBlockClientIds:I}=H(_(C)),A=T(),P=w(A);return{sectionRootClientId:A,sectionClientIds:P,insertionPoint:x(),blockInsertionPoint:R(),blockInsertionPointVisible:B(),blocksBeingDragged:I()}},[]),f=(0,Dme.useReducedMotion)();if(!e)return;let p=!1;if(!(t===i&&s&&s.includes(e)))return null;let m=a?.index===0&&e===s[a.index],g=a&&a.hasOwnProperty("index")&&e===s[a.index-1];o==="top"&&(p=m||l&&u.index===0&&e===s[u.index]),o==="bottom"&&(p=g||l&&e===s[u.index-1]);let b=d[0],v=d.includes(e),y=s.indexOf(b),S=(y>0?s[y-1]:null)===e;return(v||S)&&(p=!1),(0,W2.jsx)(KC.__unstableAnimatePresence,{children:p&&(0,W2.jsx)(KC.__unstableMotion.div,{initial:{height:0},animate:{height:"calc(1 * var(--wp-block-editor-iframe-zoom-out-frame-size) / var(--wp-block-editor-iframe-zoom-out-scale)"},exit:{height:0},transition:{type:"tween",duration:f?0:.2,ease:[.6,0,.4,1]},className:K("block-editor-block-list__zoom-out-separator",{"is-dragged-over":r}),"data-is-insertion-point":"true",onDragOver:()=>n(!0),onDragLeave:()=>n(!1),children:(0,W2.jsx)(KC.__unstableMotion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{delay:-.125}},transition:{ease:"linear",duration:.1,delay:.125},children:(0,zme.__)("Drop pattern.")})})})}var ji=c(E(),1),iI=(0,xm.createContext)();iI.displayName="IntersectionObserverContext";var $2=new WeakMap,RUe={trailing:!0};function BUe({className:e,...t}){let{isOutlineMode:o,isFocusMode:r,isPreviewMode:n,editedContentOnlySection:i}=(0,Qa.useSelect)(f=>{let{getSettings:p,isTyping:h,hasBlockSpotlight:m,getEditedContentOnlySection:g}=H(f(C)),{outlineMode:b,focusMode:v,isPreviewMode:y}=p();return{isOutlineMode:b&&!h(),isFocusMode:v||m(),isPreviewMode:y,editedContentOnlySection:g()}},[]),s=(0,Qa.useRegistry)(),{setBlockVisibility:a}=(0,Qa.useDispatch)(C),l=(0,K2.useDebounce)((0,xm.useCallback)(()=>{let f={};$2.get(s).forEach(([p,h])=>{f[p]=h}),a(f)},[s]),300,RUe),u=(0,xm.useMemo)(()=>{let{IntersectionObserver:f}=window;if(f)return new f(p=>{$2.get(s)||$2.set(s,[]);for(let h of p){let m=h.target.getAttribute("data-block");$2.get(s).push([m,h.isIntersecting])}l()})},[]),d=Eb({ref:(0,K2.useMergeRefs)([kb(),ume()]),className:K("is-root-container",e,{"is-outline-mode":o,"is-focus-mode":r,"is-preview-mode":n})},t);return(0,ji.jsxs)(iI.Provider,{value:u,children:[(0,ji.jsx)("div",{...d}),!!i&&(0,ji.jsx)(PUe,{clientId:i})]})}function PUe({clientId:e}){let{stopEditingContentOnlySection:t}=H((0,Qa.useDispatch)(C)),o=(0,Qa.useSelect)(r=>{let{isBlockSelected:n,hasSelectedInnerBlock:i,getBlockSelectionStart:s}=r(C);return!s()||n(e)||i(e,!0)},[e]);return(0,xm.useEffect)(()=>{o||t()},[o,t]),null}function HS(e){return(0,ji.jsx)(oT,{value:vF,children:(0,ji.jsx)(BUe,{...e})})}var IUe=[],OUe=new Set;function AUe({placeholder:e,rootClientId:t,renderAppender:o,__experimentalAppenderTagName:r,layout:n=Lz}){let i=o!==!1,s=!!o,{order:a,isZoomOut:l,selectedBlocks:u,visibleBlocks:d,shouldRenderAppender:f}=(0,Qa.useSelect)(p=>{let{getSettings:h,getBlockOrder:m,getSelectedBlockClientIds:g,__unstableGetVisibleBlocks:b,getTemplateLock:v,getBlockEditingMode:y,isSectionBlock:k,isContainerInsertableToInContentOnlyMode:S,getBlockName:_,isZoomOut:x,canInsertBlockType:w}=H(p(C)),T=m(t);if(h().isPreviewMode)return{order:T,selectedBlocks:IUe,visibleBlocks:OUe};let B=g(),R=B[0],I=!t&&!R&&(!T.length||!w((0,jme.getDefaultBlockName)(),t)),A=!!(t&&R&&t===R),P=v(t);return{order:T,selectedBlocks:B,visibleBlocks:b(),isZoomOut:x(),shouldRenderAppender:(!k(t)||S(_(R),t))&&y(t)!=="disabled"&&(!P||P==="contentOnly")&&i&&!x()&&(s||A||I)}},[t,i,s]);return(0,ji.jsxs)(dP,{value:n,children:[a.map(p=>(0,ji.jsxs)(Qa.AsyncModeProvider,{value:!d.has(p)&&!u.includes(p),children:[l&&(0,ji.jsx)(v9,{clientId:p,rootClientId:t,position:"top"}),(0,ji.jsx)(gI,{rootClientId:t,clientId:p}),l&&(0,ji.jsx)(v9,{clientId:p,rootClientId:t,position:"bottom"})]},p)),a.length<1&&e,f&&(0,ji.jsx)($pe,{tagName:r,rootClientId:t,CustomAppender:o})]})}function BC(e){return(0,ji.jsx)(Qa.AsyncModeProvider,{value:!1,children:(0,ji.jsx)(AUe,{...e})})}var Fk=c(Q(),1),iG=c(Tt(),1),sG=c(U(),1),dye=c(Yl(),1),uM=c(F(),1),dM=c(ue(),1),aG=c(Qr(),1),zk=c(G(),1);var yhe=c(fe(),1),vhe=c(Q(),1),She=c(Tt(),1),Su=c(F(),1);var fc=c(G(),1),Rb=c(ue(),1),fhe=c(fe(),1),phe=c(Q(),1),rL=c(F(),1);var ZC=c(U(),1),qme=c(Yw(),1),Zme=c(Rt(),1),bk=c(F(),1);var Rn=c(U(),1),Hme=(0,Rn.createSlotFill)("InspectorControls"),LUe=(0,Rn.createSlotFill)("InspectorAdvancedControls"),MUe=(0,Rn.createSlotFill)("InspectorControlsBindings"),NUe=(0,Rn.createSlotFill)("InspectorControlsBackground"),DUe=(0,Rn.createSlotFill)("InspectorControlsBorder"),VUe=(0,Rn.createSlotFill)("InspectorControlsColor"),FUe=(0,Rn.createSlotFill)("InspectorControlsFilter"),zUe=(0,Rn.createSlotFill)("InspectorControlsDimensions"),jUe=(0,Rn.createSlotFill)("InspectorControlsLayout"),HUe=(0,Rn.createSlotFill)("InspectorControlsElements"),UUe=(0,Rn.createSlotFill)("InspectorControlsPosition"),GUe=(0,Rn.createSlotFill)("InspectorControlsTypography"),WUe=(0,Rn.createSlotFill)("InspectorControlsListView"),$Ue=(0,Rn.createSlotFill)("InspectorControlsStyles"),KUe=(0,Rn.createSlotFill)("InspectorControlsEffects"),YUe=(0,Rn.createSlotFill)("InspectorControlsContent"),qUe={default:Hme,advanced:LUe,background:NUe,bindings:MUe,border:DUe,color:VUe,content:YUe,dimensions:zUe,effects:KUe,elements:HUe,filter:FUe,layout:jUe,list:WUe,position:UUe,settings:Hme,styles:$Ue,typography:GUe},dc=qUe,YC=(0,Rn.createSlotFill)(Symbol("PrivateInspectorControlsAllowedBlocks"));var Y2=c(F(),1);var qC="default",Js={viewport:qC,pseudo:qC},Ume=(0,Y2.createContext)(Js),q2=Ume.Provider;function Ja(){return(0,Y2.useContext)(Ume)}function Hi(e){return!!e?.viewport&&e.viewport!==qC}function ea(e){return!!e?.pseudo&&e.pseudo!==qC}function Bn(e){return!Hi(e)&&!ea(e)}function Gme(e){return Bn(e)?[]:[e.viewport,e.pseudo].filter(t=>t&&t!==qC)}function To(e,t){let o=Gme(t);return o.length?cd(e,o):e}function Pn(e,t,o){let r=Gme(t);return r.length?Ge(De(e,r,o)):Ge(o)}function Wme(e,t){return!t||Bn(e)?t:o=>{let r=To(o?.style,e)||{},n=t({style:r}),i=n&&typeof n=="object"&&!Array.isArray(n)&&Object.prototype.hasOwnProperty.call(n,"style")?n.style:n;return{style:Pn(o?.style,e,i)}}}var gk=c(U(),1),X2=c(F(),1),$me=c(fe(),1),Q2=c(Q(),1);var Z2=c(E(),1),Kme=Symbol("ListViewContentPopover"),{Fill:Yme,Slot:ZUe}=(0,gk.createSlotFill)(Kme);function XUe(){return(0,$me.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:35,resize:!1}}}function J2({listViewRef:e}){let{popoverProps:t}=XUe(),o=(0,gk.__experimentalUseSlotFills)(Kme),r=!!(o&&o.length),{selectedClientId:n,isOpen:i}=(0,Q2.useSelect)(u=>{let{getSelectedBlockClientId:d}=u(C),f=H(u(C));return{selectedClientId:d(),isOpen:f.isListViewContentPanelOpen()}},[]),[s,a]=(0,X2.useState)(null);(0,X2.useLayoutEffect)(()=>{if(!n||!e?.current){a(null);return}let u=e.current.querySelector(`[data-block="${n}"]`);a(u)},[n,e]);let{closeListViewContentPanel:l}=H((0,Q2.useDispatch)(C));return!i||!r||!s?null:(0,Z2.jsx)(gk.Popover,{...t??{},className:"block-editor-inspector-list-view-content-popover",anchor:s,onClose:l,children:(0,Z2.jsx)("div",{style:{width:"280px"},children:(0,Z2.jsx)(ZUe,{})})})}var wm=c(E(),1),QUe=["content","list"];function Tb({children:e,group:t="default",__experimentalGroup:o,resetAllFilter:r}){o&&((0,Zme.default)("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=o);let n=ht(),i=dc[t]?.Fill;if(!i)return(0,qme.default)(`Unknown InspectorControls group "${t}" provided.`),null;if(n[Kf]){let s=n.name==="core/template-part",a=QUe.includes(t);if(!(s||a))return null}return!n[Kf]&&!n[Dl]?null:t==="content"&&n[Bx]&&n[Kf]?n[Dl]?(0,wm.jsx)(ZC.__experimentalStyleProvider,{document,children:(0,wm.jsx)(Yme,{children:e})}):null:(0,wm.jsx)(ZC.__experimentalStyleProvider,{document,children:(0,wm.jsx)(i,{children:s=>(0,wm.jsx)(e9e,{fillProps:s,children:e,resetAllFilter:r})})})}function JUe({resetAllFilter:e,children:t}){let{registerResetAllFilter:o,deregisterResetAllFilter:r}=(0,bk.useContext)(ZC.__experimentalToolsPanelContext),n=Ja(),i=(0,bk.useMemo)(()=>Wme(n,e),[e,n]);return(0,bk.useEffect)(()=>{if(i&&o&&r)return o(i),()=>{r(i)}},[i,o,r]),t}function e9e({children:e,resetAllFilter:t,fillProps:o}){let{forwardedContext:r=[]}=o,n=(0,wm.jsx)(JUe,{resetAllFilter:t,children:e});return r.reduce((i,[s,a])=>(0,wm.jsx)(s,{...a,children:i}),n)}var nhe=c(U(),1),ihe=c(F(),1),she=c(Yw(),1),ahe=c(Rt(),1);var Qme=c(U(),1),eL=c(Q(),1),Jme=c(F(),1);var Xme=c(fe(),1);function xr(){return(0,Xme.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}}}function yk(e,t){if(!e||!t)return t;let o=e.split(","),r=t.split(","),n=[];return o.forEach(i=>{r.forEach(s=>{n.push(`${i.trim()} ${s.trim()}`)})}),n.join(", ")}var ehe=c(E(),1);function the({children:e,group:t,label:o}){let{updateBlockAttributes:r}=(0,eL.useDispatch)(C),{getBlockAttributes:n,getBlockName:i,getMultiSelectedBlockClientIds:s,getSelectedBlockClientId:a,hasMultiSelection:l}=(0,eL.useSelect)(C),u=xr(),d=a(),f=(0,Jme.useCallback)((p=[])=>{let h={},m=l()?s():[d];m.forEach(g=>{let b=n(g)||{},{style:v}=b,y={style:v},k={attributes:b,clientId:g,name:i(g)};p.forEach(S=>{y={...y,...S(y,k)}}),y={...y,style:Ge(y.style)},h[g]=y}),r(m,h,!0)},[n,i,s,l,d,r]);return(0,ehe.jsx)(Qme.__experimentalToolsPanel,{className:`${t}-block-support-panel`,label:o,resetAll:f,panelId:d,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:u,children:e},d)}var S9=c(U(),1),tL=c(F(),1),ohe=c(E(),1);function rhe({Slot:e,fillProps:t,...o}){let r=(0,tL.useContext)(S9.__experimentalToolsPanelContext),n=(0,tL.useMemo)(()=>({...t??{},forwardedContext:[...t?.forwardedContext??[],[S9.__experimentalToolsPanelContext.Provider,{value:r}]]}),[r,t]);return(0,ohe.jsx)(e,{...o,fillProps:n,bubblesVirtually:!0})}var oL=c(E(),1);function t9e({__experimentalGroup:e,group:t="default",label:o,fillProps:r,...n},i){e&&((0,ahe.default)("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=e);let s=dc[t],a=(0,nhe.__experimentalUseSlotFills)(s?.name);if(!s)return(0,she.default)(`Unknown InspectorControls group "${t}" provided.`),null;if(!a?.length)return null;let{Slot:l}=s;return o?(0,oL.jsx)(the,{group:t,label:o,children:(0,oL.jsx)(rhe,{...n,fillProps:r,Slot:l})}):(0,oL.jsx)(l,{...n,ref:i,fillProps:r,bubblesVirtually:!0})}var k9=(0,ihe.forwardRef)(t9e);var _9=c(E(),1),lhe=Tb;lhe.Slot=k9;var Cm=e=>(0,_9.jsx)(Tb,{...e,group:"advanced"});Cm.Slot=function(t){return(0,_9.jsx)(k9,{...t,group:"advanced"})};Cm.slotName="InspectorAdvancedControls";var Oe=lhe;var uhe=c(Q(),1),Em=c(ue(),1),XC=c(G(),1);function che(e){let t=e?.style?.position?.type;return t==="sticky"?(0,XC.__)("Sticky"):t==="fixed"?(0,XC.__)("Fixed"):null}function Do(e){return(0,uhe.useSelect)(t=>{if(!e)return null;let o=t(C),{getBlockName:r,getBlockAttributes:n,getBlock:i,__experimentalGetParsedPattern:s}=o,{getBlockType:a,getActiveBlockVariation:l}=t(Em.store),u=r(e),d=a(u);if(!d)return null;let f=n(e),{isSectionBlock:p}=H(o),h=f?.metadata?.patternName;if(h&&p(e)){let S=s(h),_=che(f);return{isSynced:!1,title:(0,XC.__)("Pattern"),icon:Hc,description:S?.description||(0,XC.__)("A block pattern."),anchor:f?.anchor,positionLabel:_,positionType:f?.style?.position?.type,name:S?.title||f?.metadata?.name}}let m=l(u,f,void 0,i?.(e)?.innerContent),g=(0,Em.isReusableBlock)(d)||(0,Em.isTemplatePart)(d),v=(g?(0,Em.__experimentalGetBlockLabel)(d,f):void 0)||d.title,y=che(f),k={isSynced:g,title:v,icon:d.icon,description:d.description,anchor:f?.anchor,positionLabel:y,positionType:f?.style?.position?.type,name:f?.metadata?.name};return m?{isSynced:g,title:m.title||d.title,icon:m.icon||d.icon,description:m.description||d.description,anchor:f?.anchor,positionLabel:y,positionType:f?.style?.position?.type,name:f?.metadata?.name}:k},[e])}var Tm=c(E(),1),QC="position",x9={key:"default",value:"",label:(0,fc.__)("Default")},w9={key:"sticky",value:"sticky",label:(0,fc._x)("Sticky","Name for the value of the CSS position property"),hint:(0,fc.__)("The block will stick to the top of the window instead of scrolling.")},dhe={key:"fixed",value:"fixed",label:(0,fc._x)("Fixed","Name for the value of the CSS position property"),hint:(0,fc.__)("The block will not move when the page is scrolled.")},o9e=["top","right","bottom","left"],r9e=["sticky","fixed"];function n9e({selector:e,style:t}){let o="",{type:r}=t?.position||{};return r9e.includes(r)&&(o+=`${e} {`,o+=`position: ${r};`,o9e.forEach(n=>{t?.position?.[n]!==void 0&&(o+=`${n}: ${t.position[n]};`)}),(r==="sticky"||r==="fixed")&&(o+="z-index: 10"),o+="}"),o}function i9e(e){let t=(0,Rb.getBlockSupport)(e,QC);return!!(t===!0||t?.sticky)}function s9e(e){let t=(0,Rb.getBlockSupport)(e,QC);return!!(t===!0||t?.fixed)}function a9e(e){return!!(0,Rb.getBlockSupport)(e,QC)}function mhe(e){let t=e?.style?.position?.type;return t==="sticky"||t==="fixed"}function hhe({name:e}={}){let[t,o]=Le("position.fixed","position.sticky"),r=!t&&!o;return!a9e(e)||r}function l9e({style:e={},clientId:t,name:o,setAttributes:r}){let n=s9e(o),i=i9e(o),s=e?.position?.type,{firstParentClientId:a}=(0,phe.useSelect)(m=>{let{getBlockParents:g}=m(C),b=g(t);return{firstParentClientId:b[b.length-1]}},[t]),l=Do(a),u=i&&s===w9.value&&l?(0,fc.sprintf)((0,fc.__)("The block will stick to the scrollable area of the parent %s block."),l.title):null,d=(0,rL.useMemo)(()=>{let m=[x9];return(i||s===w9.value)&&m.push(w9),(n||s===dhe.value)&&m.push(dhe),m},[n,i,s]),f=m=>{let b={...e,position:{...e?.position,type:m,top:m==="sticky"||m==="fixed"?"0px":void 0}};r({style:Ge(b)})},p=s&&d.find(m=>m.value===s)||x9,h=(0,rL.useId)();return d.length>1?(0,Tm.jsx)(Oe,{group:"position",children:(0,Tm.jsx)(Y7,{label:(0,fc.__)("Position"),hideLabelFromVision:!0,description:u,items:d,value:p,onValueChange:m=>{f(m.value)},children:d.map(m=>{let g=m.hint?`${h}-${m.key}`:void 0;return(0,Tm.jsxs)(Y7.Item,{value:m,label:m.label,className:"block-editor-hooks__position-control-item","aria-describedby":g,children:[(0,Tm.jsx)("div",{children:m.label}),m.hint&&(0,Tm.jsx)("div",{id:g,className:"block-editor-hooks__position-control-item-hint","aria-hidden":"true",children:m.hint})]},m.key)})})}):null}var C9={edit:function(t){return hhe(t)?null:(0,Tm.jsx)(l9e,{...t})},useBlockProps:u9e,attributeKeys:["style"],hasSupport(e){return(0,Rb.hasBlockSupport)(e,QC)}},c9e={};function u9e({name:e,style:t}){let o=(0,Rb.hasBlockSupport)(e,QC),r=hhe({name:e}),n=o&&!r,i=(0,fhe.useInstanceId)(c9e),s=`.wp-container-${i}.wp-container-${i}`,a;n&&(a=n9e({selector:s,style:t})||"");let l=K({[`wp-container-${i}`]:n&&!!a,[`is-position-${t?.position?.type}`]:n&&!!a&&!!t?.position?.type});return el({css:a}),{className:l}}var khe={placement:"top-start"},ghe={...khe,flip:!1,shift:!0},d9e={...khe,flip:!0,shift:!1};function bhe(e,t,o,r,n){if(!e||!t)return ghe;let i=o?.scrollTop||0,s=Nv(t),a=e.getBoundingClientRect(),l=i+a.top,u=e.ownerDocument.documentElement.clientHeight,d=l+r,f=s.top>d,p=s.height>u-r;return!n&&(f||p)?ghe:d9e}function nL({contentElement:e,clientId:t}){let o=Nt(t),[r,n]=(0,Su.useState)(0),{blockIndex:i,isSticky:s}=(0,vhe.useSelect)(p=>{let{getBlockIndex:h,getBlockAttributes:m}=p(C);return{blockIndex:h(t),isSticky:mhe(m(t))}},[t]),a=(0,Su.useMemo)(()=>{if(e)return(0,She.getScrollContainer)(e)},[e]),[l,u]=(0,Su.useState)(()=>bhe(e,o,a,r,s)),d=(0,yhe.useRefEffect)(p=>{n(p.offsetHeight)},[]),f=(0,Su.useCallback)(()=>u(bhe(e,o,a,r,s)),[e,o,a,r,s]);return(0,Su.useLayoutEffect)(f,[i,f]),(0,Su.useLayoutEffect)(()=>{if(!e||!o)return;let p=e?.ownerDocument?.defaultView;p?.addEventListener?.("resize",f);let h,m=o?.ownerDocument?.defaultView;return m?.ResizeObserver&&(h=new m.ResizeObserver(f),h.observe(o)),()=>{p?.removeEventListener?.("resize",f),h&&h.disconnect()}},[f,e,o]),{...l,ref:d}}var _he=c(Q(),1);function iL(e){return(0,_he.useSelect)(o=>{let{getBlockRootClientId:r,getBlockParents:n,__experimentalGetBlockListSettingsForBlocks:i,isBlockInsertionPointVisible:s,getBlockInsertionPoint:a,getBlockOrder:l,hasMultiSelection:u,getLastMultiSelectedBlockClientId:d}=o(C),f=n(e),p=i(f),h=f.find(g=>p[g]?.__experimentalCaptureToolbars),m=!1;if(s()){let g=a();m=l(g.rootClientId)[g.index]===e}return{capturingClientId:h,isInsertionPointVisible:m,lastClientId:u()?d():null,rootClientId:r(e)}},[e])}var sL=c(E(),1);function xhe({clientId:e,__unstableContentRef:t}){let{capturingClientId:o,isInsertionPointVisible:r,lastClientId:n,rootClientId:i}=iL(e),s=nL({contentElement:t?.current,clientId:e});return(0,sL.jsx)(Xa,{clientId:o||e,bottomClientId:n,className:K("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":r}),__unstableContentRef:t,...s,children:(0,sL.jsx)("div",{className:"block-editor-block-list__empty-block-inserter",children:(0,sL.jsx)(Za,{position:"bottom right",rootClientId:i,clientId:e,__experimentalIsQuick:!0})})})}var eye=c(Q(),1),Vk=c(F(),1),tye=c(Yl(),1);var qbe=c(G(),1),Zbe=c(Q(),1),tG=c(F(),1),Xbe=c(fe(),1),tf=c(ue(),1),Qbe=c(U(),1);var Bb=c(U(),1),Lhe=c(Q(),1),Mhe=c(G(),1);var Rhe=c(ue(),1),Bhe=c(U(),1),JC=c(Q(),1),eE=c(F(),1),Phe=c(fe(),1);var Che=c(Tt(),1),ku=c(F(),1),aL=50,Ehe=25,f9e=1e3,whe=f9e*(Ehe/1e3);function The(){let e=(0,ku.useRef)(null),t=(0,ku.useRef)(null),o=(0,ku.useRef)(null),r=(0,ku.useRef)(null);(0,ku.useEffect)(()=>()=>{r.current&&(clearInterval(r.current),r.current=null)},[]);let n=(0,ku.useCallback)(a=>{e.current=a.clientY,o.current=(0,Che.getScrollContainer)(a.target),r.current=setInterval(()=>{if(o.current&&t.current){let l=o.current.scrollTop+t.current;o.current.scroll({top:l})}},Ehe)},[]),i=(0,ku.useCallback)(a=>{if(!o.current)return;let l=o.current.offsetHeight,u=e.current-o.current.offsetTop,d=a.clientY-o.current.offsetTop;if(a.clientY>u){let f=Math.max(l-u-aL,0),p=Math.max(d-u-aL,0),h=f===0||p===0?0:p/f;t.current=whe*h}else if(a.clientY{e.current=null,o.current=null,r.current&&(clearInterval(r.current),r.current=null)}]}var E9=c(E(),1),p9e=({appendToOwnerDocument:e,children:t,clientIds:o,cloneClassname:r,elementId:n,onDragStart:i,onDragEnd:s,fadeWhenDisabled:a=!1,dragComponent:l})=>{let{srcRootClientId:u,isDraggable:d,icon:f,visibleInserter:p,getBlockType:h}=(0,JC.useSelect)(R=>{let{canMoveBlocks:I,getBlockRootClientId:A,getBlockName:P,getBlockAttributes:O,isBlockInsertionPointVisible:N}=R(C),{getBlockType:z,getActiveBlockVariation:V}=R(Rhe.store),M=A(o[0]),D=P(o[0]),L=V(D,O(o[0]));return{srcRootClientId:M,isDraggable:I(o),icon:L?.icon||z(D)?.icon,visibleInserter:N(),getBlockType:z}},[o]),m=(0,eE.useRef)(!1),[g,b,v]=The(),{getAllowedBlocks:y,getBlockNamesByClientId:k,getBlockRootClientId:S}=(0,JC.useSelect)(C),{startDraggingBlocks:_,stopDraggingBlocks:x}=(0,JC.useDispatch)(C);(0,eE.useEffect)(()=>()=>{m.current&&x()},[]);let T=Nt(o[0])?.closest("body");return(0,eE.useEffect)(()=>{if(!T||!a)return;let I=(0,Phe.throttle)(A=>{if(!A.target.closest("[data-block]"))return;let P=k(o),O=A.target.closest("[data-block]").getAttribute("data-block"),N=y(O),z=k([O])[0],V;if(N?.length===0){let M=S(O),D=k([M])[0],L=y(M);V=U2(h,L,P,D)}else V=U2(h,N,P,z);!V&&!p?window?.document?.body?.classList?.add("block-draggable-invalid-drag-token"):window?.document?.body?.classList?.remove("block-draggable-invalid-drag-token")},200);return T.addEventListener("dragover",I),()=>{T.removeEventListener("dragover",I)}},[o,T,a,y,k,S,h,p]),d?(0,E9.jsx)(Bhe.Draggable,{appendToOwnerDocument:e,cloneClassname:r,__experimentalTransferDataType:"wp-blocks",transferData:{type:"block",srcClientIds:o,srcRootClientId:u},onDragStart:R=>{window.requestAnimationFrame(()=>{_(o),m.current=!0,g(R),i&&i()})},onDragOver:b,onDragEnd:()=>{x(),m.current=!1,v(),s&&s()},__experimentalDragComponent:l!==void 0?l:(0,E9.jsx)(e2,{count:o.length,icon:f,fadeWhenDisabled:!0}),elementId:n,children:({onDraggableStart:R,onDraggableEnd:I})=>t({draggable:!0,onDragStart:R,onDragEnd:I})}):t({draggable:!1})},lL=p9e;var Ohe=c(ue(),1),Ahe=c(U(),1);var cL=c(fe(),1),uL=c(Q(),1),vk=c(F(),1),tl=c(G(),1),T9=c(io(),1);var ot=c(G(),1),Rm=(e,t)=>e==="up"?t==="horizontal"?(0,ot.isRTL)()?"right":"left":"up":e==="down"?t==="horizontal"?(0,ot.isRTL)()?"left":"right":"down":null;function Ihe(e,t,o,r,n,i,s){let a=o+1;if(e>1)return m9e(e,o,r,n,i,s);if(r&&n)return(0,ot.sprintf)((0,ot.__)("Block %s is the only block, and cannot be moved"),t);if(i>0&&!n){let l=Rm("down",s);if(l==="down")return(0,ot.sprintf)((0,ot.__)("Move %1$s block from position %2$d down to position %3$d"),t,a,a+1);if(l==="left")return(0,ot.sprintf)((0,ot.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a+1);if(l==="right")return(0,ot.sprintf)((0,ot.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a+1)}if(i>0&&n){let l=Rm("down",s);if(l==="down")return(0,ot.sprintf)((0,ot.__)("Block %1$s is at the end of the content and can\u2019t be moved down"),t);if(l==="left")return(0,ot.sprintf)((0,ot.__)("Block %1$s is at the end of the content and can\u2019t be moved left"),t);if(l==="right")return(0,ot.sprintf)((0,ot.__)("Block %1$s is at the end of the content and can\u2019t be moved right"),t)}if(i<0&&!r){let l=Rm("up",s);if(l==="up")return(0,ot.sprintf)((0,ot.__)("Move %1$s block from position %2$d up to position %3$d"),t,a,a-1);if(l==="left")return(0,ot.sprintf)((0,ot.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a-1);if(l==="right")return(0,ot.sprintf)((0,ot.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a-1)}if(i<0&&r){let l=Rm("up",s);if(l==="up")return(0,ot.sprintf)((0,ot.__)("Block %1$s is at the beginning of the content and can\u2019t be moved up"),t);if(l==="left")return(0,ot.sprintf)((0,ot.__)("Block %1$s is at the beginning of the content and can\u2019t be moved left"),t);if(l==="right")return(0,ot.sprintf)((0,ot.__)("Block %1$s is at the beginning of the content and can\u2019t be moved right"),t)}}function m9e(e,t,o,r,n,i){let s=t+1;if(o&&r)return(0,ot.__)("All blocks are selected, and cannot be moved");if(n>0&&!r){let a=Rm("down",i);if(a==="down")return(0,ot.sprintf)((0,ot.__)("Move %1$d blocks from position %2$d down by one place"),e,s);if(a==="left")return(0,ot.sprintf)((0,ot.__)("Move %1$d blocks from position %2$d left by one place"),e,s);if(a==="right")return(0,ot.sprintf)((0,ot.__)("Move %1$d blocks from position %2$d right by one place"),e,s)}if(n>0&&r){let a=Rm("down",i);if(a==="down")return(0,ot.__)("Blocks cannot be moved down as they are already at the bottom");if(a==="left")return(0,ot.__)("Blocks cannot be moved left as they are already are at the leftmost position");if(a==="right")return(0,ot.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(n<0&&!o){let a=Rm("up",i);if(a==="up")return(0,ot.sprintf)((0,ot.__)("Move %1$d blocks from position %2$d up by one place"),e,s);if(a==="left")return(0,ot.sprintf)((0,ot.__)("Move %1$d blocks from position %2$d left by one place"),e,s);if(a==="right")return(0,ot.sprintf)((0,ot.__)("Move %1$d blocks from position %2$d right by one place"),e,s)}if(n<0&&o){let a=Rm("up",i);if(a==="up")return(0,ot.__)("Blocks cannot be moved up as they are already at the top");if(a==="left")return(0,ot.__)("Blocks cannot be moved left as they are already are at the leftmost position");if(a==="right")return(0,ot.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}var $d=c(E(),1),h9e=(e,t)=>e==="up"?t==="horizontal"?(0,tl.isRTL)()?un:Ti:Jh:e==="down"?t==="horizontal"?(0,tl.isRTL)()?Ti:un:cn:null,g9e=(e,t)=>e==="up"?t==="horizontal"?(0,tl.isRTL)()?(0,tl.__)("Move right"):(0,tl.__)("Move left"):(0,tl.__)("Move up"):e==="down"?t==="horizontal"?(0,tl.isRTL)()?(0,tl.__)("Move left"):(0,tl.__)("Move right"):(0,tl.__)("Move down"):null,R9=(0,vk.forwardRef)(({clientIds:e,direction:t,orientation:o,...r},n)=>{let i=(0,cL.useInstanceId)(R9),s=(0,vk.useMemo)(()=>Array.isArray(e)?e:[e],[e]),a=s.length,l=(0,cL.useViewportMatch)("small","<"),{blockType:u,isDisabled:d,rootClientId:f,isFirst:p,isLast:h,firstIndex:m,orientation:g="vertical"}=(0,uL.useSelect)(_=>{let{getBlockIndex:x,getBlockRootClientId:w,getBlockOrder:T,getBlock:B,getBlockListSettings:R}=_(C),I=s[0],A=w(I),P=x(I),O=x(s[s.length-1]),N=T(A),z=B(I),V=P===0,M=O===N.length-1,{orientation:D}=R(A)||{};return{blockType:z?(0,Ohe.getBlockType)(z.name):null,isDisabled:t==="up"?V:M,rootClientId:A,firstIndex:P,isFirst:V,isLast:M,orientation:o||D}},[t,o,s]),{moveBlocksDown:b,moveBlocksUp:v}=(0,uL.useDispatch)(C),y=t==="up"?v:b,k=_=>{y(e,f),r.onClick&&r.onClick(_)},S=`block-editor-block-mover-button__description-${i}`;return(0,$d.jsxs)($d.Fragment,{children:[(0,$d.jsx)(Ahe.Button,{__next40pxDefaultSize:!0,ref:n,className:K("block-editor-block-mover-button",`is-${t}-button`),icon:h9e(t,g),label:g9e(t,g),tooltipPosition:!l&&t==="down"&&g==="vertical"?"bottom":"top","aria-describedby":S,...r,onClick:d?null:k,disabled:d,accessibleWhenDisabled:!0,shortcut:t==="up"?T9.displayShortcut.secondary("t"):T9.displayShortcut.secondary("y")}),(0,$d.jsx)(bt,{id:S,children:Ihe(a,u&&u.title,m,p,h,t==="up"?-1:1,g)})]})}),dL=(0,vk.forwardRef)((e,t)=>(0,$d.jsx)(R9,{direction:"up",ref:t,...e})),fL=(0,vk.forwardRef)((e,t)=>(0,$d.jsx)(R9,{direction:"down",ref:t,...e}));var _u=c(E(),1);function b9e({clientIds:e,hideDragHandle:t}){let{canMove:o,rootClientId:r,isFirst:n,isLast:i,orientation:s,isManualGrid:a}=(0,Lhe.useSelect)(l=>{let{getBlockIndex:u,getBlockListSettings:d,canMoveBlocks:f,getBlockOrder:p,getBlockRootClientId:h,getBlockAttributes:m}=l(C),g=Array.isArray(e)?e:[e],b=g[0],v=h(b),y=u(b),k=u(g[g.length-1]),S=p(v),{layout:_={}}=m(v)??{};return{canMove:f(e),rootClientId:v,isFirst:y===0,isLast:k===S.length-1,orientation:d(v)?.orientation,isManualGrid:_.type==="grid"&&_.isManualPlacement&&window.__experimentalEnableGridInteractivity}},[e]);return!o||n&&i&&!r||t&&a?null:(0,_u.jsxs)(Bb.ToolbarGroup,{className:K("block-editor-block-mover",{"is-horizontal":s==="horizontal"}),children:[!t&&(0,_u.jsx)(lL,{clientIds:e,fadeWhenDisabled:!0,children:l=>(0,_u.jsx)(Bb.Button,{__next40pxDefaultSize:!0,icon:Hx,className:"block-editor-block-mover__drag-handle",label:(0,Mhe.__)("Drag"),tabIndex:"-1",...l})}),!a&&(0,_u.jsxs)("div",{className:"block-editor-block-mover__move-button-container",children:[(0,_u.jsx)(Bb.ToolbarItem,{children:l=>(0,_u.jsx)(dL,{clientIds:e,...l})}),(0,_u.jsx)(Bb.ToolbarItem,{children:l=>(0,_u.jsx)(fL,{clientIds:e,...l})})]})]})}var pL=b9e;var Vhe=c(U(),1),hL=c(Q(),1),gL=c(G(),1),Fhe=c(F(),1);var tE=c(Q(),1),Bm=c(F(),1);var{clearTimeout:Nhe,setTimeout:y9e}=window,Dhe=200;function v9e({ref:e,isFocused:t,highlightParent:o,debounceTimeout:r=Dhe}){let{getSelectedBlockClientId:n,getBlockRootClientId:i}=(0,tE.useSelect)(C),{toggleBlockHighlight:s}=(0,tE.useDispatch)(C),a=(0,Bm.useRef)(),l=(0,tE.useSelect)(g=>g(C).getSettings().isDistractionFree,[]),u=g=>{if(g&&l)return;let b=n(),v=o?i(b):b;s(v,g)},d=()=>e?.current&&e.current.matches(":hover"),f=()=>{let g=d();return!t&&!g},p=()=>{let g=a.current;g&&Nhe&&Nhe(g)},h=g=>{g&&g.stopPropagation(),p(),u(!0)},m=g=>{g&&g.stopPropagation(),p(),a.current=y9e(()=>{f()&&u(!1)},r)};return(0,Bm.useEffect)(()=>()=>{u(!1),p()},[]),{debouncedShowGestures:h,debouncedHideGestures:m}}function Sk({ref:e,highlightParent:t=!1,debounceTimeout:o=Dhe}){let[r,n]=(0,Bm.useState)(!1),{debouncedShowGestures:i,debouncedHideGestures:s}=v9e({ref:e,debounceTimeout:o,isFocused:r,highlightParent:t}),a=(0,Bm.useRef)(!1),l=()=>e?.current&&e.current.contains(e.current.ownerDocument.activeElement);return(0,Bm.useEffect)(()=>{let u=e.current,d=()=>{l()&&(n(!0),i())},f=()=>{l()||(n(!1),s())};return u&&!a.current&&(u.addEventListener("focus",d,!0),u.addEventListener("blur",f,!0),a.current=!0),()=>{u&&(u.removeEventListener("focus",d),u.removeEventListener("blur",f))}},[e,a,n,i,s]),{onMouseMove:i,onMouseLeave:s}}var mL=c(E(),1);function zhe(){let{selectBlock:e}=(0,hL.useDispatch)(C),{parentClientId:t}=(0,hL.useSelect)(i=>{let{getBlockParents:s,getSelectedBlockClientIds:a,getParentSectionBlock:l}=H(i(C)),[u]=a(),d=l(u),f=s(u);return{parentClientId:d??f[f.length-1]}},[]),o=Do(t),r=(0,Fhe.useRef)(),n=Sk({ref:r,highlightParent:!0});return(0,mL.jsx)("div",{className:"block-editor-block-parent-selector",ref:r,...n,children:(0,mL.jsx)(Vhe.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(t),label:(0,gL.sprintf)((0,gL.__)("Select parent block: %s"),o?.title),showTooltip:!0,icon:(0,mL.jsx)(Et,{icon:o?.icon})})},t)}var bL=c(U(),1);var Pb=c(U(),1),S9e=(0,Pb.createSlotFill)("BlockControls"),k9e=(0,Pb.createSlotFill)("BlockControlsBlock"),_9e=(0,Pb.createSlotFill)("BlockFormatControls"),x9e=(0,Pb.createSlotFill)("BlockControlsOther"),w9e=(0,Pb.createSlotFill)("BlockControlsParent"),C9e=(0,Pb.createSlotFill)("BlockControlsStyleState"),E9e={default:S9e,block:k9e,inline:_9e,other:x9e,parent:w9e,"style-state":C9e},oE=E9e;function jhe(e,t){let o=ht();return o[Dl]?oE[e]?.Fill:o[Vy]&&t?oE.parent.Fill:null}var Kd=c(E(),1);function B9({group:e="default",controls:t,children:o,__experimentalShareWithChildBlocks:r=!1}){let n=jhe(e,r);if(!n)return null;let i=(0,Kd.jsxs)(Kd.Fragment,{children:[e==="default"&&(0,Kd.jsx)(bL.ToolbarGroup,{controls:t}),o]});return(0,Kd.jsx)(bL.__experimentalStyleProvider,{document,children:(0,Kd.jsx)(n,{children:s=>{let{forwardedContext:a=[]}=s;return a.reduce((l,[u,d])=>(0,Kd.jsx)(u,{...d,children:l}),i)}})})}var rE=c(F(),1),Yd=c(U(),1),Uhe=c(Yw(),1);var P9=c(E(),1),{ComponentsContext:Hhe}=H(Yd.privateApis);function I9({group:e="default",...t}){let o=(0,rE.useContext)(Yd.__experimentalToolbarContext),r=(0,rE.useContext)(Hhe),n=(0,rE.useMemo)(()=>({forwardedContext:[[Yd.__experimentalToolbarContext.Provider,{value:o}],[Hhe.Provider,{value:r}]]}),[o,r]),i=oE[e],s=(0,Yd.__experimentalUseSlotFills)(i.name);if(!i)return(0,Uhe.default)(`Unknown BlockControls group "${e}" provided.`),null;if(!s?.length)return null;let{Slot:a}=i,l=(0,P9.jsx)(a,{...t,bubblesVirtually:!0,fillProps:n});return e==="default"?l:(0,P9.jsx)(Yd.ToolbarGroup,{children:l})}var O9=c(E(),1),Ghe=B9;Ghe.Slot=I9;var A9=e=>(0,O9.jsx)(B9,{group:"inline",...e});A9.Slot=function(t){return(0,O9.jsx)(I9,{group:"inline",...t})};var No=Ghe;var Whe=c(U(),1),{Fill:$he,Slot:T9e}=(0,Whe.createSlotFill)("__unstableBlockToolbarLastItem");$he.Slot=T9e;var yL=$he;var DL=c(U(),1);var Tk=c(ue(),1),Ui=c(U(),1),Im=c(Q(),1);var ML=c(F(),1),nl=c(G(),1),Kge=c(Yl(),1),Xd=c(fe(),1);var xk=c(Q(),1),wk=c(ue(),1);var lge=c(F(),1),iE=c(ue(),1),nE=c(Q(),1),cge=c(as(),1),qd=c(G(),1);var ta=c(ue(),1),R9e="align";var Khe="__experimentalBorder",vL="color",B9e="customClassName",Yhe="typography.__experimentalFontFamily",qhe="typography.fontSize",P9e="typography.lineHeight",I9e="typography.__experimentalFontStyle",O9e="typography.__experimentalFontWeight",Zhe="typography.textAlign",A9e="typography.textColumns",L9e="typography.__experimentalTextDecoration",M9e="typography.__experimentalWritingMode",N9e="typography.__experimentalTextTransform",D9e="typography.__experimentalLetterSpacing",V9e="layout",F9e=[P9e,qhe,I9e,O9e,Yhe,Zhe,A9e,L9e,N9e,M9e,D9e],z9e=["shadow"],j9e="spacing",H9e=[...z9e,...F9e,Khe,vL,j9e],Xhe=e=>(0,ta.hasBlockSupport)(e,R9e);function Qhe(e,t="any"){let o=(0,ta.getBlockSupport)(e,Khe);return o===!0?!0:t==="any"?!!(o?.color||o?.radius||o?.width||o?.style):!!o?.[t]}var Jhe=e=>{let t=(0,ta.getBlockSupport)(e,vL);return t!==null&&typeof t=="object"&&!!t.gradients},ege=e=>{let t=(0,ta.getBlockSupport)(e,vL);return t&&t.background!==!1},tge=e=>(0,ta.hasBlockSupport)(e,Zhe);var oge=e=>{let t=(0,ta.getBlockSupport)(e,vL);return t&&t.text!==!1};var rge=e=>(0,ta.hasBlockSupport)(e,B9e,!0);var nge=e=>(0,ta.hasBlockSupport)(e,Yhe);var ige=e=>(0,ta.hasBlockSupport)(e,qhe);var sge=e=>(0,ta.hasBlockSupport)(e,V9e);var age=e=>H9e.some(t=>(0,ta.hasBlockSupport)(e,t));function U9e(e){try{let t=(0,iE.parse)(e,{__unstableSkipMigrationLogs:!0,__unstableSkipAutop:!0});return!(t.length===1&&t[0].name==="core/freeform")}catch{return!1}}var G9e={align:Xhe,borderColor:e=>Qhe(e,"color"),backgroundColor:ege,textAlign:tge,textColor:oge,gradient:Jhe,className:rge,fontFamily:nge,fontSize:ige,layout:sge,style:age};function W9e(e,t){return Object.entries(G9e).reduce((o,[r,n])=>(n(e.name)&&n(t.name)&&(o[r]=e.attributes[r]),o),{})}function L9(e,t,o){for(let r=0;r{let s="";try{if(!window.navigator.clipboard){n((0,qd.__)("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers."),{type:"snackbar"});return}s=await window.navigator.clipboard.readText()}catch{n((0,qd.__)("Unable to paste styles. Please allow browser clipboard permissions before continuing."),{type:"snackbar"});return}if(!s||!U9e(s)){r((0,qd.__)("Unable to paste styles. Block styles couldn't be found within the copied content."),{type:"snackbar"});return}let a=(0,iE.parse)(s);if(a.length===1?e.batch(()=>{L9(i,i.map(()=>a[0]),t)}):e.batch(()=>{L9(i,a,t)}),i.length===1){let l=(0,iE.getBlockType)(i[0].name)?.title;o((0,qd.sprintf)((0,qd.__)("Pasted styles to %s."),l),{type:"snackbar"})}else o((0,qd.sprintf)((0,qd.__)("Pasted styles to %d blocks."),i.length),{type:"snackbar"})},[e.batch,t,o,r,n])}var _k=c(ue(),1);function ol(e,t){let o=(0,_k.findTransform)((0,_k.getBlockTransforms)("from",t),r=>r.type==="block"&&r.isMultiBlock&&r.blocks.includes("*"));if(o?.__experimentalConvert){let r=o.__experimentalConvert(e);return Array.isArray(r)?r:[r]}return(0,_k.switchToBlockType)(e,t)}function uge({clientIds:e,children:t,__experimentalUpdateSelection:o}){let{getDefaultBlockName:r,getGroupingBlockName:n}=(0,xk.useSelect)(wk.store),i=(0,xk.useSelect)(k=>{let{canInsertBlockType:S,getBlockRootClientId:_,getBlocksByClientId:x,getDirectInsertBlock:w,canRemoveBlocks:T}=k(C),B=x(e),R=_(e[0]),I=S(r(),R),A=R?w(R):null;return{canRemove:T(e),canInsertBlock:B.every(P=>(I||!!A)&&S(P.name,R)),canCopyStyles:B.every(P=>!!P&&((0,wk.hasBlockSupport)(P.name,"color")||(0,wk.hasBlockSupport)(P.name,"typography"))),canDuplicate:B.every(P=>!!P&&(0,wk.hasBlockSupport)(P.name,"multiple",!0)&&S(P.name,R))}},[e,r]),{getBlocksByClientId:s,getBlocks:a}=(0,xk.useSelect)(C),{canRemove:l,canInsertBlock:u,canCopyStyles:d,canDuplicate:f}=i,{removeBlocks:p,replaceBlocks:h,duplicateBlocks:m,insertAfterBlock:g,insertBeforeBlock:b,flashBlock:v}=(0,xk.useDispatch)(C),y=kk();return t({canCopyStyles:d,canDuplicate:f,canInsertBlock:u,canRemove:l,onDuplicate(){return m(e,o)},onRemove(){return p(e,o)},onInsertBefore(){b(e[0])},onInsertAfter(){g(e[e.length-1])},onGroup(){if(!e.length)return;let k=n(),S=ol(s(e),k);S&&h(e,S)},onUngroup(){if(!e.length)return;let k=a(e[0]);k.length&&h(e,k)},onCopy(){e.length===1&&v(e[0])},async onPasteStyles(){await y(s(e))}})}var dge=c(U(),1),$9e=(0,dge.createSlotFill)(Symbol("NoteIconSlotFill")),SL=$9e;var fge=c(G(),1),pge=c(U(),1),kL=c(ue(),1),_L=c(Q(),1);var mge=c(E(),1);function K9e({clientId:e}){let t=(0,_L.useSelect)(r=>r(C).getBlock(e),[e]),{replaceBlocks:o}=(0,_L.useDispatch)(C);return!t||t.name!=="core/html"?null:(0,mge.jsx)(pge.MenuItem,{onClick:()=>o(e,(0,kL.rawHandler)({HTML:(0,kL.getBlockContent)(t)})),children:(0,fge.__)("Convert to Blocks")})}var hge=K9e;var gge=c(U(),1),{Fill:bge,Slot:Y9e}=(0,gge.createSlotFill)("__unstableBlockSettingsMenuFirstItem");bge.Slot=Y9e;var xL=bge;var Ek=c(U(),1),Fge=c(ue(),1),zge=c(Q(),1);var N9=c(U(),1),D9=c(G(),1),CL=c(Q(),1),kge=c(io(),1);var yge=c(ue(),1),vge=c(Q(),1);function sE(e){return(0,vge.useSelect)(t=>{let{getBlocksByClientId:o,getSelectedBlockClientIds:r,isUngroupable:n,isGroupable:i}=t(C),{getGroupingBlockName:s,getBlockType:a}=t(yge.store),l=e?.length?e:r(),u=o(l),[d]=u,f=l.length===1&&n(l[0]);return{clientIds:l,isGroupable:i(l),isUngroupable:f,blocksSelection:u,groupingBlockName:s(),onUngroup:f&&a(d.name)?.transforms?.ungroup}},[e])}var wL=c(Q(),1),Sge=c(ue(),1),Ib=c(U(),1);var aE=c(G(),1);var Ob=c(E(),1),q9e={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"},grid:{type:"grid"}};function Z9e(){let{blocksSelection:e,clientIds:t,groupingBlockName:o,isGroupable:r}=sE(),{replaceBlocks:n}=(0,wL.useDispatch)(C),{canRemove:i,variations:s}=(0,wL.useSelect)(m=>{let{canRemoveBlocks:g}=m(C),{getBlockVariations:b}=m(Sge.store);return{canRemove:g(t),variations:b(o,"transform")}},[t,o]),a=m=>{let g=ol(e,o);typeof m!="string"&&(m="group"),g&&g.length>0&&(g[0].attributes.layout=q9e[m],n(t,g))},l=()=>a("row"),u=()=>a("stack"),d=()=>a("grid");if(!r||!i)return null;let f=!!s.find(({name:m})=>m==="group-row"),p=!!s.find(({name:m})=>m==="group-stack"),h=!!s.find(({name:m})=>m==="group-grid");return(0,Ob.jsxs)(Ib.ToolbarGroup,{children:[(0,Ob.jsx)(Ib.ToolbarButton,{icon:Wx,label:(0,aE._x)("Group","action: convert blocks to group"),onClick:a}),f&&(0,Ob.jsx)(Ib.ToolbarButton,{icon:X4,label:(0,aE._x)("Row","action: convert blocks to row"),onClick:l}),p&&(0,Ob.jsx)(Ib.ToolbarButton,{icon:f6,label:(0,aE._x)("Stack","action: convert blocks to stack"),onClick:u}),h&&(0,Ob.jsx)(Ib.ToolbarButton,{icon:Gx,label:(0,aE._x)("Grid","action: convert blocks to grid"),onClick:d})]})}var M9=Z9e;var Ab=c(E(),1);function _ge({clientIds:e,isGroupable:t,isUngroupable:o,onUngroup:r,blocksSelection:n,groupingBlockName:i,onClose:s=()=>{}}){let{getSelectedBlockClientIds:a}=(0,CL.useSelect)(C),{replaceBlocks:l}=(0,CL.useDispatch)(C),u=()=>{let p=ol(n,i);p&&l(e,p)},d=()=>{let p=n[0].innerBlocks;p.length&&(r&&(p=r(n[0].attributes,n[0].innerBlocks)),l(e,p))};if(!t&&!o)return null;let f=a();return(0,Ab.jsxs)(Ab.Fragment,{children:[t&&(0,Ab.jsx)(N9.MenuItem,{shortcut:f.length>1?kge.displayShortcut.primary("g"):void 0,onClick:()=>{u(),s()},children:(0,D9._x)("Group","verb")}),o&&(0,Ab.jsx)(N9.MenuItem,{onClick:()=>{d(),s()},children:(0,D9._x)("Ungroup","Ungrouping blocks from within a grouping block back into individual blocks within the Editor")})]})}var V9=c(G(),1),Cge=c(F(),1),Ege=c(U(),1);var xge=c(Q(),1);function oa(e){return(0,xge.useSelect)(t=>{let{canLockBlockType:o,getBlockName:r,isEditLockedBlock:n,isMoveLockedBlock:i,isRemoveLockedBlock:s,isLockedBlock:a}=H(t(C));return{isEditLocked:n(e),isMoveLocked:i(e),isRemoveLocked:s(e),canLock:o(r(e)),isLocked:a(e)}},[e])}var rl=c(G(),1),lE=c(F(),1),Hr=c(U(),1);var EL=c(Q(),1),wge=c(ue(),1);var Vo=c(E(),1),X9e=["core/navigation"];function Q9e(e){return e.remove&&e.move?"all":e.remove&&!e.move?"insert":!1}function TL({clientId:e,onClose:t}){let[o,r]=(0,lE.useState)({move:!1,remove:!1}),{isEditLocked:n,isMoveLocked:i,isRemoveLocked:s}=oa(e),{allowsEditLocking:a,templateLock:l,hasTemplateLock:u}=(0,EL.useSelect)(v=>{let{getBlockName:y,getBlockAttributes:k}=v(C),S=y(e),_=(0,wge.getBlockType)(S);return{allowsEditLocking:X9e.includes(S),templateLock:k(e)?.templateLock,hasTemplateLock:!!_?.attributes?.templateLock}},[e]),[d,f]=(0,lE.useState)(!!l),{updateBlockAttributes:p}=(0,EL.useDispatch)(C),h=Do(e);(0,lE.useEffect)(()=>{r({move:i,remove:s,...a?{edit:n}:{}})},[n,i,s,a]);let m=Object.values(o).every(Boolean),g=Object.values(o).some(Boolean)&&!m,b=o.move!==i||o.remove!==s||a&&o.edit!==n||u&&d!==!!l;return(0,Vo.jsx)(Hr.Modal,{title:(0,rl.sprintf)((0,rl.__)("Lock %s"),h.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:t,size:"small",children:(0,Vo.jsxs)("form",{onSubmit:v=>{v.preventDefault(),b&&(p([e],{lock:o,templateLock:d?Q9e(o):void 0}),t())},children:[(0,Vo.jsxs)("fieldset",{className:"block-editor-block-lock-modal__options",children:[(0,Vo.jsx)("legend",{children:(0,rl.__)("Select the features you want to lock")}),(0,Vo.jsx)("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:(0,Vo.jsxs)("li",{children:[(0,Vo.jsx)(Hr.CheckboxControl,{className:"block-editor-block-lock-modal__options-all",label:(0,rl.__)("Lock all"),checked:m,indeterminate:g,onChange:v=>r({move:v,remove:v,...a?{edit:v}:{}})}),(0,Vo.jsxs)("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:[a&&(0,Vo.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,Vo.jsx)(Hr.CheckboxControl,{label:(0,rl.__)("Lock editing"),checked:!!o.edit,onChange:v=>r(y=>({...y,edit:v}))}),(0,Vo.jsx)(Hr.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.edit?ag:ad})]}),(0,Vo.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,Vo.jsx)(Hr.CheckboxControl,{label:(0,rl.__)("Lock movement"),checked:o.move,onChange:v=>r(y=>({...y,move:v}))}),(0,Vo.jsx)(Hr.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.move?ag:ad})]}),(0,Vo.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,Vo.jsx)(Hr.CheckboxControl,{label:(0,rl.__)("Lock removal"),checked:o.remove,onChange:v=>r(y=>({...y,remove:v}))}),(0,Vo.jsx)(Hr.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.remove?ag:ad})]})]})]})}),u&&(0,Vo.jsx)(Hr.ToggleControl,{className:"block-editor-block-lock-modal__template-lock",label:(0,rl.__)("Apply to all blocks inside"),checked:d,disabled:o.move&&!o.remove,onChange:()=>f(!d)})]}),(0,Vo.jsxs)(Hr.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,Vo.jsx)(Hr.FlexItem,{children:(0,Vo.jsx)(Hr.Button,{variant:"tertiary",onClick:t,__next40pxDefaultSize:!0,children:(0,rl.__)("Cancel")})}),(0,Vo.jsx)(Hr.FlexItem,{children:(0,Vo.jsx)(Hr.Button,{variant:"primary",type:"submit",disabled:!b,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,rl.__)("Apply")})})]})]})})}var Lb=c(E(),1);function F9({clientId:e}){let{canLock:t,isLocked:o}=oa(e),[r,n]=(0,Cge.useReducer)(s=>!s,!1);if(!t)return null;let i=o?(0,V9.__)("Unlock"):(0,V9.__)("Lock");return(0,Lb.jsxs)(Lb.Fragment,{children:[(0,Lb.jsx)(Ege.MenuItem,{icon:o?ad:C4,onClick:n,"aria-expanded":r,"aria-haspopup":"dialog",children:i}),r&&(0,Lb.jsx)(TL,{clientId:e,onClose:n})]})}var RL=c(G(),1),BL=c(U(),1),Ck=c(F(),1);var Pm=c(E(),1);function z9({clientId:e}){let{canLock:t,isLocked:o}=oa(e),[r,n]=(0,Ck.useReducer)(a=>!a,!1),i=(0,Ck.useRef)(!1);if((0,Ck.useEffect)(()=>{o&&(i.current=!0)},[o]),!o&&!i.current)return null;let s=o?(0,RL.__)("Unlock"):(0,RL.__)("Lock");return!t&&o&&(s=(0,RL.__)("Locked")),(0,Pm.jsxs)(Pm.Fragment,{children:[(0,Pm.jsx)(BL.ToolbarGroup,{className:"block-editor-block-lock-toolbar",children:(0,Pm.jsx)(BL.ToolbarButton,{disabled:!t,icon:o?ag:ad,label:s,onClick:n,"aria-expanded":r,"aria-haspopup":"dialog"})}),r&&(0,Pm.jsx)(TL,{clientId:e,onClose:n})]})}var j9=c(G(),1),Tge=c(U(),1),PL=c(ue(),1),IL=c(Q(),1);var Rge=c(E(),1),J9e=()=>{};function Bge({clientId:e,onToggle:t=J9e}){let{blockType:o,mode:r,enabled:n}=(0,IL.useSelect)(a=>{let{getBlock:l,getBlockMode:u,getSettings:d}=a(C),f=l(e);return{mode:u(e),blockType:f?(0,PL.getBlockType)(f.name):null,enabled:d().codeEditingEnabled&&!!f?.isValid}},[e]),{toggleBlockMode:i}=(0,IL.useDispatch)(C);if(!o||!(0,PL.hasBlockSupport)(o,"html",!0)||!n)return null;let s=r==="visual"?(0,j9.__)("Edit as HTML"):(0,j9.__)("Edit visually");return(0,Rge.jsx)(Tge.MenuItem,{onClick:()=>{i(e),t()},children:s})}var Age=c(U(),1),Lge=c(G(),1),Mge=c(F(),1),Nge=c(Q(),1),Dge=c(Yl(),1);var mc=c(U(),1),pc=c(G(),1),Ige=c(F(),1),Oge=c(Qr(),1),OL=c(Q(),1);function Pge(e){return e?.trim()?.length===0}var Zd=c(E(),1);function Mb({clientId:e,onClose:t}){let[o,r]=(0,Ige.useState)(),n=Do(e),{metadata:i}=(0,OL.useSelect)(b=>{let{getBlockAttributes:v}=b(C);return{metadata:v(e)?.metadata}},[e]),{updateBlockAttributes:s}=(0,OL.useDispatch)(C),a=i?.name||"",l=n?.title,u=!!a&&!!i?.bindings&&Object.values(i.bindings).some(b=>b.source==="core/pattern-overrides"),d=o!==void 0&&o!==a,f=o===l,p=Pge(o),h=d||f,m=b=>b.target.select(),g=()=>{let b=f||p?void 0:o,v=f||p?(0,pc.sprintf)((0,pc.__)('Block name reset to: "%s".'),o):(0,pc.sprintf)((0,pc.__)('Block name changed to: "%s".'),o);(0,Oge.speak)(v,"assertive"),s([e],{metadata:Ge({...i,name:b})}),t()};return(0,Zd.jsx)(mc.Modal,{title:(0,pc.__)("Rename"),onRequestClose:t,overlayClassName:"block-editor-block-rename-modal",focusOnMount:"firstContentElement",size:"small",children:(0,Zd.jsx)("form",{onSubmit:b=>{b.preventDefault(),h&&g()},children:(0,Zd.jsxs)(mc.__experimentalVStack,{spacing:"3",children:[(0,Zd.jsx)(mc.TextControl,{value:o??a,label:(0,pc.__)("Name"),help:u?(0,pc.__)("This block allows overrides. Changing the name can cause problems with content entered into instances of this pattern."):void 0,placeholder:l,onChange:r,onFocus:m}),(0,Zd.jsxs)(mc.__experimentalHStack,{justify:"right",children:[(0,Zd.jsx)(mc.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,children:(0,pc.__)("Cancel")}),(0,Zd.jsx)(mc.Button,{__next40pxDefaultSize:!0,accessibleWhenDisabled:!0,disabled:!h,variant:"primary",type:"submit",children:(0,pc.__)("Save")})]})]})})})}var Nb=c(E(),1);function H9({clientId:e}){let[t,o]=(0,Mge.useState)(!1),r=(0,Nge.useSelect)(n=>n(Dge.store).getShortcutRepresentation("core/block-editor/rename"),[]);return(0,Nb.jsxs)(Nb.Fragment,{children:[(0,Nb.jsx)(Age.MenuItem,{onClick:()=>{o(!0)},"aria-expanded":t,"aria-haspopup":"dialog",shortcut:r,children:(0,Lge.__)("Rename")}),t&&(0,Nb.jsx)(Mb,{clientId:e,onClose:()=>o(!1)})]})}var Vge=c(ue(),1);function Db(e){return{canRename:!!e&&(0,Vge.getBlockSupport)(e,"renaming",!0)}}var hc=c(E(),1),{Fill:eGe,Slot:tGe}=(0,Ek.createSlotFill)("BlockSettingsMenuControls"),oGe=({fillProps:e,clientIds:t=null})=>{let{selectedBlocks:o,selectedClientIds:r,isContentOnly:n,canToggleSelectedBlocksVisibility:i,canEdit:s}=(0,zge.useSelect)(b=>{let{getBlocksByClientId:v,getBlockNamesByClientId:y,getSelectedBlockClientIds:k,getBlockEditingMode:S,canEditBlock:_}=b(C),x=t!==null?t:k();return{selectedBlocks:y(x),selectedClientIds:x,isContentOnly:S(x[0])==="contentOnly",canToggleSelectedBlocksVisibility:v(x).every(w=>(0,Fge.hasBlockSupport)(w.name,"visibility",!0)),canEdit:_(x[0])}},[t]),{canLock:a}=oa(r[0]),{canRename:l}=Db(o[0]),u=r.length===1&&a&&!n,d=r.length===1&&l&&!n,f=i&&!n,p=sE(r),{isGroupable:h,isUngroupable:m}=p,g=(h||m)&&!n;return(0,hc.jsx)(tGe,{fillProps:{...e,canEdit:s,selectedBlocks:o,selectedClientIds:r},children:b=>!b?.length>0&&!g&&!u?null:(0,hc.jsxs)(Ek.MenuGroup,{children:[g&&(0,hc.jsx)(_ge,{...p,onClose:e?.onClose}),s&&u&&(0,hc.jsx)(F9,{clientId:r[0]}),s&&d&&(0,hc.jsx)(H9,{clientId:r[0]}),s&&f&&(0,hc.jsx)(Wj,{clientIds:r}),b,s&&e?.count===1&&!n&&(0,hc.jsx)(Bge,{clientId:e?.firstBlockClientId,onToggle:e?.onClose})]})})};function jge({...e}){return(0,hc.jsx)(Ek.__experimentalStyleProvider,{document,children:(0,hc.jsx)(eGe,{...e})})}jge.Slot=oGe;var AL=jge;var Hge=c(F(),1),Uge=c(U(),1),Gge=c(fe(),1),Wge=c(Q(),1),LL=c(G(),1);var U9=c(E(),1);function $ge({parentClientId:e,parentBlockType:t}){let o=(0,Gge.useViewportMatch)("medium","<"),{selectBlock:r}=(0,Wge.useDispatch)(C),n=(0,Hge.useRef)(),i=Sk({ref:n,highlightParent:!0});return o?(0,U9.jsx)(Uge.MenuItem,{...i,ref:n,icon:(0,U9.jsx)(Et,{icon:t.icon}),onClick:()=>r(e),children:(0,LL.sprintf)((0,LL.__)("Select parent block (%s)"),t.title)}):null}var eo=c(E(),1),rGe={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"};function G9({clientIds:e,onCopy:t,label:o,shortcut:r,eventType:n="copy",__experimentalUpdateSelection:i=!1}){let{getBlocksByClientId:s}=(0,Im.useSelect)(C),{removeBlocks:a}=(0,Im.useDispatch)(C),l=PS(),u=(0,Xd.useCopyToClipboard)(()=>(0,Tk.serialize)(s(e)),()=>{switch(n){case"copy":case"copyStyles":t(),l(n,e);break;case"cut":l(n,e),a(e,i);break;default:break}}),d=o||(0,nl.__)("Copy");return(0,eo.jsx)(Ui.MenuItem,{ref:u,shortcut:r,children:d})}function W9({block:e,clientIds:t,children:o,__experimentalSelectBlock:r,isContentOnlyListView:n,...i}){let s=t.length,a=t[0],{firstParentClientId:l,parentBlockType:u,previousBlockClientId:d,selectedBlockClientIds:f,isContentOnly:p,isZoomOut:h,canEdit:m,canMove:g,isFirst:b,isLast:v}=(0,Im.useSelect)(A=>{let{getBlockName:P,getBlockRootClientId:O,getPreviousBlockClientId:N,getSelectedBlockClientIds:z,getBlockAttributes:V,getBlockEditingMode:M,isZoomOut:D,canEditBlock:L,canMoveBlocks:j,getBlockIndex:q,getBlockCount:J}=H(A(C)),{getActiveBlockVariation:te}=A(Tk.store),ee=O(a),$=ee&&P(ee);return{firstParentClientId:ee,parentBlockType:ee&&(te($,V(ee))||(0,Tk.getBlockType)($)),previousBlockClientId:N(a),selectedBlockClientIds:z(),isContentOnly:M(a)==="contentOnly",isZoomOut:D(),canEdit:L(a),canMove:j(t),isFirst:q(a)===0,isLast:q(a)===J(ee)-1}},[a,t]),{getBlockOrder:y,getSelectedBlockClientIds:k}=(0,Im.useSelect)(C),{moveBlocksDown:S,moveBlocksUp:_}=(0,Im.useDispatch)(C),x=(0,Im.useSelect)(A=>{let{getShortcutRepresentation:P}=A(Kge.store);return{copy:P("core/block-editor/copy"),cut:P("core/block-editor/cut"),duplicate:P("core/block-editor/duplicate"),remove:P("core/block-editor/remove"),insertAfter:P("core/block-editor/insert-after"),insertBefore:P("core/block-editor/insert-before")}},[]),w=f.length>0;async function T(A){if(!r)return;let P=await A;P&&P[0]&&r(P[0],!1)}function B(){if(!r)return;let A=d||l;A||(A=y()[0]);let P=w&&k().length===0;r(A,P)}let I=!f?.includes(l)&&!!l;return(0,eo.jsx)(uge,{clientIds:t,__experimentalUpdateSelection:!r,children:({canCopyStyles:A,canDuplicate:P,canInsertBlock:O,canRemove:N,onDuplicate:z,onInsertAfter:V,onInsertBefore:M,onRemove:D,onCopy:L,onPasteStyles:j})=>!N&&!P&&!O&&p?null:(0,eo.jsx)(Ui.DropdownMenu,{icon:zs,label:(0,nl.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:rGe,noIcons:!0,...i,children:({onClose:J})=>(0,eo.jsxs)(eo.Fragment,{children:[(0,eo.jsxs)(Ui.MenuGroup,{children:[(0,eo.jsx)(xL.Slot,{fillProps:{onClose:J}}),I&&(0,eo.jsx)($ge,{parentClientId:l,parentBlockType:u}),g&&n&&(0,eo.jsxs)(eo.Fragment,{children:[(0,eo.jsx)(Ui.MenuItem,{icon:Jh,disabled:b,accessibleWhenDisabled:!0,onClick:(0,Xd.pipe)(J,()=>{_(t,l)}),children:(0,nl.__)("Move up")}),(0,eo.jsx)(Ui.MenuItem,{icon:cn,disabled:v,accessibleWhenDisabled:!0,onClick:(0,Xd.pipe)(J,()=>{S(t,l)}),children:(0,nl.__)("Move down")})]}),m&&s===1&&(0,eo.jsx)(hge,{clientId:a}),!p&&(0,eo.jsx)(G9,{clientIds:t,onCopy:L,shortcut:x.copy}),N&&!p&&(0,eo.jsx)(G9,{clientIds:t,label:(0,nl.__)("Cut"),eventType:"cut",shortcut:x.cut,__experimentalUpdateSelection:!r}),P&&(0,eo.jsx)(Ui.MenuItem,{onClick:(0,Xd.pipe)(J,z,T),shortcut:x.duplicate,children:(0,nl.__)("Duplicate")}),O&&!h&&(0,eo.jsxs)(eo.Fragment,{children:[(0,eo.jsx)(Ui.MenuItem,{onClick:(0,Xd.pipe)(J,M),shortcut:x.insertBefore,children:(0,nl.__)("Add before")}),(0,eo.jsx)(Ui.MenuItem,{onClick:(0,Xd.pipe)(J,V),shortcut:x.insertAfter,children:(0,nl.__)("Add after")})]}),m&&s===1&&(0,eo.jsx)(SL.Slot,{fillProps:{clientId:a,onClose:J}})]}),A&&!p&&(0,eo.jsxs)(Ui.MenuGroup,{children:[(0,eo.jsx)(G9,{clientIds:t,onCopy:L,label:(0,nl.__)("Copy styles"),eventType:"copyStyles"}),m&&(0,eo.jsx)(Ui.MenuItem,{onClick:j,children:(0,nl.__)("Paste styles")})]}),!p&&(0,eo.jsx)(AL.Slot,{fillProps:{onClose:J,count:s,firstBlockClientId:a},clientIds:t}),typeof o=="function"?o({onClose:J}):ML.Children.map(te=>(0,ML.cloneElement)(te,{onClose:J})),N&&(0,eo.jsx)(Ui.MenuGroup,{children:(0,eo.jsx)(Ui.MenuItem,{onClick:(0,Xd.pipe)(J,D,B),shortcut:x.remove,children:(0,nl.__)("Delete")})})]})})})}var Yge=W9;var qge=c(U(),1),nGe=(0,qge.createSlotFill)(Symbol("NoteIconToolbarSlotFill")),NL=nGe;var Rk=c(E(),1);function iGe({clientIds:e,...t}){return(0,Rk.jsxs)(DL.ToolbarGroup,{children:[(0,Rk.jsx)(NL.Slot,{}),(0,Rk.jsx)(DL.ToolbarItem,{children:o=>(0,Rk.jsx)(Yge,{clientIds:e,toggleProps:o,...t})})]})}var VL=iGe;var FL=c(U(),1),Zge=c(G(),1),zL=c(Q(),1);var $9=c(E(),1);function Xge({clientIds:e}){let t=e.length===1?e[0]:void 0,o=(0,zL.useSelect)(n=>!!t&&n(C).getBlockMode(t)==="html",[t]),{toggleBlockMode:r}=(0,zL.useDispatch)(C);return o?(0,$9.jsx)(FL.ToolbarGroup,{children:(0,$9.jsx)(FL.ToolbarButton,{onClick:()=>{r(t)},children:(0,Zge.__)("Edit visually")})}):null}var jL=c(U(),1),Gi=c(F(),1),ebe=c(Q(),1),tbe=c(Rt(),1),Y9=c(Tt(),1),obe=c(Yl(),1),rbe=c(io(),1);var K9=c(E(),1);function sGe(e){let t="toolbarItem";return!e.some(o=>!(t in o.dataset))}function Qge(e){return Array.from(e.querySelectorAll("[data-toolbar-item]:not([disabled])"))}function Jge(e){return e.contains(e.ownerDocument.activeElement)}function aGe(e){let[t]=Y9.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}function lGe(e){let[o,r]=(0,Gi.useState)(!0),n=(0,Gi.useCallback)(()=>{let i=Y9.focus.tabbable.find(e.current),s=sGe(i);s||(0,tbe.default)("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"}),r(s)},[e]);return(0,Gi.useLayoutEffect)(()=>{let i=new window.MutationObserver(n);return i.observe(e.current,{childList:!0,subtree:!0}),()=>i.disconnect()},[n,o,e]),o}function cGe({toolbarRef:e,focusOnMount:t,isAccessibleToolbar:o,defaultIndex:r,onIndexChange:n,shouldUseKeyboardFocusShortcut:i,focusEditorOnEscape:s}){let[a]=(0,Gi.useState)(t),[l]=(0,Gi.useState)(r),u=(0,Gi.useCallback)(()=>{aGe(e.current)},[e]);(0,obe.useShortcut)("core/block-editor/focus-toolbar",()=>{i&&u()}),(0,Gi.useEffect)(()=>{a&&u()},[o,a,u]),(0,Gi.useEffect)(()=>{let p=e.current,h=0;return!a&&!Jge(p)&&(h=window.requestAnimationFrame(()=>{let m=Qge(p),g=l||0;m[g]&&Jge(p)&&m[g].focus({preventScroll:!0})})),()=>{if(window.cancelAnimationFrame(h),!n||!p)return;let g=Qge(p).findIndex(b=>b.tabIndex===0);n(g)}},[l,a,n,e]);let{getLastFocus:f}=H((0,ebe.useSelect)(C));(0,Gi.useEffect)(()=>{let p=e.current;if(s){let h=m=>{let g=f();m.keyCode===rbe.ESCAPE&&g?.current&&(m.preventDefault(),g.current.focus())};return p.addEventListener("keydown",h),()=>{p.removeEventListener("keydown",h)}}},[s,f,e])}function Bk({children:e,focusOnMount:t,focusEditorOnEscape:o=!1,shouldUseKeyboardFocusShortcut:r=!0,__experimentalInitialIndex:n,__experimentalOnIndexChange:i,orientation:s="horizontal",...a}){let l=(0,Gi.useRef)(),u=lGe(l);return cGe({toolbarRef:l,focusOnMount:t,defaultIndex:n,onIndexChange:i,isAccessibleToolbar:u,shouldUseKeyboardFocusShortcut:r,focusEditorOnEscape:o}),u?(0,K9.jsx)(jL.Toolbar,{label:a["aria-label"],ref:l,orientation:s,...a,children:e}):(0,K9.jsx)(jL.NavigableMenu,{orientation:s,role:"toolbar",ref:l,...a,children:e})}var nbe=c(Q(),1),HL=c(ue(),1);function UL(){return(0,nbe.useSelect)(t=>{let{getBlockEditingMode:o,getBlockName:r,getBlockSelectionStart:n}=t(C),i=n(),s=i&&(0,HL.getBlockType)(r(i));return s&&(0,HL.hasBlockSupport)(s,"__experimentalToolbar",!0)&&o(i)!=="disabled"},[])}var Om=c(U(),1),ibe=c(G(),1),sbe=c(ue(),1),abe=c(F(),1),GL=c(Q(),1);var Pk=c(E(),1),q9=[],uGe=6,dGe={placement:"bottom-start"};function lbe({clientId:e}){let{categories:t,currentPatternName:o,patterns:r}=(0,GL.useSelect)(a=>{let{getBlockAttributes:l,getBlockRootClientId:u,__experimentalGetAllowedPatterns:d}=a(C),f=l(e),p=f?.metadata?.categories||q9,h=u(e),m=p.length>0?d(h):q9;return{categories:p,currentPatternName:f?.metadata?.patternName,patterns:m}},[e]),{replaceBlocks:n}=(0,GL.useDispatch)(C),i=(0,abe.useMemo)(()=>t.length===0||!r||r.length===0?q9:r.filter(a=>{let l=a.source==="core"||a.source?.startsWith("pattern-directory")&&a.source!=="pattern-directory/theme";return a.blocks.length===1&&!l&&o!==a.name&&a.categories?.some(u=>t.includes(u))&&(a.syncStatus==="unsynced"||!a.id)}).slice(0,uGe),[t,o,r]);if(i.length<2)return null;let s=a=>{let l=(a.blocks??[]).map(u=>(0,sbe.cloneBlock)(u));l[0].attributes.metadata={...l[0].attributes.metadata,categories:t},n(e,l)};return(0,Pk.jsx)(Om.Dropdown,{popoverProps:dGe,renderToggle:({onToggle:a,isOpen:l})=>(0,Pk.jsx)(Om.ToolbarGroup,{children:(0,Pk.jsx)(Om.ToolbarButton,{onClick:()=>a(!l),"aria-expanded":l,children:(0,ibe.__)("Change design")})}),renderContent:()=>(0,Pk.jsx)(Om.__experimentalDropdownContentWrapper,{className:"block-editor-block-toolbar-change-design-content-wrapper",paddingSize:"none",children:(0,Pk.jsx)(gu,{blockPatterns:i,onClickPattern:s,showTitlesAsTooltip:!0})})})}var gc=c(U(),1),mbe=c(G(),1),YL=c(Q(),1);var KL=c(Q(),1),Lm=c(ue(),1),pbe=c(F(),1);var Z9=c(WL(),1),ube=c(G(),1);function dbe(e,t){for(let o of new Z9.default(t).values()){if(o.indexOf("is-style-")===-1)continue;let r=o.substring(9),n=e?.find(({name:i})=>i===r);if(n)return n}return $L(e)}function Am(e,t,o){let r=new Z9.default(e);return t&&r.remove("is-style-"+t.name),r.add("is-style-"+o.name),r.value}function fbe(e){return!e||e.length===0?[]:$L(e)?e:[{name:"default",label:(0,ube._x)("Default","block style"),isDefault:!0},...e]}function $L(e){return e?.find(t=>t.isDefault)}function fGe(e,t){return(0,pbe.useMemo)(()=>{let o=t?.example,r=t?.name;if(o&&r)return(0,Lm.getBlockFromExample)(r,{attributes:o.attributes,innerBlocks:o.innerBlocks,innerContent:o.innerContent});if(e)return(0,Lm.cloneBlock)(e)},[e,t?.example,t?.name])}function Ik({clientId:e,onSwitch:t}){let o=p=>{let{getBlock:h}=p(C),m=h(e);if(!m)return{};let g=(0,Lm.getBlockType)(m.name),{getBlockStyles:b}=p(Lm.store);return{block:g?.example?null:m,blockType:g,styles:b(m.name),className:m.attributes.className||""}},{styles:r,block:n,blockType:i,className:s}=(0,KL.useSelect)(o,[e]),{updateBlockAttributes:a}=(0,KL.useDispatch)(C),l=fbe(r),u=dbe(l,s),d=fGe(n,i);return{onSelect:p=>{let h=Am(s,u,p);a(e,{className:h}),t()},stylesToRender:l,activeStyle:u,genericPreviewBlock:d,className:s}}var Mm=c(E(),1),{getVariationStyle:pGe}=H(Sr),mGe=(0,Mm.jsxs)(gc.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24","aria-hidden":"true",focusable:"false",children:[(0,Mm.jsx)(gc.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z"}),(0,Mm.jsx)(gc.Path,{stroke:"currentColor",strokeWidth:"1.5",d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z"})]});function hGe({clientId:e}){let{stylesToRender:t,activeStyle:o,className:r}=Ik({clientId:e}),{updateBlockAttributes:n}=(0,YL.useDispatch)(C),{globalSettings:i,globalStyles:s,blockName:a}=(0,YL.useSelect)(d=>{let f=d(C).getSettings();return{globalSettings:f.__experimentalFeatures,globalStyles:f[rs],blockName:d(C).getBlockName(e)}},[e]),l=o?.name?pGe({settings:i,styles:s},a,o.name)?.color?.background:void 0;return!t||t.length===0?null:(0,Mm.jsx)(gc.ToolbarGroup,{children:(0,Mm.jsx)(gc.ToolbarButton,{onClick:()=>{let f=(t.findIndex(m=>m.name===o.name)+1)%t.length,p=t[f],h=Am(r,o,p);n(e,{className:h})},label:(0,mbe.__)("Shuffle styles"),children:(0,Mm.jsx)(gc.Icon,{icon:mGe,style:{fill:l||"transparent"}})})})}var hbe=hGe;var XL=c(U(),1),X9=c(G(),1),gbe=c(Q(),1),QL=c(ue(),1);var qL=c(Q(),1);function ZL(e){let{isSectionBlock:t,isWithinSection:o,isWithinEditedSection:r,isEditingContentOnlySection:n,editedContentOnlySection:i}=(0,qL.useSelect)(u=>{let{isSectionBlock:d,getParentSectionBlock:f,getEditedContentOnlySection:p,isWithinEditedContentOnlySection:h}=H(u(C)),m=p();return{isSectionBlock:d(e),isWithinSection:d(e)||!!f(e),isWithinEditedSection:h(e),isEditingContentOnlySection:m===e,editedContentOnlySection:m}},[e]),s=(0,qL.useDispatch)(C),{editContentOnlySection:a,stopEditingContentOnlySection:l}=H(s);return{isSectionBlock:t,isWithinSection:o,isWithinEditedSection:r,isEditingContentOnlySection:n,editedContentOnlySection:i,editContentOnlySection:a,stopEditingContentOnlySection:l}}var Q9=c(E(),1);function bbe({clientId:e}){let{isSectionBlock:t,isEditingContentOnlySection:o,editContentOnlySection:r,stopEditingContentOnlySection:n}=ZL(e),i=(0,gbe.useSelect)(l=>{if(!e)return null;let{getBlockName:u}=l(C),d=u(e);return d?{name:d}:null},[e]);if(!e||!t&&!o||(0,QL.isReusableBlock)(i)||(0,QL.isTemplatePart)(i))return null;let s=o;return(0,Q9.jsx)(XL.ToolbarGroup,{children:(0,Q9.jsx)(XL.ToolbarButton,{onClick:()=>{s?n():r(e)},children:s?(0,X9.__)("Exit pattern"):(0,X9.__)("Edit pattern")})})}var Gbe=c(U(),1),Wbe=c(G(),1),$be=c(Q(),1);var pE=c(ue(),1),Kbe=c(dv(),1);var xu=c(G(),1),wu=c(U(),1),Dm=c(ue(),1),sM=c(Q(),1);var wbe=c(G(),1),uE=c(U(),1),eM=c(ue(),1),tM=c(F(),1);var ybe=c(U(),1),vbe=c(fe(),1);var cE=c(E(),1);function Nm({blocks:e,placement:t="right-start",offset:o=16,anchor:r}){return(0,vbe.useViewportMatch)("medium","<")?null:(0,cE.jsx)("div",{className:"block-editor-block-switcher__popover-preview-container",children:(0,cE.jsx)(ybe.Popover,{className:"block-editor-block-switcher__popover-preview",placement:t,focusOnMount:!1,offset:o,anchor:r,children:(0,cE.jsx)("div",{className:"block-editor-block-switcher__preview",children:(0,cE.jsx)(bs,{viewportWidth:601,blocks:e})})})})}var Sbe=c(U(),1),Ok=c(ue(),1),kbe=c(Q(),1),JL=c(F(),1);var Qd=c(E(),1),gGe={};function _be({clientIds:e,blocks:t}){let{activeBlockVariation:o,blockVariationTransformations:r}=(0,kbe.useSelect)(i=>{let{getBlockAttributes:s,canRemoveBlocks:a}=i(C),{getActiveBlockVariation:l,getBlockVariations:u}=i(Ok.store),d=a(e);if(t.length!==1||!d)return gGe;let[f]=t;return{blockVariationTransformations:u(f.name,"transform"),activeBlockVariation:l(f.name,s(f.clientId))}},[e,t]);return(0,JL.useMemo)(()=>r?.filter(({name:i})=>i!==o?.name),[r,o])}var bGe=({transformations:e,onSelect:t,blocks:o})=>{let[r,n]=(0,JL.useState)();return(0,Qd.jsxs)(Qd.Fragment,{children:[r&&(0,Qd.jsx)(Nm,{blocks:(0,Ok.cloneBlock)(o[0],e.find(({name:i})=>i===r).attributes)}),e?.map(i=>(0,Qd.jsx)(yGe,{item:i,onSelect:t,setHoveredTransformItemName:n},i.name))]})};function yGe({item:e,onSelect:t,setHoveredTransformItemName:o}){let{name:r,icon:n,title:i}=e;return(0,Qd.jsxs)(Sbe.MenuItem,{className:(0,Ok.getBlockMenuDefaultClassName)(r),onClick:s=>{s.preventDefault(),t(r)},onMouseLeave:()=>o(null),onMouseEnter:()=>o(r),onFocus:()=>o(r),onBlur:()=>o(null),children:[(0,Qd.jsx)(Et,{icon:n,showColors:!0}),i]})}var xbe=bGe;var xs=c(E(),1);function vGe(e){let t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},o=(0,tM.useMemo)(()=>{let r=Object.keys(t),n=e.reduce((i,s)=>{let{name:a}=s;return r.includes(a)?i.priorityTextTransformations.push(s):i.restTransformations.push(s),i},{priorityTextTransformations:[],restTransformations:[]});if(n.priorityTextTransformations.length===1&&n.priorityTextTransformations[0].name==="core/quote"){let i=n.priorityTextTransformations.pop();n.restTransformations.push(i)}return n},[e]);return o.priorityTextTransformations.sort(({name:r},{name:n})=>t[r]{let[s,a]=(0,tM.useState)(),{priorityTextTransformations:l,restTransformations:u}=vGe(t),d=l.length&&u.length,f=!!u.length&&(0,xs.jsx)(kGe,{restTransformations:u,onSelect:r,setHoveredTransformItem:a});return(0,xs.jsxs)(xs.Fragment,{children:[(0,xs.jsxs)(uE.MenuGroup,{label:(0,wbe.__)("Transform to"),className:e,children:[s&&(0,xs.jsx)(Nm,{blocks:(0,eM.switchToBlockType)(i,s.name,s.variationName)}),!!o?.length&&(0,xs.jsx)(xbe,{transformations:o,blocks:i,onSelect:n}),l.map(p=>(0,xs.jsx)(Cbe,{item:p,onSelect:r,setHoveredTransformItem:a},p.id||p.name)),!d&&f]}),!!d&&(0,xs.jsx)(uE.MenuGroup,{className:e,children:f})]})};function kGe({restTransformations:e,onSelect:t,setHoveredTransformItem:o}){return e.map(r=>(0,xs.jsx)(Cbe,{item:r,onSelect:t,setHoveredTransformItem:o},r.id||r.name))}function Cbe({item:e,onSelect:t,setHoveredTransformItem:o}){let{name:r,icon:n,title:i,isDisabled:s}=e;return(0,xs.jsxs)(uE.MenuItem,{className:(0,eM.getBlockMenuDefaultClassName)(r),onClick:a=>{a.preventDefault(),t(r,e.variationName)},disabled:s,onMouseLeave:()=>o(null),onMouseEnter:()=>o(e),onFocus:()=>o(e),onBlur:()=>o(null),children:[(0,xs.jsx)(Et,{icon:n,showColors:!0}),i]})}var Ebe=SGe;var Bbe=c(G(),1),Pbe=c(U(),1),rM=c(F(),1);var oM=c(U(),1);var Ak=c(E(),1),Tbe=()=>{};function Rbe({stylesToRender:e,activeStyle:t,onSelect:o=Tbe,onHoverStyle:r=Tbe}){return!e||e.length===0?null:(0,Ak.jsx)(Ak.Fragment,{children:e.map(n=>{let i=n.label||n.name;return(0,Ak.jsx)(oM.MenuItem,{icon:t.name===n.name?ns:null,onClick:()=>o(n),onFocus:()=>r(n),onBlur:()=>r(null),onMouseEnter:()=>r(n),onMouseLeave:()=>r(null),children:(0,Ak.jsx)(oM.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0,children:i})},n.name)})})}var dE=c(E(),1);function nM({hoveredBlock:e,onSwitch:t}){let{clientId:o}=e,[r,n]=(0,rM.useState)(null),{onSelect:i,stylesToRender:s,activeStyle:a,genericPreviewBlock:l,className:u}=Ik({clientId:o,onSwitch:t}),d=(0,rM.useMemo)(()=>{if(!r||!l)return null;let f=Am(u,a,r);return[{...l,attributes:{...l.attributes||{},className:f}}]},[r,l,u,a]);return!s||s.length===0?null:(0,dE.jsxs)(Pbe.MenuGroup,{label:(0,Bbe.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup",children:[d&&(0,dE.jsx)(Nm,{blocks:d}),(0,dE.jsx)(Rbe,{stylesToRender:s,activeStyle:a,onSelect:i,onHoverStyle:n})]})}var eG=c(G(),1),Nbe=c(F(),1),iM=c(fe(),1);var Jd=c(U(),1);var Abe=c(F(),1),Lbe=c(ue(),1);var Ibe=c(ue(),1),J9=(e,t,o=new Set)=>{let{clientId:r,name:n,innerBlocks:i=[]}=e;if(!o.has(r)){if(n===t)return e;for(let s of i){let a=J9(s,t,o);if(a)return a}}},Obe=(e,t)=>{let o=(0,Ibe.getBlockAttributesNamesByRole)(e,"content");return o?.length?o.reduce((r,n)=>(t[n]&&(r[n]=t[n]),r),{}):t};var _Ge=(e,t)=>{let o=Obe(t.name,t.attributes);e.attributes={...e.attributes,...o}},xGe=(e,t)=>{let o=t.map(n=>(0,Lbe.cloneBlock)(n)),r=new Set;for(let n of e){let i=!1;for(let s of o){let a=J9(s,n.name,r);if(a){i=!0,r.add(a.clientId),_Ge(a,n);break}}if(!i)return}return o},wGe=(e,t)=>(0,Abe.useMemo)(()=>e.reduce((o,r)=>{let n=xGe(t,r.blocks);return n&&o.push({...r,transformedBlocks:n}),o},[]),[e,t]),Mbe=wGe;var qn=c(E(),1);function CGe({blocks:e,patterns:t,onSelect:o}){let[r,n]=(0,Nbe.useState)(!1),i=Mbe(t,e);return i.length?(0,qn.jsxs)(Jd.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup",children:[r&&(0,qn.jsx)(EGe,{patterns:i,onSelect:o}),(0,qn.jsx)(Jd.MenuItem,{onClick:s=>{s.preventDefault(),n(!r)},icon:un,children:(0,eG.__)("Patterns")})]}):null}function EGe({patterns:e,onSelect:t}){let o=(0,iM.useViewportMatch)("medium","<");return(0,qn.jsx)("div",{className:"block-editor-block-switcher__popover-preview-container",children:(0,qn.jsx)(Jd.Popover,{className:"block-editor-block-switcher__popover-preview",placement:o?"bottom":"right-start",offset:16,children:(0,qn.jsx)("div",{className:"block-editor-block-switcher__preview is-pattern-list-preview",children:(0,qn.jsx)(TGe,{patterns:e,onSelect:t})})})})}function TGe({patterns:e,onSelect:t}){return(0,qn.jsx)(Jd.Composite,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,eG.__)("Patterns list"),children:e.map(o=>(0,qn.jsx)(Dbe,{pattern:o,onSelect:t},o.name))})}function Dbe({pattern:e,onSelect:t}){let o="block-editor-block-switcher__preview-patterns-container",r=(0,iM.useInstanceId)(Dbe,`${o}-list__item-description`);return(0,qn.jsxs)("div",{className:`${o}-list__list-item`,children:[(0,qn.jsxs)(Jd.Composite.Item,{render:(0,qn.jsx)("div",{role:"option","aria-label":e.title,"aria-describedby":e.description?r:void 0,className:`${o}-list__item`}),onClick:()=>t(e.transformedBlocks),children:[(0,qn.jsx)(bs,{blocks:e.transformedBlocks,viewportWidth:e.viewportWidth||500}),(0,qn.jsx)("div",{className:`${o}-list__item-title`,children:e.title})]}),!!e.description&&(0,qn.jsx)(bt,{id:r,children:e.description})]})}var Vbe=CGe;var ra=c(E(),1);function RGe({onClose:e,clientIds:t}){let{replaceBlocks:o,multiSelect:r,updateBlockAttributes:n}=(0,sM.useDispatch)(C),{possibleBlockTransformations:i,patterns:s,blocks:a,isUsingBindings:l,canRemove:u,hasBlockStyles:d}=(0,sM.useSelect)(T=>{let{getBlockAttributes:B,getBlocksByClientId:R,getBlockRootClientId:I,getBlockTransformItems:A,__experimentalGetPatternTransformItems:P,canRemoveBlocks:O,getBlockName:N}=T(C),{getBlockStyles:z}=T(Dm.store),V=I(t[0]),M=R(t),D=t.length===1,L=D&&N(t[0]),j=D&&!!z(L)?.length;return{blocks:M,possibleBlockTransformations:A(M,V),patterns:P(M,V),isUsingBindings:t.every(q=>!!B(q)?.metadata?.bindings),canRemove:O(t),hasBlockStyles:j}},[t]),f=_be({clientIds:t,blocks:a});function p(T){T.length>1&&r(T[0].clientId,T[T.length-1].clientId)}function h(T,B){let R=(0,Dm.switchToBlockType)(a,T,B);o(t,R),p(R)}function m(T){n(a[0].clientId,{...f.find(({name:B})=>B===T).attributes})}function g(T){o(t,T),p(T)}let b=a.length===1,v=b&&((0,Dm.isTemplatePart)(a[0])||(0,Dm.isReusableBlock)(a[0])),y=!!i?.length&&u&&!v,k=!!f?.length,S=!!s?.length&&u,_=y||k;if(!(d||_||S))return(0,ra.jsx)("p",{className:"block-editor-block-switcher__no-transforms",children:(0,xu.__)("No transforms.")});let w=b?(0,xu._x)("This block is connected.","block toolbar button label and description"):(0,xu._x)("These blocks are connected.","block toolbar button label and description");return(0,ra.jsxs)("div",{className:"block-editor-block-switcher__container",children:[S&&(0,ra.jsx)(Vbe,{blocks:a,patterns:s,onSelect:T=>{g(T),e()}}),_&&(0,ra.jsx)(Ebe,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:i,possibleBlockVariationTransformations:f,blocks:a,onSelect:(T,B)=>{h(T,B),e()},onSelectVariation:T=>{m(T),e()}}),d&&(0,ra.jsx)(nM,{hoveredBlock:a[0],onSwitch:e}),l&&(0,ra.jsx)(wu.MenuGroup,{children:(0,ra.jsx)(wu.__experimentalText,{className:"block-editor-block-switcher__binding-indicator",children:w})})]})}var BGe=({children:e,clientIds:t,label:o,text:r})=>{let i=t.length===1?(0,xu.__)("Change block type or style"):(0,xu.sprintf)((0,xu._n)("Change type of %d block","Change type of %d blocks",t.length),t.length);return(0,ra.jsx)(wu.ToolbarGroup,{children:(0,ra.jsx)(wu.ToolbarItem,{children:s=>(0,ra.jsx)(wu.DropdownMenu,{className:"block-editor-block-switcher",label:o,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:e,text:r,toggleProps:{description:i,...s},menuProps:{orientation:"both"},children:({onClose:a})=>(0,ra.jsx)(RGe,{onClose:a,clientIds:t})})})})},Fbe=BGe;var zbe=c(G(),1),Mk=c(U(),1);var Lk=c(E(),1);function jbe({clientIds:e,children:t,label:o,text:r}){return(0,Lk.jsx)(Mk.ToolbarGroup,{children:(0,Lk.jsx)(Mk.ToolbarItem,{children:n=>(0,Lk.jsx)(Mk.DropdownMenu,{className:"block-editor-block-switcher",label:o,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:t,text:r,toggleProps:{description:(0,zbe.__)("Change block style"),...n},menuProps:{orientation:"both"},children:({onClose:i})=>(0,Lk.jsx)("div",{className:"block-editor-block-switcher__container",children:(0,Lk.jsx)(nM,{hoveredBlock:{clientId:e[0]},onSwitch:i})})})})})}var Nk=c(U(),1),fE=c(G(),1),aM=c(F(),1),Hbe=c(Q(),1);var ef=c(E(),1);function PGe({clientIds:e,blockTitle:t}){let o=(0,Hbe.useSelect)(i=>{let{getBlockAttributes:s}=i(C);return s(e?.[0])?.metadata?.name},[e]),r=e.length===1,n;return r&&o?n=(0,fE.sprintf)((0,fE.__)('This %1$s is editable using the "%2$s" override.'),t.toLowerCase(),o):n=(0,fE.__)("These blocks are editable using overrides."),(0,ef.jsx)(Nk.__experimentalText,{children:n})}function Ube({icon:e,clientIds:t,blockTitle:o,label:r}){let[n,i]=(0,aM.useState)(!1),s=(0,aM.useRef)();return(0,ef.jsxs)(ef.Fragment,{children:[(0,ef.jsx)(Nk.ToolbarButton,{ref:s,className:"block-editor-block-toolbar__pattern-overrides-indicator",icon:e,label:r,onClick:()=>i(!n),"aria-expanded":n}),n&&(0,ef.jsx)(Nk.Popover,{anchor:s.current,onClose:()=>i(!1),placement:"bottom-start",offset:16,className:"block-editor-block-toolbar__pattern-overrides-popover",children:(0,ef.jsx)(PGe,{clientIds:t,blockTitle:o})})]})}var Dk=c(E(),1);function IGe({select:e,clientIds:t}){let{getBlockName:o,getBlockAttributes:r,getBlockParentsByBlockName:n,canRemoveBlocks:i,getTemplateLock:s,getBlockEditingMode:a,canEditBlock:l,isSectionBlock:u}=H(e(C)),{getBlockStyles:d}=e(pE.store),f=t.some(R=>s(R)==="contentOnly"),p=t.length===1,h=p&&o(t[0]),m=p&&!!d(h)?.length,g=t.some(R=>!!r(R)?.metadata?.patternName&&u(R)),b=t.every(R=>Ox(r(R)?.metadata?.bindings)),v=t.every(R=>n(R,"core/block",!0).length>0),y=i(t),k=t.every(R=>l(R)),S=a(t[0]),_=S==="default",x=S==="contentOnly",T=!g&&_&&(m||y)&&!f&&k,B=b&&v;return T?"switcher":x&&m&&!b&&k?"styles-only":B?"pattern-overrides":"default"}function OGe({select:e,clientIds:t}){let{getBlockName:o,getBlockAttributes:r,getBlock:n,isSectionBlock:i}=H(e(C)),s=t.length===1,a=t[0],l=r(a);if(s&&l?.metadata?.patternName&&i(a))return Hc;let u=o(a),d=(0,pE.getBlockType)(u);if(s){let{getActiveBlockVariation:h}=e(pE.store);return h(u,l,void 0,n?.(a)?.innerContent)?.icon||d?.icon}let f=t.map(h=>o(h));return new Set(f).size===1?d?.icon:tg}function Ybe({clientIds:e,isSynced:t}){let{icon:o,showIconLabels:r,variant:n}=(0,$be.useSelect)(f=>({icon:OGe({select:f,clientIds:e}),showIconLabels:f(Kbe.store).get("core","showIconLabels"),variant:IGe({select:f,clientIds:e})}),[e]),i=jn({clientId:e?.[0],maximumLength:35}),s=e.length===1,a=s&&t&&!r,l=s?i:(0,Wbe.__)("Multiple blocks selected"),u=a&&i?i:void 0,d=(0,Dk.jsx)(Et,{className:"block-editor-block-toolbar__block-icon",icon:o});return n==="switcher"?(0,Dk.jsx)(Fbe,{clientIds:e,label:l,text:u,children:d}):n==="styles-only"?(0,Dk.jsx)(jbe,{clientIds:e,label:l,text:u,children:d}):n==="pattern-overrides"?(0,Dk.jsx)(Ube,{icon:d,clientIds:e,blockTitle:i,label:l}):(0,Dk.jsx)(Gbe.ToolbarButton,{disabled:!0,className:"block-editor-block-toolbar__block-icon-button",title:l,icon:d,text:u})}var At=c(E(),1);function oG({hideDragHandle:e,focusOnMount:t,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,variant:n="unstyled"}){let{blockClientId:i,blockClientIds:s,isDefaultEditingMode:a,blockType:l,toolbarKey:u,shouldShowVisualToolbar:d,showParentSelector:f,isUsingBindings:p,isSectionContainer:h,hasContentOnlyLocking:m,showShuffleButton:g,showSlots:b,showGroupButtons:v,showLockButtons:y,showBlockVisibilityButton:k,showSwitchSectionStyleButton:S,areSelectedBlocksHiddenOnViewport:_,showStyleStateSlot:x,canEdit:w}=(0,Zbe.useSelect)(V=>{let{canEditBlock:M}=V(C),{getBlockName:D,getBlockMode:L,getBlockParents:j,getSelectedBlockClientIds:q,isBlockValid:J,getBlockEditingMode:te,getBlockAttributes:ee,getSettings:$,getTemplateLock:W,getParentSectionBlock:Y,isZoomOut:Z,isSectionBlock:oe,isBlockHiddenAtViewport:ne,getSelectedBlockStyleState:X,isResponsiveEditing:re}=H(V(C)),ae=q(),ve=ae[0],xe=j(ve),be=Y(ve)??xe[xe.length-1],he=D(be),ke=(0,tf.getBlockType)(he),_e=te(ve),we=_e==="default",Re=D(ve),se=ae.every(ut=>J(ut)),ie=ae.every(ut=>L(ut)==="visual"),Ae=ae.every(ut=>!!ee(ut)?.metadata?.bindings),ye=ae.some(ut=>W(ut)==="contentOnly"),Ee=Z(),qe=oe(ve),pt=M(ve),at=pt&&(Ee||qe),Ct=$()?.[wa]?.toLowerCase()||"desktop",rt=ae.length>0&&ae.every(ut=>ne(ut,Ct)),Ot=re()&&Hi(X(ve));return{blockClientId:ve,blockClientIds:ae,isDefaultEditingMode:we,blockType:ve&&(0,tf.getBlockType)(Re),shouldShowVisualToolbar:se&&ie,toolbarKey:`${ve}${be}`,showParentSelector:!Ee&&ke&&_e!=="contentOnly"&&te(be)!=="disabled"&&(0,tf.hasBlockSupport)(ke,"__experimentalParentSelector",!0)&&ae.length===1,isUsingBindings:Ae,isSectionContainer:qe,hasContentOnlyLocking:ye,showShuffleButton:Ee,showSlots:!Ee&&!Ot,showStyleStateSlot:!Ee&&Ot,showGroupButtons:!Ee,showLockButtons:!Ee,showBlockVisibilityButton:!Ee,showSwitchSectionStyleButton:at,areSelectedBlocksHiddenOnViewport:rt,canEdit:pt}},[]),T=(0,tG.useRef)(null),B=(0,tG.useRef)(),R=Sk({ref:B}),I=!(0,Xbe.useViewportMatch)("medium","<");if(!UL())return null;let P=s.length>1,O=(0,tf.isReusableBlock)(l)||(0,tf.isTemplatePart)(l),N=K("block-editor-block-contextual-toolbar",{"has-parent":f}),z=K("block-editor-block-toolbar",{"is-synced":O,"is-connected":p});return(0,At.jsx)(Bk,{focusEditorOnEscape:!0,className:N,"aria-label":(0,qbe.__)("Block tools"),variant:n==="toolbar"?void 0:n,focusOnMount:t,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,children:(0,At.jsxs)("div",{ref:T,className:z,children:[f&&!P&&I&&(0,At.jsx)(zhe,{}),(d||P)&&(0,At.jsx)("div",{ref:B,...R,children:(0,At.jsxs)(Qbe.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls",children:[(0,At.jsx)(Ybe,{clientIds:s,isSynced:O}),a&&k&&(0,At.jsx)(Uj,{clientIds:s}),!P&&a&&y&&(0,At.jsx)(z9,{clientId:i}),(0,At.jsx)(pL,{clientIds:s,hideDragHandle:e})]})}),!_&&!m&&d&&P&&v&&(0,At.jsx)(M9,{}),!P&&w&&(0,At.jsx)(bbe,{clientId:s[0]}),!_&&g&&(0,At.jsx)(lbe,{clientId:s[0]}),!_&&S&&(0,At.jsx)(hbe,{clientId:s[0]}),!_&&d&&(0,At.jsxs)(At.Fragment,{children:[!h&&(0,At.jsxs)(At.Fragment,{children:[b&&(0,At.jsxs)(At.Fragment,{children:[(0,At.jsx)(No.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,At.jsx)(No.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,At.jsx)(No.Slot,{className:"block-editor-block-toolbar__slot"}),(0,At.jsx)(No.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"})]}),x&&(0,At.jsx)(No.Slot,{group:"style-state",className:"block-editor-block-toolbar__slot"})]}),b&&(0,At.jsxs)(At.Fragment,{children:[(0,At.jsx)(No.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,At.jsx)(yL.Slot,{})]})]}),(0,At.jsx)(Xge,{clientIds:s}),(0,At.jsx)(VL,{clientIds:s})]})},u)}function Jbe({hideDragHandle:e,variant:t}){return(0,At.jsx)(oG,{hideDragHandle:e,variant:t,focusOnMount:void 0,__experimentalInitialIndex:void 0,__experimentalOnIndexChange:void 0})}var rG=c(E(),1);function oye({clientId:e,isTyping:t,__unstableContentRef:o}){let{capturingClientId:r,isInsertionPointVisible:n,lastClientId:i}=iL(e),s=(0,Vk.useRef)();(0,Vk.useEffect)(()=>{s.current=void 0},[e]);let{stopTyping:a}=(0,eye.useDispatch)(C),l=(0,Vk.useRef)(!1);(0,tye.useShortcut)("core/block-editor/focus-toolbar",()=>{l.current=!0,a(!0)}),(0,Vk.useEffect)(()=>{l.current=!1});let u=r||e,d=nL({contentElement:o?.current,clientId:u});return!t&&(0,rG.jsx)(Sb,{clientId:u,bottomClientId:i,className:K("block-editor-block-list__block-popover",{"is-insertion-point-visible":n}),resize:!1,...d,__unstableContentRef:o,children:(0,rG.jsx)(oG,{focusOnMount:l.current,__experimentalInitialIndex:s.current,__experimentalOnIndexChange:f=>{s.current=f},variant:"toolbar"})})}var lM=c(Q(),1),cM=c(F(),1);var rye=c(U(),1);var nye=c(G(),1),iye=c(E(),1);function AGe({onClick:e}){return(0,iye.jsx)(rye.Button,{variant:"primary",icon:Ca,size:"compact",className:K("block-editor-button-pattern-inserter__button","block-editor-block-tools__zoom-out-mode-inserter-button"),onClick:e,label:(0,nye._x)("Add pattern","Generic label for pattern inserter button")})}var sye=AGe;var nG=c(E(),1);function LGe(){let[e,t]=(0,cM.useState)(!1),{hasSelection:o,blockOrder:r,setInserterIsOpened:n,sectionRootClientId:i,selectedBlockClientId:s,blockInsertionPoint:a,insertionPointVisible:l}=(0,lM.useSelect)(m=>{let{getSettings:g,getBlockOrder:b,getSelectionStart:v,getSelectedBlockClientId:y,getSectionRootClientId:k,getBlockInsertionPoint:S,isBlockInsertionPointVisible:_}=H(m(C)),x=k();return{hasSelection:!!v().clientId,blockOrder:b(x),sectionRootClientId:x,setInserterIsOpened:g().__experimentalSetIsInserterOpened,selectedBlockClientId:y(),blockInsertionPoint:S(),insertionPointVisible:_()}},[]),{showInsertionPoint:u}=H((0,lM.useDispatch)(C));if((0,cM.useEffect)(()=>{let m=setTimeout(()=>{t(!0)},500);return()=>{clearTimeout(m)}},[]),!e||!o)return null;let d=s,p=r.findIndex(m=>s===m)+1,h=r[p];return l&&a?.index===p?null:(0,nG.jsx)(O2,{previousClientId:d,nextClientId:h,children:(0,nG.jsx)(sye,{onClick:()=>{n({rootClientId:i,insertionIndex:p,tab:"patterns",category:"all"}),u(i,p,{operation:"insert"})}})})}var aye=LGe;var lye=c(Q(),1),cye=c(ue(),1);function uye(){return(0,lye.useSelect)(e=>{let{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:o,getBlock:r,getBlockMode:n,getSettings:i,isTyping:s,isBlockInterfaceHidden:a}=H(e(C)),l=t()||o(),u=r(l),d=!!l&&!!u,f=d&&(0,cye.isUnmodifiedDefaultBlock)(u,"content")&&n(l)!=="html",p=l&&!s()&&f,h=!a()&&!i().hasFixedToolbar&&!p&&d&&!f;return{showEmptyBlockSideInserter:p,showBlockToolbarPopover:h}},[])}var il=c(E(),1);function MGe(e){let{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:o,getSettings:r,isTyping:n,isDragging:i,isZoomOut:s,getViewportModalClientIds:a}=H(e(C));return{clientId:t()||o(),hasFixedToolbar:r().hasFixedToolbar,isTyping:n(),isZoomOutMode:s(),isDragging:i(),viewportModalClientIds:a(),blockVisibilitySetting:e(C).getSettings().__experimentalFeatures?.blockVisibility?.allowEditing}}function mE({children:e,__unstableContentRef:t,...o}){let{clientId:r,hasFixedToolbar:n,isTyping:i,isZoomOutMode:s,isDragging:a,viewportModalClientIds:l,blockVisibilitySetting:u}=(0,Fk.useSelect)(MGe,[]),d=(0,dye.__unstableUseShortcutEventMatch)(),{getBlocksByClientId:f,getSelectedBlockClientIds:p,getBlockRootClientId:h,getBlockEditingMode:m,getBlockName:g,isGroupable:b,getEditedContentOnlySection:v,canEditBlock:y}=H((0,Fk.useSelect)(C)),{getGroupingBlockName:k}=(0,Fk.useSelect)(dM.store),{showEmptyBlockSideInserter:S,showBlockToolbarPopover:_}=uye(),x=kk(),[w,T]=(0,uM.useState)(null),{canRename:B}=Db(g(p()[0])),{duplicateBlocks:R,removeBlocks:I,replaceBlocks:A,insertAfterBlock:P,insertBeforeBlock:O,selectBlock:N,moveBlocksUp:z,moveBlocksDown:V,expandBlock:M,stopEditingContentOnlySection:D,showViewportModal:L,hideViewportModal:j}=H((0,Fk.useDispatch)(C));function q(ee){if(!ee.defaultPrevented){if(d("core/block-editor/move-up",ee)||d("core/block-editor/move-down",ee)){let $=p();if($.length){ee.preventDefault();let W=h($[0]);(d("core/block-editor/move-up",ee)?"up":"down")==="up"?z($,W):V($,W);let Z=Array.isArray($)?$.length:1,oe=(0,zk.sprintf)((0,zk._n)("%d block moved.","%d blocks moved.",$.length),Z);(0,aG.speak)(oe)}}else if(d("core/block-editor/duplicate",ee)){let $=p();$.length&&(ee.preventDefault(),R($))}else if(d("core/block-editor/remove",ee)){let $=p();$.length&&(ee.preventDefault(),I($))}else if(d("core/block-editor/paste-styles",ee)){let $=p();if($.length){ee.preventDefault();let W=f($);x(W)}}else if(d("core/block-editor/insert-after",ee)){let $=p();$.length&&(ee.preventDefault(),P($[$.length-1]))}else if(d("core/block-editor/insert-before",ee)){let $=p();$.length&&(ee.preventDefault(),O($[0]))}else if(d("core/block-editor/unselect",ee)){if(ee.target.closest("[role=toolbar]"))return;let $=p();$.length>1&&(ee.preventDefault(),N($[0]))}else if(d("core/block-editor/collapse-list-view",ee)){if((0,iG.isTextField)(ee.target)||(0,iG.isTextField)(ee.target?.contentWindow?.document?.activeElement))return;ee.preventDefault(),M(r)}else if(d("core/block-editor/group",ee)){let $=p();if($.length>1&&b($)){ee.preventDefault();let W=f($),Y=k(),Z=ol(W,Y);A($,Z),(0,aG.speak)((0,zk.__)("Selected blocks are grouped."))}}else if(d("core/block-editor/rename",ee)){let $=p();if($.length===1){let W=m($[0])==="contentOnly";B&&!W&&y($[0])&&(ee.preventDefault(),T($[0]))}}else if(d("core/block-editor/toggle-block-visibility",ee)){if(u===!1)return;let $=p();if($.length){if(ee.preventDefault(),!f($).every(Z=>(0,dM.hasBlockSupport)(Z.name,"visibility",!0))||$.some(Z=>m(Z)!=="default"||!y(Z)))return;L($)}}d("core/block-editor/stop-editing-as-blocks",ee)&&v()&&D()}}let J=vb(t),te=vb(t);return(0,il.jsxs)("div",{...o,onKeyDown:q,className:K(o.className,{"block-editor-block-tools--is-dragging":a}),children:[(0,il.jsxs)(pk.Provider,{value:(0,uM.useRef)(!1),children:[!i&&!s&&(0,il.jsx)(sme,{__unstableContentRef:t}),S&&(0,il.jsx)(xhe,{__unstableContentRef:t,clientId:r}),_&&(0,il.jsx)(oye,{__unstableContentRef:t,clientId:r,isTyping:i}),!s&&!n&&(0,il.jsx)(sG.Popover.Slot,{name:"block-toolbar",ref:J}),e,(0,il.jsx)(sG.Popover.Slot,{name:"__unstable-block-tools-after",ref:te}),s&&!a&&(0,il.jsx)(aye,{__unstableContentRef:t})]}),w&&(0,il.jsx)(Mb,{clientId:w,onClose:()=>T(null)}),l&&(0,il.jsx)(Fj,{clientIds:l,onClose:j})]})}var hE=c(fe(),1),jk=c(Q(),1),lG=c(Tt(),1),yi=c(io(),1);var fye=c(E(),1),NGe=new Set([yi.UP,yi.RIGHT,yi.DOWN,yi.LEFT,yi.ENTER,yi.BACKSPACE]);function DGe(e){let{keyCode:t,shiftKey:o}=e;return!o&&NGe.has(t)}function gE(){let e=(0,jk.useSelect)(o=>o(C).isTyping(),[]),{stopTyping:t}=(0,jk.useDispatch)(C);return(0,hE.useRefEffect)(o=>{if(!e)return;let{ownerDocument:r}=o,n,i;function s(a){let{clientX:l,clientY:u}=a;n&&i&&(n!==l||i!==u)&&t(),n=l,i=u}return r.addEventListener("mousemove",s),()=>{r.removeEventListener("mousemove",s)}},[e,t])}function bE(){let e=(0,jk.useSelect)(i=>i(C).isTyping(),[]),{startTyping:t,stopTyping:o}=(0,jk.useDispatch)(C),r=gE(),n=(0,hE.useRefEffect)(i=>{if(e){let d=function(g){let{target:b}=g;h=m.setTimeout(()=>{(0,lG.isTextField)(b)||o()})},f=function(g){let{keyCode:b}=g;(b===yi.ESCAPE||b===yi.TAB)&&o()},p=function(){m.getSelection().isCollapsed||o()};var s=d,a=f,l=p;let h,{defaultView:m}=i.ownerDocument;return i.addEventListener("focus",d),i.addEventListener("keydown",f),i.ownerDocument.addEventListener("selectionchange",p),()=>{m.clearTimeout(h),i.removeEventListener("focus",d),i.removeEventListener("keydown",f),i.ownerDocument.removeEventListener("selectionchange",p)}}function u(d){let{type:f,target:p}=d;!(0,lG.isTextField)(p)||!i.contains(p)||f==="keydown"&&!DGe(d)||t()}return i.addEventListener("keypress",u),i.addEventListener("keydown",u),()=>{i.removeEventListener("keypress",u),i.removeEventListener("keydown",u)}},[e,t,o]);return(0,hE.useMergeRefs)([r,n])}function VGe({children:e}){return(0,fye.jsx)("div",{ref:bE(),children:e})}var pye=VGe;var sl=c(G(),1),rf=c(ue(),1),of=c(Q(),1),cG=c(hye(),1);var FGe=()=>function(){let{replaceBlocks:t,multiSelect:o}=(0,of.useDispatch)(C),{blocks:r,clientIds:n,canRemove:i,possibleBlockTransformations:s,invalidSelection:a}=(0,of.useSelect)(h=>{let{getBlockRootClientId:m,getBlockTransformItems:g,getSelectedBlockClientIds:b,getBlocksByClientId:v,canRemoveBlocks:y}=h(C),k=b(),S=v(k);if(S.filter(x=>!x).length>0)return{invalidSelection:!0};let _=m(k[0]);return{blocks:S,clientIds:k,possibleBlockTransformations:g(S,_),canRemove:y(k),invalidSelection:!1}},[]);if(a)return{isLoading:!1,commands:[]};let l=r.length===1&&(0,rf.isTemplatePart)(r[0]);function u(h){h.length>1&&o(h[0].clientId,h[h.length-1].clientId)}function d(h,m){let g=(0,rf.switchToBlockType)(r,h,m);t(n,g),u(g)}let f=!!s.length&&i&&!l;return!n||n.length<1||!f?{isLoading:!1,commands:[]}:{isLoading:!1,commands:s.map(h=>{let{id:m,name:g,title:b,icon:v,variationName:y}=h,k=!v?.src||v?.src==="block-default"?{src:zx}:v;return{name:"core/block-editor/transform-to-"+(m||g).replace(/\//g,"-"),label:(0,sl.sprintf)((0,sl.__)("Transform to %s"),b),icon:k?.src,category:"command",callback:({close:S})=>{d(g,y),S()}}})}},zGe=()=>function(){let{clientIds:t,isUngroupable:o,isGroupable:r,blockVisibilitySetting:n}=(0,of.useSelect)(O=>{let{getSelectedBlockClientIds:N,getSettings:z,isUngroupable:V,isGroupable:M}=O(C);return{clientIds:N(),isUngroupable:V(),isGroupable:M(),blockVisibilitySetting:z().__experimentalFeatures?.blockVisibility?.allowEditing}},[]),{canInsertBlockType:i,getBlockRootClientId:s,getBlocksByClientId:a,canRemoveBlocks:l,isBlockHiddenAnywhere:u}=H((0,of.useSelect)(C)),{getBlockEditingMode:d}=(0,of.useSelect)(C),{getDefaultBlockName:f,getGroupingBlockName:p}=(0,of.useSelect)(rf.store),h=a(t),m=(0,of.useDispatch)(C),{removeBlocks:g,replaceBlocks:b,duplicateBlocks:v,insertAfterBlock:y,insertBeforeBlock:k}=m,S=()=>{if(!h.length)return;let O=p(),N=ol(h,O);N&&b(t,N)},_=()=>{if(!h.length)return;let O=h[0].innerBlocks;O.length&&b(t,O)};if(!t||t.length<1)return{isLoading:!1,commands:[]};let{showViewportModal:x}=H(m),w=s(t[0]),T=i(f(),w),B=h.every(O=>!!O&&(0,rf.hasBlockSupport)(O.name,"multiple",!0)&&i(O.name,w)),R=l(t),I=[];B&&I.push({name:"duplicate",label:(0,sl.__)("Duplicate"),callback:()=>v(t,!0),icon:tg}),T&&I.push({name:"add-before",label:(0,sl.__)("Add before"),callback:()=>{let O=Array.isArray(t)?t[0]:O;k(O)},icon:Ca},{name:"add-after",label:(0,sl.__)("Add after"),callback:()=>{let O=Array.isArray(t)?t[t.length-1]:O;y(O)},icon:Ca}),r&&I.push({name:"Group",label:(0,sl.__)("Group"),callback:S,icon:Wx}),o&&I.push({name:"ungroup",label:(0,sl.__)("Ungroup"),callback:_,icon:B6}),R&&I.push({name:"remove",label:(0,sl.__)("Delete"),callback:()=>g(t,!0),icon:T6});let A=h.every(O=>!!O&&(0,rf.hasBlockSupport)(O.name,"visibility",!0)),P=t.every(O=>d(O)==="default");if(A&&P&&n!==!1){let O=t.some(N=>u(N));I.push({name:"toggle-visibility",label:O?(0,sl.__)("Show"):(0,sl.__)("Hide"),callback:()=>x(t),icon:O?ug:Vl})}return{isLoading:!1,commands:I.map(O=>({...O,name:"core/block-editor/action-"+O.name,category:"command",callback:({close:N})=>{O.callback(),N()}}))}},fM=()=>{(0,cG.useCommandLoader)({name:"core/block-editor/blockTransforms",hook:FGe()}),(0,cG.useCommandLoader)({name:"core/block-editor/blockQuickActions",hook:zGe(),context:"block-selection-edit"})};var Wi=c(E(),1),pM=(0,vye.createSlotFill)(Symbol("BlockCanvasCover"));function gye({children:e}){return(0,Wi.jsx)("div",{className:"block-canvas-cover",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none"},children:e})}var jGe={ignoredSelectors:[/\.editor-styles-wrapper/gi]};function uG({shouldIframe:e=!0,height:t="300px",children:o=(0,Wi.jsx)(HS,{}),styles:r,contentRef:n,iframeProps:i}){fM();let s=(0,mM.useViewportMatch)("medium","<"),a=gE(),l=kb(),u=(0,bye.useRef)(),d=(0,mM.useMergeRefs)([n,l,u,bE()]),f=(0,yye.useSelect)(h=>H(h(C)).getZoomLevel(),[]),p=f!==100&&!s?{scale:f,frameSize:"40px"}:{};return e?(0,Wi.jsx)(mE,{__unstableContentRef:u,style:{height:t,display:"flex"},children:(0,Wi.jsxs)(LS,{...i,...p,ref:a,contentRef:d,style:{...i?.style},name:"editor-canvas",children:[(0,Wi.jsx)(pM.Slot,{fillProps:{containerRef:u},children:h=>h.map((m,g)=>(0,Wi.jsx)(gye,{children:m},g))}),(0,Wi.jsx)(Ld,{styles:r}),o]})}):(0,Wi.jsxs)(mE,{__unstableContentRef:u,style:{height:t,display:"flex"},children:[(0,Wi.jsx)(pM.Slot,{fillProps:{containerRef:u},children:h=>h.map((m,g)=>(0,Wi.jsx)(gye,{children:m},g))}),(0,Wi.jsx)(Ld,{styles:r,scope:":where(.editor-styles-wrapper)",transformOptions:jGe}),(0,Wi.jsx)(BA,{ref:d,className:"editor-styles-wrapper",tabIndex:-1,style:{height:"100%",width:"100%",overflow:"auto"},children:o})]})}function HGe({children:e,height:t,styles:o}){return(0,Wi.jsx)(uG,{height:t,styles:o,children:e})}var Sye=HGe;var Cu=c(U(),1),kye=c(G(),1),_ye=c(io(),1),xye=c(Rt(),1),al=c(E(),1),UGe=()=>(0,al.jsx)(Cu.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:(0,al.jsx)(Cu.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"})}),GGe=({style:e,className:t})=>(0,al.jsx)("div",{className:"block-library-colors-selector__icon-container",children:(0,al.jsx)("div",{className:`${t} block-library-colors-selector__state-selection`,style:e,children:(0,al.jsx)(UGe,{})})}),WGe=({TextColor:e,BackgroundColor:t})=>function({onToggle:r,isOpen:n}){let i=s=>{!n&&s.keyCode===_ye.DOWN&&(s.preventDefault(),r())};return(0,al.jsx)(Cu.ToolbarGroup,{children:(0,al.jsx)(Cu.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,kye.__)("Open Colors Selector"),onClick:r,onKeyDown:i,icon:(0,al.jsx)(t,{children:(0,al.jsx)(e,{children:(0,al.jsx)(GGe,{})})})})})},$Ge=({children:e,...t})=>((0,xye.default)("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,al.jsx)(Cu.Dropdown,{popoverProps:{placement:"bottom-start"},className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:WGe(t),renderContent:()=>e})),wye=$Ge;var Pve=c(Rt(),1),PM=c(U(),1),gG=c(G(),1),Ive=c(Q(),1),Ove=c(F(),1);var Zk=c(fe(),1),Tve=c(U(),1);var SE=c(Q(),1),Rve=c(Rt(),1),Wr=c(F(),1),hG=c(G(),1);var wM=c(U(),1),CM=c(F(),1),EM=c(Q(),1);var Eye=c(fe(),1),Tye=c(Qr(),1),Rye=c(Q(),1),vM=c(F(),1),Hk=c(G(),1);var hM=c(F(),1),gM=(0,hM.createContext)({});gM.displayName="ListViewContext";var Vm=()=>(0,hM.useContext)(gM);var bM=c(F(),1),Cye=c(E(),1);function yM({children:e,...t}){let o=(0,bM.useRef)();return(0,bM.useEffect)(()=>{o.current&&(o.current.textContent=o.current.textContent)},[e]),(0,Cye.jsx)("div",{hidden:!0,...t,ref:o,children:e})}var yE=c(E(),1),dG=(0,vM.forwardRef)(({nestingLevel:e,blockCount:t,clientId:o,...r},n)=>{let{insertedBlock:i,setInsertedBlock:s}=Vm(),a=(0,Eye.useInstanceId)(dG),{directInsert:l,hideInserter:u}=(0,Rye.useSelect)(m=>{let{getBlockListSettings:g,getTemplateLock:b,isZoomOut:v}=H(m(C)),k=g(o)?.directInsert||!1,S=!!b(o)||v();return{directInsert:k,hideInserter:S}},[o]),d=jn({clientId:o,context:"list-view"}),f=jn({clientId:i?.clientId,context:"list-view"});if((0,vM.useEffect)(()=>{f?.length&&(0,Tye.speak)((0,Hk.sprintf)((0,Hk.__)("%s block inserted"),f),"assertive")},[f]),u)return null;let p=`list-view-appender__${a}`,h=(0,Hk.sprintf)((0,Hk.__)("Append to %1$s block at position %2$d, Level %3$d"),d,t+1,e);return(0,yE.jsxs)("div",{className:"list-view-appender",children:[(0,yE.jsx)(Za,{ref:n,rootClientId:o,position:"bottom right",isAppender:!0,selectBlockOnInsert:!1,shouldDirectInsert:l,__experimentalIsQuick:!0,...r,toggleProps:{"aria-describedby":p},onSelectOrClose:m=>{m?.clientId&&s(m)}}),(0,yE.jsx)(yM,{id:p,children:h})]})});var Wk=c(ue(),1),Fb=c(U(),1),_M=c(fe(),1);var Gr=c(F(),1),$k=c(Q(),1),pG=c(G(),1),xM=c(io(),1),Qye=c(GC(),1),Jye=c(Yl(),1),eve=c(Qr(),1);var Bye=c(U(),1),Pye=c(fe(),1),Iye=c(F(),1);var Oye=c(E(),1),KGe=_ee(Bye.__experimentalTreeGridRow),YGe=(0,Iye.forwardRef)(({isDragged:e,isSelected:t,position:o,level:r,rowCount:n,children:i,className:s,path:a,...l},u)=>{let d=QP({clientId:l["data-block"],enableAnimation:!0,triggerAnimationOnChange:a}),f=(0,Pye.useMergeRefs)([u,d]);return(0,Oye.jsx)(KGe,{ref:f,className:K("block-editor-list-view-leaf",s),level:r,positionInSet:o,setSize:n,isExpanded:void 0,...l,children:i})}),Aye=YGe;var Lye=c(Tt(),1),Mye=c(F(),1);function Nye({isSelected:e,selectedClientIds:t,rowItemRef:o}){let r=t.length===1;(0,Mye.useLayoutEffect)(()=>{if(!e||!r||!o.current)return;let n=(0,Lye.getScrollContainer)(o.current),{ownerDocument:i}=o.current;if(n===i.body||n===i.documentElement||!n)return;let a=o.current.getBoundingClientRect(),l=n.getBoundingClientRect();(a.topl.bottom)&&o.current.scrollIntoView()},[e,r,o])}var Gye=c(F(),1);var Uk=c(U(),1),Hye=c(F(),1);var kM=c(io(),1);var Dye=c(G(),1),fG=c(E(),1);function SM({onClick:e}){return(0,fG.jsx)("span",{className:"block-editor-list-view__expander",onClick:e?t=>e(t,{forceToggle:!0}):void 0,"aria-hidden":"true","data-testid":"list-view-expander",children:(0,fG.jsx)(gt,{icon:(0,Dye.isRTL)()?jx:rp})})}var Vye=c(F(),1),Fye=c(Q(),1);var qGe=3,zye={"core/image":({clientId:e,attributes:t})=>{if(t.url)return{url:t.url,alt:t.alt||"",clientId:e}},"core/cover":({clientId:e,attributes:t})=>{if(t.backgroundType==="image"&&t.url)return{url:t.url,alt:t.alt||"",clientId:e}},"core/media-text":({clientId:e,attributes:t})=>{if(t.mediaType==="image"&&t.mediaUrl)return{url:t.mediaUrl,alt:t.mediaAlt||"",clientId:e}},"core/gallery":({innerBlocks:e})=>{let t=[],o=e?.length?zye[e[0].name]:void 0;if(!o)return t;for(let r of e){let n=o(r);if(n&&t.push(n),t.length>=qGe)return t}return t}};function ZGe(e,t){let o=zye[e.name],r=o?o(e):void 0;return r?Array.isArray(r)?t?[]:r:[r]:[]}function jye({clientId:e,isExpanded:t}){let{block:o}=(0,Fye.useSelect)(n=>({block:n(C).getBlock(e)}),[e]);return(0,Vye.useMemo)(()=>ZGe(o,t),[o,t])}var Ur=c(E(),1),{Badge:XGe}=H(Uk.privateApis);function QGe({className:e,block:{clientId:t},onClick:o,onContextMenu:r,onMouseDown:n,onToggleExpanded:i,tabIndex:s,onFocus:a,onDragStart:l,onDragEnd:u,draggable:d,isExpanded:f,ariaDescribedBy:p,visibilityLabel:h,isDisabled:m=!1},g){let b=Do(t),v=jn({clientId:t,context:"list-view"}),{isLocked:y}=oa(t),k=y,S=b?.positionType==="sticky",_=jye({clientId:t,isExpanded:f}),x=T=>{T.dataTransfer.clearData(),l?.(T)};function w(T){(T.keyCode===kM.ENTER||T.keyCode===kM.SPACE)&&o(T)}return(0,Ur.jsxs)("a",{className:K("block-editor-list-view-block-select-button",e),onClick:o,onContextMenu:r,onKeyDown:w,onMouseDown:n,ref:g,tabIndex:s,onFocus:a,onDragStart:x,onDragEnd:u,draggable:d,href:m?void 0:`#block-${t}`,"aria-disabled":m?!0:void 0,"aria-describedby":p,"aria-expanded":f,children:[(0,Ur.jsx)(SM,{onClick:i}),(0,Ur.jsx)(Et,{icon:b?.icon,showColors:!0,context:"list-view"}),(0,Ur.jsxs)(Uk.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:[(0,Ur.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,Ur.jsx)(Uk.__experimentalTruncate,{ellipsizeMode:"auto",children:v})}),b?.anchor&&(0,Ur.jsx)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper",children:(0,Ur.jsx)(XGe,{className:"block-editor-list-view-block-select-button__anchor",children:b.anchor})}),S&&(0,Ur.jsx)("span",{className:"block-editor-list-view-block-select-button__sticky",children:(0,Ur.jsx)(gt,{icon:M4})}),_.length?(0,Ur.jsx)("span",{className:"block-editor-list-view-block-select-button__images","aria-hidden":!0,children:_.map((T,B)=>(0,Ur.jsx)("span",{className:"block-editor-list-view-block-select-button__image",style:{backgroundImage:`url(${T.url})`,zIndex:_.length-B}},T.clientId))}):null,!!h&&(0,Ur.jsxs)(kt.Root,{children:[(0,Ur.jsx)(kt.Trigger,{render:(0,Ur.jsx)("span",{className:"block-editor-list-view-block-select-button__block-visibility","aria-hidden":"true",children:(0,Ur.jsx)(gt,{icon:Vl})})}),(0,Ur.jsx)(kt.Popup,{children:h})]}),k&&(0,Ur.jsx)("span",{className:"block-editor-list-view-block-select-button__lock",children:(0,Ur.jsx)(gt,{icon:T4})})]})]})}var Uye=(0,Hye.forwardRef)(QGe);var Fm=c(E(),1),JGe=(0,Gye.forwardRef)(({onClick:e,onToggleExpanded:t,block:o,isSelected:r,position:n,siblingBlockCount:i,level:s,isExpanded:a,selectedClientIds:l,...u},d)=>{let{clientId:f}=o,{AdditionalBlockContent:p,insertedBlock:h,setInsertedBlock:m}=Vm(),g=l.includes(f)?l:[f];return(0,Fm.jsxs)(Fm.Fragment,{children:[p&&(0,Fm.jsx)(p,{block:o,insertedBlock:h,setInsertedBlock:m}),(0,Fm.jsx)(lL,{appendToOwnerDocument:!0,clientIds:g,cloneClassname:"block-editor-list-view-draggable-chip",children:({draggable:b,onDragStart:v,onDragEnd:y})=>(0,Fm.jsx)(Uye,{ref:d,className:"block-editor-list-view-block-contents",block:o,onClick:e,onToggleExpanded:t,isSelected:r,position:n,siblingBlockCount:i,level:s,draggable:b,onDragStart:v,onDragEnd:y,isExpanded:a,...u})})]})}),Wye=JGe;var Vb=c(G(),1),$ye=c(Tt(),1),Kye=(e,t,o)=>(0,Vb.sprintf)((0,Vb.__)("Block %1$d of %2$d, Level %3$d."),e,t,o),Yye=(e,t)=>[e?.positionLabel?`${(0,Vb.sprintf)((0,Vb.__)("Position: %s"),e.positionLabel)}.`:void 0,t?(0,Vb.__)("This block is locked."):void 0].filter(Boolean).join(" "),qye=(e,t)=>Array.isArray(t)&&t.length?t.indexOf(e)!==-1:t===e;function Zye(e,t,o,r){let n=[...o,e],i=[...r,t],s=Math.min(n.length,i.length)-1,a=n[s],l=i[s];return{start:a,end:l}}function Gk(e,t){if(!t)return;let o=`[role=row][data-block="${e}"]`;return new Promise(r=>{if(t.querySelector(o))return r(t.querySelector(o));let n=null,i=new window.MutationObserver(()=>{t.querySelector(o)&&(clearTimeout(n),i.disconnect(),r(t.querySelector(o)))});i.observe(t,{childList:!0,subtree:!0}),n=setTimeout(()=>{i.disconnect(),r(null)},3e3)}).then(r=>{r&&r.isConnected&&$ye.focus.focusable.find(r)?.[0]?.focus()})}function Xye({blockIndexes:e,blockDropTargetIndex:t,blockDropPosition:o,clientId:r,firstDraggedBlockIndex:n,isDragged:i}){let s,a,l;if(!i){a=!1;let u=e[r];l=u>n,t!=null&&n!==void 0?u!==void 0&&(u>=n&&u=t?s="down":s="normal",a=typeof t=="number"&&t-1===u&&o==="inside"):t===null&&n!==void 0?u!==void 0&&u>=n?s="up":s="normal":t!=null&&n===void 0?u!==void 0&&(u{let{getBlock:Ft,getBlockName:nt,getBlockEditingMode:zt,getSettings:Ir,getEditedContentOnlySection:$o}=H(Be(C)),Sn=Ir();return{block:Ft(e),blockName:nt(e),blockEditingMode:zt(e),allowRightClickOverrides:Sn.allowRightClickOverrides,editedSection:$o(),viewportSettings:Sn.__experimentalFeatures?.viewport,blockVisibilitySetting:Sn.__experimentalFeatures?.blockVisibility?.allowEditing}},[e]),ie=ke==="disabled",{canRename:Ae}=Db(he),ye=(0,Wk.hasBlockSupport)(he,"__experimentalToolbar",!0),qe=`list-view-block-select-button__description-${(0,_M.useInstanceId)(tve)}`,{expand:pt,collapse:at,collapseAll:Ct,BlockSettingsMenu:rt,listViewInstanceId:Ot,expandedState:ut,setInsertedBlock:Gt,treeGridElementRef:So,rootClientId:mo}=Vm(),de=(0,Jye.__unstableUseShortcutEventMatch)();function Me(){let Be=te(),Ft=Be.includes(e),nt=Ft?Be[0]:e,zt=$(nt);return{blocksToUpdate:Ft?Be:[e],firstBlockClientId:nt,firstBlockRootClientId:zt,selectedBlockClientIds:Be}}async function Ze(Be){if(Be.defaultPrevented||Be.target.closest("[role=dialog]"))return;if(we&&de("core/block-editor/unselect",Be)){Be.stopPropagation(),Be.preventDefault(),j();return}let Ft=[xM.BACKSPACE,xM.DELETE].includes(Be.keyCode);if(de("core/block-editor/unselect",Be)&&g.length>0)Be.stopPropagation(),Be.preventDefault(),a(Be,void 0);else if(Ft||de("core/block-editor/remove",Be)){let{blocksToUpdate:nt,firstBlockClientId:zt,firstBlockRootClientId:Ir,selectedBlockClientIds:$o}=Me();if(!re(nt))return;let Sn=ee(zt)??Ir;V(nt,!1);let Gh=$o.length>0&&te().length===0;Sn||(Sn=W()[0]),ct(Sn,Gh)}else if(de("core/block-editor/paste-styles",Be)){Be.preventDefault();let{blocksToUpdate:nt}=Me(),zt=oe(nt);ge(zt)}else if(de("core/block-editor/duplicate",Be)){Be.preventDefault();let{blocksToUpdate:nt,firstBlockRootClientId:zt}=Me();if(oe(nt).every($o=>!!$o&&(0,Wk.hasBlockSupport)($o.name,"multiple",!0)&&J($o.name,zt))){let $o=await O(nt,!1);$o?.length&&ct($o[0],!1)}}else if(de("core/block-editor/insert-before",Be)){Be.preventDefault();let{blocksToUpdate:nt}=Me();await D(nt[0]);let zt=te();ct(zt[0],!1)}else if(de("core/block-editor/insert-after",Be)){Be.preventDefault();let{blocksToUpdate:nt}=Me();await M(nt.at(-1));let zt=te();ct(zt[0],!1)}else if(de("core/block-editor/select-all",Be)){Be.preventDefault();let{firstBlockRootClientId:nt,selectedBlockClientIds:zt}=Me(),Ir=W(nt);if(!Ir.length)return;if((0,Qye.isShallowEqual)(zt,Ir)&&nt&&nt!==mo){ct(nt,!0);return}N(Ir[0],Ir[Ir.length-1],null)}else if(de("core/block-editor/collapse-list-view",Be)){Be.preventDefault();let{firstBlockClientId:nt}=Me(),zt=Y(nt,!1);Ct(),pt(zt)}else if(de("core/block-editor/group",Be)){let{blocksToUpdate:nt}=Me();if(nt.length>1&&ae(nt)){Be.preventDefault();let zt=oe(nt),Ir=ve(),$o=ol(zt,Ir);z(nt,$o),(0,eve.speak)((0,pG.__)("Selected blocks are grouped."));let Sn=te();ct(Sn[0],!1)}}else if(de("core/block-editor/toggle-block-visibility",Be)){if(se===!1)return;Be.preventDefault();let{blocksToUpdate:nt}=Me();if(!oe(nt).every($o=>(0,Wk.hasBlockSupport)($o.name,"visibility",!0))||nt.some($o=>Z($o)!=="default"))return;L(nt)}else if(de("core/block-editor/rename",Be)){let{blocksToUpdate:nt}=Me(),zt=Z(nt[0])==="contentOnly";nt.length===1&&Ae&&!zt&&(Be.preventDefault(),B(!0))}}let ze=(0,Gr.useCallback)(()=>{_(!0),q(e,!0)},[e,_,q]),Je=(0,Gr.useCallback)(()=>{_(!1),q(e,!1)},[e,_,q]),lt=(0,Gr.useCallback)(Be=>{let Ft=Be?.detail===0;a(Be,e,Ft?-1:null),Be.preventDefault()},[e,a]),ct=(0,Gr.useCallback)((Be,Ft)=>{Ft&&a(void 0,Be,null,null),Gk(Be,So?.current)},[a,So]),yr=(0,Gr.useCallback)(Be=>{Be.preventDefault(),Be.stopPropagation(),m===!0?at(e):m===!1&&pt(e)},[e,pt,at,m]),Ao=(0,Gr.useCallback)(Be=>{let{ownerDocument:Ft}=k?.current||{};!Ft||!Ft.hasFocus()||ye&&_e&&(k.current?.click(),w(new window.DOMRect(Be.clientX,Be.clientY,0,0)),Be.preventDefault())},[_e,k,ye]),rr=(0,Gr.useCallback)(Be=>{_e&&Be.button===2&&Be.preventDefault()},[_e]),ho=(0,Gr.useMemo)(()=>{let{ownerDocument:Be}=y?.current||{};if(!(!x||!Be))return{ownerDocument:Be,getBoundingClientRect(){return x}}},[x]),Go=(0,Gr.useCallback)(()=>{w(void 0)},[w]);if(Nye({isSelected:i,rowItemRef:y,selectedClientIds:g}),!be)return null;let Vn=Kye(l,f,u),vr=Yye(xe,R),an=Vj(be?.attributes?.metadata?.blockVisibility,Re),it=f>0,_t=ye&&!ie,Vt=p&&it&&!ie,ko=K("block-editor-list-view-block__mover-cell",{"is-visible":S||i}),Wo=K("block-editor-list-view-block__menu-cell",{"is-visible":S||I}),nr;Vt?nr=2:_t||(nr=3);let Sa=K({"is-selected":i,"is-first-selected":I,"is-last-selected":A,"is-branch-selected":s,"is-synced-branch":b,"is-dragging":r,"has-single-cell":!ye,"is-synced":xe?.isSynced,"is-draggable":X&&!ie,"is-displacement-normal":t==="normal","is-displacement-up":t==="up","is-displacement-down":t==="down","is-after-dragged-blocks":o,"is-nesting":n,"is-disabled":ie}),ka=g.includes(e)?g:[e],Ll=Be=>ie?-1:i&&g.length===1?0:Be;return(0,In.jsxs)(Aye,{className:Sa,isDragged:r,onKeyDown:Ze,onMouseEnter:ie?void 0:ze,onMouseLeave:ie?void 0:Je,onFocus:ie?void 0:ze,onBlur:ie?void 0:Je,level:u,position:l,rowCount:d,path:h,id:`list-view-${Ot}-block-${e}`,"data-block":e,"data-expanded":ne?m:void 0,ref:y,children:[(0,In.jsx)(Fb.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:nr,ref:v,"aria-selected":!!i,children:({ref:Be,tabIndex:Ft,onFocus:nt})=>(0,In.jsxs)("div",{className:"block-editor-list-view-block__contents-container",children:[(0,In.jsx)(Wye,{block:be,onClick:lt,onContextMenu:ie?void 0:Ao,onMouseDown:rr,onToggleExpanded:ie?void 0:yr,isSelected:i,position:l,siblingBlockCount:f,level:u,ref:Be,tabIndex:Ll(Ft),onFocus:nt,isExpanded:ne?m:void 0,selectedClientIds:g,ariaDescribedBy:qe,visibilityLabel:an,isDisabled:ie}),(0,In.jsx)(yM,{id:qe,children:[Vn,vr,an].filter(Boolean).join(" ")})]})}),Vt&&(0,In.jsx)(In.Fragment,{children:(0,In.jsxs)(Fb.__experimentalTreeGridCell,{className:ko,withoutGridItem:!0,children:[(0,In.jsx)(Fb.__experimentalTreeGridItem,{children:({ref:Be,tabIndex:Ft,onFocus:nt})=>(0,In.jsx)(dL,{orientation:"vertical",clientIds:[e],ref:Be,tabIndex:Ft,onFocus:nt})}),(0,In.jsx)(Fb.__experimentalTreeGridItem,{children:({ref:Be,tabIndex:Ft,onFocus:nt})=>(0,In.jsx)(fL,{orientation:"vertical",clientIds:[e],ref:Be,tabIndex:Ft,onFocus:nt})})]})}),_t&&rt&&(0,In.jsx)(Fb.__experimentalTreeGridCell,{className:Wo,"aria-selected":!!i,ref:k,children:({ref:Be,tabIndex:Ft,onFocus:nt})=>(0,In.jsx)(rt,{clientIds:ka,block:be,icon:zs,label:(0,pG.__)("Options"),popoverProps:{anchor:ho},toggleProps:{ref:Be,className:"block-editor-list-view-block__menu",tabIndex:Ft,onClick:Go,onFocus:nt,size:"small"},disableOpenOnArrowDown:!0,expand:pt,expandedState:ut,setInsertedBlock:Gt,__experimentalSelectBlock:ct,isContentOnlyListView:!!mo&&Z(mo)==="contentOnly"})}),T&&(0,In.jsx)(Mb,{clientId:e,onClose:()=>B(!1)})]})}var ove=(0,Gr.memo)(tve);var na=c(E(),1);function rve(e,t,o,r){return o?.includes(e.clientId)?0:t[e.clientId]??r?1+e.innerBlocks.reduce(eWe(t,o,r),0):1}var eWe=(e,t,o)=>(r,n)=>t?.includes(n.clientId)?r:(e[n.clientId]??o)&&n.innerBlocks.length>0?r+rve(n,e,t,o):r+1,tWe=()=>{};function nve(e){let{blocks:t,selectBlock:o=tWe,showBlockMovers:r,selectedClientIds:n,level:i=1,path:s="",isBranchSelected:a=!1,listPosition:l=0,fixedListWindow:u,isExpanded:d,parentId:f,shouldShowInnerBlocks:p=!0,isSyncedBranch:h=!1,showAppender:m=!0}=e,g=Do(f),b=h||!!g?.isSynced,v=(0,EM.useSelect)(P=>f?P(C).canEditBlock(f):!0,[f]),{blockDropPosition:y,blockDropTargetIndex:k,firstDraggedBlockIndex:S,blockIndexes:_,expandedState:x,draggedClientIds:w}=Vm(),T=(0,CM.useRef)();if(!v)return null;let B=m&&i===1,R=t.filter(Boolean),I=R.length,A=B?I+1:I;return T.current=l,(0,na.jsxs)(na.Fragment,{children:[R.map((P,O)=>{let{clientId:N,innerBlocks:z}=P;O>0&&(T.current+=rve(R[O-1],x,w,d));let V=!!w?.includes(N),{displacement:M,isAfterDraggedBlocks:D,isNesting:L}=Xye({blockIndexes:_,blockDropTargetIndex:k,blockDropPosition:y,clientId:N,firstDraggedBlockIndex:S,isDragged:V}),{itemInView:j}=u,q=j(T.current),J=O+1,te=s.length>0?`${s}_${J}`:`${J}`,ee=!!z?.length,$=ee&&p?x[N]??d:void 0,W=qye(N,n),Y=a||W&&ee,Z=V||q||W&&N===n[0]||O===0||O===I-1;return(0,na.jsxs)(EM.AsyncModeProvider,{value:!W,children:[Z&&(0,na.jsx)(ove,{block:P,selectBlock:o,isSelected:W,isBranchSelected:Y,isDragged:V,level:i,position:J,rowCount:A,siblingBlockCount:I,showBlockMovers:r,path:te,isExpanded:V?!1:$,listPosition:T.current,selectedClientIds:n,isSyncedBranch:b,displacement:M,isAfterDraggedBlocks:D,isNesting:L}),!Z&&(0,na.jsx)("tr",{children:(0,na.jsx)("td",{className:"block-editor-list-view-placeholder"})}),ee&&$&&!V&&(0,na.jsx)(nve,{parentId:N,blocks:z,selectBlock:o,showBlockMovers:r,level:i+1,path:te,listPosition:T.current+1,fixedListWindow:u,isBranchSelected:Y,selectedClientIds:n,isExpanded:d,isSyncedBranch:b})]},N)}),B&&(0,na.jsx)(wM.__experimentalTreeGridRow,{level:i,setSize:A,positionInSet:A,isExpanded:!0,children:(0,na.jsx)(wM.__experimentalTreeGridCell,{children:P=>(0,na.jsx)(dG,{clientId:f,nestingLevel:i,blockCount:I,...P})})})]})}var ive=(0,CM.memo)(nve);var Kk=c(U(),1),TM=c(Tt(),1),nf=c(F(),1),mG=c(G(),1);var ll=c(E(),1);function sve({draggedBlockClientId:e,listViewRef:t,blockDropTarget:o}){let r=Do(e),n=jn({clientId:e,context:"list-view"}),{rootClientId:i,clientId:s,dropPosition:a}=o||{},[l,u]=(0,nf.useMemo)(()=>{if(!t.current)return[];let y=i?t.current.querySelector(`[data-block="${i}"]`):void 0,k=s?t.current.querySelector(`[data-block="${s}"]`):void 0;return[y,k]},[t,i,s]),d=u||l,f=(0,mG.isRTL)(),p=(0,nf.useCallback)((y,k)=>{if(!d)return 0;let S=d.offsetWidth,_=(0,TM.getScrollContainer)(d,"horizontal"),x=d.ownerDocument,w=_===x.body||_===x.documentElement;if(_&&!w){let T=_.getBoundingClientRect(),B=(0,mG.isRTL)()?T.right-y.right:y.left-T.left,R=_.clientWidth;if(RT.right)return S-=y.right-T.right,S}return S-k},[f,d]),h=(0,nf.useMemo)(()=>{if(!d)return{};let y=d.getBoundingClientRect();return{width:p(y,0)}},[p,d]),m=(0,nf.useMemo)(()=>{if(!d)return{};let y=(0,TM.getScrollContainer)(d),k=d.ownerDocument,S=y===k.body||y===k.documentElement;if(y&&!S){let _=y.getBoundingClientRect(),x=d.getBoundingClientRect(),w=f?_.right-x.right:x.left-_.left;if(!f&&_.left>x.left)return{transform:`translateX( ${w}px )`};if(f&&_.right{if(!l)return 1;let y=parseInt(l.getAttribute("aria-level"),10);return y?y+1:1},[l]),b=(0,nf.useMemo)(()=>d?d.classList.contains("is-branch-selected"):!1,[d]),v=(0,nf.useMemo)(()=>{if(!(!d||!(a==="top"||a==="bottom"||a==="inside")))return{contextElement:d,getBoundingClientRect(){let k=d.getBoundingClientRect(),S=k.left,_=0,x=(0,TM.getScrollContainer)(d,"horizontal"),w=d.ownerDocument,T=x===w.body||x===w.documentElement;if(x&&!T){let I=x.getBoundingClientRect(),A=f?x.offsetWidth-x.clientWidth:0;S{}}),(0,ll.jsx)(Et,{icon:r?.icon,showColors:!0,context:"list-view"}),(0,ll.jsx)(Kk.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:(0,ll.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,ll.jsx)(Kk.__experimentalTruncate,{ellipsizeMode:"auto",children:n})})})]}),(0,ll.jsx)("div",{className:"block-editor-list-view-block__menu-cell"})]})})}):null}var ave=c(Qr(),1),Yk=c(G(),1),vE=c(Q(),1),lve=c(F(),1),ia=c(io(),1),cve=c(ue(),1);function uve(){let{clearSelectedBlock:e,multiSelect:t,selectBlock:o}=(0,vE.useDispatch)(C),{getBlockName:r,getBlockParents:n,getBlockSelectionStart:i,getSelectedBlockClientIds:s,hasMultiSelection:a,hasSelectedBlock:l}=(0,vE.useSelect)(C),{getBlockType:u}=(0,vE.useSelect)(cve.store);return{updateBlockSelection:(0,lve.useCallback)(async(f,p,h,m)=>{if(!f?.shiftKey&&f?.keyCode!==ia.ESCAPE){o(p,m);return}f.preventDefault();let g=f.type==="keydown"&&f.keyCode===ia.ESCAPE,b=f.type==="keydown"&&(f.keyCode===ia.UP||f.keyCode===ia.DOWN||f.keyCode===ia.HOME||f.keyCode===ia.END);if(!b&&!l()&&!a()){o(p,null);return}let v=s(),y=[...n(p),p];if((g||b&&!v.some(x=>y.includes(x)))&&await e(),!g){let x=i(),w=p;b&&(!l()&&!a()&&(x=p),h&&(w=h));let T=n(x),B=n(w),{start:R,end:I}=Zye(x,w,T,B);await t(R,I,null)}let k=s();if((f.keyCode===ia.HOME||f.keyCode===ia.END)&&k.length>1)return;let S=v.filter(x=>!k.includes(x)),_;if(S.length===1){let x=u(r(S[0]))?.title;x&&(_=(0,Yk.sprintf)((0,Yk.__)("%s deselected."),x))}else S.length>1&&(_=(0,Yk.sprintf)((0,Yk.__)("%s blocks deselected."),S.length));_&&(0,ave.speak)(_,"assertive")},[e,r,u,n,i,s,a,l,t,o])}}var dve=c(F(),1);function fve(e){return(0,dve.useMemo)(()=>{let o={},r=0,n=i=>{i.forEach(s=>{o[s.clientId]=r,r++,s.innerBlocks.length>0&&n(s.innerBlocks)})};return n(e),o},[e])}var pve=c(Q(),1);function mve({blocks:e,rootClientId:t}){return(0,pve.useSelect)(o=>{let{getDraggedBlockClientIds:r,getSelectedBlockClientIds:n,getListViewClientIdsTree:i}=H(o(C));return{selectedClientIds:n(),draggedClientIds:r(),clientIdsTree:e??i(t)}},[e,t])}var hve=c(F(),1),gve=c(Q(),1);function bve({collapseAll:e,expand:t}){let{expandedBlock:o,getBlockParents:r}=(0,gve.useSelect)(n=>{let{getBlockParents:i,getExpandedBlock:s}=H(n(C));return{expandedBlock:s(),getBlockParents:i}},[]);(0,hve.useEffect)(()=>{if(o){let n=r(o,!1);e(),t(n)}},[e,t,o,r])}var yve=c(Q(),1),zb=c(F(),1),jb=c(fe(),1),vve=c(G(),1);var sf=24;function oWe(e,t,o=1,r=!1){let n=r?t.right-o*sf:t.left+o*sf;return r?e.x>n:e.xn.clientId===r.rootClientId);return o}function Sve(e,t){let o=e[t+1];return o&&o.isDraggedBlock?Sve(e,t+1):o}function iWe(e,t,o=1,r=!1){let n=r?t.right-o*sf:t.left+o*sf;return(r?e.xn+sf)&&e.y0&&n.isExpanded||iWe(t,s,l.length,o))){let f=n.isExpanded?0:n.innerBlockCount||0;return{rootClientId:n.clientId,clientId:n.clientId,blockIndex:f,dropPosition:"inside"}}if(u&&n.rootClientId&&oWe(t,s,l.length,o)){let f=Sve(e,a),p=n.nestingLevel,h=f?f.nestingLevel:1;if(p&&h){let m=rWe(t,s,l.length,o),g=Math.max(Math.min(m,p-h),0);if(l[g]){let b=n.blockIndex;if(l[g].nestingLevel===f?.nestingLevel)b=f?.blockIndex;else for(let v=a;v>=0;v--){let y=e[v];if(y.rootClientId===l[g].rootClientId){b=y.blockIndex+1;break}}return{rootClientId:l[g].rootClientId,clientId:n.clientId,blockIndex:b,dropPosition:r}}}}if(!n.canInsertDraggedBlocksAsSibling)return;let d=u?1:0;return{rootClientId:n.rootClientId,clientId:n.clientId,blockIndex:n.blockIndex+d,dropPosition:r}}var lWe={leading:!1,trailing:!0};function kve({dropZoneElement:e,expandedState:t,setExpandedState:o}){let{getBlockRootClientId:r,getBlockIndex:n,getBlockCount:i,getDraggedBlockClientIds:s,canInsertBlocks:a}=(0,yve.useSelect)(C),[l,u]=(0,zb.useState)(),{rootClientId:d,blockIndex:f}=l||{},p=F2(d,f),h=(0,vve.isRTL)(),m=(0,jb.usePrevious)(d),g=(0,zb.useCallback)((S,_)=>{let{rootClientId:x}=_||{};x&&_?.dropPosition==="inside"&&!S[x]&&o({type:"expand",clientIds:[x]})},[o]),b=(0,jb.useThrottle)(g,500,lWe);(0,zb.useEffect)(()=>{if(l?.dropPosition!=="inside"||m!==l?.rootClientId){b.cancel();return}b(t,l)},[t,m,l,b]);let v=s(),y=(0,jb.useThrottle)((0,zb.useCallback)((S,_)=>{let x={x:S.clientX,y:S.clientY},w=!!v?.length,B=Array.from(_.querySelectorAll("[data-block]")).map(I=>{let A=I.dataset.block,P=I.dataset.expanded==="true",O=I.classList.contains("is-dragging"),N=parseInt(I.getAttribute("aria-level"),10),z=r(A);return{clientId:A,isExpanded:P,rootClientId:z,blockIndex:n(A),element:I,nestingLevel:N||void 0,isDraggedBlock:w?O:!1,innerBlockCount:i(A),canInsertDraggedBlocksAsSibling:w?a(v,z):!0,canInsertDraggedBlocksAsChild:w?a(v,A):!0}}),R=aWe(B,x,h);R&&u(R)},[a,v,i,n,r,h]),50);return{ref:(0,jb.__experimentalUseDropZone)({dropZoneElement:e,onDrop(S){y.cancel(),l&&p(S),u(void 0)},onDragLeave(){y.cancel(),u(null)},onDragOver(S){y(S,S.currentTarget)},onDragEnd(){y.cancel(),u(void 0)}}),target:l}}var RM=c(F(),1),_ve=c(Q(),1);function xve({firstSelectedBlockClientId:e,setExpandedState:t}){let[o,r]=(0,RM.useState)(null),{selectedBlockParentClientIds:n}=(0,_ve.useSelect)(i=>{let{getBlockParents:s}=i(C);return{selectedBlockParentClientIds:s(e,!1)}},[e]);return(0,RM.useEffect)(()=>{o!==e&&n?.length&&t({type:"expand",clientIds:n})},[e,n,o,t]),{setSelectedTreeId:r}}var qk=c(Q(),1),wve=c(fe(),1);function Cve({selectBlock:e}){let t=(0,qk.useRegistry)(),{getBlockOrder:o,getBlockRootClientId:r,getBlocksByClientId:n,getPreviousBlockClientId:i,getSelectedBlockClientIds:s,getSettings:a,canInsertBlockType:l,canRemoveBlocks:u}=(0,qk.useSelect)(C),{flashBlock:d,removeBlocks:f,replaceBlocks:p,insertBlocks:h}=(0,qk.useDispatch)(C),m=PS();return(0,wve.useRefEffect)(g=>{function b(k,S){S&&e(void 0,k,null,null),Gk(k,g)}function v(k){let S=s(),_=S.includes(k),x=_?S[0]:k,w=r(x);return{blocksToUpdate:_?S:[k],firstBlockClientId:x,firstBlockRootClientId:w,originallySelectedBlockClientIds:S}}function y(k){if(k.defaultPrevented||!g.contains(k.target.ownerDocument.activeElement))return;let _=k.target.ownerDocument.activeElement?.closest("[role=row]")?.dataset?.block;if(!_)return;let{blocksToUpdate:x,firstBlockClientId:w,firstBlockRootClientId:T,originallySelectedBlockClientIds:B}=v(_);if(x.length!==0){if(k.preventDefault(),k.type==="copy"||k.type==="cut"){x.length===1&&d(x[0]),m(k.type,x);let R=n(x);yA(k,R,t)}if(k.type==="cut"){if(!u(x))return;let R=i(w)??T;f(x,!1);let I=B.length>0&&s().length===0;R||(R=o()[0]),b(R,I)}else if(k.type==="paste"){let{__experimentalCanUserUseUnfilteredHTML:R}=a(),I=bce(k,R);if(x.length===1){let[A]=x;if(I.every(P=>l(P.name,A))){h(I,void 0,A),b(I[0]?.clientId,!1);return}}p(x,I,I.length-1,-1),b(I[0]?.clientId,!1)}}}return g.ownerDocument.addEventListener("copy",y),g.ownerDocument.addEventListener("cut",y),g.ownerDocument.addEventListener("paste",y),()=>{g.ownerDocument.removeEventListener("copy",y),g.ownerDocument.removeEventListener("cut",y),g.ownerDocument.removeEventListener("paste",y)}},[])}var af=c(E(),1),cWe=(e,t)=>t.type==="clear"?{}:Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce((o,r)=>({...o,[r]:t.type==="expand"}),{})}:e,Eve=32;function Bve({id:e,blocks:t,dropZoneElement:o,showBlockMovers:r=!1,isExpanded:n=!1,showAppender:i=!1,blockSettingsMenu:s=W9,rootClientId:a,description:l,onSelect:u,additionalBlockContent:d},f){t&&(0,Rve.default)("`blocks` property in `wp.blockEditor.__experimentalListView`",{since:"6.3",alternative:"`rootClientId` property"});let p=(0,Zk.useInstanceId)(Bve),{clientIdsTree:h,draggedClientIds:m,selectedClientIds:g}=mve({blocks:t,rootClientId:a}),b=fve(h),{getBlock:v,getSelectedBlockClientIds:y}=(0,SE.useSelect)(C),{visibleBlockCount:k}=(0,SE.useSelect)(oe=>{let{getGlobalBlockCount:ne,getClientIdsOfDescendants:X}=oe(C),re=m?.length>0?X(m).length+1:0;return{visibleBlockCount:ne()-re}},[m]),{updateBlockSelection:S}=uve(),[_,x]=(0,Wr.useReducer)(cWe,{}),[w,T]=(0,Wr.useState)(null),{setSelectedTreeId:B}=xve({firstSelectedBlockClientId:g[0],setExpandedState:x}),R=(0,Wr.useCallback)((oe,ne,X)=>{S(oe,ne,null,X),B(ne),u&&u(v(ne))},[B,S,u,v]),{ref:I,target:A}=kve({dropZoneElement:o,expandedState:_,setExpandedState:x}),P=(0,Wr.useRef)(),O=Cve({selectBlock:R}),N=(0,Wr.useCallback)(oe=>{let[ne]=y();ne&&oe&&Gk(ne,oe)},[y]),z=(0,Zk.useMergeRefs)([O,N,P,I,f]),V=(0,Wr.useCallback)(oe=>{if(!oe)return;let ne=Array.isArray(oe)?oe:[oe];x({type:"expand",clientIds:ne})},[x]),M=(0,Wr.useCallback)(oe=>{oe&&x({type:"collapse",clientIds:[oe]})},[x]),D=(0,Wr.useCallback)(()=>{x({type:"clear"})},[x]),L=(0,Wr.useCallback)(oe=>{V(oe?.dataset?.block)},[V]),j=(0,Wr.useCallback)(oe=>{M(oe?.dataset?.block)},[M]),q=(0,Wr.useCallback)((oe,ne,X)=>{oe.shiftKey&&S(oe,ne?.dataset?.block,X?.dataset?.block)},[S]);bve({collapseAll:D,expand:V});let J=m?.[0],{blockDropTargetIndex:te,blockDropPosition:ee,firstDraggedBlockIndex:$}=(0,Wr.useMemo)(()=>{let oe,ne;if(A?.clientId){let X=b[A.clientId];oe=X===void 0||A?.dropPosition==="top"?X:X+1}else A===null&&(oe=null);if(J){let X=b[J];ne=X===void 0||A?.dropPosition==="top"?X:X+1}return{blockDropTargetIndex:oe,blockDropPosition:A?.dropPosition,firstDraggedBlockIndex:ne}},[A,b,J]),W=(0,Wr.useMemo)(()=>({blockDropPosition:ee,blockDropTargetIndex:te,blockIndexes:b,draggedClientIds:m,expandedState:_,expand:V,firstDraggedBlockIndex:$,collapse:M,collapseAll:D,BlockSettingsMenu:s,listViewInstanceId:p,AdditionalBlockContent:d,insertedBlock:w,setInsertedBlock:T,treeGridElementRef:P,rootClientId:a}),[ee,te,b,m,_,V,$,M,D,s,p,d,w,T,a]),[Y]=(0,Zk.__experimentalUseFixedWindowList)(P,Eve,k,{expandedState:_,useWindowing:!0,windowOverscan:40});if(!h.length&&!i)return null;let Z=l&&`block-editor-list-view-description-${p}`;return(0,af.jsxs)(SE.AsyncModeProvider,{value:!0,children:[(0,af.jsx)(sve,{draggedBlockClientId:J,listViewRef:P,blockDropTarget:A}),l&&(0,af.jsx)(bt,{id:Z,children:l}),(0,af.jsx)(Tve.__experimentalTreeGrid,{id:e,className:K("block-editor-list-view-tree",{"is-dragging":m?.length>0&&te!==void 0}),"aria-label":(0,hG.__)("Block navigation structure"),ref:z,onCollapseRow:j,onExpandRow:L,onFocusRow:q,applicationAriaLabel:(0,hG.__)("Block navigation structure"),"aria-describedby":Z,style:{"--wp-admin--list-view-dragged-items-height":m?.length?`${Eve*(m.length-1)}px`:null},children:(0,af.jsx)(gM.Provider,{value:W,children:(0,af.jsx)(ive,{blocks:h,parentId:a,selectBlock:R,showBlockMovers:r,fixedListWindow:Y,selectedClientIds:g,isExpanded:n,showAppender:i})})})]})}var kE=(0,Wr.forwardRef)(Bve),BM=(0,Wr.forwardRef)((e,t)=>(0,af.jsx)(kE,{ref:t,...e,showAppender:!1,rootClientId:null,onSelect:null,additionalBlockContent:null,blockSettingsMenu:void 0}));var zm=c(E(),1);function uWe({isEnabled:e,onToggle:t,isOpen:o,innerRef:r,...n}){return(0,zm.jsx)(PM.Button,{__next40pxDefaultSize:!0,...n,ref:r,icon:Qx,"aria-expanded":o,"aria-haspopup":"true",onClick:e?t:void 0,label:(0,gG.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!e})}function dWe({isDisabled:e,...t},o){(0,Pve.default)("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});let n=(0,Ive.useSelect)(i=>!!i(C).getBlockCount(),[])&&!e;return(0,zm.jsx)(PM.Dropdown,{contentClassName:"block-editor-block-navigation__popover",popoverProps:{placement:"bottom-start"},renderToggle:({isOpen:i,onToggle:s})=>(0,zm.jsx)(uWe,{...t,innerRef:o,isOpen:i,onToggle:s,isEnabled:n}),renderContent:()=>(0,zm.jsxs)("div",{className:"block-editor-block-navigation__container",children:[(0,zm.jsx)("p",{className:"block-editor-block-navigation__label",children:(0,gG.__)("List view")}),(0,zm.jsx)(BM,{})]})})}var Ave=(0,Ove.forwardRef)(dWe);var _E=c(F(),1),Mve=c(Q(),1),Nve=c(fe(),1),jm=c(U(),1),bG=c(G(),1);var lf=c(E(),1),Lve=()=>{};function fWe({clientId:e,onSwitch:t=Lve,onHoverClassName:o=Lve}){let r=(0,Mve.useSelect)(_=>_(C).canEditBlock(e),[e]),{onSelect:n,stylesToRender:i,activeStyle:s,genericPreviewBlock:a,className:l}=Ik({clientId:e,onSwitch:t}),[u,d]=(0,_E.useState)(null),[f,p]=(0,_E.useState)(null),h=xr(),m=(0,_E.useMemo)(()=>{if(!u||!a)return null;let _=Am(l,s,u);return[{...a,attributes:{...a.attributes||{},className:_}}]},[u,a,l,s]);if(!r||!i||i.length===0)return null;let g=(0,Nve.debounce)(d,250),b=_=>{n(_),o(null),d(null),g.cancel()},v=_=>{if(u===_){g.cancel();return}g(_),o(_?.name??null)},y=$L(i),k=()=>s?.name!==y?.name,S=()=>{b(y)};return(0,lf.jsx)(jm.__experimentalToolsPanel,{label:(0,bG.__)("Styles"),resetAll:S,panelId:e,hasInnerWrapper:!0,dropdownMenuProps:h,children:(0,lf.jsx)(jm.__experimentalToolsPanelItem,{hasValue:k,label:(0,bG.__)("Variation"),onDeselect:S,isShownByDefault:!0,panelId:e,children:(0,lf.jsxs)("div",{ref:p,className:"block-editor-block-styles",children:[(0,lf.jsx)("div",{className:"block-editor-block-styles__variants",children:i.map(_=>{let x=_.label||_.name;return(0,lf.jsx)(jm.Button,{__next40pxDefaultSize:!0,className:K("block-editor-block-styles__item",{"is-active":s.name===_.name}),variant:"secondary",label:x,onMouseEnter:()=>v(_),onFocus:()=>v(_),onMouseLeave:()=>v(null),onBlur:()=>v(null),onClick:()=>b(_),"aria-current":s.name===_.name,children:(0,lf.jsx)(jm.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text",children:x})},_.name)})}),m&&(0,lf.jsx)(Nm,{blocks:m,placement:"left-start",offset:34,anchor:f})]})})})}var Xk=fWe;var jve=c(U(),1),Qk=c(G(),1);var Vve=c(U(),1),Fve=c(E(),1),Dve={0:O4,1:$3,2:Y3,3:Z3,4:Q3,5:e4,6:o4};function yG({level:e}){return Dve[e]?(0,Fve.jsx)(Vve.Icon,{icon:Dve[e]}):null}var IM=c(E(),1),zve=[1,2,3,4,5,6],pWe={className:"block-library-heading-level-dropdown"};function Hve({options:e=zve,value:t,onChange:o}){let r=e.filter(n=>n===0||zve.includes(n)).sort((n,i)=>n-i);return(0,IM.jsx)(jve.ToolbarDropdownMenu,{popoverProps:pWe,icon:(0,IM.jsx)(yG,{level:t}),label:(0,Qk.__)("Change level"),controls:r.map(n=>{let i=n===t;return{icon:(0,IM.jsx)(yG,{level:n}),title:n===0?(0,Qk.__)("Paragraph"):(0,Qk.sprintf)((0,Qk.__)("Heading %d"),n),isActive:i,onClick(){o(n)},role:"menuitemradio"}})})}var xE=c(G(),1),wE=c(U(),1);var cf=c(E(),1);function mWe({icon:e=S4,label:t=(0,xE.__)("Choose variation"),instructions:o=(0,xE.__)("Select a variation to start with:"),variations:r,onSelect:n,allowSkip:i}){let s=K("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,cf.jsxs)(wE.Placeholder,{icon:e,label:t,instructions:o,className:s,children:[(0,cf.jsx)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,xE.__)("Block variations"),children:r.map(a=>(0,cf.jsxs)("li",{children:[(0,cf.jsx)(wE.Button,{__next40pxDefaultSize:!0,variant:"tertiary",icon:a.icon&&a.icon.src?a.icon.src:a.icon,iconSize:48,onClick:()=>n(a),className:"block-editor-block-variation-picker__variation",label:a.description||a.title}),(0,cf.jsx)("span",{className:"block-editor-block-variation-picker__variation-label",children:a.title})]},a.name))}),i&&(0,cf.jsx)("div",{className:"block-editor-block-variation-picker__skip",children:(0,cf.jsx)(wE.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>n(),children:(0,xE.__)("Skip")})})]})}var Uve=mWe;var Kve=c(Q(),1),Yve=c(ue(),1),SG=c(U(),1);var vG=c(F(),1),kG=c(fe(),1),qve=c(G(),1);var uf=c(G(),1),Jk=c(U(),1);var Hm={carousel:"carousel",grid:"grid"};var sa=c(E(),1),hWe=({onBlockPatternSelect:e})=>(0,sa.jsx)("div",{className:"block-editor-block-pattern-setup__actions",children:(0,sa.jsx)(Jk.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:e,children:(0,uf.__)("Choose")})}),gWe=({handlePrevious:e,handleNext:t,activeSlide:o,totalSlides:r})=>(0,sa.jsxs)("div",{className:"block-editor-block-pattern-setup__navigation",children:[(0,sa.jsx)(Jk.Button,{size:"compact",icon:(0,uf.isRTL)()?un:Ti,label:(0,uf.__)("Previous pattern"),onClick:e,disabled:o===0,accessibleWhenDisabled:!0}),(0,sa.jsx)(Jk.Button,{size:"compact",icon:(0,uf.isRTL)()?Ti:un,label:(0,uf.__)("Next pattern"),onClick:t,disabled:o===r-1,accessibleWhenDisabled:!0})]}),bWe=({viewMode:e,setViewMode:t,handlePrevious:o,handleNext:r,activeSlide:n,totalSlides:i,onBlockPatternSelect:s})=>{let a=e===Hm.carousel,l=(0,sa.jsxs)("div",{className:"block-editor-block-pattern-setup__display-controls",children:[(0,sa.jsx)(Jk.Button,{size:"compact",icon:mw,label:(0,uf.__)("Carousel view"),onClick:()=>t(Hm.carousel),isPressed:a}),(0,sa.jsx)(Jk.Button,{size:"compact",icon:Gx,label:(0,uf.__)("Grid view"),onClick:()=>t(Hm.grid),isPressed:e===Hm.grid})]});return(0,sa.jsxs)("div",{className:"block-editor-block-pattern-setup__toolbar",children:[a&&(0,sa.jsx)(gWe,{handlePrevious:o,handleNext:r,activeSlide:n,totalSlides:i}),l,a&&(0,sa.jsx)(hWe,{onBlockPatternSelect:s})]})},Gve=bWe;var Wve=c(Q(),1);function yWe(e,t,o){return(0,Wve.useSelect)(r=>{let{getBlockRootClientId:n,getPatternsByBlockTypes:i,__experimentalGetAllowedPatterns:s}=r(C),a=n(e);return o?s(a).filter(o):i(t,a)},[e,t,o])}var $ve=yWe;var Xo=c(E(),1),vWe=({viewMode:e,activeSlide:t,patterns:o,onBlockPatternSelect:r,showTitles:n})=>{let i="block-editor-block-pattern-setup__container";if(e===Hm.carousel){let s=new Map([[t,"active-slide"],[t-1,"previous-slide"],[t+1,"next-slide"]]);return(0,Xo.jsx)("div",{className:"block-editor-block-pattern-setup__carousel",children:(0,Xo.jsx)("div",{className:i,children:(0,Xo.jsx)("div",{className:"carousel-container",children:o.map((a,l)=>(0,Xo.jsx)(Xve,{active:l===t,className:s.get(l)||"",pattern:a},a.name))})})})}return(0,Xo.jsx)("div",{className:"block-editor-block-pattern-setup__grid",children:(0,Xo.jsx)(SG.Composite,{role:"listbox",className:i,"aria-label":(0,qve.__)("Patterns list"),children:o.map(s=>(0,Xo.jsx)(Zve,{pattern:s,onSelect:r,showTitles:n},s.name))})})};function Zve({pattern:e,onSelect:t,showTitles:o}){let r="block-editor-block-pattern-setup-list",{blocks:n,description:i,viewportWidth:s=700}=e,a=(0,kG.useInstanceId)(Zve,`${r}__item-description`);return(0,Xo.jsx)("div",{className:`${r}__list-item`,children:(0,Xo.jsxs)(SG.Composite.Item,{render:(0,Xo.jsx)("div",{"aria-describedby":i?a:void 0,"aria-label":e.title,className:`${r}__item`}),id:`${r}__pattern__${e.name}`,role:"option",onClick:()=>t(n),children:[(0,Xo.jsx)(bs,{blocks:n,viewportWidth:s}),o&&(0,Xo.jsx)("div",{className:`${r}__item-title`,children:e.title}),!!i&&(0,Xo.jsx)(bt,{id:a,children:i})]})})}function Xve({active:e,className:t,pattern:o,minHeight:r}){let{blocks:n,title:i,description:s}=o,a=(0,kG.useInstanceId)(Xve,"block-editor-block-pattern-setup-list__item-description");return(0,Xo.jsxs)("div",{"aria-hidden":!e,role:"img",className:`pattern-slide ${t}`,"aria-label":i,"aria-describedby":s?a:void 0,children:[(0,Xo.jsx)(bs,{blocks:n,minHeight:r}),!!s&&(0,Xo.jsx)(bt,{id:a,children:s})]})}var SWe=({clientId:e,blockName:t,filterPatternsFn:o,onBlockPatternSelect:r,initialViewMode:n=Hm.carousel,showTitles:i=!1})=>{let[s,a]=(0,vG.useState)(n),[l,u]=(0,vG.useState)(0),{replaceBlock:d}=(0,Kve.useDispatch)(C),f=$ve(e,t,o);if(!f?.length)return null;let h=r||(m=>{let g=m.map(b=>(0,Yve.cloneBlock)(b));d(e,g)});return(0,Xo.jsx)(Xo.Fragment,{children:(0,Xo.jsxs)("div",{className:`block-editor-block-pattern-setup view-mode-${s}`,children:[(0,Xo.jsx)(vWe,{viewMode:s,activeSlide:l,patterns:f,onBlockPatternSelect:h,showTitles:i}),(0,Xo.jsx)(Gve,{viewMode:s,setViewMode:a,activeSlide:l,totalSlides:f.length,handleNext:()=>{u(m=>Math.min(m+1,f.length-1))},handlePrevious:()=>{u(m=>Math.max(m-1,0))},onBlockPatternSelect:()=>{h(f[l].blocks)}})]})})},Qve=SWe;var _G=c(ue(),1),df=c(G(),1),ff=c(U(),1);var OM=c(Q(),1),Jve=c(F(),1);var $r=c(E(),1),{Menu:Hb}=H(ff.privateApis);function kWe({className:e,onSelectVariation:t,selectedValue:o,variations:r}){return(0,$r.jsxs)("fieldset",{className:e,children:[(0,$r.jsx)(bt,{render:(0,$r.jsx)("legend",{}),children:(0,df.__)("Transform to variation")}),r.map(n=>(0,$r.jsx)(ff.Button,{__next40pxDefaultSize:!0,size:"compact",icon:(0,$r.jsx)(Et,{icon:n.icon,showColors:!0}),isPressed:o===n.name,label:o===n.name?n.title:(0,df.sprintf)((0,df.__)("Transform to %s"),n.title),onClick:()=>t(n.name),"aria-label":n.title,showTooltip:!0},n.name))]})}function _We({className:e,onSelectVariation:t,selectedValue:o,variations:r}){return(0,$r.jsx)("div",{className:e,children:(0,$r.jsxs)(Hb,{children:[(0,$r.jsx)(Hb.TriggerButton,{render:(0,$r.jsx)(ff.Button,{className:"block-editor-block-variation-transforms__button",__next40pxDefaultSize:!0,variant:"secondary",children:(0,df.__)("Transform to variation")})}),(0,$r.jsx)(Hb.Popover,{position:"bottom",children:(0,$r.jsx)(Hb.Group,{children:r.map(n=>(0,$r.jsxs)(Hb.RadioItem,{value:n.name,checked:o===n.name,onChange:()=>t(n.name),children:[(0,$r.jsx)(Hb.ItemLabel,{children:n.title}),n.description&&(0,$r.jsx)(Hb.ItemHelpText,{children:n.description})]},n.name))})})]})})}function xWe({className:e,onSelectVariation:t,selectedValue:o,variations:r}){return(0,$r.jsx)("div",{className:e,children:(0,$r.jsx)(ff.__experimentalToggleGroupControl,{label:(0,df.__)("Transform to variation"),value:o,hideLabelFromVision:!0,onChange:t,children:r.map(n=>(0,$r.jsx)(ff.__experimentalToggleGroupControlOptionIcon,{icon:(0,$r.jsx)(Et,{icon:n.icon,showColors:!0}),value:n.name,label:o===n.name?n.title:(0,df.sprintf)((0,df.__)("Transform to %s"),n.title)},n.name))})})}function wWe({blockClientId:e}){let{updateBlockAttributes:t}=(0,OM.useDispatch)(C),{activeBlockVariation:o,variations:r,canEdit:n,isContentOnly:i,isSection:s}=(0,OM.useSelect)(m=>{let{getActiveBlockVariation:g,getBlockVariations:b}=m(_G.store),{getBlockName:v,getBlockAttributes:y,getBlockEditingMode:k,isSectionBlock:S}=H(m(C)),{canEditBlock:_}=m(C),x=e&&v(e),{hasContentRoleAttribute:w}=H(m(_G.store)),T=w(x);return{activeBlockVariation:g(x,y(e),"transform"),variations:x&&b(x,"transform"),canEdit:_(e),isContentOnly:k(e)==="contentOnly"&&!T,isSection:S(e)}},[e]),a=o?.name,l=(0,Jve.useMemo)(()=>{let m=new Set;return r?(r.forEach(g=>{g.icon&&m.add(g.icon?.src||g.icon)}),m.size===r.length):!1},[r]),u=m=>{t(e,{...r.find(({name:g})=>g===m).attributes})};if(!r?.length||!n||i||s)return null;let d="block-editor-block-variation-transforms",p=r.length>6?kWe:xWe;return(0,$r.jsx)(l?p:_We,{className:d,onSelectVariation:u,selectedValue:a,variations:r})}var AM=wWe;var Ub=c(G(),1),LM=c(U(),1);var eSe=c(E(),1),xG={top:{icon:Xx,title:(0,Ub._x)("Align top","Block vertical alignment setting")},center:{icon:Yx,title:(0,Ub._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Kx,title:(0,Ub._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:Zx,title:(0,Ub._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:qx,title:(0,Ub._x)("Space between","Block vertical alignment setting")}},CWe=["top","center","bottom"],EWe="top";function TWe({value:e,onChange:t,controls:o=CWe,isCollapsed:r=!0,isToolbar:n}){function i(d){return()=>t(e===d?void 0:d)}let s=xG[e],a=xG[EWe],l=n?LM.ToolbarGroup:LM.ToolbarDropdownMenu,u=n?{isCollapsed:r}:{};return(0,eSe.jsx)(l,{icon:s?s.icon:a.icon,label:(0,Ub._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map(d=>({...xG[d],isActive:e===d,role:r?"menuitemradio":void 0,onClick:i(d)})),...u})}var wG=TWe;var CG=c(E(),1),lP=e=>(0,CG.jsx)(wG,{...e,isToolbar:!1}),tSe=e=>(0,CG.jsx)(wG,{...e,isToolbar:!0});var ws=c(U(),1),CE=c(F(),1),VM=c(G(),1);var oSe=c(U(),1);var EG=c(G(),1),rSe=c(E(),1);function nSe({isLinked:e,...t}){let o=e?(0,EG.__)("Unlink radii"):(0,EG.__)("Link radii");return(0,rSe.jsx)(oSe.Button,{...t,className:"components-border-radius-control__linked-button",size:"small",icon:e?ss:is,iconSize:24,label:o})}var iSe=c(U(),1);function RWe(e){return[...e].sort((o,r)=>e.filter(n=>n===r).length-e.filter(n=>n===o).length).shift()}function sSe(e={}){if(typeof e=="string")return e;let t=Object.values(e).map(a=>{let l=(0,iSe.__experimentalParseQuantityAndUnitFromRawValue)(a);return typeof a=="string"&&l[0]===void 0?[a,""]:l}),o=t.map(a=>a[0]??""),r=t.map(a=>a[1]),n=o.every(a=>a===o[0])?o[0]:"",i=RWe(r);return n===0||n?`${n}${i||""}`:void 0}function aSe(e={}){if(typeof e=="string"||!e||typeof e!="object")return!1;let t=Object.values(e);if(t.length===0)return!1;let o=t[0];return!t.every(n=>n===o)}function lSe(e){return e?typeof e=="string"?!0:!!Object.values(e).filter(o=>!!o||o===0).length:!1}var cl=c(U(),1),mSe=c(fe(),1),Gm=c(G(),1);var Gb=c(F(),1);var TG=24,cSe=8,MM={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}};var Um=(e,t)=>e?.includes?e==="0"||e.includes(`var:preset|${t}|`):!1;function uSe(e,t){if(!e)return;if(e==="0"||e==="default")return e;let o=e.match(new RegExp(`var:preset\\|${t}\\|(.+)`));return o?o[1]:void 0}function dSe(e,t,o){if(e===void 0)return 0;let r=parseFloat(e,10)===0?"0":uSe(e,o),n=t.findIndex(i=>String(i.slug)===r);return n!==-1?n:NaN}function RG(e,t,o){if(!Um(e,o))return e;let r=parseFloat(e,10)===0?"0":uSe(e,o);return t.find(i=>String(i.slug)===r)?.size}function fSe(e,t,o){if(!e||Um(e,o)||e==="0")return e;let r=t.find(n=>String(n.size)===String(e));return r?.slug?`var:preset|${o}|${r.slug}`:e}var NM=c(U(),1);var bc=c(E(),1);function pSe({allowNegativeOnDrag:e,ariaLabel:t,allPlaceholder:o,minValue:r,parsedQuantity:n,computedUnit:i,units:s,isMixed:a,step:l,max:u,showTooltip:d,value:f,minimumCustomValue:p,onCustomValueChange:h,onCustomValueSliderChange:m,onUnitChange:g,onMouseOut:b,onMouseOver:v,setMinValue:y}){let k=(0,bc.jsx)(NM.__experimentalUnitControl,{className:"preset-input-control__unit-control",disableUnits:a,hideLabelFromVision:!0,label:t,min:r,onChange:h,onUnitChange:g,onBlur:b,onFocus:v,onMouseOut:b,onMouseOver:v,units:s,value:[n,i].join(""),placeholder:o,onDragStart:()=>{e&&f?.charAt(0)==="-"&&y(0)},onDrag:()=>{e&&f?.charAt(0)==="-"&&y(0)},onDragEnd:()=>{e&&y(p)}}),S=d?(0,bc.jsxs)(kt.Root,{children:[(0,bc.jsx)(kt.Trigger,{render:(0,bc.jsx)("div",{className:"preset-input-control__tooltip-wrapper",children:k})}),(0,bc.jsx)(kt.Popup,{children:t})]}):k;return(0,bc.jsxs)(bc.Fragment,{children:[S,(0,bc.jsx)(NM.RangeControl,{className:"preset-input-control__custom-value-range",hideLabelFromVision:!0,initialPosition:0,label:t,max:u,min:0,onBlur:b,onChange:m,onFocus:v,onMouseOut:b,onMouseOver:v,step:l,value:n,withInputField:!1})]})}var Wm=c(E(),1);function Wb({allowNegativeOnDrag:e=!1,ariaLabel:t,className:o,customValueSettings:r=MM,disableCustomValues:n,icon:i,isMixed:s,value:a,minimumCustomValue:l,onChange:u,onMouseOut:d,onMouseOver:f,onUnitChange:p,placeholder:h,presets:m=[],presetType:g,selectedUnit:b,showTooltip:v,units:y}){let k=(0,Gb.useMemo)(()=>fSe(a,m,g),[a,m,g]),S=o??"preset-input-control",_=m.slice(1,m.length-1).map((Z,oe)=>({value:oe+1,label:void 0})),x=_.length>0,w=m.length<=cSe,T=s?(0,Gm.__)("Mixed"):h??null,[B,R]=(0,Gb.useState)(l),[I,A]=(0,Gb.useState)(!n&&k!==void 0&&!Um(k,g)),P=null,O=(0,mSe.usePrevious)(k);(0,Gb.useEffect)(()=>{k&&O!==k&&!Um(k,g)&&I!==!0&&A(!0)},[k,O,g,I]);let N=!w&&!I&&k!==void 0&&(!Um(k,g)||Um(k,g)&&s),z=m;N?(z=[...m,{name:s?(0,Gm.__)("Mixed"):(0,Gm.sprintf)((0,Gm.__)("Custom (%s)"),k),slug:"custom",size:k}],P=z.length-1):s||(P=I?RG(k,m,g):dSe(k,m,g));let V=z.map((Z,oe)=>({key:oe,name:Z.name})),M=Um(k,g)?RG(k,m,g):k,[D,L]=(0,cl.__experimentalParseQuantityAndUnitFromRawValue)(M),j=L||b||"px",q=y?.find(Z=>Z.value===j),J=q?.step??r[j]?.steps??.1,te=q?.max??r[j]?.max??10,ee=Z=>{if(Z===void 0||Z===""){u(void 0);return}isNaN(parseFloat(Z))||u(Z)},$=Z=>{u([Z,j].join(""))},W=Z=>k===void 0?void 0:m[Z]?.name,Y=(Z,oe)=>{let ne=parseInt(Z,10);if(oe==="selectList"){if(ne===0&&m[0]?.slug==="0")return"0";if(ne===0)return}else if(ne===0)return"0";return`var:preset|${g}|${m[Z]?.slug}`};return(0,Wm.jsxs)(cl.__experimentalHStack,{className:`preset-input-control__wrapper ${S}__wrapper`,children:[i&&(0,Wm.jsx)(cl.Icon,{className:"preset-input-control__icon",icon:i,size:TG}),(!x||I)&&(0,Wm.jsx)(pSe,{allowNegativeOnDrag:e,ariaLabel:t,allPlaceholder:T,minValue:B,parsedQuantity:D,computedUnit:j,units:y,isMixed:s,step:J,max:te,showTooltip:v,value:k,minimumCustomValue:l,onCustomValueChange:ee,onCustomValueSliderChange:$,onUnitChange:p,onMouseOut:d,onMouseOver:f,setMinValue:R}),x&&w&&!I&&(0,Wm.jsx)(cl.RangeControl,{"aria-valuenow":P,"aria-valuetext":m[P]?.name,className:"preset-input-control__preset-range",hideLabelFromVision:!0,initialPosition:0,label:t,max:m.length-1,marks:_,min:0,onBlur:d,onChange:Z=>u(Y(Z)),onFocus:f,onMouseDown:Z=>{Z?.nativeEvent?.offsetX<35&&k===void 0&&u("0")},onMouseOut:d,onMouseOver:f,renderTooltipContent:W,step:1,value:P,withInputField:!1}),x&&!w&&!I&&(0,Wm.jsx)(cl.CustomSelectControl,{className:"preset-input-control__custom-select-control",hideLabelFromVision:!0,label:t,onBlur:d,onChange:Z=>{N&&Z.selectedItem.key===V.length-1?A(!0):u(Y(Z.selectedItem.key,"selectList"))},onFocus:f,onMouseOut:d,onMouseOver:f,options:V,value:V.find(Z=>Z.key===P)||""}),x&&!n&&(0,Wm.jsx)(cl.Button,{className:"preset-input-control__custom-toggle",icon:t6,iconSize:TG,isPressed:I,label:I?(0,Gm.__)("Use preset"):(0,Gm.__)("Set custom value"),onClick:()=>{A(!I)},size:"small"})]})}var e_=c(G(),1);var hSe=8,DM=[],BG={all:(0,e_.__)("Border radius"),topLeft:(0,e_.__)("Top left"),topRight:(0,e_.__)("Top right"),bottomLeft:(0,e_.__)("Bottom left"),bottomRight:(0,e_.__)("Bottom right")},PG={all:f3,topLeft:h3,topRight:g3,bottomLeft:p3,bottomRight:m3},IG=0;var pf=c(E(),1);function BWe(e){let t=e?.default??DM,o=e?.custom??DM,r=e?.theme??DM;return(0,CE.useMemo)(()=>{let n=[{name:(0,VM.__)("None"),slug:"0",size:0},...o,...r,...t];return n.length>hSe?[{name:(0,VM.__)("Default"),slug:"default",size:void 0},...n]:n},[o,r,t])}function gSe(e,t){return t==="all"?sSe(e):typeof e=="string"?e:e?.[t]}function bSe(e,t){return t==="all"?e.flat:e[t]}function ySe(e,t,o){return r=>{o(e==="all"?{topLeft:r,topRight:r,bottomLeft:r,bottomRight:r}:{...typeof t!="string"?t||{}:{topLeft:t,topRight:t,bottomLeft:t,bottomRight:t},[e]:r})}}function vSe(e,t,o){return r=>{let n={...t};e==="all"?(n.flat=r,n.topLeft=r,n.topRight=r,n.bottomLeft=r,n.bottomRight=r):n[e]=r,o(n)}}function FM({onChange:e,values:t,presets:o}){let[r,n]=(0,CE.useState)(!lSe(t)||!aSe(t)),i=BWe(o),[s,a]=(0,CE.useState)({flat:typeof t=="string"?(0,ws.__experimentalParseQuantityAndUnitFromRawValue)(t)[1]:void 0,topLeft:(0,ws.__experimentalParseQuantityAndUnitFromRawValue)(t?.topLeft)[1],topRight:(0,ws.__experimentalParseQuantityAndUnitFromRawValue)(t?.topRight)[1],bottomLeft:(0,ws.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomLeft)[1],bottomRight:(0,ws.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomRight)[1]}),[l]=Le("spacing.units"),u=(0,ws.__experimentalUseCustomUnits)({availableUnits:l||["px","em","rem"]}),d=()=>n(!r);return(0,pf.jsxs)("fieldset",{className:"components-border-radius-control",children:[(0,pf.jsxs)(ws.__experimentalHStack,{className:"components-border-radius-control__header",children:[(0,pf.jsx)(ws.BaseControl.VisualLabel,{as:"legend",children:(0,VM.__)("Radius")}),(0,pf.jsx)(nSe,{onClick:d,isLinked:r})]}),r?(0,pf.jsx)(Wb,{ariaLabel:BG.all,className:"components-border-radius-control",icon:PG.all,minimumCustomValue:IG,onChange:ySe("all",t,e),onUnitChange:vSe("all",s,a),presets:i,presetType:"border-radius",selectedUnit:bSe(s,"all"),showTooltip:!0,units:u,value:gSe(t,"all")}):(0,pf.jsx)(ws.__experimentalVStack,{children:["topLeft","topRight","bottomLeft","bottomRight"].map(f=>(0,pf.jsx)(Wb,{ariaLabel:BG[f],className:"components-border-radius-control",icon:PG[f],minimumCustomValue:IG,onChange:ySe(f,t,e),onUnitChange:vSe(f,s,a),presets:i,presetType:"border-radius",selectedUnit:bSe(s,f),showTooltip:!0,units:u,value:gSe(t,f)},f))})]})}var _Se=c(U(),1);var SSe=c(fe(),1);var kSe=c(E(),1),zM=(0,SSe.createHigherOrderComponent)(e=>function(o){let[r,n,i,s,a]=Le("color.palette.default","color.palette.theme","color.palette.custom","color.custom","color.defaultPalette"),l=a?[...n||[],...r||[],...i||[]]:[...n||[],...i||[]],{colors:u=l,disableCustomColors:d=!s}=o,f=u&&u.length>0||!d;return(0,kSe.jsx)(e,{...o,colors:u,disableCustomColors:d,hasColorsToChoose:f})},"withColorContext");var xSe=zM(_Se.ColorPalette);var OG=c(G(),1),aa=c(U(),1);var Fo=c(E(),1),{Tabs:t_}=H(aa.privateApis),PWe=["colors","disableCustomColors","gradients","disableCustomGradients"],Eu={color:"color",gradient:"gradient"};function wSe({colors:e,gradients:t,disableCustomColors:o,disableCustomGradients:r,__experimentalIsRenderedInSidebar:n,className:i,label:s,onColorChange:a,onGradientChange:l,colorValue:u,colorSlug:d,gradientValue:f,gradientSlug:p,clearable:h,showTitle:m=!0,enableAlpha:g,headingLevel:b,noticeProps:v}){let y=a&&(e&&e.length>0||!o),k=l&&(t&&t.length>0||!r);if(!y&&!k)return null;let _=(0,Fo.jsx)(aa.ColorPalette,{value:u,selectedSlug:d,onChange:k?(T,B,R)=>{a(T,R),l()}:(T,B,R)=>a(T,R),colors:e,disableCustomColors:o,__experimentalIsRenderedInSidebar:n,clearable:h,enableAlpha:g,headingLevel:b}),x={[Eu.color]:(0,Fo.jsxs)(Fo.Fragment,{children:[_,v&&(0,Fo.jsx)(aa.Notice,{isDismissible:!1,...v})]}),[Eu.gradient]:(0,Fo.jsx)(aa.GradientPicker,{value:f,selectedSlug:p,onChange:y?(T,B,R)=>{l(T,R),a()}:(T,B,R)=>l(T,R),gradients:t,disableCustomGradients:r,__experimentalIsRenderedInSidebar:n,clearable:h,headingLevel:b})},w=T=>(0,Fo.jsx)("div",{className:"block-editor-color-gradient-control__panel",children:x[T]});return(0,Fo.jsx)(aa.BaseControl,{className:K("block-editor-color-gradient-control",i),children:(0,Fo.jsx)("fieldset",{className:"block-editor-color-gradient-control__fieldset",children:(0,Fo.jsxs)(aa.__experimentalVStack,{spacing:1,children:[m&&(0,Fo.jsx)("legend",{children:(0,Fo.jsx)("div",{className:"block-editor-color-gradient-control__color-indicator",children:(0,Fo.jsx)(aa.BaseControl.VisualLabel,{children:s})})}),y&&k&&(0,Fo.jsx)("div",{children:(0,Fo.jsxs)(t_,{defaultTabId:f?Eu.gradient:!!y&&Eu.color,children:[(0,Fo.jsxs)(t_.TabList,{children:[(0,Fo.jsx)(t_.Tab,{tabId:Eu.color,children:(0,OG.__)("Color")}),(0,Fo.jsx)(t_.Tab,{tabId:Eu.gradient,children:(0,OG.__)("Gradient")})]}),(0,Fo.jsx)(t_.TabPanel,{tabId:Eu.color,className:"block-editor-color-gradient-control__panel",focusable:!1,children:x.color}),(0,Fo.jsx)(t_.TabPanel,{tabId:Eu.gradient,className:"block-editor-color-gradient-control__panel",focusable:!1,children:x.gradient})]})}),!k&&w(Eu.color),!y&&w(Eu.gradient)]})})})}function IWe(e){let[t,o,r,n]=Le("color.palette","color.gradients","color.custom","color.customGradient");return(0,Fo.jsx)(wSe,{colors:t,gradients:o,disableCustomColors:!r,disableCustomGradients:!n,...e})}function OWe(e){return PWe.every(t=>e.hasOwnProperty(t))?(0,Fo.jsx)(wSe,{...e}):(0,Fo.jsx)(IWe,{...e})}var $m=OWe;var CSe=c(E(),1);function ESe({onChange:e,value:t,...o}){return(0,CSe.jsx)($m,{...o,onColorChange:e,colorValue:t,gradients:[],disableCustomGradients:!0})}var yc=c(G(),1),TSe=c(U(),1),RSe=c(Qr(),1),AG=c(E(),1);Yf([qf,jy]);function LG({backgroundColor:e,fallbackBackgroundColor:t,fallbackTextColor:o,fallbackLinkColor:r,fontSize:n,isLargeText:i,textColor:s,linkColor:a,messageOverride:l,enableAlphaChecker:u=!1}){let d=e||t;if(!d)return null;let f=s||o,p=a||r;if(!f&&!p)return null;let h=[{color:f,description:(0,yc.__)("text color")},{color:p,description:(0,yc.__)("link color")}],m=Lo(d),g=m.alpha()<1,b=m.brightness(),v={level:"AA",size:i||i!==!1&&n>=24?"large":"small"},y="",k="";for(let S of h){if(!S.color)continue;let _=Lo(S.color),x=_.isReadable(m,v),w=_.alpha()<1;if(!x){if(g||w)continue;if(l){y=l,k=l;break}y=b<_.brightness()?(0,yc.sprintf)((0,yc.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),S.description):(0,yc.sprintf)((0,yc.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),S.description),k=(0,yc.__)("This color combination may be hard for people to read.");break}w&&u&&(y=(0,yc.__)("Transparent text may be hard for people to read."),k=(0,yc.__)("Transparent text may be hard for people to read."))}return y?{message:y,speakMessage:k}:null}function AWe(e){let t=LG(e);return t?((0,RSe.speak)(t.speakMessage),(0,AG.jsx)("div",{className:"block-editor-contrast-checker",children:(0,AG.jsx)(TSe.Notice,{spokenMessage:null,status:"warning",isDismissible:!1,children:t.message})})):null}var BSe=AWe;var Zn=c(G(),1),EE=c(Tu(),1),jM=c(F(),1),Sc=c(U(),1);var vc=c(E(),1),Km=new Date;Km.setDate(20);Km.setMonth(Km.getMonth()-3);Km.getMonth()===4&&Km.setMonth(3);function ISe({format:e,defaultFormat:t,onChange:o}){return(0,vc.jsxs)(Sc.__experimentalVStack,{as:"fieldset",spacing:4,className:"block-editor-date-format-picker",children:[(0,vc.jsx)(bt,{render:(0,vc.jsx)("legend",{}),children:(0,Zn.__)("Date format")}),(0,vc.jsx)(Sc.ToggleControl,{label:(0,Zn.__)("Default format"),help:`${(0,Zn.__)("Example:")} ${(0,EE.dateI18n)(t,Km)}`,checked:!e,onChange:r=>o(r?null:t)}),e&&(0,vc.jsx)(LWe,{format:e,onChange:o})]})}function LWe({format:e,onChange:t}){let r=[...[...new Set(["Y-m-d",(0,Zn._x)("n/j/Y","short date format"),(0,Zn._x)("n/j/Y g:i A","short date format with time"),(0,Zn._x)("M j, Y","medium date format"),(0,Zn._x)("M j, Y g:i A","medium date format with time"),(0,Zn._x)("F j, Y","long date format"),(0,Zn._x)("M j","short date format without the year")])].map((a,l)=>({key:`suggested-${l}`,name:(0,EE.dateI18n)(a,Km),format:a})),{key:"human-diff",name:(0,EE.humanTimeDiff)(Km),format:"human-diff"}],n={key:"custom",name:(0,Zn.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",hint:(0,Zn.__)("Enter your own date format")},[i,s]=(0,jM.useState)(()=>!!e&&!r.some(a=>a.format===e));return(0,vc.jsxs)(Sc.__experimentalVStack,{children:[(0,vc.jsx)(Sc.CustomSelectControl,{label:(0,Zn.__)("Choose a format"),options:[...r,n],value:i?n:r.find(a=>a.format===e)??n,onChange:({selectedItem:a})=>{a===n?s(!0):(s(!1),t(a.format))}}),i&&(0,vc.jsx)(Sc.TextControl,{label:(0,Zn.__)("Custom format"),hideLabelFromVision:!0,help:(0,jM.createInterpolateElement)((0,Zn.__)("Enter a date or timeformat string."),{Link:(0,vc.jsx)(Sc.ExternalLink,{href:(0,Zn.__)("https://wordpress.org/documentation/article/customize-date-and-time-format/")})}),value:e,onChange:a=>t(a)})]})}var ul=c(U(),1),TE=c(G(),1),OSe=c(io(),1);var ASe=c(fe(),1),Ru=c(E(),1);function LSe({id:e,colorPalette:t,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:n,value:i,onChange:s}){let a;i==="unset"?a=(0,Ru.jsx)(ul.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):i?a=(0,Ru.jsx)(ul.DuotoneSwatch,{values:i}):a=(0,Ru.jsx)(gt,{icon:R3});let l=(0,TE.__)("Apply duotone filter"),d=`${(0,ASe.useInstanceId)(LSe,"duotone-control",e)}__description`;return(0,Ru.jsx)(ul.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,TE.__)("Duotone")},renderToggle:({isOpen:f,onToggle:p})=>(0,Ru.jsx)(ul.ToolbarButton,{showTooltip:!0,onClick:p,"aria-haspopup":"true","aria-expanded":f,onKeyDown:m=>{!f&&m.keyCode===OSe.DOWN&&(m.preventDefault(),p())},label:l,icon:a}),renderContent:()=>(0,Ru.jsxs)(ul.MenuGroup,{label:(0,TE.__)("Duotone"),children:[(0,Ru.jsx)("p",{children:(0,TE.__)("Create a two-tone color effect without losing your original image.")}),(0,Ru.jsx)(ul.DuotonePicker,{"aria-label":l,"aria-describedby":d,colorPalette:t,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:n,value:i,onChange:s})]})})}var HM=LSe;var VSe=c(U(),1),FSe=c(F(),1),la=c(G(),1);var On=c(G(),1);var UM=c(G(),1);function MSe(e){if(!e)return{};if(typeof e=="object")return e;let t;switch(e){case"normal":t=(0,UM._x)("Regular","font style");break;case"italic":t=(0,UM._x)("Italic","font style");break;case"oblique":t=(0,UM._x)("Oblique","font style");break;default:t=e;break}return{name:t,value:e}}var kc=c(G(),1);function MG(e){if(!e)return{};if(typeof e=="object")return e;let t;switch(e){case"normal":case"400":t=(0,kc._x)("Regular","font weight");break;case"bold":case"700":t=(0,kc._x)("Bold","font weight");break;case"100":t=(0,kc._x)("Thin","font weight");break;case"200":t=(0,kc._x)("Extra Light","font weight");break;case"300":t=(0,kc._x)("Light","font weight");break;case"500":t=(0,kc._x)("Medium","font weight");break;case"600":t=(0,kc._x)("Semi Bold","font weight");break;case"800":t=(0,kc._x)("Extra Bold","font weight");break;case"900":t=(0,kc._x)("Black","font weight");break;case"1000":t=(0,kc._x)("Extra Black","font weight");break;default:t=e;break}return{name:t,value:e}}var NSe=[{name:(0,On._x)("Regular","font style"),value:"normal"},{name:(0,On._x)("Italic","font style"),value:"italic"}],DSe=[{name:(0,On._x)("Thin","font weight"),value:"100"},{name:(0,On._x)("Extra Light","font weight"),value:"200"},{name:(0,On._x)("Light","font weight"),value:"300"},{name:(0,On._x)("Regular","font weight"),value:"400"},{name:(0,On._x)("Medium","font weight"),value:"500"},{name:(0,On._x)("Semi Bold","font weight"),value:"600"},{name:(0,On._x)("Bold","font weight"),value:"700"},{name:(0,On._x)("Extra Bold","font weight"),value:"800"},{name:(0,On._x)("Black","font weight"),value:"900"},{name:(0,On._x)("Extra Black","font weight"),value:"1000"}];function o_(e){let t=[],o=[],r=[],n=!e||e?.length===0,i=!1;return e?.forEach(s=>{if(typeof s.fontWeight=="string"&&/\s/.test(s.fontWeight.trim())){i=!0;let[u,d]=s.fontWeight.split(" "),f=parseInt(u.slice(0,1)),p=d==="1000"?10:parseInt(d.slice(0,1));for(let h=f;h<=p;h++){let m=`${h.toString()}00`;o.some(g=>g.value===m)||o.push(MG(m))}}let a=MG(typeof s.fontWeight=="number"?s.fontWeight.toString():s.fontWeight),l=MSe(s.fontStyle);l&&Object.keys(l).length&&(t.some(u=>u.value===l.value)||t.push(l)),a&&Object.keys(a).length&&(o.some(u=>u.value===a.value)||i||o.push(a))}),o.some(s=>(s.value??"")>="600")||o.push({name:(0,On._x)("Bold","font weight"),value:"700"}),t.some(s=>s.value==="italic")||t.push({name:(0,On._x)("Italic","font style"),value:"italic"}),n&&(t=NSe,o=DSe),t=t.length===0?NSe:t,o=o.length===0?DSe:o,t.forEach(({name:s,value:a})=>{o.forEach(({name:l,value:u})=>{let d=a==="normal"?l:(0,On.sprintf)((0,On._x)("%1$s %2$s","font"),l??"",s??"");r.push({key:`${a}-${u}`,name:d??"",style:{fontStyle:a,fontWeight:u}})})}),{fontStyles:t,fontWeights:o,combinedStyleAndWeightOptions:r,isSystemFont:n,isVariableFont:i}}var zSe=c(E(),1),MWe=(e,t)=>e?t?(0,la.__)("Appearance"):(0,la.__)("Font style"):(0,la.__)("Font weight");function GM(e){let{__next40pxDefaultSize:t,onChange:o,hasFontStyles:r=!0,hasFontWeights:n=!0,fontFamilyFaces:i,value:{fontStyle:s,fontWeight:a},...l}=e,u=r||n,d=MWe(r,n),f={key:"default",name:(0,la.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},{fontStyles:p,fontWeights:h,combinedStyleAndWeightOptions:m}=o_(i),g=()=>{let _=[f];return m&&_.push(...m),_},b=()=>{let _=[f];return p.forEach(({name:x,value:w})=>{_.push({key:w,name:x,style:{fontStyle:w,fontWeight:void 0}})}),_},v=()=>{let _=[f];return h.forEach(({name:x,value:w})=>{_.push({key:w,name:x,style:{fontStyle:void 0,fontWeight:w}})}),_},y=(0,FSe.useMemo)(()=>r&&n?g():r?b():v(),[e.options,p,h,m]),k=y.find(_=>_.style.fontStyle===s&&_.style.fontWeight===a)||y[0];return u&&(0,zSe.jsx)(VSe.CustomSelectControl,{...l,className:"components-font-appearance-control",label:d,describedBy:k?r?n?(0,la.sprintf)((0,la.__)("Currently selected font appearance: %s"),k.name):(0,la.sprintf)((0,la.__)("Currently selected font style: %s"),k.name):(0,la.sprintf)((0,la.__)("Currently selected font weight: %s"),k.name):(0,la.__)("No selected font appearance"),options:y,value:k,onChange:({selectedItem:_})=>o(_.style)})}var jSe=c(U(),1),NG=c(G(),1);var HSe=c(E(),1);function WM({__next40pxDefaultSize:e,value:t="",onChange:o,fontFamilies:r,className:n,...i}){let[s]=Le("typography.fontFamilies");if(r||(r=s),!r||r.length===0)return null;let a=[{key:"",name:(0,NG.__)("Default")},...r.map(({fontFamily:u,name:d})=>({key:u,name:d||u,style:{fontFamily:u}}))],l=a.find(u=>u.key===t)??"";return(0,HSe.jsx)(jSe.CustomSelectControl,{label:(0,NG.__)("Font"),value:l,onChange:({selectedItem:u})=>o(u.key),options:a,className:K("block-editor-font-family-control",n),...i})}var $M=c(U(),1),USe=c(G(),1);var GSe=c(E(),1);function KM({value:e,onChange:t,__unstableInputWidth:o="60px",...r}){let[n]=Le("spacing.units"),i=(0,$M.__experimentalUseCustomUnits)({availableUnits:n||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,GSe.jsx)($M.__experimentalUnitControl,{...r,label:(0,USe.__)("Letter spacing"),value:e,__unstableInputWidth:o,units:i,onChange:t})}var RE=c(G(),1),YM=c(U(),1),DG=c(E(),1),NWe=[{label:(0,RE.__)("None"),value:"none",icon:dn},{label:(0,RE.__)("Underline"),value:"underline",icon:N3},{label:(0,RE.__)("Strikethrough"),value:"line-through",icon:L3}];function qM({value:e,onChange:t,className:o}){return(0,DG.jsx)(YM.__experimentalToggleGroupControl,{isDeselectable:!0,label:(0,RE.__)("Decoration"),className:K("block-editor-text-decoration-control",o),value:e,onChange:r=>{t(r===e?void 0:r)},children:NWe.map(r=>(0,DG.jsx)(YM.__experimentalToggleGroupControlOptionIcon,{value:r.value,icon:r.icon,label:r.label},r.value))})}var r_=c(G(),1);var ZM=c(U(),1),VG=c(E(),1),DWe=[{label:(0,r_.__)("None"),value:"none",icon:dn},{label:(0,r_.__)("Uppercase"),value:"uppercase",icon:V3},{label:(0,r_.__)("Lowercase"),value:"lowercase",icon:O3},{label:(0,r_.__)("Capitalize"),value:"capitalize",icon:P3}];function XM({className:e,value:t,onChange:o}){return(0,VG.jsx)(ZM.__experimentalToggleGroupControl,{isDeselectable:!0,label:(0,r_.__)("Letter case"),className:K("block-editor-text-transform-control",e),value:t,onChange:r=>{o(r===t?void 0:r)},children:DWe.map(r=>(0,VG.jsx)(ZM.__experimentalToggleGroupControlOptionIcon,{value:r.value,icon:r.icon,label:r.label},r.value))})}var n_=c(G(),1);var QM=c(U(),1),FG=c(E(),1),VWe=[{label:(0,n_.__)("Horizontal"),value:"horizontal-tb",icon:x6},{label:(0,n_.__)("Vertical"),value:(0,n_.isRTL)()?"vertical-lr":"vertical-rl",icon:C6}];function JM({className:e,value:t,onChange:o}){return(0,FG.jsx)(QM.__experimentalToggleGroupControl,{isDeselectable:!0,label:(0,n_.__)("Orientation"),className:K("block-editor-writing-mode-control",e),value:t,onChange:r=>{o(r===t?void 0:r)},children:VWe.map(r=>(0,FG.jsx)(QM.__experimentalToggleGroupControlOptionIcon,{value:r.value,icon:r.icon,label:r.label},r.value))})}var $i=c(U(),1),WSe=c(F(),1),$Se=c(G(),1);var mn=c(E(),1),FWe=({setting:e,children:t,panelId:o,...r})=>{let n=()=>{e.colorValue?e.onColorChange():e.gradientValue&&e.onGradientChange()};return(0,mn.jsx)($i.__experimentalToolsPanelItem,{hasValue:()=>!!e.colorValue||!!e.gradientValue,label:e.label,onDeselect:n,isShownByDefault:e.isShownByDefault!==void 0?e.isShownByDefault:!0,...r,className:K("block-editor-color-gradient-item","block-editor-tools-panel-color-gradient-settings__item"),panelId:o,resetAllFilter:e.resetAllFilter,children:t})},zWe=({colorValue:e,label:t})=>(0,mn.jsxs)($i.__experimentalHStack,{justify:"flex-start",children:[(0,mn.jsx)($i.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:e}),(0,mn.jsx)($i.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:t,children:t})]}),jWe=e=>function({onToggle:o,isOpen:r}){let{clearable:n,colorValue:i,gradientValue:s,onColorChange:a,onGradientChange:l,label:u}=e,d=(0,WSe.useRef)(void 0),f={onClick:o,className:K("block-editor-panel-color-gradient-settings__dropdown",{"is-open":r}),"aria-expanded":r,ref:d},p=()=>{i?a():s&&l()},h=i??s;return(0,mn.jsxs)(mn.Fragment,{children:[(0,mn.jsx)($i.Button,{__next40pxDefaultSize:!0,...f,children:(0,mn.jsx)(zWe,{colorValue:h,label:u})}),n&&h&&(0,mn.jsx)($i.Button,{__next40pxDefaultSize:!0,label:(0,$Se.__)("Reset"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:dn,onClick:()=>{p(),r&&o(),d.current?.focus()}})]})};function eN({colors:e,disableCustomColors:t,disableCustomGradients:o,enableAlpha:r,gradients:n,settings:i,__experimentalIsRenderedInSidebar:s,...a}){let l;return s&&(l={placement:"left-start",offset:36,shift:!0}),(0,mn.jsx)(mn.Fragment,{children:i.map((u,d)=>{let f={clearable:!1,colorValue:u.colorValue,colors:e,disableCustomColors:t,disableCustomGradients:o,enableAlpha:r,gradientValue:u.gradientValue,gradients:n,label:u.label,onColorChange:u.onColorChange,onGradientChange:u.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:s,...u},p={clearable:u.clearable,label:u.label,colorValue:u.colorValue,gradientValue:u.gradientValue,onColorChange:u.onColorChange,onGradientChange:u.onGradientChange};return u&&(0,mn.jsx)(FWe,{setting:u,...a,children:(0,mn.jsx)($i.Dropdown,{popoverProps:l,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:jWe(p),renderContent:()=>(0,mn.jsx)($i.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,mn.jsx)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:(0,mn.jsx)($m,{...f})})})})},d)})})}var tN=c(U(),1),KSe=c(Q(),1),YSe=c(fe(),1);var zG=c(F(),1),$b=c(G(),1);function Ym(){let[e,t,o,r,n,i,s,a,l,u]=Le("color.custom","color.palette.custom","color.palette.theme","color.palette.default","color.defaultPalette","color.customGradient","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients"),d={disableCustomColors:!e,disableCustomGradients:!i};return d.colors=(0,zG.useMemo)(()=>{let f=[];return o&&o.length&&f.push({name:(0,$b._x)("Theme","Indicates this palette comes from the theme."),slug:"theme",colors:o}),n&&r&&r.length&&f.push({name:(0,$b._x)("Default","Indicates this palette comes from WordPress."),slug:"default",colors:r}),t&&t.length&&f.push({name:(0,$b._x)("Custom","Indicates this palette is created by the user."),slug:"custom",colors:t}),f},[t,o,r,n]),d.gradients=(0,zG.useMemo)(()=>{let f=[];return a&&a.length&&f.push({name:(0,$b._x)("Theme","Indicates this palette comes from the theme."),slug:"theme",gradients:a}),u&&l&&l.length&&f.push({name:(0,$b._x)("Default","Indicates this palette comes from WordPress."),slug:"default",gradients:l}),s&&s.length&&f.push({name:(0,$b._x)("Custom","Indicates this palette is created by the user."),slug:"custom",gradients:s}),f},[s,a,l,u]),d.hasColorsOrGradients=!!d.colors.length||!!d.gradients.length,d}var dl=c(E(),1),HWe=["colors","disableCustomColors","gradients","disableCustomGradients"],jG=({className:e,colors:t,gradients:o,disableCustomColors:r,disableCustomGradients:n,children:i,settings:s,title:a,showTitle:l=!0,__experimentalIsRenderedInSidebar:u,enableAlpha:d})=>{let f=(0,YSe.useInstanceId)(jG),{batch:p}=(0,KSe.useRegistry)();return(!t||t.length===0)&&(!o||o.length===0)&&r&&n&&s?.every(h=>(!h.colors||h.colors.length===0)&&(!h.gradients||h.gradients.length===0)&&(h.disableCustomColors===void 0||h.disableCustomColors)&&(h.disableCustomGradients===void 0||h.disableCustomGradients))?null:(0,dl.jsx)(tN.__experimentalToolsPanel,{className:K("block-editor-panel-color-gradient-settings",e),hasInnerWrapper:!0,label:l?a:void 0,resetAll:()=>{p(()=>{s.forEach(({colorValue:h,gradientValue:m,onColorChange:g,onGradientChange:b})=>{h?g():m&&b()})})},panelId:f,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",children:(0,dl.jsxs)("div",{className:"block-editor-panel-color-gradient-settings__inner-wrapper",children:[(0,dl.jsx)(eN,{settings:s,panelId:f,colors:t,gradients:o,disableCustomColors:r,disableCustomGradients:n,__experimentalIsRenderedInSidebar:u,enableAlpha:d}),!!i&&(0,dl.jsxs)(dl.Fragment,{children:[(0,dl.jsx)(tN.__experimentalSpacer,{marginTop:4,marginBottom:0}),i]})]})})},UWe=e=>{let t=Ym();return(0,dl.jsx)(jG,{...t,...e})},GWe=e=>HWe.every(t=>e.hasOwnProperty(t))?(0,dl.jsx)(jG,{...e}):(0,dl.jsx)(UWe,{...e}),oN=GWe;var rN=c(F(),1),Kb=c(U(),1),UG=c(G(),1);var BE=c(E(),1),HG=[],WWe={...MM,px:{max:1e3,steps:1},em:{max:50,steps:.1},rem:{max:50,steps:.1}};function $We(e){let t=e?.default??HG,o=e?.custom??HG,r=e?.theme??HG;return(0,rN.useMemo)(()=>[{name:(0,UG.__)("None"),slug:"0",size:0},...o,...r,...t],[o,r,t])}function Yb({label:e=(0,UG.__)("Dimension"),onChange:t,value:o,placeholder:r,className:n,dimensionSizes:i}){let[s,a]=Le("dimensions.dimensionSizes","spacing.units"),l=i??s,u=(0,Kb.__experimentalUseCustomUnits)({availableUnits:a||["%","px","em","rem","vh","vw"]}),d=$We(l),[f,p]=(0,rN.useState)(()=>{let[,m]=(0,Kb.__experimentalParseQuantityAndUnitFromRawValue)(o);return m||u[0]?.value||"px"}),h=m=>{let[g,b]=(0,Kb.__experimentalParseQuantityAndUnitFromRawValue)(o);["em","rem"].includes(m)&&b==="px"?t((g/16).toFixed(2)+m):["em","rem"].includes(b)&&m==="px"?t(Math.round(g*16)+m):["%","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(m)&&g>100&&t(100+m),p(m)};return(0,BE.jsxs)("fieldset",{className:K("block-editor-dimension-control",n),children:[(0,BE.jsx)(Kb.BaseControl.VisualLabel,{as:"legend",children:e}),(0,BE.jsx)(Wb,{ariaLabel:e,className:"block-editor-dimension-control",customValueSettings:WWe,minimumCustomValue:0,onChange:t,onUnitChange:h,placeholder:r,presets:d,presetType:"dimension",selectedUnit:f,showTooltip:!0,units:u,value:o})]})}var ZSe=c(F(),1),An=c(U(),1),XSe=c(G(),1),QSe=c(Rt(),1);var Bu=c(E(),1),qSe={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 JSe({label:e=(0,XSe.__)("Height"),onChange:t,value:o}){(0,QSe.default)("wp.blockEditor.HeightControl",{since:"7.0",version:"7.2",alternative:"wp.blockEditor.DimensionControl"});let r=parseFloat(o),[n]=Le("spacing.units"),i=(0,An.__experimentalUseCustomUnits)({availableUnits:n||["%","px","em","rem","vh","vw"]}),s=(0,ZSe.useMemo)(()=>(0,An.__experimentalParseQuantityAndUnitFromRawValue)(o),[o])[1]||i[0]?.value||"px",a=u=>{t([u,s].join(""))},l=u=>{let[d,f]=(0,An.__experimentalParseQuantityAndUnitFromRawValue)(o);["em","rem"].includes(u)&&f==="px"?t((d/16).toFixed(2)+u):["em","rem"].includes(f)&&u==="px"?t(Math.round(d*16)+u):["%","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(u)&&d>100&&t(100+u)};return(0,Bu.jsxs)("fieldset",{className:"block-editor-height-control",children:[(0,Bu.jsx)(An.BaseControl.VisualLabel,{as:"legend",children:e}),(0,Bu.jsxs)(An.Flex,{children:[(0,Bu.jsx)(An.FlexItem,{isBlock:!0,children:(0,Bu.jsx)(An.__experimentalUnitControl,{value:o,units:i,onChange:t,onUnitChange:l,min:0,label:e,hideLabelFromVision:!0})}),(0,Bu.jsx)(An.FlexItem,{isBlock:!0,children:(0,Bu.jsx)(An.__experimentalSpacer,{marginX:2,marginBottom:0,children:(0,Bu.jsx)(An.RangeControl,{value:r,min:0,max:qSe[s]?.max??100,step:qSe[s]?.step??.1,withInputField:!1,onChange:a,label:e,hideLabelFromVision:!0})})})]})]})}var AE=c(U(),1),o_e=c(Rt(),1);var fl=c(ce()),Cke=c(Ske());function XWe(e,t,o,r,n,i){i===void 0&&(i=0);var s=i_(e,t,i),a=s.width,l=s.height,u=Math.min(a,o),d=Math.min(l,r);return u>d*n?{width:d*n,height:d}:{width:u,height:u/n}}function QWe(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}function PE(e,t,o,r,n){n===void 0&&(n=0);var i=i_(t.width,t.height,n),s=i.width,a=i.height;return{x:kke(e.x,s,o.width,r),y:kke(e.y,a,o.height,r)}}function kke(e,t,o,r){var n=t*r/2-o/2;return cN(e,-n,n)}function _ke(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function xke(e,t){return Math.atan2(t.y-e.y,t.x-e.x)*180/Math.PI}function JWe(e,t,o,r,n,i,s){i===void 0&&(i=0),s===void 0&&(s=!0);var a=s?e$e:t$e,l=i_(t.width,t.height,i),u=i_(t.naturalWidth,t.naturalHeight,i),d={x:a(100,((l.width-o.width/n)/2-e.x/n)/l.width*100),y:a(100,((l.height-o.height/n)/2-e.y/n)/l.height*100),width:a(100,o.width/l.width*100/n),height:a(100,o.height/l.height*100/n)},f=Math.round(a(u.width,d.width*u.width/100)),p=Math.round(a(u.height,d.height*u.height/100)),h=u.width>=u.height*r,m=h?{width:Math.round(p*r),height:p}:{width:f,height:Math.round(f/r)},g=fn(fn({},m),{x:Math.round(a(u.width-m.width,d.x*u.width/100)),y:Math.round(a(u.height-m.height,d.y*u.height/100))});return{croppedAreaPercentages:d,croppedAreaPixels:g}}function e$e(e,t){return Math.min(e,Math.max(0,t))}function t$e(e,t){return t}function o$e(e,t,o,r,n,i){var s=i_(t.width,t.height,o),a=cN(r.width/s.width*(100/e.width),n,i),l={x:a*s.width/2-r.width/2-s.width*a*(e.x/100),y:a*s.height/2-r.height/2-s.height*a*(e.y/100)};return{crop:l,zoom:a}}function r$e(e,t,o){var r=QWe(t);return o.height>o.width?o.height/(e.height*r):o.width/(e.width*r)}function n$e(e,t,o,r,n,i){o===void 0&&(o=0);var s=i_(t.naturalWidth,t.naturalHeight,o),a=cN(r$e(e,t,r),n,i),l=r.height>r.width?r.height/e.height:r.width/e.width,u={x:((s.width-e.width)/2-e.x)*l,y:((s.height-e.height)/2-e.y)*l};return{crop:u,zoom:a}}function wke(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function i$e(e){return e*Math.PI/180}function i_(e,t,o){var r=i$e(o);return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}function cN(e,t,o){return Math.min(Math.max(e,t),o)}function lN(){for(var e=[],t=0;t0}).join(" ").trim()}var s$e=`.reactEasyCrop_Container { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; user-select: none; touch-action: none; cursor: move; display: flex; justify-content: center; align-items: center; }.reactEasyCrop_Image, .reactEasyCrop_Video { will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */ }.reactEasyCrop_Contain { max-width: 100%; max-height: 100%; margin: auto; position: absolute; top: 0; bottom: 0; left: 0; right: 0; } .reactEasyCrop_Cover_Horizontal { width: 100%; height: auto; } .reactEasyCrop_Cover_Vertical { width: auto; height: 100%; }.reactEasyCrop_CropArea { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border: 1px solid rgba(255, 255, 255, 0.5); box-sizing: border-box; box-shadow: 0 0 0 9999em; color: rgba(0, 0, 0, 0.5); overflow: hidden; }.reactEasyCrop_CropAreaRound { border-radius: 50%; }.reactEasyCrop_CropAreaGrid::before { content: ' '; box-sizing: border-box; position: absolute; border: 1px solid rgba(255, 255, 255, 0.5); top: 0; bottom: 0; left: 33.33%; right: 33.33%; border-top: 0; border-bottom: 0; }.reactEasyCrop_CropAreaGrid::after { content: ' '; box-sizing: border-box; position: absolute; border: 1px solid rgba(255, 255, 255, 0.5); top: 33.33%; bottom: 33.33%; left: 0; right: 0; border-left: 0; border-right: 0; } `,a$e=1,l$e=3,c$e=1,Eke=(function(e){IX(t,e);function t(){var o=e!==null&&e.apply(this,arguments)||this;return o.cropperRef=fl.createRef(),o.imageRef=fl.createRef(),o.videoRef=fl.createRef(),o.containerPosition={x:0,y:0},o.containerRef=null,o.styleRef=null,o.containerRect=null,o.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},o.dragStartPosition={x:0,y:0},o.dragStartCrop={x:0,y:0},o.gestureZoomStart=0,o.gestureRotationStart=0,o.isTouching=!1,o.lastPinchDistance=0,o.lastPinchRotation=0,o.rafDragTimeout=null,o.rafPinchTimeout=null,o.wheelTimer=null,o.currentDoc=typeof document<"u"?document:null,o.currentWindow=typeof window<"u"?window:null,o.resizeObserver=null,o.previousCropSize=null,o.isInitialized=!1,o.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},o.initResizeObserver=function(){if(!(typeof window.ResizeObserver>"u"||!o.containerRef)){var r=!0;o.resizeObserver=new window.ResizeObserver(function(n){if(r){r=!1;return}o.computeSizes()}),o.resizeObserver.observe(o.containerRef)}},o.preventZoomSafari=function(r){return r.preventDefault()},o.cleanEvents=function(){o.currentDoc&&(o.currentDoc.removeEventListener("mousemove",o.onMouseMove),o.currentDoc.removeEventListener("mouseup",o.onDragStopped),o.currentDoc.removeEventListener("touchmove",o.onTouchMove),o.currentDoc.removeEventListener("touchend",o.onDragStopped),o.currentDoc.removeEventListener("gesturechange",o.onGestureChange),o.currentDoc.removeEventListener("gestureend",o.onGestureEnd),o.currentDoc.removeEventListener("scroll",o.onScroll))},o.clearScrollEvent=function(){o.containerRef&&o.containerRef.removeEventListener("wheel",o.onWheel),o.wheelTimer&&clearTimeout(o.wheelTimer)},o.onMediaLoad=function(){var r=o.computeSizes();r&&(o.previousCropSize=r,o.emitCropData(),o.setInitialCrop(r),o.isInitialized=!0),o.props.onMediaLoaded&&o.props.onMediaLoaded(o.mediaSize)},o.setInitialCrop=function(r){if(o.props.initialCroppedAreaPercentages){var n=o$e(o.props.initialCroppedAreaPercentages,o.mediaSize,o.props.rotation,r,o.props.minZoom,o.props.maxZoom),i=n.crop,s=n.zoom;o.props.onCropChange(i),o.props.onZoomChange&&o.props.onZoomChange(s)}else if(o.props.initialCroppedAreaPixels){var a=n$e(o.props.initialCroppedAreaPixels,o.mediaSize,o.props.rotation,r,o.props.minZoom,o.props.maxZoom),i=a.crop,s=a.zoom;o.props.onCropChange(i),o.props.onZoomChange&&o.props.onZoomChange(s)}},o.computeSizes=function(){var r,n,i,s,a,l,u=o.imageRef.current||o.videoRef.current;if(u&&o.containerRef){o.containerRect=o.containerRef.getBoundingClientRect(),o.saveContainerPosition();var d=o.containerRect.width/o.containerRect.height,f=((r=o.imageRef.current)===null||r===void 0?void 0:r.naturalWidth)||((n=o.videoRef.current)===null||n===void 0?void 0:n.videoWidth)||0,p=((i=o.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((s=o.videoRef.current)===null||s===void 0?void 0:s.videoHeight)||0,h=u.offsetWidthm?{width:o.containerRect.height*m,height:o.containerRect.height}:{width:o.containerRect.width,height:o.containerRect.width/m};break;case"horizontal-cover":g={width:o.containerRect.width,height:o.containerRect.width/m};break;case"vertical-cover":g={width:o.containerRect.height*m,height:o.containerRect.height};break}else g={width:u.offsetWidth,height:u.offsetHeight};o.mediaSize=fn(fn({},g),{naturalWidth:f,naturalHeight:p}),o.props.setMediaSize&&o.props.setMediaSize(o.mediaSize);var b=o.props.cropSize?o.props.cropSize:XWe(o.mediaSize.width,o.mediaSize.height,o.containerRect.width,o.containerRect.height,o.props.aspect,o.props.rotation);return(((a=o.state.cropSize)===null||a===void 0?void 0:a.height)!==b.height||((l=o.state.cropSize)===null||l===void 0?void 0:l.width)!==b.width)&&o.props.onCropSizeChange&&o.props.onCropSizeChange(b),o.setState({cropSize:b},o.recomputeCropPosition),o.props.setCropSize&&o.props.setCropSize(b),b}},o.saveContainerPosition=function(){if(o.containerRef){var r=o.containerRef.getBoundingClientRect();o.containerPosition={x:r.left,y:r.top}}},o.onMouseDown=function(r){o.currentDoc&&(r.preventDefault(),o.currentDoc.addEventListener("mousemove",o.onMouseMove),o.currentDoc.addEventListener("mouseup",o.onDragStopped),o.saveContainerPosition(),o.onDragStart(t.getMousePoint(r)))},o.onMouseMove=function(r){return o.onDrag(t.getMousePoint(r))},o.onScroll=function(r){o.currentDoc&&(r.preventDefault(),o.saveContainerPosition())},o.onTouchStart=function(r){o.currentDoc&&(o.isTouching=!0,!(o.props.onTouchRequest&&!o.props.onTouchRequest(r))&&(o.currentDoc.addEventListener("touchmove",o.onTouchMove,{passive:!1}),o.currentDoc.addEventListener("touchend",o.onDragStopped),o.saveContainerPosition(),r.touches.length===2?o.onPinchStart(r):r.touches.length===1&&o.onDragStart(t.getTouchPoint(r.touches[0]))))},o.onTouchMove=function(r){r.preventDefault(),r.touches.length===2?o.onPinchMove(r):r.touches.length===1&&o.onDrag(t.getTouchPoint(r.touches[0]))},o.onGestureStart=function(r){o.currentDoc&&(r.preventDefault(),o.currentDoc.addEventListener("gesturechange",o.onGestureChange),o.currentDoc.addEventListener("gestureend",o.onGestureEnd),o.gestureZoomStart=o.props.zoom,o.gestureRotationStart=o.props.rotation)},o.onGestureChange=function(r){if(r.preventDefault(),!o.isTouching){var n=t.getMousePoint(r),i=o.gestureZoomStart-1+r.scale;if(o.setNewZoom(i,n,{shouldUpdatePosition:!0}),o.props.onRotationChange){var s=o.gestureRotationStart+r.rotation;o.props.onRotationChange(s)}}},o.onGestureEnd=function(r){o.cleanEvents()},o.onDragStart=function(r){var n,i,s=r.x,a=r.y;o.dragStartPosition={x:s,y:a},o.dragStartCrop=fn({},o.props.crop),(i=(n=o.props).onInteractionStart)===null||i===void 0||i.call(n)},o.onDrag=function(r){var n=r.x,i=r.y;o.currentWindow&&(o.rafDragTimeout&&o.currentWindow.cancelAnimationFrame(o.rafDragTimeout),o.rafDragTimeout=o.currentWindow.requestAnimationFrame(function(){if(o.state.cropSize&&!(n===void 0||i===void 0)){var s=n-o.dragStartPosition.x,a=i-o.dragStartPosition.y,l={x:o.dragStartCrop.x+s,y:o.dragStartCrop.y+a},u=o.props.restrictPosition?PE(l,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):l;o.props.onCropChange(u)}}))},o.onDragStopped=function(){var r,n;o.isTouching=!1,o.cleanEvents(),o.emitCropData(),(n=(r=o.props).onInteractionEnd)===null||n===void 0||n.call(r)},o.onWheel=function(r){if(o.currentWindow&&!(o.props.onWheelRequest&&!o.props.onWheelRequest(r))){r.preventDefault();var n=t.getMousePoint(r),i=(0,Cke.default)(r).pixelY,s=o.props.zoom-i*o.props.zoomSpeed/200;o.setNewZoom(s,n,{shouldUpdatePosition:!0}),o.state.hasWheelJustStarted||o.setState({hasWheelJustStarted:!0},function(){var a,l;return(l=(a=o.props).onInteractionStart)===null||l===void 0?void 0:l.call(a)}),o.wheelTimer&&clearTimeout(o.wheelTimer),o.wheelTimer=o.currentWindow.setTimeout(function(){return o.setState({hasWheelJustStarted:!1},function(){var a,l;return(l=(a=o.props).onInteractionEnd)===null||l===void 0?void 0:l.call(a)})},250)}},o.getPointOnContainer=function(r,n){var i=r.x,s=r.y;if(!o.containerRect)throw new Error("The Cropper is not mounted");return{x:o.containerRect.width/2-(i-n.x),y:o.containerRect.height/2-(s-n.y)}},o.getPointOnMedia=function(r){var n=r.x,i=r.y,s=o.props,a=s.crop,l=s.zoom;return{x:(n+a.x)/l,y:(i+a.y)/l}},o.setNewZoom=function(r,n,i){var s=i===void 0?{}:i,a=s.shouldUpdatePosition,l=a===void 0?!0:a;if(!(!o.state.cropSize||!o.props.onZoomChange)){var u=cN(r,o.props.minZoom,o.props.maxZoom);if(l){var d=o.getPointOnContainer(n,o.containerPosition),f=o.getPointOnMedia(d),p={x:f.x*u-d.x,y:f.y*u-d.y},h=o.props.restrictPosition?PE(p,o.mediaSize,o.state.cropSize,u,o.props.rotation):p;o.props.onCropChange(h)}o.props.onZoomChange(u)}},o.getCropData=function(){if(!o.state.cropSize)return null;var r=o.props.restrictPosition?PE(o.props.crop,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):o.props.crop;return JWe(r,o.mediaSize,o.state.cropSize,o.getAspect(),o.props.zoom,o.props.rotation,o.props.restrictPosition)},o.emitCropData=function(){var r=o.getCropData();if(r){var n=r.croppedAreaPercentages,i=r.croppedAreaPixels;o.props.onCropComplete&&o.props.onCropComplete(n,i),o.props.onCropAreaChange&&o.props.onCropAreaChange(n,i)}},o.emitCropAreaChange=function(){var r=o.getCropData();if(r){var n=r.croppedAreaPercentages,i=r.croppedAreaPixels;o.props.onCropAreaChange&&o.props.onCropAreaChange(n,i)}},o.recomputeCropPosition=function(){if(o.state.cropSize){var r=o.props.crop;if(o.isInitialized&&o.previousCropSize){var n=Math.abs(o.previousCropSize.width-o.state.cropSize.width)>1e-6||Math.abs(o.previousCropSize.height-o.state.cropSize.height)>1e-6;if(n){var i=o.state.cropSize.width/o.previousCropSize.width,s=o.state.cropSize.height/o.previousCropSize.height;r={x:o.props.crop.x*i,y:o.props.crop.y*s}}}var a=o.props.restrictPosition?PE(r,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):r;o.previousCropSize=o.state.cropSize,o.props.onCropChange(a),o.emitCropData()}},o.onKeyDown=function(r){var n,i,s=o.props,a=s.crop,l=s.onCropChange,u=s.keyboardStep,d=s.zoom,f=s.rotation,p=u;if(o.state.cropSize){r.shiftKey&&(p*=.2);var h=fn({},a);switch(r.key){case"ArrowUp":h.y-=p,r.preventDefault();break;case"ArrowDown":h.y+=p,r.preventDefault();break;case"ArrowLeft":h.x-=p,r.preventDefault();break;case"ArrowRight":h.x+=p,r.preventDefault();break;default:return}o.props.restrictPosition&&(h=PE(h,o.mediaSize,o.state.cropSize,d,f)),r.repeat||(i=(n=o.props).onInteractionStart)===null||i===void 0||i.call(n),l(h)}},o.onKeyUp=function(r){var n,i;switch(r.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":r.preventDefault();break;default:return}o.emitCropData(),(i=(n=o.props).onInteractionEnd)===null||i===void 0||i.call(n)},o}return 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(),typeof window.ResizeObserver>"u"&&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=s$e,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 o,r;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(o=this.resizeObserver)===null||o===void 0||o.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((r=this.styleRef.parentNode)===null||r===void 0||r.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(o){var r,n,i,s,a,l,u,d,f;o.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):o.aspect!==this.props.aspect?this.computeSizes():o.objectFit!==this.props.objectFit?this.computeSizes():o.zoom!==this.props.zoom?this.recomputeCropPosition():((r=o.cropSize)===null||r===void 0?void 0:r.height)!==((n=this.props.cropSize)===null||n===void 0?void 0:n.height)||((i=o.cropSize)===null||i===void 0?void 0:i.width)!==((s=this.props.cropSize)===null||s===void 0?void 0:s.width)?this.computeSizes():(((a=o.crop)===null||a===void 0?void 0:a.x)!==((l=this.props.crop)===null||l===void 0?void 0:l.x)||((u=o.crop)===null||u===void 0?void 0:u.y)!==((d=this.props.crop)===null||d===void 0?void 0:d.y))&&this.emitCropAreaChange(),o.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),o.video!==this.props.video&&((f=this.videoRef.current)===null||f===void 0||f.load());var p=this.getObjectFit();p!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:p},this.computeSizes)},t.prototype.getAspect=function(){var o=this.props,r=o.cropSize,n=o.aspect;return r?r.width/r.height:n},t.prototype.getObjectFit=function(){var o,r,n,i;if(this.props.objectFit==="cover"){var s=this.imageRef.current||this.videoRef.current;if(s&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var a=this.containerRect.width/this.containerRect.height,l=((o=this.imageRef.current)===null||o===void 0?void 0:o.naturalWidth)||((r=this.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,u=((n=this.imageRef.current)===null||n===void 0?void 0:n.naturalHeight)||((i=this.videoRef.current)===null||i===void 0?void 0:i.videoHeight)||0,d=l/u;return de>=0?e%360:(360+e%360)%360,u$e=e=>new Promise((t,o)=>{let r=new Image;r.addEventListener("load",()=>t(r)),r.addEventListener("error",n=>o(n)),r.setAttribute("crossOrigin","anonymous"),r.src=e});function Pke(e){return e*Math.PI/180}function d$e(e,t,o){let r=Pke(o);return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}async function Ike(e,t,o=0,r={horizontal:!1,vertical:!1}){try{let n=await u$e(e),i=document.createElement("canvas"),s=i.getContext("2d");if(!s)return null;let a=Pke(o),{width:l,height:u}=d$e(n.width,n.height,o);i.width=l,i.height=u,s.translate(l/2,u/2),s.rotate(a),s.scale(r.horizontal?-1:1,r.vertical?-1:1),s.translate(-n.width/2,-n.height/2),s.drawImage(n,0,0);let d=document.createElement("canvas"),f=d.getContext("2d");return f?(d.width=t.width,d.height=t.height,f.drawImage(i,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise(p=>{d.toBlob(h=>{h&&p(URL.createObjectURL(h))},"image/jpeg")})):null}catch{return null}}var Xb={crop:{x:0,y:0,width:100,height:100},zoom:s_,rotation:0,aspectRatio:1,flip:{horizontal:!1,vertical:!1}},f$e={x:0,y:0},QG={crop:f$e,croppedArea:Xb.crop,croppedAreaPixels:null,zoom:Xb.zoom,rotation:Xb.rotation,flip:Xb.flip,aspectRatio:Xb.aspectRatio,mediaSize:null};function Oke(){let[e,t]=(0,_c.useState)(QG),[o,r]=(0,_c.useState)(null),n=(0,_c.useCallback)(u=>{t(d=>{let p={...typeof u=="function"?u(d):u};return"rotation"in p&&p.rotation!==void 0&&(p.rotation=uN(p.rotation)),{...d,...p}})},[]),i=(0,_c.useCallback)((u=null)=>{if(!u){r(null),n(QG);return}if(typeof u=="object"){let d={...Xb,...u};r(d),n(d)}},[n,r]),s=(0,_c.useCallback)(()=>{if(o){let u={crop:{x:0,y:0},croppedAreaPixels:null};o.crop&&(u.croppedArea=o.crop),o.zoom!==void 0&&(u.zoom=o.zoom),o.rotation!==void 0&&(u.rotation=o.rotation),o.aspectRatio!==void 0&&(u.aspectRatio=o.aspectRatio),o.flip!==void 0&&(u.flip=o.flip),n(u)}else n({...QG})},[o,n]),a=(0,_c.useMemo)(()=>{if(o){let d={crop:e.croppedAreaPixels||e.croppedArea,zoom:e.zoom,rotation:uN(e.rotation),aspectRatio:e.aspectRatio,flip:e.flip};return Zb(d,o)===!1}let u={crop:e.croppedArea,zoom:e.zoom,rotation:uN(e.rotation),aspectRatio:e.aspectRatio,flip:e.flip};return Zb(u,Xb)===!1},[e,o]),l=(0,_c.useCallback)(async u=>e.croppedAreaPixels?Ike(u,e.croppedAreaPixels,e.rotation,e.flip):null,[e.croppedAreaPixels,e.rotation,e.flip]);return(0,_c.useMemo)(()=>({cropperState:e,setCropperState:n,resetState:o,setResetState:i,isDirty:a,reset:s,getCroppedImage:l}),[e,n,o,i,a,s,l])}var Ake=c(E(),1),Lke=(0,a_.createContext)({cropperState:{crop:{x:0,y:0},croppedArea:{x:0,y:0,width:100,height:100},croppedAreaPixels:null,zoom:s_,rotation:0,aspectRatio:1,flip:{horizontal:!1,vertical:!1},mediaSize:null},setCropperState:()=>{},resetState:null,setResetState:()=>{},isDirty:!1,reset:()=>{},getCroppedImage:()=>Promise.resolve(null)});function JG({children:e}){let t=Oke(),o=(0,a_.useMemo)(()=>({...t}),[t]);return(0,Ake.jsx)(Lke.Provider,{value:o,children:e})}var IE=()=>{let e=(0,a_.useContext)(Lke);if(!e)throw new Error("Missing ImageCropperContext");return e};var Nke=c(E(),1);function eW({src:e,onLoad:t,minZoom:o=s_,maxZoom:r=Bke,...n}){let{cropperState:i,setCropperState:s}=IE(),{crop:a,zoom:l,rotation:u,aspectRatio:d,flip:f}=i,p=v=>s({crop:v}),h=v=>s({zoom:v}),m=v=>s({rotation:v}),g=v=>s({mediaSize:v}),b=(0,Mke.useCallback)((v,y)=>{s({croppedArea:v,croppedAreaPixels:y})},[s]);return(0,Nke.jsx)(Eke,{classes:{containerClassName:"image-cropper__container",cropAreaClassName:"image-cropper__crop-area",mediaClassName:"image-cropper__image"},minZoom:o,maxZoom:r,rotation:u,image:e,setMediaSize:g,crop:a,zoom:l,aspect:d,onCropChange:p,onZoomChange:h,onCropComplete:b,onMediaLoaded:v=>{t?.(v)},onRotationChange:m,transform:[`translate(${a.x}px, ${a.y}px)`,`rotateZ(${u}deg)`,`rotateY(${f.horizontal?180:0}deg)`,`rotateX(${f.vertical?180:0}deg)`,`scale(${l})`].join(" "),...n})}var u_=c(U(),1),c_=c(G(),1);var Dke=100,Vke=300,dN={placement:"bottom-start"};var l_=c(F(),1);var fN=c(Q(),1),Qb=c(F(),1),mf=c(G(),1),Fke=c(as(),1),zke=c(Tt(),1);var p$e={crop:(0,mf.__)("Image cropped."),rotate:(0,mf.__)("Image rotated."),cropAndRotate:(0,mf.__)("Image cropped and rotated.")};function jke({crop:e,rotation:t,url:o,id:r,onSaveImage:n,onFinishEditing:i}){let{createErrorNotice:s,createSuccessNotice:a}=(0,fN.useDispatch)(Fke.store),[l,u]=(0,Qb.useState)(!1),{editMediaEntity:d}=(0,fN.useSelect)(h=>({editMediaEntity:h(C).getSettings()?.[fT]}),[]),f=(0,Qb.useCallback)(()=>{u(!1),i()},[i]),p=(0,Qb.useCallback)(async()=>{if(!d){i(),s((0,mf.__)("Sorry, you are not allowed to edit images on this site."),{id:"image-editing-error",type:"snackbar"});return}u(!0);let h=[];if(t>0&&h.push({type:"rotate",args:{angle:t}}),(e.width<99.9||e.height<99.9)&&h.push({type:"crop",args:{left:e.x,top:e.y,width:e.width,height:e.height}}),h.length===0){u(!1),i();return}let m=h.length===1?h[0].type:"cropAndRotate";try{let g=await d(r,{src:o,modifiers:h},{throwOnError:!0});g&&(n({id:g.id,url:g.source_url}),a(p$e[m],{type:"snackbar",actions:[{label:(0,mf.__)("Undo"),onClick:()=>{n({id:r,url:o})}}]}))}catch(g){s((0,mf.sprintf)((0,mf.__)("Could not edit image. %s"),(0,zke.__unstableStripHTML)(g.message)),{id:"image-editing-error",type:"snackbar"})}finally{u(!1),i()}},[e,t,r,o,n,s,a,i,d]);return(0,Qb.useMemo)(()=>({isInProgress:l,apply:p,cancel:f}),[l,p,f])}var xc=c(F(),1),Hke=c(go(),1);function Uke({url:e,naturalWidth:t,naturalHeight:o}){let[r,n]=(0,xc.useState)(),{cropperState:i,setCropperState:s}=IE(),{zoom:a,aspectRatio:l,crop:u,croppedArea:d}=i,f=(0,xc.useCallback)(y=>{s({zoom:y})},[s]),p=(0,xc.useCallback)(y=>{s({aspectRatio:y})},[s]),h=t/o,m=o/t;(0,xc.useEffect)(()=>{p(h)},[]);let[g,b]=(0,xc.useState)(0),v=(0,xc.useCallback)(()=>{let y=(g+90)%360,k=h,_=a!==1||!(h===l||m===l);if(g%180===90&&(k=1/h),y===0){n(),b(y),s({aspectRatio:_?l:h,crop:{x:-(u.y*k),y:u.x*k}});return}function x(B){let R=document.createElement("canvas"),I=0,A=0;y%180?(R.width=B.target.height,R.height=B.target.width):(R.width=B.target.width,R.height=B.target.height),(y===90||y===180)&&(I=R.width),(y===270||y===180)&&(A=R.height);let P=R.getContext("2d");P.translate(I,A),P.rotate(y*Math.PI/180),P.drawImage(B.target,0,0),R.toBlob(O=>{n(URL.createObjectURL(O)),b(y);let N=_?l:R.width/R.height;s({aspectRatio:N,crop:{x:-(u.y*k),y:u.x*k}})})}let w=new window.Image;w.src=e,w.onload=x;let T=(0,Hke.applyFilters)("media.crossOrigin",void 0,e);typeof T=="string"&&(w.crossOrigin=T)},[g,h,e,s,u,a,l,m,b]);return(0,xc.useMemo)(()=>({editedUrl:r,setEditedUrl:n,crop:d,zoom:a,setZoom:f,rotation:g,rotateClockwise:v,aspect:l,setAspect:p,defaultAspect:h}),[r,d,a,f,g,v,l,p,h])}var Gke=c(E(),1),tW=(0,l_.createContext)({});tW.displayName="ImageEditingContext";var Pu=()=>(0,l_.useContext)(tW);function Wke({id:e,url:t,naturalWidth:o,naturalHeight:r,onFinishEditing:n,onSaveImage:i,children:s}){let a=Uke({url:t,naturalWidth:o,naturalHeight:r}),l=jke({id:e,url:t,onSaveImage:i,onFinishEditing:n,...a}),u=(0,l_.useMemo)(()=>({...a,...l}),[a,l]);return(0,Gke.jsx)(tW.Provider,{value:u,children:s})}var pl=c(E(),1);function pN({aspectRatios:e,isDisabled:t,label:o,onClick:r,value:n}){return(0,pl.jsx)(u_.MenuGroup,{label:o,children:e.map(({name:i,slug:s,ratio:a})=>(0,pl.jsx)(u_.MenuItem,{disabled:t,onClick:()=>{r(a)},role:"menuitemradio",isSelected:a===n,icon:a===n?ns:void 0,children:i},s))})}function m$e(e){let[t,o,...r]=e.split("/").map(Number);return t<=0||o<=0||Number.isNaN(t)||Number.isNaN(o)||r.length?NaN:o?t/o:t}function oW({ratio:e,...t}){return{ratio:m$e(e),...t}}function $ke({toggleProps:e}){let{isInProgress:t,aspect:o,setAspect:r,defaultAspect:n}=Pu(),[i,s,a]=Le("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios");return(0,pl.jsx)(u_.DropdownMenu,{icon:GF,label:(0,c_.__)("Aspect Ratio"),popoverProps:dN,toggleProps:e,children:({onClose:l})=>(0,pl.jsxs)(pl.Fragment,{children:[(0,pl.jsx)(pN,{isDisabled:t,onClick:u=>{r(u),l()},value:o,aspectRatios:[{slug:"original",name:(0,c_.__)("Original"),ratio:n},...a?i.map(oW).filter(({ratio:u})=>u===1):[]]}),s?.length>0&&(0,pl.jsx)(pN,{label:(0,c_.__)("Theme"),isDisabled:t,onClick:u=>{r(u),l()},value:o,aspectRatios:s}),a&&(0,pl.jsx)(pN,{label:(0,c_.__)("Landscape"),isDisabled:t,onClick:u=>{r(u),l()},value:o,aspectRatios:i.map(oW).filter(({ratio:u})=>u>1)}),a&&(0,pl.jsx)(pN,{label:(0,c_.__)("Portrait"),isDisabled:t,onClick:u=>{r(u),l()},value:o,aspectRatios:i.map(oW).filter(({ratio:u})=>u<1)})]})})}var Kke=c(U(),1),Yke=c(fe(),1);var qm=c(E(),1);function qke({url:e,width:t,height:o,naturalHeight:r,naturalWidth:n,borderProps:i}){let{isInProgress:s,editedUrl:a,rotation:l}=Pu(),[u,{width:d}]=(0,Yke.useResizeObserver)(),f=o||d*r/n;l%180===90&&(f=d*n/r);let p=(0,qm.jsxs)("div",{className:K("wp-block-image__crop-area",i?.className,{"is-applying":s}),style:{...i?.style,width:t||d,height:f},children:[(0,qm.jsx)(eW,{src:a||e}),s&&(0,qm.jsx)(Kke.Spinner,{})]});return(0,qm.jsxs)(qm.Fragment,{children:[u,p]})}var Zm=c(U(),1),rW=c(G(),1);var OE=c(E(),1);function Zke(){let{isInProgress:e,zoom:t,setZoom:o}=Pu();return(0,OE.jsx)(Zm.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:dN,renderToggle:({isOpen:r,onToggle:n})=>(0,OE.jsx)(Zm.ToolbarButton,{icon:J4,label:(0,rW.__)("Zoom"),onClick:n,"aria-expanded":r,disabled:e}),renderContent:()=>(0,OE.jsx)(Zm.__experimentalDropdownContentWrapper,{paddingSize:"medium",children:(0,OE.jsx)(Zm.RangeControl,{label:(0,rW.__)("Zoom"),min:Dke,max:Vke,value:Math.round(t*100),onChange:r=>o(r/100)})})})}var Xke=c(U(),1),Qke=c(G(),1);var Jke=c(E(),1);function e_e(){let{isInProgress:e,rotateClockwise:t}=Pu();return(0,Jke.jsx)(Xke.ToolbarButton,{icon:q4,label:(0,Qke.__)("Rotate"),onClick:t,disabled:e})}var nW=c(U(),1),iW=c(G(),1);var Jb=c(E(),1);function t_e(){let{isInProgress:e,apply:t,cancel:o}=Pu();return(0,Jb.jsxs)(Jb.Fragment,{children:[(0,Jb.jsx)(nW.ToolbarButton,{onClick:t,disabled:e,children:(0,iW.__)("Apply")}),(0,Jb.jsx)(nW.ToolbarButton,{onClick:o,children:(0,iW.__)("Cancel")})]})}var ca=c(E(),1);function r_e({id:e,url:t,width:o,height:r,naturalHeight:n,naturalWidth:i,onSaveImage:s,onFinishEditing:a,borderProps:l}){return(0,o_e.default)("wp.blockEditor.__experimentalImageEditor",{since:"7.1",hint:"The Media Editor modal is now the default crop experience for core blocks. This component will be removed in a future major release."}),(0,ca.jsx)(JG,{children:(0,ca.jsxs)(Wke,{id:e,url:t,naturalWidth:i,naturalHeight:n,onSaveImage:s,onFinishEditing:a,children:[(0,ca.jsx)(qke,{borderProps:l,url:t,width:o,height:r,naturalHeight:n,naturalWidth:i}),(0,ca.jsxs)(No,{children:[(0,ca.jsxs)(AE.ToolbarGroup,{children:[(0,ca.jsx)(Zke,{}),(0,ca.jsx)(AE.ToolbarItem,{children:u=>(0,ca.jsx)($ke,{toggleProps:u})}),(0,ca.jsx)(e_e,{})]}),(0,ca.jsx)(AE.ToolbarGroup,{children:(0,ca.jsx)(t_e,{})})]})]})})}var ua=c(U(),1),Xm=c(G(),1);var d_=c(F(),1);function n_e(e,t,o,r,n){let[i,s]=(0,d_.useState)(t??r??""),[a,l]=(0,d_.useState)(e??o??"");return(0,d_.useEffect)(()=>{t===void 0&&r!==void 0&&s(r),e===void 0&&o!==void 0&&l(o)},[r,o]),(0,d_.useEffect)(()=>{t!==void 0&&Number.parseInt(t)!==Number.parseInt(i)&&s(t),e!==void 0&&Number.parseInt(e)!==Number.parseInt(a)&&l(e)},[t,e]),{currentHeight:a,currentWidth:i,updateDimension:(f,p)=>{let h=p===""?void 0:parseInt(p,10);f==="width"?s(h):l(h),n({[f]:h})},updateDimensions:(f,p)=>{l(f??o),s(p??r),n({height:f,width:p})}}}var ml=c(E(),1),i_e=[25,50,75,100],h$e=()=>{};function s_e(e,t,o){let r=Math.round(t*(e/100)),n=Math.round(o*(e/100));return{scaledWidth:r,scaledHeight:n}}function a_e({imageSizeHelp:e,imageWidth:t,imageHeight:o,imageSizeOptions:r=[],isResizable:n=!0,slug:i,width:s,height:a,onChange:l,onChangeImage:u=h$e}){let{currentHeight:d,currentWidth:f,updateDimension:p,updateDimensions:h}=n_e(a,s,o,t,l),m=b=>{if(b===void 0){h();return}let{scaledWidth:v,scaledHeight:y}=s_e(b,t,o);h(y,v)},g=i_e.find(b=>{let{scaledWidth:v,scaledHeight:y}=s_e(b,t,o);return f===v&&d===y});return(0,ml.jsxs)(ua.__experimentalVStack,{className:"block-editor-image-size-control",spacing:"4",children:[r&&r.length>0&&(0,ml.jsx)(ua.SelectControl,{label:(0,Xm.__)("Resolution"),value:i,options:r,onChange:u,help:e}),n&&(0,ml.jsxs)(ml.Fragment,{children:[(0,ml.jsxs)(ua.__experimentalHStack,{align:"baseline",spacing:"4",children:[(0,ml.jsx)(ua.__experimentalNumberControl,{label:(0,Xm.__)("Width"),value:f,min:1,onChange:b=>p("width",b)}),(0,ml.jsx)(ua.__experimentalNumberControl,{label:(0,Xm.__)("Height"),value:d,min:1,onChange:b=>p("height",b)})]}),(0,ml.jsx)(ua.__experimentalToggleGroupControl,{label:(0,Xm.__)("Image size presets"),hideLabelFromVision:!0,onChange:m,value:g,isBlock:!0,children:i_e.map(b=>(0,ml.jsx)(ua.__experimentalToggleGroupControlOption,{value:b,label:(0,Xm.sprintf)((0,Xm.__)("%d%%"),b)},b))})]})]})}var mN=c(U(),1);var ey=c(G(),1),c_e=c(E(),1),l_e={left:ip,center:np,right:sp,"space-between":Zy,stretch:Xy};function g$e({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:o,value:r,popoverProps:n,isToolbar:i}){let s=f=>{o(f===r?void 0:f)},a=r?l_e[r]:l_e.left,l=[{name:"left",icon:ip,title:(0,ey.__)("Justify items left"),isActive:r==="left",onClick:()=>s("left")},{name:"center",icon:np,title:(0,ey.__)("Justify items center"),isActive:r==="center",onClick:()=>s("center")},{name:"right",icon:sp,title:(0,ey.__)("Justify items right"),isActive:r==="right",onClick:()=>s("right")},{name:"space-between",icon:Zy,title:(0,ey.__)("Space between items"),isActive:r==="space-between",onClick:()=>s("space-between")},{name:"stretch",icon:Xy,title:(0,ey.__)("Stretch items"),isActive:r==="stretch",onClick:()=>s("stretch")}],u=i?mN.ToolbarGroup:mN.ToolbarDropdownMenu,d=i?{isCollapsed:t}:{};return(0,c_e.jsx)(u,{icon:a,popoverProps:n,label:(0,ey.__)("Change items justification"),controls:l.filter(f=>e.includes(f.name)),...d})}var sW=g$e;var aW=c(E(),1),_v=e=>(0,aW.jsx)(sW,{...e,isToolbar:!1}),u_e=e=>(0,aW.jsx)(sW,{...e,isToolbar:!0});var Ki=c(U(),1),wc=c(G(),1),wr=c(F(),1),TN=c(fe(),1),oxe=c(Tt(),1),rxe=c(io(),1),nxe=c(GC(),1),RN=c(Q(),1),gW=c(dv(),1);var ixe=c(Rt(),1),BN=c(Fs(),1);var f_=c(U(),1);var hN=c(fe(),1),gN=c(G(),1),d_e=c(F(),1),hf=c(E(),1);function f_e({children:e,settingsOpen:t,setSettingsOpen:o}){let r=(0,hN.useReducedMotion)(),n=r?d_e.Fragment:f_.__unstableAnimatePresence,i=r?"div":f_.__unstableMotion.div,a=`link-control-settings-drawer-${(0,hN.useInstanceId)(f_e)}`;return(0,hf.jsxs)(hf.Fragment,{children:[(0,hf.jsx)(f_.Button,{__next40pxDefaultSize:!0,className:"block-editor-link-control__drawer-toggle","aria-expanded":t,onClick:()=>o(!t),icon:(0,gN.isRTL)()?jx:rp,"aria-controls":a,children:(0,gN._x)("Advanced","Additional link settings")}),(0,hf.jsx)(n,{children:t&&(0,hf.jsx)(i,{className:"block-editor-link-control__drawer",hidden:!t,id:a,initial:"collapsed",animate:"open",exit:"collapsed",variants:{open:{opacity:1,height:"auto"},collapsed:{opacity:0,height:0}},transition:{duration:.1},children:(0,hf.jsx)("div",{className:"block-editor-link-control__drawer-inner",children:e})})})]})}var p_e=f_e;var _N=c(F(),1),mW=c(G(),1),O_e=c(Rt(),1);var LE=c(G(),1),w_e=c(U(),1);var bN=c(G(),1),m_e=c(U(),1),h_e=c(F(),1);var lW=c(E(),1),b$e=({searchTerm:e,onClick:t,itemProps:o,buttonText:r})=>{if(!e)return null;let n;return r?n=typeof r=="function"?r(e):r:n=(0,h_e.createInterpolateElement)((0,bN.sprintf)((0,bN.__)("Create: %s"),e),{mark:(0,lW.jsx)("mark",{})}),(0,lW.jsx)(m_e.MenuItem,{...o,iconPosition:"left",icon:Ca,className:"block-editor-link-control__search-item",onClick:t,children:n})},g_e=b$e;var gf=c(G(),1),vN=c(U(),1);var b_e=c(Tt(),1),m_=c(Fs(),1),y_e=c(fe(),1),v_e=c(Rt(),1),p_=c(E(),1),yN={post:{icon:$4,label:(0,gf.__)("Post")},page:{icon:lg,label:(0,gf.__)("Page")},post_tag:{icon:k6,label:(0,gf.__)("Tag")},category:{icon:qF,label:(0,gf.__)("Category")},attachment:{icon:E3,label:(0,gf.__)("Attachment")}};function y$e({isURL:e,suggestion:t}){let o=null;return e?o=Ux:t.type in yN&&(o=yN[t.type].icon,t.type==="page"&&(t.isFrontPage&&(o=n4),t.isBlogHome&&(o=M6))),o?(0,p_.jsx)(gt,{className:"block-editor-link-control__search-item-icon",icon:o}):null}function v$e(e){return e?.trim()?.length?e?.replace(/^\/?/,"/"):e}function S$e(e){return e?.trim()?.length?e?.replace(/\/$/,""):e}var k$e=(e,...t)=>(...o)=>e(...o,...t),_$e=e=>t=>t==null||t!==t?e:t;function x$e(e){return e&&(0,y_e.pipe)(m_.safeDecodeURI,m_.getPath,_$e(""),k$e(m_.filterURLForDisplay,24),S$e,v$e)(e)}var S_e=({itemProps:e,suggestion:t,searchTerm:o,onClick:r,isURL:n=!1,shouldShowType:i=!1})=>{let s=n?(0,gf.__)("Press ENTER to add this link"):x$e(t.url);return(0,p_.jsx)(vN.MenuItem,{...e,info:s,iconPosition:"left",icon:(0,p_.jsx)(y$e,{suggestion:t,isURL:n}),onClick:r,shortcut:i&&w$e(t),className:"block-editor-link-control__search-item",children:(0,p_.jsx)(vN.TextHighlight,{text:(0,b_e.__unstableStripHTML)(t.title),highlight:o})})};function w$e(e){return e.isFrontPage?(0,gf.__)("Front page"):e.isBlogHome?(0,gf.__)("Blog home"):e.type in yN?yN[e.type].label:e.type}var k_e=S_e,__e=e=>((0,v_e.default)("wp.blockEditor.__experimentalLinkControlSearchItem",{since:"6.8"}),(0,p_.jsx)(S_e,{...e}));var x_e=c(G(),1),ty="__CREATE__",cW="tel",SN="link",uW="mailto",dW="internal",h_=[SN,uW,cW,dW],fW=[{id:"opensInNewTab",title:(0,x_e.__)("Open in new tab")}];var C_e=c(Rt(),1),oy=c(E(),1);function E_e({withCreateSuggestion:e,currentInputValue:t,handleSuggestionClick:o,suggestionsListProps:r,buildSuggestionItemProps:n,suggestions:i,selectedSuggestion:s,isLoading:a,isInitialSuggestions:l,createSuggestionButtonText:u,suggestionsQuery:d}){let f=K("block-editor-link-control__search-results",{"is-loading":a}),p=i.length===1&&h_.includes(i[0].type),h=e&&!p&&!l,m=!d?.type,g=l?(0,LE.__)("Suggestions"):(0,LE.sprintf)((0,LE.__)('Search results for "%s"'),t);return(0,oy.jsx)("div",{className:"block-editor-link-control__search-results-wrapper",children:(0,oy.jsx)("div",{...r,className:f,"aria-label":g,children:(0,oy.jsx)(w_e.MenuGroup,{children:i.map((b,v)=>h&&ty===b.type?(0,oy.jsx)(g_e,{searchTerm:t,buttonText:u,onClick:()=>o(b),itemProps:n(b,v),isSelected:v===s},b.type):ty===b.type?null:(0,oy.jsx)(k_e,{itemProps:n(b,v),suggestion:b,index:v,onClick:()=>{o(b)},isSelected:v===s,isURL:h_.includes(b.type),searchTerm:t,shouldShowType:m,isFrontPage:b?.isFrontPage,isBlogHome:b?.isBlogHome},`${b.id}-${b.type}`))})})})}var T_e=E_e,R_e=e=>((0,C_e.default)("wp.blockEditor.__experimentalLinkControlSearchResults",{since:"6.8"}),(0,oy.jsx)(E_e,{...e}));var B_e=c(F(),1),P_e=c(Q(),1);var kN=c(Fs(),1);function ME(e){let t=e?.trim();if(!t)return{url:t,type:SN};let o=SN,r=(0,kN.getProtocol)(t)||"";return r.includes("mailto")?o=uW:r.includes("tel")?o=cW:t?.startsWith("#")&&(o=dW),$h(t)||Kh(t)||t.startsWith("?")||r?{url:t,type:o}:{url:(0,kN.prependHTTPS)(t),type:o}}var C$e=()=>Promise.resolve([]),E$e=e=>{let{url:t,type:o}=ME(e);return Promise.resolve([{id:e,title:e,url:t,type:o}])},T$e=async(e,t,o,r,n,i)=>{let{isInitialSuggestions:s}=t,a=await o(e,t);return a.map(l=>Number(l.id)===n?(l.isFrontPage=!0,l):(Number(l.id)===i&&(l.isBlogHome=!0),l)),s||Yh(e)||!r?a:a.concat({title:e,url:e,type:ty})};function I_e(e,t,o){let{fetchSearchSuggestions:r,pageOnFront:n,pageForPosts:i}=(0,P_e.useSelect)(a=>{let{getSettings:l}=a(C);return{pageOnFront:l().pageOnFront,pageForPosts:l().pageForPosts,fetchSearchSuggestions:l().__experimentalFetchLinkSuggestions}},[]),s=t?E$e:C$e;return(0,B_e.useCallback)((a,{isInitialSuggestions:l})=>Yh(a)?s(a,{isInitialSuggestions:l}):T$e(a,{...e,isInitialSuggestions:l},r,o,n,i),[s,r,n,i,e,o])}var g_=c(E(),1),R$e=()=>Promise.resolve([]),pW=()=>{},A_e=(0,_N.forwardRef)(({value:e,children:t,currentLink:o={},className:r=null,placeholder:n=null,withCreateSuggestion:i=!1,onCreateSuggestion:s=pW,onChange:a=pW,onSelect:l=pW,showSuggestions:u=!0,renderSuggestions:d=x=>(0,g_.jsx)(T_e,{...x}),fetchSuggestions:f=null,allowDirectEntry:p=!0,showInitialSuggestions:h=!1,suggestionsQuery:m={},withURLSuggestion:g=!0,createSuggestionButtonText:b,hideLabelFromVision:v=!1,suffix:y,isEntity:k=!1,customValidity:S},_)=>{let x=I_e(m,p,i,g),w=u?f||x:R$e,[T,B]=(0,_N.useState)(),R=(N,z)=>{a(N),B(z)},I=N=>d({...N,withCreateSuggestion:i,createSuggestionButtonText:b,suggestionsQuery:m,handleSuggestionClick:z=>{N.handleSuggestionClick&&N.handleSuggestionClick(z),A(z)}}),A=async N=>{let z=N;if(ty===N.type){try{z=await s(N.title),z?.url&&l(z)}catch{}return}if(p||z&&Object.keys(z).length>=1){let{id:V,url:M,kind:D,type:L,...j}=o??{};l({...j,...z},z)}},P=n??(0,mW.__)("Search or type URL"),O=v&&n!==""?P:(0,mW.__)("Link");return(0,g_.jsxs)("div",{className:"block-editor-link-control__search-input-container",children:[(0,g_.jsx)(Qm,{disableSuggestions:o?.url===e,label:O,hideLabelFromVision:v,className:r,value:e,onChange:R,placeholder:P,__experimentalRenderSuggestions:u?I:null,__experimentalFetchLinkSuggestions:w,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:h,customValidity:S,required:!1,onSubmit:(N,z)=>{let V=N||T;!V&&!e?.trim()?.length?z.preventDefault():A(V||{url:e})},inputRef:_,suffix:y,disabled:k}),t]})}),L_e=A_e,M_e=e=>((0,O_e.default)("wp.blockEditor.__experimentalLinkControlSearchInput",{since:"6.8"}),(0,g_.jsx)(A_e,{...e}));var Jm=c(G(),1),rn=c(U(),1),z_e=c(fe(),1),CN=c(Fs(),1);var j_e=c(Tt(),1),EN=c(Q(),1),H_e=c(as(),1),U_e=c(dv(),1);var N_e=c(U(),1),{Slot:D_e,Fill:V_e}=(0,N_e.createSlotFill)("BlockEditorLinkControlViewer");var F_e=c(Q(),1),xN=c(F(),1);function B$e(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}`)}}function P$e(e){let[t,o]=(0,xN.useReducer)(B$e,{richData:null,isFetching:!1}),{fetchRichUrlData:r}=(0,F_e.useSelect)(n=>{let{getSettings:i}=n(C);return{fetchRichUrlData:i().__experimentalFetchRichUrlData}},[]);return(0,xN.useEffect)(()=>{if(e?.length&&r&&typeof AbortController<"u"){o({type:"LOADING"});let n=new window.AbortController,i=n.signal;return r(e,{signal:i}).then(s=>{o({type:"RESOLVED",richData:s})}).catch(()=>{i.aborted||o({type:"ERROR"})}),()=>{n.abort()}}},[e]),t}var wN=P$e;var Ro=c(E(),1),{Badge:I$e}=H(rn.privateApis);function G_e({value:e,onEditClick:t,hasRichPreviews:o=!1,hasUnlinkControl:r=!1,onRemove:n}){let i=(0,EN.useSelect)(b=>b(U_e.store).get("core","showIconLabels"),[]),s=o?e?.url:null,{richData:a,isFetching:l}=wN(s),u=a&&Object.keys(a).length,d=e&&(0,CN.filterURLForDisplay)((0,CN.safeDecodeURI)(e.url),24)||"",f=!e?.url?.length,p=!f&&(0,j_e.__unstableStripHTML)(e?.entityTitle||a?.title||e?.title||d),h;a?.icon?h=(0,Ro.jsx)("img",{src:a?.icon,alt:""}):f?h=(0,Ro.jsx)(gt,{icon:a4,size:32}):h=(0,Ro.jsx)(gt,{icon:Ux});let{createNotice:m}=(0,EN.useDispatch)(H_e.store),g=(0,z_e.useCopyToClipboard)(e.url,()=>{m("info",(0,Jm.__)("Link copied to clipboard."),{isDismissible:!0,type:"snackbar"})});return(0,Ro.jsx)(rn.Flex,{role:"group","aria-label":(0,Jm.__)("Manage link"),className:K("block-editor-link-control__preview",{"is-current":!0,"is-rich":u,"is-fetching":!!l,"is-preview":!0,"is-error":f,"is-url-title":p===d}),children:(0,Ro.jsxs)(rn.Flex,{gap:0,align:"flex-start",children:[(0,Ro.jsxs)(rn.Flex,{className:"block-editor-link-control__link-information",role:"figure","aria-label":(0,Jm.__)("Link information"),justify:"start",align:"flex-start",children:[e?.image?(0,Ro.jsx)(rn.Flex,{className:"block-editor-link-control__preview-image",justify:"center",children:(0,Ro.jsx)("img",{src:e?.image,alt:""})}):(0,Ro.jsx)(rn.Flex,{className:K("block-editor-link-control__preview-icon",{"is-image":a?.icon}),justify:"center",children:h}),(0,Ro.jsx)(rn.Flex,{className:"block-editor-link-control__preview-details",direction:"column",gap:2,children:f?(0,Ro.jsx)("span",{className:"block-editor-link-control__preview-error-notice",children:(0,Jm.__)("Link is empty")}):(0,Ro.jsxs)(Ro.Fragment,{children:[(0,Ro.jsx)(rn.ExternalLink,{className:"block-editor-link-control__preview-title",href:e.url,children:(0,Ro.jsx)(rn.__experimentalTruncate,{numberOfLines:1,children:p})}),(0,Ro.jsx)("span",{className:"block-editor-link-control__preview-info",children:(0,Ro.jsx)(rn.__experimentalTruncate,{numberOfLines:1,children:d})}),e?.badges?.length>0&&(0,Ro.jsx)(rn.__experimentalHStack,{className:"block-editor-link-control__preview-badges",alignment:"left",gap:1,children:e.badges.map((b,v)=>(0,Ro.jsx)(I$e,{intent:b.intent,children:b.label},`${b.label}|${b.intent}|${v}`))})]})})]}),(0,Ro.jsx)(rn.Button,{icon:cg,label:(0,Jm.__)("Edit link"),onClick:t,size:"compact",showTooltip:!i}),r&&(0,Ro.jsx)(rn.Button,{icon:is,label:(0,Jm.__)("Remove link"),onClick:n,size:"compact",showTooltip:!i}),(0,Ro.jsx)(rn.Button,{icon:c3,label:(0,Jm.__)("Copy link"),ref:g,accessibleWhenDisabled:!0,disabled:f,size:"compact",showTooltip:!i}),(0,Ro.jsx)(D_e,{fillProps:e})]})})}var W_e=c(G(),1),$_e=c(U(),1);var ry=c(E(),1),O$e=()=>{},A$e=({value:e,onChange:t=O$e,settings:o})=>{if(!o||!o.length)return null;let r=i=>s=>{t({...e,[i.id]:s})},n=o.map(i=>{if("render"in i){if(typeof i.render=="function"){let s=i.render(i,e,t);return(0,ry.jsx)("div",{className:"block-editor-link-control__setting",children:s},i.id)}return null}return(0,ry.jsx)($_e.CheckboxControl,{className:"block-editor-link-control__setting",label:i.title,onChange:r(i),checked:e?!!e[i.id]:!1,help:i?.help},i.id)}).filter(Boolean);return(0,ry.jsxs)("fieldset",{className:"block-editor-link-control__settings",children:[(0,ry.jsx)(bt,{render:(0,ry.jsx)("legend",{}),children:(0,W_e.__)("Currently selected link settings")}),n]})},K_e=A$e;var Y_e=c(G(),1),ny=c(F(),1);function q_e(e){let t=(0,ny.useRef)(),[o,r]=(0,ny.useState)(!1),[n,i]=(0,ny.useState)(null),s=async function(a){r(!0),i(null);try{return t.current=L$e(Promise.resolve(e(a))),await t.current.promise}catch(l){if(l&&l.isCanceled)return;throw i(l.message||(0,Y_e.__)("An unknown error occurred during creation. Please try again.")),l}finally{r(!1)}};return(0,ny.useEffect)(()=>()=>{t.current&&t.current.cancel()},[]),{createPage:s,isCreatingPage:o,errorMessage:n}}var L$e=e=>{let t=!1;return{promise:new Promise((r,n)=>{e.then(i=>t?n({isCanceled:!0}):r(i),i=>n(t?{isCanceled:!0}:i))}),cancel(){t=!0}}};var hW=c(F(),1),Q_e=c(X_e(),1);function J_e(e){let[t,o]=(0,hW.useState)(e||{}),[r,n]=(0,hW.useState)(e);return(0,Q_e.default)(e,r)||(n(e),o(e)),[t,o,l=>{o({...t,url:l})},l=>{o({...t,title:l})},l=>u=>{let d=Object.keys(u).reduce((f,p)=>(l.includes(p)&&(f[p]=u[p]),f),{});o({...t,...d})}]}var zo=c(E(),1),bW=()=>{},exe="core/block-editor",txe="linkControlSettingsDrawer";function iy({searchInputPlaceholder:e,value:t,settings:o=fW,onChange:r=bW,onInputChange:n,onRemove:i,onCancel:s,noDirectEntry:a=!1,showSuggestions:l=!0,showInitialSuggestions:u,forceIsEditingLink:d,createSuggestion:f,withCreateSuggestion:p,inputValue:h="",suggestionsQuery:m={},noURLSuggestion:g=!1,createSuggestionButtonText:b,hasRichPreviews:v=!1,hasTextControl:y=!1,renderControlBottom:k=null,handleEntities:S=!1}){p===void 0&&f&&(p=!0);let[_,x]=(0,wr.useState)(!1),[w,T]=(0,wr.useState)(void 0),{advancedSettingsPreference:B}=(0,RN.useSelect)(de=>({advancedSettingsPreference:de(gW.store).get(exe,txe)??!1}),[]),{set:R}=(0,RN.useDispatch)(gW.store),I=de=>{R&&R(exe,txe,de),x(de)},A=B||_,P=(0,wr.useRef)(!0),O=(0,wr.useRef)(),N=(0,TN.useMergeRefs)([O,wv()]),z=(0,wr.useRef)(),V=(0,wr.useRef)(),M=(0,wr.useRef)(),D=o.map(({id:de})=>de),[L,j,q,J,te]=J_e(t),ee=de=>{q(de),n?.(de)},$=S&&!!L?.id,W=(0,TN.useInstanceId)(iy,"link-control"),Y=$?`${W}__help`:null,Z=t&&!(0,nxe.isShallowEqualObjects)(L,t),[oe,ne]=(0,wr.useState)(d!==void 0?d:!t||!t.url),{createPage:X,isCreatingPage:re,errorMessage:ae}=q_e(f);(0,wr.useEffect)(()=>{d!==void 0&&ne(d)},[d]),(0,wr.useEffect)(()=>{if(P.current)return;(oxe.focus.focusable.find(O.current)[0]||O.current).focus()},[oe,re]),(0,wr.useEffect)(()=>(P.current=!1,()=>{P.current=!0}),[]);let ve=(0,wr.useRef)();(0,wr.useEffect)(()=>{if(ve.current===void 0){ve.current=h;return}ve.current!==h&&(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."),ve.current=h)},[h]),(0,wr.useEffect)(()=>{if(w?.type==="invalid"){let de=V.current;de&&typeof de.reportValidity=="function"&&de.reportValidity()}},[w]);let xe=t?.url?.trim()?.length>0,ge=()=>{ne(!1)},be=de=>{let Me={type:"invalid",message:(0,wc.__)("Please enter a valid URL.")},Ze={type:"valid"},ze=de?.trim();if(!ze?.length||!Yh(ze))return Me;if($h(ze)||Kh(ze))return Ze;let Je=(0,BN.prependHTTPS)(ze);return(0,BN.isURL)(Je)?Ze:Me},he=de=>{if(!(de&&de.id&&de.type&&!h_.includes(de.type))){let ze=de?.url||qe,Je=be(ze);if(Je.type==="invalid"){T(Je);return}let{url:lt}=ME(ze);de={...de,url:lt}}de?.kind==="taxonomy"&&de?.url&&(M.current=de.url);let Ze=Object.keys(de).reduce((ze,Je)=>(D.includes(Je)||(ze[Je]=de[Je]),ze),{});r({...L,...Ze,title:L?.title||de?.title}),T(void 0),ge()},ke=()=>{if(pt)return!1;let de=qe.trim(),Me=L&&L.id&&L.type&&!h_.includes(L.type),Ze=t?.url===de;if(Me&&Ze)return T(void 0),!0;let ze=be(qe);return ze.type==="invalid"?(T(ze),!1):(T(void 0),!0)},_e=()=>{Z&&r({...t,...L,url:ME(qe).url}),ge(),T(void 0)},we=()=>{ke()&&_e()},Re=de=>{let{keyCode:Me}=de;Me===rxe.ENTER&&!pt&&(de.preventDefault(),we())},se=()=>{j(t)},ie=de=>{de.preventDefault(),de.stopPropagation(),se(),T(void 0),xe?ge():i?.(),s?.()},[Ae,ye]=(0,wr.useState)(!1),Ee=()=>{let{id:de,kind:Me,type:Ze,...ze}=L;j({...ze,id:void 0,kind:void 0,type:void 0,url:void 0}),ye(!0)};(0,wr.useEffect)(()=>{Ae&&(V.current?.focus(),ye(!1))},[Ae]);let qe=L?.url!==void 0?L.url:h||"",pt=!qe?.trim()?.length;(0,wr.useEffect)(()=>{T(void 0)},[qe]);let at=!w,Ct=i&&t&&!oe&&!re,rt=oe&&xe,Ot=xe&&y,ut=(oe||!t)&&!re,Gt=pt||!at||t&&!Z,So=!!o?.length&&oe&&xe,mo=(0,wr.useMemo)(()=>t?.kind==="taxonomy"&&!t?.url&&M.current?{...t,url:M.current}:t,[t]);return(0,zo.jsxs)("div",{tabIndex:-1,ref:N,className:"block-editor-link-control",children:[re&&(0,zo.jsxs)("div",{className:"block-editor-link-control__loading",children:[(0,zo.jsx)(Ki.Spinner,{})," ",(0,wc.__)("Creating"),"\u2026"]}),ut&&(0,zo.jsxs)(zo.Fragment,{children:[(0,zo.jsxs)("div",{className:K({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":Ot,"has-actions":rt}),children:[Ot&&(0,zo.jsx)(Ki.TextControl,{ref:z,className:"block-editor-link-control__field block-editor-link-control__text-content",label:(0,wc.__)("Text"),value:L?.title,onChange:J,onKeyDown:Re}),(0,zo.jsx)(L_e,{ref:V,currentLink:t,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:e,value:qe,withCreateSuggestion:p,onCreateSuggestion:X,onChange:ee,onSelect:he,showInitialSuggestions:u,allowDirectEntry:!a,showSuggestions:l,suggestionsQuery:m,withURLSuggestion:!g,createSuggestionButtonText:b,hideLabelFromVision:!Ot,isEntity:$,customValidity:w,suffix:(0,zo.jsx)(M$e,{isEntity:$,showActions:rt,isDisabled:Gt,onUnlink:Ee,onSubmit:we,helpTextId:Y})}),$&&Y&&(0,zo.jsx)("p",{id:Y,className:"block-editor-link-control__help",children:(0,wc.sprintf)((0,wc.__)("Synced with the selected %s."),L?.type||"item")})]}),ae&&(0,zo.jsx)(Ki.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1,children:ae})]}),t&&!oe&&!re&&(0,zo.jsx)(G_e,{value:mo,onEditClick:()=>ne(!0),hasRichPreviews:v,hasUnlinkControl:Ct,onRemove:()=>{i(),ne(!0)}},mo?.url),So&&(0,zo.jsx)("div",{className:"block-editor-link-control__tools",children:!pt&&(0,zo.jsx)(p_e,{settingsOpen:A,setSettingsOpen:I,children:(0,zo.jsx)(K_e,{value:L,settings:o,onChange:te(D)})})}),rt&&(0,zo.jsxs)(Ki.__experimentalHStack,{justify:"right",className:"block-editor-link-control__search-actions",children:[(0,zo.jsx)(Ki.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:ie,children:(0,wc.__)("Cancel")}),(0,zo.jsx)(Ki.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:Gt?bW:we,className:"block-editor-link-control__search-submit","aria-disabled":Gt,children:(0,wc.__)("Apply")})]}),!re&&k&&k()]})}function M$e({isEntity:e,showActions:t,isDisabled:o,onUnlink:r,onSubmit:n,helpTextId:i}){if(e)return(0,zo.jsx)(Ki.Button,{icon:is,onClick:r,"aria-describedby":i,showTooltip:!0,label:(0,wc.__)("Unsync and edit"),__next40pxDefaultSize:!0});if(!t)return(0,zo.jsx)(Ki.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,zo.jsx)(Ki.Button,{onClick:o?bW:n,label:(0,wc.__)("Submit"),icon:sd,className:"block-editor-link-control__search-submit","aria-disabled":o,size:"small"})})}iy.ViewerFill=V_e;iy.DEFAULT_LINK_SETTINGS=fW;var PN=e=>((0,ixe.default)("wp.blockEditor.__experimentalLinkControl",{since:"6.8",alternative:"wp.blockEditor.LinkControl"}),(0,zo.jsx)(iy,{...e}));PN.ViewerFill=iy.ViewerFill;PN.DEFAULT_LINK_SETTINGS=iy.DEFAULT_LINK_SETTINGS;var eh=iy;var axe=c(G(),1),lxe=c(U(),1);var NE=1.5,yW=.01,vW=10,SW="";function sxe(e){return e!==void 0&&e!==SW}var kW=c(E(),1),N$e=({__next40pxDefaultSize:e,value:t,onChange:o,__unstableInputWidth:r="60px",...n})=>{let i=sxe(t),s=(d,f)=>{if(i)return d;let p=yW*vW;switch(`${d}`){case`${p}`:return NE+p;case"0":return f?d:NE-p;case"":return NE;default:return d}},a=(d,f)=>{let p=["insertText","insertFromPaste"].includes(f.payload.event.nativeEvent?.inputType),h=s(d.value,p);return{...d,value:h}},l=i?t:SW;return(0,kW.jsx)("div",{className:"block-editor-line-height-control",children:(0,kW.jsx)(lxe.__experimentalNumberControl,{placeholder:NE,...n,__unstableInputWidth:r,__unstableStateReducer:a,onChange:(d,{event:f})=>{if(d===""){o();return}if(f.type==="click"){o(s(`${d}`,!1));return}o(`${d}`)},label:(0,axe.__)("Line height"),step:yW,spinFactor:vW,value:l,min:0,spinControls:"custom"})})},IN=N$e;var Iu=c(G(),1),cxe=c(Qr(),1),Yi=c(U(),1),AN=c(Q(),1),uxe=c(io(),1);var dxe=c(fe(),1),fxe=c(Tt(),1),pxe=c(as(),1),mxe=c(F(),1);function ON(e,t,o){if(o)return o;if(!t||typeof t!="object"||Object.keys(t).length===0)return e&&e.length>0?e.map(n=>`${n}/*`).join(","):void 0;if(!e||e.length===0)return;let r=[];for(let[,n]of Object.entries(t))e.some(s=>s.includes("/")?n===s:n.startsWith(`${s}/`))&&r.push(n);return r.length>0?r.join(","):e.map(n=>`${n}/*`).join(",")}var Ln=c(E(),1),D$e=()=>{},V$e=0,F$e=({mediaURL:e,mediaId:t,mediaIds:o,allowedTypes:r,accept:n,onError:i,onSelect:s,onSelectURL:a,onReset:l,onToggleFeaturedImage:u,useFeaturedImage:d,onFilesUpload:f=D$e,name:p=(0,Iu.__)("Replace"),createNotice:h,removeNotice:m,children:g,multiple:b=!1,addToGallery:v,handleUpload:y=!0,variant:k,popoverProps:S,renderToggle:_,className:x})=>{let{mediaUpload:w,allowedMimeTypes:T}=(0,AN.useSelect)(M=>{let{getSettings:D}=M(C),L=D();return{mediaUpload:L.mediaUpload,allowedMimeTypes:L.allowedMimeTypes}},[]),B=`block-editor/media-replace-flow/error-notice/${++V$e}`,R=(0,mxe.useMemo)(()=>ON(r,T,n),[r,T,n]),I=M=>{let D=(0,fxe.__unstableStripHTML)(M);if(i){i(D);return}setTimeout(()=>{h("error",D,{speak:!0,id:B,isDismissible:!0})},1e3)},A=(M,D)=>{d&&u&&u(),D(),s(M),(0,cxe.speak)((0,Iu.__)("The media file has been replaced")),m(B)},P=(M,D)=>{let L=M.target.files;if(!y)return D(),s(L);f(L),w({allowedTypes:r,filesList:L,onFileChange:([j])=>{A(j,D)},onError:I})},O=M=>{M.keyCode===uxe.DOWN&&(M.preventDefault(),M.target.click())},z=b&&(!r||r.length===0?!1:r.every(M=>M==="image"||M.startsWith("image/"))),V={...S,variant:k};return(0,Ln.jsx)(Yi.Dropdown,{popoverProps:V,className:x,contentClassName:K("block-editor-media-replace-flow__options",k&&`is-variant-${k}`),renderToggle:({isOpen:M,onToggle:D})=>_?_({"aria-expanded":M,"aria-haspopup":"true",onClick:D,onKeyDown:O,children:p}):(0,Ln.jsx)(Yi.ToolbarButton,{"aria-expanded":M,"aria-haspopup":"true",onClick:D,onKeyDown:O,children:p}),renderContent:({onClose:M})=>(0,Ln.jsxs)(Ln.Fragment,{children:[(0,Ln.jsxs)(Yi.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu",children:[(0,Ln.jsxs)(Xs,{children:[(0,Ln.jsx)(yu,{gallery:z,addToGallery:v,multiple:b,value:b?o:t,onSelect:D=>A(D,M),allowedTypes:r,render:({open:D})=>(0,Ln.jsx)(Yi.MenuItem,{icon:Qy,onClick:D,children:(0,Iu.__)("Open Media Library")})}),(0,Ln.jsx)(Yi.FormFileUpload,{onChange:D=>{P(D,M)},accept:R,multiple:!!b,render:({openFileDialog:D})=>(0,Ln.jsx)(Yi.MenuItem,{icon:A6,onClick:()=>{D()},children:(0,Iu._x)("Upload","verb")})})]}),u&&(0,Ln.jsx)(Yi.MenuItem,{icon:G4,onClick:u,isPressed:d,children:(0,Iu.__)("Use featured image")}),typeof g=="function"?g({onClose:M}):g,e&&l&&(0,Ln.jsx)(Yi.MenuItem,{onClick:()=>{l(),M()},children:(0,Iu.__)("Reset")})]}),a&&(0,Ln.jsxs)("form",{className:"block-editor-media-flow__url-input",children:[(0,Ln.jsx)("span",{className:"block-editor-media-replace-flow__image-url-label",children:(0,Iu.__)("Current media URL:")}),(0,Ln.jsx)(eh,{value:{url:e},settings:[],showSuggestions:!1,onChange:({url:D})=>{a(D)},searchInputPlaceholder:(0,Iu.__)("Paste or type URL")})]})]})})},b_=(0,dxe.compose)([(0,AN.withDispatch)(e=>{let{createNotice:t,removeNotice:o}=e(pxe.store);return{createNotice:t,removeNotice:o}}),(0,Yi.withFilters)("editor.MediaReplaceFlow")])(F$e);var Yr=c(U(),1),Kr=c(G(),1),nh=c(F(),1),Rxe=c(Q(),1);var Bxe=c(Rt(),1);var xW=c(G(),1),MN=c(F(),1),y_=c(U(),1);var Txe=c(Rt(),1);var bxe=c(G(),1),yxe=c(U(),1);var hxe=c(U(),1),LN=c(Fs(),1),_W=c(E(),1);function gxe({url:e,urlLabel:t,className:o}){let r=K(o,"block-editor-url-popover__link-viewer-url");return e?(0,_W.jsx)(hxe.ExternalLink,{className:r,href:e,children:t||(0,LN.filterURLForDisplay)((0,LN.safeDecodeURI)(e))}):(0,_W.jsx)("span",{className:r})}var DE=c(E(),1);function vxe({className:e,linkClassName:t,onEditLinkClick:o,url:r,urlLabel:n,...i}){return(0,DE.jsxs)("div",{className:K("block-editor-url-popover__link-viewer",e),...i,children:[(0,DE.jsx)(gxe,{url:r,urlLabel:n,className:t}),o&&(0,DE.jsx)(yxe.Button,{icon:cg,label:(0,bxe.__)("Edit"),onClick:o,size:"compact"})]})}var wxe=c(G(),1),Cxe=c(U(),1);var bf=c(G(),1),VE=c(F(),1),Cc=c(io(),1),Es=c(U(),1),th=c(fe(),1),Sxe=c(Q(),1),kxe=c(Fs(),1);var Ou=c(E(),1),_xe=c(ce(),1),{ValidatedInputControl:z$e}=H(Es.privateApis);function xxe(e){return typeof e=="function"}var j$e=class extends VE.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,VE.createRef)(),this.inputRef=e.inputRef||(0,VE.createRef)(),this.hasRenderedValidation={current:!1},this.updateSuggestions=(0,th.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.suggestionsRequest=null,this.state={suggestions:[],showSuggestions:!1,suggestionsValue:null,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){let{showSuggestions:t,selectedSuggestion:o}=this.state,{value:r,__experimentalShowInitialSuggestions:n=!1}=this.props;t&&o!==null&&this.suggestionNodes[o]&&this.suggestionNodes[o].scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}),e.value!==r&&!this.props.disableSuggestions&&(r?.length?this.updateSuggestions(r):n&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){let{__experimentalShowInitialSuggestions:e=!1,value:t}=this.props;return e&&!(t&&t.length)}updateSuggestions(e=""){let{__experimentalFetchLinkSuggestions:t,__experimentalHandleURLSuggestions:o}=this.props;if(!t)return;let r=!e?.length;if(e=e.trim(),!r&&(e.length<2||!o&&(0,kxe.isURL)(e))){this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null,this.setState({suggestions:[],showSuggestions:!1,suggestionsValue:e,selectedSuggestion:null,loading:!1});return}this.setState({selectedSuggestion:null,loading:!0});let n=t(e,{isInitialSuggestions:r});n.then(i=>{this.suggestionsRequest===n&&(this.setState({suggestions:i,suggestionsValue:e,loading:!1,showSuggestions:!!i.length}),i.length?this.props.debouncedSpeak((0,bf.sprintf)((0,bf._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",i.length),i.length),"assertive"):this.props.debouncedSpeak((0,bf.__)("No results."),"assertive"))}).catch(()=>{this.suggestionsRequest===n&&this.setState({loading:!1})}).finally(()=>{this.suggestionsRequest===n&&(this.suggestionsRequest=null)}),this.suggestionsRequest=n}onChange(e){this.props.onChange(e)}onFocus(){let{suggestions:e}=this.state,{disableSuggestions:t,value:o}=this.props;o&&!t&&!(e&&e.length)&&this.suggestionsRequest===null&&this.updateSuggestions(o)}onKeyDown(e){this.props.onKeyDown?.(e);let{showSuggestions:t,selectedSuggestion:o,suggestions:r,loading:n}=this.state;if(!t||!r.length||n){switch(e.keyCode){case Cc.UP:{e.target.selectionStart!==0&&(e.preventDefault(),e.target.setSelectionRange(0,0));break}case Cc.DOWN:{this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break}case Cc.ENTER:{this.props.onSubmit&&(e.preventDefault(),this.props.onSubmit(null,e));break}}return}let i=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case Cc.UP:{e.preventDefault();let s=o?o-1:r.length-1;this.setState({selectedSuggestion:s});break}case Cc.DOWN:{e.preventDefault();let s=o===null||o===r.length-1?0:o+1;this.setState({selectedSuggestion:s});break}case Cc.TAB:{this.state.selectedSuggestion!==null&&(this.selectLink(i),this.props.speak((0,bf.__)("Link selected.")));break}case Cc.ENTER:{e.preventDefault(),this.state.selectedSuggestion!==null?(this.selectLink(i),this.props.onSubmit&&this.props.onSubmit(i,e)):this.props.onSubmit&&this.props.onSubmit(null,e);break}}}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:o,__experimentalShowInitialSuggestions:r=!1},{showSuggestions:n}){let i=n,s=e&&e.length;return!r&&!s&&(i=!1),o===!0&&(i=!1),{showSuggestions:i,suggestionsListboxId:`block-editor-url-input-suggestions-${t}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${t}`}}render(){return(0,Ou.jsxs)(Ou.Fragment,{children:[this.renderControl(),this.renderSuggestions()]})}renderControl(){let{label:e=null,className:t,isFullWidth:o,instanceId:r,placeholder:n=(0,bf.__)("Paste URL or type to search"),__experimentalRenderControl:i,value:s="",hideLabelFromVision:a=!1,help:l=null,disabled:u=!1,customValidity:d,markWhenOptional:f}=this.props,{loading:p,showSuggestions:h,selectedSuggestion:m,suggestionsListboxId:g,suggestionOptionIdPrefix:b}=this.state,v=`url-input-control-${r}`,y={id:v,label:e,className:K("block-editor-url-input",t,{"is-full-width":o}),hideLabelFromVision:a},k={id:v,value:s,required:this.props.required??!0,type:"text",name:v,autoComplete:"off",onChange:u?()=>{}:this.onChange,onFocus:u?()=>{}:this.onFocus,placeholder:n,onKeyDown:u?()=>{}:this.onKeyDown,role:"combobox","aria-label":e?void 0:(0,bf.__)("URL"),"aria-expanded":h,"aria-autocomplete":"list","aria-owns":g,"aria-activedescendant":m!==null?`${b}-${m}`:void 0,ref:this.inputRef,disabled:u,suffix:this.props.suffix,help:l},S={customValidity:d,...f!==void 0&&{markWhenOptional:f}};if(i)return i(y,k,p);d!==void 0&&(this.hasRenderedValidation.current=!0);let _=this.hasRenderedValidation.current?z$e:Es.__experimentalInputControl;return(0,Ou.jsxs)(Es.BaseControl,{...y,children:[(0,Ou.jsx)(_,{...k,...this.hasRenderedValidation.current?S:{},__next40pxDefaultSize:!0}),p&&(0,Ou.jsx)(Es.Spinner,{})]})}renderSuggestions(){let{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:o,suggestions:r,suggestionsValue:n,selectedSuggestion:i,suggestionsListboxId:s,suggestionOptionIdPrefix:a,loading:l}=this.state;if(!o||r.length===0)return null;let u={id:s,ref:this.autocompleteRef,role:"listbox"},d=(f,p)=>({role:"option",tabIndex:"-1",id:`${a}-${p}`,ref:this.bindSuggestionNode(p),"aria-selected":p===i?!0:void 0});return xxe(t)?t({suggestions:r,selectedSuggestion:i,suggestionsListProps:u,buildSuggestionItemProps:d,isLoading:l,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!n?.length,currentInputValue:n}):(0,Ou.jsx)(Es.Popover,{placement:"bottom",focusOnMount:!1,children:(0,Ou.jsx)("div",{...u,className:K("block-editor-url-input__suggestions",{[`${e}__suggestions`]:e}),children:r.map((f,p)=>(0,_xe.createElement)(Es.Button,{__next40pxDefaultSize:!0,...d(f,p),key:f.id,className:K("block-editor-url-input__suggestion",{"is-selected":p===i}),onClick:()=>this.handleOnClick(f)},f.title))})})}},Qm=(0,th.compose)(th.withSafeTimeout,Es.withSpokenMessages,th.withInstanceId,(0,Sxe.withSelect)((e,t)=>{if(xxe(t.__experimentalFetchLinkSuggestions))return;let{getSettings:o}=e(C);return{__experimentalFetchLinkSuggestions:o().__experimentalFetchLinkSuggestions}}))(j$e);var FE=c(E(),1);function Exe({autocompleteRef:e,className:t,onChangeInputValue:o,value:r,...n}){return(0,FE.jsxs)("form",{className:K("block-editor-url-popover__link-editor",t),...n,children:[(0,FE.jsx)(Qm,{value:r,onChange:o,autocompleteRef:e}),(0,FE.jsx)(Cxe.Button,{icon:sd,label:(0,wxe.__)("Apply"),type:"submit",size:"compact"})]})}var oh=c(E(),1),{__experimentalPopoverLegacyPositionToPlacement:H$e}=H(y_.privateApis),U$e="bottom",wW=(0,MN.forwardRef)(({additionalControls:e,children:t,renderSettings:o,placement:r,focusOnMount:n="firstElement",position:i,...s},a)=>{i!==void 0&&(0,Txe.default)("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"});let l;r!==void 0?l=r:i!==void 0&&(l=H$e(i)),l=l||U$e;let[u,d]=(0,MN.useState)(!1),f=!!o&&u,p=()=>{d(!u)};return(0,oh.jsxs)(y_.Popover,{ref:a,role:"dialog","aria-modal":"true","aria-label":(0,xW.__)("Edit URL"),className:"block-editor-url-popover",focusOnMount:n,placement:l,shift:!0,variant:"toolbar",...s,children:[(0,oh.jsx)("div",{className:"block-editor-url-popover__input-container",children:(0,oh.jsxs)("div",{className:"block-editor-url-popover__row",children:[t,!!o&&(0,oh.jsx)(y_.Button,{className:"block-editor-url-popover__settings-toggle",icon:cn,label:(0,xW.__)("Link settings"),onClick:p,"aria-expanded":u,size:"compact"})]})}),f&&(0,oh.jsx)("div",{className:"block-editor-url-popover__settings",children:o()}),e&&!f&&(0,oh.jsx)("div",{className:"block-editor-url-popover__additional-controls",children:e})]})});wW.LinkEditor=Exe;wW.LinkViewer=vxe;var rh=wW;var Zt=c(E(),1),G$e=()=>{},W$e=({src:e,onChange:t,onSubmit:o,onClose:r,popoverAnchor:n})=>(0,Zt.jsx)(rh,{anchor:n,onClose:r,children:(0,Zt.jsx)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:o,children:(0,Zt.jsx)(Yr.__experimentalInputControl,{label:(0,Kr.__)("URL"),type:"text",hideLabelFromVision:!0,placeholder:(0,Kr.__)("Paste or type URL"),onChange:t,value:e,suffix:(0,Zt.jsx)(Yr.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,Zt.jsx)(Yr.Button,{size:"small",icon:sd,label:(0,Kr.__)("Apply"),type:"submit"})})})})}),$$e=({src:e,onChangeSrc:t,onSelectURL:o})=>{let[r,n]=(0,nh.useState)(null),[i,s]=(0,nh.useState)(!1),a=()=>{s(!0)},l=()=>{s(!1),r?.focus()},u=d=>{d.preventDefault(),e&&o&&(o(e),l())};return(0,Zt.jsxs)("div",{className:"block-editor-media-placeholder__url-input-container",children:[(0,Zt.jsx)(Yr.Button,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__button",onClick:a,isPressed:i,variant:"secondary","aria-haspopup":"dialog",ref:n,children:(0,Kr.__)("Insert from URL")}),i&&(0,Zt.jsx)(W$e,{src:e,onChange:t,onSubmit:u,onClose:l,popoverAnchor:r})]})};function K$e({value:e={},allowedTypes:t,className:o,icon:r,labels:n={},mediaPreview:i,notices:s,isAppender:a,accept:l,addToGallery:u,multiple:d=!1,handleUpload:f=!0,disableDropZone:p,disableMediaButtons:h,onError:m,onSelect:g,onCancel:b,onSelectURL:v,onToggleFeaturedImage:y,onDoubleClick:k,onFilesPreUpload:S=G$e,onHTMLDrop:_,children:x,mediaLibraryButton:w,placeholder:T,style:B}){_&&(0,Bxe.default)("wp.blockEditor.MediaPlaceholder onHTMLDrop prop",{since:"6.2",version:"6.4"});let{mediaUpload:R,allowedMimeTypes:I}=(0,Rxe.useSelect)($=>{let{getSettings:W}=$(C),Y=W();return{mediaUpload:Y.mediaUpload,allowedMimeTypes:Y.allowedMimeTypes}},[]),[A,P]=(0,nh.useState)("");(0,nh.useEffect)(()=>{P(e?.src??"")},[e?.src]);let O=(0,nh.useMemo)(()=>ON(t,I,l),[t,I,l]),N=()=>!t||t.length===0?!1:t.every($=>$==="image"||$.startsWith("image/")),z=$=>{if(!f||typeof f=="function"&&!f($))return g($);S($);let W;if(d)if(u){let Y=[];W=Z=>{let oe=(e??[]).filter(ne=>ne.id?!Y.some(({id:X})=>Number(X)===Number(ne.id)):!Y.some(({urlSlug:X})=>ne.url.includes(X)));g(oe.concat(Z)),Y=Z.map(ne=>{let X=ne.url.lastIndexOf("."),re=ne.url.slice(0,X);return{id:ne.id,urlSlug:re}})}}else W=g;else W=([Y])=>g(Y);R({allowedTypes:t,filesList:$,onFileChange:W,onError:m,multiple:d})};async function V($){let{blocks:W}=b9($);if(!W?.length)return;let Y=await Promise.all(W.map(Z=>{let oe=Z.name.split("/")[1];return Z.attributes.id?(Z.attributes.type=oe,Z.attributes):new Promise((ne,X)=>{window.fetch(Z.attributes.url).then(re=>re.blob()).then(re=>R({filesList:[re],additionalData:{title:Z.attributes.title,alt_text:Z.attributes.alt,caption:Z.attributes.caption,type:oe},onFileChange:([ae])=>{ae.id&&ne(ae)},allowedTypes:t,onError:X})).catch(()=>ne(Z.attributes.url))})})).catch(Z=>m(Z));Y?.length&&g(d?Y:Y[0])}let M=$=>{z($.target.files)},L=T??($=>{let{instructions:W,title:Y}=n;if(!R&&!v&&(W=(0,Kr.__)("To edit this block, you need permission to upload media.")),W===void 0||Y===void 0){let oe=t??[],[ne]=oe,X=oe.length===1,re=X&&ne==="audio",ae=X&&ne==="image",ve=X&&ne==="video";W===void 0&&R&&(W=(0,Kr.__)("Drag and drop an image or video, upload, or choose from your library."),re?W=(0,Kr.__)("Drag and drop an audio file, upload, or choose from your library."):ae?W=(0,Kr.__)("Drag and drop an image, upload, or choose from your library."):ve&&(W=(0,Kr.__)("Drag and drop a video, upload, or choose from your library."))),Y===void 0&&(Y=(0,Kr.__)("Media"),re?Y=(0,Kr.__)("Audio"):ae?Y=(0,Kr.__)("Image"):ve&&(Y=(0,Kr.__)("Video")))}let Z=K("block-editor-media-placeholder",o,{"is-appender":a});return(0,Zt.jsxs)(Yr.Placeholder,{icon:r,label:Y,instructions:W,className:Z,notices:s,onDoubleClick:k,preview:i,style:B,children:[$,x]})}),j=()=>p?null:(0,Zt.jsx)(Yr.DropZone,{onFilesDrop:z,onDrop:V,isEligible:$=>{let W="wp-block:core/",Y=[];for(let Z of $.types)Z.startsWith(W)&&Y.push(Z.slice(W.length));return Y.every(Z=>t.includes(Z))&&(d?!0:Y.length===1)}}),q=()=>b&&(0,Zt.jsx)(Yr.Button,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__cancel-button",title:(0,Kr.__)("Cancel"),variant:"link",onClick:b,children:(0,Kr.__)("Cancel")}),J=()=>v&&(0,Zt.jsx)($$e,{src:A,onChangeSrc:P,onSelectURL:v}),te=()=>y&&(0,Zt.jsx)("div",{className:"block-editor-media-placeholder__url-input-container",children:(0,Zt.jsx)(Yr.Button,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__button",onClick:y,variant:"secondary",children:(0,Kr.__)("Use featured image")})}),ee=()=>{let W=w??(({open:Z})=>(0,Zt.jsx)(Yr.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{Z()},children:(0,Kr.__)("Media Library")})),Y=(0,Zt.jsx)(yu,{addToGallery:u,gallery:d&&N(),multiple:d,onSelect:g,allowedTypes:t,mode:"browse",value:Array.isArray(e)?e.map(({id:Z})=>Z):e.id,render:W});if(R&&a)return(0,Zt.jsxs)(Zt.Fragment,{children:[j(),(0,Zt.jsx)(Yr.FormFileUpload,{onChange:M,accept:O,multiple:!!d,render:({openFileDialog:Z})=>{let oe=(0,Zt.jsxs)(Zt.Fragment,{children:[(0,Zt.jsx)(Yr.Button,{__next40pxDefaultSize:!0,variant:"primary",className:K("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:Z,children:(0,Kr._x)("Upload","verb")}),Y,J(),te(),q()]});return L(oe)}})]});if(R){let Z=(0,Zt.jsxs)(Zt.Fragment,{children:[j(),(0,Zt.jsx)(Yr.FormFileUpload,{render:({openFileDialog:oe})=>(0,Zt.jsx)(Yr.Button,{__next40pxDefaultSize:!0,onClick:oe,variant:"primary",className:K("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),children:(0,Kr._x)("Upload","verb")}),onChange:M,accept:O,multiple:!!d}),Y,J(),te(),q()]});return L(Z)}return L(Y)};return h?(0,Zt.jsx)(Xs,{children:j()}):(0,Zt.jsx)(Xs,{fallback:L(J()),children:ee()})}var Pxe=(0,Yr.withFilters)("editor.MediaPlaceholder")(K$e);var Ixe=c(E(),1),Y$e=({colorSettings:e,...t})=>{let o=e.map(r=>{if(!r)return r;let{value:n,onChange:i,...s}=r;return{...s,colorValue:n,onColorChange:i}});return(0,Ixe.jsx)(oN,{settings:o,gradients:[],disableCustomGradients:!0,...t})},Oxe=Y$e;var Nwe=c(Zz(),1);var Dwe=c(F(),1);var Awe=c(F(),1);var Ewe=c(Zh(),1),Xn=c(F(),1),vf=c(Q(),1),YN=c(fe(),1),Twe=c(Ko(),1),Rwe=c(U(),1),Bwe=c(ue(),1),Pwe=c(Rt(),1),E_=c(G(),1);var Axe=c(G(),1),NN=c(U(),1);var CW=c(G(),1),sy=c(U(),1);var yf=c(E(),1),q$e={placement:"bottom-start"},Z$e=()=>(0,yf.jsxs)(yf.Fragment,{children:[["bold","italic","link","unknown"].map(e=>(0,yf.jsx)(sy.Slot,{name:`RichText.ToolbarControls.${e}`},e)),(0,yf.jsx)(sy.Slot,{name:"RichText.ToolbarControls",children:e=>{if(!e.length)return null;let o=e.map(([{props:r}])=>r).some(({isActive:r})=>r);return(0,yf.jsx)(sy.ToolbarItem,{children:r=>(0,yf.jsx)(sy.DropdownMenu,{icon:cn,label:(0,CW.__)("More"),toggleProps:{...r,className:K(r.className,{"is-pressed":o}),description:(0,CW.__)("Displays more block tools")},controls:Kc(e.map(([{props:n}])=>n),"title"),popoverProps:q$e})})}})]}),EW=Z$e;var ih=c(E(),1);function X$e({popoverAnchor:e}){return(0,ih.jsx)(NN.Popover,{placement:"top",focusOnMount:!1,anchor:e,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar",children:(0,ih.jsx)(Bk,{className:"block-editor-rich-text__inline-format-toolbar-group","aria-label":(0,Axe.__)("Format tools"),children:(0,ih.jsx)(NN.ToolbarGroup,{children:(0,ih.jsx)(EW,{})})})})}var Q$e=({inline:e,editableContentElement:t})=>e?(0,ih.jsx)(X$e,{popoverAnchor:t}):(0,ih.jsx)(No,{group:"inline",children:(0,ih.jsx)(EW,{})}),Lxe=Q$e;var DN=c(F(),1),Mxe=c(Q(),1);function Nxe({html:e,value:t}){let o=(0,DN.useRef)(),r=!!t.activeFormats?.length,{__unstableMarkLastChangeAsPersistent:n}=(0,Mxe.useDispatch)(C);(0,DN.useLayoutEffect)(()=>{if(!o.current){o.current=t.text;return}if(o.current!==t.text){let i=window.setTimeout(()=>{n()},1e3);return o.current=t.text,()=>{window.clearTimeout(i)}}n()},[e,r])}var x_=c(F(),1),cwe=c(fe(),1);var ay=c(Ko(),1),Dxe=c(go(),1);var{subscribeOwnedListener:J$e}=H(ay.privateApis),eKe=["`",'"',"'","\u201C\u201D","\u2018\u2019"],Vxe=e=>t=>{function o(r){let{inputType:n,data:i}=r,{value:s,onChange:a,registry:l}=e.current;if(n!=="insertText"||(0,ay.isCollapsed)(s))return;let u=(0,Dxe.applyFilters)("blockEditor.wrapSelectionSettings",eKe).find(([_,x])=>_===i||x===i);if(!u)return;let[d,f=d]=u,p=s.start,h=s.end+d.length,m=(0,ay.insert)(s,d,p,p);m=(0,ay.insert)(m,f,h,h);let{__unstableMarkLastChangeAsPersistent:g,__unstableMarkAutomaticChange:b}=l.dispatch(C);g(),a(m),b();let v={};for(let _ in r)v[_]=r[_];v.data=f;let{ownerDocument:y}=t,{defaultView:k}=y,S=new k.InputEvent("input",v);window.queueMicrotask(()=>{t.dispatchEvent(S)}),r.preventDefault()}return J$e(t,"beforeinput",o,!0)};var S_=c(Ko(),1),v_=c(ue(),1);var Fxe=c(Ko(),1);function zxe(e){let t="tales of gutenberg",o=" \u{1F421}\u{1F422}\u{1F980}\u{1F424}\u{1F98B}\u{1F418}\u{1F427}\u{1F439}\u{1F981}\u{1F984}\u{1F98D}\u{1F43C}\u{1F43F}\u{1F383}\u{1F434}\u{1F41D}\u{1F406}\u{1F995}\u{1F994}\u{1F331}\u{1F347}\u03C0\u{1F34C}\u{1F409}\u{1F4A7}\u{1F968}\u{1F30C}\u{1F342}\u{1F360}\u{1F966}\u{1F95A}\u{1F95D}\u{1F39F}\u{1F965}\u{1F952}\u{1F6F5}\u{1F956}\u{1F352}\u{1F36F}\u{1F3BE}\u{1F3B2}\u{1F43A}\u{1F41A}\u{1F42E}\u231B\uFE0F",{start:r,text:n}=e;return rt=>{function o(){let{getValue:s,onReplace:a,selectionChange:l,registry:u}=e.current;if(!a)return;let d=s(),{start:f,text:p}=d;if(p.slice(f-1,f)!==" ")return;let m=p.slice(0,f).trim(),g=(0,v_.getBlockTransforms)("from").filter(({type:k})=>k==="prefix"),b=(0,v_.findTransform)(g,({prefix:k})=>m===k);if(!b)return;let v=(0,S_.toHTMLString)({value:(0,S_.insert)(d,hd,0,f)}),y=b.transform(v);return l(...Hxe([y])),a([y]),u.dispatch(C).__unstableMarkAutomaticChange(),!0}function r(s){let{inputType:a,type:l}=s,{getValue:u,onChange:d,__unstableAllowPrefixTransformations:f,formatTypes:p,registry:h,onReplace:m}=e.current;if(a!=="insertText"&&l!=="compositionend"||f&&o())return;let g=u(),b=(0,v_.getBlockTransforms)("from").filter(_=>_.type==="input"),v=(0,v_.findTransform)(b,_=>_.regExp.test(g.text));if(v){m(v.transform()),h.dispatch(C).__unstableMarkAutomaticChange();return}let y=p.reduce((_,{__unstableInputRule:x})=>(x&&(_=x(_)),_),zxe(g)),{__unstableMarkLastChangeAsPersistent:k,__unstableMarkAutomaticChange:S}=h.dispatch(C);y!==g&&(k(),d({...y,activeFormats:g.activeFormats}),S())}let n=jxe(t,"input",r,!0),i=jxe(t,"compositionend",r,!0);return()=>{n(),i()}};var Gxe=c(Ko(),1);var{subscribeOwnedListener:tKe}=H(Gxe.privateApis),Wxe=e=>t=>{function o(r){if(r.inputType!=="insertReplacementText")return;let{registry:n}=e.current;n.dispatch(C).__unstableMarkLastChangeAsPersistent()}return tKe(t,"beforeinput",o)};var VN=c(io(),1),$xe=c(Ko(),1);var{subscribeOwnedListener:oKe}=H($xe.privateApis),Kxe=()=>e=>{function t(o){(VN.isKeyboardEvent.primary(o,"z")||VN.isKeyboardEvent.primary(o,"y")||VN.isKeyboardEvent.primaryShift(o,"z"))&&o.preventDefault()}return oKe(e,"keydown",t,!0)};var Yxe=c(Ko(),1);var{subscribeOwnedListener:rKe}=H(Yxe.privateApis),qxe=e=>t=>{let{keyboardShortcuts:o}=e.current;function r(n){for(let i of o.current)i(n)}return rKe(t,"keydown",r,!0)};var Zxe=c(Ko(),1);var{subscribeOwnedListener:nKe}=H(Zxe.privateApis),Xxe=e=>t=>{let{inputEvents:o}=e.current;function r(n){for(let i of o.current)i(n)}return nKe(t,"input",r)};var FN=c(io(),1),Qxe=c(Ko(),1);var{subscribeOwnedListener:iKe}=H(Qxe.privateApis),Jxe=e=>t=>{function o(r){let{keyCode:n}=r;if(r.defaultPrevented||n!==FN.BACKSPACE&&n!==FN.ESCAPE)return;let{registry:i}=e.current,{didAutomaticChange:s,getSettings:a}=i.select(C),{__experimentalUndo:l}=a();l&&s()&&(r.preventDefault(),l())}return iKe(t,"keydown",o)};var twe=c(ue(),1),hl=c(Ko(),1),owe=c(Fs(),1),rwe=c(fe(),1);var sKe=c(F(),1),aKe=c(ue(),1),lKe=c(E(),1);function ewe(e,t){if(t?.length){let o=e.formats.length;for(;o--;)e.formats[o]=[...t,...e.formats[o]||[]]}}function zN(e){if(!(e!==!0&&e!=="p"&&e!=="li"))return e===!0?"p":e}function k_({allowedFormats:e,disableFormats:t}){return t?k_.EMPTY_ARRAY:e}k_.EMPTY_ARRAY=[];var{subscribeDelegatedListener:cKe}=H(rwe.privateApis),{ownsSelection:uKe}=H(hl.privateApis),nwe=e=>t=>{function o(n){let{disableFormats:i,onChange:s,value:a,formatTypes:l,tagName:u,onReplace:d,__unstableEmbedURLOnPaste:f,preserveWhiteSpace:p,pastePlainText:h,registry:m}=e.current;if(!t.contains(n.target)&&!uKe(t)||n.defaultPrevented)return;let{plainText:g,html:b}=TS(n);if(n.preventDefault(),window.console.log(`Received HTML (RichText):`,b),window.console.log(`Received plain text (RichText):`,g),i){s((0,hl.insert)(a,g));return}let v=n.clipboardData.getData("rich-text")==="true";function y(x){let w=l.reduce((T,{__unstablePasteRule:B})=>(B&&T===a&&(T=B(a,{html:b,plainText:g})),T),a);if(w!==a)s(w);else{let T=(0,hl.create)({html:x});ewe(T,a.activeFormats),s((0,hl.insert)(a,T))}}if(v){y(b);return}if(h){s((0,hl.insert)(a,(0,hl.create)({text:g})));return}let k="INLINE",S=g.trim();f&&(0,hl.isEmpty)(a)&&(0,owe.isURL)(S)&&/^https?:/.test(S)&&(k="BLOCKS");let _=(0,twe.pasteHandler)({HTML:b,plainText:g,mode:k,tagName:u,preserveWhiteSpace:p});if(typeof _=="string"){y(_);return}!_.length||!d||!(0,hl.isEmpty)(a)||(k==="BLOCKS"&&(y(b),m.dispatch(C).__unstableMarkLastChangeAsPersistent()),d(_,_.length-1,-1))}let{defaultView:r}=t.ownerDocument;return cKe(r,"paste",o)};var zE=c(io(),1),__=c(Ko(),1);var{subscribeOwnedListener:dKe}=H(__.privateApis),iwe=e=>t=>{function o(r){let{keyCode:n}=r;if(r.defaultPrevented)return;let{value:i,onMerge:s,onRemove:a}=e.current;if(n===zE.DELETE||n===zE.BACKSPACE){let{start:l,end:u,text:d}=i,f=n===zE.BACKSPACE,p=i.activeFormats&&!!i.activeFormats.length;if(!(0,__.isCollapsed)(i)||p||f&&l!==0||!f&&u!==d.length)return;s?s(!f):a&&(0,__.isEmpty)(i)&&f&&a(!f),r.preventDefault()}}return dKe(t,"keydown",o)};var TW=c(io(),1),ly=c(Ko(),1),swe=c(fe(),1);var{subscribeOwnedListener:fKe,ownsSelection:pKe}=H(ly.privateApis),{subscribeDelegatedListener:mKe}=H(swe.privateApis),awe=e=>t=>{function o(a){if(a.keyCode!==TW.ENTER)return;let{onReplace:l,onSplit:u}=e.current;l&&u&&(a.__deprecatedOnSplit=!0)}function r(a){if(a.defaultPrevented||a.target!==t&&!pKe(t)||a.keyCode!==TW.ENTER)return;let{value:l,onChange:u,disableLineBreaks:d,onSplitAtEnd:f,onSplitAtDoubleLineEnd:p,registry:h}=e.current;a.preventDefault();let{text:m,start:g,end:b}=l;a.shiftKey?d||u((0,ly.insert)(l,` `)):f&&g===b&&b===m.length?f():p&&g===b&&b===m.length&&m.slice(-2)===``?h.batch(()=>{let v={...l};v.start=v.end-2,u((0,ly.remove)(v)),p()}):d||u((0,ly.insert)(l,` `))}let{defaultView:n}=t.ownerDocument,i=mKe(n,"keydown",r),s=fKe(t,"keydown",o,!0);return()=>{i(),s()}};var lwe=e=>t=>{function o(){let{registry:r}=e.current;if(!r.select(C).isMultiSelecting())return;let n=t.parentElement.closest('[contenteditable="true"]');n&&n.focus()}return t.addEventListener("focus",o),()=>{t.removeEventListener("focus",o)}};var hKe=[Vxe,Uxe,Wxe,Kxe,qxe,Xxe,Jxe,nwe,iwe,awe,lwe];function jN(e){let t=(0,x_.useRef)(e);(0,x_.useInsertionEffect)(()=>{t.current=e});let o=(0,x_.useMemo)(()=>hKe.map(r=>r(t)),[t]);return(0,cwe.useRefEffect)(r=>{if(!e.isSelected)return;let n=o.map(i=>i(r));return()=>{n.forEach(i=>i())}},[o,e.isSelected])}var HN=c(Ko(),1),UN=c(F(),1);var uwe=c(E(),1),dwe=c(ce(),1),gKe={},RW=Symbol("usesContext");function bKe({onChange:e,onFocus:t,value:o,forwardedRef:r,settings:n,isVisible:i}){let{name:s,edit:a,[RW]:l}=n,u=(0,UN.useContext)(_n),d=(0,UN.useMemo)(()=>l?Object.fromEntries(Object.entries(u).filter(([g])=>l.includes(g))):gKe,[l,u]);if(!a)return null;let f=(0,HN.getActiveFormat)(o,s),p=f!==void 0,h=(0,HN.getActiveObject)(o),m=h!==void 0&&h.type===s;return(0,uwe.jsx)(a,{isActive:p,isVisible:i,activeAttributes:p?f.attributes||{}:{},isObjectActive:m,activeObjectAttributes:m?h.attributes||{}:{},value:o,onChange:e,onFocus:t,contentRef:r,context:d},s)}function GN({formatTypes:e,...t}){return e.map(o=>(0,dwe.createElement)(bKe,{settings:o,...t,key:o.name}))}var fwe=c(F(),1),pwe=c(ue(),1),mwe=c(Rt(),1);var BW=c(E(),1);function PW(e,t){if(w_.isEmpty(e)){let o=zN(t);return o?`<${o}>`:""}return Array.isArray(e)?((0,mwe.default)("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/"}),pwe.children.toHTML(e)):typeof e=="string"?e:e.toHTMLString()}function jE({value:e,tagName:t,multiline:o,format:r,...n}){return e=(0,BW.jsx)(fwe.RawHTML,{children:PW(e,o)}),t?(0,BW.jsx)(t,{...n,children:e}):e}var vwe=c(F(),1),OW=c(ue(),1),Swe=c(Ko(),1),kwe=c(Rt(),1);var hwe=c(F(),1),gwe=c(Rt(),1),WN=c(Q(),1),bwe=c(io(),1),C_=c(Ko(),1);var IW=c(E(),1);function yKe({children:e,identifier:t,tagName:o="div",value:r="",onChange:n,multiline:i,...s},a){(0,gwe.default)("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/"});let{clientId:l}=ht(),{getSelectionStart:u,getSelectionEnd:d}=(0,WN.useSelect)(C),{selectionChange:f}=(0,WN.useDispatch)(C),p=zN(i);r=r||`<${p}>`;let m=`${r}<${p}>`.split(`<${p}>`);m.shift(),m.pop();function g(b){n(`<${p}>${b.join(`<${p}>`)}`)}return(0,IW.jsx)(o,{ref:a,children:m.map((b,v)=>(0,IW.jsx)($N,{identifier:`${t}-${v}`,tagName:p,value:b,onChange:y=>{let k=m.slice();k[v]=y,g(k)},isSelected:void 0,onKeyDown:y=>{if(y.keyCode!==bwe.ENTER)return;y.preventDefault();let{offset:k}=u(),{offset:S}=d();if(typeof k!="number"||typeof S!="number")return;let _=(0,C_.create)({html:b});_.start=k,_.end=S;let x=(0,C_.split)(_).map(T=>(0,C_.toHTMLString)({value:T})),w=m.slice();w.splice(v,1,...x),g(w),f(l,`${t}-${v+1}`,0,0)},onMerge:y=>{let k=m.slice(),S=0;if(y){if(!k[v+1])return;k.splice(v,2,k[v]+k[v+1]),S=k[v].length-1}else{if(!k[v-1])return;k.splice(v-1,2,k[v-1]+k[v]),S=k[v-1].length-1}g(k),f(l,`${t}-${v-(y?0:1)}`,S,S)},...s},v))})}var ywe=(0,hwe.forwardRef)(yKe);var _we=c(E(),1);function xwe(e){return(0,vwe.forwardRef)((t,o)=>{let r=t.value,n=t.onChange;Array.isArray(r)&&((0,kwe.default)("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/"}),r=OW.children.toHTML(t.value),n=s=>t.onChange(OW.children.fromDOM((0,Swe.__unstableCreateElement)(document,s).childNodes)));let i=t.multiline?ywe:e;return(0,_we.jsx)(i,{...t,value:r,onChange:n,ref:o})})}var KN=c(U(),1),wwe=c(io(),1),AW=c(E(),1);function LW({name:e,shortcutType:t,shortcutCharacter:o,...r}){let n,i="RichText.ToolbarControls";return e&&(i+=`.${e}`),t&&o&&(n=wwe.displayShortcut[t](o)),(0,AW.jsx)(KN.Fill,{name:i,children:(0,AW.jsx)(KN.ToolbarButton,{...r,shortcut:n})})}var da=c(E(),1),{useRichText:vKe,KeyboardShortcutContext:SKe,InputEventContext:kKe,RichTextShortcut:Iwe,RichTextInputEvent:Owe}=H(Twe.privateApis),Cwe=Symbol("instanceId");function $N({children:e,tagName:t="div",value:o="",onChange:r,isSelected:n,multiline:i,inlineToolbar:s,wrapperClassName:a,autocompleters:l,onReplace:u,placeholder:d,allowedFormats:f,withoutInteractiveFormatting:p,onRemove:h,onMerge:m,onSplit:g,__unstableOnSplitAtEnd:b,__unstableOnSplitAtDoubleLineEnd:v,identifier:y,preserveWhiteSpace:k,__unstablePastePlainText:S,__unstableEmbedURLOnPaste:_,__unstableDisableFormats:x,disableLineBreaks:w,__unstableAllowPrefixTransformations:T,readOnly:B,...R},I){g&&(0,Pwe.default)("wp.blockEditor.RichText onSplit prop",{since:"6.4",alternative:'block.json support key: "splitting"'});let A=(0,YN.useInstanceId)($N),P=(0,Xn.useRef)(),[O,N]=(0,Xn.useState)(null),z=ht(),{clientId:V,isSelected:M,name:D}=z,L=z[zy],j=z[Fy]==="default",q=(0,Xn.useContext)(_n),J=(0,vf.useRegistry)(),te=de=>{if(!M)return{isSelected:!1};let{getSelectionStart:Me,getSelectionEnd:Ze}=de(C),ze=Me(),Je=Ze(),lt;return n===void 0?lt=ze.clientId===V&&Je.clientId===V&&(y?ze.attributeKey===y:ze[Cwe]===A):n&&(lt=ze.clientId===V),{selectionStart:lt?ze.offset:void 0,selectionEnd:lt?Je.offset:void 0,isSelected:lt}},{selectionStart:ee,selectionEnd:$,isSelected:W}=(0,vf.useSelect)(te,[V,y,A,n,M]),{disableBoundBlock:Y,bindingsPlaceholder:Z,bindingsLabel:oe}=(0,vf.useSelect)(de=>{if(!L?.[y])return{};let{__experimentalBlockBindingsSupportedAttributes:Me}=de(C).getSettings();if(!Me?.[D])return{};let ze=L[y],Je=(0,Bwe.getBlockBindingsSource)(ze.source),lt={};if(Je?.usesContext?.length)for(let vr of Je.usesContext)lt[vr]=q[vr];let ct=!Je?.canUserEditValue?.({select:de,context:lt,args:ze.args});if(o.length>0)return{disableBoundBlock:ct,bindingsPlaceholder:null,bindingsLabel:null};let{getBlockAttributes:yr}=de(C),Ao=yr(V),rr=null;Je?.getFieldsList&&(rr=Je.getFieldsList({select:de,context:lt})?.find(an=>(0,Ewe.default)(an.args,ze?.args))?.label);let ho=rr??Je?.label,Go=ct?ho:(0,E_.sprintf)((0,E_.__)("Add %s"),ho),Vn=ct?ze?.args?.key||Je?.label:(0,E_.sprintf)((0,E_.__)("Empty %s; start writing to edit its value"),ze?.args?.key||Je?.label);return{disableBoundBlock:ct,bindingsPlaceholder:Ao?.placeholder||Go,bindingsLabel:Vn}},[L,y,D,o,V,q]),ne=!!q?.["pattern/overrides"],X=L?.__default?.source==="core/pattern-overrides",ae=B||Y||ne&&!X,ve=(0,vf.useSelect)(de=>{if(ae||!j||!M)return!1;let{getSelectedBlockClientId:Me,canHostEditableRoot:Ze}=H(de(C));return Ze(Me())},[ae,j,M]),{getSelectionStart:xe,getSelectionEnd:ge,getBlockRootClientId:be}=(0,vf.useSelect)(C),{selectionChange:he}=(0,vf.useDispatch)(C),ke=k_({allowedFormats:f,disableFormats:x}),_e=!ke||ke.length>0,we=(0,Xn.useCallback)((de,Me)=>{let Ze={},ze=de===void 0&&Me===void 0,Je={clientId:V,[y?"attributeKey":Cwe]:y||A};if(typeof de=="number"||ze){if(Me===void 0&&be(V)!==be(ge().clientId))return;Ze.start={...Je,offset:de}}if(typeof Me=="number"||ze){if(de===void 0&&be(V)!==be(xe().clientId))return;Ze.end={...Je,offset:Me}}he(Ze)},[V,be,ge,xe,y,A,he]),{value:Re,getValue:se,onChange:ie,ref:Ae,formatTypes:ye}=vKe({value:o,onChange:r,selectionStart:ee,selectionEnd:$,onSelectionChange:we,placeholder:Z||d,__unstableIsSelected:W,__unstableDisableFormats:x,preserveWhiteSpace:k,__unstableDependencies:[t],allowedFormats:ke,withoutInteractiveFormatting:p,__unstableFormatTypeHandlerContext:(0,Xn.useMemo)(()=>({richTextIdentifier:y,blockClientId:V}),[y,V])}),Ee=GX({onReplace:u,completers:l,record:Re,onChange:ie}),{"aria-autocomplete":qe,"aria-haspopup":pt,"aria-controls":at,"aria-owns":Ct,"aria-activedescendant":rt}=Ee;(0,Xn.useEffect)(()=>{if(!W)return;let de=P.current?.parentElement?.closest('[contenteditable="true"]');if(!de)return;let Me={"aria-autocomplete":qe,"aria-haspopup":pt,"aria-controls":at,"aria-owns":Ct,"aria-activedescendant":rt};for(let[Ze,ze]of Object.entries(Me))ze===void 0?de.removeAttribute(Ze):de.setAttribute(Ze,ze);return()=>{for(let Ze of Object.keys(Me))de.removeAttribute(Ze)}},[W,qe,pt,at,Ct,rt]),Nxe({html:o,value:Re});let Ot=(0,Xn.useRef)(new Set),ut=(0,Xn.useRef)(new Set);function Gt(){P.current?.focus()}let So=R.tabIndex;ve?So=R.tabIndex??0:!ae&&R.tabIndex===0&&(So=null);let mo=t;return(0,da.jsxs)(da.Fragment,{children:[W&&(0,da.jsx)(SKe.Provider,{value:Ot,children:(0,da.jsx)(kKe.Provider,{value:ut,children:(0,da.jsxs)(Rwe.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after",children:[e&&e({value:Re,onChange:ie,onFocus:Gt}),(0,da.jsx)(GN,{value:Re,onChange:ie,onFocus:Gt,formatTypes:ye,forwardedRef:P})]})})}),W&&_e&&(0,da.jsx)(Lxe,{inline:s,editableContentElement:O}),(0,da.jsx)(mo,{role:"textbox","aria-multiline":!w,"aria-readonly":ae,...R,draggable:void 0,"aria-label":oe||R["aria-label"]||d,...Ee,ref:(0,YN.useMergeRefs)([Ae,I,Ee.ref,R.ref,jN({registry:J,getValue:se,onChange:ie,__unstableAllowPrefixTransformations:T,formatTypes:ye,onReplace:u,selectionChange:he,isSelected:W,disableFormats:x,value:Re,tagName:t,onSplit:g,__unstableEmbedURLOnPaste:_,pastePlainText:S,onMerge:m,onRemove:h,disableLineBreaks:w,onSplitAtEnd:b,onSplitAtDoubleLineEnd:v,keyboardShortcuts:Ot,inputEvents:ut}),P,N]),contentEditable:!ae,suppressContentEditableWarning:!0,className:K("block-editor-rich-text__editable",R.className,"rich-text"),tabIndex:So,"data-wp-block-attribute-key":y})]})}var HE=xwe((0,Xn.forwardRef)($N));HE.Content=jE;HE.isEmpty=e=>!e||e.length===0;var MW=(0,Xn.forwardRef)((e,t)=>{if(ht()[tT]){let{children:n,tagName:i="div",value:s,onChange:a,isSelected:l,multiline:u,inlineToolbar:d,wrapperClassName:f,autocompleters:p,onReplace:h,placeholder:m,allowedFormats:g,withoutInteractiveFormatting:b,onRemove:v,onMerge:y,onSplit:k,__unstableOnSplitAtEnd:S,__unstableOnSplitAtDoubleLineEnd:_,identifier:x,preserveWhiteSpace:w,__unstablePastePlainText:T,__unstableEmbedURLOnPaste:B,__unstableDisableFormats:R,disableLineBreaks:I,__unstableAllowPrefixTransformations:A,readOnly:P,...O}=e;return(0,da.jsx)(i,{ref:t,...O,dangerouslySetInnerHTML:{__html:PW(s,u)||"
"}})}return(0,da.jsx)(HE,{ref:t,...e,readOnly:!1})});MW.Content=jE;MW.isEmpty=e=>!e||e.length===0;var w_=MW;var NW=c(E(),1),Lwe=(0,Awe.forwardRef)((e,t)=>(0,NW.jsx)(w_,{ref:t,...e,__unstableDisableFormats:!0}));Lwe.Content=function({value:t="",tagName:o="div",...r}){return(0,NW.jsx)(o,{...r,children:t})};var Mwe=Lwe;var DW=c(E(),1),_Ke=(0,Dwe.forwardRef)(({__experimentalVersion:e,...t},o)=>{if(e===2)return(0,DW.jsx)(Mwe,{ref:o,...t});let{className:r,onChange:n,...i}=t;return(0,DW.jsx)(Nwe.default,{ref:o,className:K("block-editor-plain-text",r),onChange:s=>n(s.target.value),...i})}),Vwe=_Ke;var Au=c(G(),1),zwe=c(F(),1),jwe=c(U(),1);var Fwe=c(fe(),1);var qN=c(G(),1),sh=c(E(),1);function ZN({property:e,viewport:t,desc:o}){let r=(0,Fwe.useInstanceId)(ZN),n=o||(0,qN.sprintf)((0,qN._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,sh.jsxs)(sh.Fragment,{children:[(0,sh.jsx)("span",{"aria-describedby":`rbc-desc-${r}`,children:t.label}),(0,sh.jsx)(bt,{id:`rbc-desc-${r}`,render:(0,sh.jsx)("span",{}),children:n})]})}var Lu=c(E(),1);function xKe(e){let{title:t,property:o,toggleLabel:r,onIsResponsiveChange:n,renderDefaultControl:i,renderResponsiveControls:s,isResponsive:a=!1,defaultLabel:l={id:"all",label:(0,Au._x)("All","screen sizes")},viewports:u=[{id:"small",label:(0,Au.__)("Small screens")},{id:"medium",label:(0,Au.__)("Medium screens")},{id:"large",label:(0,Au.__)("Large screens")}]}=e;if(!t||!o||!i)return null;let d=r||(0,Au.sprintf)((0,Au.__)("Use the same %s on all screen sizes."),o),f=(0,Au.__)("Choose whether to use the same value for all screen sizes or a unique value for each screen size."),p=i((0,Lu.jsx)(ZN,{property:o,viewport:l}),l),h=()=>u.map(m=>(0,Lu.jsx)(zwe.Fragment,{children:i((0,Lu.jsx)(ZN,{property:o,viewport:m}),m)},m.id));return(0,Lu.jsxs)("fieldset",{className:"block-editor-responsive-block-control",children:[(0,Lu.jsx)("legend",{className:"block-editor-responsive-block-control__title",children:t}),(0,Lu.jsxs)("div",{className:"block-editor-responsive-block-control__inner",children:[(0,Lu.jsx)(jwe.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:d,checked:!a,onChange:n,help:f}),(0,Lu.jsxs)("div",{className:K("block-editor-responsive-block-control__group",{"is-responsive":a}),children:[!a&&p,a&&(s?s(u):h())]})]})]})}var Hwe=xKe;var XN=c(U(),1);var Uwe=c(E(),1);function Gwe({units:e,...t}){let[o]=Le("spacing.units"),r=(0,XN.__experimentalUseCustomUnits)({availableUnits:o||["%","px","em","rem","vw"],units:e});return(0,Uwe.jsx)(XN.__experimentalUnitControl,{units:r,...t})}var UE=c(G(),1),Wwe=c(F(),1),T_=c(U(),1);var Mu=c(E(),1);function wKe({url:e,onChange:t}){let[o,r]=(0,Wwe.useReducer)(i=>!i,!1),n=i=>{i.preventDefault(),r()};return(0,Mu.jsxs)("div",{className:"block-editor-url-input__button",children:[(0,Mu.jsx)(T_.Button,{size:"compact",icon:ss,label:e?(0,UE.__)("Edit link"):(0,UE.__)("Insert link"),onClick:r,className:"components-toolbar__control",isPressed:!!e}),o&&(0,Mu.jsx)("form",{className:"block-editor-url-input__button-modal",onSubmit:n,children:(0,Mu.jsxs)("div",{className:"block-editor-url-input__button-modal-line",children:[(0,Mu.jsx)(T_.Button,{__next40pxDefaultSize:!0,className:"block-editor-url-input__back",icon:Vx,label:(0,UE.__)("Close"),onClick:r}),(0,Mu.jsx)(Qm,{value:e||"",onChange:t,suffix:(0,Mu.jsx)(T_.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,Mu.jsx)(T_.Button,{size:"small",icon:sd,label:(0,UE.__)("Submit"),type:"submit"})})})]})})]})}var $we=wKe;var Ts=c(G(),1),gl=c(F(),1),Xwe=c(Tt(),1),hn=c(U(),1);var Qwe=c(Fs(),1);var Bo=c(E(),1),VW="none",Kwe="custom",Ywe="media",qwe="attachment",Zwe=["noopener"],Jwe=({linkDestination:e,onChangeUrl:t,url:o,mediaType:r="image",mediaUrl:n,mediaLink:i,linkTarget:s,linkClass:a,rel:l,showLightboxSetting:u,lightboxEnabled:d,onSetLightbox:f,resetLightbox:p})=>{let[h,m]=(0,gl.useState)(!1),[g,b]=(0,gl.useState)(null),v=()=>{m(!0)},[y,k]=(0,gl.useState)(!1),[S,_]=(0,gl.useState)(null),x=(0,gl.useRef)(null),w=(0,gl.useRef)();(0,gl.useEffect)(()=>{if(!w.current)return;(Xwe.focus.focusable.find(w.current)[0]||w.current).focus()},[y,o,d]);let T=()=>{(e===Ywe||e===qwe)&&_(""),k(!0)},B=()=>{k(!1)},R=()=>{_(null),B(),m(!1)},I=$=>{let W=$?"_blank":void 0,Y;if(W){let Z=(l??"").split(" ");Zwe.forEach(oe=>{Z.includes(oe)||Z.push(oe)}),Y=Z.join(" ")}else{let Z=(l??"").split(" ").filter(oe=>Zwe.includes(oe)===!1);Y=Z.length?Z.join(" "):void 0}return{linkTarget:W,rel:Y}},A=()=>$=>{let W=x.current;W&&W.contains($.target)||(m(!1),_(null),B())},P=()=>$=>{if(S){let W=N().find(Y=>Y.url===S)?.linkDestination||Kwe;t({href:(0,Qwe.prependHTTPS)(S),linkDestination:W,lightbox:{enabled:!1}})}B(),_(null),$.preventDefault()},O=()=>{t({linkDestination:VW,href:""})},N=()=>{let $=[{linkDestination:Ywe,title:(0,Ts.__)("Link to image file"),url:r==="image"?n:void 0,icon:$x}];return r==="image"&&i&&$.push({linkDestination:qwe,title:(0,Ts.__)("Link to attachment page"),url:r==="image"?i:void 0,icon:lg}),$},z=$=>{let W=N(),Y;$?Y=(W.find(Z=>Z.url===$)||{linkDestination:Kwe}).linkDestination:Y=VW,t({linkDestination:Y,href:$})},V=$=>{let W=I($);t(W)},M=$=>{t({rel:$})},D=$=>{t({linkClass:$})},L=(0,Bo.jsxs)(hn.__experimentalVStack,{spacing:"3",children:[(0,Bo.jsx)(hn.ToggleControl,{label:(0,Ts.__)("Open in new tab"),onChange:V,checked:s==="_blank"}),(0,Bo.jsx)(hn.TextControl,{label:(0,Ts.__)("Link relation"),value:l??"",onChange:M,help:(0,gl.createInterpolateElement)((0,Ts.__)("The Link Relation attribute defines the relationship between a linked resource and the current document."),{a:(0,Bo.jsx)(hn.ExternalLink,{href:"https://developer.mozilla.org/docs/Web/HTML/Attributes/rel"})})}),(0,Bo.jsx)(hn.TextControl,{label:(0,Ts.__)("Link CSS class"),value:a||"",onChange:D})]}),j=S!==null?S:o,q=!d||d&&!u,J=!j&&q,te=(N().find($=>$.linkDestination===e)||{}).title,ee=()=>{if(d&&u&&!o&&!y)return(0,Bo.jsxs)("div",{className:"block-editor-url-popover__expand-on-click",children:[(0,Bo.jsx)(gt,{icon:rR}),(0,Bo.jsxs)("div",{className:"text",children:[(0,Bo.jsx)("p",{children:(0,Ts.__)("Enlarge on click")}),(0,Bo.jsx)("p",{className:"description",children:(0,Ts.__)("Scales the image with a lightbox effect")})]}),(0,Bo.jsx)(hn.Button,{icon:is,label:(0,Ts.__)("Disable enlarge on click"),onClick:()=>{f?.(!1)},size:"compact"})]});if(!o||y)return(0,Bo.jsx)(rh.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:j,onChangeInputValue:_,onSubmit:P(),autocompleteRef:x});if(o&&!y)return(0,Bo.jsxs)(Bo.Fragment,{children:[(0,Bo.jsx)(rh.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:o,onEditLinkClick:T,urlLabel:te}),(0,Bo.jsx)(hn.Button,{icon:is,label:(0,Ts.__)("Remove link"),onClick:()=>{O(),p?.()},size:"compact"})]})};return(0,Bo.jsxs)(Bo.Fragment,{children:[(0,Bo.jsx)(hn.ToolbarButton,{icon:ss,className:"components-toolbar__control",label:(0,Ts.__)("Link"),"aria-expanded":h,onClick:v,ref:b,isActive:!!o||d&&u}),h&&(0,Bo.jsx)(rh,{ref:w,anchor:g,onFocusOutside:A(),onClose:R,renderSettings:q?()=>L:null,additionalControls:J&&(0,Bo.jsxs)(hn.NavigableMenu,{children:[N().map($=>(0,Bo.jsx)(hn.MenuItem,{icon:$.icon,iconPosition:"left",onClick:()=>{_(null),z($.url),B()},children:$.title},$.linkDestination)),u&&(0,Bo.jsx)(hn.MenuItem,{className:"block-editor-url-popover__expand-on-click",icon:rR,info:(0,Ts.__)("Scale the image with a lightbox effect."),iconPosition:"left",onClick:()=>{_(null),t({linkDestination:VW,href:""}),f?.(!0),B()},children:(0,Ts.__)("Enlarge on click")},"expand-on-click")]}),offset:13,children:ee()})]})};var B_=c(U(),1),p0e=c(F(),1),eD=c(G(),1);var e0e=c(F(),1),zW=c(G(),1);var FW=[],CKe=new Intl.Collator("und",{numeric:!0}).compare;function QN(){let[e,t,o,r]=Le("spacing.spacingSizes.custom","spacing.spacingSizes.theme","spacing.spacingSizes.default","spacing.defaultSpacingSizes"),n=e??FW,i=t??FW,s=o&&r!==!1?o:FW;return(0,e0e.useMemo)(()=>{let a=[{name:(0,zW.__)("None"),slug:"0",size:0},...n,...i,...s];return a.every(({slug:l})=>/^[0-9]/.test(l))&&a.sort((l,u)=>CKe(l.slug,u.slug)),a.length>$X?[{name:(0,zW.__)("Default"),slug:"default",size:void 0},...a]:a},[n,i,s])}var t0e=c(F(),1),o0e=c(Q(),1),JN=c(G(),1),r0e=c(U(),1);var n0e=c(E(),1),EKe={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 R_({icon:e,isMixed:t=!1,minimumCustomValue:o,onChange:r,onMouseOut:n,onMouseOver:i,showSideInLabel:s=!0,side:a,spacingSizes:l,type:u,value:d,...f}){let p=(0,o0e.useSelect)(S=>S(C).getSettings()?.disableCustomSpacingSizes),[h]=Le("spacing.units"),m=(0,r0e.__experimentalUseCustomUnits)({availableUnits:h||["px","em","rem"]}),g=(0,t0e.useMemo)(()=>l?.map(S=>({name:S.name,slug:S.slug,size:S.size}))||[],[l]),b=(wp.includes(a)||["vertical","horizontal"].includes(a))&&s?qc[a]:"",v=s?u?.toLowerCase():u,y=(0,JN.sprintf)((0,JN._x)("%1$s %2$s","spacing"),b,v).trim(),k=m[0]?.value||"px";return(0,n0e.jsx)(Wb,{allowNegativeOnDrag:o<0,ariaLabel:y,className:"spacing-sizes-control",customValueSettings:EKe,disableCustomValues:p,icon:e,isMixed:t,minimumCustomValue:o,onChange:r,onMouseOut:n,onMouseOver:i,presets:g,presetType:"spacing",selectedUnit:k,units:m,value:d,...f})}var GE=c(E(),1),i0e=["vertical","horizontal"];function s0e({minimumCustomValue:e,onChange:t,onMouseOut:o,onMouseOver:r,sides:n,spacingSizes:i,type:s,values:a}){let l=d=>f=>{if(!t)return;let p={...Object.keys(a).reduce((h,m)=>(h[m]=kv(a[m],i),h),{})};d==="vertical"&&(p.top=f,p.bottom=f),d==="horizontal"&&(p.left=f,p.right=f),t(p)},u=n?.length?i0e.filter(d=>Oz(n,d)):i0e;return(0,GE.jsx)(GE.Fragment,{children:u.map(d=>{let f=d==="vertical"?a.top:a.left;return(0,GE.jsx)(R_,{icon:sP[d],label:qc[d],minimumCustomValue:e,onChange:l(d),onMouseOut:o,onMouseOver:r,side:d,spacingSizes:i,type:s,value:f,withInputField:!1},`spacing-sizes-control-${d}`)})})}var WE=c(E(),1);function a0e({minimumCustomValue:e,onChange:t,onMouseOut:o,onMouseOver:r,sides:n,spacingSizes:i,type:s,values:a}){let l=n?.length?wp.filter(d=>n.includes(d)):wp,u=d=>f=>{let p={...Object.keys(a).reduce((h,m)=>(h[m]=kv(a[m],i),h),{})};p[d]=f,t(p)};return(0,WE.jsx)(WE.Fragment,{children:l.map(d=>(0,WE.jsx)(R_,{icon:sP[d],label:qc[d],minimumCustomValue:e,onChange:u(d),onMouseOut:o,onMouseOver:r,side:d,spacingSizes:i,type:s,value:a[d],withInputField:!1},`spacing-sizes-control-${d}`))})}var l0e=c(E(),1);function c0e({minimumCustomValue:e,onChange:t,onMouseOut:o,onMouseOver:r,showSideInLabel:n,side:i,spacingSizes:s,type:a,values:l}){let u=d=>f=>{let p={...Object.keys(l).reduce((h,m)=>(h[m]=kv(l[m],s),h),{})};p[d]=f,t(p)};return(0,l0e.jsx)(R_,{label:qc[i],minimumCustomValue:e,onChange:u(i),onMouseOut:o,onMouseOver:r,showSideInLabel:n,side:i,spacingSizes:s,type:a,value:l[i],withInputField:!1})}var u0e=c(U(),1);var jW=c(G(),1),d0e=c(E(),1);function f0e({isLinked:e,...t}){let o=e?(0,jW.__)("Unlink sides"):(0,jW.__)("Link sides");return(0,d0e.jsx)(u0e.Button,{...t,size:"small",icon:e?ss:is,iconSize:24,label:o})}var Nu=c(E(),1);function P_({inputProps:e,label:t,minimumCustomValue:o=0,onChange:r,onMouseOut:n,onMouseOver:i,showSideInLabel:s=!0,sides:a=wp,useSelect:l,values:u}){let d=QN(),f=u||KX,p=a?.length===1,h=a?.includes("horizontal")&&a?.includes("vertical")&&a?.length===2,[m,g]=(0,p0e.useState)(qX(f,a)),b=()=>{g(m===bd.axial?bd.custom:bd.axial)},y={...e,minimumCustomValue:o,onChange:x=>{let w={...u,...x};r(w)},onMouseOut:n,onMouseOver:i,sides:a,spacingSizes:d,type:t,useSelect:l,values:f},k=()=>m===bd.axial?(0,Nu.jsx)(s0e,{...y}):m===bd.custom?(0,Nu.jsx)(a0e,{...y}):(0,Nu.jsx)(c0e,{side:m,...y,showSideInLabel:s}),S=wp.includes(m)&&s?qc[m]:"",_=(0,eD.sprintf)((0,eD._x)("%1$s %2$s","spacing"),t,S).trim();return(0,Nu.jsxs)("fieldset",{className:"spacing-sizes-control",children:[(0,Nu.jsxs)(B_.__experimentalHStack,{className:"spacing-sizes-control__header",children:[(0,Nu.jsx)(B_.BaseControl.VisualLabel,{as:"legend",className:"spacing-sizes-control__label",children:_}),!p&&!h&&(0,Nu.jsx)(f0e,{label:t,onClick:b,isLinked:m===bd.axial})]}),(0,Nu.jsx)(B_.__experimentalVStack,{spacing:.5,children:k()})]})}var m0e=c(Rt(),1);function h0e(){return(0,m0e.default)("wp.blockEditor.PreviewOptions",{version:"6.5"}),null}var g0e=c(Rt(),1);function b0e(){(0,g0e.default)("wp.blockEditor.useResizeCanvas",{since:"7.1",hint:"Device preview is now handled by the editor canvas. This hook no longer does anything."})}var qi=c(G(),1),Z_=c(ue(),1),X_=c(U(),1),g1=c(Q(),1),QEe=c(F(),1);var I_=c(U(),1),tD=c(G(),1),oD=c(Q(),1),rD=c(ue(),1);var cy=c(E(),1);function TKe({block:e,onNavigateToEntityRecord:t,isSyncedPattern:o,isTemplatePartBlock:r}){let n=e?.attributes||{};return(0,cy.jsx)(I_.__experimentalVStack,{className:"block-editor-block-inspector-edit-contents",expanded:!0,children:(0,cy.jsx)(I_.Button,{className:"block-editor-block-inspector-edit-contents__button",__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{if(o)t({postId:n.ref,postType:"wp_block"});else if(r){let{theme:s,slug:a}=n,l=s&&a?`${s}//${a}`:null;l&&t({postId:l,postType:"wp_template_part"})}},children:(0,tD.__)("Edit original")})})}function RKe({clientId:e,editedContentOnlySection:t,editContentOnlySection:o,stopEditingContentOnlySection:r}){let{selectBlock:n}=(0,oD.useDispatch)(C);return(0,cy.jsx)(I_.__experimentalVStack,{className:"block-editor-block-inspector-edit-contents",expanded:!0,children:(0,cy.jsx)(I_.Button,{className:"block-editor-block-inspector-edit-contents__button",__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{t?(r(),n(e)):(o(e),n(e))},children:t?(0,tD.__)("Exit pattern"):(0,tD.__)("Edit pattern")})})}function y0e({clientId:e}){let{isWithinSection:t,isWithinEditedSection:o,editedContentOnlySection:r,editContentOnlySection:n,stopEditingContentOnlySection:i}=ZL(e),{block:s,onNavigateToEntityRecord:a,canEdit:l}=(0,oD.useSelect)(p=>{let{getBlock:h,getSettings:m,canEditBlock:g}=p(C);return{block:h(e),onNavigateToEntityRecord:m().onNavigateToEntityRecord,canEdit:g(e)}},[e]);if(!l||!t&&!o)return null;let u=(0,rD.isReusableBlock)(s),d=(0,rD.isTemplatePart)(s);return(u||d)&&a?(0,cy.jsx)(TKe,{block:s,onNavigateToEntityRecord:a,isSyncedPattern:u,isTemplatePartBlock:d}):(0,cy.jsx)(RKe,{clientId:e,editedContentOnlySection:r,editContentOnlySection:n,stopEditingContentOnlySection:i})}var v0e=c(Q(),1),S0e=c(G(),1),k0e=c(U(),1),_0e=c(F(),1);var x0e=c(E(),1);function nD(){let e=(0,v0e.useSelect)(r=>r(C).getBlockSelectionStart(),[]),t=(0,_0e.useRef)();return _g(e,t),e?(0,x0e.jsx)(k0e.Button,{__next40pxDefaultSize:!0,variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{t.current?.focus()},children:(0,S0e.__)("Skip to the selected block")}):null}var iD=c(G(),1),w0e=c(Q(),1);var C0e=c(U(),1);var $E=c(E(),1);function HW(){let e=(0,w0e.useSelect)(t=>t(C).getSelectedBlockCount(),[]);return(0,$E.jsxs)(C0e.__experimentalHStack,{justify:"flex-start",spacing:2,className:"block-editor-multi-selection-inspector__card",children:[(0,$E.jsx)(Et,{icon:tg,showColors:!0}),(0,$E.jsx)("div",{className:"block-editor-multi-selection-inspector__card-title",children:(0,iD.sprintf)((0,iD._n)("%d Block","%d Blocks",e),e)})]})}var E0e=c(U(),1),BKe=Symbol("BlockInspectorPreTabs"),{Fill:Fqt,Slot:T0e}=(0,E0e.createSlotFill)(BKe);var pV=c(U(),1),Bc=c(F(),1),jEe=c(dv(),1),q_=c(Q(),1);var KE=c(G(),1),sD={name:"settings",title:(0,KE.__)("Settings"),value:"settings",icon:a3},aD={name:"styles",title:(0,KE.__)("Styles"),value:"styles",icon:g6},lD={name:"content",title:(0,KE.__)("Content"),value:"content",icon:lg},Sf={name:"list",title:(0,KE.__)("List View"),value:"list-view",icon:Qx};var UW=c(U(),1);var YE=c(U(),1),R0e=c(G(),1);var qE=c(E(),1),PKe=({initialOpen:e=!1})=>{let t=(0,YE.__experimentalUseSlotFills)(Cm.slotName),o=(0,YE.__experimentalUseSlotFills)(YC.name),r=!!(t&&t.length),n=!!(o&&o.length);return!r&&!n?null:(0,qE.jsxs)(YE.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,R0e.__)("Advanced"),initialOpen:e,children:[(0,qE.jsx)(Oe.Slot,{group:"advanced"}),(0,qE.jsx)(YC.Slot,{})]})},cD=PKe;var kf=c(E(),1),IKe=({showAdvancedControls:e=!1})=>{let t=(0,UW.__experimentalUseSlotFills)(dc.default.name),o=(0,UW.__experimentalUseSlotFills)(dc.bindings.name),r=!!t?.length||!!o?.length;return(0,kf.jsxs)(kf.Fragment,{children:[(0,kf.jsx)(Oe.Slot,{}),(0,kf.jsx)(Oe.Slot,{group:"bindings"}),e&&(0,kf.jsx)("div",{children:(0,kf.jsx)(cD,{initialOpen:!r})})]})},B0e=IKe;var dh=c(G(),1),cV=c(Q(),1),I$=c(F(),1);var O_=c(U(),1),uD=c(Q(),1),GW=c(G(),1);var ZE=c(E(),1),OKe=()=>{let{selectedClientIds:e,selectedBlocks:t,hasPositionAttribute:o}=(0,uD.useSelect)(s=>{let{getBlocksByClientId:a,getSelectedBlockClientIds:l}=s(C),u=l(),d=a(u);return{selectedClientIds:u,selectedBlocks:d,hasPositionAttribute:d?.some(({attributes:f})=>!!f?.style?.position?.type)}},[]),{updateBlockAttributes:r}=(0,uD.useDispatch)(C),n=xr();function i(){if(!e?.length||!t?.length)return;let s=Object.fromEntries(t?.map(({clientId:a,attributes:l})=>[a,{style:Ge({...l?.style,position:{...l?.style?.position,type:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0}})}]));r(e,s,!0)}return(0,ZE.jsx)(O_.__experimentalToolsPanel,{className:"block-editor-block-inspector__position",label:(0,GW.__)("Position"),resetAll:i,dropdownMenuProps:n,children:(0,ZE.jsx)(O_.__experimentalToolsPanelItem,{isShownByDefault:o,label:(0,GW.__)("Position"),hasValue:()=>o,onDeselect:i,children:(0,ZE.jsx)(Oe.Slot,{group:"position"})})})},AKe=()=>{let e=(0,O_.__experimentalUseSlotFills)(dc.position.name);return!(e&&e.length)?null:(0,ZE.jsx)(OKe,{})},dD=AKe;var u1=c(ue(),1),d$=c(U(),1),$D=c(F(),1),ZCe=c(go(),1),XCe=c(Q(),1),WD=c(G(),1);var a$={};Or(a$,{AdvancedPanel:()=>ND,BackgroundPanel:()=>zD,BorderPanel:()=>ID,ColorPanel:()=>yD,DimensionsPanel:()=>TD,FiltersPanel:()=>AD,ImageSettingsPanel:()=>ICe,StateControl:()=>jD,StateControlBadges:()=>HD,TypographyPanel:()=>SD,useHasBackgroundPanel:()=>FD,useHasBorderPanel:()=>PD,useHasBorderPanelControls:()=>e1,useHasColorPanel:()=>bD,useHasDimensionsPanel:()=>ED,useHasFiltersPanel:()=>RCe,useHasImageSettingsPanel:()=>PCe,useHasTypographyPanel:()=>vD,useSettingsForBlockElement:()=>fD});var XE=c(F(),1),P0e=c(Q(),1),WW=c(ue(),1),uy=c(G(),1);function fD(e,t,o){let{supportedStyles:r,supports:n}=(0,P0e.useSelect)(i=>({supportedStyles:H(i(WW.store)).getSupportedStyles(t,o),supports:i(WW.store).getBlockType(t)?.supports}),[t,o]);return(0,XE.useMemo)(()=>{let i={...e};return r.includes("fontSize")||(i.typography={...i.typography,fontSizes:{},customFontSize:!1,defaultFontSizes:!1}),r.includes("fontFamily")||(i.typography={...i.typography,fontFamilies:{}}),i.color={...i.color,text:i.color?.text&&r.includes("color"),background:i.color?.background&&(r.includes("background")||r.includes("backgroundColor")),button:i.color?.button&&r.includes("buttonColor"),heading:i.color?.heading&&r.includes("headingColor"),link:i.color?.link&&r.includes("linkColor"),caption:i.color?.caption&&r.includes("captionColor")},!r.includes("background")&&!r.includes("backgroundGradient")&&(i.color.gradients=[],i.color.customGradient=!1),r.includes("filter")||(i.color.defaultDuotone=!1,i.color.customDuotone=!1),["lineHeight","fontStyle","fontWeight","letterSpacing","textAlign","textTransform","textDecoration","textIndent","writingMode"].forEach(s=>{r.includes(s)||(i.typography={...i.typography,[s]:!1})}),r.includes("textIndent")&&(i.typography={...i.typography,textIndent:i.typography?.textIndent??"subsequent"}),r.includes("columnCount")||(i.typography={...i.typography,textColumns:!1}),["contentSize","wideSize"].forEach(s=>{r.includes(s)||(i.layout={...i.layout,[s]:!1})}),["padding","margin","blockGap"].forEach(s=>{r.includes(s)||(i.spacing={...i.spacing,[s]:!1});let a=Array.isArray(n?.spacing?.[s])?n?.spacing?.[s]:n?.spacing?.[s]?.sides;a?.length&&i.spacing?.[s]&&(i.spacing={...i.spacing,[s]:{...i.spacing?.[s],sides:a}})}),["aspectRatio","height","minHeight","minWidth","width"].forEach(s=>{r.includes(s)||(i.dimensions={...i.dimensions,[s]:!1})}),["radius","color","style","width"].forEach(s=>{r.includes("border"+s.charAt(0).toUpperCase()+s.slice(1))||(i.border={...i.border,[s]:!1})}),[["backgroundImage","backgroundImage"],["backgroundSize","backgroundSize"],["backgroundGradient","gradient"]].forEach(([s,a])=>{r.includes(s)||(i.background={...i.background,[a]:!1})}),i.shadow=r.includes("shadow")?i.shadow:!1,i},[e,r,n])}function Du(e){let t=e?.color?.palette?.custom,o=e?.color?.palette?.theme,r=e?.color?.palette?.default,n=e?.color?.defaultPalette;return(0,XE.useMemo)(()=>{let i=[];return o&&o.length&&i.push({name:(0,uy._x)("Theme","Indicates this palette comes from the theme."),colors:o}),n&&r&&r.length&&i.push({name:(0,uy._x)("Default","Indicates this palette comes from WordPress."),colors:r}),t&&t.length&&i.push({name:(0,uy._x)("Custom","Indicates this palette is created by the user."),colors:t}),i},[t,o,r,n])}function QE(e){let t=e?.color?.gradients?.custom,o=e?.color?.gradients?.theme,r=e?.color?.gradients?.default,n=e?.color?.defaultGradients;return(0,XE.useMemo)(()=>{let i=[];return o&&o.length&&i.push({name:(0,uy._x)("Theme","Indicates this palette comes from the theme."),gradients:o}),n&&r&&r.length&&i.push({name:(0,uy._x)("Default","Indicates this palette comes from WordPress."),gradients:r}),t&&t.length&&i.push({name:(0,uy._x)("Custom","Indicates this palette is created by the user."),gradients:t}),i},[t,o,r,n])}function A_(e){let t=Du(e),o=QE(e),r=e?.color?.custom,n=e?.color?.customGradient,i=(0,XE.useMemo)(()=>t.flatMap(({colors:l})=>l),[t]),s=l=>Ea({settings:e},"",l),a=(l,u)=>{if(u)return"var:preset|gradient|"+u;let f=o.flatMap(({gradients:p})=>p).find(({gradient:p})=>p===l);return f?"var:preset|gradient|"+f.slug:l};return{colors:t,gradients:o,allColors:i,areCustomSolidsEnabled:r,areCustomGradientsEnabled:n,hasSolidColors:t.length>0||r,hasGradientColors:o.length>0||n,decodeValue:s,encodeGradientValue:a}}var vl=c(U(),1),Cr=c(G(),1),dy=c(F(),1);var L_=c(G(),1);var I0e=c(F(),1),pD=c(U(),1),$W=c(E(),1),LKe=[{label:(0,L_.__)("Align text left"),value:"left",icon:tp},{label:(0,L_.__)("Align text center"),value:"center",icon:Xh},{label:(0,L_.__)("Align text right"),value:"right",icon:op},{label:(0,L_.__)("Justify text"),value:"justify",icon:MF}],MKe=["left","center","right"];function mD({className:e,value:t,onChange:o,options:r=MKe}){let n=(0,I0e.useMemo)(()=>LKe.filter(i=>r.includes(i.value)),[r]);return n.length?(0,$W.jsx)(pD.__experimentalToggleGroupControl,{isDeselectable:!0,label:(0,L_.__)("Text alignment"),className:K("block-editor-text-alignment-control",e),value:t,onChange:i=>{o(i===t?void 0:i)},children:n.map(i=>(0,$W.jsx)(pD.__experimentalToggleGroupControlOptionIcon,{value:i.value,icon:i.icon,label:i.label},i.value))}):null}var nn=c(U(),1),JE=c(G(),1);var bl=c(E(),1);function O0e({value:e,onChange:t,__unstableInputWidth:o="60px",withSlider:r=!1,hasBottomMargin:n=!1,help:i,className:s,placeholder:a,...l}){let[u]=Le("spacing.units"),d=(0,nn.__experimentalUseCustomUnits)({availableUnits:u||["px","em","rem","ch","%","vw","vh"],defaultValues:{px:16,em:2,rem:2,ch:2}}),[f,p]=(0,nn.__experimentalParseQuantityAndUnitFromRawValue)(e,d),h=!!p&&["em","rem","%","ch","vw","vh"].includes(p);return r?(0,bl.jsxs)(nn.__experimentalView,{style:n?{marginBottom:12}:void 0,children:[(0,bl.jsx)(nn.BaseControl.VisualLabel,{children:(0,JE.__)("Line indent")}),(0,bl.jsxs)(nn.Flex,{children:[(0,bl.jsx)(nn.FlexItem,{isBlock:!0,children:(0,bl.jsx)(nn.__experimentalUnitControl,{label:(0,JE.__)("Line indent"),labelPosition:"top",hideLabelFromVision:!0,value:e,onChange:t,units:d,__unstableInputWidth:o,min:0,className:s,placeholder:a})}),r&&(0,bl.jsx)(nn.FlexItem,{isBlock:!0,children:(0,bl.jsx)(nn.__experimentalSpacer,{marginX:2,marginBottom:0,children:(0,bl.jsx)(nn.RangeControl,{label:(0,JE.__)("Line indent"),hideLabelFromVision:!0,value:f,withInputField:!1,onChange:m=>{t?.(m===void 0?void 0:m+(p??"px"))},min:0,max:h?10:100,step:h?.1:1,initialPosition:0})})})]}),i&&(0,bl.jsx)("p",{className:"components-base-control__help",children:i})]}):(0,bl.jsx)(nn.__experimentalUnitControl,{...l,label:(0,JE.__)("Line indent"),value:e,__unstableInputWidth:o,units:d,onChange:t,help:i,className:s,placeholder:a})}var sn=c(U(),1),M0e=c(F(),1),KW=c(G(),1);var M_=c(U(),1);var A0e=c(G(),1),ah=c(E(),1),gn=()=>!!window.__experimentalGlobalStylesInheritanceUI;function yl(e,t,o){let r=!!e&&!t,n=K(o,{"is-inherited-from-global-styles":r,"has-local-override-from-global-styles":!!t});return{...n?{className:n}:{},isInherited:r,hasLocalOverride:!!t}}function _f({onResetToInherited:e,className:t}){return(0,ah.jsxs)(M_.Button,{__next40pxDefaultSize:!1,label:(0,A0e.__)("Reset to inherited value"),showTooltip:!0,className:K("has-local-override-from-global-styles__reset",t),onClick:o=>{o.preventDefault(),o.stopPropagation(),e?.()},children:[(0,ah.jsx)("span",{"aria-hidden":"true",className:"has-local-override-from-global-styles__dot"}),(0,ah.jsx)(M_.Icon,{className:"has-local-override-from-global-styles__reset-icon",icon:dn})]})}function Lt({className:e,isInherited:t,hasLocalOverride:o,label:r,onDeselect:n,showLocalOverrideActionsInLabel:i=!0,hasInlineEndToggle:s=!1,children:a,...l}){return(0,ah.jsxs)(M_.__experimentalToolsPanelItem,{className:e,label:r,onDeselect:n,...l,children:[a,o&&i&&(0,ah.jsx)("div",{className:K("global-styles-inheritance-affordance",{"global-styles-inheritance-affordance--offset-toggle":s}),children:(0,ah.jsx)(_f,{onResetToInherited:n})})]})}var vo=c(E(),1),{Tabs:hD}=H(sn.privateApis);function NKe({tabs:e,colorGradientControlSettings:t,contrastWarning:o}){let{key:r,...n}=e[0]??{},i=(e.find(s=>s.userValue!==void 0)??e.find(s=>s.isPlaceholder||s.inheritedValue!==void 0))?.key;return(0,vo.jsx)(sn.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,vo.jsxs)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:[e.length===1&&(0,vo.jsx)(L0e,{...n,colorGradientControlSettings:t,contrastWarning:o},r),e.length>1&&(0,vo.jsxs)(hD,{defaultTabId:i,children:[(0,vo.jsx)(hD.TabList,{children:e.map(s=>(0,vo.jsx)(hD.Tab,{tabId:s.key,children:s.label},s.key))}),e.map(s=>{let{key:a,...l}=s;return(0,vo.jsx)(hD.TabPanel,{tabId:a,focusable:!1,children:(0,vo.jsx)(L0e,{...l,colorGradientControlSettings:t,contrastWarning:o},a)},a)})]})]})})}var DKe={placement:"left-start",offset:36,shift:!0},VKe=({indicators:e,label:t})=>(0,vo.jsxs)(sn.__experimentalHStack,{justify:"flex-start",children:[(0,vo.jsx)(sn.__experimentalZStack,{isLayered:!1,offset:-8,children:e.map((o,r)=>(0,vo.jsx)(sn.Flex,{expanded:!1,children:(0,vo.jsx)(sn.ColorIndicator,{colorValue:o})},r))}),(0,vo.jsx)(sn.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",children:t})]});function L0e({isGradient:e,inheritedValue:t,inheritedSlug:o,userSlug:r,userValue:n,setValue:i,isPlaceholder:s,colorGradientControlSettings:a,contrastWarning:l}){let u=n??t,d=n!==void 0?r:o,f=(p,h)=>{if(s&&p===void 0){i(t,o);return}i(p,h)};return(0,vo.jsx)($m,{...a,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:e?void 0:u,colorSlug:e?void 0:d,gradientValue:e?u:void 0,gradientSlug:e?d:void 0,onColorChange:e?void 0:f,onGradientChange:e?f:void 0,clearable:n!==void 0,headingLevel:3,noticeProps:!e&&l?{children:l,status:"warning",spokenMessage:null,className:"block-editor-panel-color-gradient-settings__contrast-notice"}:void 0})}function lh({label:e,hasValue:t,resetValue:o,isShownByDefault:r,indicators:n,tabs:i,colorGradientControlSettings:s,panelId:a,contrastWarning:l,className:u="block-editor-tools-panel-color-gradient-settings__item",isPlaceholder:d=!1,hasInheritedValue:f=!1,showInheritanceLabelIndicators:p=gn()}){let h=(0,M0e.useRef)(void 0),m=K("block-editor-color-gradient-item",u),g=p&&t()&&f,b=p?yl(d,g,m):{className:m};return(0,vo.jsx)(Lt,{...b,showLocalOverrideActionsInLabel:!1,hasValue:t,label:e,onDeselect:o,isShownByDefault:r,panelId:a,children:(0,vo.jsx)(sn.Dropdown,{popoverProps:DKe,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:v,isOpen:y})=>{let k={onClick:v,className:K("block-editor-panel-color-gradient-settings__dropdown",{"is-open":y,"has-contrast-warning":!!l}),"aria-expanded":y,ref:h};return(0,vo.jsxs)(vo.Fragment,{children:[(0,vo.jsx)(sn.Button,{...k,__next40pxDefaultSize:!0,children:(0,vo.jsx)(VKe,{indicators:n,label:e})}),t()&&(g?(0,vo.jsx)(_f,{className:"block-editor-panel-color-gradient-settings__reset",onResetToInherited:()=>{o(),y&&v(),h.current?.focus()}}):(0,vo.jsx)(sn.Button,{__next40pxDefaultSize:!0,label:(0,KW.__)("Reset"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:dn,onClick:()=>{o(),y&&v(),h.current?.focus()}})),l&&(0,vo.jsx)(sn.Button,{__next40pxDefaultSize:!0,size:"small",icon:XF,label:(0,KW.__)("Low contrast"),className:"block-editor-panel-color-gradient-settings__contrast-warning","aria-expanded":y,onClick:v})]})},renderContent:()=>(0,vo.jsx)(NKe,{tabs:i,colorGradientControlSettings:s,contrastWarning:l})})})}var N0e=c(U(),1),gD=c(F(),1),Qn=c(G(),1),D0e=c(rv(),1);function Po(e,t){if(typeof e!="string")return;let o=`var:preset|${t}|`;if(e.startsWith(o))return e.slice(o.length);let r=`--wp--preset--${t}--`;return e.match(new RegExp(`^var\\(${r}([^)]+)\\)$`))?.[1]}function xf(e,t,o){if(o)return"var:preset|color|"+o;let r=e.find(({color:n})=>n===t);return r?"var:preset|color|"+r.slug:t}var N_=c(E(),1);function bD(e){let t=V0e(e),o=z0e(e),r=j0e(e),n=F0e(e);return t||o||r||n}function YW(e){let t=Du(e);return e?.color?.text&&(t?.length>0||e?.color?.custom)}function V0e(e){let t=Du(e);return e?.color?.link&&(t?.length>0||e?.color?.custom)}function F0e(e){let t=Du(e);return e?.color?.caption&&(t?.length>0||e?.color?.custom)}function z0e(e){let t=Du(e),o=QE(e);return e?.color?.heading&&(t?.length>0||e?.color?.custom||o?.length>0||e?.color?.customGradient)}function j0e(e){let t=Du(e),o=QE(e);return e?.color?.button&&(t?.length>0||e?.color?.custom||o?.length>0||e?.color?.customGradient)}function qW(e){let t=Du(e),o=QE(e);return e?.color?.background&&(t?.length>0||e?.color?.custom||o?.length>0||e?.color?.customGradient)}function ZW({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n,label:i}){let s=xr(),a=()=>{let l=e(o);t(l)};return(0,N_.jsx)(N0e.__experimentalToolsPanel,{label:i||(0,Qn.__)("Elements"),resetAll:a,panelId:r,hasInnerWrapper:!0,headingLevel:3,className:"color-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:s,children:(0,N_.jsx)("div",{className:"color-block-support-panel__inner-wrapper",children:n})})}var FKe={link:!0,heading:!0,button:!0,caption:!0};function yD({as:e=ZW,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,defaultControls:s=FKe,label:a,children:l,contrastWarning:u,showInheritanceLabelIndicators:d=gn()}){let{colors:f,gradients:p,areCustomSolidsEnabled:h,areCustomGradientsEnabled:m,hasSolidColors:g,hasGradientColors:b,allColors:v,decodeValue:y,encodeGradientValue:k}=A_(n),S=L=>(0,D0e.getCSSValueFromRawStyle)(y(L)),_=V0e(n),x=S(r?.elements?.link?.color?.text),w=y(t?.elements?.link?.color?.text),T=(L,j)=>{o(De(t,["elements","link","color","text"],xf(v,L,j)))},B=S(r?.elements?.link?.[":hover"]?.color?.text),R=y(t?.elements?.link?.[":hover"]?.color?.text),I=(L,j)=>{o(De(t,["elements","link",":hover","color","text"],xf(v,L,j)))},A=()=>!!w||!!R,P=()=>{let L=De(t,["elements","link",":hover","color","text"],void 0);L=De(L,["elements","link","color","text"],void 0),o(L)},O=F0e(n),N=j0e(n),z=z0e(n),V=(0,gD.useMemo)(()=>[{name:"caption",label:(0,Qn.__)("Captions"),showPanel:O},{name:"button",label:(0,Qn.__)("Button"),showPanel:N},{name:"heading",label:(0,Qn.__)("Heading"),showPanel:z},{name:"h1",label:(0,Qn.__)("H1"),showPanel:z},{name:"h2",label:(0,Qn.__)("H2"),showPanel:z},{name:"h3",label:(0,Qn.__)("H3"),showPanel:z},{name:"h4",label:(0,Qn.__)("H4"),showPanel:z},{name:"h5",label:(0,Qn.__)("H5"),showPanel:z},{name:"h6",label:(0,Qn.__)("H6"),showPanel:z}],[O,N,z]),M=(0,gD.useCallback)(L=>({...L,elements:{...L?.elements,link:{...L?.elements?.link,color:void 0,":hover":{color:void 0}},...V.reduce((j,q)=>({...j,[q.name]:{...L?.elements?.[q.name],color:void 0}}),{})}}),[V]),D=[_&&{key:"link",label:(0,Qn.__)("Link"),hasValue:A,resetValue:P,isShownByDefault:s.link,indicators:[w??x,R??B],isPlaceholder:w===void 0&&R===void 0&&(x!==void 0||B!==void 0),hasInheritedValue:x!==void 0||B!==void 0,contrastWarning:u,tabs:[{key:"link",label:(0,Qn.__)("Default"),inheritedValue:x,inheritedSlug:Po(r?.elements?.link?.color?.text,"color"),userSlug:Po(t?.elements?.link?.color?.text,"color"),setValue:T,userValue:w,isPlaceholder:w===void 0&&x!==void 0},{key:"hover",label:(0,Qn.__)("Hover"),inheritedValue:B,inheritedSlug:Po(r?.elements?.link?.[":hover"]?.color?.text,"color"),userSlug:Po(t?.elements?.link?.[":hover"]?.color?.text,"color"),setValue:I,userValue:R,isPlaceholder:R===void 0&&B!==void 0}]}].filter(Boolean);return V.forEach(({name:L,label:j,showPanel:q})=>{if(!q)return;let J=S(r?.elements?.[L]?.color?.background),te=S(r?.elements?.[L]?.color?.gradient),ee=S(r?.elements?.[L]?.color?.text),$=y(t?.elements?.[L]?.color?.background),W=y(t?.elements?.[L]?.color?.gradient),Y=y(t?.elements?.[L]?.color?.text),Z=()=>!!(Y||$||W),oe=()=>{let ke=De(t,["elements",L,"color","background"],void 0);ke.elements[L].color.gradient=void 0,ke.elements[L].color.text=void 0,o(ke)},ne=(ke,_e)=>{o(De(t,["elements",L,"color","text"],xf(v,ke,_e)))},X=(ke,_e)=>{let we=De(t,["elements",L,"color","background"],xf(v,ke,_e));we.elements[L].color.gradient=void 0,o(we)},re=(ke,_e)=>{let we=De(t,["elements",L,"color","gradient"],k(ke,_e));we.elements[L].color.background=void 0,o(we)},ae=L!=="caption",ve=Y===void 0&&ee!==void 0,xe=$===void 0&&J!==void 0,ge=W===void 0&&te!==void 0,be=Y===void 0&&$===void 0&&W===void 0&&(ee!==void 0||J!==void 0||te!==void 0),he=ee!==void 0||J!==void 0||te!==void 0;D.push({key:L,label:j,hasValue:Z,resetValue:oe,isShownByDefault:s[L],indicators:ae?[Y??ee,W??te??$??J]:[Y??ee],isPlaceholder:be,hasInheritedValue:he,tabs:[g&&{key:"text",label:(0,Qn.__)("Text"),inheritedValue:ee,inheritedSlug:Po(r?.elements?.[L]?.color?.text,"color"),userSlug:Po(t?.elements?.[L]?.color?.text,"color"),setValue:ne,userValue:Y,isPlaceholder:ve},g&&ae&&{key:"background",label:(0,Qn.__)("Background"),inheritedValue:J,inheritedSlug:Po(r?.elements?.[L]?.color?.background,"color"),userSlug:Po(t?.elements?.[L]?.color?.background,"color"),setValue:X,userValue:$,isPlaceholder:xe},b&&ae&&{key:"gradient",label:(0,Qn.__)("Gradient"),inheritedValue:te,inheritedSlug:Po(r?.elements?.[L]?.color?.gradient,"gradient"),userSlug:Po(t?.elements?.[L]?.color?.gradient,"gradient"),setValue:re,userValue:W,isGradient:!0,isPlaceholder:ge}].filter(Boolean)})}),(0,N_.jsxs)(e,{resetAllFilter:M,value:t,onChange:o,panelId:i,label:a,children:[D.map(L=>{let{key:j,...q}=L;return(0,N_.jsx)(lh,{...q,showInheritanceLabelIndicators:d,colorGradientControlSettings:{colors:f,disableCustomColors:!h,gradients:p,disableCustomGradients:!m},panelId:i},j)}),l]})}function U0e(e,t){let o=e?.typography?.fontFamilies,r=["default","theme","custom"].flatMap(i=>o?.[i]??[]),n=r.find(i=>i.fontFamily===t)?.fontFace??[];return{fontFamilies:r,fontFamilyFaces:n}}function H0e(e,t){return t=typeof t=="number"?t.toString():t,!t||typeof t!="string"?"":!e||e.length===0?t:e?.reduce((r,{value:n})=>{let i=Math.abs(parseInt(n)-parseInt(t)),s=Math.abs(parseInt(r)-parseInt(t));return ir.value===t)?t:t==="oblique"&&!e.find(r=>r.value==="oblique")?"italic":""}function G0e(e,t,o){let r=t,n=o,{fontStyles:i,fontWeights:s,combinedStyleAndWeightOptions:a}=o_(e),l=i?.some(({value:d})=>d===t),u=s?.some(({value:d})=>d?.toString()===o?.toString());return l||(r=t?zKe(i,t):a?.find(d=>d.style.fontWeight===H0e(s,o))?.style?.fontStyle),u||(n=o?H0e(s,o):a?.find(d=>d.style.fontStyle===(r||t))?.style?.fontWeight),{nearestFontStyle:r,nearestFontWeight:n}}var to=c(E(),1),jKe=1,HKe=6;function UKe(e,t){let o=e?.elements?.link?.color?.text;if(o!==void 0)return o===e?.color?.text;let r=t?.elements?.link?.color?.text;return r===void 0||t?.color?.text===r}function vD(e){let t=$0e(e),o=K0e(e),r=Y0e(e),n=q0e(e),i=X0e(e),s=Z0e(e),a=Q0e(e),l=tCe(e),u=J0e(e),d=eCe(e),f=W0e(e),p=YW(e);return t||o||r||n||i||s||f||a||l||u||d||p}function W0e(e){return e?.typography?.defaultFontSizes!==!1&&e?.typography?.fontSizes?.default?.length||e?.typography?.fontSizes?.theme?.length||e?.typography?.fontSizes?.custom?.length||e?.typography?.customFontSize}function $0e(e){return["default","theme","custom"].some(t=>e?.typography?.fontFamilies?.[t]?.length)}function K0e(e){return e?.typography?.lineHeight}function Y0e(e){return e?.typography?.fontStyle||e?.typography?.fontWeight}function GKe(e){return e?.typography?.fontStyle?e?.typography?.fontWeight?(0,Cr.__)("Appearance"):(0,Cr.__)("Font style"):(0,Cr.__)("Font weight")}function q0e(e){return e?.typography?.letterSpacing}function Z0e(e){return e?.typography?.textTransform}function X0e(e){return e?.typography?.textAlign}function Q0e(e){return e?.typography?.textDecoration}function J0e(e){return e?.typography?.writingMode}function eCe(e){return e?.typography?.textColumns}function tCe(e){return e?.typography?.textIndent}function WKe(e){let t=e?.typography?.fontSizes,o=!!e?.typography?.defaultFontSizes;return[...t?.custom??[],...t?.theme??[],...o?t?.default??[]:[]]}function QW({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n}){let i=xr(),s=()=>{let a=e(o);t(a)};return(0,to.jsx)(vl.__experimentalToolsPanel,{label:(0,Cr.__)("Typography"),resetAll:s,panelId:r,__experimentalFirstVisibleItemClass:"first",dropdownMenuProps:i,children:n})}var $Ke={textColor:!0,fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textAlign:!0,textTransform:!0,textDecoration:!0,textIndent:!0,writingMode:!0,textColumns:!0},KKe=[void 0,null,""];function Ye(e){return!KKe.includes(e)}function XW(e){if(!Ye(e))return;let[t]=(0,vl.__experimentalParseQuantityAndUnitFromRawValue)(e);return t}function SD({as:e=QW,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,defaultControls:s=$Ke,isGlobalStyles:a=!1,showInheritanceLabelIndicators:l=gn(),contrastWarning:u}){let{colors:d,allColors:f,areCustomSolidsEnabled:p,decodeValue:h}=A_(n),m=(Ne,ln,zc)=>yl(l&&Ne,l&&ln,zc),g=YW(n),b=h(r?.color?.text),v=h(t?.color?.text),y=()=>!!t?.color?.text,k=(Ne,ln)=>{let zc=xf(f,Ne,ln),Ml=De(t,["color","text"],zc);(gn()?UKe(t,r):r?.color?.text===r?.elements?.link?.color?.text)&&(Ml=De(Ml,["elements","link","color","text"],zc)),o(Ml)},S=()=>k(void 0),_=$0e(n),x=h(r?.typography?.fontFamily),w=h(t?.typography?.fontFamily)??x,T=!Ye(t?.typography?.fontFamily)&&Ye(x),{fontFamilies:B,fontFamilyFaces:R}=(0,dy.useMemo)(()=>U0e(n,w),[n,w]),I=Ne=>{let ln=B?.find(({fontFamily:Nl})=>Nl===Ne)?.slug,zc=ln?`var:preset|font-family|${ln}`:Ne,Ml=De(t,["typography","fontFamily"],Ye(zc)?zc:void 0),bF=B?.find(({fontFamily:Nl})=>Nl===Ne)?.fontFace??[],{fontStyles:FIe,fontWeights:zIe}=o_(bF),jIe=FIe?.some(({value:Nl})=>Nl===xe),HIe=zIe?.some(({value:Nl})=>Nl?.toString()===ge?.toString());if(!jIe||!HIe){let{nearestFontStyle:Nl,nearestFontWeight:yF}=G0e(bF,xe,ge);Nl||yF?Ml={...Ml,typography:{...Ml?.typography,fontStyle:Ye(Nl)?Nl:void 0,fontWeight:Ye(yF)?yF:void 0}}:(xe||ge)&&(Ml={...Ml,typography:{...Ml?.typography,fontStyle:void 0,fontWeight:void 0}})}o(Ml)},A=()=>Ye(t?.typography?.fontFamily),P=()=>I(void 0),O=W0e(n),N=!n?.typography?.customFontSize,z=WKe(n),V=t?.typography?.fontSize,M=r?.typography?.fontSize,D=V??M,L=h(D),j=h(M),q=!Ye(V)&&Ye(M),J=Ne=>{if(!Ne||typeof Ne!="string")return;if(Ne.startsWith("var:preset|font-size|"))return Ne.replace("var:preset|font-size|","");let ln=Ne.match(/^var\(--wp--preset--font-size--([^)]+)\)$/);if(ln)return ln[1]},te=J(D),ee=J(M),$=(Ne,ln)=>{let zc=ln?.slug?`var:preset|font-size|${ln?.slug}`:Ne;o(De(t,["typography","fontSize"],Ye(zc)?zc:void 0))},W=(Ne,ln)=>{if(q&&Ne===void 0&&!ln){ee?$(void 0,{slug:ee}):$(j);return}$(Ne,ln)},Y=()=>Ye(t?.typography?.fontSize),Z=()=>$(void 0),oe=Y0e(n),ne=GKe(n),X=n?.typography?.fontStyle,re=n?.typography?.fontWeight,ae=h(r?.typography?.fontStyle),ve=h(r?.typography?.fontWeight),xe=h(t?.typography?.fontStyle)??ae,ge=h(t?.typography?.fontWeight)??ve,be=!Ye(t?.typography?.fontStyle)&&!Ye(t?.typography?.fontWeight)&&(Ye(ae)||Ye(ve)),he=(0,dy.useCallback)(({fontStyle:Ne,fontWeight:ln})=>{(Ne!==xe||ln!==ge)&&o({...t,typography:{...t?.typography,fontStyle:Ye(Ne)?Ne:void 0,fontWeight:Ye(ln)?ln:void 0}})},[xe,ge,o,t]),ke=(0,dy.useCallback)(Ne=>{if(be&&Ne.fontStyle===xe&&Ne.fontWeight===ge){o({...t,typography:{...t?.typography,fontStyle:Ye(xe)?xe:void 0,fontWeight:Ye(ge)?ge:void 0}});return}he(Ne)},[be,xe,ge,o,t,he]),_e=()=>Ye(t?.typography?.fontStyle)||Ye(t?.typography?.fontWeight),we=(0,dy.useCallback)(()=>{he({})},[he]),Re=K0e(n),se=h(t?.typography?.lineHeight),ie=h(r?.typography?.lineHeight),Ae=!Ye(t?.typography?.lineHeight)&&Ye(ie),ye=Ne=>{o(De(t,["typography","lineHeight"],Ye(Ne)?Ne:void 0))},Ee=()=>Ye(t?.typography?.lineHeight),qe=()=>ye(void 0),pt=q0e(n),at=h(t?.typography?.letterSpacing),Ct=h(r?.typography?.letterSpacing),rt=!Ye(t?.typography?.letterSpacing)&&Ye(Ct),Ot=Ne=>{o(De(t,["typography","letterSpacing"],Ye(Ne)?Ne:void 0))},ut=()=>Ye(t?.typography?.letterSpacing),Gt=()=>Ot(void 0),So=tCe(n),mo=h(t?.typography?.textIndent),de=h(r?.typography?.textIndent),Me=!Ye(t?.typography?.textIndent)&&Ye(de),ze=(n?.typography?.textIndent??"subsequent")==="all",Je=Ne=>{o(De(t,["typography","textIndent"],Ye(Ne)?Ne:void 0))},lt=Ne=>{o({...t,settings:{typography:{textIndent:Ne?"all":"subsequent"}}})},ct=()=>Ye(t?.typography?.textIndent),yr=()=>{o(De(t,["typography","textIndent"],void 0))},Ao=ze?(0,Cr.__)("Indents the first line of all paragraphs."):(0,Cr.__)("Indents the first line of each paragraph after the first one."),rr=eCe(n),ho=h(t?.typography?.textColumns),Go=h(r?.typography?.textColumns),Vn=!Ye(t?.typography?.textColumns)&&Ye(Go),vr=Ne=>{o(De(t,["typography","textColumns"],Ye(Ne)?Ne:void 0))},an=()=>Ye(t?.typography?.textColumns),it=()=>vr(void 0),_t=Z0e(n),Vt=h(r?.typography?.textTransform),ko=h(t?.typography?.textTransform)??Vt,Wo=!Ye(t?.typography?.textTransform)&&Ye(Vt),nr=Ne=>{o(De(t,["typography","textTransform"],Ye(Ne)?Ne:void 0))},Sa=Ne=>{if(Wo&&Ne===void 0){nr(Vt);return}nr(Ne)},ka=()=>Ye(t?.typography?.textTransform),Ll=()=>nr(void 0),Be=Q0e(n),Ft=h(r?.typography?.textDecoration),nt=h(t?.typography?.textDecoration)??Ft,zt=!Ye(t?.typography?.textDecoration)&&Ye(Ft),Ir=Ne=>{o(De(t,["typography","textDecoration"],Ye(Ne)?Ne:void 0))},$o=Ne=>{if(zt&&Ne===void 0){Ir(Ft);return}Ir(Ne)},Sn=()=>Ye(t?.typography?.textDecoration),Gh=()=>Ir(void 0),mF=J0e(n),Dy=h(r?.typography?.writingMode),X1=h(t?.typography?.writingMode)??Dy,Q1=!Ye(t?.typography?.writingMode)&&Ye(Dy),Rx=Ne=>{o(De(t,["typography","writingMode"],Ye(Ne)?Ne:void 0))},hF=Ne=>{if(Q1&&Ne===void 0){Rx(Dy);return}Rx(Ne)},Wh=()=>Ye(t?.typography?.writingMode),$e=()=>Rx(void 0),ri=X0e(n),od=h(r?.typography?.textAlign),EY=h(t?.typography?.textAlign)??od,TY=!Ye(t?.typography?.textAlign)&&Ye(od),gF=Ne=>{o(De(t,["typography","textAlign"],Ye(Ne)?Ne:void 0))},NIe=Ne=>{if(TY&&Ne===void 0){gF(od);return}gF(Ne)},RY=()=>Ye(t?.typography?.textAlign),DIe=()=>gF(void 0),VIe=(0,dy.useCallback)(Ne=>g?{...Ne,typography:{},color:{...Ne?.color,text:void 0}}:{...Ne,typography:{}},[g]);return(0,to.jsxs)(e,{resetAllFilter:VIe,value:t,onChange:o,panelId:i,children:[g&&(0,to.jsx)(lh,{label:(0,Cr.__)("Color"),hasValue:y,resetValue:S,isShownByDefault:s.textColor,indicators:[v??b],contrastWarning:u,showInheritanceLabelIndicators:l,isPlaceholder:v===void 0&&b!==void 0,hasInheritedValue:b!==void 0,tabs:[{key:"text",label:(0,Cr.__)("Color"),inheritedValue:b,inheritedSlug:Po(r?.color?.text,"color"),userSlug:Po(t?.color?.text,"color"),setValue:k,userValue:v,isPlaceholder:v===void 0&&b!==void 0}],colorGradientControlSettings:{colors:d,disableCustomColors:!p},panelId:i}),_&&(0,to.jsx)(Lt,{...m(T,A()&&x!==void 0),label:(0,Cr.__)("Font"),hasValue:A,onDeselect:P,isShownByDefault:s.fontFamily,panelId:i,children:(0,to.jsx)(WM,{fontFamilies:B,value:w,onChange:I})}),O&&(0,to.jsx)(Lt,{...m(q,Y()&&M!==void 0),label:(0,Cr.__)("Size"),hasValue:Y,hasInlineEndToggle:!0,onDeselect:Z,isShownByDefault:s.fontSize,panelId:i,children:(0,to.jsx)(vl.FontSizePicker,{value:te||L,valueMode:te?"slug":"literal",onChange:W,fontSizes:z,disableCustomFontSizes:N,withReset:!1,withSlider:!0})}),oe&&(0,to.jsx)(Lt,{...m(be,_e()&&(ae!==void 0||ve!==void 0)),label:ne,hasValue:_e,onDeselect:we,isShownByDefault:s.fontAppearance,panelId:i,children:(0,to.jsx)(GM,{value:{fontStyle:xe,fontWeight:ge},onChange:ke,hasFontStyles:X,hasFontWeights:re,fontFamilyFaces:R})}),Re&&(0,to.jsx)(Lt,{...m(Ae,Ee()&&ie!==void 0,"single-column"),label:(0,Cr.__)("Line height"),hasValue:Ee,onDeselect:qe,isShownByDefault:s.lineHeight,panelId:i,children:(0,to.jsx)(IN,{__unstableInputWidth:"auto",value:se??ie,onChange:ye,...Ae?{placeholder:XW(ie)}:{}})}),pt&&(0,to.jsx)(Lt,{...m(rt,ut()&&Ct!==void 0,"single-column"),label:(0,Cr.__)("Letter spacing"),hasValue:ut,onDeselect:Gt,isShownByDefault:s.letterSpacing,panelId:i,children:(0,to.jsx)(KM,{value:at??Ct,onChange:Ot,__unstableInputWidth:"auto",placeholder:rt?XW(Ct):void 0})}),So&&(0,to.jsxs)(Lt,{...m(Me,ct()&&de!==void 0),label:(0,Cr.__)("Line indent"),hasValue:ct,onDeselect:yr,isShownByDefault:s.textIndent,panelId:i,children:[(0,to.jsx)(O0e,{value:mo??de,onChange:Je,__unstableInputWidth:"auto",withSlider:!0,hasBottomMargin:a,placeholder:Me?XW(de):void 0}),a&&(0,to.jsx)(vl.ToggleControl,{label:(0,Cr.__)("Indent all paragraphs"),checked:ze,onChange:lt,help:Ao})]}),rr&&(0,to.jsx)(Lt,{...m(Vn,an()&&Go!==void 0,"single-column"),label:(0,Cr.__)("Columns"),hasValue:an,onDeselect:it,isShownByDefault:s.textColumns,panelId:i,children:(0,to.jsx)(vl.__experimentalNumberControl,{label:(0,Cr.__)("Columns"),max:HKe,min:jKe,onChange:vr,placeholder:Vn?Go:void 0,spinControls:"custom",value:ho,initialPosition:1})}),Be&&(0,to.jsx)(Lt,{...m(zt,Sn()&&Ft!==void 0,"single-column"),label:(0,Cr.__)("Decoration"),hasValue:Sn,onDeselect:Gh,isShownByDefault:s.textDecoration,panelId:i,children:(0,to.jsx)(qM,{value:nt,onChange:$o,size:"__unstable-large",__unstableInputWidth:"auto"})}),mF&&(0,to.jsx)(Lt,{...m(Q1,Wh()&&Dy!==void 0,"single-column"),label:(0,Cr.__)("Orientation"),hasValue:Wh,onDeselect:$e,isShownByDefault:s.writingMode,panelId:i,children:(0,to.jsx)(JM,{value:X1,onChange:hF,size:"__unstable-large"})}),_t&&(0,to.jsx)(Lt,{...m(Wo,ka()&&Vt!==void 0),label:(0,Cr.__)("Letter case"),hasValue:ka,onDeselect:Ll,isShownByDefault:s.textTransform,panelId:i,children:(0,to.jsx)(XM,{value:ko,onChange:Sa,showNone:!0,isBlock:!0,size:"__unstable-large"})}),ri&&(0,to.jsxs)(Lt,{...m(TY,RY()&&od!==void 0),label:(0,Cr.__)("Text alignment"),hasValue:RY,onDeselect:DIe,isShownByDefault:s.textAlign,panelId:i,children:[(0,to.jsx)(mD,{value:EY,onChange:NIe,options:["left","center","right","justify"],size:"__unstable-large"}),EY==="justify"&&(0,to.jsx)("div",{children:(0,to.jsx)(vl.Notice,{status:"warning",isDismissible:!1,children:(0,Cr.__)("Justified text can reduce readability. For better accessibility, use left-aligned text instead.")})})]})]})}var jo=c(G(),1),ei=c(U(),1);var CD=c(F(),1);var oo=c(U(),1),pr=c(G(),1),rCe=c(F(),1),kD=c(Q(),1);var oCe=c(Q(),1);function fy(e,t){let{getBlockOrder:o,getBlockAttributes:r}=(0,oCe.useSelect)(C);return(i,s)=>{let a=(s-1)*t+i-1,l=0;for(let u of o(e)){let{columnStart:d,rowStart:f}=r(u).style?.layout??{};(f-1)*t+d-1!!i,f=a==="horizontal"?(0,pr.__)("Width"):(0,pr.__)("Height"),[p]=Le("spacing.units"),h=(0,oo.__experimentalUseCustomUnits)({availableUnits:p||["%","px","em","rem","vh","vw"]}),m=()=>{t({selfStretch:void 0,flexSize:void 0})};return(0,rCe.useEffect)(()=>{JW(i)&&!s&&t({...e,selfStretch:Jn.fit})},[]),(0,Qo.jsxs)(oo.__experimentalVStack,{as:oo.__experimentalToolsPanelItem,spacing:2,hasValue:d,label:f,onDeselect:m,isShownByDefault:r,panelId:n,children:[(0,Qo.jsxs)(oo.__experimentalToggleGroupControl,{label:QKe(o),value:l,help:ZKe(l,o),onChange:g=>{let b=JW(g)?s:null;t({selfStretch:g,flexSize:b})},isBlock:!0,children:[(0,Qo.jsx)(oo.__experimentalToggleGroupControlOption,{value:Jn.fit,label:(0,pr._x)("Fit","Intrinsic block width in flex layout")},Jn.fit),(0,Qo.jsx)(oo.__experimentalToggleGroupControlOption,{value:Jn.grow,label:(0,pr._x)("Grow","Block with expanding width in flex layout")},Jn.grow),(0,Qo.jsx)(oo.__experimentalToggleGroupControlOption,{value:Jn.max,label:qKe(o)},Jn.max),(0,Qo.jsx)(oo.__experimentalToggleGroupControlOption,{value:Jn.fixed,label:(0,pr._x)("Fixed","Block with fixed width in flex layout")},Jn.fixed)]}),u&&(0,Qo.jsx)(oo.__experimentalUnitControl,{units:h,onChange:g=>{t({selfStretch:l,flexSize:g})},value:s,min:0,label:f,hideLabelFromVision:!0})]})}function QKe(e){let{orientation:t="horizontal"}=e??{};return t==="horizontal"?(0,pr.__)("Width"):(0,pr.__)("Height")}function JKe({childLayout:e,onChange:t,parentLayout:o,isShownByDefault:r,panelId:n,showGridSpanDefaults:i}){let{columnStart:s,rowStart:a,columnSpan:l,rowSpan:u}=e,{columnCount:d,rowCount:f}=o??{},p=(0,kD.useSelect)(T=>T(C).getBlockRootClientId(n)),{moveBlocksToPosition:h,__unstableMarkNextChangeAsNotPersistent:m}=(0,kD.useDispatch)(C),g=fy(p,d||3),b=()=>!!s||!!a,v=()=>!!l||!!u,y=()=>{t({columnStart:void 0,rowStart:void 0})},k=()=>{t({columnSpan:void 0,rowSpan:void 0})},S=d?d-(s??1)+1:void 0,_=window.__experimentalEnableGridInteractivity&&f?f-(a??1)+1:void 0,x=l??(i?1:void 0),w=u??(i?1:void 0);return(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsxs)(oo.Flex,{as:oo.__experimentalToolsPanelItem,hasValue:v,label:(0,pr.__)("Grid span"),onDeselect:k,isShownByDefault:r,panelId:n,children:[(0,Qo.jsx)(oo.FlexItem,{style:{width:"50%"},children:(0,Qo.jsx)(oo.__experimentalInputControl,{label:(0,pr.__)("Column span"),type:"number",onChange:T=>{let B=T===""?1:parseInt(T,10),R=S?Math.min(B,S):B;t({columnStart:s,rowStart:a,rowSpan:u,columnSpan:R})},value:x,min:1,max:S})}),(0,Qo.jsx)(oo.FlexItem,{style:{width:"50%"},children:(0,Qo.jsx)(oo.__experimentalInputControl,{label:(0,pr.__)("Row span"),type:"number",onChange:T=>{let B=T===""?1:parseInt(T,10),R=_?Math.min(B,_):B;t({columnStart:s,rowStart:a,columnSpan:l,rowSpan:R})},value:w,min:1,max:_})})]}),window.__experimentalEnableGridInteractivity&&(0,Qo.jsxs)(oo.Flex,{as:oo.__experimentalToolsPanelItem,hasValue:b,label:(0,pr.__)("Grid placement"),onDeselect:y,isShownByDefault:!1,panelId:n,children:[(0,Qo.jsx)(oo.FlexItem,{style:{width:"50%"},children:(0,Qo.jsx)(oo.__experimentalInputControl,{label:(0,pr.__)("Column"),type:"number",onChange:T=>{let B=T===""?1:parseInt(T,10);t({columnStart:B,rowStart:a,columnSpan:l,rowSpan:u}),m(),h([n],p,p,g(B,a))},value:s??1,min:1,max:d?d-(l??1)+1:void 0})}),(0,Qo.jsx)(oo.FlexItem,{style:{width:"50%"},children:(0,Qo.jsx)(oo.__experimentalInputControl,{label:(0,pr.__)("Row"),type:"number",onChange:T=>{let B=T===""?1:parseInt(T,10);t({columnStart:s,rowStart:B,columnSpan:l,rowSpan:u}),m(),h([n],p,p,g(s,B))},value:a??1,min:1,max:f?f-(u??1)+1:void 0})})]})]})}var iCe=c(U(),1),D_=c(G(),1);var e$=c(E(),1);function _D({panelId:e,value:t,onChange:o=()=>{},options:r,defaultValue:n="auto",hasValue:i,isShownByDefault:s=!0,className:a,isInherited:l,hasLocalOverride:u}){let d=t??"auto",[f,p,h]=Le("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios"),m=p?.map(({name:v,ratio:y})=>({label:v,value:y})),g=f?.map(({name:v,ratio:y})=>({label:v,value:y})),b=[{label:(0,D_._x)("Original","Aspect ratio option for dimensions control"),value:"auto"},...h?g:[],...m||[],{label:(0,D_._x)("Custom","Aspect ratio option for dimensions control"),value:"custom",disabled:!0,hidden:!0}];return(0,e$.jsx)(Lt,{className:a,isInherited:l,hasLocalOverride:u,hasValue:i||(()=>d!==n),label:(0,D_.__)("Aspect ratio"),onDeselect:()=>o(void 0),isShownByDefault:s,panelId:e,children:(0,e$.jsx)(iCe.SelectControl,{label:(0,D_.__)("Aspect ratio"),value:d,options:r??b,onChange:o})})}var Dt=c(E(),1),t$=["horizontal","vertical"];function sCe(e,t){return e?.length===1?!1:t?!(e?.includes("horizontal")&&e?.includes("vertical")&&e?.length===2):!0}function ED(e,t=Js){return uCe(e)||dCe(e)||fCe(e)||pCe(e)||mCe(e)||hCe(e)||gCe(e)||bCe(e)||yCe(e)||vCe(e,t)||SCe(e,t)}function uCe(e){return e?.layout?.contentSize}function dCe(e){return e?.layout?.wideSize}function fCe(e){return e?.spacing?.padding}function pCe(e){return e?.spacing?.margin}function mCe(e){return e?.spacing?.blockGap}function hCe(e){return e?.dimensions?.height}function gCe(e){return e?.dimensions?.minHeight}function bCe(e){return e?.dimensions?.minWidth}function yCe(e){return e?.dimensions?.width}function vCe(e,t=Js){return!ea(t)&&e?.dimensions?.aspectRatio}function SCe(e,t=Js){if(ea(t))return!1;let{type:o="default",default:{type:r="default"}={},allowSizingOnChildren:n=!1}=e?.parentLayout??{},i=(r==="flex"||o==="flex"||r==="grid"||o==="grid")&&n;return!!e?.layout&&i}function eYe(e){let{defaultSpacingSizes:t,spacingSizes:o}=e?.spacing||{};return t!==!1&&o?.default?.length>0||o?.theme?.length>0||o?.custom?.length>0}function aCe(e,t){if(!t||!e)return e;let o={};return t.forEach(r=>{r==="vertical"&&(o.top=e.top,o.bottom=e.bottom),r==="horizontal"&&(o.left=e.left,o.right=e.right),o[r]=e?.[r]}),o}var tYe=[void 0,null,""];function dt(e){return!tYe.includes(e)}function xD(e){if(!dt(e))return;let[t]=(0,ei.__experimentalParseQuantityAndUnitFromRawValue)(e);return t}function wD(e){return dt(e)&&typeof e=="string"?{top:e,right:e,bottom:e,left:e}:e}function lCe(e){if(!dt(e))return;if(typeof e=="string")return e!==""?e:void 0;if(typeof e!="object")return;let o=["top","right","bottom","left"].map(i=>e[i]);if(!o.every(dt))return;let n=o[0];return o.every(i=>i===n)?n:void 0}function cCe(e){return dt(e)?typeof e=="string"?e!=="":typeof e!="object"?!1:["top","right","bottom","left"].some(t=>dt(e[t])):!1}function oYe(e,t){return dt(e)?typeof e=="string"?t?{top:e,right:e,bottom:e,left:e}:{top:e}:{...e,right:e?.left,bottom:e?.top}:e}function rYe({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n}){let i=xr(),s=()=>{let a=e(o);t(a)};return(0,Dt.jsx)(ei.__experimentalToolsPanel,{label:(0,jo.__)("Dimensions"),resetAll:s,panelId:r,dropdownMenuProps:i,children:n})}var Sl={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,height:!0,minHeight:!0,minWidth:!0,width:!0,aspectRatio:!0,childLayout:!0};function TD({as:e=rYe,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,defaultControls:s=Sl,onVisualize:a=()=>{},includeLayoutControls:l=!1,styleState:u=Js,showInheritanceLabelIndicators:d=gn()}){let{dimensions:f,spacing:p}=n,h=$e=>$e&&typeof $e=="object"?Object.keys($e).reduce((ri,od)=>(ri[od]=Ea({settings:{dimensions:f,spacing:p}},"",$e[od]),ri),{}):Ea({settings:{dimensions:f,spacing:p}},"",$e),m=($e,ri,od)=>yl(d&&$e,d&&ri,od),g=eYe(n),b=(0,ei.__experimentalUseCustomUnits)({availableUnits:n?.spacing?.units||["%","px","em","rem","vw"]}),v=-1/0,[y,k]=(0,CD.useState)(v),S=(0,CD.useCallback)($e=>({...$e,layout:Ge({...$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:{...$e?.spacing,padding:void 0,margin:void 0,blockGap:void 0},dimensions:{...$e?.dimensions,height:void 0,minHeight:void 0,minWidth:void 0,aspectRatio:void 0,width:void 0}}),[]),_=uCe(n)&&l,x=h(t?.layout?.contentSize),w=h(r?.layout?.contentSize),T=!dt(t?.layout?.contentSize)&&dt(w),B=$e=>{o(De(t,["layout","contentSize"],dt($e)?$e:void 0))},R=()=>dt(t?.layout?.contentSize),I=()=>B(void 0),A=dCe(n)&&l,P=h(t?.layout?.wideSize),O=h(r?.layout?.wideSize),N=!dt(t?.layout?.wideSize)&&dt(O),z=$e=>{o(De(t,["layout","wideSize"],dt($e)?$e:void 0))},V=()=>dt(t?.layout?.wideSize),M=()=>z(void 0),D=fCe(n),L=wD(h(r?.spacing?.padding)),j=wD(h(t?.spacing?.padding)),q=dt(t?.spacing?.padding)?j:L,J=lCe(L),te=!dt(t?.spacing?.padding)&&J!==void 0,ee=cCe(L),$=!dt(t?.spacing?.padding)&&ee,W=Array.isArray(n?.spacing?.padding)?n?.spacing?.padding:n?.spacing?.padding?.sides,Y=W&&W.some($e=>t$.includes($e)),Z=$e=>{let ri=aCe($e,W);o(De(t,["spacing","padding"],ri))},oe=()=>dt(t?.spacing?.padding)&&Object.keys(t?.spacing?.padding).length,ne=()=>Z(void 0),X=()=>a("padding"),re=pCe(n),ae=wD(h(r?.spacing?.margin)),ve=wD(h(t?.spacing?.margin)),xe=dt(t?.spacing?.margin)?ve:ae,ge=lCe(ae),be=!dt(t?.spacing?.margin)&&ge!==void 0,he=cCe(ae),ke=!dt(t?.spacing?.margin)&&he,_e=Array.isArray(n?.spacing?.margin)?n?.spacing?.margin:n?.spacing?.margin?.sides,we=_e&&_e.some($e=>t$.includes($e)),Re=$e=>{let ri=aCe($e,_e);o(De(t,["spacing","margin"],ri))},se=()=>dt(t?.spacing?.margin)&&Object.keys(t?.spacing?.margin).length,ie=()=>Re(void 0),Ae=()=>a("margin"),ye=mCe(n),Ee=Array.isArray(n?.spacing?.blockGap)?n?.spacing?.blockGap:n?.spacing?.blockGap?.sides,qe=Ee&&Ee.some($e=>t$.includes($e)),pt=h(t?.spacing?.blockGap),at=h(r?.spacing?.blockGap),Ct=dt(t?.spacing?.blockGap)?pt:at,rt=oYe(Ct,qe),Ot=!dt(t?.spacing?.blockGap)&&typeof at=="string"&&at!=="",ut=$e=>{o(De(t,["spacing","blockGap"],$e))},Gt=$e=>{dt($e)||ut(null),!qe&&$e?.hasOwnProperty("top")?ut($e.top):ut({top:$e?.top,left:$e?.left})},So=()=>ut(void 0),mo=()=>dt(t?.spacing?.blockGap),de=gCe(n),Me=h(t?.dimensions?.minHeight),Ze=h(r?.dimensions?.minHeight),ze=!dt(t?.dimensions?.minHeight)&&dt(Ze),Je=$e=>{let ri=De(t,["dimensions","minHeight"],$e);o(De(ri,["dimensions","aspectRatio"],void 0))},lt=()=>{Je(void 0)},ct=()=>dt(t?.dimensions?.minHeight),yr=hCe(n),Ao=h(t?.dimensions?.height),rr=h(r?.dimensions?.height),ho=!dt(t?.dimensions?.height)&&dt(rr),Go=$e=>{let ri=De(t,["dimensions","height"],$e);o(De(ri,["dimensions","aspectRatio"],void 0))},Vn=()=>{Go(void 0)},vr=()=>dt(t?.dimensions?.height),an=bCe(n),it=h(t?.dimensions?.minWidth),_t=h(r?.dimensions?.minWidth),Vt=!dt(t?.dimensions?.minWidth)&&dt(_t),ko=$e=>{o(De(t,["dimensions","minWidth"],$e))},Wo=()=>{ko(void 0)},nr=()=>dt(t?.dimensions?.minWidth),Sa=yCe(n),ka=h(t?.dimensions?.width),Ll=h(r?.dimensions?.width),Be=!dt(t?.dimensions?.width)&&dt(Ll),Ft=$e=>{o(De(t,["dimensions","width"],$e))},nt=()=>{Ft(void 0)},zt=()=>dt(t?.dimensions?.width),Ir=vCe(n,u),$o=h(t?.dimensions?.aspectRatio),Sn=h(r?.dimensions?.aspectRatio),Gh=$o??Sn,mF=!dt(t?.dimensions?.aspectRatio)&&dt(Sn),Dy=$e=>{let ri=De(t,["dimensions","aspectRatio"],$e);o(De(ri,["dimensions","minHeight"],void 0))},X1=()=>dt(t?.dimensions?.aspectRatio),Q1=SCe(n,u),Rx=t?.layout,hF=$e=>{o({...t,layout:{...t?.layout,...$e}})},Wh=()=>a(!1);return(0,Dt.jsxs)(e,{resetAllFilter:S,value:t,onChange:o,panelId:i,children:[(_||A)&&(0,Dt.jsx)("span",{className:"span-columns",children:(0,jo.__)("Set the width of the main content area.")}),_&&(0,Dt.jsx)(Lt,{...m(T,R()&&w!==void 0),label:(0,jo.__)("Content width"),hasValue:R,onDeselect:I,isShownByDefault:s.contentSize??Sl.contentSize,panelId:i,children:(0,Dt.jsx)(ei.__experimentalUnitControl,{label:(0,jo.__)("Content width"),labelPosition:"top",value:x??w,placeholder:T?xD(w):void 0,onChange:$e=>{B($e)},units:b,prefix:(0,Dt.jsx)(ei.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,Dt.jsx)(gt,{icon:Qh})})})}),A&&(0,Dt.jsx)(Lt,{...m(N,V()&&O!==void 0),label:(0,jo.__)("Wide width"),hasValue:V,onDeselect:M,isShownByDefault:s.wideSize??Sl.wideSize,panelId:i,children:(0,Dt.jsx)(ei.__experimentalUnitControl,{label:(0,jo.__)("Wide width"),labelPosition:"top",value:P??O,placeholder:N?xD(O):void 0,onChange:$e=>{z($e)},units:b,prefix:(0,Dt.jsx)(ei.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,Dt.jsx)(gt,{icon:dg})})})}),D&&(0,Dt.jsxs)(Lt,{hasValue:oe,label:(0,jo.__)("Padding"),hasInlineEndToggle:sCe(W,g),onDeselect:ne,isShownByDefault:s.padding??Sl.padding,...m($,oe()&&ee,{"tools-panel-item-spacing":g}),panelId:i,children:[!g&&(0,Dt.jsx)(ei.BoxControl,{values:j,onChange:Z,label:(0,jo.__)("Padding"),sides:W,units:b,allowReset:!1,splitOnAxis:Y,inputProps:{onMouseOver:X,onMouseOut:Wh,placeholder:te?J:void 0}}),g&&(0,Dt.jsx)(P_,{values:q,onChange:Z,label:(0,jo.__)("Padding"),sides:W,units:b,allowReset:!1,onMouseOver:X,onMouseOut:Wh})]}),re&&(0,Dt.jsxs)(Lt,{hasValue:se,label:(0,jo.__)("Margin"),hasInlineEndToggle:sCe(_e,g),onDeselect:ie,isShownByDefault:s.margin??Sl.margin,...m(ke,se()&&he,{"tools-panel-item-spacing":g}),panelId:i,children:[!g&&(0,Dt.jsx)(ei.BoxControl,{values:ve,onChange:Re,inputProps:{min:y,onDragStart:()=>{k(0)},onDragEnd:()=>{k(v)},onMouseOver:Ae,onMouseOut:Wh,placeholder:be?ge:void 0},label:(0,jo.__)("Margin"),sides:_e,units:b,allowReset:!1,splitOnAxis:we}),g&&(0,Dt.jsx)(P_,{values:xe,onChange:Re,minimumCustomValue:-1/0,label:(0,jo.__)("Margin"),sides:_e,units:b,allowReset:!1,onMouseOver:Ae,onMouseOut:Wh})]}),ye&&(0,Dt.jsxs)(Lt,{hasValue:mo,label:(0,jo.__)("Block spacing"),hasInlineEndToggle:qe,onDeselect:So,isShownByDefault:s.blockGap??Sl.blockGap,...m(Ot,mo()&&at!==void 0,{"tools-panel-item-spacing":g,"single-column":!g&&!qe}),panelId:i,children:[!g&&(qe?(0,Dt.jsx)(ei.BoxControl,{label:(0,jo.__)("Block spacing"),min:0,onChange:Gt,units:b,sides:Ee,values:rt,allowReset:!1,splitOnAxis:qe}):(0,Dt.jsx)(ei.__experimentalUnitControl,{label:(0,jo.__)("Block spacing"),min:0,onChange:ut,units:b,value:pt??void 0,placeholder:Ot?at:void 0})),g&&(0,Dt.jsx)(P_,{label:(0,jo.__)("Block spacing"),min:0,onChange:Gt,showSideInLabel:!1,sides:qe?Ee:["top"],values:rt,allowReset:!1})]}),Q1&&(0,Dt.jsx)(nCe,{value:Rx,onChange:hF,parentLayout:n?.parentLayout,panelId:i,showGridSpanDefaults:!Hi(u),isShownByDefault:s.childLayout??Sl.childLayout}),de&&(0,Dt.jsx)(Lt,{...m(ze,ct()&&Ze!==void 0),hasValue:ct,label:(0,jo.__)("Minimum height"),onDeselect:lt,isShownByDefault:s.minHeight??Sl.minHeight,panelId:i,children:(0,Dt.jsx)(Yb,{label:(0,jo.__)("Minimum height"),value:Me??Ze,onChange:Je,placeholder:ze?xD(Ze):void 0,dimensionSizes:f?.dimensionSizes})}),an&&(0,Dt.jsx)(Lt,{...m(Vt,nr()&&_t!==void 0),hasValue:nr,label:(0,jo.__)("Minimum width"),onDeselect:Wo,isShownByDefault:s.minWidth??Sl.minWidth,panelId:i,children:(0,Dt.jsx)(Yb,{label:(0,jo.__)("Minimum width"),value:it??_t,onChange:ko,placeholder:Vt?xD(_t):void 0,dimensionSizes:f?.dimensionSizes})}),yr&&(0,Dt.jsx)(Lt,{...m(ho,vr()&&rr!==void 0),hasValue:vr,label:(0,jo.__)("Height"),onDeselect:Vn,isShownByDefault:s.height??Sl.height,panelId:i,children:(0,Dt.jsx)(Yb,{label:(0,jo.__)("Height"),value:Ao,onChange:Go,placeholder:ho?rr:void 0,dimensionSizes:f?.dimensionSizes})}),Sa&&(0,Dt.jsx)(Lt,{...m(Be,zt()&&Ll!==void 0),hasValue:zt,label:(0,jo.__)("Width"),onDeselect:nt,isShownByDefault:s.width??Sl.width,panelId:i,children:(0,Dt.jsx)(Yb,{label:(0,jo.__)("Width"),value:ka,onChange:Ft,placeholder:Be?Ll:void 0,dimensionSizes:f?.dimensionSizes})}),Ir&&(0,Dt.jsx)(_D,{hasValue:X1,value:Gh,onChange:Dy,panelId:i,...m(mF,X1()&&Sn!==void 0),isShownByDefault:s.aspectRatio??Sl.aspectRatio})]})}var vi=c(U(),1),Vu=c(F(),1),V_=c(G(),1);var py=c(G(),1),bn=c(U(),1),BD=c(F(),1);var fo=c(E(),1),RD=[];function nYe({shadow:e,onShadowChange:t,settings:o}){let r=o$(o);return(0,fo.jsx)("div",{className:"block-editor-global-styles__shadow-popover-container",children:(0,fo.jsxs)(bn.__experimentalVStack,{spacing:4,children:[(0,fo.jsx)(bn.__experimentalHeading,{level:5,children:(0,py.__)("Drop shadow")}),(0,fo.jsx)(iYe,{presets:r,activeShadow:e,onSelect:t}),(0,fo.jsx)("div",{className:"block-editor-global-styles__clear-shadow",children:(0,fo.jsx)(bn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t(void 0),disabled:!e,accessibleWhenDisabled:!0,children:(0,py.__)("Clear")})})]})})}function iYe({presets:e,activeShadow:t,onSelect:o}){return e?(0,fo.jsx)(bn.Composite,{role:"listbox",className:"block-editor-global-styles__shadow__list","aria-label":(0,py.__)("Drop shadows"),children:e.map(({name:r,slug:n,shadow:i})=>(0,fo.jsx)(sYe,{label:r,isActive:i===t,type:n==="unset"?"unset":"preset",onSelect:()=>o(i===t?void 0:i),shadow:i},n))}):null}function sYe({type:e,label:t,isActive:o,onSelect:r,shadow:n}){return(0,fo.jsxs)(kt.Root,{children:[(0,fo.jsx)(kt.Trigger,{render:(0,fo.jsx)(bn.Composite.Item,{role:"option","aria-label":t,"aria-selected":o,className:K("block-editor-global-styles__shadow__item",{"is-active":o}),render:(0,fo.jsx)("button",{className:K("block-editor-global-styles__shadow-indicator",{unset:e==="unset"}),onClick:r,style:{boxShadow:n},"aria-label":t,children:o&&(0,fo.jsx)(gt,{icon:ns})})})}),(0,fo.jsx)(kt.Popup,{children:t})]})}function kCe({shadow:e,onShadowChange:t,settings:o,className:r,hasLocalValue:n=!!e,hasLocalOverride:i=!1,onReset:s}){return(0,fo.jsx)(bn.Dropdown,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:K("block-editor-global-styles__shadow-dropdown",r),renderToggle:aYe(e,t,{hasLocalValue:n,hasLocalOverride:i,onReset:s??(()=>t(void 0))}),renderContent:()=>(0,fo.jsx)(bn.__experimentalDropdownContentWrapper,{paddingSize:"medium",children:(0,fo.jsx)(nYe,{shadow:e,onShadowChange:t,settings:o})})})}function aYe(e,t,o){let{hasLocalValue:r,hasLocalOverride:n,onReset:i}=o;return function({onToggle:a,isOpen:l}){let u=(0,BD.useRef)(void 0),d={onClick:a,className:K("block-editor-global-styles__shadow-dropdown-toggle",{"is-open":l}),"aria-expanded":l,ref:u},f=()=>{l&&a(),i(),u.current?.focus()};return(0,fo.jsxs)(fo.Fragment,{children:[(0,fo.jsx)(bn.Button,{__next40pxDefaultSize:!0,...d,children:(0,fo.jsxs)(bn.__experimentalHStack,{justify:"flex-start",children:[(0,fo.jsx)(gt,{className:"block-editor-global-styles__toggle-icon",icon:r6,size:24}),(0,fo.jsx)(bn.FlexItem,{children:(0,py.__)("Drop shadow")})]})}),r&&(n?(0,fo.jsx)(_f,{className:"block-editor-global-styles__shadow-editor__remove-button",onResetToInherited:f}):(0,fo.jsx)(bn.Button,{__next40pxDefaultSize:!0,size:"small",icon:dn,label:(0,py.__)("Remove"),className:"block-editor-global-styles__shadow-editor__remove-button",onClick:f}))]})}}function o$(e){return(0,BD.useMemo)(()=>{if(!e?.shadow)return RD;let t=e?.shadow?.defaultPresets,{default:o,theme:r,custom:n}=e?.shadow?.presets??{},i={name:(0,py.__)("Unset"),slug:"unset",shadow:"none"},s=[...t&&o||RD,...r||RD,...n||RD];return s.length&&s.unshift(i),s},[e])}var kl=c(E(),1);function PD(e){return Object.values(e1(e)).some(Boolean)}function e1(e){return{hasBorderColor:_Ce(e),hasBorderRadius:xCe(e),hasBorderStyle:wCe(e),hasBorderWidth:CCe(e),hasShadow:ECe(e)}}function _Ce(e){return e?.border?.color}function xCe(e){return e?.border?.radius}function wCe(e){return e?.border?.style}function CCe(e){return e?.border?.width}function ECe(e){let t=o$(e);return!!e?.shadow&&t.length>0}function lYe({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n,label:i}){let s=xr();return(0,kl.jsx)(vi.__experimentalToolsPanel,{label:i,resetAll:()=>{let l=e(o);t(l)},panelId:r,dropdownMenuProps:s,children:n})}var cYe={radius:!0,color:!0,width:!0,shadow:!0};function ID({as:e=lYe,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,name:s,defaultControls:a=cYe,showInheritanceLabelIndicators:l=gn()}){let u=Du(n),d=n?.color?.custom,f=(0,Vu.useCallback)(X=>Ea({settings:n},"",X),[n]),p=(X,re,ae)=>yl(l&&X,l&&re,ae),h=X=>{let ae=u.flatMap(({colors:ve})=>ve).find(({color:ve})=>ve===X);return ae?"var:preset|color|"+ae.slug:X},m=(0,Vu.useCallback)(X=>{if(X){if((0,vi.__experimentalHasSplitBorders)(X)){let re={...X};return["top","right","bottom","left"].forEach(ae=>{re[ae]={...re[ae],color:f(re[ae]?.color)}}),re}return{...X,color:X.color?f(X.color):void 0}}},[f]),g=(0,Vu.useMemo)(()=>m(t?.border),[t?.border,m]),b=(0,Vu.useMemo)(()=>m(r?.border),[r?.border,m]),v=!(0,vi.__experimentalIsDefinedBorder)(t?.border)&&!!b&&(0,vi.__experimentalIsDefinedBorder)(b),y=v?b:g,k=X=>o({...t,border:X}),S=_Ce(n),_=wCe(n),x=CCe(n),w=xCe(n),T=(0,Vu.useMemo)(()=>typeof t?.border?.radius!="object"?f(t?.border?.radius):{topLeft:f(t?.border?.radius?.topLeft),topRight:f(t?.border?.radius?.topRight),bottomLeft:f(t?.border?.radius?.bottomLeft),bottomRight:f(t?.border?.radius?.bottomRight)},[t?.border?.radius,f]),B=(0,Vu.useMemo)(()=>{let X=r?.border?.radius;return typeof X!="object"?f(X):{topLeft:f(X?.topLeft),topRight:f(X?.topRight),bottomLeft:f(X?.bottomLeft),bottomRight:f(X?.bottomRight)}},[r?.border?.radius,f]),R=X=>k({...t?.border,radius:X}),I=()=>{let X=t?.border?.radius;return typeof X=="object"?Object.entries(X).some(([,re])=>!!re):!!X},A=!I()&&B!==void 0&&B!=="",P=(0,Vu.useMemo)(()=>{if(!A)return T;if(typeof B=="string")return B;let X=B;return X?{all:X.topLeft&&X.topLeft===X.topRight&&X.topLeft===X.bottomLeft&&X.topLeft===X.bottomRight?X.topLeft:void 0,...X}:T},[A,T,B]),O=ECe(n),N=f(t?.shadow),z=f(r?.shadow),V=N===void 0&&z!==void 0&&z!=="",M=V?z:N,D=n?.shadow?.presets??{},L=D.custom??D.theme??D.default??[],j=X=>{let re=L?.find(({shadow:ae})=>ae===X)?.slug;o(De(t,["shadow"],re?`var:preset|shadow|${re}`:X||void 0))},q=X=>{if(V&&X===void 0){j(z);return}j(X)},J=()=>!!t?.shadow,te=()=>j(void 0),ee=l&&J()&&z!==void 0,$=()=>{if(I())return k({radius:t?.border?.radius});k(void 0)},W=X=>{let re={...X};(0,vi.__experimentalHasSplitBorders)(re)?["top","right","bottom","left"].forEach(ae=>{re[ae]&&(re[ae]={...re[ae],color:h(re[ae]?.color)})}):re&&(re.color=h(re.color)),k({...re,radius:t?.border?.radius})},Y=(0,Vu.useCallback)(X=>({...X,border:void 0,shadow:void 0}),[]),Z=a?.color||a?.width,oe=S||_||x||w,ne=my({blockName:s,hasShadowControl:O,hasBorderControl:oe});return(0,kl.jsxs)(e,{resetAllFilter:Y,value:t,onChange:o,panelId:i,label:ne,children:[(x||S)&&(0,kl.jsxs)(Lt,{...p(v,(0,vi.__experimentalIsDefinedBorder)(t?.border)&&!!b&&(0,vi.__experimentalIsDefinedBorder)(b)),hasValue:()=>(0,vi.__experimentalIsDefinedBorder)(t?.border),label:(0,V_.__)("Border"),onDeselect:()=>$(),isShownByDefault:Z,panelId:i,children:[(l||O)&&(0,kl.jsx)(vi.BaseControl.VisualLabel,{as:"legend",children:(0,V_.__)("Border")}),(0,kl.jsx)(vi.BorderBoxControl,{colors:u,disableCustomColors:!d,enableAlpha:!0,enableStyle:_,onChange:W,popoverOffset:40,popoverPlacement:"left-start",value:y,__experimentalIsRenderedInSidebar:!0})]}),w&&(0,kl.jsx)(Lt,{...p(A,I()&&B!==void 0),hasValue:I,label:(0,V_.__)("Radius"),hasInlineEndToggle:!0,onDeselect:()=>R(void 0),isShownByDefault:a.radius,panelId:i,children:(0,kl.jsx)(FM,{presets:n?.border?.radiusSizes,values:P,onChange:X=>{R(X||void 0)}})}),O&&(0,kl.jsxs)(Lt,{...p(V,J()&&z!==void 0),label:(0,V_.__)("Shadow"),hasValue:J,onDeselect:te,isShownByDefault:a.shadow,showLocalOverrideActionsInLabel:!1,panelId:i,children:[oe?(0,kl.jsx)(vi.BaseControl.VisualLabel,{as:"legend",children:(0,V_.__)("Shadow")}):null,(0,kl.jsx)(kCe,{shadow:M,onShadowChange:q,settings:n,hasLocalValue:J(),hasLocalOverride:ee,onReset:te})]})]})}var Ho=c(U(),1),wf=c(G(),1),F_=c(F(),1);var mr=c(E(),1),OD=[];function TCe(e,{presetSetting:t,defaultSetting:o}){let r=!e?.color?.[o],n=e?.color?.[t]?.custom||OD,i=e?.color?.[t]?.theme||OD,s=e?.color?.[t]?.default||OD;return(0,F_.useMemo)(()=>[...n,...i,...r?OD:s],[r,n,i,s])}function RCe(e){return BCe(e)}function BCe(e){return e.color.customDuotone||e.color.defaultDuotone||e.color.duotone.length>0}function uYe({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n}){let i=xr(),s=()=>{let a=e(o);t(a)};return(0,mr.jsx)(Ho.__experimentalToolsPanel,{label:(0,wf._x)("Filters","Name for applying graphical effects"),resetAll:s,panelId:r,dropdownMenuProps:i,children:n})}var dYe={duotone:!0},fYe={placement:"left-start",offset:36,shift:!0,className:"block-editor-duotone-control__popover",headerTitle:(0,wf.__)("Duotone")},pYe=({indicator:e,label:t})=>(0,mr.jsxs)(Ho.__experimentalHStack,{justify:"flex-start",children:[(0,mr.jsx)(Ho.__experimentalZStack,{isLayered:!1,offset:-8,children:(0,mr.jsx)(Ho.Flex,{expanded:!1,children:e==="unset"||!e?(0,mr.jsx)(Ho.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):(0,mr.jsx)(Ho.DuotoneSwatch,{values:e})})}),(0,mr.jsx)(Ho.FlexItem,{className:"block-editor-panel-duotone-settings__label",title:t,children:t})]}),mYe=(e,t)=>function({onToggle:r,isOpen:n}){let{hasLocalValue:i,hasLocalOverride:s,onReset:a}=t,l=(0,F_.useRef)(void 0),u={onClick:r,className:K("block-editor-global-styles-filters-panel__dropdown-toggle",{"is-open":n}),"aria-expanded":n,ref:l},d=()=>{n&&r(),a(),l.current?.focus()};return(0,mr.jsxs)(mr.Fragment,{children:[(0,mr.jsx)(Ho.Button,{__next40pxDefaultSize:!0,...u,children:(0,mr.jsx)(pYe,{indicator:e,label:(0,wf.__)("Duotone")})}),i&&(s?(0,mr.jsx)(_f,{className:"block-editor-panel-duotone-settings__reset",onResetToInherited:d}):(0,mr.jsx)(Ho.Button,{size:"small",icon:dn,label:(0,wf.__)("Reset"),className:"block-editor-panel-duotone-settings__reset",onClick:d}))]})};function AD({as:e=uYe,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,defaultControls:s=dYe,showInheritanceLabelIndicators:a=gn()}){let l=w=>Ea({settings:n},"",w),u=(w,T,B)=>yl(a&&w,a&&T,B),d=BCe(n),f=TCe(n,{presetSetting:"duotone",defaultSetting:"defaultDuotone"}),p=TCe(n,{presetSetting:"palette",defaultSetting:"defaultPalette"}),h=l(t?.filter?.duotone),m=l(r?.filter?.duotone),g=h??m,b=h===void 0&&m!==void 0,v=w=>{let T=f.find(({colors:R})=>R===w),B=T?`var:preset|duotone|${T.slug}`:w;o(De(t,["filter","duotone"],B))},y=w=>{if(w===void 0&&b&&m!==void 0){v(m);return}v(w)},k=()=>!!t?.filter?.duotone,S=()=>v(void 0),_=a&&k()&&m!==void 0,x=(0,F_.useCallback)(w=>({...w,filter:{...w.filter,duotone:void 0}}),[]);return(0,mr.jsx)(e,{resetAllFilter:x,value:t,onChange:o,panelId:i,children:d&&(0,mr.jsx)(Lt,{...u(b,h!==void 0&&m!==void 0),label:(0,wf.__)("Duotone"),hasValue:k,onDeselect:S,isShownByDefault:s.duotone,showLocalOverrideActionsInLabel:!1,panelId:i,children:(0,mr.jsx)(Ho.Dropdown,{popoverProps:fYe,className:"block-editor-global-styles-filters-panel__dropdown",renderToggle:mYe(g,{hasLocalValue:k(),hasLocalOverride:_,onReset:S}),renderContent:()=>(0,mr.jsx)(Ho.__experimentalDropdownContentWrapper,{paddingSize:"small",children:(0,mr.jsxs)(Ho.MenuGroup,{label:(0,wf.__)("Duotone"),children:[(0,mr.jsx)("p",{children:(0,wf.__)("Create a two-tone color effect without losing your original image.")}),(0,mr.jsx)(Ho.DuotonePicker,{colorPalette:p,duotonePalette:f,disableCustomColors:!0,disableCustomDuotone:!0,value:g,onChange:y})]})})})})})}var z_=c(U(),1),t1=c(G(),1);var hy=c(E(),1);function PCe(e,t,o){return e==="core/image"&&o?.lightbox?.allowEditing||!!t?.lightbox}function ICe({onChange:e,value:t,inheritedValue:o,panelId:r}){let n=xr(),i=()=>{e(void 0)},s=l=>{e({enabled:l})},a=!1;return o?.lightbox?.enabled&&(a=o.lightbox.enabled),(0,hy.jsx)(hy.Fragment,{children:(0,hy.jsx)(z_.__experimentalToolsPanel,{label:(0,t1._x)("Settings","Image settings"),resetAll:i,panelId:r,dropdownMenuProps:n,children:(0,hy.jsx)(z_.__experimentalToolsPanelItem,{hasValue:()=>!!t?.lightbox,label:(0,t1.__)("Enlarge on click"),onDeselect:i,isShownByDefault:!0,panelId:r,children:(0,hy.jsx)(z_.ToggleControl,{label:(0,t1.__)("Enlarge on click"),checked:a,onChange:s})})})})}var LD=c(U(),1);var ACe=c(F(),1),MD=c(G(),1);var o1=c(E(),1);function r$(e){return!(typeof e=="string"&&/<\/?\w/.test(e))}function LCe(e){return r$(e)?null:(0,MD.__)("The custom CSS is invalid. Do not use <> markup.")}function OCe(e){if(!e)return null;let t=LCe(e);if(t)return t;let[o]=zS([{css:e}],".for-validation-only");return o===null?(0,MD.__)("There is an error with your CSS structure."):null}function ND({value:e,onChange:t,inheritedValue:o=e,help:r}){let n=o?.css,[i,s]=(0,ACe.useState)(()=>OCe(n));function a(u){t({...e,css:u}),s(LCe(u))}function l(u){s(OCe(u?.target?.value))}return(0,o1.jsxs)(Qe,{direction:"column",gap:"md",className:"block-editor-global-styles-advanced-panel",children:[i&&(0,o1.jsx)(LD.Notice,{status:"error",onRemove:()=>s(null),children:i}),(0,o1.jsx)(LD.TextareaControl,{label:(0,MD.__)("Additional CSS"),value:n,onChange:u=>a(u),onBlur:l,className:"block-editor-global-styles-advanced-panel__custom-css-input",spellCheck:!1,help:r})]})}var HCe=c(U(),1),UCe=c(F(),1),Ef=c(G(),1);var yt=c(U(),1);var Uo=c(G(),1),NCe=c(as(),1),n$=c(Fs(),1),Cf=c(F(),1),n1=c(Q(),1),DCe=c(Tt(),1),VCe=c(t9(),1);var ft=c(E(),1),DD="image",hYe={placement:"left-start",offset:36,shift:!0,className:"block-editor-global-styles-background-panel__popover"},VD=()=>{},r1=e=>{window.requestAnimationFrame(()=>{let[t]=DCe.focus.tabbable.find(e?.current);t&&t.focus()})};function gYe(e){return e==="cover"||e===void 0?(0,Uo.__)("Image covers the space evenly."):e==="contain"?(0,Uo.__)("Image is contained without distortion."):(0,Uo.__)("Image has a fixed width.")}var bYe=e=>{if(!e||isNaN(e.x)&&isNaN(e.y))return;let t=isNaN(e.x)?.5:e.x,o=isNaN(e.y)?.5:e.y;return`${t*100}% ${o*100}%`},yYe=e=>{if(!e)return{x:void 0,y:void 0};let[t,o]=e.split(" ").map(r=>parseFloat(r)/100);return t=isNaN(t)?void 0:t,o=isNaN(o)?t:o,{x:t,y:o}};function FCe({as:e="span",imgUrl:t,toggleProps:o={},filename:r,label:n,onToggleCallback:i=VD}){let{isOpen:s,...a}=o;(0,Cf.useEffect)(()=>{typeof s<"u"&&i(s)},[s,i]);let l=()=>(0,ft.jsxs)(yt.__experimentalHStack,{className:"block-editor-global-styles-background-panel__inspector-preview-inner",children:[(0,ft.jsx)("span",{className:"block-editor-global-styles-background-panel__inspector-image-indicator",style:{backgroundImage:t?`url(${t})`:void 0}}),(0,ft.jsxs)(yt.FlexBlock,{children:[(0,ft.jsx)(yt.__experimentalTruncate,{numberOfLines:1,className:"block-editor-global-styles-background-panel__inspector-media-replace-title",children:n}),(0,ft.jsx)(bt,{render:(0,ft.jsx)("span",{}),children:t?(0,Uo.sprintf)((0,Uo.__)("Background image: %s"),r||n):(0,Uo.__)("No background image selected")})]})]});return e==="button"?(0,ft.jsx)(yt.Button,{__next40pxDefaultSize:!0,...a,children:l()}):l()}function vYe({label:e,filename:t,url:o,children:r,onToggle:n=VD,hasImageValue:i,onReset:s,hasLocalOverride:a,containerRef:l}){if(!i)return;let u=e||(0,n$.getFilename)(o)||(0,Uo.__)("Image");return(0,ft.jsx)(yt.Dropdown,{popoverProps:hYe,renderToggle:({onToggle:d,isOpen:f})=>{let p={onClick:d,className:"block-editor-global-styles-background-panel__dropdown-toggle","aria-expanded":f,"aria-label":(0,Uo.__)("Background size, position and repeat options."),isOpen:f};return(0,ft.jsxs)(ft.Fragment,{children:[(0,ft.jsx)(FCe,{imgUrl:o,filename:t,label:u,toggleProps:p,as:"button",onToggleCallback:n}),s&&(a?(0,ft.jsx)(_f,{className:"block-editor-global-styles-background-panel__reset",onResetToInherited:()=>{s(),f&&d(),r1(l)}}):(0,ft.jsx)(yt.Button,{__next40pxDefaultSize:!0,label:(0,Uo.__)("Reset"),className:"block-editor-global-styles-background-panel__reset",size:"small",icon:dn,onClick:()=>{s(),f&&d(),r1(l)}}))]})},renderContent:()=>(0,ft.jsx)(yt.__experimentalDropdownContentWrapper,{className:"block-editor-global-styles-background-panel__dropdown-content-wrapper",paddingSize:"medium",children:r})})}function SYe(){return(0,ft.jsx)(yt.Placeholder,{className:"block-editor-global-styles-background-panel__loading",children:(0,ft.jsx)(yt.Spinner,{})})}function MCe({onChange:e,style:t,inheritedValue:o,onRemoveImage:r=VD,onResetImage:n=VD,displayInPanel:i,defaultValues:s,containerRef:a}){let[l,u]=(0,Cf.useState)(!1),{getSettings:d}=(0,n1.useSelect)(C),{id:f,title:p,url:h}=t?.background?.backgroundImage||{...o?.background?.backgroundImage},{createErrorNotice:m}=(0,n1.useDispatch)(NCe.store),g=w=>{m(w,{type:"snackbar"}),u(!1)},b=()=>e(De(t,["background","backgroundImage"],void 0)),v=w=>{if(!w||!w.url){b(),u(!1);return}if((0,VCe.isBlobURL)(w.url)){u(!0);return}if(w.media_type&&w.media_type!==DD||!w.media_type&&w.type&&w.type!==DD){g((0,Uo.__)("Only images can be used as a background image."));return}let T=t?.background?.backgroundSize||s?.backgroundSize,B=t?.background?.backgroundPosition;e(De(t,["background"],{...t?.background,backgroundImage:{url:w.url,id:w.id,source:"file",title:w.title||void 0},backgroundPosition:!B&&(T==="auto"||!T)?"50% 0":B,backgroundSize:T})),u(!1),r1(a)},y=w=>{d().mediaUpload({allowedTypes:[DD],filesList:w,onFileChange([T]){v(T)},onError:g,multiple:!1})},k=Ec(t),S=()=>e(De(t,["background"],{backgroundImage:"none"})),_=!k&&Ec(o),x=p||(0,n$.getFilename)(h)||(0,Uo.__)("Image");return(0,ft.jsxs)("div",{className:"block-editor-global-styles-background-panel__image-tools-panel-item",children:[l&&(0,ft.jsx)(SYe,{}),(0,ft.jsx)(b_,{mediaId:f,mediaURL:h,allowedTypes:[DD],accept:"image/*",onSelect:v,popoverProps:{className:K({"block-editor-global-styles-background-panel__media-replace-popover":i})},name:(0,ft.jsx)(FCe,{imgUrl:h,filename:p,label:x}),renderToggle:w=>(0,ft.jsx)(yt.Button,{...w,__next40pxDefaultSize:!0}),onError:g,onReset:()=>{r1(a),n()},children:_&&(0,ft.jsx)(yt.MenuItem,{onClick:()=>{r1(a),S(),r()},children:(0,Uo.__)("Remove")})}),(0,ft.jsx)(yt.DropZone,{onFilesDrop:y,label:(0,Uo.__)("Drop to upload")})]})}function kYe({onChange:e,style:t,inheritedValue:o,defaultValues:r}){let n=t?.background?.backgroundSize,i=t?.background?.backgroundRepeat,s=t?.background?.backgroundPosition,a=t?.background?.backgroundAttachment,l=o?.background?.backgroundSize,u=o?.background?.backgroundRepeat,d=o?.background?.backgroundPosition,f=o?.background?.backgroundAttachment,p=n||l,h=i||u,m=t?.background?.backgroundImage?.url||o?.background?.backgroundImage?.url,g=t?.background?.backgroundImage?.id,b=s||d,v=a||f,y=!p&&g?r?.backgroundSize:p||"auto";y=["cover","contain","auto"].includes(y)?y:"auto";let k=!(h==="no-repeat"||y==="cover"&&h===void 0),S=B=>{let R=h,I=b;B==="contain"&&(R="no-repeat",I=void 0),B==="cover"&&(R=void 0,I=void 0),(y==="cover"||y==="contain")&&B==="auto"&&(R=void 0,t?.background?.backgroundImage?.id&&(I="50% 0")),!B&&y==="auto"&&(B="auto"),e(De(t,["background"],{...t?.background,backgroundPosition:I,backgroundRepeat:R,backgroundSize:B}))},_=B=>{e(De(t,["background","backgroundPosition"],bYe(B)))},x=()=>e(De(t,["background","backgroundRepeat"],k===!0?"no-repeat":"repeat")),w=()=>e(De(t,["background","backgroundAttachment"],v==="fixed"?"scroll":"fixed")),T=!b&&g&&p==="contain"?r?.backgroundPosition:b;return(0,ft.jsxs)(yt.__experimentalVStack,{spacing:3,className:"single-column",children:[(0,ft.jsx)(yt.FocalPointPicker,{label:(0,Uo.__)("Focal point"),url:m,value:yYe(T),onChange:_}),(0,ft.jsx)(yt.ToggleControl,{label:(0,Uo.__)("Fixed background"),checked:v==="fixed",onChange:w}),(0,ft.jsxs)(yt.__experimentalToggleGroupControl,{label:(0,Uo.__)("Size"),value:y,onChange:S,isBlock:!0,help:gYe(p||r?.backgroundSize),children:[(0,ft.jsx)(yt.__experimentalToggleGroupControlOption,{value:"cover",label:(0,Uo._x)("Cover","Size option for background image control")},"cover"),(0,ft.jsx)(yt.__experimentalToggleGroupControlOption,{value:"contain",label:(0,Uo._x)("Contain","Size option for background image control")},"contain"),(0,ft.jsx)(yt.__experimentalToggleGroupControlOption,{value:"auto",label:(0,Uo._x)("Tile","Size option for background image control")},"tile")]}),(0,ft.jsxs)(yt.__experimentalHStack,{justify:"flex-start",spacing:2,as:"span",children:[(0,ft.jsx)(yt.__experimentalUnitControl,{"aria-label":(0,Uo.__)("Background image width"),onChange:S,value:p,__unstableInputWidth:"100px",min:0,placeholder:(0,Uo.__)("Auto"),disabled:y!=="auto"||y===void 0}),(0,ft.jsx)(yt.ToggleControl,{label:(0,Uo.__)("Repeat"),checked:k,onChange:x,disabled:y==="cover"})]})]})}function zCe({value:e,onChange:t,inheritedValue:o=e,settings:r,defaultValues:n={},showInheritanceLabelIndicators:i=gn()}){let{globalStyles:s,_links:a}=(0,n1.useSelect)(S=>{let{getSettings:_}=S(C),x=_();return{globalStyles:x[rs],_links:x[Gy]}},[]),l=(0,Cf.useMemo)(()=>{let S={background:{}};return o?.background?(Object.entries(o?.background).forEach(([_,x])=>{S.background[_]=ap(x,{styles:s,_links:a})}),S):o},[s,a,o]),u=()=>t(De(e,["background"],{gradient:e?.background?.gradient})),{title:d,url:f}=e?.background?.backgroundImage||{...l?.background?.backgroundImage},p=Ec(e),h=p||Ec(l),m=i&&p&&Ec(l),g=e?.background?.backgroundImage||o?.background?.backgroundImage,b=h&&g!=="none"&&(r?.background?.backgroundSize||r?.background?.backgroundPosition||r?.background?.backgroundRepeat),[v,y]=(0,Cf.useState)(!1),k=(0,Cf.useRef)();return(0,ft.jsx)("div",{ref:k,className:K("block-editor-global-styles-background-panel__inspector-media-replace-container",{"is-open":v}),children:b?(0,ft.jsx)(vYe,{label:d,filename:d,url:f,onToggle:y,hasImageValue:h,hasLocalOverride:m,onReset:p?u:void 0,containerRef:k,children:(0,ft.jsxs)(yt.__experimentalVStack,{spacing:3,className:"single-column",children:[(0,ft.jsx)(MCe,{onChange:t,style:e,inheritedValue:l,displayInPanel:!0,onResetImage:()=>{y(!1),u()},onRemoveImage:()=>y(!1),defaultValues:n,containerRef:k}),(0,ft.jsx)(kYe,{onChange:t,style:e,defaultValues:n,inheritedValue:l})]})}):(0,ft.jsx)(MCe,{onChange:t,style:e,inheritedValue:l,defaultValues:n,onResetImage:()=>{y(!1),u()},onRemoveImage:()=>y(!1),containerRef:k})})}var Fu=c(E(),1),_Ye={backgroundImage:!0,backgroundColor:!0,gradient:!0};function jCe(e,t){return e?.background?.[t]}function FD(e){let t=qW(e),{backgroundImage:o,gradient:r}=e?.background||{};return o||r||t}function Ec(e){return!!e?.background?.backgroundImage?.id||typeof e?.background?.backgroundImage=="string"||!!e?.background?.backgroundImage?.url}function i$(e){return typeof e?.background?.gradient=="string"&&e?.background?.gradient!==""}function xYe(e){return!!e?.color?.background}function wYe(e){return!!e?.color?.gradient}function s$({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n,headerLabel:i}){let s=xr();return(0,Fu.jsx)(HCe.__experimentalToolsPanel,{label:i,resetAll:()=>{let l=e(o);t(l)},panelId:r,hasInnerWrapper:!0,className:"background-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:s,children:(0,Fu.jsx)("div",{className:"background-block-support-panel__inner-wrapper",children:n})})}function zD({as:e=s$,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,defaultControls:s=_Ye,defaultValues:a={},headerLabel:l=(0,Ef.__)("Background"),contrastWarning:u,showInheritanceLabelIndicators:d=gn()}){let{colors:f,gradients:p,allColors:h,areCustomSolidsEnabled:m,areCustomGradientsEnabled:g,hasSolidColors:b,hasGradientColors:v,decodeValue:y,encodeGradientValue:k}=A_(n),S=jCe(n,"gradient"),_=qW(n),x=_&&b,w=v&&S,T=_&&v&&!S,B=jCe(n,"backgroundImage"),R=(0,UCe.useCallback)(W=>{let Y=x,Z=S||T;return!Y&&!Z?{...W,background:{}}:{...W,background:{},color:{...W?.color,...Y&&{background:void 0},...Z&&{gradient:void 0}}}},[S,x,T]);if(!B&&!x&&!w&&!T)return null;let I=()=>o(De(t,["background","backgroundImage"],void 0)),A=()=>{let W=De(t,["background","gradient"],void 0);W=De(W,["color","gradient"],void 0),o(W)},P=y(r?.color?.background),O=y(t?.color?.background),N=(W,Y)=>{let Z=De(t,["color","background"],xf(h,W,Y));T&&(Z.color.gradient=void 0),o(Z)},z=()=>{let W=De(t,["color","background"],void 0);T&&(W.color.gradient=void 0),o(W)},V=y(r?.color?.gradient),M=y(t?.color?.gradient),D=(W,Y)=>{let Z=De(t,["color","gradient"],k(W,Y));Z.color.background=void 0,o(Z)},L=()=>o(De(t,["color","gradient"],void 0)),j=y(t?.background?.gradient??t?.color?.gradient),q=y(r?.background?.gradient??r?.color?.gradient),J=(W,Y)=>{let Z=De(t,["background","gradient"],k(W,Y));Z=De(Z,["color","gradient"],void 0),o(Z)},te=(W,Y,Z)=>d?yl(W,Y,Z):{className:Z},ee=Ec({background:{backgroundImage:r?.background?.backgroundImage}}),$=Ec(t);return(0,Fu.jsxs)(e,{resetAllFilter:R,value:t,onChange:o,panelId:i,headerLabel:l,children:[B&&(0,Fu.jsx)(Lt,{...te(ee&&!$,$&&ee,"block-editor-color-gradient-item"),showLocalOverrideActionsInLabel:!1,hasValue:()=>Ec(t),label:(0,Ef.__)("Image"),onDeselect:I,isShownByDefault:s.backgroundImage,panelId:i,children:(0,Fu.jsx)(zCe,{value:t,onChange:o,settings:n,inheritedValue:r,defaultControls:s,defaultValues:a,showInheritanceLabelIndicators:d})}),x&&(0,Fu.jsx)(lh,{label:(0,Ef.__)("Color"),hasValue:()=>xYe(t),resetValue:z,isShownByDefault:s.backgroundColor,indicators:[O??P],contrastWarning:u,showInheritanceLabelIndicators:d,isPlaceholder:O===void 0&&P!==void 0,hasInheritedValue:P!==void 0,tabs:[{key:"background",label:(0,Ef.__)("Color"),inheritedValue:P,inheritedSlug:Po(r?.color?.background,"color"),userSlug:Po(t?.color?.background,"color"),setValue:N,userValue:O,isPlaceholder:O===void 0&&P!==void 0}],colorGradientControlSettings:{colors:f,disableCustomColors:!m},panelId:i}),w&&(0,Fu.jsx)(lh,{label:(0,Ef.__)("Gradient"),hasValue:()=>i$(t),resetValue:A,isShownByDefault:s.gradient,indicators:[j??q],showInheritanceLabelIndicators:d,isPlaceholder:j===void 0&&q!==void 0,hasInheritedValue:q!==void 0,tabs:[{key:"gradient",label:(0,Ef.__)("Gradient"),inheritedValue:q,inheritedSlug:Po(r?.background?.gradient??r?.color?.gradient,"gradient"),userSlug:Po(t?.background?.gradient??t?.color?.gradient,"gradient"),setValue:J,userValue:j,isGradient:!0,isPlaceholder:j===void 0&&q!==void 0}],colorGradientControlSettings:{gradients:p,disableCustomGradients:!g},panelId:i}),T&&(0,Fu.jsx)(lh,{label:(0,Ef.__)("Gradient"),hasValue:()=>wYe(t),resetValue:L,isShownByDefault:s.gradient,indicators:[M??V],showInheritanceLabelIndicators:d,isPlaceholder:M===void 0&&V!==void 0,hasInheritedValue:V!==void 0,tabs:[{key:"gradient",label:(0,Ef.__)("Gradient"),inheritedValue:V,inheritedSlug:Po(r?.color?.gradient,"gradient"),userSlug:Po(t?.color?.gradient,"gradient"),setValue:D,userValue:M,isGradient:!0,isPlaceholder:M===void 0&&V!==void 0}],colorGradientControlSettings:{gradients:p,disableCustomGradients:!g},panelId:i})]})}var zu=c(G(),1);var ch=c(U(),1);var Tc=c(E(),1);function jD({viewportStates:e=[],pseudoStates:t=[],viewportValue:o="default",pseudoStateValue:r="default",onChangeViewport:n,onChangePseudoState:i,showText:s=!0,popoverProps:a={}}){if(!e.length&&!t.length)return null;let l=[{label:(0,zu.__)("Default"),value:"default"},...e.map(v=>({label:v.label,value:v.value}))],u=[{label:(0,zu.__)("Default"),value:"default"},...t.map(v=>({label:v.label,value:v.value}))],d=e.length>0,f=t.length>0,p=(0,zu.__)("States"),h=[];if(d&&o!=="default"){let v=l.find(y=>y.value===o);v&&h.push({key:`viewport-${v.value}`,label:v.label})}if(f&&r!=="default"){let v=u.find(y=>y.value===r);v&&h.push({key:`pseudo-${v.value}`,label:v.label})}let m=h.length?h.map(v=>v.label).join(", "):(0,zu.__)("Default"),g=s?cn:zs,b=s?{size:"compact",iconPosition:"right"}:{size:"small"};return(0,Tc.jsx)(Qe,{direction:"column",gap:"sm",align:"flex-end",className:"block-editor-global-styles-state-control",children:(0,Tc.jsx)(ch.DropdownMenu,{icon:g,label:s?p:(0,zu.sprintf)((0,zu.__)("State: %s"),m),popoverProps:{placement:"right-start",...a},text:s?p:void 0,toggleProps:b,children:({onClose:v})=>(0,Tc.jsxs)(Tc.Fragment,{children:[d&&(0,Tc.jsx)(ch.MenuGroup,{label:(0,zu.__)("Viewport"),children:l.map(y=>(0,Tc.jsx)(ch.MenuItem,{onClick:()=>{n?.(y.value),f||v()},icon:o===y.value?ns:null,children:y.label},`viewport-${y.value}`))}),f&&(0,Tc.jsx)(ch.MenuGroup,{label:(0,zu.__)("Pseudo state"),children:u.map(y=>(0,Tc.jsx)(ch.MenuItem,{onClick:()=>{i?.(y.value),d||v()},icon:r===y.value?ns:null,children:y.label},`pseudo-${y.value}`))})]})})})}var GCe=c(U(),1),j_=c(G(),1);var ju=c(E(),1),{Badge:CYe}=H(GCe.privateApis);function HD({viewportStates:e=[],pseudoStates:t=[],viewportValue:o="default",pseudoStateValue:r="default",className:n="block-editor-global-styles-state-control__badges"}){let i=[],s=e.find(l=>l.value===o),a=t.find(l=>l.value===r);return s&&i.push({key:`viewport-${s.value}`,label:s.label,tooltipText:(0,j_.sprintf)((0,j_.__)("Style changes apply to the %s viewport."),s.label)}),a&&i.push({key:`pseudo-${a.value}`,label:a.label,tooltipText:(0,j_.sprintf)((0,j_.__)("Style changes apply to the %s state."),a.label)}),(0,ju.jsx)(Qe,{className:n,direction:"row",justify:"flex-start",gap:"xs",wrap:"wrap",children:i.map(l=>{let u=(0,ju.jsxs)(CYe,{className:"block-editor-global-styles-state-control__badge",intent:"info",children:[l.label,!!l.tooltipText&&(0,ju.jsx)(bt,{render:(0,ju.jsx)("span",{}),children:l.tooltipText})]},l.key);return l.tooltipText?(0,ju.jsxs)(kt.Root,{children:[(0,ju.jsx)(kt.Trigger,{render:(0,ju.jsx)("span",{className:"block-editor-global-styles-state-control__badge-tooltip-trigger",children:u})}),(0,ju.jsx)(kt.Popup,{children:l.tooltipText})]},l.key):u})})}var c1=c(F(),1),u$=c(Q(),1),KCe=c(ue(),1);var a1=c(ue(),1),i1=c(Q(),1),UD=c(F(),1);var s1=c(E(),1),{getVariationStyle:EYe}=H(Sr),l$="is-style-";function WCe(e){return e?e.split(/\s+/).reduce((t,o)=>{if(o.startsWith(l$)){let r=o.slice(l$.length);r!=="default"&&t.push(r)}return t},[]):[]}function l1(e,t=[]){let o=WCe(e);if(!o)return null;for(let r of o)if(t.some(n=>n.name===r))return r;return null}function TYe({override:e}){Rc(e)}function c$({config:e}){let{overrides:t}=(0,i1.useSelect)(n=>({overrides:H(n(C)).getStyleOverrides()}),[]),{getBlockName:o}=(0,i1.useSelect)(C),r=(0,UD.useMemo)(()=>{if(!t?.length)return;let n=[],i=[];for(let[,s]of t)if(s?.variation&&s?.clientId&&!i.includes(s.clientId)){let a=o(s.clientId),l=e?.styles?.blocks?.[a]?.variations?.[s.variation];if(l){let u={settings:e?.settings,styles:{blocks:{[a]:{variations:{[`${s.variation}-${s.clientId}`]:l}}}}},d=_B((0,a1.getBlockTypes)(),s.clientId),g=kB(u,d,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0});n.push({id:`${s.variation}-${s.clientId}`,css:g,__unstableType:"variation",variation:s.variation,clientId:s.clientId}),i.push(s.clientId)}}return n},[e,t,o]);return!r||!r.length?null:(0,s1.jsx)(s1.Fragment,{children:r.map(n=>(0,s1.jsx)(TYe,{override:n},n.id))})}function RYe(e,t,o){let{globalSettings:r,globalStyles:n}=(0,i1.useSelect)(i=>{let s=i(C).getSettings();return{globalSettings:s.__experimentalFeatures,globalStyles:s[rs]}},[]);return(0,UD.useMemo)(()=>{let i=EYe({settings:r,styles:n},e,t);return{settings:r,styles:{blocks:{[e]:{variations:{[`${t}-${o}`]:i}}}}}},[r,n,t,o,e])}function BYe({name:e,className:t,clientId:o}){let{getBlockStyles:r}=(0,i1.useSelect)(a1.store),n=r(e),i=l1(t,n),s=`${l$}${i}-${o}`,{settings:a,styles:l}=RYe(e,i,o),u=(0,UD.useMemo)(()=>{if(!i)return;let d={settings:a,styles:l},f=_B((0,a1.getBlockTypes)(),o);return kB(d,f,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0})},[i,a,l,o]);return Rc({id:`variation-${o}`,css:u,__unstableType:"variation",variation:i,clientId:o}),i?{className:s}:{}}var $Ce={hasSupport:()=>!0,attributeKeys:["className"],isMatch:({className:e})=>WCe(e).length>0,useBlockProps:BYe};var{resolveStyle:PYe}=H(Sr),IYe={value:void 0,sources:void 0};function OYe(){let{rawGlobalStylesData:e,links:t}=(0,u$.useSelect)(o=>{let r=o(C).getSettings();return{rawGlobalStylesData:r[rs]??null,links:r[Gy]??null}},[]);return(0,c1.useMemo)(()=>e?{styles:e,_links:t??void 0}:null,[e,t])}var YCe={"core/accordion-heading":{contextKey:"core/accordion-heading-level",fallbackLevel:3}};function AYe(e,t,o){let r=YCe[e];return r?t||o||r.fallbackLevel:t}function LYe(e){let t=(0,c1.useContext)(_n),o=YCe[e]?.contextKey;return o?t[o]:void 0}function MYe(e,t){switch(e){case"core/button":return["button"];case"core/accordion-heading":case"core/heading":case"core/post-title":case"core/site-title":case"core/query-title":case"core/comments-title":case"core/term-name":case"core/site-tagline":return t===0?[]:t?["heading",`h${t}`]:["heading"];case"core/read-more":case"core/loginout":case"core/post-navigation-link":case"core/query-pagination-next":case"core/query-pagination-previous":case"core/query-pagination-numbers":case"core/comments-pagination-next":case"core/comments-pagination-previous":case"core/comments-pagination-numbers":case"core/comment-edit-link":case"core/comment-reply-link":case"core/post-comments-link":return["link"];default:return[]}}function NYe(e,t){let{clientId:o}=ht(),r=LYe(e);return(0,u$.useSelect)(n=>{if(!e)return{variationName:null,headingLevel:void 0};let i=n(KCe.store).getBlockStyles(e),{level:s}=n(C).getBlockAttributes(o)||{};return{variationName:t?l1(t,i):null,headingLevel:AYe(e,s,r)}},[e,t,o,r])}function _l(e,t,o=null){let{variationName:r,headingLevel:n}=NYe(e,t),i=OYe();return(0,c1.useMemo)(()=>gn()?e?PYe(i,{blockName:e,variationName:r,elements:MYe(e,n),viewport:o?.viewport??null,pseudoState:o?.pseudo??null}):{value:{},sources:{}}:IYe,[e,r,n,i,o])}var f$=c(E(),1),by="__experimentalBorder",d1="shadow",qCe=(e,t,o)=>{let r;return e.some(n=>n.colors.some(i=>i[t]===o?(r=i,!0):!1)),r},gy=({colors:e,namedColor:t,customColor:o})=>{if(t){let n=qCe(e,"slug",t);if(n)return n}if(!o)return{color:void 0};let r=qCe(e,"color",o);return r||{color:o}};function GD(e){let t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function QCe(e){if((0,d$.__experimentalHasSplitBorders)(e?.border))return{style:e,borderColor:void 0};let t=e?.border?.color,o=t?.startsWith("var:preset|color|")?t.substring(17):void 0,r={...e};return r.border={...r.border,color:o?void 0:t},{style:Ge(r),borderColor:o}}function JCe(e){return(0,d$.__experimentalHasSplitBorders)(e.style?.border)?e.style:{...e.style,border:{...e.style?.border,color:e.borderColor?"var:preset|color|"+e.borderColor:e.style?.border?.color}}}function DYe({label:e,children:t,resetAllFilter:o}){let r=(0,$D.useCallback)(n=>{let i=JCe(n),s=o(i);return{...n,...QCe(s)}},[o]);return(0,f$.jsx)(Oe,{group:"border",resetAllFilter:r,label:e,children:t})}function eEe({clientId:e,name:t,setAttributes:o,settings:r}){let n=Ja(),i=PD(r),{style:s,borderColor:a,className:l}=(0,XCe.useSelect)(m=>{if(!i)return{};let{style:g,borderColor:b,className:v}=m(C).getBlockAttributes(e)||{};return{style:g,borderColor:b,className:v}},[e,i]),{value:u}=_l(t,l,n),d=!Bn(n),f=(0,$D.useMemo)(()=>d?To(s,n):JCe({style:s,borderColor:a}),[d,n,s,a]),p=d?m=>{o({style:Pn(s,n,m)})}:m=>{o(QCe(m))};if(!i)return null;let h={...(0,u1.getBlockSupport)(t,[by,"__experimentalDefaultControls"]),...(0,u1.getBlockSupport)(t,[d1,"__experimentalDefaultControls"])};return(0,f$.jsx)(ID,{as:DYe,panelId:e,settings:r,value:f,onChange:p,defaultControls:h,inheritedValue:u})}function KD(e,t="any"){let o=(0,u1.getBlockSupport)(e,by);return o===!0?!0:t==="any"?!!(o?.color||o?.radius||o?.width||o?.style):!!o?.[t]}function my({blockName:e,hasBorderControl:t,hasShadowControl:o}={}){let r=xl(e),n=e1(r);return!t&&!o&&e&&(t=n?.hasBorderColor||n?.hasBorderStyle||n?.hasBorderWidth||n?.hasBorderRadius,o=n?.hasShadow),t&&o?(0,WD.__)("Border & Shadow"):o?(0,WD.__)("Shadow"):(0,WD.__)("Border")}function VYe(e){return!KD(e,"color")||e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}}function tEe(e,t,o){if(!KD(t,"color")||$t(t,by,"color"))return e;let r=p$(o),n=K(e.className,r);return e.className=n||void 0,e}function p$(e){let{borderColor:t,style:o}=e,r=xa("border-color",t);return K({"has-border-color":t||o?.border?.color,[r]:!!r})}function FYe({name:e,borderColor:t,style:o}){let{colors:r}=Ym();if(!KD(e,"color")||$t(e,by,"color"))return{};let{color:n}=gy({colors:r,namedColor:t}),{color:i}=gy({colors:r,namedColor:GD(o?.border?.top?.color)}),{color:s}=gy({colors:r,namedColor:GD(o?.border?.right?.color)}),{color:a}=gy({colors:r,namedColor:GD(o?.border?.bottom?.color)}),{color:l}=gy({colors:r,namedColor:GD(o?.border?.left?.color)});return tEe({style:Ge({borderTopColor:i||n,borderRightColor:s||n,borderBottomColor:a||n,borderLeftColor:l||n})||{}},e,{borderColor:t,style:o})}var m$={useBlockProps:FYe,addSaveProps:tEe,attributeKeys:["borderColor","style"],hasSupport(e){return KD(e,"color")}};(0,ZCe.addFilter)("blocks.registerBlockType","core/border/addAttributes",VYe);var S$=c(ue(),1),JD=c(F(),1),fEe=c(Q(),1),pEe=c(G(),1);var b$=c(go(),1),G_=c(ue(),1),uEe=c(F(),1);var U_=c(ue(),1),sEe=c(Q(),1),aEe=c(G(),1);var yy=c(F(),1),rEe=c(Q(),1),nEe=c(ue(),1);var iEe=c(Qr(),1);function YD(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function oEe(e,t){if(!e||!t)return{};let o=js(t,"color.text",{fallback:!0}),r=js(t,"color.background",{fallback:!0}),n=e.querySelector(o)||e,i=e.querySelector(r)||e,s=e.querySelector("a"),a=YD(n,"color"),l=s&&s.textContent?YD(s,"color"):void 0,u=i,d=YD(u,"background-color");for(;d==="rgba(0, 0, 0, 0)"&&u.parentNode&&u.parentNode.nodeType===u.parentNode.ELEMENT_NODE;)u=u.parentNode,d=YD(u,"background-color");return{textColor:a,backgroundColor:d,linkColor:l}}function zYe(e,t){return Object.keys(t).some(r=>e[r]!==t[r])?t:e}function H_({clientId:e,name:t,enabled:o=!0,checkTextColor:r=!0,checkLinkColor:n=!0,messageOverride:i}){let s=Nt(e),[a,l]=(0,yy.useReducer)(zYe,{}),u=(0,rEe.useSelect)(p=>t&&o?p(nEe.store).getBlockType(t):void 0,[t,o]);(0,yy.useLayoutEffect)(()=>{!o||!s||!u||window.requestAnimationFrame(()=>window.requestAnimationFrame(()=>l(oEe(s,u))))}),(0,yy.useLayoutEffect)(()=>{if(!o||!s||!u)return;let p=new window.MutationObserver(()=>{l(oEe(s,u))});return p.observe(s,{attributes:!0,attributeFilter:["class","style"],subtree:!0}),()=>{p.disconnect()}},[o,s,u]);let d=o?LG({backgroundColor:a.backgroundColor,textColor:r?a.textColor:void 0,linkColor:n?a.linkColor:void 0,messageOverride:i,enableAlphaChecker:!0}):null,f=d?.speakMessage;return(0,yy.useEffect)(()=>{f&&(0,iEe.speak)(f)},[f]),d?.message}var g$=c(E(),1),vy="background",h$={backgroundSize:"cover",backgroundPosition:"50% 50%"};function f1(e,t="any"){let o=(0,U_.getBlockSupport)(e,vy);return o===!0?!0:t==="any"?!!o?.backgroundImage||!!o?.backgroundSize||!!o?.backgroundRepeat||!!o?.gradient:!!o?.[t]}function qD(e){if(!e||!e?.backgroundImage?.url)return;let t;return e?.backgroundSize||(t={backgroundSize:h$.backgroundSize}),e?.backgroundSize==="contain"&&!e?.backgroundPosition&&(t={backgroundPosition:h$.backgroundPosition}),t}function jYe({name:e,style:t}){if(!f1(e)||!t?.background?.backgroundImage)return;let o=qD(t?.background);if(o)return{style:{...o}}}function lEe(e){return Ec(e)||i$(e)?"has-background":""}function HYe(e){let t=e.className?.includes("has-background")?e.className.split(" ").filter(o=>o!=="has-background").join(" ")||void 0:e.className;return{...e,className:t,backgroundColor:void 0,gradient:void 0,style:Ge({...e.style,background:void 0,color:{...e.style?.color,background:void 0,gradient:void 0}})}}function UYe({children:e}){return(0,g$.jsx)(Oe,{group:"background",resetAllFilter:HYe,children:e})}function ZD({clientId:e,name:t,setAttributes:o,settings:r,asWrapper:n}){let i=Ja(),{style:s,className:a,backgroundColor:l,gradient:u}=(0,sEe.useSelect)(R=>{let{getBlockAttributes:I}=R(C),A=I(e);return{style:A?.style,className:A?.className,backgroundColor:A?.backgroundColor,gradient:A?.gradient}},[e]),{value:d}=_l(t,a,i),f=f1(t,"gradient")&&!!r?.background?.gradient,p=(0,U_.getBlockSupport)(t,"color"),h=p&&p.background!==!1,m=!!p?.gradients,g=!Bn(i),b={...s,color:{...s?.color,background:l?"var:preset|color|"+l:s?.color?.background,gradient:!f&&u?"var:preset|gradient|"+u:s?.color?.gradient},...f&&{background:{...s?.background,gradient:u?"var:preset|gradient|"+u:s?.background?.gradient??s?.color?.gradient}}},v=g?To(s,i):b,y=!v?.color?.gradient&&!v?.background?.gradient&&!!v?.color?.background&&(r?.color?.text||r?.color?.link)&&(0,U_.getBlockSupport)(t,["color","enableContrastChecker"])!==!1,k=H_({clientId:e,name:t,enabled:!!y,messageOverride:(0,aEe.__)("This color combination has poor contrast. Consider increasing contrast between background and foreground.")});if(!FD(r)||!f1(t)&&!h&&!m)return null;let S=R=>{if(g){o({style:Pn(s,i,R)});return}let I=R?.color?.background,A=Po(I,"color"),P=f?R?.background?.gradient:R?.color?.gradient,O=Po(P,"gradient"),N=O?void 0:R?.color?.gradient,z={...R,color:{...R?.color,background:A?void 0:I,gradient:f?void 0:N}};f&&(z.background={...z.background,gradient:R?.background?.gradient});let V=f&&!!s?.color?.gradient,M={style:Ge(z),backgroundColor:A,gradient:f?void 0:O},D=!!O||!!P;V&&D?M.className=K(a,"has-background"):!D&&a?.includes("has-background")&&(M.className=a.split(" ").filter(L=>L!=="has-background").join(" ")||void 0),o(M)},_={...r,background:{...r.background,backgroundSize:r?.background?.backgroundSize&&f1(t,"backgroundSize")}},x=(0,U_.getBlockSupport)(t,[vy,"__experimentalDefaultControls"]),w=(0,U_.getBlockSupport)(t,["color","__experimentalDefaultControls"]),T={...x,backgroundColor:w?.background,gradient:x?.gradient??w?.background};return(0,g$.jsx)(zD,{as:n||UYe,panelId:e,defaultValues:h$,settings:_,onChange:S,defaultControls:T,value:g?To(s,i):b,contrastWarning:k,inheritedValue:d})}var cEe={useBlockProps:jYe,attributeKeys:["style"],hasSupport:f1};var Mn="color",XD=e=>{let t=(0,G_.getBlockSupport)(e,Mn);return t&&(t.link===!0||t.gradient===!0||t.background!==!1||t.text!==!1)},GYe=e=>{let t=(0,G_.getBlockSupport)(e,Mn);return t!==null&&typeof t=="object"&&!!t.link},y$=e=>{let t=(0,G_.getBlockSupport)(e,Mn);return t!==null&&typeof t=="object"&&!!t.gradients},WYe=e=>{let t=(0,G_.getBlockSupport)(e,Mn);return t&&t.background!==!1},$Ye=e=>{let t=(0,G_.getBlockSupport)(e,Mn);return t&&t.text!==!1};function KYe(e){return XD(e)&&(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),y$(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}})),e}function dEe(e,t,o){if(!XD(t)||$t(t,Mn))return e;let r=y$(t),{backgroundColor:n,textColor:i,gradient:s,style:a}=o,l=g=>!$t(t,Mn,g),u=l("text")?xa("color",i):void 0,d=l("gradients")?gv(s):void 0,f=l("background")?xa("background-color",n):void 0,p=l("background")||l("gradients"),h=n||a?.color?.background||r&&(s||a?.color?.gradient),m=K(e.className,u,d,{[f]:(!r||!a?.color?.gradient)&&!!f,"has-text-color":l("text")&&(i||a?.color?.text),"has-background":p&&h,"has-link-color":l("link")&&a?.elements?.link?.color});return e.className=m||void 0,e}function YYe({name:e,backgroundColor:t,textColor:o,gradient:r,style:n}){let[i,s,a]=Le("color.palette.custom","color.palette.theme","color.palette.default"),l=(0,uEe.useMemo)(()=>[...i||[],...s||[],...a||[]],[i,s,a]);if(!XD(e)||$t(e,Mn))return{};let u={};o&&!$t(e,Mn,"text")&&(u.color=jc(l,o)?.color),t&&!$t(e,Mn,"background")&&(u.backgroundColor=jc(l,t)?.color);let d=dEe({style:u},e,{textColor:o,backgroundColor:t,gradient:r,style:n}),f=t||n?.color?.background||r||n?.color?.gradient;return{...d,className:K(d.className,!f&&lEe(n))}}var v$={useBlockProps:YYe,addSaveProps:dEe,attributeKeys:["backgroundColor","textColor","gradient","style"],hasSupport:XD},qYe={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};function ZYe(e,t,o,r){let n=e.name,i={linkColor:GYe(n),textColor:$Ye(n),backgroundColor:WYe(n),gradient:y$(n)};return QD(i,qYe,e,t,o,r)}(0,b$.addFilter)("blocks.registerBlockType","core/color/addAttribute",KYe);(0,b$.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",ZYe);var k$=c(E(),1);function XYe({children:e,resetAllFilter:t}){let o=(0,JD.useCallback)(r=>{let n=t(r.style);return{...r,style:Ge(n)}},[t]);return(0,k$.jsx)(Oe,{group:"elements",resetAllFilter:o,children:e})}function eV({clientId:e,name:t,setAttributes:o,settings:r,asWrapper:n,label:i,defaultControls:s}){let a=Ja(),l=bD(r),{style:u,className:d}=(0,fEe.useSelect)(y=>{if(!l)return{};let k=y(C).getBlockAttributes(e);return{style:k?.style,className:k?.className}},[e,l]),{value:f}=_l(t,d,a),p=!Bn(a),h=(0,JD.useMemo)(()=>p?To(u,a):u,[p,a,u]),m=p?y=>{o({style:Pn(u,a,y)})}:y=>{o({style:Ge(y)})},g=!!h?.elements?.link?.color?.text&&r?.color?.link&&(0,S$.getBlockSupport)(t,[Mn,"enableContrastChecker"])!==!1,b=H_({clientId:e,name:t,enabled:!!g,checkTextColor:!1,messageOverride:(0,pEe.__)("This link color has poor contrast against the background. Consider increasing contrast.")});return l?(s=s||(0,S$.getBlockSupport)(t,[Mn,"__experimentalDefaultControls"]),(0,k$.jsx)(yD,{as:n||XYe,panelId:e,settings:r,value:h,onChange:m,defaultControls:s,label:i,contrastWarning:b,inheritedValue:f})):null}var h1=c(ue(),1),aV=c(F(),1),OEe=c(Q(),1),AEe=c(G(),1);var QYe=c(ue(),1);var JYe=c(E(),1),mEe="typography.lineHeight";var hEe=c(go(),1),tV=c(ue(),1),gEe=c(WL(),1),bEe=c(U(),1);var p1="typography.__experimentalFontFamily",{kebabCase:eqe}=H(bEe.privateApis);function tqe(e){return(0,tV.hasBlockSupport)(e,p1)&&(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}})),e}function yEe(e,t,o){if(!(0,tV.hasBlockSupport)(t,p1)||$t(t,wl,"fontFamily")||!o?.fontFamily)return e;let r=new gEe.default(e.className);r.add(`has-${eqe(o?.fontFamily)}-font-family`);let n=r.value;return e.className=n||void 0,e}function oqe({name:e,fontFamily:t}){return yEe({},e,{fontFamily:t})}var _$={useBlockProps:oqe,addSaveProps:yEe,attributeKeys:["fontFamily"],hasSupport(e){return(0,tV.hasBlockSupport)(e,p1)}};(0,hEe.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",tqe);var x$=c(go(),1),W_=c(ue(),1),vEe=c(WL(),1);var rqe=c(E(),1),Sy="typography.fontSize";function nqe(e){return(0,W_.hasBlockSupport)(e,Sy)&&(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}})),e}function SEe(e,t,o){if(!(0,W_.hasBlockSupport)(t,Sy)||$t(t,wl,"fontSize"))return e;let r=new vEe.default(e.className);r.add(yp(o.fontSize));let n=r.value;return e.className=n||void 0,e}function iqe({name:e,fontSize:t,style:o}){let[r,n,i]=Le("typography.fontSizes","typography.fluid","layout");if(!(0,W_.hasBlockSupport)(e,Sy)||$t(e,wl,"fontSize")||!t&&!o?.typography?.fontSize)return;let s;if(o?.typography?.fontSize&&(s={style:{fontSize:ld({size:o.typography.fontSize},{typography:{fluid:n},layout:i})}}),t&&(s={style:{fontSize:bv(r,t,o?.typography?.fontSize).size}}),!!s)return SEe(s,e,{fontSize:t})}var w$={useBlockProps:iqe,addSaveProps:SEe,attributeKeys:["fontSize","style"],hasSupport(e){return(0,W_.hasBlockSupport)(e,Sy)}},sqe={fontSize:[["fontSize"],["style","typography","fontSize"]]};function aqe(e,t,o,r){let n=e.name,i={fontSize:(0,W_.hasBlockSupport)(n,Sy)};return QD(i,sqe,e,t,o,r)}(0,x$.addFilter)("blocks.registerBlockType","core/font/addAttribute",nqe);(0,x$.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",aqe);var rV=c(G(),1),$_=c(ue(),1);var xEe=c(Q(),1);var oV=c(Q(),1),kEe=c(F(),1);function Er(e){let t=ht(),{clientId:o=""}=t,r=(0,oV.useRegistry)(),n=(0,oV.useSelect)(i=>o?null:i(C).getBlockEditingMode(),[o]);return(0,kEe.useEffect)(()=>{if(!e)return;let{setBlockEditingMode:i,unsetBlockEditingMode:s,__unstableMarkNextChangeAsNotPersistent:a}=r.dispatch(C);return a(),i(o,e),()=>{a(),s(o)}},[r,o,e]),o?t[Fy]:n}var C$=c(E(),1),K_="typography.textAlign",lqe=[{icon:tp,title:(0,rV.__)("Align text left"),align:"left"},{icon:Xh,title:(0,rV.__)("Align text center"),align:"center"},{icon:op,title:(0,rV.__)("Align text right"),align:"right"}],_Ee=["left","center","right"],cqe=[];function E$(e){return Array.isArray(e)?_Ee.filter(t=>e.includes(t)):e===!0?_Ee:cqe}function uqe(e,t){return e&&Hi(t)?"style-state":"block"}function dqe({clientId:e,style:t,name:o,setAttributes:r}){let i=xl(o)?.typography?.textAlign,s=Er(),{selectedState:a,isResponsiveEditing:l}=(0,xEe.useSelect)(m=>{let{getSelectedBlockStyleState:g,isResponsiveEditing:b}=H(m(C));return{selectedState:g(e),isResponsiveEditing:b()}},[e]);if(!i||s!=="default")return null;let u=E$((0,$_.getBlockSupport)(o,K_));if(!u.length)return null;let d=lqe.filter(m=>u.includes(m.align)),f=To(t,a),p=uqe(l,a),h=m=>{let g={...f,typography:{...f?.typography,textAlign:m}};r({style:Pn(t,a,g)})};return(0,C$.jsx)(No,{group:p,children:(0,C$.jsx)(qB,{value:f?.typography?.textAlign,onChange:h,alignmentControls:d})})}var nV={edit:dqe,useBlockProps:fqe,addSaveProps:pqe,attributeKeys:["style"],hasSupport(e){return(0,$_.hasBlockSupport)(e,K_,!1)}};function fqe({name:e,style:t}){if(!t?.typography?.textAlign||!E$((0,$_.getBlockSupport)(e,K_)).length||$t(e,wl,"textAlign"))return null;let r=t.typography.textAlign;return{className:K({[`has-text-align-${r}`]:r})}}function pqe(e,t,o){if(!o?.style?.typography?.textAlign)return e;let{textAlign:r}=o.style.typography,n=(0,$_.getBlockSupport)(t,K_);return E$(n).includes(r)&&!$t(t,wl,"textAlign")&&(e.className=K(`has-text-align-${r}`,e.className)),e}var R$=c(go(),1),uh=c(ue(),1),ky=c(F(),1),B$=c(Q(),1),m1=c(G(),1),iV=c(U(),1),PEe=c(fe(),1);function mqe(e,t){let o=e.scrollHeight>e.clientHeight,r=0,n=2400,i=r,s=window.getComputedStyle(e),a=parseFloat(s.paddingLeft)||0,l=parseFloat(s.paddingRight)||0,u=document.createRange();u.selectNodeContents(e);let d=e,f=e.parentElement;if(f){let h=window.getComputedStyle(f);h?.display==="flex"&&(d=f,a+=parseFloat(h.paddingLeft)||0,l+=parseFloat(h.paddingRight)||0)}let p=d.clientHeight;for(;r<=n;){let h=Math.floor((r+n)/2);t(h);let g=u.getBoundingClientRect().width,b=e.scrollWidth<=d.clientWidth&&g<=d.clientWidth-a-l,v=o||e.scrollHeight<=d.clientHeight||e.scrollHeight<=p;d.clientHeight>p&&(p=d.clientHeight),b&&v?(i=h,r=h+1):n=h-1}return u.detach(),i}function wEe(e,t){if(!e)return;t(0);let o=mqe(e,t);return t(o),o}var CEe=c(F(),1),EEe=c(G(),1),TEe=c(U(),1),REe=c(Qr(),1),T$=c(E(),1);function BEe(){let e=(0,EEe.__)("The text may be too small to read. Consider using a larger container or less text.");return(0,CEe.useEffect)(()=>{(0,REe.speak)(e)},[e]),(0,T$.jsx)("div",{className:"block-editor-fit-text-size-warning",children:(0,T$.jsx)(TEe.Notice,{spokenMessage:null,status:"warning",isDismissible:!1,children:e})})}var Rs=c(E(),1),hqe={},gqe=12,Tf="typography.fitText";function bqe(e){return!(0,uh.hasBlockSupport)(e,Tf)||e.attributes?.fitText?e:{...e,attributes:{...e.attributes,fitText:{type:"boolean"}}}}function yqe({fitText:e,name:t,clientId:o}){let[r,n]=(0,ky.useState)(null),i=(0,uh.hasBlockSupport)(t,Tf),s=Nt(o),{blockAttributes:a,parentId:l,blockMode:u}=(0,B$.useSelect)(f=>{if(!o||!i||!e)return hqe;let p=f(C).getBlockMode(o);return p==="html"?{blockMode:p}:{blockAttributes:f(C).getBlockAttributes(o),parentId:f(C).getBlockRootClientId(o),blockMode:p}},[o,i,e]),d=(0,ky.useCallback)(()=>{if(!s||!i||!e)return;let f=`fit-text-${o}`,p=s.ownerDocument.getElementById(f);p||(p=s.ownerDocument.createElement("style"),p.id=f,s.ownerDocument.head.appendChild(p));let h=`#block-${o}`,g=wEe(s,b=>{b===0?p.textContent="":p.textContent=`${h} { font-size: ${b}px !important; }`});n(g)},[s,o,i,e]);return(0,ky.useEffect)(()=>{if(!e||!s||!o||!i||u==="html")return;let f=s,p=f.style.visibility,h=null,m=null,g=null;h=window.requestAnimationFrame(()=>{f.style.visibility="hidden",m=window.requestAnimationFrame(()=>{d(),g=setTimeout(()=>{f.style.visibility=p},10)})});let b;return window.ResizeObserver&&f.parentElement&&(b=new window.ResizeObserver(d),b.observe(f.parentElement),b.observe(f)),()=>{h!==null&&window.cancelAnimationFrame(h),m!==null&&window.cancelAnimationFrame(m),g!==null&&clearTimeout(g),b&&b.disconnect();let v=`fit-text-${o}`,y=f.ownerDocument.getElementById(v);y&&y.remove()}},[e,o,l,d,s,i,u]),(0,ky.useEffect)(()=>{if(e&&s&&i&&u!=="html"){let f=window.requestAnimationFrame(()=>{s&&d()});return()=>window.cancelAnimationFrame(f)}},[a,e,d,s,i,u]),{fontSize:r}}function vqe({clientId:e,fitText:t=!1,setAttributes:o,name:r,fontSize:n,style:i}){let s=(0,B$.useSelect)(a=>{let{hasSelectedStyleState:l}=H(a(C));return l(e)},[e]);return!(0,uh.hasBlockSupport)(r,Tf)||s?null:(0,Rs.jsx)(iV.__experimentalToolsPanelItem,{hasValue:()=>t,label:(0,m1.__)("Fit text"),onDeselect:()=>o({fitText:void 0}),resetAllFilter:()=>({fitText:void 0}),panelId:e,children:(0,Rs.jsx)(iV.ToggleControl,{label:(0,m1.__)("Fit text"),checked:t,onChange:()=>{let a=!t||void 0,l={fitText:a};a&&(n&&(l.fontSize=void 0),i?.typography?.fontSize&&(l.style={...i,typography:{...i?.typography,fontSize:void 0}})),o(l)},help:t?(0,m1.__)("Text will resize to fit its container."):(0,m1.__)("The text will resize to fit its container, resetting other font size settings.")})})}function Sqe(e,t,o){if(!(0,uh.hasBlockSupport)(t,Tf))return e;let{fitText:r}=o;if(!r)return e;let n=e.className?`${e.className} has-fit-text`:"has-fit-text";return{...e,className:n}}function kqe({name:e,fitText:t}){return t&&(0,uh.hasBlockSupport)(e,Tf)?{className:"has-fit-text"}:{}}(0,R$.addFilter)("blocks.registerBlockType","core/fit-text/addAttribute",bqe);var _qe=e=>(0,uh.hasBlockSupport)(e,Tf);function xqe({fitText:e,name:t,clientId:o,isSelected:r}){let{fontSize:n}=yqe({fitText:e,name:t,clientId:o});return r&&n&&nfunction(o){let{name:r,attributes:n,clientId:i,isSelected:s,setAttributes:a}=o,{fitText:l}=n;return(0,uh.hasBlockSupport)(r,Tf)?(0,Rs.jsxs)(Rs.Fragment,{children:[(0,Rs.jsx)(e,{...o}),(0,Rs.jsx)(Oe,{group:"typography",children:(0,Rs.jsx)(vqe,{clientId:i,fitText:l,setAttributes:a,name:r,fontSize:n.fontSize,style:n.style})}),l&&(0,Rs.jsx)(xqe,{fitText:l,name:r,clientId:i,isSelected:s})]}):(0,Rs.jsx)(e,{...o})},"addFitTextControl");(0,R$.addFilter)("editor.BlockEdit","core/fit-text/add-fit-text-control",wqe);var sV={useBlockProps:kqe,addSaveProps:Sqe,attributeKeys:["fitText","fontSize","style"],hasSupport:_qe,edit:()=>null};var P$=c(E(),1);function IEe(e,t){return Object.fromEntries(Object.entries(e).filter(([o])=>!t.includes(o)))}var Cqe="typography.__experimentalLetterSpacing",Eqe="typography.__experimentalTextTransform",Tqe="typography.__experimentalTextDecoration",Rqe="typography.textIndent",Bqe="typography.textColumns",Pqe="typography.__experimentalFontStyle",Iqe="typography.__experimentalFontWeight",Oqe="typography.__experimentalWritingMode",wl="typography",LEe=[mEe,Sy,Pqe,Iqe,p1,K_,Bqe,Tqe,Rqe,Oqe,Eqe,Cqe,Tf];function MEe(e){let t={...IEe(e,["fontFamily"])},o=e?.typography?.fontSize,r=e?.typography?.fontFamily,n=e?.color?.text,i=typeof o=="string"&&o?.startsWith("var:preset|font-size|")?o.substring(21):void 0,s=r?.startsWith("var:preset|font-family|")?r.substring(23):void 0,a=Po(n,"color");return t.typography={...IEe(t.typography,["fontFamily"]),fontSize:i?void 0:o},t.color={...t.color,text:a?void 0:n},{style:Ge(t),fontFamily:s,fontSize:i,textColor:a}}function NEe(e){return{...e.style,typography:{...e.style?.typography,fontFamily:e.fontFamily?"var:preset|font-family|"+e.fontFamily:void 0,fontSize:e.fontSize?"var:preset|font-size|"+e.fontSize:e.style?.typography?.fontSize},color:{...e.style?.color,text:e.textColor?"var:preset|color|"+e.textColor:e.style?.color?.text}}}function Aqe({children:e,resetAllFilter:t}){let o=(0,aV.useCallback)(r=>{let n=NEe(r),i=t(n);return{...r,...MEe(i)}},[t]);return(0,P$.jsx)(Oe,{group:"typography",resetAllFilter:o,children:e})}function lV({clientId:e,name:t,setAttributes:o,settings:r,asWrapper:n}){let i=Ja(),s=vD(r),{style:a,fontFamily:l,fontSize:u,fitText:d,textColor:f,className:p}=(0,OEe.useSelect)(w=>{if(!s)return{};let{style:T,fontFamily:B,fontSize:R,fitText:I,textColor:A,className:P}=w(C).getBlockAttributes(e)||{};return{style:T,fontFamily:B,fontSize:R,fitText:I,textColor:A,className:P}},[e,s]),h=!Bn(i),{value:m}=_l(t,p,i),g=(0,aV.useMemo)(()=>h?To(a,i):NEe({style:a,fontFamily:l,fontSize:u,textColor:f}),[h,i,a,u,l,f]),b=h?w=>{o({style:Pn(a,i,w)})}:w=>{let T=MEe(w);(T.fontSize||T.style?.typography?.fontSize)&&d&&(T.fitText=void 0),o(T)},v=!g?.color?.gradient&&!!g?.color?.text&&r?.color?.text&&(0,h1.getBlockSupport)(t,["color","enableContrastChecker"])!==!1,y=H_({clientId:e,name:t,enabled:!!v,checkLinkColor:!1,messageOverride:(0,AEe.__)("This color has poor contrast against the background. Consider increasing contrast.")});if(!s)return null;let k=(0,h1.getBlockSupport)(t,[wl,"__experimentalDefaultControls"]),S=(0,h1.getBlockSupport)(t,["color","__experimentalDefaultControls"]),_={...k,textColor:S?.text};return(0,P$.jsx)(SD,{as:n||Aqe,panelId:e,settings:r,value:g,onChange:b,defaultControls:_,contrastWarning:y,inheritedValue:m})}var Jo=c(E(),1);function O$({blockName:e,clientId:t,contentClientIds:o}){let r=xl(e),{updateBlockAttributes:n}=(0,cV.useDispatch)(C),{hasButtons:i,hasHeading:s}=(0,cV.useSelect)(d=>{let f=d(C).getBlockNamesByClientId(o);return{hasButtons:f.includes("core/buttons"),hasHeading:f.includes("core/heading")}},[o]),a=d=>{n(t,d)},l=(0,I$.useMemo)(()=>({...r,typography:{}}),[r]),u=(0,I$.useMemo)(()=>({...r,background:{...r.background,backgroundImage:!1,backgroundSize:!1}}),[r]);return(0,Jo.jsxs)(Jo.Fragment,{children:[(0,Jo.jsx)(lV,{clientId:t,name:e,settings:l,setAttributes:a,asWrapper:QW}),(0,Jo.jsx)(ZD,{clientId:t,name:e,settings:u,setAttributes:a,asWrapper:s$}),(0,Jo.jsx)(eV,{clientId:t,name:e,settings:r,setAttributes:a,asWrapper:ZW,label:(0,dh.__)("Elements"),defaultControls:{button:i,heading:s}})]})}var Lqe=({blockName:e,clientId:t,hasBlockStyles:o,isSectionBlock:r,contentClientIds:n})=>{let i=my({blockName:e});return(0,Jo.jsxs)(Jo.Fragment,{children:[o&&(0,Jo.jsx)(Xk,{clientId:t}),r&&e!=="core/template-part"&&(0,Jo.jsx)(O$,{blockName:e,clientId:t,contentClientIds:n}),(!r||e==="core/template-part")&&(0,Jo.jsxs)(Jo.Fragment,{children:[(0,Jo.jsx)(Oe.Slot,{group:"typography",label:(0,dh.__)("Typography")}),(0,Jo.jsx)(Oe.Slot,{group:"color",label:(0,dh.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,Jo.jsx)(Oe.Slot,{group:"background",label:(0,dh.__)("Background"),className:"background-block-support-panel__inner-wrapper"}),(0,Jo.jsx)(Oe.Slot,{group:"filter"}),(0,Jo.jsx)(Oe.Slot,{group:"layout",label:(0,dh.__)("Layout")}),(0,Jo.jsx)(Oe.Slot,{group:"dimensions",label:(0,dh.__)("Dimensions")}),(0,Jo.jsx)(Oe.Slot,{group:"border",label:i}),(0,Jo.jsx)(Oe.Slot,{group:"elements",label:(0,dh.__)("Elements"),className:"elements-block-support-panel__inner-wrapper"}),(0,Jo.jsx)(dD,{}),(0,Jo.jsx)(Oe.Slot,{group:"styles"})]})]})},DEe=Lqe;var FEe=c(U(),1),zEe=c(G(),1);var VEe=c(ue(),1),uV=c(Q(),1),fa=c(U(),1);var Cl=c(E(),1);function dV({clientIds:e,onSelect:t,onSwitchToListView:o,hasListViewTab:r}){return e.length?(0,Cl.jsx)(fa.__experimentalVStack,{spacing:1,children:e.map(n=>(0,Cl.jsx)(Mqe,{onSelect:t,onSwitchToListView:o,hasListViewTab:r,clientId:n},n))}):null}function Mqe({clientId:e,onSelect:t,onSwitchToListView:o,hasListViewTab:r}){let n=Do(e),{isSelected:i,childBlocks:s,shouldRenderListView:a,blockName:l}=(0,uV.useSelect)(g=>{let{isBlockSelected:b,hasSelectedInnerBlock:v,getBlockOrder:y,getBlockName:k,shouldRenderBlockListView:S}=H(g(C)),_=k(e);return{isSelected:b(e)||v(e,!0),childBlocks:y(e),shouldRenderListView:S(e),blockName:_}},[e]),u=(0,VEe.getBlockType)(l),f=jn({clientId:e,context:"list-view"})||u?.title||l,{selectBlock:p}=(0,uV.useDispatch)(C),m=s&&s.length>0&&r&&a;return(0,Cl.jsx)(fa.Button,{__next40pxDefaultSize:!0,className:"block-editor-block-quick-navigation__item",isPressed:i,onClick:async()=>{await p(e),m&&o&&o(e),t&&t(e)},children:(0,Cl.jsxs)(fa.Flex,{children:[(0,Cl.jsx)(fa.FlexItem,{children:(0,Cl.jsx)(Et,{icon:n?.icon})}),(0,Cl.jsx)(fa.FlexBlock,{style:{textAlign:"left"},children:(0,Cl.jsx)(fa.__experimentalTruncate,{children:f})}),m&&(0,Cl.jsx)(fa.FlexItem,{children:(0,Cl.jsx)(gt,{icon:un,size:24})})]})})}var Y_=c(E(),1),Nqe=({contentClientIds:e,onSwitchToListView:t,hasListViewTab:o})=>{if(!e||e.length===0)return null;let r=window?.__experimentalContentOnlyInspectorFields;return(0,Y_.jsx)(Y_.Fragment,{children:!r&&(0,Y_.jsx)(FEe.PanelBody,{title:(0,zEe.__)("Content"),children:(0,Y_.jsx)(dV,{clientIds:e,onSwitchToListView:t,hasListViewTab:o})})})},fV=Nqe;var qr=c(E(),1),{Tabs:fh}=H(pV.privateApis);function A$({blockName:e,clientId:t,hasBlockStyles:o,tabs:r,isSectionBlock:n,contentClientIds:i}){let s=(0,Bc.useRef)(null),a=(0,q_.useSelect)(S=>S(jEe.store).get("core","showIconLabels"),[]),{requestedTab:l}=(0,q_.useSelect)(S=>({requestedTab:H(S(C)).getRequestedInspectorTab()})),[u,d]=(0,Bc.useState)(()=>l?.tabName??r[0]?.name),f=(0,Bc.useRef)(!1),p=(0,Bc.useRef)(!1),{__unstableSetOpenListViewPanel:h,__unstableIncrementListViewExpandRevision:m,__unstableSetAllListViewPanelsOpen:g}=(0,q_.useDispatch)(C),{clearRequestedInspectorTab:b}=H((0,q_.useDispatch)(C));(0,Bc.useEffect)(()=>{f.current=!1},[t]),(0,Bc.useEffect)(()=>{l&&(d(l.tabName),l.tabName===Sf.name&&l.options?.openPanel&&(h(l.options.openPanel),m()),p.current=!0,f.current=!0,b())},[l,h,m,b]),(0,Bc.useEffect)(()=>{u===Sf.name&&!f.current&&(g(),m())},[t,u,g,m]),(0,Bc.useEffect)(()=>{if(!r?.length||f.current&&r.some(_=>_.name===u))return;let S=r[0]?.name;u!==S&&d(S)},[r,u]);let v=S=>{d(S),f.current=!0,S===Sf.name&&!p.current&&(g(),m()),p.current=!1},y=r.some(S=>S.name===Sf.name),k=S=>{y&&(h(S),m(),p.current=!0,v(Sf.name))};return(0,qr.jsx)("div",{className:"block-editor-block-inspector__tabs",children:(0,qr.jsxs)(fh,{selectedTabId:u,onSelect:v,children:[(0,qr.jsx)(fh.TabList,{children:r.map(S=>a?(0,qr.jsx)(fh.Tab,{tabId:S.name,children:S.title},S.name):(0,qr.jsxs)(kt.Root,{children:[(0,qr.jsx)(fh.Tab,{tabId:S.name,"aria-label":S.title,render:(0,qr.jsx)(kt.Trigger,{}),children:(0,qr.jsx)(pV.Icon,{icon:S.icon})}),(0,qr.jsx)(kt.Popup,{children:S.title})]},S.name))}),(0,qr.jsxs)(fh.TabPanel,{tabId:lD.name,focusable:!1,children:[(0,qr.jsx)(fV,{contentClientIds:i,onSwitchToListView:k,hasListViewTab:y}),(0,qr.jsx)(Oe.Slot,{group:"content"})]}),(0,qr.jsxs)(fh.TabPanel,{tabId:Sf.name,focusable:!1,children:[(0,qr.jsx)(Oe.Slot,{group:"list",ref:s}),(0,qr.jsx)(J2,{listViewRef:s})]}),(0,qr.jsx)(fh.TabPanel,{tabId:sD.name,focusable:!1,children:(0,qr.jsx)(B0e,{showAdvancedControls:!!e})}),(0,qr.jsx)(fh.TabPanel,{tabId:aD.name,focusable:!1,children:(0,qr.jsx)(DEe,{blockName:e,clientId:t,hasBlockStyles:o,isSectionBlock:n,contentClientIds:i})})]},t)})}var Bs=c(U(),1),HEe=c(Q(),1);var Dqe=[];function Vqe(e,t={}){return t[e]!==void 0?t[e]:t.default!==void 0?t.default:!0}function UEe(e,t,o,r){let n=[],{bindings:i,border:s,color:a,content:l,default:u,layout:d,dimensions:f,list:p,position:h,styles:m,typography:g,effects:b}=dc,v=(0,Bs.__experimentalUseSlotFills)(p.name),y=!!v&&v.length,k=(0,Bs.__experimentalUseSlotFills)(l.name),S=!!k&&k.length,x=[...(0,Bs.__experimentalUseSlotFills)(s.name)||[],...(0,Bs.__experimentalUseSlotFills)(a.name)||[],...(0,Bs.__experimentalUseSlotFills)(d.name)||[],...(0,Bs.__experimentalUseSlotFills)(h.name)||[],...(0,Bs.__experimentalUseSlotFills)(f.name)||[],...(0,Bs.__experimentalUseSlotFills)(m.name)||[],...(0,Bs.__experimentalUseSlotFills)(g.name)||[],...(0,Bs.__experimentalUseSlotFills)(b.name)||[]].length,w=[...(0,Bs.__experimentalUseSlotFills)(Cm.slotName)||[],...(0,Bs.__experimentalUseSlotFills)(i.name)||[]],T=[...(0,Bs.__experimentalUseSlotFills)(u.name)||[],...y&&x>1?w:[]],B=window?.__experimentalContentOnlyInspectorFields,R=S||!B&&t?.length;R&&n.push(lD),y&&n.push(Sf),(T.length||w.length&&(R||y))&&n.push(sD);let{tabSettings:I,isPreviewMode:A}=(0,HEe.useSelect)(O=>{let N=O(C).getSettings();return{tabSettings:N.blockInspectorTabs,isPreviewMode:N.isPreviewMode}},[]);return!A&&(r||x)&&n.push(aD),Vqe(e,I)?n:Dqe}var GEe=c(U(),1);var L$=c(E(),1),{Fill:Fqe,Slot:zqe}=(0,GEe.createSlotFill)(Symbol("InspectorControlsLastItem")),WEe=e=>ht()[Dl]?(0,L$.jsx)(Fqe,{...e}):null;WEe.Slot=function(t){return(0,L$.jsx)(zqe,{...t})};var mV=WEe;var $Ee=c(Q(),1);function KEe(e){return(0,$Ee.useSelect)(t=>{if(e){let o=t(C).getSettings().blockInspectorAnimation,r=o?.animationParent,{getSelectedBlockClientId:n,getBlockParentsByBlockName:i}=t(C),s=n();return!i(s,r,!0)[0]&&e.name!==r?null:o?.[e.name]}return null},[e])}var hV=c(F(),1);var _y=c(G(),1);var N$=c(E(),1),{getViewportBreakpoints:jqe}=H(Sr),YEe={":hover":(0,_y.__)("Hover"),":focus":(0,_y.__)("Focus"),":focus-visible":(0,_y.__)("Focus-visible"),":active":(0,_y.__)("Active")},Hqe={"@tablet":(0,_y.__)("Tablet"),"@mobile":(0,_y.__)("Mobile")};function Uqe(e){let t=jqe(e);return Object.entries(Hqe).filter(([o])=>(o!=="@tablet"||t.tablet!==void 0)&&(o!=="@mobile"||t.mobile!==void 0)).map(([o,r])=>({value:o,label:r}))}var gV={"core/button":[":hover",":focus",":focus-visible",":active"],"core/navigation-link":[":hover",":focus",":focus-visible",":active"]};function qEe(e){return(gV[e]??[]).filter(o=>YEe[o]).map(o=>({value:o,label:YEe[o]}))}var M$="default",Gqe=[];function ZEe({name:e,value:t,onChange:o}){let r=(0,hV.useMemo)(()=>qEe(e),[e]),n=xr();return r.length?(0,N$.jsx)(jD,{pseudoStates:r,pseudoStateValue:t?.pseudo??M$,onChangePseudoState:i=>o({pseudo:i}),popoverProps:n.popoverProps,showText:!1}):null}function XEe({name:e,value:t,isResponsiveEditing:o}){let r=(0,hV.useMemo)(()=>qEe(e),[e]),[n]=Le("viewport"),i=(0,hV.useMemo)(()=>Uqe(n),[n]);return!r.length&&!o?null:(0,N$.jsx)(HD,{viewportStates:o?i:Gqe,pseudoStates:r,viewportValue:t?.viewport??M$,pseudoStateValue:t?.pseudo??M$})}var Fe=c(E(),1);function JEe({blockName:e,showAdvancedControls:t=!0,showPositionControls:o=!0,showBindingsControls:r=!0}){let n=my({blockName:e});return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(Oe.Slot,{}),(0,Fe.jsx)(Oe.Slot,{group:"typography",label:(0,qi.__)("Typography")}),(0,Fe.jsx)(Oe.Slot,{group:"color",label:(0,qi.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,Fe.jsx)(Oe.Slot,{group:"background",label:(0,qi.__)("Background"),className:"background-block-support-panel__inner-wrapper"}),(0,Fe.jsx)(Oe.Slot,{group:"layout",label:(0,qi.__)("Layout")}),(0,Fe.jsx)(Oe.Slot,{group:"dimensions",label:(0,qi.__)("Dimensions")}),(0,Fe.jsx)(Oe.Slot,{group:"border",label:n}),(0,Fe.jsx)(Oe.Slot,{group:"elements",label:(0,qi.__)("Elements"),className:"elements-block-support-panel__inner-wrapper"}),o&&(0,Fe.jsx)(dD,{}),(0,Fe.jsx)(Oe.Slot,{group:"styles"}),r&&(0,Fe.jsx)(Oe.Slot,{group:"bindings"}),t&&(0,Fe.jsx)("div",{children:(0,Fe.jsx)(cD,{})})]})}function Wqe({blockName:e,clientId:t,contentClientIds:o,isSectionBlock:r,selectedBlockStyleState:n}){let i=my({blockName:e}),s=Hi(n)&&!ea(n),a=r&&e!=="core/template-part";return(0,Fe.jsxs)(Fe.Fragment,{children:[a&&(0,Fe.jsx)(q2,{value:n,children:(0,Fe.jsx)(O$,{blockName:e,clientId:t,contentClientIds:o})}),!a&&(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(Oe.Slot,{group:"typography",label:(0,qi.__)("Typography")}),(0,Fe.jsx)(Oe.Slot,{group:"color",label:(0,qi.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,Fe.jsx)(Oe.Slot,{group:"background",label:(0,qi.__)("Background"),className:"background-block-support-panel__inner-wrapper"}),s&&(0,Fe.jsx)(Oe.Slot,{group:"layout",label:(0,qi.__)("Layout")}),(0,Fe.jsx)(Oe.Slot,{group:"dimensions",label:(0,qi.__)("Dimensions")}),(0,Fe.jsx)(Oe.Slot,{group:"border",label:i}),(0,Fe.jsx)(Oe.Slot,{group:"elements",label:(0,qi.__)("Elements"),className:"elements-block-support-panel__inner-wrapper"})]})]})}function $qe(){let{selectedBlockCount:e,renderedBlockName:t,renderedBlockClientId:o,blockType:r,isSectionBlock:n,isSectionBlockInSelection:i,hasBlockStyles:s,editedContentOnlySection:a,blockEditingMode:l,selectedBlockStyleState:u,showStateOnCanvas:d,isResponsiveEditing:f,blockStatesEditingEnabled:p}=(0,g1.useSelect)(_=>{let{getSettings:x,getSelectedBlockClientId:w,getSelectedBlockClientIds:T,getSelectedBlockCount:B,getBlockName:R,getParentSectionBlock:I,isSectionBlock:A,getEditedContentOnlySection:P,isWithinEditedContentOnlySection:O,getBlockEditingMode:N,getSelectedBlockStyleState:z,isSelectedBlockStyleStateShownOnCanvas:V,isResponsiveEditing:M}=H(_(C)),{getBlockStyles:D}=_(Z_.store),L=w(),q=O(L)?L:I(L)||L,J=q&&R(q),te=J&&(0,Z_.getBlockType)(J),$=T().some(Z=>A(Z)),W=J&&D(J),Y=W&&W.length>0;return{selectedBlockCount:B(),renderedBlockClientId:q,renderedBlockName:J,blockType:te,isSectionBlockInSelection:$,isSectionBlock:A(q),hasBlockStyles:Y,editedContentOnlySection:P(),blockEditingMode:N(q),selectedBlockStyleState:z(q),showStateOnCanvas:V(q),isResponsiveEditing:M(),blockStatesEditingEnabled:x().blockStatesEditingEnabled}},[]),h=(0,g1.useSelect)(_=>{if(!n||!o)return[];let{getClientIdsOfDescendants:x,getBlockEditingMode:w,shouldRenderBlockListView:T}=H(_(C)),B=x(o),R=new Set;return B.forEach(I=>{T(I)&&x(I).forEach(P=>R.add(P))}),B.filter(I=>!R.has(I)&&w(I)==="contentOnly")},[n,o]),m=UEe(r?.name,h,n,s),g=m?.length>1,b=KEe(r),v=e>1,y=!Bn(u);if(v&&!i)return(0,Fe.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,Fe.jsx)(HW,{}),g?(0,Fe.jsx)(A$,{tabs:m}):(0,Fe.jsx)(JEe,{blockName:t,showAdvancedControls:!1,showPositionControls:!1,showBindingsControls:!1})]});if(v&&i)return(0,Fe.jsx)("div",{className:"block-editor-block-inspector",children:(0,Fe.jsx)(HW,{})});let k=t===(0,Z_.getUnregisteredTypeHandlerName)();return!r||!o||k?(0,Fe.jsx)("span",{className:"block-editor-block-inspector__no-blocks",children:(0,qi.__)("No block selected.")}):(0,Fe.jsx)(Kqe,{animate:b,wrapper:_=>(0,Fe.jsx)(Yqe,{blockInspectorAnimationSettings:b,renderedBlockClientId:o,children:_}),children:(0,Fe.jsx)(qqe,{renderedBlockClientId:o,blockName:r.name,isSectionBlock:n,availableTabs:m,contentClientIds:h,hasBlockStyles:s,editedContentOnlySection:a,blockEditingMode:l,selectedBlockStyleState:u,showStateOnCanvas:d,isResponsiveEditing:f,blockStatesEditingEnabled:p,isBlockStyleStateSelected:y})})}var Kqe=({animate:e,wrapper:t,children:o})=>e?t(o):o,Yqe=({blockInspectorAnimationSettings:e,renderedBlockClientId:t,children:o})=>{let r=e&&e.enterDirection==="leftToRight"?-50:50;return(0,Fe.jsx)(X_.__unstableMotion.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:r,opacity:0},children:o},t)},qqe=({renderedBlockClientId:e,blockName:t,isSectionBlock:o,availableTabs:r,contentClientIds:n,hasBlockStyles:i,editedContentOnlySection:s,blockEditingMode:a,selectedBlockStyleState:l,showStateOnCanvas:u,isResponsiveEditing:d,blockStatesEditingEnabled:f=!0})=>{let p=(0,QEe.useRef)(null),h=r?.length>1,m=ea(l),g=Hi(l)&&d||ea(l),b=s&&s!==e,v=Do(s),y=Do(e),k=y.isSynced,{setSelectedBlockStyleState:S,setSelectedBlockStyleStateCanvasPreview:_}=H((0,g1.useDispatch)(C)),x=T=>{S(e,T)},w=T=>{_(e,T)};return(0,Fe.jsxs)("div",{className:"block-editor-block-inspector",children:[b&&(0,Fe.jsx)(cC,{...v,className:v?.isSynced&&"is-synced",parentClientId:s}),(0,Fe.jsx)(cC,{...y,allowParentNavigation:!0,className:k&&"is-synced",isChild:b,clientId:e,controls:a==="default"&&f&&(0,Fe.jsx)(ZEe,{name:t,value:l,onChange:x})}),a==="default"&&g&&(0,Fe.jsxs)(X_.__experimentalSpacer,{paddingX:4,paddingY:2,children:[m&&(0,Fe.jsx)(X_.ToggleControl,{label:(0,qi.__)("Show state on canvas"),checked:u,onChange:w}),(0,Fe.jsx)(XEe,{name:t,value:l,isResponsiveEditing:d})]}),(0,Fe.jsx)(cte,{clientId:e}),(0,Fe.jsx)(y0e,{clientId:e}),!g&&(0,Fe.jsx)(AM,{blockClientId:e}),(0,Fe.jsx)(T0e,{}),g&&(0,Fe.jsx)(Wqe,{blockName:t,clientId:e,contentClientIds:n,isSectionBlock:o,selectedBlockStyleState:l}),!g&&h&&(0,Fe.jsx)(Fe.Fragment,{children:(0,Fe.jsx)(A$,{hasBlockStyles:i,clientId:e,blockName:t,tabs:r,isSectionBlock:o,contentClientIds:n})}),!g&&!h&&(0,Fe.jsxs)(Fe.Fragment,{children:[i&&(0,Fe.jsx)(Xk,{clientId:e}),(0,Fe.jsx)(fV,{contentClientIds:n}),(0,Fe.jsx)(Oe.Slot,{group:"content"}),(0,Fe.jsx)(Oe.Slot,{group:"list",ref:p}),(0,Fe.jsx)(J2,{listViewRef:p}),!o&&(0,Fe.jsx)(JEe,{blockName:t})]}),!g&&(0,Fe.jsx)(mV.Slot,{}),(0,Fe.jsx)(nD,{},"back")]})},e1e=$qe;var D$=c(Rt(),1);var t1e=c(E(),1),o1e=()=>((0,D$.default)("__unstableUseClipboardHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),pC());function r1e(e){return(0,D$.default)("CopyHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),(0,t1e.jsx)("div",{...e,ref:pC()})}var n1e=c(Q(),1),V$=c(F(),1);var F$=c(E(),1),Zqe=()=>{};function Xqe({rootClientId:e,clientId:t,isAppender:o,showInserterHelpPanel:r,showMostUsedBlocks:n=!1,__experimentalInsertionIndex:i,__experimentalInitialTab:s,__experimentalInitialCategory:a,__experimentalFilterValue:l,onPatternCategorySelection:u,onSelect:d=Zqe,shouldFocusBlock:f=!1,onClose:p},h){let{destinationRootClientId:m}=(0,n1e.useSelect)(g=>{let{getBlockRootClientId:b}=g(C);return{destinationRootClientId:e||b(t)||void 0}},[t,e]);return(0,F$.jsx)(s9,{onSelect:d,rootClientId:m,clientId:t,isAppender:o,showInserterHelpPanel:r,showMostUsedBlocks:n,__experimentalInsertionIndex:i,__experimentalFilterValue:l,onPatternCategorySelection:u,__experimentalInitialTab:s,__experimentalInitialCategory:a,shouldFocusBlock:f,ref:h,onClose:p})}var z$=(0,V$.forwardRef)(Xqe);function Qqe(e,t){return(0,F$.jsx)(z$,{...e,onPatternCategorySelection:void 0,ref:t})}var i1e=(0,V$.forwardRef)(Qqe);var s1e=c(Rt(),1);function a1e(){return(0,s1e.default)("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}var l1e=c(fe(),1),b1=c(Tt(),1),ph=c(io(),1),c1e=c(E(),1),Jqe=window.navigator.userAgent.indexOf("Trident")!==-1,eZe=new Set([ph.UP,ph.DOWN,ph.LEFT,ph.RIGHT]),tZe=.75;function j$(){return(0,l1e.useRefEffect)(e=>{let{ownerDocument:t}=e,{defaultView:o}=t,r,n,i;function s(){r||(r=o.requestAnimationFrame(()=>{f(),r=null}))}function a(g){n&&o.cancelAnimationFrame(n),n=o.requestAnimationFrame(()=>{l(g),n=null})}function l({keyCode:g}){if(!h())return;let b=(0,b1.computeCaretRect)(o);if(!b)return;if(!i){i=b;return}if(eZe.has(g)){i=b;return}let v=b.top-i.top;if(v===0)return;let y=(0,b1.getScrollContainer)(e);if(!y)return;let k=y===t.body||y===t.documentElement,S=k?o.scrollY:y.scrollTop,_=k?0:y.getBoundingClientRect().top,x=k?i.top/o.innerHeight:(i.top-_)/(o.innerHeight-_);if(S===0&&x_+w||i.top<_){i=b;return}k?o.scrollBy(0,v):y.scrollTop+=v}function u(){t.addEventListener("selectionchange",d)}function d(){t.removeEventListener("selectionchange",d),f()}function f(){h()&&(i=(0,b1.computeCaretRect)(o))}function p(){let{activeElement:g}=t;if(!g)return null;if(!g.isContentEditable||!g.contains(e))return g;let{anchorNode:b}=o.getSelection();return b?(b.nodeType===b.ELEMENT_NODE?b:b.parentElement)?.closest('[contenteditable="true"]')??null:null}function h(){let g=p();return!!g&&e.contains(g)&&g.isContentEditable}function m(){let g=e.querySelectorAll('[contenteditable="true"]');return g[g.length-1]===p()}return o.addEventListener("scroll",s,!0),o.addEventListener("resize",s,!0),e.addEventListener("keydown",a),e.addEventListener("keyup",l),e.addEventListener("mousedown",u),e.addEventListener("touchstart",u),()=>{o.removeEventListener("scroll",s,!0),o.removeEventListener("resize",s,!0),e.removeEventListener("keydown",a),e.removeEventListener("keyup",l),e.removeEventListener("mousedown",u),e.removeEventListener("touchstart",u),t.removeEventListener("selectionchange",d),o.cancelAnimationFrame(r),o.cancelAnimationFrame(n)}},[])}function oZe({children:e}){return(0,c1e.jsx)("div",{ref:j$(),className:"block-editor__typewriter",children:e})}var rZe=Jqe?e=>e.children:oZe,u1e=rZe;var xy=c(F(),1),H$=c(Rt(),1);var U$=c(E(),1),bV=(0,xy.createContext)({});bV.displayName="RenderedRefsContext";function nZe(e,t,o){let r={...e,[t]:e[t]?new Set(e[t]):new Set};return r[t].add(o),r}function G$({children:e,uniqueId:t,blockName:o=""}){let r=(0,xy.useContext)(bV),{name:n}=ht();o=o||n;let i=(0,xy.useMemo)(()=>nZe(r,o,t),[r,o,t]);return(0,U$.jsx)(bV.Provider,{value:i,children:e})}function W$(e,t=""){let o=(0,xy.useContext)(bV),{name:r}=ht();return t=t||r,!!o[t]?.has(e)}var d1e=e=>((0,H$.default)("wp.blockEditor.__experimentalRecursionProvider",{since:"6.5",alternative:"wp.blockEditor.RecursionProvider"}),(0,U$.jsx)(G$,{...e})),f1e=(...e)=>((0,H$.default)("wp.blockEditor.__experimentalUseHasRecursion",{since:"6.5",alternative:"wp.blockEditor.useHasRecursion"}),W$(...e));var vV=c(U(),1),$$=c(G(),1),K$=c(F(),1),m1e=c(Tu(),1);var pa=c(U(),1);var p1e=c(G(),1),Rf=c(E(),1);function yV({title:e,help:t,actions:o=[],onClose:r}){return(0,Rf.jsxs)(pa.__experimentalVStack,{className:"block-editor-inspector-popover-header",spacing:4,children:[(0,Rf.jsxs)(pa.__experimentalHStack,{alignment:"center",children:[(0,Rf.jsx)(pa.__experimentalHeading,{className:"block-editor-inspector-popover-header__heading",level:2,size:13,children:e}),(0,Rf.jsx)(pa.__experimentalSpacer,{}),o.map(({label:n,icon:i,onClick:s})=>(0,Rf.jsx)(pa.Button,{size:"small",className:"block-editor-inspector-popover-header__action",label:n,icon:i,variant:!i&&"tertiary",onClick:s,children:!i&&n},n)),r&&(0,Rf.jsx)(pa.Button,{size:"small",className:"block-editor-inspector-popover-header__action",label:(0,p1e.__)("Close"),icon:eg,onClick:r})]}),t&&(0,Rf.jsx)(pa.__experimentalText,{children:t})]})}var Q_=c(E(),1);function iZe({onClose:e,onChange:t,showPopoverHeaderActions:o,isCompact:r,currentDate:n,title:i,...s},a){let l={startOfWeek:(0,m1e.getSettings)().l10n.startOfWeek,onChange:t,currentDate:r?void 0:n,currentTime:r?n:void 0,...s},u=r?vV.TimePicker:vV.DateTimePicker;return(0,Q_.jsxs)("div",{ref:a,className:"block-editor-publish-date-time-picker",children:[(0,Q_.jsx)(yV,{title:i||(0,$$.__)("Publish"),actions:o?[{label:(0,$$.__)("Now"),onClick:()=>t?.(null)}]:void 0,onClose:e}),(0,Q_.jsx)(u,{...l})]})}var Y$=(0,K$.forwardRef)(iZe);function sZe(e,t){return(0,Q_.jsx)(Y$,{...e,showPopoverHeaderActions:!0,isCompact:!1,ref:t})}var h1e=(0,K$.forwardRef)(sZe);var g1e=c(Rt(),1),b1e=c(F(),1);function aZe(){return(0,g1e.default)("wp.blockEditor.ToolSelector",{since:"6.9",hint:"The ToolSelector component no longer renders anything."}),null}var y1e=(0,b1e.forwardRef)(aZe);var v1=c(E(),1),Ge=e=>{if(e===null||typeof e!="object"||Array.isArray(e))return e;let t=Object.entries(e).map(([o,r])=>[o,Ge(r)]).filter(([,o])=>o!==void 0);return t.length?Object.fromEntries(t):void 0};function QD(e,t,o,r,n,i){if(Object.values(e??{}).every(l=>!l)||i.length===1&&o.innerBlocks.length===r.length)return o;let s=r[0]?.attributes;if(i.length>1&&r.length>1)if(r[n])s=r[n]?.attributes;else return o;let a=o;return Object.entries(e).forEach(([l,u])=>{u&&t[l].forEach(d=>{let f=cd(s,d);f&&(a={...a,attributes:De(a.attributes,d,f)})})}),a}function $t(e,t,o){let n=(0,v1e.getBlockSupport)(e,t)?.__experimentalSkipSerialization;return Array.isArray(n)?n.includes(o):n}var Bf=new WeakMap;function el({id:e,css:t}){return Rc({id:e,css:t})}function Rc({id:e,css:t,assets:o,__unstableType:r,variation:n,clientId:i}={}){let{setStyleOverride:s,deleteStyleOverride:a}=H((0,SV.useDispatch)(C)),l=(0,SV.useRegistry)(),u=(0,El.useId)();(0,El.useEffect)(()=>{if(!t&&!o)return;let d=e||u,f={id:e,css:t,assets:o,__unstableType:r,variation:n,clientId:i};return Bf.get(l)||Bf.set(l,[]),Bf.get(l).push([d,f]),window.queueMicrotask(()=>{Bf.get(l)?.length&&l.batch(()=>{Bf.get(l).forEach(p=>{s(...p)}),Bf.set(l,[])})}),()=>{Bf.get(l)?.find(([h])=>h===d)?Bf.set(l,Bf.get(l).filter(([h])=>h!==d)):a(d)}},[e,t,i,o,r,u,s,a,l,n])}function xl(e,t){let[o,r,n,i,s,a,l,u,d,f,p,h,m,g,b,v,y,k,S,_,x,w,T,B,R,I,A,P,O,N,z,V,M,D,L,j,q,J,te,ee,$,W,Y,Z,oe,ne,X,re,ae,ve,xe,ge,be,he,ke,_e,we,Re,se,ie,Ae,ye,Ee]=Le("background.backgroundImage","background.backgroundSize","background.gradient","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.minWidth","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"),qe=(0,El.useMemo)(()=>({background:{backgroundImage:o,backgroundSize:r,gradient:n},color:{palette:{custom:Z,theme:ne,default:X},gradients:{custom:be,theme:he,default:ke},duotone:{custom:ve,theme:xe,default:ge},defaultGradients:_e,defaultPalette:re,defaultDuotone:ae,custom:Y,customGradient:we,customDuotone:oe,background:Re,link:se,heading:Ae,button:ye,text:ie},typography:{fontFamilies:{custom:i,default:s,theme:a},fontSizes:{custom:u,default:d,theme:f},customFontSize:p,defaultFontSizes:l,fontStyle:h,fontWeight:m,lineHeight:g,textAlign:b,textColumns:v,textDecoration:y,textIndent:k,textTransform:_,letterSpacing:x,writingMode:S},spacing:{spacingSizes:{custom:A,default:P,theme:O},customSpacingSize:I,defaultSpacingSizes:R,padding:w,margin:T,blockGap:B,units:N},border:{color:J,radius:te,style:ee,width:$,radiusSizes:W},dimensions:{aspectRatio:z,height:V,minHeight:M,minWidth:D,width:L,dimensionSizes:j},layout:q,parentLayout:t,shadow:Ee}),[o,r,n,i,s,a,l,u,d,f,p,h,m,g,b,v,y,k,_,x,S,w,T,B,R,I,A,P,O,N,z,V,M,D,L,j,q,t,J,te,ee,$,W,Y,Z,oe,ne,X,re,ae,ve,xe,ge,be,he,ke,_e,we,Re,se,ie,Ae,ye,Ee]);return fD(qe,e)}function S1e(e){e=e.map(o=>({...o,Edit:(0,El.memo)(o.edit)}));let t=(0,q$.createHigherOrderComponent)(o=>function(n){let i=ht();return[...e.map((s,a)=>{let{Edit:l,hasSupport:u,attributeKeys:d=[],shareWithChildBlocks:f,supportsPatternEditing:p}=s;if(!(p&&i[Kf]||i[Dl]||i[Vy]&&f)||!u(n.name))return null;let m={};for(let g of d)n.attributes[g]&&(m[g]=n.attributes[g]);return(0,v1.jsx)(l,{name:n.name,isSelected:n.isSelected,clientId:n.clientId,setAttributes:n.setAttributes,__unstableParentLayout:n.__unstableParentLayout,...m},a)}),(0,v1.jsx)(o,{...n},"edit")]},"withBlockEditHooks");(0,y1.addFilter)("editor.BlockEdit","core/editor/hooks",t)}function lZe({index:e,useBlockProps:t,setAllWrapperProps:o,...r}){let n=t(r),i=s=>o(a=>{let l=[...a];return l[e]=s,l});return(0,El.useEffect)(()=>(i(n),()=>{i(void 0)})),null}var cZe=(0,El.memo)(lZe);function k1e(e){let t=(0,q$.createHigherOrderComponent)(o=>function(n){let[i,s]=(0,El.useState)(Array(e.length).fill(void 0));return[...e.map((a,l)=>{let{hasSupport:u,attributeKeys:d=[],useBlockProps:f,isMatch:p}=a,h={};for(let m of d)n.attributes[m]&&(h[m]=n.attributes[m]);return!Object.keys(h).length||!u(n.name)||p&&!p(h)?null:(0,v1.jsx)(cZe,{index:l,useBlockProps:f,setAllWrapperProps:s,name:n.name,clientId:n.clientId,...h},l)}),(0,v1.jsx)(o,{...n,wrapperProps:i.filter(Boolean).reduce((a,l)=>({...a,...l,className:K(a.className,l.className),style:{...a.style,...l.style}}),n.wrapperProps||{})},"edit")]},"withBlockListBlockHooks");(0,y1.addFilter)("editor.BlockListBlock","core/editor/hooks",t)}function _1e(e){function t(o,r,n){return e.reduce((i,s)=>{let{hasSupport:a,attributeKeys:l=[],addSaveProps:u}=s,d={};for(let f of l)n[f]&&(d[f]=n[f]);return!Object.keys(d).length||!a(r)?i:u(i,r,d)},o)}(0,y1.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",t,0),(0,y1.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",o=>(o.hasOwnProperty("className")&&!o.className&&delete o.className,o))}var x1e=c(ue(),1),w1e=c(go(),1);function uZe(e){let{apiVersion:t=1}=e;return t<2&&(0,x1e.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}(0,w1e.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",uZe);function C1e(e){e.hasAttribute("crossorigin")||e.setAttribute("crossorigin","anonymous")}if(window.crossOriginIsolated){let e=function(){document.body?t.observe(document.body,{childList:!0,attributes:!0,subtree:!0}):document.readyState==="loading"&&document.addEventListener("DOMContentLoaded",()=>{document.body&&t.observe(document.body,{childList:!0,attributes:!0,subtree:!0})})};dZe=e;let t=new window.MutationObserver(o=>{o.forEach(r=>{[r.addedNodes,r.target].forEach(n=>{(n instanceof window.NodeList?n:[n]).forEach(s=>{let a=s;a.querySelectorAll&&(a.querySelectorAll("source,script,video,link").forEach(l=>{C1e(l)}),["SOURCE","SCRIPT","VIDEO","LINK"].includes(a.nodeName)&&C1e(a))})})})});e()}var dZe;var E1e=c(go(),1),Tl=c(ue(),1);var Z$=c(E(),1),X$=["left","center","right","wide","full"],fZe=["wide","full"];function Q$(e,t=!0,o=!0){let r;return Array.isArray(e)?r=X$.filter(n=>e.includes(n)):e===!0?r=[...X$]:r=[],!o||e===!0&&!t?r.filter(n=>!fZe.includes(n)):r}function pZe(e){return"type"in(e.attributes?.align??{})||(0,Tl.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...X$,""]}}),e}function mZe({name:e,align:t,setAttributes:o}){let r=Q$((0,Tl.getBlockSupport)(e,"align"),(0,Tl.hasBlockSupport)(e,"alignWide",!0)),n=Fw(r).map(({name:a})=>a),i=Er();return!n.length||i!=="default"?null:(0,Z$.jsx)(No,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,Z$.jsx)(pP,{value:t,onChange:a=>{a||(0,Tl.getBlockType)(e)?.attributes?.align?.default&&(a=""),o({align:a})},controls:n})})}var kV={shareWithChildBlocks:!0,edit:mZe,useBlockProps:hZe,addSaveProps:gZe,attributeKeys:["align"],hasSupport(e){return(0,Tl.hasBlockSupport)(e,"align",!1)}};function hZe({name:e,align:t}){let o=Q$((0,Tl.getBlockSupport)(e,"align"),(0,Tl.hasBlockSupport)(e,"alignWide",!0));return Fw(o).some(n=>n.name===t)?{"data-align":t}:{}}function gZe(e,t,o){let{align:r}=o,n=(0,Tl.getBlockSupport)(t,"align"),i=(0,Tl.hasBlockSupport)(t,"alignWide",!0);return Q$(n,i).includes(r)&&(e.className=K(`align${r}`,e.className)),e}(0,E1e.addFilter)("blocks.registerBlockType","core/editor/align/addAttribute",pZe);var T1e=c(go(),1);function bZe(e){return"type"in(e.attributes?.lock??{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}(0,T1e.addFilter)("blocks.registerBlockType","core/lock/addAttribute",bZe);var rK=c(go(),1),rx=c(ue(),1);var S1=c(U(),1),wV=c(G(),1),F1e=c(F(),1),z1e=c(Q(),1),CV=c(ue(),1);var Ps=c(U(),1),N1e=c(F(),1),ox=c(G(),1),D1e=c(Q(),1);var tK=c(ue(),1),A1e=c(Q(),1),tx=c(U(),1),Pc=c(G(),1),_V=c(F(),1),L1e=c(fe(),1),M1e=c(Qr(),1);var J$=c(F(),1),P1e=c(fe(),1),I1e=c(U(),1);var R1e=c(U(),1);var J_=c(E(),1);function yZe({blockTypes:e,value:t,onItemChange:o}){return(0,J_.jsx)("ul",{className:"block-editor-block-manager__checklist",children:e.map(r=>(0,J_.jsxs)("li",{className:"block-editor-block-manager__checklist-item",children:[(0,J_.jsx)(R1e.CheckboxControl,{label:r.title,checked:t.includes(r.name),onChange:(...n)=>o(r,...n)}),(0,J_.jsx)(Et,{icon:r.icon})]},r.name))})}var B1e=yZe;var ex=c(E(),1);function O1e({title:e,blockTypes:t,selectedBlockTypes:o,onChange:r}){let n=(0,P1e.useInstanceId)(O1e),i=(0,J$.useCallback)((f,p)=>{r(p?[...o,f]:o.filter(({name:h})=>h!==f.name))},[o,r]),s=(0,J$.useCallback)(f=>{r(f?[...o,...t.filter(p=>!o.find(({name:h})=>h===p.name))]:o.filter(p=>!t.find(({name:h})=>h===p.name)))},[t,o,r]);if(!t.length)return null;let a=t.map(({name:f})=>f).filter(f=>(o??[]).some(p=>p.name===f)),l="block-editor-block-manager__category-title-"+n,u=a.length===t.length,d=!u&&a.length>0;return(0,ex.jsxs)("div",{role:"group","aria-labelledby":l,className:"block-editor-block-manager__category",children:[(0,ex.jsx)(I1e.CheckboxControl,{checked:u,onChange:s,className:"block-editor-block-manager__category-title",indeterminate:d,label:(0,ex.jsx)("span",{id:l,children:e})}),(0,ex.jsx)(B1e,{blockTypes:t,value:a,onItemChange:i})]})}var eK=O1e;var Pf=c(E(),1);function xV({blockTypes:e,selectedBlockTypes:t,onChange:o,showSelectAll:r=!0}){let n=(0,L1e.useDebounce)(M1e.speak,500),[i,s]=(0,_V.useState)(""),{categories:a,isMatchingSearchTerm:l}=(0,A1e.useSelect)(p=>({categories:p(tK.store).getCategories(),isMatchingSearchTerm:p(tK.store).isMatchingSearchTerm}),[]),u=e.filter(p=>!i||l(p,i)),d=t.length>0&&t.length!==e.length,f=e.length>0&&t.length===e.length;return(0,_V.useEffect)(()=>{if(!i)return;let p=u.length,h=(0,Pc.sprintf)((0,Pc._n)("%d result found.","%d results found.",p),p);n(h)},[u?.length,i,n]),(0,Pf.jsxs)(tx.__experimentalVStack,{className:"block-editor-block-manager__content",spacing:4,children:[(0,Pf.jsx)(tx.SearchControl,{label:(0,Pc.__)("Search for a block"),placeholder:(0,Pc.__)("Search for a block"),value:i,onChange:p=>s(p),className:"block-editor-block-manager__search"}),r&&(0,Pf.jsx)(tx.CheckboxControl,{className:"block-editor-block-manager__select-all",label:(0,Pc.__)("Select all"),checked:f,onChange:()=>{o(f?[]:e)},indeterminate:d}),(0,Pf.jsxs)("div",{tabIndex:"0",role:"region","aria-label":(0,Pc.__)("Available block types"),className:"block-editor-block-manager__results",children:[u.length===0&&(0,Pf.jsx)("p",{className:"block-editor-block-manager__no-results",children:(0,Pc.__)("No blocks found.")}),a.map(p=>(0,Pf.jsx)(eK,{title:p.title,blockTypes:u.filter(h=>h.category===p.slug),selectedBlockTypes:t,onChange:o},p.slug)),(0,Pf.jsx)(eK,{title:(0,Pc.__)("Uncategorized"),blockTypes:u.filter(({category:p})=>!p),selectedBlockTypes:t,onChange:o})]})]})}var Ic=c(E(),1);function V1e({clientId:e,blockTypes:t,selectedBlockTypes:o,onClose:r}){let[n,i]=(0,N1e.useState)(o),{updateBlockAttributes:s}=(0,D1e.useDispatch)(C),a=()=>{let l=n.length===t.length,u=n.map(({name:d})=>d);s(e,{allowedBlocks:l?void 0:u}),r()};return(0,Ic.jsx)(Ps.Modal,{title:(0,ox._x)("Manage allowed blocks","modal title"),onRequestClose:r,overlayClassName:"block-editor-block-allowed-blocks-modal",focusOnMount:"firstContentElement",size:"medium",children:(0,Ic.jsxs)(Ps.__experimentalVStack,{as:"form",onSubmit:l=>{l.preventDefault(),a()},spacing:"4",children:[(0,Ic.jsx)(Ps.__experimentalText,{children:(0,ox.__)("Select which blocks can be added inside this container.")}),(0,Ic.jsx)(xV,{blockTypes:t,selectedBlockTypes:n,onChange:l=>{i(l)}}),(0,Ic.jsxs)(Ps.Flex,{className:"block-editor-block-allowed-blocks-modal__actions",justify:"flex-end",expanded:!1,children:[(0,Ic.jsx)(Ps.FlexItem,{children:(0,Ic.jsx)(Ps.Button,{variant:"tertiary",onClick:r,__next40pxDefaultSize:!0,children:(0,ox.__)("Cancel")})}),(0,Ic.jsx)(Ps.FlexItem,{children:(0,Ic.jsx)(Ps.Button,{variant:"primary",type:"submit",__next40pxDefaultSize:!0,children:(0,ox.__)("Apply")})})]})]})})}var wy=c(E(),1);function j1e({clientId:e}){let[t,o]=(0,F1e.useState)(!1),{blockTypes:r,selectedBlockNames:n}=(0,z1e.useSelect)(a=>{let{getBlockAttributes:l}=a(C);return{blockTypes:a(CV.store).getBlockTypes(),selectedBlockNames:l(e)?.allowedBlocks}},[e]),i=r.filter(a=>(0,CV.hasBlockSupport)(a,"inserter",!0)&&(!a.parent||a.parent.includes("core/post-content")));if(!i)return null;let s=n===void 0?i:i.filter(a=>n.includes(a.name));return(0,wy.jsxs)("div",{className:"block-editor-block-allowed-blocks-control",children:[(0,wy.jsxs)(S1.BaseControl,{help:(0,wV.__)("Specify which blocks are allowed inside this container."),children:[(0,wy.jsx)(S1.BaseControl.VisualLabel,{children:(0,wV.__)("Allowed Blocks")}),(0,wy.jsx)(S1.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{o(!0)},className:"block-editor-block-allowed-blocks-control__button",children:(0,wV.__)("Manage allowed blocks")})]}),t&&(0,wy.jsx)(V1e,{clientId:e,blockTypes:i,selectedBlockTypes:s,onClose:()=>o(!1)})]})}var oK=c(E(),1);function vZe({clientId:e}){return Er()==="contentOnly"?null:(0,oK.jsx)(YC.Fill,{children:(0,oK.jsx)(j1e,{clientId:e})})}var H1e={edit:vZe,attributeKeys:["allowedBlocks"],hasSupport(e){return(0,rx.hasBlockSupport)(e,"allowedBlocks")}};function SZe(e){return e?.attributes?.allowedBlocks?.type||(0,rx.hasBlockSupport)(e,"allowedBlocks")&&(e.attributes={...e.attributes,allowedBlocks:{type:"array"}}),e}(0,rK.addFilter)("blocks.registerBlockType","core/allowedBlocks/attribute",SZe);function kZe(e,t,o,r){if(!(0,rx.hasBlockSupport)(e.name,"allowedBlocks")||t.length!==1&&r.length===1&&e.innerBlocks.length===t.length||r.length===1&&t.length>1||r.length>1&&t.length===1||r.length>1&&t.length>1&&r.length!==t.length||e.attributes.allowedBlocks)return e;let n=t[o]?.attributes?.allowedBlocks;if(!n)return e;let s=(0,rx.getBlockType)(e.name)?.allowedBlocks||[];if(!s.length)return{...e,attributes:{...e.attributes,allowedBlocks:n}};let a=n.filter(l=>s.includes(l));return{...e,attributes:{...e.attributes,allowedBlocks:a}}}(0,rK.addFilter)("blocks.switchToBlockType.transformedBlock","core/allowedBlocks/addTransforms",kZe);var U1e=c(go(),1),EV=c(U(),1),k1=c(G(),1),TV=c(ue(),1);var mh=c(E(),1),_Ze=/[\s#]/g;function xZe(e){return"type"in(e.attributes?.anchor??{})||(0,TV.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:{type:"string"}}),e}function wZe({anchor:e,setAttributes:t}){return Er()!=="default"?null:(0,mh.jsx)(Oe,{group:"advanced",children:(0,mh.jsx)(EV.TextControl,{className:"html-anchor-control",label:(0,k1.__)("HTML anchor"),help:(0,mh.jsxs)(mh.Fragment,{children:[(0,k1.__)("Enter a word or two\u2014without spaces\u2014to make a unique web address just for this block, called an \u201Canchor\u201D. Then, you\u2019ll be able to link directly to this section of your page.")," ",(0,mh.jsx)(EV.ExternalLink,{href:(0,k1.__)("https://wordpress.org/documentation/article/page-jumps/"),children:(0,k1.__)("Learn more about anchors")})]}),value:e||"",placeholder:null,onChange:r=>{r=r.replace(_Ze,"-"),t({anchor:r!==""?r:void 0})},autoCapitalize:"none",autoComplete:"off"})})}var nK={addSaveProps:CZe,edit:wZe,attributeKeys:["anchor"],hasSupport(e){return(0,TV.hasBlockSupport)(e,"anchor")}};function CZe(e,t,o){return(0,TV.hasBlockSupport)(t,"anchor")&&(e.id=o.anchor===""?null:o.anchor),e}(0,U1e.addFilter)("blocks.registerBlockType","core/anchor/attribute",xZe);var G1e=c(go(),1),RV=c(ue(),1);function EZe(e){return e?.attributes?.ariaLabel?.type||(0,RV.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:{type:"string"}}),e}function TZe(e,t,o){return(0,RV.hasBlockSupport)(t,"ariaLabel")&&!$t(t,"ariaLabel","ariaLabel")&&(e["aria-label"]=o.ariaLabel===""?null:o.ariaLabel),e}var W1e={addSaveProps:TZe,attributeKeys:["ariaLabel"],hasSupport(e){return(0,RV.hasBlockSupport)(e,"ariaLabel")}};(0,G1e.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",EZe);var bx=c(ue(),1),JBe=c(fe(),1),P5=c(U(),1),I5=c(Q(),1);var iK=c(G(),1);var er="isAny",tr="isNone",Si="isAll",ki="isNotAll",Zi="between",Xi="inThePast",Is="over",hr="is",gr="isNot",hh="lessThan",gh="greaterThan",bh="lessThanOrEqual",yh="greaterThanOrEqual",vh="before",Sh="after",kh="beforeInc",_h="afterInc",Hu="contains",Uu="notContains",Gu="startsWith",xh="on",wh="notOn";var Dno={asc:(0,iK.__)("Sort ascending"),desc:(0,iK.__)("Sort descending")};var $1e=c(Ix(),1),{lock:Fno,unlock:so}=(0,$1e.__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/dataviews");var _1=c(F(),1),RZe=[];function Os({elements:e,getElements:t}){let o=Array.isArray(e)&&e.length>0?e:RZe,[r,n]=(0,_1.useState)(o),[i,s]=(0,_1.useState)(!1);return(0,_1.useEffect)(()=>{if(!t){n(o);return}let a=!1;return s(!0),t().then(l=>{if(!a){let u=Array.isArray(l)&&l.length>0?l:o;n(u)}}).catch(()=>{a||n(o)}).finally(()=>{a||s(!1)}),()=>{a=!0}},[t,o]),{elements:r,isLoading:i}}var BZe=Math.pow(10,8)*24*60*60*1e3,Hno=-BZe,BV=6048e5,K1e=864e5;var PZe=3600;var Y1e=PZe*24,Uno=Y1e*7,IZe=Y1e*365.2425,OZe=IZe/12,Gno=OZe*3,sK=Symbol.for("constructDateFrom");function yn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&sK in e?e[sK](t):e instanceof Date?new e.constructor(t):new Date(t)}function po(e,t){return yn(t||e,e)}function PV(e,t,o){let r=po(e,o?.in);return isNaN(t)?yn(o?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function IV(e,t,o){let r=po(e,o?.in);if(isNaN(t))return yn(o?.in||e,NaN);if(!t)return r;let n=r.getDate(),i=yn(o?.in||e,r.getTime());i.setMonth(r.getMonth()+t+1,0);let s=i.getDate();return n>=s?i:(r.setFullYear(i.getFullYear(),i.getMonth(),n),r)}var AZe={};function Ch(){return AZe}function If(e,t){let o=Ch(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,n=po(e,t?.in),i=n.getDay(),s=(i=i.getTime()?r+1:o.getTime()>=a.getTime()?r:r-1}function aK(e){let t=po(e),o=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return o.setUTCFullYear(t.getFullYear()),+e-+o}function q1e(e,...t){let o=yn.bind(null,e||t.find(r=>typeof r=="object"));return t.map(o)}function lK(e,t){let o=po(e,t?.in);return o.setHours(0,0,0,0),o}function Z1e(e,t,o){let[r,n]=q1e(o?.in,e,t),i=lK(r),s=lK(n),a=+i-aK(i),l=+s-aK(s);return Math.round((a-l)/K1e)}function X1e(e,t){let o=OV(e,t),r=yn(t?.in||e,0);return r.setFullYear(o,0,4),r.setHours(0,0,0,0),Cy(r)}function Q1e(e,t,o){return PV(e,t*7,o)}function J1e(e,t,o){return IV(e,t*12,o)}function eTe(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Of(e){return!(!eTe(e)&&typeof e!="number"||isNaN(+po(e)))}function tTe(e,t){let o=po(e,t?.in);return o.setDate(1),o.setHours(0,0,0,0),o}function AV(e,t){let o=po(e,t?.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}var LZe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},oTe=(e,t,o)=>{let r,n=LZe[e];return typeof n=="string"?r=n:t===1?r=n.one:r=n.other.replace("{{count}}",t.toString()),o?.addSuffix?o.comparison&&o.comparison>0?"in "+r:r+" ago":r};function LV(e){return(t={})=>{let o=t.width?String(t.width):e.defaultWidth;return e.formats[o]||e.formats[e.defaultWidth]}}var MZe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},NZe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},DZe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},rTe={date:LV({formats:MZe,defaultWidth:"full"}),time:LV({formats:NZe,defaultWidth:"full"}),dateTime:LV({formats:DZe,defaultWidth:"full"})};var VZe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},nTe=(e,t,o,r)=>VZe[e];function nx(e){return(t,o)=>{let r=o?.context?String(o.context):"standalone",n;if(r==="formatting"&&e.formattingValues){let s=e.defaultFormattingWidth||e.defaultWidth,a=o?.width?String(o.width):s;n=e.formattingValues[a]||e.formattingValues[s]}else{let s=e.defaultWidth,a=o?.width?String(o.width):e.defaultWidth;n=e.values[a]||e.values[s]}let i=e.argumentCallback?e.argumentCallback(t):t;return n[i]}}var FZe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},zZe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},jZe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},HZe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},UZe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},GZe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},WZe=(e,t)=>{let o=Number(e),r=o%100;if(r>20||r<10)switch(r%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},iTe={ordinalNumber:WZe,era:nx({values:FZe,defaultWidth:"wide"}),quarter:nx({values:zZe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:nx({values:jZe,defaultWidth:"wide"}),day:nx({values:HZe,defaultWidth:"wide"}),dayPeriod:nx({values:UZe,defaultWidth:"wide",formattingValues:GZe,defaultFormattingWidth:"wide"})};function ix(e){return(t,o={})=>{let r=o.width,n=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(n);if(!i)return null;let s=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?KZe(a,f=>f.test(s)):$Ze(a,f=>f.test(s)),u;u=e.valueCallback?e.valueCallback(l):l,u=o.valueCallback?o.valueCallback(u):u;let d=t.slice(s.length);return{value:u,rest:d}}}function $Ze(e,t){for(let o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t(e[o]))return o}function KZe(e,t){for(let o=0;o{let r=t.match(e.matchPattern);if(!r)return null;let n=r[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=o.valueCallback?o.valueCallback(s):s;let a=t.slice(n.length);return{value:s,rest:a}}}var YZe=/^(\d+)(th|st|nd|rd)?/i,qZe=/\d+/i,ZZe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},XZe={any:[/^b/i,/^(a|c)/i]},QZe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},JZe={any:[/1/i,/2/i,/3/i,/4/i]},eXe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},tXe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},oXe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},rXe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},nXe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},iXe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},aTe={ordinalNumber:sTe({matchPattern:YZe,parsePattern:qZe,valueCallback:e=>parseInt(e,10)}),era:ix({matchPatterns:ZZe,defaultMatchWidth:"wide",parsePatterns:XZe,defaultParseWidth:"any"}),quarter:ix({matchPatterns:QZe,defaultMatchWidth:"wide",parsePatterns:JZe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ix({matchPatterns:eXe,defaultMatchWidth:"wide",parsePatterns:tXe,defaultParseWidth:"any"}),day:ix({matchPatterns:oXe,defaultMatchWidth:"wide",parsePatterns:rXe,defaultParseWidth:"any"}),dayPeriod:ix({matchPatterns:nXe,defaultMatchWidth:"any",parsePatterns:iXe,defaultParseWidth:"any"})};var cK={code:"en-US",formatDistance:oTe,formatLong:rTe,formatRelative:nTe,localize:iTe,match:aTe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function lTe(e,t){let o=po(e,t?.in);return Z1e(o,AV(o))+1}function cTe(e,t){let o=po(e,t?.in),r=+Cy(o)-+X1e(o);return Math.round(r/BV)+1}function MV(e,t){let o=po(e,t?.in),r=o.getFullYear(),n=Ch(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=yn(t?.in||e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);let a=If(s,t),l=yn(t?.in||e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);let u=If(l,t);return+o>=+a?r+1:+o>=+u?r:r-1}function uTe(e,t){let o=Ch(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,n=MV(e,t),i=yn(t?.in||e,0);return i.setFullYear(n,0,r),i.setHours(0,0,0,0),If(i,t)}function dTe(e,t){let o=po(e,t?.in),r=+If(o,t)-+uTe(o,t);return Math.round(r/BV)+1}function Xt(e,t){let o=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return o+r}var Af={y(e,t){let o=e.getFullYear(),r=o>0?o:1-o;return Xt(t==="yy"?r%100:r,t.length)},M(e,t){let o=e.getMonth();return t==="M"?String(o+1):Xt(o+1,2)},d(e,t){return Xt(e.getDate(),t.length)},a(e,t){let o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return o.toUpperCase();case"aaa":return o;case"aaaaa":return o[0];default:return o==="am"?"a.m.":"p.m."}},h(e,t){return Xt(e.getHours()%12||12,t.length)},H(e,t){return Xt(e.getHours(),t.length)},m(e,t){return Xt(e.getMinutes(),t.length)},s(e,t){return Xt(e.getSeconds(),t.length)},S(e,t){let o=t.length,r=e.getMilliseconds(),n=Math.trunc(r*Math.pow(10,o-3));return Xt(n,t.length)}};var sx={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},uK={G:function(e,t,o){let r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return o.era(r,{width:"abbreviated"});case"GGGGG":return o.era(r,{width:"narrow"});default:return o.era(r,{width:"wide"})}},y:function(e,t,o){if(t==="yo"){let r=e.getFullYear(),n=r>0?r:1-r;return o.ordinalNumber(n,{unit:"year"})}return Af.y(e,t)},Y:function(e,t,o,r){let n=MV(e,r),i=n>0?n:1-n;if(t==="YY"){let s=i%100;return Xt(s,2)}return t==="Yo"?o.ordinalNumber(i,{unit:"year"}):Xt(i,t.length)},R:function(e,t){let o=OV(e);return Xt(o,t.length)},u:function(e,t){let o=e.getFullYear();return Xt(o,t.length)},Q:function(e,t,o){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Xt(r,2);case"Qo":return o.ordinalNumber(r,{unit:"quarter"});case"QQQ":return o.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return o.quarter(r,{width:"narrow",context:"formatting"});default:return o.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,o){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Xt(r,2);case"qo":return o.ordinalNumber(r,{unit:"quarter"});case"qqq":return o.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return o.quarter(r,{width:"narrow",context:"standalone"});default:return o.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,o){let r=e.getMonth();switch(t){case"M":case"MM":return Af.M(e,t);case"Mo":return o.ordinalNumber(r+1,{unit:"month"});case"MMM":return o.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return o.month(r,{width:"narrow",context:"formatting"});default:return o.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,o){let r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Xt(r+1,2);case"Lo":return o.ordinalNumber(r+1,{unit:"month"});case"LLL":return o.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return o.month(r,{width:"narrow",context:"standalone"});default:return o.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,o,r){let n=dTe(e,r);return t==="wo"?o.ordinalNumber(n,{unit:"week"}):Xt(n,t.length)},I:function(e,t,o){let r=cTe(e);return t==="Io"?o.ordinalNumber(r,{unit:"week"}):Xt(r,t.length)},d:function(e,t,o){return t==="do"?o.ordinalNumber(e.getDate(),{unit:"date"}):Af.d(e,t)},D:function(e,t,o){let r=lTe(e);return t==="Do"?o.ordinalNumber(r,{unit:"dayOfYear"}):Xt(r,t.length)},E:function(e,t,o){let r=e.getDay();switch(t){case"E":case"EE":case"EEE":return o.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return o.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(r,{width:"short",context:"formatting"});default:return o.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,o,r){let n=e.getDay(),i=(n-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Xt(i,2);case"eo":return o.ordinalNumber(i,{unit:"day"});case"eee":return o.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return o.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(n,{width:"short",context:"formatting"});default:return o.day(n,{width:"wide",context:"formatting"})}},c:function(e,t,o,r){let n=e.getDay(),i=(n-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Xt(i,t.length);case"co":return o.ordinalNumber(i,{unit:"day"});case"ccc":return o.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return o.day(n,{width:"narrow",context:"standalone"});case"cccccc":return o.day(n,{width:"short",context:"standalone"});default:return o.day(n,{width:"wide",context:"standalone"})}},i:function(e,t,o){let r=e.getDay(),n=r===0?7:r;switch(t){case"i":return String(n);case"ii":return Xt(n,t.length);case"io":return o.ordinalNumber(n,{unit:"day"});case"iii":return o.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return o.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return o.day(r,{width:"short",context:"formatting"});default:return o.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,o){let n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return o.dayPeriod(n,{width:"narrow",context:"formatting"});default:return o.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,o){let r=e.getHours(),n;switch(r===12?n=sx.noon:r===0?n=sx.midnight:n=r/12>=1?"pm":"am",t){case"b":case"bb":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return o.dayPeriod(n,{width:"narrow",context:"formatting"});default:return o.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,o){let r=e.getHours(),n;switch(r>=17?n=sx.evening:r>=12?n=sx.afternoon:r>=4?n=sx.morning:n=sx.night,t){case"B":case"BB":case"BBB":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return o.dayPeriod(n,{width:"narrow",context:"formatting"});default:return o.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,o){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),o.ordinalNumber(r,{unit:"hour"})}return Af.h(e,t)},H:function(e,t,o){return t==="Ho"?o.ordinalNumber(e.getHours(),{unit:"hour"}):Af.H(e,t)},K:function(e,t,o){let r=e.getHours()%12;return t==="Ko"?o.ordinalNumber(r,{unit:"hour"}):Xt(r,t.length)},k:function(e,t,o){let r=e.getHours();return r===0&&(r=24),t==="ko"?o.ordinalNumber(r,{unit:"hour"}):Xt(r,t.length)},m:function(e,t,o){return t==="mo"?o.ordinalNumber(e.getMinutes(),{unit:"minute"}):Af.m(e,t)},s:function(e,t,o){return t==="so"?o.ordinalNumber(e.getSeconds(),{unit:"second"}):Af.s(e,t)},S:function(e,t){return Af.S(e,t)},X:function(e,t,o){let r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return pTe(r);case"XXXX":case"XX":return Ey(r);default:return Ey(r,":")}},x:function(e,t,o){let r=e.getTimezoneOffset();switch(t){case"x":return pTe(r);case"xxxx":case"xx":return Ey(r);default:return Ey(r,":")}},O:function(e,t,o){let r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+fTe(r,":");default:return"GMT"+Ey(r,":")}},z:function(e,t,o){let r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+fTe(r,":");default:return"GMT"+Ey(r,":")}},t:function(e,t,o){let r=Math.trunc(+e/1e3);return Xt(r,t.length)},T:function(e,t,o){return Xt(+e,t.length)}};function fTe(e,t=""){let o=e>0?"-":"+",r=Math.abs(e),n=Math.trunc(r/60),i=r%60;return i===0?o+String(n):o+String(n)+t+Xt(i,2)}function pTe(e,t){return e%60===0?(e>0?"-":"+")+Xt(Math.abs(e)/60,2):Ey(e,t)}function Ey(e,t=""){let o=e>0?"-":"+",r=Math.abs(e),n=Xt(Math.trunc(r/60),2),i=Xt(r%60,2);return o+n+t+i}var mTe=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},hTe=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},sXe=(e,t)=>{let o=e.match(/(P+)(p+)?/)||[],r=o[1],n=o[2];if(!n)return mTe(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",mTe(r,t)).replace("{{time}}",hTe(n,t))},gTe={p:hTe,P:sXe};var aXe=/^D+$/,lXe=/^Y+$/,cXe=["D","DD","YY","YYYY"];function bTe(e){return aXe.test(e)}function yTe(e){return lXe.test(e)}function vTe(e,t,o){let r=uXe(e,t,o);if(console.warn(r),cXe.includes(e))throw new RangeError(r)}function uXe(e,t,o){let r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var dXe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,fXe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,pXe=/^'([^]*?)'?$/,mXe=/''/g,hXe=/[a-zA-Z]/;function dK(e,t,o){let r=Ch(),n=o?.locale??r.locale??cK,i=o?.firstWeekContainsDate??o?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=o?.weekStartsOn??o?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=po(e,o?.in);if(!Of(a))throw new RangeError("Invalid time value");let l=t.match(fXe).map(d=>{let f=d[0];if(f==="p"||f==="P"){let p=gTe[f];return p(d,n.formatLong)}return d}).join("").match(dXe).map(d=>{if(d==="''")return{isToken:!1,value:"'"};let f=d[0];if(f==="'")return{isToken:!1,value:gXe(d)};if(uK[f])return{isToken:!0,value:d};if(f.match(hXe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:d}});n.localize.preprocessor&&(l=n.localize.preprocessor(a,l));let u={firstWeekContainsDate:i,weekStartsOn:s,locale:n};return l.map(d=>{if(!d.isToken)return d.value;let f=d.value;(!o?.useAdditionalWeekYearTokens&&yTe(f)||!o?.useAdditionalDayOfYearTokens&&bTe(f))&&vTe(f,t,String(e));let p=uK[f[0]];return p(a,f,n.localize,u)}).join("")}function gXe(e){let t=e.match(pXe);return t?t[1].replace(mXe,"'"):e}function Ty(e,t,o){return PV(e,-t,o)}function NV(e,t,o){return IV(e,-t,o)}function STe(e,t,o){return Q1e(e,-t,o)}function DV(e,t,o){return J1e(e,-t,o)}var He=c(G(),1),Tr=c(F(),1),Qi=c(Tu(),1);var fK=c(E(),1),Zr={Name:(0,fK.jsx)("span",{className:"dataviews-filters__summary-filter-text-name"}),Value:(0,fK.jsx)("span",{className:"dataviews-filters__summary-filter-text-value"})};function kTe(e,t){switch(t){case"days":return Ty(new Date,e);case"weeks":return STe(new Date,e);case"months":return NV(new Date,e);case"years":return DV(new Date,e);default:return new Date}}var _Te={label:(0,He.__)("Is none of"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is none of: %2$s"),e.name,t.map(o=>o.label).join(", ")),Zr),filter:((e,t,o)=>{if(!o?.length)return!0;let r=t.getValue({item:e});return Array.isArray(r)?!o.some(n=>r.includes(n)):typeof r=="string"?!o.includes(r):!1}),selection:"multi"},xTe=[{name:er,label:(0,He.__)("Includes"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s includes: %2$s"),e.name,t.map(o=>o.label).join(", ")),Zr),filter(e,t,o){if(!o?.length)return!0;let r=t.getValue({item:e});return Array.isArray(r)?o.some(n=>r.includes(n)):typeof r=="string"?o.includes(r):!1},selection:"multi"},{name:tr,..._Te},{name:Si,label:(0,He.__)("Includes all"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s includes all: %2$s"),e.name,t.map(o=>o.label).join(", ")),Zr),filter(e,t,o){return o?.length?o.every(r=>t.getValue({item:e})?.includes(r)):!0},selection:"multi"},{name:ki,..._Te},{name:Zi,label:(0,He.__)("Between (inc)"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s between (inc): %2$s and %3$s"),e.name,t[0].label[0],t[0].label[1]),Zr),filter(e,t,o){if(!Array.isArray(o)||o.length!==2||o[0]===void 0||o[1]===void 0)return!0;let r=t.getValue({item:e});return typeof r=="number"||r instanceof Date||typeof r=="string"?r>=o[0]&&r<=o[1]:!1},selection:"custom"},{name:Xi,label:(0,He.__)("In the past"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is in the past: %2$s"),e.name,`${t[0].value.value} ${t[0].value.unit}`),Zr),filter(e,t,o){if(o?.value===void 0||o?.unit===void 0)return!0;let r=kTe(o.value,o.unit),n=(0,Qi.getDate)(t.getValue({item:e}));return n>=r&&n<=new Date},selection:"custom"},{name:Is,label:(0,He.__)("Over"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is over: %2$s"),e.name,`${t[0].value.value} ${t[0].value.unit}`),Zr),filter(e,t,o){if(o?.value===void 0||o?.unit===void 0)return!0;let r=kTe(o.value,o.unit);return(0,Qi.getDate)(t.getValue({item:e}))(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){return o===t.getValue({item:e})||o===void 0},selection:"single"},{name:gr,label:(0,He.__)("Is not"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is not: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){return o!==t.getValue({item:e})},selection:"single"},{name:hh,label:(0,He.__)("Less than"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is less than: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){return o===void 0?!0:t.getValue({item:e})(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is greater than: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){return o===void 0?!0:t.getValue({item:e})>o},selection:"single"},{name:bh,label:(0,He.__)("Less than or equal"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is less than or equal to: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){return o===void 0?!0:t.getValue({item:e})<=o},selection:"single"},{name:yh,label:(0,He.__)("Greater than or equal"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is greater than or equal to: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){return o===void 0?!0:t.getValue({item:e})>=o},selection:"single"},{name:vh,label:(0,He.__)("Before"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is before: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){if(o===void 0)return!0;let r=(0,Qi.getDate)(o);return(0,Qi.getDate)(t.getValue({item:e}))(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is after: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){if(o===void 0)return!0;let r=(0,Qi.getDate)(o);return(0,Qi.getDate)(t.getValue({item:e}))>r},selection:"single"},{name:kh,label:(0,He.__)("Before (inc)"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is on or before: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){if(o===void 0)return!0;let r=(0,Qi.getDate)(o);return(0,Qi.getDate)(t.getValue({item:e}))<=r},selection:"single"},{name:_h,label:(0,He.__)("After (inc)"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is on or after: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){if(o===void 0)return!0;let r=(0,Qi.getDate)(o);return(0,Qi.getDate)(t.getValue({item:e}))>=r},selection:"single"},{name:Hu,label:(0,He.__)("Contains"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s contains: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){if(o===void 0)return!0;let r=t.getValue({item:e});return typeof r=="string"&&o&&r.toLowerCase().includes(String(o).toLowerCase())},selection:"single"},{name:Uu,label:(0,He.__)("Doesn't contain"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s doesn't contain: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){if(o===void 0)return!0;let r=t.getValue({item:e});return typeof r=="string"&&o&&!r.toLowerCase().includes(String(o).toLowerCase())},selection:"single"},{name:Gu,label:(0,He.__)("Starts with"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s starts with: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){if(o===void 0)return!0;let r=t.getValue({item:e});return typeof r=="string"&&o&&r.toLowerCase().startsWith(String(o).toLowerCase())},selection:"single"},{name:xh,label:(0,He.__)("On"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){if(o===void 0)return!0;let r=(0,Qi.getDate)(o),n=(0,Qi.getDate)(t.getValue({item:e}));return r.getTime()===n.getTime()},selection:"single"},{name:wh,label:(0,He.__)("Not on"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is not: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){if(o===void 0)return!0;let r=(0,Qi.getDate)(o),n=(0,Qi.getDate)(t.getValue({item:e}));return r.getTime()!==n.getTime()},selection:"single"}],wTe=e=>xTe.find(t=>t.name===e),CTe=()=>xTe.map(e=>e.name);var ETe=c(U(),1),TTe=c(F(),1);function ao(e,t){let o;return e?.required&&t?.required?o=t?.required?.message?t.required:void 0:e?.pattern&&t?.pattern?o=t.pattern:e?.min&&t?.min?o=t.min:e?.max&&t?.max?o=t.max:e?.minLength&&t?.minLength?o=t.minLength:e?.maxLength&&t?.maxLength?o=t.maxLength:e?.elements&&t?.elements?o=t.elements:t?.custom&&(o=t.custom),o}var RTe=c(E(),1),{ValidatedCheckboxControl:bXe}=so(ETe.privateApis);function BTe({field:e,onChange:t,data:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{getValue:s,setValue:a,label:l,description:u,isValid:d}=e,f=e.isDisabled({item:o,field:e}),p=(0,TTe.useCallback)(()=>{t(a({item:o,value:!s({item:o})}))},[o,s,t,a]);return(0,RTe.jsx)(bXe,{required:!!e.isValid?.required,markWhenOptional:n,customValidity:ao(d,i),hidden:r,label:l,help:u,checked:s({item:o}),onChange:p,disabled:f})}var VV=c(U(),1),PTe=c(F(),1);var pK=c(E(),1),{ValidatedComboboxControl:yXe}=so(VV.privateApis);function FV({data:e,field:t,onChange:o,hideLabelFromVision:r,validity:n}){let{label:i,description:s,placeholder:a,getValue:l,setValue:u,isValid:d}=t,f=l({item:e})??"",p=(0,PTe.useCallback)(g=>o(u({item:e,value:g??""})),[e,o,u]),{elements:h,isLoading:m}=Os({elements:t.elements,getElements:t.getElements});return m?(0,pK.jsx)(VV.Spinner,{}):(0,pK.jsx)(yXe,{required:!!t.isValid?.required,customValidity:ao(d,n),label:i,value:f,help:s,placeholder:a,options:h,onChange:p,hideLabelFromVision:r,allowReset:!0,expandOnFocus:!0})}var HV=c(U(),1),Rl=c(F(),1),jV=c(G(),1),ma=c(Tu(),1);var lx=c(U(),1),mK=c(F(),1),Wu=c(G(),1);var ax=c(E(),1),vXe={[Xi]:[{value:"days",label:(0,Wu.__)("Days")},{value:"weeks",label:(0,Wu.__)("Weeks")},{value:"months",label:(0,Wu.__)("Months")},{value:"years",label:(0,Wu.__)("Years")}],[Is]:[{value:"days",label:(0,Wu.__)("Days ago")},{value:"weeks",label:(0,Wu.__)("Weeks ago")},{value:"months",label:(0,Wu.__)("Months ago")},{value:"years",label:(0,Wu.__)("Years ago")}]};function zV({className:e,data:t,field:o,onChange:r,hideLabelFromVision:n,operator:i}){let s=vXe[i===Xi?"inThePast":"over"],{id:a,label:l,description:u,getValue:d,setValue:f}=o,p=o.isDisabled({item:t,field:o}),h=d({item:t}),{value:m="",unit:g=s[0].value}=h&&typeof h=="object"?h:{},b=(0,mK.useCallback)(y=>r(f({item:t,value:{value:Number(y),unit:g}})),[r,f,t,g]),v=(0,mK.useCallback)(y=>r(f({item:t,value:{value:m,unit:y}})),[r,f,t,m]);return(0,ax.jsx)(lx.BaseControl,{id:a,className:K(e,"dataviews-controls__relative-date"),label:l,hideLabelFromVision:n,help:u,children:(0,ax.jsxs)(Qe,{direction:"row",gap:"sm",children:[(0,ax.jsx)(lx.__experimentalNumberControl,{className:"dataviews-controls__relative-date-number",spinControls:"none",min:1,step:1,value:m,onChange:b,disabled:p}),(0,ax.jsx)(lx.SelectControl,{className:"dataviews-controls__relative-date-unit",label:(0,Wu.__)("Unit"),value:g,options:s,onChange:v,hideLabelFromVision:!0,disabled:p})]})})}var ITe=c(F(),1);function x1(e,t){let o=typeof e.min?.constraint=="string"?e.min.constraint:void 0,r=typeof e.max?.constraint=="string"?e.max.constraint:void 0,n=(0,ITe.useMemo)(()=>{let i=[];if(o){let s=t(o);s&&i.push({before:s})}if(r){let s=t(r);s&&i.push({after:s})}return i.length>0?i:void 0},[o,r,t]);return{minConstraint:o,maxConstraint:r,disabledMatchers:n}}var OTe=c(Tu(),1);function w1(e){if(!e)return null;let t=(0,OTe.getDate)(e);return t&&Of(t)?t:null}var Eh=c(E(),1),{DateCalendar:SXe,ValidatedInputControl:kXe}=so(HV.privateApis),hK=e=>e?(0,ma.dateI18n)("Y-m-d\\TH:i",(0,ma.getDate)(e)):"";function _Xe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i,config:s}){let{compact:a}=s||{},{id:l,label:u,description:d,setValue:f,getValue:p,isValid:h}=t,m=t.isDisabled({item:e,field:t}),g=p({item:e}),b=typeof g=="string"?g:void 0,[v,y]=(0,Rl.useState)(()=>w1(b)||new Date),k=(0,Rl.useRef)(null),S=(0,Rl.useRef)(void 0),_=(0,Rl.useRef)(null),{minConstraint:x,maxConstraint:w,disabledMatchers:T}=x1(h,w1),B=(0,Rl.useCallback)(z=>o(f({item:e,value:z})),[e,o,f]);(0,Rl.useEffect)(()=>()=>{S.current&&clearTimeout(S.current)},[]);let R=(0,Rl.useCallback)(z=>{let V;if(z){let M=(0,ma.dateI18n)("Y-m-d",z),D;b?D=(0,ma.dateI18n)("H:i",(0,ma.getDate)(b)):D=(0,ma.dateI18n)("H:i",z),V=(0,ma.getDate)(`${M}T${D}`).toISOString(),B(V),S.current&&clearTimeout(S.current)}else B(void 0);_.current=k.current&&k.current.ownerDocument.activeElement,S.current=setTimeout(()=>{k.current&&(k.current.focus(),k.current.blur(),B(V),_.current&&_.current instanceof HTMLElement&&_.current.focus())},0)},[B,b]),I=(0,Rl.useCallback)(z=>{if(z){let V=(0,ma.getDate)(z);B(V.toISOString());let M=w1(V.toISOString());M&&y(M)}else B(void 0)},[B]),{format:A}=t,P=A.weekStartsOn??(0,ma.getSettings)().l10n.startOfWeek,{timezone:{string:O}}=(0,ma.getSettings)(),N=u;return h?.required&&!n&&!r?N=`${u} (${(0,jV.__)("Required")})`:!h?.required&&n&&!r&&(N=`${u} (${(0,jV.__)("Optional")})`),(0,Eh.jsx)(HV.BaseControl,{id:l,label:N,help:d,hideLabelFromVision:r,children:(0,Eh.jsxs)(Qe,{direction:"column",gap:"lg",children:[(0,Eh.jsx)(kXe,{ref:k,required:!!h?.required,customValidity:ao(h,i),type:"datetime-local",label:(0,jV.__)("Date time"),hideLabelFromVision:!0,value:hK(b),onChange:I,disabled:m,min:x?hK(x):void 0,max:w?hK(w):void 0}),!a&&(0,Eh.jsx)(SXe,{style:{width:"100%"},selected:b&&w1(b)||void 0,onSelect:R,month:v,onMonthChange:y,timeZone:O||void 0,weekStartsOn:P,disabled:m||T})]})})}function ATe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,operator:i,validity:s,config:a}){return i===Xi||i===Is?(0,Eh.jsx)(zV,{className:"dataviews-controls__datetime",data:e,field:t,onChange:o,hideLabelFromVision:r,operator:i}):(0,Eh.jsx)(_Xe,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:s,config:a})}var xi=c(U(),1),LTe=c(Qr(),1),ro=c(F(),1),vn=c(G(),1),_i=c(Tu(),1);var Io=c(E(),1),{DateCalendar:xXe,DateRangeCalendar:wXe}=so(xi.privateApis),CXe=[{id:"today",label:(0,vn.__)("Today"),getValue:()=>(0,_i.getDate)(null)},{id:"yesterday",label:(0,vn.__)("Yesterday"),getValue:()=>{let e=(0,_i.getDate)(null);return Ty(e,1)}},{id:"past-week",label:(0,vn.__)("Past week"),getValue:()=>{let e=(0,_i.getDate)(null);return Ty(e,7)}},{id:"past-month",label:(0,vn.__)("Past month"),getValue:()=>{let e=(0,_i.getDate)(null);return NV(e,1)}}],EXe=[{id:"last-7-days",label:(0,vn.__)("Last 7 days"),getValue:()=>{let e=(0,_i.getDate)(null);return[Ty(e,7),e]}},{id:"last-30-days",label:(0,vn.__)("Last 30 days"),getValue:()=>{let e=(0,_i.getDate)(null);return[Ty(e,30),e]}},{id:"month-to-date",label:(0,vn.__)("Month to date"),getValue:()=>{let e=(0,_i.getDate)(null);return[tTe(e),e]}},{id:"last-year",label:(0,vn.__)("Last year"),getValue:()=>{let e=(0,_i.getDate)(null);return[DV(e,1),e]}},{id:"year-to-date",label:(0,vn.__)("Year to date"),getValue:()=>{let e=(0,_i.getDate)(null);return[AV(e),e]}}],Th=e=>{if(!e)return null;let t=(0,_i.getDate)(e);return t&&Of(t)?t:null},gK=e=>e?typeof e=="string"?e:dK(e,"yyyy-MM-dd"):"";function MTe({field:e,validity:t,inputRefs:o,isTouched:r,setIsTouched:n,children:i}){let{isValid:s}=e,[a,l]=(0,ro.useState)(void 0),u=(0,ro.useCallback)(()=>{let f=Array.isArray(o)?o:[o];for(let p of f){let h=p.current;if(h&&!h.validity.valid){l({type:"invalid",message:h.validationMessage});return}}l(void 0)},[o]);return(0,ro.useEffect)(()=>{let f=Array.isArray(o)?o:[o],p=t?ao(s,t):void 0;for(let h of f){let m=h.current;m&&m.setCustomValidity(p?.type==="invalid"&&p.message?p.message:"")}},[o,s,t]),(0,ro.useEffect)(()=>{let f=Array.isArray(o)?o:[o],p=h=>{h.preventDefault(),n(!0)};for(let h of f)h.current?.addEventListener("invalid",p);return()=>{for(let h of f)h.current?.removeEventListener("invalid",p)}},[o,n]),(0,ro.useEffect)(()=>{if(!r)return;let f=t?ao(s,t):void 0;f?l(f):u()},[r,s,t,u]),(0,ro.useEffect)(()=>{r&&a?.message&&(0,LTe.speak)(a.message)},[r,a?.message]),(0,Io.jsxs)("div",{onBlur:f=>{r||(!f.relatedTarget||!f.currentTarget.contains(f.relatedTarget))&&n(!0)},children:[i,a&&(0,Io.jsxs)("p",{className:K("components-validated-control__indicator",a.type==="invalid"?"is-invalid":void 0),children:[(0,Io.jsx)(xi.Icon,{className:"components-validated-control__indicator-icon",icon:sg,size:16,fill:"currentColor"}),a.message]})]})}function TXe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{id:s,label:a,description:l,setValue:u,getValue:d,isValid:f,format:p}=t,h=t.isDisabled({item:e,field:t}),[m,g]=(0,ro.useState)(null),b=p.weekStartsOn??(0,_i.getSettings)().l10n.startOfWeek,v=d({item:e}),y=typeof v=="string"?v:void 0,[k,S]=(0,ro.useState)(()=>Th(y)||new Date),[_,x]=(0,ro.useState)(!1),w=(0,ro.useRef)(null),{minConstraint:T,maxConstraint:B,disabledMatchers:R}=x1(f,Th),I=(0,ro.useCallback)(V=>o(u({item:e,value:V})),[e,o,u]),A=(0,ro.useCallback)(V=>{let M=V?dK(V,"yyyy-MM-dd"):void 0;I(M),g(null),x(!0)},[I]),P=(0,ro.useCallback)(V=>{let M=V.getValue(),D=gK(M);S(M),I(D),g(V.id),x(!0)},[I]),O=(0,ro.useCallback)(V=>{if(I(V),V){let M=Th(V);M&&S(M)}g(null),x(!0)},[I]),{timezone:{string:N}}=(0,_i.getSettings)(),z=a;return f?.required&&!n?z=`${a} (${(0,vn.__)("Required")})`:!f?.required&&n&&(z=`${a} (${(0,vn.__)("Optional")})`),(0,Io.jsx)(MTe,{field:t,validity:i,inputRefs:w,isTouched:_,setIsTouched:x,children:(0,Io.jsx)(xi.BaseControl,{id:s,className:"dataviews-controls__date",label:z,help:l,hideLabelFromVision:r,children:(0,Io.jsxs)(Qe,{direction:"column",gap:"lg",children:[(0,Io.jsxs)(Qe,{direction:"row",gap:"sm",wrap:"wrap",justify:"flex-start",children:[CXe.map(V=>{let M=m===V.id;return(0,Io.jsx)(xi.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:M,size:"small",disabled:h,accessibleWhenDisabled:!0,onClick:()=>P(V),children:V.label},V.id)}),(0,Io.jsx)(xi.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:!m,size:"small",disabled:!!m||h,accessibleWhenDisabled:!0,children:(0,vn.__)("Custom")})]}),(0,Io.jsx)(xi.__experimentalInputControl,{ref:w,type:"date",label:(0,vn.__)("Date"),hideLabelFromVision:!0,value:y,onChange:O,required:!!t.isValid?.required,disabled:h,min:T,max:B}),(0,Io.jsx)(xXe,{style:{width:"100%"},selected:y&&Th(y)||void 0,onSelect:A,month:k,onMonthChange:S,timeZone:N||void 0,weekStartsOn:b,disabled:h||R,disableNavigation:h})]})})})}function RXe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{id:s,label:a,description:l,getValue:u,setValue:d,isValid:f,format:p}=t,h=t.isDisabled({item:e,field:t}),m,g=u({item:e});Array.isArray(g)&&g.length===2&&g.every(L=>typeof L=="string")&&(m=g);let b=p.weekStartsOn??(0,_i.getSettings)().l10n.startOfWeek,{minConstraint:v,maxConstraint:y,disabledMatchers:k}=x1(f,Th),S=(0,ro.useCallback)(L=>{o(d({item:e,value:L}))},[e,o,d]),[_,x]=(0,ro.useState)(null),w=(0,ro.useMemo)(()=>{if(!m)return{from:void 0,to:void 0};let[L,j]=m;return{from:Th(L)||void 0,to:Th(j)||void 0}},[m]),[T,B]=(0,ro.useState)(()=>w.from||new Date),[R,I]=(0,ro.useState)(!1),A=(0,ro.useRef)(null),P=(0,ro.useRef)(null),O=(0,ro.useCallback)((L,j)=>{L&&j?S([gK(L),gK(j)]):!L&&!j&&S(void 0)},[S]),N=(0,ro.useCallback)(L=>{O(L?.from,L?.to),x(null),I(!0)},[O]),z=(0,ro.useCallback)(L=>{let[j,q]=L.getValue();B(j),O(j,q),x(L.id),I(!0)},[O]),V=(0,ro.useCallback)((L,j)=>{let[q,J]=m||[void 0,void 0];if(O(L==="from"?j:q,L==="to"?j:J),j){let $=Th(j);$&&B($)}x(null),I(!0)},[m,O]),{timezone:M}=(0,_i.getSettings)(),D=a;return t.isValid?.required&&!n?D=`${a} (${(0,vn.__)("Required")})`:!t.isValid?.required&&n&&(D=`${a} (${(0,vn.__)("Optional")})`),(0,Io.jsx)(MTe,{field:t,validity:i,inputRefs:[A,P],isTouched:R,setIsTouched:I,children:(0,Io.jsx)(xi.BaseControl,{id:s,className:"dataviews-controls__date",label:D,help:l,hideLabelFromVision:r,children:(0,Io.jsxs)(Qe,{direction:"column",gap:"lg",children:[(0,Io.jsxs)(Qe,{direction:"row",gap:"sm",wrap:"wrap",justify:"flex-start",children:[EXe.map(L=>{let j=_===L.id;return(0,Io.jsx)(xi.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:j,size:"small",disabled:h,accessibleWhenDisabled:!0,onClick:()=>z(L),children:L.label},L.id)}),(0,Io.jsx)(xi.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:!_,size:"small",accessibleWhenDisabled:!0,disabled:!!_||h,children:(0,vn.__)("Custom")})]}),(0,Io.jsxs)(Qe,{direction:"row",gap:"sm",justify:"space-between",className:"dataviews-controls__date-range-inputs",children:[(0,Io.jsx)(xi.__experimentalInputControl,{ref:A,type:"date",label:(0,vn.__)("From"),hideLabelFromVision:!0,value:m?.[0],onChange:L=>V("from",L),required:!!t.isValid?.required,disabled:h,min:v,max:y}),(0,Io.jsx)(xi.__experimentalInputControl,{ref:P,type:"date",label:(0,vn.__)("To"),hideLabelFromVision:!0,value:m?.[1],onChange:L=>V("to",L),required:!!t.isValid?.required,disabled:h,min:v,max:y})]}),(0,Io.jsx)(wXe,{style:{width:"100%"},selected:w,onSelect:N,month:T,onMonthChange:B,timeZone:M.string||void 0,weekStartsOn:b,disabled:h||k})]})})})}function NTe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,operator:i,validity:s}){return i===Xi||i===Is?(0,Io.jsx)(zV,{className:"dataviews-controls__date",data:e,field:t,onChange:o,hideLabelFromVision:r,operator:i}):i===Zi?(0,Io.jsx)(RXe,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:s}):(0,Io.jsx)(TXe,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:s})}var UV=c(U(),1),DTe=c(F(),1);var bK=c(E(),1),{ValidatedSelectControl:BXe}=so(UV.privateApis);function GV({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{type:s,label:a,description:l,getValue:u,setValue:d,isValid:f}=t,p=t.isDisabled({item:e,field:t}),h=s==="array",m=u({item:e})??(h?[]:""),g=(0,DTe.useCallback)(y=>o(d({item:e,value:y})),[e,o,d]),{elements:b,isLoading:v}=Os({elements:t.elements,getElements:t.getElements});return v?(0,bK.jsx)(UV.Spinner,{}):(0,bK.jsx)(BXe,{required:!!t.isValid?.required,markWhenOptional:n,customValidity:ao(f,i),label:a,value:m,help:l,options:b,onChange:g,hideLabelFromVision:r,multiple:h,disabled:p})}var yK=c(E(),1),PXe=10;function VTe(e){let{field:t}=e,{elements:o}=Os({elements:t.elements,getElements:t.getElements});return o.length>=PXe?(0,yK.jsx)(FV,{...e}):(0,yK.jsx)(GV,{...e})}var $V=c(U(),1);var FTe=c(U(),1),zTe=c(F(),1);var jTe=c(E(),1),{ValidatedInputControl:IXe}=so(FTe.privateApis);function $u({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,type:i,prefix:s,suffix:a,validity:l}){let{label:u,placeholder:d,description:f,getValue:p,setValue:h,isValid:m}=t,g=p({item:e}),b=t.isDisabled({item:e,field:t}),v=(0,zTe.useCallback)(y=>o(h({item:e,value:y})),[e,h,o]);return(0,jTe.jsx)(IXe,{required:!!m.required,markWhenOptional:n,customValidity:ao(m,l),label:u,placeholder:d,value:g??"",help:f,onChange:v,hideLabelFromVision:r,type:i,prefix:s,suffix:a,disabled:b,pattern:m.pattern?m.pattern.constraint:void 0,minLength:m.minLength?m.minLength.constraint:void 0,maxLength:m.maxLength?m.maxLength.constraint:void 0})}var WV=c(E(),1);function HTe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){return(0,WV.jsx)($u,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i,type:"email",prefix:(0,WV.jsx)($V.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,WV.jsx)($V.Icon,{icon:k3})})})}var YV=c(U(),1);var KV=c(E(),1);function UTe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){return(0,KV.jsx)($u,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i,type:"tel",prefix:(0,KV.jsx)(YV.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,KV.jsx)(YV.Icon,{icon:tw})})})}var ZV=c(U(),1);var qV=c(E(),1);function GTe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){return(0,qV.jsx)($u,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i,type:"url",prefix:(0,qV.jsx)(ZV.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,qV.jsx)(ZV.Icon,{icon:ss})})})}var Lf=c(U(),1),C1=c(F(),1),XV=c(G(),1);var Rh=c(E(),1),{ValidatedNumberControl:OXe}=so(Lf.privateApis);function WTe(e){if(e===""||e===void 0)return"";let t=Number(e);return Number.isFinite(t)?t:""}function AXe({value:e,onChange:t,hideLabelFromVision:o,step:r}){let[n="",i=""]=e,s=(0,C1.useCallback)(l=>t([WTe(l),i]),[t,i]),a=(0,C1.useCallback)(l=>t([n,WTe(l)]),[t,n]);return(0,Rh.jsx)(Lf.BaseControl,{help:(0,XV.__)("The max. value must be greater than the min. value."),children:(0,Rh.jsxs)(Lf.Flex,{direction:"row",gap:4,children:[(0,Rh.jsx)(Lf.__experimentalNumberControl,{label:(0,XV.__)("Min."),value:n,max:i?Number(i)-r:void 0,onChange:s,hideLabelFromVision:o,step:r}),(0,Rh.jsx)(Lf.__experimentalNumberControl,{label:(0,XV.__)("Max."),value:i,min:n?Number(n)+r:void 0,onChange:a,hideLabelFromVision:o,step:r})]})})}function QV({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,operator:i,validity:s}){let a=t.format?.decimals??0,l=Math.pow(10,Math.abs(a)*-1),{label:u,description:d,getValue:f,setValue:p,isValid:h}=t,m=f({item:e})??"",g=t.isDisabled({item:e,field:t}),b=(0,C1.useCallback)(y=>{o(p({item:e,value:["",void 0].includes(y)?void 0:Number(y)}))},[e,o,p]),v=(0,C1.useCallback)(y=>{o(p({item:e,value:y}))},[e,o,p]);if(i===Zi){let y=["",""];return Array.isArray(m)&&m.length===2&&m.every(k=>typeof k=="number"||k==="")&&(y=m),(0,Rh.jsx)(AXe,{value:y,onChange:v,hideLabelFromVision:r,step:l})}return(0,Rh.jsx)(OXe,{required:!!h.required,markWhenOptional:n,customValidity:ao(h,s),label:u,help:d,value:m,onChange:b,hideLabelFromVision:r,step:l,min:h.min?h.min.constraint:void 0,max:h.max?h.max.constraint:void 0,disabled:g})}var $Te=c(E(),1);function KTe(e){return(0,$Te.jsx)(QV,{...e})}var YTe=c(E(),1);function qTe(e){return(0,YTe.jsx)(QV,{...e})}var JV=c(U(),1),ZTe=c(F(),1);var vK=c(E(),1),{ValidatedRadioControl:LXe}=so(JV.privateApis);function XTe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{label:s,description:a,getValue:l,setValue:u,isValid:d}=t,f=t.isDisabled({item:e,field:t}),{elements:p,isLoading:h}=Os({elements:t.elements,getElements:t.getElements}),m=l({item:e}),g=(0,ZTe.useCallback)(b=>o(u({item:e,value:b})),[e,o,u]);return h?(0,vK.jsx)(JV.Spinner,{}):(0,vK.jsx)(LXe,{required:!!t.isValid?.required,markWhenOptional:n,customValidity:ao(d,i),label:s,help:a,onChange:g,options:p,selected:m,hideLabelFromVision:r,disabled:f})}var SK=c(F(),1);var QTe=c(E(),1);function JTe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,config:i,validity:s}){let{prefix:a,suffix:l}=i||{};return(0,QTe.jsx)($u,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:s,prefix:a?(0,SK.createElement)(a):void 0,suffix:l?(0,SK.createElement)(l):void 0})}var eRe=c(U(),1),tRe=c(F(),1);var oRe=c(E(),1),{ValidatedToggleControl:MXe}=so(eRe.privateApis);function rRe({field:e,onChange:t,data:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{label:s,description:a,getValue:l,setValue:u,isValid:d}=e,f=e.isDisabled({item:o,field:e}),p=(0,tRe.useCallback)(()=>{t(u({item:o,value:!l({item:o})}))},[t,u,o,l]);return(0,oRe.jsx)(MXe,{required:!!d.required,markWhenOptional:n,customValidity:ao(d,i),hidden:r,label:s,help:a,checked:l({item:o}),onChange:p,disabled:f})}var nRe=c(U(),1),iRe=c(F(),1);var sRe=c(E(),1),{ValidatedTextareaControl:NXe}=so(nRe.privateApis);function aRe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,config:i,validity:s}){let{rows:a=4}=i||{},l=t.isDisabled({item:e,field:t}),{label:u,placeholder:d,description:f,setValue:p,isValid:h}=t,m=t.getValue({item:e}),g=(0,iRe.useCallback)(b=>o(p({item:e,value:b})),[e,o,p]);return(0,sRe.jsx)(NXe,{required:!!h.required,markWhenOptional:n,customValidity:ao(h,s),label:u,placeholder:d,value:m??"",help:f,onChange:g,rows:a,disabled:l,minLength:h.minLength?h.minLength.constraint:void 0,maxLength:h.maxLength?h.maxLength.constraint:void 0,__next40pxDefaultSize:!0,hideLabelFromVision:r})}var pRe=c(F(),1);var cx=c(U(),1),Ph=c(fe(),1),ha=c(F(),1),t5=c(Ko(),1);var DXe=[];function lRe({allowedFormats:e,disableFormats:t}){return t?DXe:e}var e5=c(Ko(),1),cRe=c(E(),1),uRe=c(ce(),1),VXe={};function FXe({onChange:e,onFocus:t,value:o,forwardedRef:r,settings:n,isVisible:i}){let{name:s,edit:a}=n;if(!a)return null;let l=(0,e5.getActiveFormat)(o,s),u=l!==void 0,d=(0,e5.getActiveObject)(o),f=d!==void 0&&d.type===s;return(0,cRe.jsx)(a,{isActive:u,isVisible:i,activeAttributes:u?l.attributes||{}:{},isObjectActive:f,activeObjectAttributes:f?d.attributes||{}:{},value:o,onChange:e,onFocus:t,contentRef:r,context:VXe},s)}function dRe({formatTypes:e,...t}){return e.map(o=>(0,uRe.createElement)(FXe,{settings:o,...t,key:o.name}))}var Bh=c(E(),1),{ValidatedContentEditableControl:zXe,withIgnoreIMEEvents:jXe}=so(cx.privateApis),{useRichText:HXe,KeyboardShortcutContext:UXe,InputEventContext:GXe,shortcutsListener:WXe,inputEventsListener:$Xe}=so(t5.privateApis),KXe=[];function fRe({label:e,value:t,onChange:o,placeholder:r,id:n,clientId:i,className:s,hideLabelFromVision:a,help:l,disabled:u,required:d,markWhenOptional:f,customValidity:p,allowedFormats:h,disableFormats:m,withoutInteractiveFormatting:g,preserveWhiteSpace:b,disableLineBreaks:v,focusOnMount:y,completers:k=KXe}){let[S,_]=(0,ha.useState)({start:void 0,end:void 0}),[x,w]=(0,ha.useState)(!1),T=(0,ha.useRef)(void 0),B=(0,ha.useRef)(new Set),R=(0,ha.useRef)(new Set),I=(0,Ph.__experimentalUseFocusOutside)(()=>w(!1)),A=lRe({allowedFormats:h,disableFormats:m}),{value:P,onChange:O,ref:N,formatTypes:z,getValue:V}=HXe({value:t,onChange:o,selectionStart:S.start,selectionEnd:S.end,onSelectionChange:(W,Y)=>_({start:W,end:Y}),__unstableIsSelected:x,preserveWhiteSpace:!!b,placeholder:r,__unstableDisableFormats:m,allowedFormats:A,withoutInteractiveFormatting:g,__unstableFormatTypeHandlerContext:(0,ha.useMemo)(()=>({richTextIdentifier:n,blockClientId:i}),[n,i])});function M(){T.current?.focus()}let D=(0,ha.useRef)({keyboardShortcuts:R,inputEvents:B}),L=(0,ha.useRef)({formatTypes:z,getValue:V,onChange:O});(0,ha.useInsertionEffect)(()=>{L.current={formatTypes:z,getValue:V,onChange:O}});let j=(0,Ph.useRefEffect)(W=>{if(u)return;let Y=jXe(Z=>{if(Z.key!=="Enter"||Z.defaultPrevented||Z.metaKey||Z.ctrlKey||(Z.preventDefault(),v))return;let{getValue:oe,onChange:ne}=L.current,X=oe();ne((0,t5.insert)(X,` `,X.start??X.text.length,X.end??X.text.length))});return W.addEventListener("keydown",Y),()=>W.removeEventListener("keydown",Y)},[v,u]),q=(0,Ph.useRefEffect)(W=>{if(!x)return;let Y=WXe(D)(W),Z=$Xe(D)(W);function oe(ne){if(ne.inputType!=="insertText"&&ne.type!=="compositionend")return;let{formatTypes:X,getValue:re,onChange:ae}=L.current,ve=re(),xe=X.reduce((ge,{__unstableInputRule:be})=>be?be(ge):ge,ve);xe!==ve&&ae({...xe,activeFormats:ve.activeFormats})}return W.addEventListener("input",oe),W.addEventListener("compositionend",oe),()=>{Y(),Z(),W.removeEventListener("input",oe),W.removeEventListener("compositionend",oe)}},[x]),{ref:J,...te}=(0,cx.__unstableUseAutocompleteProps)({completers:k,record:P,onChange:O,onReplace:()=>{}}),ee=(0,Ph.useRefEffect)(W=>{y&&!u&&W.focus()},[y,u]),$=(0,Ph.useMergeRefs)([N,T,q,j,ee,J]);return(0,Bh.jsx)("div",{...I,onFocus:W=>{w(!0),I.onFocus(W)},children:(0,Bh.jsxs)(cx.SlotFillProvider,{children:[(0,Bh.jsx)(zXe,{label:e,id:n,className:K("dataviews-controls__richtext",s),placeholder:r,hideLabelFromVision:a,help:l,disabled:u,required:d,markWhenOptional:f,customValidity:p,value:P.text,"aria-multiline":!v,...te,ref:$}),x&&!u&&(0,Bh.jsx)(UXe.Provider,{value:R,children:(0,Bh.jsx)(GXe.Provider,{value:B,children:(0,Bh.jsx)(dRe,{value:P,onChange:O,onFocus:M,formatTypes:z,forwardedRef:T,isVisible:!0})})})]})})}var mRe=c(E(),1);function hRe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,config:i,validity:s}){let{className:a,clientId:l,allowedFormats:u,disableFormats:d,withoutInteractiveFormatting:f,preserveWhiteSpace:p,disableLineBreaks:h}=i||{},m=t.isDisabled({item:e,field:t}),{label:g,placeholder:b,description:v,id:y,setValue:k,isValid:S}=t,_=t.getValue({item:e})??"",x=(0,pRe.useCallback)(w=>o(k({item:e,value:w})),[e,o,k]);return(0,mRe.jsx)(fRe,{label:g,value:_,onChange:x,placeholder:b,id:y,hideLabelFromVision:r,help:v,disabled:m,required:!!S.required,markWhenOptional:n,customValidity:ao(S,s),className:a,clientId:l,allowedFormats:u,disableFormats:d,withoutInteractiveFormatting:f,preserveWhiteSpace:p,disableLineBreaks:h})}var ux=c(U(),1),gRe=c(F(),1);var o5=c(E(),1),{ValidatedToggleGroupControl:YXe}=so(ux.privateApis);function bRe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{getValue:s,setValue:a,isValid:l}=t,u=t.isDisabled({item:e,field:t}),d=s({item:e}),f=(0,gRe.useCallback)(g=>o(a({item:e,value:g})),[e,o,a]),{elements:p,isLoading:h}=Os({elements:t.elements,getElements:t.getElements});if(h)return(0,o5.jsx)(ux.Spinner,{});if(p.length===0)return null;let m=p.find(g=>g.value===d);return(0,o5.jsx)(YXe,{required:!!t.isValid?.required,markWhenOptional:n,customValidity:ao(l,i),isBlock:!0,label:t.label,help:m?.description||t.description,onChange:f,value:d,hideLabelFromVision:r,children:p.map(g=>(0,o5.jsx)(ux.__experimentalToggleGroupControlOption,{label:g.label,value:g.value,disabled:u},g.value))})}var r5=c(U(),1),n5=c(F(),1);var E1=c(E(),1),{ValidatedFormTokenField:qXe}=so(r5.privateApis);function yRe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{label:s,placeholder:a,description:l,getValue:u,setValue:d,isValid:f}=t,p=u({item:e}),h=t.isDisabled({item:e,field:t}),{elements:m,isLoading:g}=Os({elements:t.elements,getElements:t.getElements}),b=(0,n5.useMemo)(()=>Array.isArray(p)?p.map(y=>m?.find(S=>S.value===y)||{value:y,label:y}):[],[p,m]),v=(0,n5.useCallback)(y=>{let k=y.map(S=>typeof S=="object"&&"value"in S?S.value:S);o(d({item:e,value:k}))},[o,d,e]);return g?(0,E1.jsx)(r5.Spinner,{}):(0,E1.jsx)(qXe,{required:!!f?.required,markWhenOptional:n,customValidity:ao(f,i),label:r?void 0:s,value:b,onChange:v,placeholder:a,suggestions:m?.map(y=>y.value),disabled:h,__experimentalValidateInput:y=>t.isValid?.elements&&m?m.some(k=>k.value===y||k.label===y):!0,__experimentalExpandOnFocus:m&&m.length>0,help:l??(t.isValid?.elements?"":void 0),displayTransform:y=>typeof y=="object"&&"label"in y?y.label:typeof y=="string"&&m&&m.find(S=>S.value===y)?.label||y,__experimentalRenderItem:({item:y})=>{if(typeof y=="string"&&m){let k=m.find(S=>S.value===y);return(0,E1.jsx)("span",{children:k?.label||y})}return(0,E1.jsx)("span",{children:y})}})}var As=c(U(),1),kK=c(F(),1),vRe=c(G(),1);var Mf=c(E(),1),{ValidatedInputControl:ZXe}=so(As.privateApis),XXe=({color:e,onColorChange:t,disabled:o})=>{let r=e&&Lo(e).isValid()?e:"#ffffff";return(0,Mf.jsx)(As.Dropdown,{className:"dataviews-controls__color-picker-dropdown",popoverProps:{resize:!1},renderToggle:({onToggle:n})=>(0,Mf.jsx)(As.Button,{onClick:n,"aria-label":(0,vRe.__)("Open color picker"),size:"small",disabled:o,accessibleWhenDisabled:!0,icon:()=>(0,Mf.jsx)(As.ColorIndicator,{colorValue:r})}),renderContent:()=>(0,Mf.jsx)(As.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,Mf.jsx)(As.ColorPicker,{color:r,onChange:t,enableAlpha:!0})})})};function SRe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{label:s,placeholder:a,description:l,setValue:u,isValid:d}=t,f=t.isDisabled({item:e,field:t}),p=t.getValue({item:e})||"",h=(0,kK.useCallback)(g=>{o(u({item:e,value:g}))},[e,o,u]),m=(0,kK.useCallback)(g=>{o(u({item:e,value:g||""}))},[e,o,u]);return(0,Mf.jsx)(ZXe,{required:!!t.isValid?.required,markWhenOptional:n,customValidity:ao(d,i),label:s,placeholder:a,value:p,help:l,onChange:m,hideLabelFromVision:r,type:"text",disabled:f,prefix:(0,Mf.jsx)(As.__experimentalInputControlPrefixWrapper,{variant:"control",children:(0,Mf.jsx)(XXe,{color:p,onColorChange:h,disabled:f})})})}var s5=c(U(),1),a5=c(F(),1),_K=c(G(),1);var i5=c(E(),1);function kRe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let[s,a]=(0,a5.useState)(!1),l=t.isDisabled({item:e,field:t}),u=(0,a5.useCallback)(()=>{a(d=>!d)},[]);return(0,i5.jsx)($u,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i,type:s?"text":"password",suffix:(0,i5.jsx)(s5.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,i5.jsx)(s5.Button,{icon:s?Vl:ug,onClick:u,size:"small",label:s?(0,_K.__)("Hide password"):(0,_K.__)("Show password"),disabled:l,accessibleWhenDisabled:!0})})})}function l5(e){return Array.isArray(e.elements)&&e.elements.length>0||typeof e.getElements=="function"}var xRe=c(E(),1),_Re={adaptiveSelect:VTe,array:yRe,checkbox:BTe,color:SRe,combobox:FV,datetime:ATe,date:NTe,email:HTe,telephone:UTe,url:GTe,integer:KTe,number:qTe,password:kRe,radio:XTe,select:GV,text:JTe,toggle:rRe,textarea:aRe,richtext:hRe,toggleGroup:bRe};function QXe(e){return e&&typeof e=="object"&&typeof e.control=="string"}function JXe(e){let{control:t,...o}=e,r=c5(t);return r===null?null:function(i){return(0,xRe.jsx)(r,{...i,config:o})}}function wRe(e,t){return typeof e.Edit=="function"?e.Edit:typeof e.Edit=="string"?c5(e.Edit):QXe(e.Edit)?JXe(e.Edit):l5(e)&&e.type!=="array"?c5("adaptiveSelect"):t===null?null:c5(t)}function c5(e){return Object.keys(_Re).includes(e)?_Re[e]:null}function eQe(e,t,o){if(e.filterBy===!1)return!1;let r=e.filterBy?.operators?.filter(n=>o.includes(n))??t;return r.length===0?!1:{isPrimary:!!e.filterBy?.isPrimary,operators:r}}var CRe=eQe;var tQe=e=>({item:t})=>{let o=e.split("."),r=t;for(let n of o)r.hasOwnProperty(n)?r=r[n]:r=void 0;return r},ERe=tQe;var oQe=e=>({value:t})=>{let o=e.split("."),r={},n=r;for(let i of o.slice(0,-1))n[i]={},n=n[i];return n[o.at(-1)]=t,r},TRe=oQe;var BRe=c(G(),1);function u5({item:e,field:t}){let{elements:o,isLoading:r}=Os({elements:t.elements,getElements:t.getElements}),n=t.getValue({item:e});return r||o.length===0?n:o?.find(i=>i.value===n)?.label||t.getValue({item:e})}var RRe=c(E(),1);function Rr({item:e,field:t}){return t.hasElements?(0,RRe.jsx)(u5,{item:e,field:t}):t.getValueFormatted({item:e,field:t})}var Ku=(e,t,o)=>o==="asc"?e.localeCompare(t):t.localeCompare(e);function Br(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)}function Yu(e,t){if(typeof t.isValid.minLength?.constraint!="number")return!1;let o=t.getValue({item:e});return[void 0,"",null].includes(o)?!0:String(o).length>=t.isValid.minLength.constraint}function qu(e,t){if(typeof t.isValid.maxLength?.constraint!="number")return!1;let o=t.getValue({item:e});return[void 0,"",null].includes(o)?!0:String(o).length<=t.isValid.maxLength.constraint}function Zu(e,t){if(t.isValid.pattern?.constraint===void 0)return!0;try{let o=new RegExp(t.isValid.pattern.constraint),r=t.getValue({item:e});return[void 0,"",null].includes(r)?!0:o.test(String(r))}catch{return!1}}function Oo(e,t){let r=(t.elements??[]).map(i=>i.value);if(r.length===0)return!0;let n=t.getValue({item:e});return[].concat(n).every(i=>r.includes(i))}function rQe({item:e,field:t}){return t.getValue({item:e})}var Ji=rQe;var nQe=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;function iQe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&!nQe.test(o)?(0,BRe.__)("Value must be a valid email address."):null}var PRe={type:"email",render:Rr,Edit:"email",sort:Ku,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[er,tr],validOperators:[hr,gr,Hu,Uu,Gu,er,tr,Si,ki],format:{},getValueFormatted:Ji,validate:{required:Br,pattern:Zu,minLength:Yu,maxLength:qu,elements:Oo,custom:iQe}};var IRe=c(G(),1);var dx=(e,t,o)=>o==="asc"?e-t:t-e;function d5(e,t){if(typeof t.isValid.min?.constraint!="number")return!1;let o=t.getValue({item:e});return[void 0,"",null].includes(o)?!0:Number(o)>=t.isValid.min.constraint}function f5(e,t){if(typeof t.isValid.max?.constraint!="number")return!1;let o=t.getValue({item:e});return[void 0,"",null].includes(o)?!0:Number(o)<=t.isValid.max.constraint}var ORe={separatorThousand:","};function sQe({item:e,field:t}){let o=t.getValue({item:e});if(o==null)return"";if(o=Number(o),!Number.isFinite(o))return String(o);let r;t.type!=="integer"?r=ORe:r=t.format;let{separatorThousand:n}=r,i=Math.trunc(o);return n?String(i).replace(/\B(?=(\d{3})+(?!\d))/g,n):String(i)}function aQe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&!Number.isInteger(o)?(0,IRe.__)("Value must be an integer."):null}var ARe={type:"integer",render:Rr,Edit:"integer",sort:dx,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[hr,gr,hh,gh,bh,yh,Zi],validOperators:[hr,gr,hh,gh,bh,yh,Zi,er,tr,Si,ki],format:ORe,getValueFormatted:sQe,validate:{required:Br,min:d5,max:f5,elements:Oo,custom:aQe}};var LRe=c(G(),1);var MRe={separatorThousand:",",separatorDecimal:".",decimals:2};function lQe({item:e,field:t}){let o=t.getValue({item:e});if(o==null)return"";if(o=Number(o),!Number.isFinite(o))return String(o);let r;t.type!=="number"?r=MRe:r=t.format;let{separatorThousand:n,separatorDecimal:i,decimals:s}=r,a=o.toFixed(s),[l,u]=a.split("."),d=n?l.replace(/\B(?=(\d{3})+(?!\d))/g,n):l;return s===0?d:d+i+u}function cQe(e){return e===""||e===void 0||e===null}function uQe(e,t){let o=t.getValue({item:e});return!cQe(o)&&!Number.isFinite(o)?(0,LRe.__)("Value must be a number."):null}var NRe={type:"number",render:Rr,Edit:"number",sort:dx,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[hr,gr,hh,gh,bh,yh,Zi],validOperators:[hr,gr,hh,gh,bh,yh,Zi,er,tr,Si,ki],format:MRe,getValueFormatted:lQe,validate:{required:Br,min:d5,max:f5,elements:Oo,custom:uQe}};var DRe={type:"text",render:Rr,Edit:"text",sort:Ku,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[er,tr],validOperators:[hr,gr,Hu,Uu,Gu,er,tr,Si,ki],format:{},getValueFormatted:Ji,validate:{required:Br,pattern:Zu,minLength:Yu,maxLength:qu,elements:Oo}};var Ry=c(Tu(),1);var FRe=c(Tu(),1);function VRe(e){if(!e||!Of(new Date(e)))return null;let t=(0,FRe.getDate)(e);return t&&Of(t)?t:null}function zRe(e,t,o){let r=t.isValid[o]?.constraint;if(typeof r!="string")return!1;let n=t.getValue({item:e}),i=Array.isArray(n)?n[o==="min"?0:n.length-1]:n;if(i==null||i==="")return!0;let s=VRe(r),a=VRe(String(i));return!!s&&!!a&&(o==="min"?a.getTime()>=s.getTime():a.getTime()<=s.getTime())}function p5(e,t){return zRe(e,t,"min")}function m5(e,t){return zRe(e,t,"max")}var jRe={datetime:(0,Ry.getSettings)().formats.datetime,weekStartsOn:(0,Ry.getSettings)().l10n.startOfWeek};function dQe({item:e,field:t}){let o=t.getValue({item:e});if(["",void 0,null].includes(o))return"";let r;return t.type!=="datetime"?r=jRe:r=t.format,(0,Ry.dateI18n)(r.datetime,(0,Ry.getDate)(o))}var fQe=(e,t,o)=>{let r=new Date(e).getTime(),n=new Date(t).getTime();return o==="asc"?r-n:n-r},HRe={type:"datetime",render:Rr,Edit:"datetime",sort:fQe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[xh,wh,vh,Sh,kh,_h,Xi,Is],validOperators:[xh,wh,vh,Sh,kh,_h,Xi,Is],format:jRe,getValueFormatted:dQe,validate:{required:Br,elements:Oo,min:p5,max:m5}};var By=c(Tu(),1);var URe={date:(0,By.getSettings)().formats.date,weekStartsOn:(0,By.getSettings)().l10n.startOfWeek};function pQe({item:e,field:t}){let o=t.getValue({item:e});if(["",void 0,null].includes(o))return"";let r;return t.type!=="date"?r=URe:r=t.format,(0,By.dateI18n)(r.date,(0,By.getDate)(o))}var mQe=(e,t,o)=>{let r=new Date(e).getTime(),n=new Date(t).getTime();return o==="asc"?r-n:n-r},GRe={type:"date",render:Rr,Edit:"date",sort:mQe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[xh,wh,vh,Sh,kh,_h,Xi,Is,Zi],validOperators:[xh,wh,vh,Sh,kh,_h,Xi,Is,Zi],format:URe,getValueFormatted:pQe,validate:{required:Br,elements:Oo,min:p5,max:m5}};var h5=c(G(),1);function WRe(e,t){return t.getValue({item:e})===!0}function hQe({item:e,field:t}){let o=t.getValue({item:e});return o===!0?(0,h5.__)("True"):o===!1?(0,h5.__)("False"):""}function gQe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&![!0,!1].includes(o)?(0,h5.__)("Value must be true, false, or undefined"):null}var bQe=(e,t,o)=>{let r=!!e;return r===!!t?0:o==="asc"?r?1:-1:r?-1:1},$Re={type:"boolean",render:Rr,Edit:"checkbox",sort:bQe,validate:{required:WRe,elements:Oo,custom:gQe},enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[hr,gr],validOperators:[hr,gr],format:{},getValueFormatted:hQe};var KRe={type:"media",render:()=>null,Edit:null,sort:()=>0,enableSorting:!1,enableGlobalSearch:!1,defaultOperators:[],validOperators:[],format:{},getValueFormatted:Ji,validate:{}};var xK=c(G(),1);function YRe(e,t){let o=t.getValue({item:e});return Array.isArray(o)&&o.length>0&&o.every(r=>![void 0,"",null].includes(r))}function qRe({item:e,field:t}){let o=t.getValue({item:e});return(Array.isArray(o)?o:[]).join(", ")}function yQe({item:e,field:t}){return qRe({item:e,field:t})}function vQe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&!Array.isArray(o)?(0,xK.__)("Value must be an array."):o.every(r=>typeof r=="string")?null:(0,xK.__)("Every value must be a string.")}var SQe=(e,t,o)=>{let r=Array.isArray(e)?e:[],n=Array.isArray(t)?t:[];if(r.length!==n.length)return o==="asc"?r.length-n.length:n.length-r.length;let i=r.join(","),s=n.join(",");return o==="asc"?i.localeCompare(s):s.localeCompare(i)},ZRe={type:"array",render:yQe,Edit:"array",sort:SQe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[er,tr],validOperators:[er,tr,Si,ki],format:{},getValueFormatted:qRe,validate:{required:YRe,elements:Oo,custom:vQe}};function kQe({item:e,field:t}){return t.getValue({item:e})?"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022":""}var XRe={type:"password",render:Rr,Edit:"password",sort:()=>0,enableSorting:!1,enableGlobalSearch:!1,defaultOperators:[],validOperators:[],format:{},getValueFormatted:kQe,validate:{required:Br,pattern:Zu,minLength:Yu,maxLength:qu,elements:Oo}};var QRe={type:"telephone",render:Rr,Edit:"telephone",sort:Ku,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[er,tr],validOperators:[hr,gr,Hu,Uu,Gu,er,tr,Si,ki],format:{},getValueFormatted:Ji,validate:{required:Br,pattern:Zu,minLength:Yu,maxLength:qu,elements:Oo}};var JRe=c(G(),1);var fx=c(E(),1);function _Qe({item:e,field:t}){if(t.hasElements)return(0,fx.jsx)(u5,{item:e,field:t});let o=Ji({item:e,field:t});return!o||!Lo(o).isValid()?o:(0,fx.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,fx.jsx)("div",{style:{width:"16px",height:"16px",borderRadius:"50%",backgroundColor:o,border:"1px solid #ddd",flexShrink:0}}),(0,fx.jsx)("span",{children:o})]})}function xQe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&!Lo(o).isValid()?(0,JRe.__)("Value must be a valid color."):null}var wQe=(e,t,o)=>{let r=Lo(e),n=Lo(t);if(!r.isValid()&&!n.isValid())return 0;if(!r.isValid())return o==="asc"?1:-1;if(!n.isValid())return o==="asc"?-1:1;let i=r.toHsl(),s=n.toHsl();return i.h!==s.h?o==="asc"?i.h-s.h:s.h-i.h:i.s!==s.s?o==="asc"?i.s-s.s:s.s-i.s:o==="asc"?i.l-s.l:s.l-i.l},eBe={type:"color",render:_Qe,Edit:"color",sort:wQe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[er,tr],validOperators:[hr,gr,er,tr],format:{},getValueFormatted:Ji,validate:{required:Br,elements:Oo,custom:xQe}};var tBe={type:"url",render:Rr,Edit:"url",sort:Ku,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[er,tr],validOperators:[hr,gr,Hu,Uu,Gu,er,tr,Si,ki],format:{},getValueFormatted:Ji,validate:{required:Br,pattern:Zu,minLength:Yu,maxLength:qu,elements:Oo}};var CQe=(e,t,o)=>typeof e=="number"&&typeof t=="number"?dx(e,t,o):Ku(e,t,o),oBe={render:Rr,Edit:null,sort:CQe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[hr,gr],validOperators:CTe(),format:{},getValueFormatted:Ji,validate:{required:Br,elements:Oo}};function EQe(e){return e==="integer"||e==="number"}function TQe(e){return e==="date"||e==="datetime"}function rBe(e,t,o){let r=t.validate[o];if(r&&(typeof e=="number"&&EQe(t.type)||typeof e=="string"&&TQe(t.type)))return{constraint:e,validate:r}}function nBe(e,t){let o=e.isValid,r;o?.required===!0&&t.validate.required!==void 0&&(r={constraint:!0,validate:t.validate.required});let n;(o?.elements===!0||o?.elements===void 0&&(e.elements||e.getElements))&&t.validate.elements!==void 0&&(n={constraint:!0,validate:t.validate.elements});let i=rBe(o?.min,t,"min"),s=rBe(o?.max,t,"max"),a=o?.minLength,l;typeof a=="number"&&t.validate.minLength!==void 0&&(l={constraint:a,validate:t.validate.minLength});let u=o?.maxLength,d;typeof u=="number"&&t.validate.maxLength!==void 0&&(d={constraint:u,validate:t.validate.maxLength});let f=o?.pattern,p;f!==void 0&&t.validate.pattern!==void 0&&(p={constraint:f,validate:t.validate.pattern});let h=o?.custom??t.validate.custom;return{required:r,elements:n,min:i,max:s,minLength:l,maxLength:d,pattern:p,custom:h}}function iBe(e){return e.validOperators.reduce((t,o)=>{let r=wTe(o);return r?.filter&&(t[o]=r.filter),t},{})}function RQe(e,t){return{...t.format,...e.format}}var sBe=RQe;function BQe(e){let t=[PRe,ARe,NRe,DRe,HRe,GRe,$Re,KRe,ZRe,XRe,QRe,eBe,tBe].find(o=>o?.type===e);return t||oBe}function T1(e){return e.map(t=>{let o=BQe(t.type),r=t.getValue||ERe(t.id),n=function(i,s,a){let l=r({item:i}),u=r({item:s});return t.sort?t.sort(l,u,a):o.sort(l,u,a)};return{id:t.id,label:t.label||t.id,header:t.header||t.label||t.id,description:t.description,placeholder:t.placeholder,getValue:r,setValue:t.setValue||TRe(t.id),elements:t.elements,getElements:t.getElements,hasElements:l5(t),isVisible:t.isVisible,isDisabled:typeof t.isDisabled=="function"?t.isDisabled:()=>!!t.isDisabled,enableHiding:t.enableHiding??!0,readOnly:t.readOnly??!1,type:o.type,render:t.render??o.render,Edit:wRe(t,o.Edit),sort:n,enableSorting:t.enableSorting??o.enableSorting,enableGlobalSearch:t.enableGlobalSearch??o.enableGlobalSearch,isValid:nBe(t,o),filterBy:CRe(t,o.defaultOperators,o.validOperators),filter:iBe(o),format:sBe(t,o),getValueFormatted:t.getValueFormatted??o.getValueFormatted}})}var BK=c(F(),1);var aBe=c(F(),1),lBe=c(E(),1),wK=(0,aBe.createContext)({fields:[]});wK.displayName="DataFormContext";function cBe({fields:e,children:t}){return(0,lBe.jsx)(wK.Provider,{value:{fields:e},children:t})}var Bl=wK;var C5=c(F(),1);var b5=c(F(),1),B1=c(U(),1);var R1=c(G(),1),wi={type:"regular",labelPosition:"top"},PQe=e=>typeof e=="string"?[{id:e,visibility:"when-collapsed"}]:e.map(t=>typeof t=="string"?{id:t,visibility:"when-collapsed"}:{id:t.id,visibility:t.visibility});function uBe(e){let t=wi;if(e?.type==="regular")t={type:"regular",labelPosition:e?.labelPosition??"top"};else if(e?.type==="panel"){let o=e.summary??[],r=Array.isArray(o)?o:[o],n=e?.openAs,i;typeof n=="object"&&n.type==="modal"?i={type:"modal",applyLabel:n.applyLabel?.trim()||(0,R1.__)("Apply"),cancelLabel:n.cancelLabel?.trim()||(0,R1.__)("Cancel")}:n==="modal"?i={type:"modal",applyLabel:(0,R1.__)("Apply"),cancelLabel:(0,R1.__)("Cancel")}:i={type:"dropdown"},t={type:"panel",labelPosition:e?.labelPosition??"side",openAs:i,summary:r,editVisibility:e?.editVisibility??"on-hover"}}else if(e?.type==="card")if(e.withHeader===!1)t={type:"card",withHeader:!1,isOpened:!0,summary:[],isCollapsible:!1};else{let o=e.summary??[];t={type:"card",withHeader:!0,isOpened:typeof e.isOpened=="boolean"?e.isOpened:!0,summary:PQe(o),isCollapsible:e.isCollapsible===void 0?!0:e.isCollapsible}}else e?.type==="row"?t={type:"row",alignment:e?.alignment??"center",styles:e?.styles??{}}:e?.type==="details"&&(t={type:"details",summary:e?.summary??""});return t}function dBe(e){let t=uBe(e?.layout),o=(e.fields??[]).map(r=>{if(typeof r=="string")return{id:r,layout:t};let n=r.layout?uBe(r.layout):t;return{id:r.id,layout:n,...!!r.label&&{label:r.label},...!!r.description&&{description:r.description},..."children"in r&&Array.isArray(r.children)&&{children:dBe({fields:r.children,layout:wi}).fields}}});return{layout:t,fields:o}}var g5=dBe;var or=c(E(),1);function IQe({title:e}){return(0,or.jsx)(Qe,{direction:"column",className:"dataforms-layouts-regular__header",gap:"lg",children:(0,or.jsx)(Qe,{direction:"row",align:"center",children:(0,or.jsx)(B1.__experimentalHeading,{level:2,size:13,children:e})})})}function fBe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{fields:s}=(0,b5.useContext)(Bl),a=t.layout,l=(0,b5.useMemo)(()=>({layout:wi,fields:t.children?t.children:[]}),[t]);if(t.children)return(0,or.jsxs)(or.Fragment,{children:[!r&&t.label&&(0,or.jsx)(IQe,{title:t.label}),(0,or.jsx)(Ls,{data:e,form:l,onChange:o,validity:i?.children})]});let u=a.labelPosition,d=s.find(f=>f.id===t.id);return!d||!d.Edit?null:u==="side"?(0,or.jsxs)(Qe,{direction:"row",className:"dataforms-layouts-regular__field",gap:"sm",children:[(0,or.jsx)("div",{className:K("dataforms-layouts-regular__field-label",`dataforms-layouts-regular__field-label--label-position-${u}`),children:(0,or.jsx)(B1.BaseControl.VisualLabel,{children:d.label})}),(0,or.jsx)("div",{className:"dataforms-layouts-regular__field-control",children:d.readOnly===!0?(0,or.jsx)(d.render,{item:e,field:d}):(0,or.jsx)(d.Edit,{data:e,field:d,onChange:o,hideLabelFromVision:!0,markWhenOptional:n,validity:i},d.id)})]}):(0,or.jsx)("div",{className:"dataforms-layouts-regular__field",children:d.readOnly===!0?(0,or.jsx)(or.Fragment,{children:(0,or.jsxs)(or.Fragment,{children:[!r&&u!=="none"&&(0,or.jsx)(B1.BaseControl.VisualLabel,{children:d.label}),(0,or.jsx)(d.render,{item:e,field:d})]})}):(0,or.jsx)(d.Edit,{data:e,field:d,onChange:o,hideLabelFromVision:u==="none"?!0:r,markWhenOptional:n,validity:i})})}var TK=c(bB(),1),Py=c(U(),1),Oc=c(F(),1),k5=c(fe(),1);var y5=c(U(),1),px=c(G(),1);var yBe=c(fe(),1);var CK=c(F(),1);function OQe(e,t){return K("dataforms-layouts-panel__field-label",`dataforms-layouts-panel__field-label--label-position-${e}`,{"has-error":t})}var pBe=OQe;var mBe=c(U(),1);var Ih=c(E(),1);function AQe(e,t,o){return e?(0,Ih.jsxs)(kt.Root,{children:[(0,Ih.jsx)(kt.Trigger,{render:(0,Ih.jsxs)("span",{className:"dataforms-layouts-panel__field-label-error-content",children:[(0,Ih.jsx)(mBe.Icon,{icon:sg,size:16}),(0,Ih.jsxs)(bt,{children:[t,": "]}),o]})}),(0,Ih.jsx)(kt.Popup,{children:t})]}):o}var hBe=AQe;function gBe(e){if(!e)return;let t=Object.keys(e).filter(o=>o!=="children");for(let o of t){let r=e[o];if(r!==void 0&&r.type==="invalid")return r.message?r.message:o==="required"?"A required field is empty":"Unidentified validation error"}if(e.children)for(let o of Object.values(e.children)){let r=gBe(o);if(r)return r}}var bBe=gBe;var es=c(E(),1);function P1({data:e,field:t,fieldLabel:o,summaryFields:r,validity:n,touched:i,disabled:s,isOpen:a,onClick:l}){let{labelPosition:u,editVisibility:d}=t.layout,f=bBe(n),p=i&&!!f,h=pBe(u,p),m=hBe(p,f,o),g=K("dataforms-layouts-panel__field-trigger",`dataforms-layouts-panel__field-trigger--label-${u}`,{"is-disabled":s,"dataforms-layouts-panel__field-trigger--edit-always":d==="always"}),b=(0,yBe.useInstanceId)(P1,"dataforms-layouts-panel__field-control"),v=p?(0,px.sprintf)((0,px._x)("Edit %s (has errors)","field"),o||""):(0,px.sprintf)((0,px._x)("Edit %s","field"),o||""),y=(0,CK.useRef)(null),k=(0,CK.useRef)(null);return(0,es.jsxs)("div",{ref:y,className:g,onClick:s?void 0:x=>{!a&&x.detail<2&&!k.current?.contains(x.target)&&y.current?.ownerDocument.defaultView?.getSelection()?.toString()||l()},onKeyDown:s?void 0:x=>{x.target===x.currentTarget&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),l())},children:[u!=="none"&&(0,es.jsx)("span",{className:h,children:m}),u==="none"&&p&&(0,es.jsxs)(kt.Root,{children:[(0,es.jsx)(kt.Trigger,{render:(0,es.jsx)("span",{className:"dataforms-layouts-panel__field-label-error-content",role:"img","aria-label":f,children:(0,es.jsx)(y5.Icon,{icon:sg,size:16})})}),(0,es.jsx)(kt.Popup,{children:f})]}),(0,es.jsx)("span",{id:`${b}`,className:"dataforms-layouts-panel__field-control",children:r.length>1?(0,es.jsx)("span",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",width:"100%",gap:"2px"},children:r.map(x=>(0,es.jsx)("span",{style:{width:"100%"},children:(0,es.jsx)(x.render,{item:e,field:x})},x.id))}):r.map(x=>(0,es.jsx)(x.render,{item:e,field:x},x.id))}),!s&&(0,es.jsx)(y5.Button,{ref:k,className:"dataforms-layouts-panel__field-trigger-icon",label:v,icon:cg,size:"small","aria-expanded":a,"aria-haspopup":"dialog","aria-describedby":`${b}`})]})}var vBe=c(bB(),1),EK=c(Zh(),1),Xu=c(F(),1),ts=c(G(),1);function SBe(e){return e?Object.values(e).every(t=>Object.entries(t).every(([o,r])=>o==="children"&&r&&typeof r=="object"?SBe(r):r.type!=="invalid"&&r.type!=="validating")):!0}function LQe(e,t){let o=g5(e);if(o.fields.length===0)return[];let r=new Map;t.forEach(s=>{r.set(s.id,s)});function n(s){if("children"in s&&Array.isArray(s.children)){let u=s.children.map(n).filter(f=>f!==null);if(u.length===0)return null;let d=r.get(s.id);if(d){let[f]=T1([d]);return{id:s.id,children:u,field:f}}return{id:s.id,children:u}}let a=r.get(s.id);if(!a)return null;let[l]=T1([a]);return{id:s.id,children:[],field:l}}return o.fields.map(n).filter(s=>s!==null)}function mx(e,t,o){if(e||(e={}),o.length===0)return e;let r={...e},n=r;for(let s=0;s{if(a===r.current[t.id]){if(!Array.isArray(l)){n(u=>mx(u,{elements:{type:"invalid",message:(0,ts.__)("Could not validate elements.")}},[...i,t.id]));return}t.field?.isValid.elements&&!t.field.isValid.elements.validate(s,{...t.field,elements:l})?n(u=>mx(u,{elements:{type:"invalid",message:(0,ts.__)("Value must be one of the elements.")}},[...i,t.id])):n(u=>kBe(u,[...i,t.id],"elements"))}}).catch(l=>{if(a!==r.current[t.id])return;let u;l instanceof Error?u=l.message:u=String(l)||(0,ts.__)("Unknown error when running elements validation asynchronously."),n(d=>mx(d,{elements:{type:"invalid",message:u}},[...i,t.id]))})}function NQe(e,t,o){let{customCounterRef:r,setFormValidity:n,path:i}=o,s=(r.current[t.id]||0)+1;r.current[t.id]=s,e.then(a=>{if(s===r.current[t.id]){if(a===null){n(l=>kBe(l,[...i,t.id],"custom"));return}if(typeof a=="string"){n(l=>mx(l,{custom:{type:"invalid",message:a}},[...i,t.id]));return}n(l=>mx(l,{custom:{type:"invalid",message:(0,ts.__)("Validation could not be processed.")}},[...i,t.id]))}}).catch(a=>{if(s!==r.current[t.id])return;let l;a instanceof Error?l=a.message:l=String(a)||(0,ts.__)("Unknown error when running custom validation asynchronously."),n(u=>mx(u,{custom:{type:"invalid",message:l}},[...i,t.id]))})}function _Be(e,t,o){if(t.field?.isValid.required&&!t.field.isValid.required.validate(e,t.field))return{required:{type:"invalid"}};if(t.field?.isValid.pattern&&!t.field.isValid.pattern.validate(e,t.field))return{pattern:{type:"invalid",message:(0,ts.__)("Value does not match the required pattern.")}};if(t.field?.isValid.min&&!t.field.isValid.min.validate(e,t.field))return{min:{type:"invalid",message:(0,ts.__)("Value is below the minimum.")}};if(t.field?.isValid.max&&!t.field.isValid.max.validate(e,t.field))return{max:{type:"invalid",message:(0,ts.__)("Value is above the maximum.")}};if(t.field?.isValid.minLength&&!t.field.isValid.minLength.validate(e,t.field))return{minLength:{type:"invalid",message:(0,ts.__)("Value is too short.")}};if(t.field?.isValid.maxLength&&!t.field.isValid.maxLength.validate(e,t.field))return{maxLength:{type:"invalid",message:(0,ts.__)("Value is too long.")}};if(t.field?.isValid.elements&&t.field.hasElements&&!t.field.getElements&&Array.isArray(t.field.elements)&&!t.field.isValid.elements.validate(e,t.field))return{elements:{type:"invalid",message:(0,ts.__)("Value must be one of the elements.")}};let r;if(t.field&&t.field.isValid.custom)try{let i=t.field.getValue({item:e});r=t.field.isValid.custom((0,vBe.default)(e,t.field.setValue({item:e,value:i})),t.field)}catch(i){let s;return i instanceof Error?s=i.message:s=String(i)||(0,ts.__)("Unknown error when running custom validation."),{custom:{type:"invalid",message:s}}}if(typeof r=="string")return{custom:{type:"invalid",message:r}};let n={};if(t.field&&t.field.isValid.elements&&t.field.hasElements&&typeof t.field.getElements=="function"&&(MQe(t.field.getElements(),t,o),n.elements={type:"validating",message:(0,ts.__)("Validating\u2026")}),r instanceof Promise&&(NQe(r,t,o),n.custom={type:"validating",message:(0,ts.__)("Validating\u2026")}),Object.keys(n).length>0)return n;if(t.children.length>0){let i={};t.children.forEach(a=>{i[a.id]=_Be(e,a,{...o,path:[...o.path,t.id,"children"]})});let s={};return Object.entries(i).forEach(([a,l])=>{l!==void 0&&(s[a]=l)}),Object.keys(s).length===0?void 0:{children:s}}}function xBe(e,t){let o=e?.field?.getValue({item:t});if(e.children.length===0)return o;let r=e.children.map(n=>xBe(n,t));return r?{value:o,children:r}:o}function DQe(e,t,o){let[r,n]=(0,Xu.useState)(),i=(0,Xu.useRef)({}),s=(0,Xu.useRef)({}),a=(0,Xu.useRef)({}),l=(0,Xu.useCallback)(()=>{let u={customCounterRef:i,elementsCounterRef:s,setFormValidity:n,path:[],item:e},d=LQe(o,t);if(d.length===0){n(void 0);return}let f={},p=[];d.forEach(h=>{let m=xBe(h,e);if(a.current.hasOwnProperty(h.id)&&(0,EK.default)(a.current[h.id],m)){p.push(h.id);return}a.current[h.id]=m;let g=_Be(e,h,u);g!==void 0&&(f[h.id]=g)}),n(h=>{let m={...h,...f},g=[...p,...Object.keys(f)];return Object.keys(m).forEach(v=>{m&&!g.includes(v)&&delete m[v]}),Object.keys(m).length===0&&(m=void 0),(0,EK.default)(h,m)?h:m})},[e,t,o]);return(0,Xu.useEffect)(()=>{l()},[l]),{validity:r,isValid:SBe(r)}}var wBe=DQe;var CBe=c(F(),1);function Oh(e,t){(0,CBe.useEffect)(()=>{t&&e.current&&e.current.querySelectorAll("input, textarea, select").forEach(r=>{r.reportValidity()})},[t,e])}var EBe=c(F(),1);function VQe(e){return Array.isArray(e)?e.map(t=>typeof t=="string"?t:t.id):[]}var v5=(e,t)=>Array.isArray(e)&&e.length>0?VQe(e).map(r=>t.find(n=>n.id===r)).filter(r=>r!==void 0):[];var FQe=(e,t)=>{let o=t.find(r=>r.id===e.id);return o||t.find(r=>{if(e.children){let n=e.children.filter(i=>!i.children);return n.length===0?!1:r.id===n[0].id}return r.id===e.id})};function zQe(e){let{fields:t}=(0,EBe.useContext)(Bl),o=e.layout,r=v5(o.summary,t),n=FQe(e,t),i=e.children?e.label:n?.label;return r.length===0?{summaryFields:n?[n]:[],fieldDefinition:n,fieldLabel:i}:{summaryFields:r,fieldDefinition:n,fieldLabel:i}}var S5=zQe;var os=c(E(),1);function jQe({data:e,field:t,onChange:o,fieldLabel:r,onClose:n,touched:i}){let{openAs:s}=t.layout,{applyLabel:a,cancelLabel:l}=s,{fields:u}=(0,Oc.useContext)(Bl),[d,f]=(0,Oc.useState)({}),p=(0,Oc.useMemo)(()=>(0,TK.default)(e,d,{arrayMerge:(_,x)=>x}),[e,d]),h=(0,Oc.useMemo)(()=>({layout:wi,fields:t.children?t.children:[{id:t.id,layout:wi}]}),[t]),m=u.map(_=>({..._,Edit:_.Edit===null?void 0:_.Edit,isValid:{required:_.isValid.required?.constraint,elements:_.isValid.elements?.constraint,min:_.isValid.min?.constraint,max:_.isValid.max?.constraint,pattern:_.isValid.pattern?.constraint,minLength:_.isValid.minLength?.constraint,maxLength:_.isValid.maxLength?.constraint}})),{validity:g}=wBe(p,m,h),b=()=>{o(d),n()},v=_=>{f(x=>(0,TK.default)(x,_,{arrayMerge:(w,T)=>T}))},y=(0,k5.useFocusOnMount)("firstInputElement"),k=(0,Oc.useRef)(null),S=(0,k5.useMergeRefs)([y,k]);return Oh(k,i),(0,os.jsxs)(Py.Modal,{className:"dataforms-layouts-panel__modal",onRequestClose:n,isFullScreen:!1,title:r,size:"medium",children:[(0,os.jsx)("div",{ref:S,children:(0,os.jsx)(Ls,{data:p,form:h,onChange:v,validity:g,children:(_,x,w,T)=>(0,os.jsx)(_,{data:p,field:x,onChange:v,hideLabelFromVision:h.fields.length<2,markWhenOptional:T,validity:w},x.id)})}),(0,os.jsxs)(Qe,{direction:"row",className:"dataforms-layouts-panel__modal-footer",gap:"md",children:[(0,os.jsx)(Py.__experimentalSpacer,{style:{flex:1}}),(0,os.jsx)(Py.Button,{variant:"tertiary",onClick:n,__next40pxDefaultSize:!0,children:l}),(0,os.jsx)(Py.Button,{variant:"primary",onClick:b,__next40pxDefaultSize:!0,children:a})]})]})}function HQe({data:e,field:t,onChange:o,validity:r}){let[n,i]=(0,Oc.useState)(!1),[s,a]=(0,Oc.useState)(!1),{fieldDefinition:l,fieldLabel:u,summaryFields:d}=S5(t);if(!l)return null;let f=()=>{a(!1),i(!0)};return(0,os.jsxs)(os.Fragment,{children:[(0,os.jsx)(P1,{data:e,field:t,fieldLabel:u,summaryFields:d,validity:r,touched:n,disabled:l.readOnly===!0,onClick:()=>a(!0),isOpen:s}),s&&(0,os.jsx)(jQe,{data:e,field:t,onChange:o,fieldLabel:u??"",onClose:f,touched:n})]})}var TBe=HQe;var Ah=c(U(),1),RBe=c(G(),1),Nf=c(F(),1);var BBe=c(fe(),1);var Ci=c(E(),1);function UQe({title:e,onClose:t}){return(0,Ci.jsx)(Qe,{direction:"column",className:"dataforms-layouts-panel__dropdown-header",gap:"lg",children:(0,Ci.jsxs)(Qe,{direction:"row",gap:"sm",align:"center",children:[e&&(0,Ci.jsx)(Ah.__experimentalHeading,{level:2,size:13,children:e}),(0,Ci.jsx)(Ah.__experimentalSpacer,{style:{flex:1}}),t&&(0,Ci.jsx)(Ah.Button,{label:(0,RBe.__)("Close"),icon:eg,onClick:t,size:"small"})]})})}function GQe({touched:e,children:t}){let o=(0,Nf.useRef)(null);return Oh(o,e),(0,Ci.jsx)("div",{ref:o,children:t})}function WQe({data:e,field:t,onChange:o,validity:r}){let[n,i]=(0,Nf.useState)(!1),[s,a]=(0,Nf.useState)(null),l=(0,Nf.useMemo)(()=>({anchor:s,placement:"left-start",offset:36,shift:!0}),[s]),[u,d]=(0,BBe.__experimentalUseDialog)({focusOnMount:"firstInputElement"}),f=(0,Nf.useMemo)(()=>({layout:wi,fields:t.children?t.children:[{id:t.id,layout:wi}]}),[t]),p=(0,Nf.useMemo)(()=>{if(r!==void 0)return t.children?r?.children:{[t.id]:r}},[r,t]),{fieldDefinition:h,fieldLabel:m,summaryFields:g}=S5(t);return h?(0,Ci.jsx)("div",{ref:a,className:"dataforms-layouts-panel__field-dropdown-anchor",children:(0,Ci.jsx)(Ah.Dropdown,{contentClassName:"dataforms-layouts-panel__field-dropdown",popoverProps:l,focusOnMount:!1,onToggle:b=>{b||i(!0)},renderToggle:({isOpen:b,onToggle:v})=>(0,Ci.jsx)(P1,{data:e,field:t,fieldLabel:m,summaryFields:g,validity:r,touched:n,disabled:h.readOnly===!0,isOpen:b,onClick:v}),renderContent:({onClose:b})=>(0,Ci.jsx)(GQe,{touched:n,children:(0,Ci.jsxs)("div",{ref:u,...d,children:[(0,Ci.jsx)(UQe,{title:m,onClose:b}),(0,Ci.jsx)(Ls,{data:e,form:f,onChange:o,validity:p,children:(v,y,k,S)=>(0,Ci.jsx)(v,{data:e,field:y,onChange:o,hideLabelFromVision:(f?.fields??[]).length<2,markWhenOptional:S,validity:k},y.id)})]})})})}):null}var PBe=WQe;var RK=c(E(),1);function IBe({data:e,field:t,onChange:o,validity:r}){return t.layout.openAs.type==="modal"?(0,RK.jsx)(TBe,{data:e,field:t,onChange:o,validity:r}):(0,RK.jsx)(PBe,{data:e,field:t,onChange:o,validity:r})}var Ms=c(F(),1);var _5=c(G(),1),OBe=c(E(),1);function ABe(e){if(!e)return 0;let t=0,o=Object.keys(e).filter(r=>r!=="children");for(let r of o)e[r]?.type==="invalid"&&t++;if(e.children)for(let r of Object.values(e.children))t+=ABe(r);return t}function x5({validity:e}){let t=ABe(e);return t===0?null:(0,OBe.jsx)(UH,{intent:"high",children:(0,_5.sprintf)((0,_5._n)("%d field needs attention","%d fields need attention",t),t)})}var Pr=c(E(),1);function $Qe(e,t,o){if(!t||Array.isArray(t)&&t.length===0)return!1;let n=(Array.isArray(t)?t:[t]).find(i=>typeof i=="string"?i===e.id:typeof i=="object"&&"id"in i?i.id===e.id:!1);return n?typeof n=="string"?!0:typeof n=="object"&&"visibility"in n?n.visibility==="always"||n.visibility==="when-collapsed"&&!o:!0:!1}function KQe({data:e,fields:t,label:o,layout:r,isOpen:n,touched:i,validity:s}){let l=v5(r.summary,t).filter(f=>$Qe(f,r.summary,n)),u=i&&r.isCollapsible,d=l.length>0&&r.withHeader;return(0,Pr.jsxs)(Qe,{align:"center",justify:"space-between",className:"dataforms-layouts-card__field-header-content",children:[(0,Pr.jsx)(lu.Title,{children:o}),(u||d)&&(0,Pr.jsxs)(rb.HeaderDescription,{className:"dataforms-layouts-card__field-header-content-description",children:[u&&(0,Pr.jsx)(x5,{validity:s}),d&&(0,Pr.jsx)("div",{className:"dataforms-layouts-card__field-summary",children:l.map(f=>(0,Pr.jsx)(f.render,{item:e,field:f},f.id))})]})]})}function YQe({data:e,field:t,form:o,onChange:r,hideLabelFromVision:n,markWhenOptional:i,validity:s,withHeader:a}){if(t.children)return(0,Pr.jsxs)(Pr.Fragment,{children:[t.description&&(0,Pr.jsx)("div",{className:"dataforms-layouts-card__field-description",children:t.description}),(0,Pr.jsx)(Ls,{data:e,form:o,onChange:r,validity:s?.children})]});let l=Iy("regular")?.component;return l?(0,Pr.jsx)(l,{data:e,field:t,onChange:r,hideLabelFromVision:n||a,markWhenOptional:i,validity:s}):null}function LBe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{fields:s}=(0,Ms.useContext)(Bl),a=t.layout,l=(0,Ms.useRef)(null),u=(0,Ms.useMemo)(()=>({layout:wi,fields:t.children??[]}),[t]),{isOpened:d,isCollapsible:f}=a,[p,h]=(0,Ms.useState)(d),[m,g]=(0,Ms.useState)(!1);(0,Ms.useEffect)(()=>{h(d)},[d]);let b=(0,Ms.useCallback)(x=>{x||g(!0),h(x)},[]),v=(0,Ms.useCallback)(()=>{g(!0)},[]);Oh(l,(f?p:!0)&&m);let y=t.label,k;if(t.children)k=!!y&&a.withHeader;else{let x=s.find(w=>w.id===t.id);if(!x||!x.Edit)return null;y=x.label,k=!!y&&a.withHeader}let S=(0,Pr.jsx)(YQe,{data:e,field:t,form:u,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i,withHeader:k}),_=(0,Pr.jsx)(KQe,{data:e,fields:s,label:y,layout:a,isOpen:f?!!p:!0,touched:m,validity:i});return k&&f?(0,Pr.jsxs)(rb.Root,{className:"dataforms-layouts-card__field",open:p,onOpenChange:b,children:[(0,Pr.jsx)(rb.Header,{children:_}),(0,Pr.jsx)(rb.Content,{ref:l,onBlur:v,children:S})]}):(0,Pr.jsxs)(lu.Root,{className:"dataforms-layouts-card__field",children:[k&&(0,Pr.jsx)(lu.Header,{children:_}),(0,Pr.jsx)(lu.Content,{ref:l,onBlur:v,children:S})]})}var MBe=c(U(),1);var Nn=c(E(),1);function qQe({title:e}){return(0,Nn.jsx)(Qe,{direction:"column",className:"dataforms-layouts-row__header",gap:"lg",children:(0,Nn.jsx)(Qe,{direction:"row",align:"center",children:(0,Nn.jsx)(MBe.__experimentalHeading,{level:2,size:13,children:e})})})}var ZQe=({children:e})=>(0,Nn.jsx)(Nn.Fragment,{children:e});function NBe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let s=t.layout;if(t.children){let l={layout:wi,fields:t.children};return(0,Nn.jsxs)("div",{className:"dataforms-layouts-row__field",children:[!r&&t.label&&(0,Nn.jsx)(qQe,{title:t.label}),(0,Nn.jsx)(Qe,{direction:"row",align:s.alignment,gap:"lg",children:(0,Nn.jsx)(Ls,{data:e,form:l,onChange:o,validity:i?.children,as:ZQe,children:(u,d,f)=>(0,Nn.jsx)("div",{className:"dataforms-layouts-row__field-control",style:s.styles[d.id],children:(0,Nn.jsx)(u,{data:e,field:d,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:f})},d.id)})})]})}let a=Iy("regular")?.component;return a?(0,Nn.jsx)(Nn.Fragment,{children:(0,Nn.jsx)("div",{className:"dataforms-layouts-row__field-control",children:(0,Nn.jsx)(a,{data:e,field:t,onChange:o,markWhenOptional:n,validity:i})})}):null}var Ns=c(F(),1),DBe=c(G(),1);var Df=c(E(),1);function VBe({data:e,field:t,onChange:o,validity:r}){let{fields:n}=(0,Ns.useContext)(Bl),i=(0,Ns.useRef)(null),s=(0,Ns.useRef)(null),[a,l]=(0,Ns.useState)(!1),[u,d]=(0,Ns.useState)(!1),f=(0,Ns.useMemo)(()=>({layout:wi,fields:t.children??[]}),[t]);(0,Ns.useEffect)(()=>{let b=i.current;if(!b)return;let v=()=>{let y=b.open;y||l(!0),d(y)};return b.addEventListener("toggle",v),()=>{b.removeEventListener("toggle",v)}},[]),Oh(s,u&&a);let p=(0,Ns.useCallback)(()=>{l(!0)},[]);if(!t.children)return null;let h=t.layout.summary??"",m=h?n.find(b=>b.id===h):void 0,g;return m&&m.render?g=(0,Df.jsx)(m.render,{item:e,field:m}):g=t.label||(0,DBe.__)("More details"),(0,Df.jsxs)("details",{ref:i,className:"dataforms-layouts-details__details",children:[(0,Df.jsx)("summary",{className:"dataforms-layouts-details__summary",children:(0,Df.jsxs)(Qe,{direction:"row",align:"center",gap:"md",className:"dataforms-layouts-details__summary-content",children:[g,a&&(0,Df.jsx)(x5,{validity:r})]})}),(0,Df.jsx)("div",{ref:s,className:"dataforms-layouts-details__content",onBlur:p,children:(0,Df.jsx)(Ls,{data:e,form:f,onChange:o,validity:r?.children})})]})}var Oy=c(E(),1),XQe=[{type:"regular",component:fBe,wrapper:({children:e})=>(0,Oy.jsx)(Qe,{direction:"column",className:"dataforms-layouts__wrapper",gap:"lg",children:e})},{type:"panel",component:IBe,wrapper:({children:e})=>(0,Oy.jsx)(Qe,{direction:"column",className:"dataforms-layouts__wrapper",gap:"md",children:e})},{type:"card",component:LBe,wrapper:({children:e})=>(0,Oy.jsx)(Qe,{direction:"column",className:"dataforms-layouts__wrapper",gap:"xl",children:e})},{type:"row",component:NBe,wrapper:({children:e,layout:t})=>(0,Oy.jsx)(Qe,{direction:"column",className:"dataforms-layouts__wrapper",gap:"lg",children:(0,Oy.jsx)("div",{className:"dataforms-layouts-row__field",children:(0,Oy.jsx)(Qe,{direction:"row",gap:"lg",align:t.alignment,children:e})})})},{type:"details",component:VBe}];function Iy(e){return XQe.find(t=>t.type===e)}var w5=c(E(),1),QQe=({children:e})=>(0,w5.jsx)(Qe,{direction:"column",className:"dataforms-layouts__wrapper",gap:"lg",children:e});function Ls({data:e,form:t,onChange:o,validity:r,children:n,as:i}){let{fields:s}=(0,C5.useContext)(Bl),a=(0,C5.useMemo)(()=>{let d=s.filter(p=>!!p.isValid?.required).length,f=s.length-d;return d>f},[s]);function l(d){return s.find(f=>f.id===d.id)}let u=i??Iy(t.layout.type)?.wrapper??QQe;return(0,w5.jsx)(u,{layout:t.layout,children:t.fields.map(d=>{let f=Iy(d.layout.type)?.component;if(!f)return null;let p=d.children?void 0:l(d);return p&&p.isVisible&&!p.isVisible(e)?null:n?n(f,d,r?.[d.id],a):(0,w5.jsx)(f,{data:e,field:d,onChange:o,markWhenOptional:a,validity:r?.[d.id]},d.id)})})}var PK=c(E(),1);function I1({data:e,form:t,fields:o,onChange:r,validity:n}){let i=(0,BK.useMemo)(()=>g5(t),[t]),s=(0,BK.useMemo)(()=>T1(o),[o]);return t.fields?(0,PK.jsx)(cBe,{fields:s,children:(0,PK.jsx)(Ls,{data:e,form:i,onChange:r,validity:n})}):null}var Mh=c(F(),1),ePe=c(G(),1);var gx=c(U(),1);var IK=c(G(),1);var FBe=c(fe(),1);function hx({isControl:e}={isControl:!1}){return(0,FBe.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:e?35:259}}}var E5=c(E(),1);function zBe({fields:e,visibleFields:t,onToggleField:o}){let{popoverProps:r}=hx();return!e||e.length===0?null:(0,E5.jsx)(gx.DropdownMenu,{icon:zs,label:(0,IK.__)("Options"),popoverProps:r,toggleProps:{size:"small"},children:({onClose:n})=>(0,E5.jsx)(gx.MenuGroup,{label:(0,IK.__)("Show / Hide"),children:e.map(i=>{let s=t.includes(i.id);return(0,E5.jsx)(gx.MenuItem,{isSelected:s,onClick:()=>{o(i.id),n()},role:"menuitemcheckbox",icon:s?ns:null,children:i.label},i.id)})})})}var T5=c(U(),1),jBe=c(fe(),1),HBe=c(Q(),1),Vf=c(F(),1),UBe=c(Ko(),1);var Ac=c(E(),1),{useRichText:JQe,KeyboardShortcutContext:eJe,InputEventContext:tJe}=H(UBe.privateApis);function GBe({data:e,field:t,hideLabelFromVision:o,onChange:r,config:n={}}){let i=(0,HBe.useRegistry)(),s=t.getValue({item:e}),a=t.config||{},{clientId:l}=n,[u,d]=(0,Vf.useState)({start:void 0,end:void 0}),[f,p]=(0,Vf.useState)(!1),h=(0,Vf.useRef)(),m=(0,Vf.useRef)(new Set),g=(0,Vf.useRef)(new Set),b=k_({allowedFormats:a?.allowedFormats,disableFormats:a?.disableFormats});function v(){h.current?.focus()}let{value:y,getValue:k,onChange:S,ref:_,formatTypes:x}=JQe({value:s,onChange(B){r(t.setValue({item:e,value:B}))},selectionStart:u.start,selectionEnd:u.end,onSelectionChange:(B,R)=>d({start:B,end:R}),__unstableIsSelected:f,preserveWhiteSpace:!!a?.preserveWhiteSpace,placeholder:a?.placeholder,__unstableDisableFormats:a?.disableFormats,allowedFormats:b,withoutInteractiveFormatting:a?.withoutInteractiveFormatting,__unstableFormatTypeHandlerContext:(0,Vf.useMemo)(()=>({richTextIdentifier:t.id,blockClientId:l}),[t.id,l])}),{baseControlProps:w,controlProps:T}=(0,T5.useBaseControlProps)({hideLabelFromVision:o??t.hideLabelFromVision,label:t.label});return(0,Ac.jsxs)(Ac.Fragment,{children:[f&&(0,Ac.jsx)(eJe.Provider,{value:g,children:(0,Ac.jsx)(tJe.Provider,{value:m,children:(0,Ac.jsx)("div",{children:(0,Ac.jsx)(GN,{value:y,onChange:S,onFocus:v,formatTypes:x,forwardedRef:h,isVisible:!1})})})}),(0,Ac.jsx)(T5.BaseControl,{...w,children:(0,Ac.jsx)("div",{className:"block-editor-content-only-controls__rich-text",role:"textbox","aria-multiline":!a?.disableLineBreaks,ref:(0,jBe.useMergeRefs)([_,jN({registry:i,getValue:k,onChange:S,formatTypes:x,selectionChange:d,isSelected:f,disableFormats:a?.disableFormats,value:y,tagName:"div",disableLineBreaks:a?.disableLineBreaks,keyboardShortcuts:g,inputEvents:m}),h]),onFocus:()=>p(!0),onBlur:()=>p(!1),contentEditable:!0,...T})})]})}var Lh=c(U(),1),WBe=c(Q(),1),$Be=c(Tt(),1),KBe=c(F(),1),Ay=c(G(),1);var br=c(E(),1),oJe=e=>{window.requestAnimationFrame(()=>{let[t]=$Be.focus.tabbable.find(e?.current);t&&t.focus()})};function rJe({data:e,field:t,attachment:o,config:r}){let{allowedTypes:n=[],multiple:i=!1}=r||{};if(i)return"todo multiple";if(o?.media_type==="image"||o?.poster)return(0,br.jsx)("div",{className:"block-editor-content-only-controls__media-thumbnail",children:(0,br.jsx)("img",{alt:"",width:20,height:20,src:o.media_type==="image"?o.source_url:o.poster})});if(n.length===1){let a=t.getValue({item:e})?.url;if(n[0]==="image"&&a)return(0,br.jsx)("div",{className:"block-editor-content-only-controls__media-thumbnail",children:(0,br.jsx)("img",{alt:"",width:20,height:20,src:a})});let l;if(n[0]==="image"?l=$x:n[0]==="video"?l=D6:n[0]==="audio"?l=$F:l=Qy,l)return(0,br.jsx)(Lh.Icon,{icon:l,size:20})}return(0,br.jsx)(Lh.Icon,{icon:Qy,size:20})}function YBe({data:e,field:t,onChange:o,config:r={}}){let{popoverProps:n}=hx({isControl:!0}),i=t.getValue({item:e}),{allowedTypes:s=[],multiple:a=!1,useFeaturedImage:l=!1}=r,u=i?.id,d=i?.url,f=(0,WBe.useSelect)(m=>{if(!u)return;let b=m(C).getSettings()[pT];if(b)return b(m,u)},[u]),p;if(s.length===1){let m=s[0];m==="image"?p=(0,Ay.__)("Image"):m==="video"?p=(0,Ay.__)("Video"):m==="application"?p=(0,Ay.__)("File"):p=(0,Ay.__)("Media")}else p=(0,Ay.__)("Media");let h=(0,KBe.useRef)();return(0,br.jsx)(Xs,{children:(0,br.jsxs)("div",{ref:h,className:"block-editor-content-only-controls",children:[(0,br.jsx)(b_,{className:"block-editor-content-only-controls__media-replace-flow",allowedTypes:s,mediaId:u,mediaURL:d,multiple:a,popoverProps:n,onReset:()=>{o(t.setValue({item:e,value:{}}))},...l&&{useFeaturedImage:!!i?.featuredImage,onToggleFeaturedImage:()=>{o(t.setValue({item:e,value:{featuredImage:!i?.featuredImage}}))}},onSelect:m=>{if(m.id&&m.url){let g={...m,mediaType:m.media_type};l&&(g.featuredImage=!1),o(t.setValue({item:e,value:g}))}},renderToggle:m=>(0,br.jsx)(Lh.Button,{__next40pxDefaultSize:!0,className:"block-editor-content-only-controls__media",...m,children:(0,br.jsxs)(Lh.__experimentalGrid,{rowGap:0,columnGap:8,templateColumns:"20px 1fr",className:"block-editor-content-only-controls__media-row",children:[d&&(0,br.jsxs)(br.Fragment,{children:[(0,br.jsx)(rJe,{attachment:f,field:t,data:e,config:r}),(0,br.jsx)("span",{className:"block-editor-content-only-controls__media-title",children:f?.title?.raw&&f?.title?.raw!==""?f?.title?.raw:d})]}),!d&&(0,br.jsxs)(br.Fragment,{children:[(0,br.jsx)("span",{className:"block-editor-content-only-controls__media-placeholder",style:{width:"20px",height:"20px"}}),(0,br.jsx)("span",{className:"block-editor-content-only-controls__media-title",children:p})]})]})})}),d&&(0,br.jsx)(Lh.Button,{label:(0,Ay.__)("Reset"),className:"block-editor-content-only-controls__media-reset",size:"small",icon:dn,onClick:()=>{o(t.setValue({item:e,value:{}})),oJe(h)}})]})})}var Ff=c(U(),1),B5=c(F(),1),qBe=c(G(),1);var ZBe=c(Fs(),1);var ti=c(E(),1),OK="noopener",XBe="_blank",R5="nofollow";function nJe({rel:e="",url:t="",opensInNewTab:o,nofollow:r}){let n,i=e;if(o)n=XBe,i=i?.includes(OK)?i:i+` ${OK}`;else{let s=new RegExp(`\\b${OK}\\s*`,"g");i=i?.replace(s,"").trim()}if(r)i=i?.includes(R5)?i:(i+` ${R5}`).trim();else{let s=new RegExp(`\\b${R5}\\s*`,"g");i=i?.replace(s,"").trim()}return{url:(0,ZBe.prependHTTP)(t),linkTarget:n,rel:i||void 0}}function QBe({data:e,field:t,onChange:o}){let[r,n]=(0,B5.useState)(!1),{popoverProps:i}=hx({isControl:!0}),s=t.getValue({item:e}),a=s?.url,l=s?.rel||"",d=s?.linkTarget===XBe,f=l===R5,p=(0,B5.useMemo)(()=>({url:a,opensInNewTab:d,nofollow:f}),[a,d,f]);return(0,ti.jsxs)(ti.Fragment,{children:[(0,ti.jsx)(Ff.Button,{__next40pxDefaultSize:!0,className:"block-editor-content-only-controls__link",onClick:()=>{n(!0)},children:(0,ti.jsxs)(Ff.__experimentalGrid,{rowGap:0,columnGap:8,templateColumns:"24px 1fr",className:"block-editor-content-only-controls__link-row",children:[a&&(0,ti.jsxs)(ti.Fragment,{children:[(0,ti.jsx)(Ff.Icon,{icon:ss,size:24}),(0,ti.jsx)("span",{className:"block-editor-content-only-controls__link-title",children:a})]}),!a&&(0,ti.jsxs)(ti.Fragment,{children:[(0,ti.jsx)(Ff.Icon,{icon:ss,size:24,style:{opacity:.3}}),(0,ti.jsx)("span",{className:"block-editor-content-only-controls__link-title",children:(0,qBe.__)("Link")})]})]})}),r&&(0,ti.jsx)(Ff.Popover,{onClose:()=>{n(!1)},...i??{},children:(0,ti.jsx)(eh,{value:p,onChange:h=>{let m=nJe({rel:l,...h});o(t.setValue({item:e,value:m}))},onRemove:()=>{o(t.setValue({item:e,value:{}}))}})})]})}var oi=c(E(),1),{fieldsKey:tPe,formKey:AK}=H(bx.privateApis);function LK(e,t={}){return function(r){return(0,oi.jsx)(e,{...r,config:t})}}function iJe({clientId:e,blockType:t,setAttributes:o,isMultiBlock:r=!1}){let n=jn({clientId:e,context:"list-view"}),i=Do(e),s=t?.[tPe],a=(0,Mh.useContext)(_n),l=(0,I5.useSelect)(v=>{let y=v(C).getBlockAttributes(e);if(!y?.metadata?.bindings)return y;let{__experimentalBlockBindingsSupportedAttributes:k}=v(C).getSettings(),S=k?.[t?.name],_=S?aT(y.metadata.bindings,S):y.metadata.bindings,{getBlockBindingsSource:x}=H(v(bx.store));return Object.entries(_).reduce((w,[T,B])=>{if(T==="__default")return w;let R=x(B.source);if(!R)return w;let I=R.getValues({select:v,clientId:e,context:a,bindings:{[T]:B}});return{...w,...I}},y)},[a,e,t?.name]),{selectBlock:u,toggleBlockHighlight:d}=(0,I5.useDispatch)(C),f=(0,JBe.useDebounce)(d,50),p=(0,Mh.useMemo)(()=>r?{...t?.[AK],fields:[t?.[AK]?.fields?.[0]]}:t?.[AK],[t,r]),[h,m]=(0,Mh.useState)(p),g=(0,Mh.useMemo)(()=>s?.length?s.map(v=>{let y={...v};return typeof v.Edit=="string"&&v.Edit==="rich-text"?y.Edit=LK(GBe,{clientId:e}):typeof v.Edit=="string"&&v.Edit==="link"?y.Edit=LK(QBe):typeof v.Edit=="object"&&v.Edit.control==="media"&&(y.Edit=LK(YBe,{...v.Edit})),y}):[],[s,e]);if(!s?.length)return null;let b=v=>{m(y=>y.fields?.includes(v)?{...y,fields:y.fields.filter(k=>k!==v)}:{...y,fields:[...y.fields||[],v]})};return(0,oi.jsxs)("div",{className:"block-editor-block-fields__container",onMouseEnter:r?()=>f(e,!0):void 0,onMouseLeave:()=>r?f(e,!1):void 0,onFocus:r?()=>{u(e,null)}:void 0,children:[(0,oi.jsx)("div",{className:"block-editor-block-fields__header",children:(0,oi.jsxs)(P5.__experimentalHStack,{spacing:1,children:[r&&(0,oi.jsxs)(oi.Fragment,{children:[(0,oi.jsx)(Et,{className:"block-editor-block-fields__header-icon",icon:i?.icon}),(0,oi.jsx)("h2",{className:"block-editor-block-fields__header-title",children:(0,oi.jsx)(P5.__experimentalTruncate,{numberOfLines:1,children:n})}),(0,oi.jsx)(zBe,{fields:g,visibleFields:h.fields,onToggleField:b})]}),!r&&(0,oi.jsx)("h2",{className:"block-editor-block-fields__header-title",children:(0,ePe.__)("Content")})]})}),(0,oi.jsx)(I1,{data:l,fields:g,form:h,onChange:o})]})}function sJe(e){return!!(window?.__experimentalContentOnlyInspectorFields&&(0,bx.getBlockType)(e)?.[tPe])}function aJe(e){let{blockType:t,isSelectionWithinCurrentSection:o}=(0,Mh.useContext)(Fn);return(0,oi.jsx)(Tb,{group:"content",children:(0,oi.jsx)(iJe,{...e,blockType:t,isMultiBlock:o})})}var oPe={edit:aJe,hasSupport:sJe,attributeKeys:[],supportsPatternEditing:!0};var DK=c(go(),1),rPe=c(U(),1),MK=c(G(),1),O1=c(ue(),1);var NK=c(E(),1);function lJe(e){return(0,O1.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e}function cJe({className:e,setAttributes:t}){return Er()!=="default"?null:(0,NK.jsx)(Oe,{group:"advanced",children:(0,NK.jsx)(rPe.TextControl,{autoComplete:"off",label:(0,MK.__)("Additional CSS class(es)"),value:e||"",onChange:r=>{t({className:r!==""?r:void 0})},help:(0,MK.__)("Separate multiple classes with spaces.")})})}var VK={edit:cJe,addSaveProps:uJe,attributeKeys:["className"],hasSupport(e){return(0,O1.hasBlockSupport)(e,"customClassName",!0)}};function uJe(e,t,o){return(0,O1.hasBlockSupport)(t,"customClassName",!0)&&o.className&&(e.className=K(e.className,o.className)),e}function dJe(e,t,o,r){if(!(0,O1.hasBlockSupport)(e.name,"customClassName",!0)||r.length===1&&e.innerBlocks.length===t.length||r.length===1&&t.length>1||r.length>1&&t.length===1)return e;if(t[o]){let n=t[o]?.attributes.className;if(n&&e.attributes.className===void 0)return{...e,attributes:{...e.attributes,className:n}}}return e}(0,DK.addFilter)("blocks.registerBlockType","core/editor/custom-class-name/attribute",lJe);(0,DK.addFilter)("blocks.switchToBlockType.transformedBlock","core/customClassName/addTransforms",dJe);var nPe=c(go(),1),A1=c(ue(),1);function fJe(e,t){return(0,A1.hasBlockSupport)(t,"className",!0)&&(typeof e.className=="string"?e.className=[...new Set([(0,A1.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,A1.getBlockDefaultClassName)(t.name)),e}(0,nPe.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",fJe);var HK=c(F(),1),hPe=c(go(),1),gPe=c(Q(),1);var Lc=c(ue(),1),bPe=c(fe(),1),ed=c(rv(),1);var yx=c(F(),1),A5=c(Q(),1),O5=c(ue(),1),cPe=c(Rt(),1);var Qu=c(F(),1),iPe=c(GC(),1);var L1=c(E(),1);function sPe({clientId:e,value:t,computeStyle:o,forceShow:r}){let n=Nt(e),[i,s]=(0,Qu.useReducer)(()=>o(n));(0,Qu.useEffect)(()=>{n&&r&&s()},[n,r]),(0,Qu.useEffect)(()=>{if(!n)return;let d=new window.MutationObserver(s);return d.observe(n,{attributes:!0,attributeFilter:["style","class"]}),()=>{d.disconnect()}},[n]);let a=(0,Qu.useRef)(t),[l,u]=(0,Qu.useState)(!1);return(0,Qu.useEffect)(()=>{if((0,iPe.isShallowEqual)(t,a.current)||r)return;u(!0),a.current=t;let d=setTimeout(()=>{u(!1)},400);return()=>{u(!1),clearTimeout(d)}},[t,r]),!l&&!r?null:(0,L1.jsx)(Xa,{clientId:e,__unstablePopoverSlot:"block-toolbar",children:(0,L1.jsx)("div",{className:"block-editor__spacing-visualizer",style:i})})}function Nh(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function aPe({clientId:e,value:t,forceShow:o}){return(0,L1.jsx)(sPe,{clientId:e,value:t?.spacing?.margin,computeStyle:r=>{let n=Nh(r,"margin-top"),i=Nh(r,"margin-right"),s=Nh(r,"margin-bottom"),a=Nh(r,"margin-left");return{borderTopWidth:n,borderRightWidth:i,borderBottomWidth:s,borderLeftWidth:a,top:n?`-${n}`:0,right:i?`-${i}`:0,bottom:s?`-${s}`:0,left:a?`-${a}`:0}},forceShow:o})}function lPe({clientId:e,value:t,forceShow:o}){return(0,L1.jsx)(sPe,{clientId:e,value:t?.spacing?.padding,computeStyle:r=>({borderTopWidth:Nh(r,"padding-top"),borderRightWidth:Nh(r,"padding-right"),borderBottomWidth:Nh(r,"padding-bottom"),borderLeftWidth:Nh(r,"padding-left")}),forceShow:o})}var zf=c(E(),1),Ju="dimensions",M1="spacing";function pJe(){let[e,t]=(0,yx.useState)(!1),{hideBlockInterface:o,showBlockInterface:r}=H((0,A5.useDispatch)(C));return(0,yx.useEffect)(()=>{e?o():r()},[e,r,o]),[e,t]}function mJe({children:e,resetAllFilter:t}){let o=(0,yx.useCallback)(r=>{let n=r.style,i=t(n);return{...r,style:i}},[t]);return(0,zf.jsx)(Oe,{group:"dimensions",resetAllFilter:o,children:e})}function uPe({clientId:e,name:t,setAttributes:o,settings:r}){let n=Ja(),i=!Bn(n),s=ED(r,n),{style:a,className:l}=(0,A5.useSelect)(v=>{if(!s)return{};let y=v(C).getBlockAttributes(e)||{};return{style:y.style,className:y.className}},[e,s]),{value:u}=_l(t,l,n),[d,f]=pJe(),p=i?To(a,n):a,h=i?v=>{o({style:Pn(a,n,v)})}:v=>{o({style:Ge(v)})};if(!s)return null;let m=(0,O5.getBlockSupport)(t,[Ju,"__experimentalDefaultControls"]),g=(0,O5.getBlockSupport)(t,[M1,"__experimentalDefaultControls"]),b={minHeight:!1,minWidth:!1,...m,...g};return(0,zf.jsxs)(zf.Fragment,{children:[(0,zf.jsx)(TD,{as:mJe,panelId:e,settings:r,value:p,onChange:h,defaultControls:b,styleState:n,onVisualize:i?void 0:f,inheritedValue:u}),!i&&!!r?.spacing?.padding&&d==="padding"&&(0,zf.jsx)(lPe,{forceShow:d==="padding",clientId:e,value:p}),!i&&!!r?.spacing?.margin&&d==="margin"&&(0,zf.jsx)(aPe,{forceShow:d==="margin",clientId:e,value:p})]})}function dPe(e,t="any"){let o=(0,O5.getBlockSupport)(e,Ju);return o===!0?!0:t==="any"?!!(o?.aspectRatio||o?.height||o?.minHeight||o?.width||o?.minWidth):!!o?.[t]}function FK(e){return e?`${e}`.trim().toLowerCase()!=="auto":!1}var fPe={useBlockProps:hJe,attributeKeys:["height","minHeight","width","style"],hasSupport(e){return dPe(e)}};function hJe({name:e,height:t,minHeight:o,style:r}){if(!dPe(e,"aspectRatio")||$t(e,Ju,"aspectRatio"))return{};let n=FK(r?.dimensions?.aspectRatio),i=K({"has-aspect-ratio":n}),s={};return n?(s.minHeight="unset",s.height="unset"):(o||r?.dimensions?.minHeight||t||r?.dimensions?.height)&&(s.aspectRatio="unset"),{className:i,style:s}}function zK(){(0,cPe.default)("wp.blockEditor.__experimentalUseCustomSides",{since:"6.3",version:"6.4"})}var gJe=c(ue(),1);function pPe(e,t,o=""){if(typeof t!="string"||!t)return Gc(e).map(i=>`${i.trim()}${o}`).join(", ");let r=Gc(e).filter(i=>i.trim()),n=Gc(t).filter(i=>i.trim());return n.length?n.map(i=>{i=i.trim();let s=i.match(/^([.#]?[-_a-zA-Z0-9]+|\[[^\]]+\])/);return s?r.map(a=>`${a.trim()}${i.slice(s[0].length)}${o}`).join(", "):r.map(a=>`${a.trim()}${o}`).join(", ")}).join(", "):r.map(i=>`${i.trim()}${o}`).join(", ")}var Dh=c(E(),1),{getResponsiveMediaQueries:bJe}=H(Sr),yJe=["Top","Right","Bottom","Left"],vJe=[...LEe,by,Mn,Ju,vy,M1,d1],UK=e=>vJe.some(t=>(0,Lc.hasBlockSupport)(e,t));function ga(e={}){let t={};return(0,ed.getCSSRules)(e).forEach(o=>{t[o.key]=o.value}),t}function SJe(e){let t=e?.border;if(!t)return;let o=!!t.style,r=!!t.color,n=!!t.width,i={};return!o&&(r||n)&&(i.style="solid"),yJe.forEach(s=>{let a=s.toLowerCase(),l=t[a],u=!!l?.style,d=!!l?.color,f=!!l?.width;!o&&!u&&(d||f)&&(i[a]={style:"solid"})}),Ge({border:Ge(i)})}function kJe(e,t){if(!!!e?.color?.background)return;let r=!!e?.color?.gradient,n=!!e?.background?.gradient||!!e?.background?.backgroundImage;if(r||n)return;let i="background-image: unset !important";return t?`${t} { ${i}; }`:`${i};`}function _Je(e){let t=e?.dimensions;if(t){if(FK(t.aspectRatio))return{dimensions:{minHeight:"unset",height:"unset"}};if(t.minHeight||t.height)return{dimensions:{aspectRatio:"unset"}}}}function xJe(e,t){let o=e?.typography?.textAlign;if(typeof o!="string"||!o)return;let r=`text-align: ${(0,ed.getCSSValueFromRawStyle)(o)} !important`;return t?`${t} { ${r}; }`:`${r};`}function wJe(e,t){let o=_Je(e),r=o?GK(e,o):e,n=(0,ed.compileCSS)(r,{selector:t}),i=n?n.replace(/;/g," !important;"):void 0,s=SJe(e),a=s?(0,ed.compileCSS)(s,{selector:t}):void 0,l=xJe(e,t),u=kJe(e,t);return[i,l,a,u].filter(Boolean).join(` `)}function M5(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function GK(e={},t={}){let o={...e};return Object.entries(t).forEach(([r,n])=>{o[r]=M5(n)&&M5(o[r])?GK(o[r],n):n}),o}function L5(e,t,o){let r=t||"",n=e.get(r)||{selector:t,style:{}};e.set(r,{selector:t,style:GK(n.style,o)})}function CJe(e,t){let o=(0,Lc.getBlockType)(t)?.selectors||{},r=new Map;return Object.entries(e||{}).forEach(([n,i])=>{let s=o[n];if(typeof s=="string"){L5(r,s,{[n]:i});return}if(M5(s)&&M5(i)){let a={...i};Object.entries(s).forEach(([l,u])=>{l==="root"||typeof u!="string"||!Object.hasOwn(i,l)||(L5(r,u,{[n]:{[l]:i[l]}}),delete a[l])}),Object.keys(a).length&&L5(r,s.root||o.root,{[n]:a});return}L5(r,o.root,{[n]:i})}),Array.from(r.values())}function WK(e,t){let{name:o,baseSelector:r,state:n=""}=t,i=CJe(e,o).map(({selector:s,style:a})=>wJe(a,pPe(r,s,n))).filter(Boolean);return i.length?i.join(` `):void 0}function EJe(e,t){if(!e)return e;let o={...e};return t.forEach(r=>{delete o[r]}),o}function yPe(e,t,o){let r=gV[t];if(!r)return[];let n=[];return r.forEach(i=>{let s=e?.[i];if(s){let a=WK(s,{name:t,baseSelector:o,state:i});a&&n.push(a)}}),n}function TJe(e,t,o,r){let n=[],s=["elements",...gV[t]??[]],a=bJe(r);return Object.entries(a).forEach(([l,u])=>{let d=To(e,{viewport:l,pseudo:Js.pseudo});if(!d)return;let f=[],p=WK(EJe(d,s),{name:t,baseSelector:o});p&&f.push(p);let h=kPe(d.elements,t,o);h&&f.push(h),f.push(...yPe(d,t,o)),f.length&&n.push(`${u}{${f.join("")}}`)}),n}function mPe(e,t){let o=To(e,t);if(!Hi(t))return o;let r={...t,viewport:Js.viewport},n=To(e,r);return n&&o?yB(n,o):o||n}function RJe(e){return!UK(e)&&!(0,Lc.hasBlockSupport)(e,"customCSS",!0)||e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e}var vPe={[`${by}.__experimentalSkipSerialization`]:["border"],[`${Mn}.__experimentalSkipSerialization`]:[Mn],[`${wl}.__experimentalSkipSerialization`]:[wl],[`${Ju}.__experimentalSkipSerialization`]:[Ju],[`${M1}.__experimentalSkipSerialization`]:[M1],[`${d1}.__experimentalSkipSerialization`]:[d1]},BJe={...vPe,[`${Ju}.aspectRatio`]:[`${Ju}.aspectRatio`],[`${vy}`]:[vy]},PJe={[`${Ju}.aspectRatio`]:!0,[`${vy}`]:!0},IJe={gradients:"gradient"};function jK(e,t,o=!1){if(!e)return e;let r=e;return o||(r=JSON.parse(JSON.stringify(e))),Array.isArray(t)||(t=[t]),t.forEach(n=>{if(Array.isArray(n)||(n=n.split(".")),n.length>1){let[i,...s]=n;jK(r[i],[s],!0)}else n.length===1&&delete r[n[0]]}),r}function SPe(e,t,o,r=BJe){if(!UK(t))return e;let{style:n}=o;return Object.entries(r).forEach(([i,s])=>{let a=PJe[i]||(0,Lc.getBlockSupport)(t,i);a===!0&&(n=jK(n,s)),Array.isArray(a)&&a.forEach(l=>{let u=IJe[l]||l;n=jK(n,[[...s,u]])})}),e.style={...ga(n),...e.style},e}function OJe({clientId:e,name:t,setAttributes:o,style:r,__unstableParentLayout:n}){let i=xl(t,n),s=Er(),{globalBlockStyles:a,selectedState:l,showStateOnCanvas:u}=(0,gPe.useSelect)(m=>{let g=m(C),{getSelectedBlockStyleState:b,isSelectedBlockStyleStateShownOnCanvas:v}=H(g);return{globalBlockStyles:g.getSettings()?.[rs]?.blocks?.[t],selectedState:b(e),showStateOnCanvas:v(e)}},[e,t]),d=ea(l),f=(0,HK.useMemo)(()=>{if(!u||!d)return;let m=mPe(a,l),g=mPe(r,l),b;if(m&&g)b=yB(m,g);else if(g)b=g;else if(m)b=m;else return;return WK(b,{name:t,baseSelector:`[data-block="${e}"]`})},[u,d,a,r,l,e,t]);if(el({css:f}),s!=="default")return null;let p={...i,typography:{...i.typography,textAlign:!1}},h={clientId:e,name:t,setAttributes:o,settings:p};return(0,Dh.jsxs)(q2,{value:l,children:[(0,Dh.jsx)(eV,{...h}),(0,Dh.jsx)(ZD,{...h}),(0,Dh.jsx)(lV,{...h}),(0,Dh.jsx)(eEe,{...h}),(0,Dh.jsx)(uPe,{...h})]})}var N5={edit:OJe,hasSupport:UK,addSaveProps:SPe,attributeKeys:["style"],useBlockProps:MJe},AJe=[{elementType:"button"},{elementType:"link",pseudo:[":hover"]},{elementType:"heading",elements:["h1","h2","h3","h4","h5","h6"]}],LJe={};function kPe(e,t,o){if(!e)return;let r=[];return AJe.forEach(({elementType:n,pseudo:i,elements:s})=>{if($t(t,Mn,n))return;let l=e?.[n];if(l){let u=yk(o,Lc.__EXPERIMENTAL_ELEMENTS[n]);r.push((0,ed.compileCSS)(l,{selector:u})),i&&i.forEach(d=>{l[d]&&r.push((0,ed.compileCSS)(l[d],{selector:yk(o,`${Lc.__EXPERIMENTAL_ELEMENTS[n]}${d}`)}))})}s&&s.forEach(u=>{e[u]&&r.push((0,ed.compileCSS)(e[u],{selector:yk(o,Lc.__EXPERIMENTAL_ELEMENTS[u])}))})}),r.length>0?r.join(""):void 0}function MJe({name:e,style:t}){let o=(0,bPe.useInstanceId)(LJe,"wp-elements"),r=`.${o}`,n=t?.elements,[i]=Le("viewport"),s=(0,HK.useMemo)(()=>{let a=[],l=kPe(n,e,r);return l&&a.push(l),a.push(...yPe(t,e,r)),a.push(...TJe(t,e,r,i)),a.length>0?a.join(""):void 0},[r,n,e,t,i]);return el({css:s}),SPe({className:o},e,{style:t},vPe)}(0,hPe.addFilter)("blocks.registerBlockType","core/style/addAttribute",RJe);var _Pe=c(go(),1),xPe=c(ue(),1),NJe=e=>(0,xPe.hasBlockSupport)(e,"__experimentalSettings",!1);function DJe(e){return NJe(e)&&(e?.attributes?.settings||(e.attributes={...e.attributes,settings:{type:"object"}})),e}(0,_Pe.addFilter)("blocks.registerBlockType","core/settings/addAttribute",DJe);var Vh=c(ue(),1),EPe=c(fe(),1),TPe=c(go(),1),N1=c(F(),1),RPe=c(Q(),1);function VJe(e=[]){let t={r:[],g:[],b:[],a:[]};return e.forEach(o=>{let r=Lo(o).toRgb();t.r.push(r.r/255),t.g.push(r.g/255),t.b.push(r.b/255),t.a.push(r.a)}),t}function wPe(e){return`${e}{filter:none}`}function CPe(e,t){return`${e}{filter:url(#${t})}`}function D5(e,t){let o=VJe(t);return` `}var jf=c(E(),1),$K=[],FJe=window?.navigator.userAgent&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&!window.navigator.userAgent.includes("Chromium");Yf([qf]);function KK({presetSetting:e,defaultSetting:t}){let[o,r,n,i]=Le(t,`${e}.custom`,`${e}.theme`,`${e}.default`);return(0,N1.useMemo)(()=>[...r||$K,...n||$K,...o&&i||$K],[o,r,n,i])}function BPe(e,t){if(!e)return;let o=t?.find(({slug:r})=>e===`var:preset|duotone|${r}`);return o?o.colors:void 0}function zJe(e,t){if(!e||!Array.isArray(e))return;let o=t?.find(r=>r?.colors?.every((n,i)=>n===e[i]));return o?`var:preset|duotone|${o.slug}`:void 0}function jJe({style:e,setAttributes:t,name:o,clientId:r}){let n=e?.color?.duotone,i=xl(o),s=Er(),a=(0,RPe.useSelect)(b=>r?b(C).getBlockAttributes(r)?.className:void 0,[r]),{value:l}=_l(o,a),u=KK({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),d=KK({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),[f,p]=Le("color.custom","color.customDuotone"),h=!f,m=!p||d?.length===0&&h;if(u?.length===0&&m||s!=="default")return null;let g=n==="unset"||Array.isArray(n)?n:BPe(n,u);return(0,jf.jsxs)(jf.Fragment,{children:[(0,jf.jsx)(Oe,{group:"filter",children:(0,jf.jsx)(AD,{value:{filter:{duotone:g}},onChange:b=>{let v={...e,color:{...b?.filter}};t({style:Ge(v)})},settings:i,inheritedValue:l})}),(0,jf.jsx)(No,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,jf.jsx)(HM,{duotonePalette:u,colorPalette:d,disableCustomDuotone:m,disableCustomColors:h,value:g,onChange:b=>{let v=zJe(b,u),y={...e,color:{...e?.color,duotone:v??b}};t({style:Ge(y)})},settings:i})})]})}var YK={shareWithChildBlocks:!0,edit:jJe,useBlockProps:WJe,attributeKeys:["style"],hasSupport(e){return(0,Vh.hasBlockSupport)(e,"filter.duotone")}};function HJe(e){return(0,Vh.hasBlockSupport)(e,"filter.duotone")&&(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}})),e}function UJe({clientId:e,id:t,selector:o,attribute:r}){let n=KK({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),i=Array.isArray(r),s=i?void 0:BPe(r,n),a=typeof r=="string"&&s,l=typeof r=="string"&&!a,u=null;a?u=s:(l||i)&&(u=r);let p=o.split(",").map(g=>`.${t}${g.trim()}`).join(", "),h=Array.isArray(u)||u==="unset";Rc(h?{css:u!=="unset"?CPe(p,t):wPe(p),__unstableType:"presets"}:void 0),Rc(h?{assets:u!=="unset"?D5(t,u):"",__unstableType:"svgs"}:void 0);let m=Nt(e);(0,N1.useEffect)(()=>{if(h&&m&&FJe){let g=m.style.display;m.style.setProperty("display","inline-block"),m.offsetHeight,m.style.setProperty("display",g)}},[h,m,u])}var GJe={};function WJe({clientId:e,name:t,style:o}){let r=(0,EPe.useInstanceId)(GJe),n=(0,N1.useMemo)(()=>{let l=(0,Vh.getBlockType)(t);if(l){if(!(0,Vh.getBlockSupport)(l,"filter.duotone",!1))return null;let d=(0,Vh.getBlockSupport)(l,"color.__experimentalDuotone",!1);if(d){let f=js(l);return typeof d=="string"?yk(f,d):f}return js(l,"filter.duotone",{fallback:!0})}},[t]),i=o?.color?.duotone,s=`wp-duotone-${r}`,a=n&&i;return UJe({clientId:e,id:s,selector:n,attribute:i}),{className:a?s:""}}(0,TPe.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",HJe);var F5=c(F(),1),D1=c(Q(),1),PPe=c(fe(),1),V1=c(ue(),1),F1=c(G(),1);var IPe=c(as(),1);var V5=c(E(),1),$Je={},KJe={};function YJe({blockName:e,setAttributes:t,style:o}){if(Er()!=="default")return null;let n=(0,V1.getBlockType)(e);function i(a){let l=a?.css?.trim()?a.css:void 0;t({style:Ge({...a,css:l})})}let s=(0,F1.sprintf)((0,F1.__)("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;."),n?.title);return(0,V5.jsx)(Oe,{group:"advanced",children:(0,V5.jsx)(ND,{value:o,onChange:i,inheritedValue:o,help:s})})}var qJe="custom-css-edit-warning";function ZJe({clientId:e,name:t,setAttributes:o}){let{style:r,canEditCSS:n}=(0,D1.useSelect)(i=>{let{getBlockAttributes:s,getSettings:a}=i(C);return{style:s(e)?.style||KJe,canEditCSS:a().canEditCSS}},[e]);return n?(0,V5.jsx)(YJe,{blockName:t,setAttributes:o,style:r}):null}function XJe({style:e,clientId:t}){let o=e?.css,r=typeof o=="string"&&o.trim().length>0&&r$(o),n=(0,D1.useSelect)(d=>d(C).getSettings().canEditCSS,[]),{createWarningNotice:i}=(0,D1.useDispatch)(IPe.store),s=!!o?.trim();(0,F5.useEffect)(()=>{!n&&s&&i((0,F1.__)("This post contains blocks with custom CSS. You do not have permission to edit CSS. If you save this post, the custom CSS will be removed."),{id:qJe,isDismissible:!0})},[n,s,i]);let a=(0,PPe.useInstanceId)($Je,"wp-custom-css"),l=`.${a}`,u=(0,F5.useMemo)(()=>{if(r)return xB(o,l)},[o,l,r]);return Rc({css:u,clientId:t,__unstableType:"custom-css"}),r?{className:`has-custom-css ${a}`}:{}}function QJe(e,t,o){if(!(0,V1.hasBlockSupport)(t,"customCSS",!0)||!o?.style?.css?.trim())return e;let r=e.className?`${e.className} has-custom-css`:"has-custom-css";return{...e,className:r}}var z5={edit:ZJe,useBlockProps:XJe,addSaveProps:QJe,attributeKeys:["style"],hasSupport(e){return(0,V1.hasBlockSupport)(e,"customCSS",!0)}};var H5=c(fe(),1),XK=c(go(),1),APe=c(F(),1),Mc=c(ue(),1);var U5=c(Q(),1),Nc=c(U(),1),Ly=c(G(),1);var Dn=c(E(),1),JJe="is-style-",j5="layout",qK=["selfStretch","flexSize","columnStart","columnSpan","rowStart","rowSpan"],{kebabCase:ZK}=H(Nc.privateApis),{getResponsiveMediaQueries:eet}=H(Sr);function tet(e={},t){let o=e?.default;return t?.attributes?.layout??o}function OPe(e={},t){return Ge({...tet(e,t)})}function oet(e={},t={},o={}){let r={},n=Object.fromEntries(qK.filter(i=>Object.hasOwn(o||{},i)).map(i=>[i,o[i]]));return Object.entries(e||{}).forEach(([i,s])=>{let a=Object.hasOwn(t||{},i);!qK.includes(i)&&s!==t?.[i]&&(r[i]=s===void 0&&a?null:s)}),Ge({...n,...r})}function ret(e={}){return Object.fromEntries(Object.entries(e||{}).filter(([t])=>!qK.includes(t)))}function QK(e){return(0,Mc.hasBlockSupport)(e,"layout")||(0,Mc.hasBlockSupport)(e,"__experimentalLayout")}function G5(e={},t=""){let{layout:o}=e,{default:r}=(0,Mc.getBlockSupport)(t,j5)||{},n=o?.inherit||o?.contentSize||o?.wideSize?{...o,type:"constrained"}:o||r||{},i=[];if(Gs[n?.type||"default"]?.className){let a=Gs[n?.type||"default"]?.className,l=t.split("/"),d=`wp-block-${l[0]==="core"?l.pop():l.join("-")}-${a}`;i.push(a,d)}return(0,U5.useSelect)(a=>!n?.inherit&&!n?.contentSize&&n?.type!=="constrained"?!1:a(C).getSettings().__experimentalFeatures?.useRootPaddingAwareAlignments,[n?.contentSize,n?.inherit,n?.type])&&i.push("has-global-padding"),n?.orientation&&i.push(`is-${ZK(n.orientation)}`),n?.justifyContent&&i.push(`is-content-justification-${ZK(n.justifyContent)}`),n?.flexWrap&&n.flexWrap==="nowrap"&&i.push("is-nowrap"),i}function JK(e={},t,o){let{layout:r={},style:n={}}=e,i=r?.inherit||r?.contentSize||r?.wideSize?{...r,type:"constrained"}:r||{},s=Ba(i?.type||"default"),[a]=Le("spacing.blockGap"),l=a!==null;return s?.getLayoutStyle?.({blockName:t,selector:o,layout:r,style:n,hasBlockGapSupport:l})}function net({attributes:e={},blockName:t,selector:o,layout:r={},hasBlockGapSupport:n,globalBlockGapValue:i,viewportSettings:s}){return Object.entries(eet(s)).map(([a,l])=>{let u=To(e?.style,{viewport:a,pseudo:Js.pseudo}),d=ret(u?.layout),f=Object.keys(d).length>0,p=u?.spacing&&Object.hasOwn(u.spacing,"blockGap"),h=u?.spacing&&Object.hasOwn(u.spacing,"padding");if(!f&&!p&&!h)return"";let g=Ba(r?.type||"default")?.getLayoutStyle?.({blockName:t,selector:o,layout:r,viewportOverrides:d,style:u,hasBlockGapSupport:n,globalBlockGapValue:i});return g?`${l}{${g}}`:""}).filter(Boolean).join("")}function iet({layout:e,style:t,setAttributes:o,name:r,clientId:n}){let i=xl(r),{layout:s}=i,{themeSupportsLayout:a,activeBlockVariation:l,selectedState:u,isResponsiveEditing:d}=(0,U5.useSelect)(Y=>{let{getBlockAttributes:Z,getSettings:oe,getSelectedBlockStyleState:ne,isResponsiveEditing:X}=H(Y(C));return{activeBlockVariation:Y(Mc.store).getActiveBlockVariation(r,Z(n)||{},"block"),themeSupportsLayout:oe().supportsLayout,selectedState:ne(n),isResponsiveEditing:X()}},[r,n]),f=Er(),p=Hi(u)&&!ea(u),h=(0,APe.useCallback)((...Y)=>{let Z=Y[0]||{},oe=Y[1]||{};if(p){let re=To(Z.style??t,u)||{},ae=Ge({...re,layout:void 0});return{style:Pn(Z.style??t,u,ae)}}let ne=oe.name||r,X=(0,Mc.getBlockSupport)(ne,j5,{});return{layout:OPe(X,l)}},[r,l,p,u,t]);if(f!=="default")return null;let m=(0,Mc.getBlockSupport)(r,j5,{}),g={...s,...m},{allowSwitching:b,allowEditing:v=!0,allowInheriting:y=!0,default:k}=g;if(!v)return null;let S=e||k||{},_=p?To(t,u):void 0,x=_?.layout,w=p?Ge({...S,...x})||{}:S,T=p?S:OPe(m,l),B={...m,...w},{type:R,default:{type:I="default"}={}}=B,A=R||I,P=!!(y&&(!A||A==="default"||A==="constrained"||B.inherit)),{inherit:O=!1,contentSize:N=null}=w;if((A==="default"||A==="constrained")&&!a)return null;let z=Ba(A),V=Ba("constrained"),M=!w.type&&(N||O),D=!!O||!!N,L=Bn(u)&&!O&&b,j=Y=>{if(p){let Z=Ge({..._,layout:oet(Y,S,_?.layout)});o({style:Pn(t,u,Z)});return}o({layout:Ge(Y)})},q=Y=>j({type:Y}),J=()=>j(T),te=()=>j({type:"default"}),ee=()=>z?.name==="constrained"||D,$=()=>p?(w?.type??"default")!==(T?.type??"default"):e?.type==="constrained",W=()=>(w?.type??"default")!==(T?.type??"default");return(0,Dn.jsxs)(Dn.Fragment,{children:[(0,Dn.jsxs)(Oe,{group:"layout",resetAllFilter:h,children:[P&&(0,Dn.jsx)(Nc.__experimentalToolsPanelItem,{label:(0,Ly.__)("Use content width"),hasValue:$,onDeselect:te,isShownByDefault:!0,panelId:n,children:(0,Dn.jsx)(Nc.ToggleControl,{label:(0,Ly.__)("Inner blocks use content width"),checked:ee(),onChange:()=>j({type:ee()?"default":"constrained"}),help:ee()?(0,Ly.__)("Nested blocks use content width with options for full and wide widths."):(0,Ly.__)("Nested blocks will fill the width of this container.")})}),L&&(0,Dn.jsx)(Nc.__experimentalToolsPanelItem,{label:(0,Ly.__)("Layout type"),hasValue:W,onDeselect:J,isShownByDefault:!0,panelId:n,children:(0,Dn.jsx)(set,{type:A,onChange:q})}),z&&z.name!=="default"&&(0,Dn.jsx)(z.inspectorControls,{layout:w,value:e,onChange:j,layoutBlockSupport:g,resetLayout:T,name:r,clientId:n}),V&&M&&(0,Dn.jsx)(V.inspectorControls,{layout:w,value:e,onChange:j,layoutBlockSupport:g,resetLayout:T,name:r,clientId:n})]}),!O&&z&&(0,Dn.jsx)(z.toolBarControls,{layout:w,onChange:j,layoutBlockSupport:m,controlsGroup:d&&Hi(u)&&!ea(u)?"style-state":"block",name:r,clientId:n})]})}var LPe={shareWithChildBlocks:!0,edit:iet,attributeKeys:["layout","style"],hasSupport(e){return QK(e)}};function set({type:e,onChange:t}){return(0,Dn.jsx)(Nc.__experimentalToggleGroupControl,{isBlock:!0,label:(0,Ly.__)("Layout type"),hideLabelFromVision:!0,isAdaptiveWidth:!0,value:e,onChange:t,children:lQ().map(({name:o,label:r})=>(0,Dn.jsx)(Nc.__experimentalToggleGroupControlOption,{value:o,label:r},o))})}function aet(e){return"type"in(e.attributes?.layout??{})||QK(e)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e}function cet({block:e,props:t,blockGapSupport:o,globalBlockGapValue:r,viewportSettings:n,layoutClasses:i}){let{name:s,attributes:a}=t,l=(0,H5.useInstanceId)(e),{layout:u}=a,{default:d}=(0,Mc.getBlockSupport)(s,j5)||{},f=u?.inherit||u?.contentSize||u?.wideSize?{...u,type:"constrained"}:u||d||{},p=`wp-container-${ZK(s)}-is-layout-`,h=`.${p}${l}`,m=o!==null,b=Ba(f?.type||"default")?.getLayoutStyle?.({blockName:s,selector:h,layout:f,style:a?.style,hasBlockGapSupport:m,globalBlockGapValue:r}),v=net({attributes:a,blockName:s,selector:h,layout:f,hasBlockGapSupport:m,globalBlockGapValue:r,viewportSettings:n}),y=[b,v].filter(Boolean).join(""),k=K({[`${p}${l}`]:!!y},i);return el({css:y}),(0,Dn.jsx)(e,{...t,__unstableLayoutClassNames:k})}var uet=(0,H5.createHigherOrderComponent)(e=>function(o){let{clientId:r,name:n,attributes:i}=o,s=QK(n),a=G5(i,n),l=(0,U5.useSelect)(u=>{if(!s)return;let{getSettings:d,getBlockSettings:f}=H(u(C)),p=d(),{disableLayoutStyles:h}=p;if(h)return;let[m]=f(r,"spacing.blockGap"),g=p[rs],b,v=i?.className;if(v?.includes(JJe)){let{getBlockStyles:k}=u(Mc.store),S=k(n),_=l1(v,S);b=_?g?.blocks?.[n]?.variations?.[_]?.spacing?.blockGap:void 0}let y=b??g?.blocks?.[n]?.spacing?.blockGap??g?.spacing?.blockGap;return{blockGapSupport:m,globalBlockGapValue:y,viewportSettings:p?.__experimentalFeatures?.viewport}},[s,r,i?.className,n]);return l?(0,Dn.jsx)(cet,{block:e,props:o,layoutClasses:a,...l}):(0,Dn.jsx)(e,{...o,__unstableLayoutClassNames:s?a:void 0})},"withLayoutStyles");(0,XK.addFilter)("blocks.registerBlockType","core/layout/addAttribute",aet);(0,XK.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",uet);var UPe=c(fe(),1),q5=c(Q(),1),GPe=c(F(),1);var Pl=c(F(),1),Fh=c(Q(),1),NPe=c(fe(),1);function j1(e,t){return Array.from({length:t},(o,r)=>e+r)}var Dc=class{constructor({columnStart:e,rowStart:t,columnEnd:o,rowEnd:r,columnSpan:n,rowSpan:i}={}){this.columnStart=e??1,this.rowStart=t??1,n!==void 0?this.columnEnd=this.columnStart+n-1:this.columnEnd=o??this.columnStart,i!==void 0?this.rowEnd=this.rowStart+i-1:this.rowEnd=r??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 Xr(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function z1(e,t){let o=[];for(let r of e.split(" ")){let n=o[o.length-1],i=n?n.end+t:0,s=i+parseFloat(r);o.push({start:i,end:s})}return o}function Hf(e,t,o="start"){return e.reduce((r,n,i)=>Math.abs(n[o]-t)a(C).getSettings().isDistractionFree,[]),i=Nt(e);if(n||!i)return null;let s=o?.isManualPlacement&&window.__experimentalEnableGridInteractivity;return(0,ba.jsx)(fet,{gridClientId:e,gridElement:i,isManualGrid:s,ref:t,childGridClientId:r})}var fet=(0,Pl.forwardRef)(({gridClientId:e,gridElement:t,isManualGrid:o,childGridClientId:r},n)=>{let[i,s]=(0,Pl.useState)(()=>eY(t)),[a,l]=(0,Pl.useState)(!1),u=Nt(r),d=(0,Pl.useMemo)(()=>u?MPe(u):null,[u]);return(0,Pl.useEffect)(()=>{let f=()=>s(eY(t)),p=new window.ResizeObserver(f);p.observe(t,{box:"border-box"});let h=new window.ResizeObserver(f);h.observe(t);for(let m of t.children)h.observe(m);return()=>{p.disconnect(),h.disconnect()}},[t]),(0,Pl.useEffect)(()=>{function f(){l(!0)}function p(){l(!1)}return document.addEventListener("drag",f),document.addEventListener("dragend",p),()=>{document.removeEventListener("drag",f),document.removeEventListener("dragend",p)}},[]),(0,ba.jsx)(Xa,{className:K("block-editor-grid-visualizer",{"is-dropping-allowed":a}),clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",children:(0,ba.jsx)("div",{ref:n,className:"block-editor-grid-visualizer__grid",style:i.style,children:o?(0,ba.jsx)(met,{gridClientId:e,gridInfo:i,childGridRect:d}):(0,ba.jsx)(pet,{gridInfo:i,childGridRect:d})})})});function pet({gridInfo:e,childGridRect:t}){return j1(1,e.numRows).map(o=>j1(1,e.numColumns).map(r=>{let n=e.currentColor;return t?.contains(r,o)&&(n="transparent"),(0,ba.jsx)(DPe,{color:n},`${o}-${r}`)}))}function met({gridClientId:e,gridInfo:t,childGridRect:o}){let[r,n]=(0,Pl.useState)(null),i=(0,Fh.useSelect)(a=>{let{getBlockOrder:l,getBlockStyles:u}=H(a(C)),d=l(e);return u(d)},[e]),s=(0,Pl.useMemo)(()=>{let a=[];for(let l of Object.values(i)){let{columnStart:u,rowStart:d,columnSpan:f=1,rowSpan:p=1}=l?.layout??{};!u||!d||a.push(new Dc({columnStart:u,rowStart:d,columnSpan:f,rowSpan:p}))}return a},[i]);return j1(1,t.numRows).map(a=>j1(1,t.numColumns).map(l=>{let u=o?.contains(l,a),d=t.currentColor;u&&(d="transparent");let f=s.some(h=>h.contains(l,a)),p=r?.contains(l,a)??!1;return(0,ba.jsx)(DPe,{color:d,className:p&&"is-highlighted",children:f&&!u?(0,ba.jsx)(het,{column:l,row:a,gridClientId:e,gridInfo:t,setHighlightedRect:n}):(0,ba.jsx)(get,{column:l,row:a,gridClientId:e,gridInfo:t,setHighlightedRect:n})},`${a}-${l}`)}))}function DPe({color:e,children:t,className:o}){return(0,ba.jsx)("div",{className:K("block-editor-grid-visualizer__cell",o),style:{boxShadow:`inset 0 0 0 1px color-mix(in srgb, ${e} 20%, #0000)`,color:e},children:t})}function VPe(e,t,o,r,n){let{getBlockAttributes:i,getBlockRootClientId:s,canInsertBlockType:a,getBlockName:l}=(0,Fh.useSelect)(C),{updateBlockAttributes:u,moveBlocksToPosition:d,__unstableMarkNextChangeAsNotPersistent:f}=(0,Fh.useDispatch)(C),p=fy(o,r.numColumns);return bet({validateDrag(h){let m=l(h);if(!a(m,o))return!1;let g=i(h),b=new Dc({columnStart:e,rowStart:t,columnSpan:g.style?.layout?.columnSpan,rowSpan:g.style?.layout?.rowSpan});return new Dc({columnSpan:r.numColumns,rowSpan:r.numRows}).containsRect(b)},onDragEnter(h){let m=i(h);n(new Dc({columnStart:e,rowStart:t,columnSpan:m.style?.layout?.columnSpan,rowSpan:m.style?.layout?.rowSpan}))},onDragLeave(){n(h=>h?.columnStart===e&&h?.rowStart===t?null:h)},onDrop(h){n(null);let m=i(h);u(h,{style:{...m.style,layout:{...m.style?.layout,columnStart:e,rowStart:t}}}),f(),d([h],s(h),o,p(e,t))}})}function het({column:e,row:t,gridClientId:o,gridInfo:r,setHighlightedRect:n}){return(0,ba.jsx)("div",{className:"block-editor-grid-visualizer__drop-zone",ref:VPe(e,t,o,r,n)})}function get({column:e,row:t,gridClientId:o,gridInfo:r,setHighlightedRect:n}){let{updateBlockAttributes:i,moveBlocksToPosition:s,__unstableMarkNextChangeAsNotPersistent:a}=(0,Fh.useDispatch)(C),l=fy(o,r.numColumns);return(0,ba.jsx)(Sm,{rootClientId:o,className:"block-editor-grid-visualizer__appender",ref:VPe(e,t,o,r,n),style:{color:r.currentColor},onSelect:u=>{u&&(i(u.clientId,{style:{layout:{columnStart:e,rowStart:t}}}),a(),s([u.clientId],o,o,l(e,t)))}})}function bet({validateDrag:e,onDragEnter:t,onDragLeave:o,onDrop:r}){let{getDraggedBlockClientIds:n}=(0,Fh.useSelect)(C);return(0,NPe.__experimentalUseDropZone)({onDragEnter(){let[i]=n();i&&e(i)&&t(i)},onDragLeave(){o()},onDrop(){let[i]=n();i&&e(i)&&r(i)}})}var FPe=c(U(),1),U1=c(F(),1);var W5=c(E(),1);function tY({clientId:e,bounds:t,onChange:o,parentLayout:r}){let n=Nt(e),i=n?.parentElement,{isManualPlacement:s}=r;return!n||!i?null:(0,W5.jsx)(yet,{clientId:e,bounds:t,blockElement:n,rootBlockElement:i,onChange:o,isManualGrid:s&&window.__experimentalEnableGridInteractivity})}function yet({clientId:e,bounds:t,blockElement:o,rootBlockElement:r,onChange:n,isManualGrid:i}){let[s,a]=(0,U1.useState)(null),[l,u]=(0,U1.useState)({top:!1,bottom:!1,left:!1,right:!1});(0,U1.useEffect)(()=>{let h=new window.ResizeObserver(()=>{let m=o.getBoundingClientRect(),g=r.getBoundingClientRect(),b=m.top>g.top,v=m.bottomg.left,k=m.righth.disconnect()},[o,r,i]);let d={right:"left",left:"right"},f={top:"flex-end",bottom:"flex-start"},p={display:"flex",justifyContent:"center",alignItems:"center",...d[s]&&{justifyContent:d[s]},...f[s]&&{alignItems:f[s]}};return(0,W5.jsx)(Xa,{className:"block-editor-grid-item-resizer",clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",additionalStyles:p,children:(0,W5.jsx)(FPe.ResizableBox,{className:"block-editor-grid-item-resizer__box",size:{width:"100%",height:"100%"},enable:{bottom:l.bottom,bottomLeft:!1,bottomRight:!1,left:l.left,right:l.right,top:l.top,topLeft:!1,topRight:!1},bounds:t,boundsByDirection:!0,onPointerDown:({target:h,pointerId:m})=>{h.setPointerCapture(m)},onResizeStart:(h,m)=>{a(m)},onResizeStop:(h,m,g)=>{let b=parseFloat(Xr(r,"column-gap")),v=parseFloat(Xr(r,"row-gap")),y=z1(Xr(r,"grid-template-columns"),b),k=z1(Xr(r,"grid-template-rows"),v),S=new window.DOMRect(o.offsetLeft+g.offsetLeft,o.offsetTop+g.offsetTop,g.offsetWidth,g.offsetHeight),_=Hf(y,S.left)+1,x=Hf(k,S.top)+1,w=Hf(y,S.right,"end")+1,T=Hf(k,S.bottom,"end")+1;n({columnSpan:w-_+1,rowSpan:T-x+1,columnStart:i?_:void 0,rowStart:i?x:void 0})}})})}var Il=c(G(),1),$5=c(U(),1);var zPe=c(Q(),1),jPe=c(fe(),1);var Ei=c(E(),1);function oY({layout:e,parentLayout:t,onChange:o,gridClientId:r,blockClientId:n}){let{moveBlocksToPosition:i,__unstableMarkNextChangeAsNotPersistent:s}=(0,zPe.useDispatch)(C),a=e?.columnStart??1,l=e?.rowStart??1,u=e?.columnSpan??1,d=e?.rowSpan??1,f=a+u-1,p=l+d-1,h=t?.columnCount,m=t?.rowCount,g=fy(r,h);return(0,Ei.jsx)(No,{group:"parent",children:(0,Ei.jsxs)($5.ToolbarGroup,{className:"block-editor-grid-item-mover__move-button-container",children:[(0,Ei.jsx)("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-left",children:(0,Ei.jsx)(G1,{icon:(0,Il.isRTL)()?un:Ti,label:(0,Il.__)("Move left"),description:(0,Il.__)("Move left"),isDisabled:a<=1,onClick:()=>{o({columnStart:a-1}),s(),i([n],r,r,g(a-1,l))}})}),(0,Ei.jsxs)("div",{className:"block-editor-grid-item-mover__move-vertical-button-container",children:[(0,Ei.jsx)(G1,{className:"is-up-button",icon:Jh,label:(0,Il.__)("Move up"),description:(0,Il.__)("Move up"),isDisabled:l<=1,onClick:()=>{o({rowStart:l-1}),s(),i([n],r,r,g(a,l-1))}}),(0,Ei.jsx)(G1,{className:"is-down-button",icon:cn,label:(0,Il.__)("Move down"),description:(0,Il.__)("Move down"),isDisabled:m&&p>=m,onClick:()=>{o({rowStart:l+1}),s(),i([n],r,r,g(a,l+1))}})]}),(0,Ei.jsx)("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-right",children:(0,Ei.jsx)(G1,{icon:(0,Il.isRTL)()?Ti:un,label:(0,Il.__)("Move right"),description:(0,Il.__)("Move right"),isDisabled:h&&f>=h,onClick:()=>{o({columnStart:a+1}),s(),i([n],r,r,g(a+1,l))}})})]})})}function G1({className:e,icon:t,label:o,isDisabled:r,onClick:n,description:i}){let a=`block-editor-grid-item-mover-button__description-${(0,jPe.useInstanceId)(G1)}`;return(0,Ei.jsxs)(Ei.Fragment,{children:[(0,Ei.jsx)($5.ToolbarButton,{className:K("block-editor-grid-item-mover-button",e),icon:t,label:o,"aria-describedby":a,onClick:r?null:n,disabled:r,accessibleWhenDisabled:!0}),(0,Ei.jsx)(bt,{id:a,children:i})]})}var W1=c(Q(),1),Y5=c(F(),1),K5=c(fe(),1);function rY({clientId:e}){let{gridLayout:t,blockOrder:o,selectedBlockLayout:r}=(0,W1.useSelect)(p=>{let{getBlockAttributes:h,getBlockOrder:m}=p(C),g=p(C).getSelectedBlock();return{gridLayout:h(e).layout??{},blockOrder:m(e),selectedBlockLayout:g?.attributes.style?.layout}},[e]),{getBlockAttributes:n,getBlockRootClientId:i}=(0,W1.useSelect)(C),{updateBlockAttributes:s,__unstableMarkNextChangeAsNotPersistent:a}=(0,W1.useDispatch)(C),l=(0,Y5.useMemo)(()=>r?new Dc(r):null,[r]),u=(0,K5.usePrevious)(l),d=(0,K5.usePrevious)(t.isManualPlacement),f=(0,K5.usePrevious)(o);(0,Y5.useEffect)(()=>{let p={};if(t.isManualPlacement){let h=[];for(let g of o){let{columnStart:b,rowStart:v,columnSpan:y=1,rowSpan:k=1}=n(g).style?.layout??{};!b||!v||h.push(new Dc({columnStart:b,rowStart:v,columnSpan:y,rowSpan:k}))}for(let g of o){let b=n(g),{columnStart:v,rowStart:y,columnSpan:k=1,rowSpan:S=1}=b.style?.layout??{};if(v&&y)continue;let[_,x]=vet(h,t.columnCount,k,S,u?.columnEnd,u?.rowEnd);h.push(new Dc({columnStart:_,rowStart:x,columnSpan:k,rowSpan:S})),p[g]={style:{...b.style,layout:{...b.style?.layout,columnStart:_,rowStart:x}}}}let m=Math.max(...h.map(g=>g.rowEnd));(!t.rowCount||t.rowCountu.intersectsRect(l)))return[a,s]}}var Uf=c(E(),1),{getResponsiveMediaQueries:ket}=H(Sr),_et={},zh={fit:"fit",grow:"fill",max:"fixed",fixed:"fixedNoShrink"},xet=[zh.max,zh.fixed];function HPe(e){return xet.includes(e)}function WPe({selector:e,declarations:t}){return`${e} { ${Object.entries(t).map(([o,r])=>`${o}: ${r}`).join("; ")}; }`}function $Pe({selector:e,layout:t={},viewportOverrides:o,parentLayout:r={},includeContainerQuery:n=!0}){let i=o!==void 0,s=i?{...t,...o}:t,a=k=>Object.hasOwn(o||{},k),{selfStretch:l,flexSize:u,columnStart:d,rowStart:f,columnSpan:p,rowSpan:h}=s,m=t.selfStretch,{columnCount:g,minimumColumnWidth:b}=r,v=[],y={};if((!i||a("selfStretch")||a("flexSize"))&&(i&&(l===zh.fit||l===zh.grow)&&HPe(m)&&t.flexSize&&(y["flex-basis"]="unset",m===zh.fixed&&(y["flex-shrink"]="unset")),HPe(l)&&u?(y["flex-basis"]=u,l===zh.fixed?y["flex-shrink"]="0":i&&m===zh.fixed&&(y["flex-shrink"]="unset"),y["box-sizing"]="border-box"):l===zh.grow&&(y["flex-grow"]="1")),(!i||a("columnStart")||a("columnSpan"))&&(d&&p?y["grid-column"]=`${d} / span ${p}`:d?y["grid-column"]=`${d}`:p&&(y["grid-column"]=`span ${p}`)),(!i||a("rowStart")||a("rowSpan"))&&(f&&h?y["grid-row"]=`${f} / span ${h}`:f?y["grid-row"]=`${f}`:h&&(y["grid-row"]=`span ${h}`)),Object.keys(y).length&&v.push({selector:e,declarations:y}),n&&!i&&(p||d)&&(b||!g)){let k=parseFloat(b);isNaN(k)&&(k=12);let S=b?.replace(k,"");["px","rem","em"].includes(S)||(S="rem");let _=2;p&&d?_=p+d-1:p?_=p:_=d;let x=S==="px"?24:1.5,w=_*k+(_-1)*x,T=k*2+x-1,B=p&&p>1?"1/-1":"auto";v.push({rulesGroup:`@container (max-width: ${Math.max(w,T)}${S})`,selector:e,declarations:{"grid-column":B,"grid-row":"auto"}})}return v}function wet({selector:e,layout:t={},parentLayout:o={},includeContainerQuery:r=!0}){return $Pe({selector:e,layout:t,parentLayout:o,includeContainerQuery:r}).map(n=>{let i=WPe(n);return n.rulesGroup?`${n.rulesGroup} { ${i} }`:i}).join("")}function Cet({style:e={},selector:t,parentLayout:o={},viewportSettings:r}){let n=e?.layout??{};return Object.entries(ket(r)).map(([i,s])=>{let a=To(e,{viewport:i,pseudo:Js.pseudo})?.layout;if(!a||!Object.keys(a).length)return"";let u=$Pe({selector:t,layout:n,viewportOverrides:a,parentLayout:o,includeContainerQuery:!1}).map(WPe).join("");return u?`${s}{${u}}`:""}).filter(Boolean).join("")}function Eet({style:e}){let{shouldRenderChildLayoutStyles:t,viewportSettings:o}=(0,q5.useSelect)(p=>{let h=p(C).getSettings();return{shouldRenderChildLayoutStyles:!h.disableLayoutStyles,viewportSettings:h?.__experimentalFeatures?.viewport}}),r=e?.layout??{},{columnStart:n,rowStart:i,columnSpan:s,rowSpan:a}=r,l=yg()||{},u=(0,UPe.useInstanceId)(_et),d=`.wp-container-content-${u}`,f="";if(t&&(f=[wet({selector:d,layout:r,parentLayout:l}),Cet({style:e,selector:d,parentLayout:l,viewportSettings:o})].join("")),el({css:f}),!!f)return{className:`wp-container-content-${u}`}}function Tet({clientId:e,style:t,setAttributes:o}){let r=yg()||{},{type:n="default",allowSizingOnChildren:i=!1,isManualPlacement:s}=r;return n!=="grid"?null:(0,Uf.jsx)(Ret,{clientId:e,style:t,setAttributes:o,allowSizingOnChildren:i,isManualPlacement:s,parentLayout:r})}function Ret({clientId:e,style:t,setAttributes:o,allowSizingOnChildren:r,isManualPlacement:n,parentLayout:i}){let{rootClientId:s,isVisible:a,parentBlockVisibility:l,blockBlockVisibility:u,deviceType:d,viewportSettings:f,isChildBlockAGrid:p}=(0,q5.useSelect)(B=>{let{getBlockRootClientId:R,getBlockEditingMode:I,getTemplateLock:A,getBlockAttributes:P,getSettings:O}=B(C),N=R(e);if(A(N)||I(N)!=="default")return{rootClientId:N,isVisible:!1};let z=P(N),V=P(e),M=O(),D=M?.[wa]?.toLowerCase()||no.desktop.key;return{rootClientId:N,isVisible:!0,parentBlockVisibility:z?.metadata?.blockVisibility,blockBlockVisibility:V?.metadata?.blockVisibility,deviceType:D,viewportSettings:M?.__experimentalFeatures?.viewport,isChildBlockAGrid:V?.layout?.type==="grid"}},[e]),m=Nt(e)?.ownerDocument?.defaultView,g=m===null?void 0:m,{isBlockCurrentlyHidden:b,currentViewport:v}=Ma({blockVisibility:l,deviceType:d,view:g,viewportSettings:f}),y=(0,q5.useSelect)(B=>{if(!s)return!1;let{isBlockParentHiddenAtViewport:R}=H(B(C));return R(s,v)},[s,v]),{isBlockCurrentlyHidden:k}=Ma({blockVisibility:u,deviceType:d,view:g,viewportSettings:f}),[S,_]=(0,GPe.useState)(),x=p?e:void 0;if(!a||b||y)return null;let w=r&&!k;function T(B){o({style:{...t,layout:{...t?.layout,...B}}})}return(0,Uf.jsxs)(Uf.Fragment,{children:[(0,Uf.jsx)(H1,{clientId:s,contentRef:_,parentLayout:i,childGridClientId:x}),w&&(0,Uf.jsx)(tY,{clientId:e,bounds:S,onChange:T,parentLayout:i}),n&&window.__experimentalEnableGridInteractivity&&(0,Uf.jsx)(oY,{layout:t?.layout,parentLayout:i,onChange:T,gridClientId:s,blockClientId:e})]})}var nY={useBlockProps:Eet,edit:Tet,attributeKeys:["style"],hasSupport(){return!0}};var sY=c(go(),1),iY=c(ue(),1),KPe="metadata";function Bet(e){return e?.attributes?.[KPe]?.type||(e.attributes={...e.attributes,[KPe]:{type:"object"}}),e}function Pet(e,t,o,r){if(r.length===1&&e.innerBlocks.length===t.length||r.length===1&&t.length>1||r.length>1&&t.length===1||r.length>1&&t.length>1&&r.length!==t.length)return e;let n=t[o]?.attributes?.metadata;if(!n)return e;let i={};return n.noteId&&!e.attributes?.metadata?.noteId&&(i.noteId=n.noteId),n.name&&!e.attributes?.metadata?.name&&(0,iY.hasBlockSupport)(e.name,"renaming",!0)&&(i.name=n.name),n.blockVisibility!==void 0&&!e.attributes?.metadata?.blockVisibility&&(0,iY.hasBlockSupport)(e.name,"visibility",!0)&&(i.blockVisibility=n.blockVisibility),Object.keys(i).length>0?{...e,attributes:{...e.attributes,metadata:{...e.attributes.metadata,...i}}}:e}(0,sY.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",Bet);(0,sY.addFilter)("blocks.switchToBlockType.transformedBlock","core/metadata/addTransforms",Pet);var aY=c(G(),1),Z5=c(F(),1),X5=c(U(),1),Q5=c(ue(),1),vx=c(Q(),1);var jh=c(E(),1),Iet={};function Oet({name:e,clientId:t,metadata:{ignoredHookedBlocks:o=[]}={}}){let r=(0,vx.useSelect)(h=>h(Q5.store).getBlockTypes(),[]),n=(0,Z5.useMemo)(()=>r?.filter(({name:h,blockHooks:m})=>m&&e in m||o.includes(h)),[r,e,o]),i=(0,vx.useSelect)(h=>{let{getBlocks:m,getBlockRootClientId:g,getGlobalBlockCount:b}=h(C),v=g(t),y=n.reduce((k,S)=>{if(b(S.name)===0)return k;let _=S?.blockHooks?.[e],x;switch(_){case"before":case"after":x=m(v);break;case"first_child":case"last_child":x=m(t);break;case void 0:x=[...m(v),...m(t)];break}let w=x?.find(T=>T.name===S.name);return w?{...k,[S.name]:w.clientId}:k},{});return Object.values(y).length>0?y:Iet},[n,e,t]),{getBlockIndex:s,getBlockCount:a,getBlockRootClientId:l}=(0,vx.useSelect)(C),{insertBlock:u,removeBlock:d}=(0,vx.useDispatch)(C);if(!n.length)return null;let f=n.reduce((h,m)=>{let[g]=m.name.split("/");return h[g]||(h[g]=[]),h[g].push(m),h},{}),p=(h,m)=>{let g=s(t),b=a(t),v=l(t);switch(m){case"before":case"after":u(h,m==="after"?g+1:g,v,!1);break;case"first_child":case"last_child":u(h,m==="first_child"?0:b,t,!1);break;case void 0:u(h,g+1,v,!1);break}};return(0,jh.jsx)(Oe,{children:(0,jh.jsxs)(X5.PanelBody,{className:"block-editor-hooks__block-hooks",title:(0,aY.__)("Plugins"),initialOpen:!0,children:[(0,jh.jsx)("p",{className:"block-editor-hooks__block-hooks-helptext",children:(0,aY.__)("Manage the inclusion of blocks added automatically by plugins.")}),Object.keys(f).map(h=>(0,jh.jsxs)(Z5.Fragment,{children:[(0,jh.jsx)("h3",{children:h}),f[h].map(m=>{let g=m.name in i;return(0,jh.jsx)(X5.ToggleControl,{checked:g,label:m.title,onChange:()=>{if(!g){let b=m.blockHooks[e];p((0,Q5.createBlock)(m.name),b);return}d(i[m.name],!1)}},m.title)})]},h))]})})}var YPe={edit:Oet,attributeKeys:["metadata"],hasSupport(){return!0}};var lY=c(G(),1),qPe=c(ue(),1),Sx=c(U(),1),ZPe=c(Q(),1),XPe=c(F(),1),QPe=c(fe(),1);var Hh=c(E(),1),Aet=()=>(0,QPe.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}},Let=({name:e,metadata:t})=>{let o=(0,XPe.useContext)(_n),{removeAllBlockBindings:r}=yd(),n=Aet(),{bindableAttributes:i,hasCompatibleFields:s}=(0,ZPe.useSelect)(l=>{let{__experimentalBlockBindingsSupportedAttributes:u}=l(C).getSettings(),{getAllBlockBindingsSources:d,getBlockBindingsSourceFieldsList:f}=H(l(qPe.store));return{bindableAttributes:u?.[e],hasCompatibleFields:Object.values(d()).some(p=>f(p,o)?.length>0)}},[e,o]);if(!i||i.length===0)return null;let{bindings:a}=t||{};return a===void 0&&!s?null:(0,Hh.jsx)(Oe,{group:"bindings",children:(0,Hh.jsxs)(Sx.__experimentalToolsPanel,{label:(0,lY.__)("Attributes"),resetAll:()=>{r()},dropdownMenuProps:n,className:"block-editor-bindings__panel",children:[(0,Hh.jsx)(Sx.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:i.map(l=>(0,Hh.jsx)(Hw,{attribute:l,blockName:e,binding:a?.[l]},l))}),(0,Hh.jsx)(Sx.__experimentalText,{as:"div",variant:"muted",children:(0,Hh.jsx)("p",{children:(0,lY.__)("Attributes connected to custom fields or other dynamic data.")})})]})})},JPe={edit:Let,attributeKeys:["metadata"],hasSupport(e){return!["core/post-date","core/navigation-link","core/navigation-submenu"].includes(e)}};var eIe=c(G(),1),tIe=c(U(),1),tF=c(Q(),1),oF=c(ue(),1),oIe=c(F(),1);var J5=c(Q(),1);function eF(e){let{isOpened:t,expandRevision:o}=(0,J5.useSelect)(i=>{let{isListViewPanelOpened:s,getListViewExpandRevision:a}=H(i(C));return{isOpened:s(e),expandRevision:a()}},[e]),{__unstableToggleListViewPanel:r}=(0,J5.useDispatch)(C);return{isOpened:t,expandRevision:o,handleToggle:i=>{r(e,i)}}}var kx=c(E(),1),Met="listView";function Net(e){return(0,oF.hasBlockSupport)(e,Met)}function Det({clientId:e,name:t}){let{isSelectionWithinCurrentSection:o}=(0,oIe.useContext)(Fn),{isOpened:r,expandRevision:n,handleToggle:i}=eF(e),{openListViewContentPanel:s}=H((0,tF.useDispatch)(C)),{isEnabled:a,hasChildren:l,isNestedListView:u}=(0,tF.useSelect)(h=>{let{getBlockCount:m,getBlockParents:g,shouldRenderBlockListView:b}=H(h(C)),y=g(e,!1).find(k=>b(k));return{isEnabled:b(e),hasChildren:!!m(e),isNestedListView:y}},[e]),f=(0,oF.getBlockType)(t)?.title||t;return!a||u?null:(0,kx.jsx)(Tb,{group:"list",children:(0,kx.jsxs)(tIe.PanelBody,{title:o?f:void 0,opened:r,onToggle:i,children:[!l&&(0,kx.jsx)("p",{className:"block-editor-block-inspector__no-blocks",children:(0,eIe.__)("No items yet.")}),(0,kx.jsx)(kE,{rootClientId:e,isExpanded:!0,description:f,showAppender:!0,onSelect:s},`${e}-${n}`)]})})}var rIe={edit:Det,hasSupport:Net,attributeKeys:[],supportsPatternEditing:!0};var nIe=c(go(),1),iIe=c(ue(),1);function Vet(e){return e.__experimentalLabel||(0,iIe.hasBlockSupport)(e,"renaming",!0)&&(e.__experimentalLabel=(o,{context:r})=>{let{metadata:n}=o;if((r==="list-view"||r==="breadcrumb")&&n?.name)return n.name}),e}(0,nIe.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",Vet);var sIe=c(fe(),1),aIe=c(go(),1),cY=c(Q(),1);var Ol=c(E(),1);function Fet(e){rY(e)}function zet({clientId:e,layout:t}){let{isVisible:o,blockVisibility:r,deviceType:n,viewportSettings:i}=(0,cY.useSelect)(p=>{let{isBlockSelected:h,hasSelectedInnerBlock:m,isDraggingBlocks:g,getTemplateLock:b,getBlockEditingMode:v,getBlockAttributes:y,getSettings:k}=p(C);if(!g()&&!h(e)||b(e)||v(e)!=="default"||m(e))return{isVisible:!1};let S=y(e),_=k(),x=_?.[wa]?.toLowerCase()||no.desktop.key;return{isVisible:!0,blockVisibility:S?.metadata?.blockVisibility,deviceType:x,viewportSettings:_?.__experimentalFeatures?.viewport}},[e]),a=Nt(e)?.ownerDocument?.defaultView,l=a===null?void 0:a,{isBlockCurrentlyHidden:u,currentViewport:d}=Ma({blockVisibility:r,deviceType:n,view:l,viewportSettings:i}),f=(0,cY.useSelect)(p=>{if(!o)return!1;let{isBlockParentHiddenAtViewport:h}=H(p(C));return h(e,d)},[e,d,o]);return(0,Ol.jsxs)(Ol.Fragment,{children:[(0,Ol.jsx)(Fet,{clientId:e}),o&&!u&&!f&&(0,Ol.jsx)(H1,{clientId:e,parentLayout:t})]})}var jet=(0,sIe.createHigherOrderComponent)(e=>function(o){return o.attributes.layout?.type!=="grid"?(0,Ol.jsx)(e,{...o},"edit"):(0,Ol.jsxs)(Ol.Fragment,{children:[(0,Ol.jsx)(zet,{clientId:o.clientId,layout:o.attributes.layout}),(0,Ol.jsx)(e,{...o},"edit")]})},"addGridVisualizerToBlockEdit");(0,aIe.addFilter)("editor.BlockEdit","core/editor/grid-visualizer",jet);var $1=c(ue(),1),cIe=c(U(),1),uIe=c(Q(),1);var nF=c(F(),1),dIe=c(G(),1);function lIe(e){let t=[],o=[];return Object.entries(e).forEach(([r,n])=>{if(!n.autoGenerateControl)return;let i=Het(r,n);i&&(t.push(i),o.push(r))}),{fields:t,form:{fields:o}}}function Het(e,t){let o=t.type,r={id:e,label:t.label||e,type:o==="string"?"text":o};return t.enum&&Array.isArray(t.enum)&&(r.elements=t.enum.map(n=>({value:n,label:String(n)}))),r}var rF=c(E(),1);function Uet(e){return e?Object.values(e).some(t=>t?.autoGenerateControl):!1}function Get({name:e,clientId:t,setAttributes:o}){let r=Er(),n=(0,nF.useContext)(_n),i=(0,uIe.useSelect)(u=>{let d=u(C).getBlockAttributes(t);if(!d?.metadata?.bindings)return d;let{getBlockBindingsSource:f}=H(u($1.store));return Object.entries(d.metadata.bindings).reduce((p,[h,m])=>{let g=f(m.source);if(!g)return p;let b=g.getValues({select:u,context:n,bindings:{[h]:m}});return{...p,...b}},d)},[n,t]),s=(0,$1.getBlockType)(e),{fields:a,form:l}=(0,nF.useMemo)(()=>s?.attributes?lIe(s.attributes):{fields:[],form:{fields:[]}},[s?.attributes]);return r!=="default"||!a||a.length===0?null:(0,rF.jsx)(Oe,{children:(0,rF.jsx)(cIe.PanelBody,{title:(0,dIe.__)("Settings"),children:(0,rF.jsx)(I1,{data:i,fields:a,form:l,onChange:o})})})}var fIe={edit:Get,attributeKeys:[],hasSupport(e){let t=(0,$1.getBlockType)(e);return Uet(t?.attributes)}};function iF(e){let{style:t}=e,o=t?.dimensions||{},r=ga({dimensions:o});return{className:o.aspectRatio?"has-aspect-ratio":void 0,style:r}}function sF(e){let t=e.style?.border||{};return{className:p$(e)||void 0,style:ga({border:t})}}function uY(e){let{colors:t}=Ym(),o=sF(e),{borderColor:r}=e;if(r){let n=gy({colors:t,namedColor:r});o.style.borderColor=n.color}return o}function dY(e){let t=e.style?.shadow||"";return{style:ga({shadow:t})}}var fY=c(F(),1);function aF(e){let{backgroundColor:t,textColor:o,gradient:r,style:n}=e,i=xa("background-color",t),s=xa("color",o),a=gv(r),l=a||n?.color?.gradient,u=K(s,a,{[i]:!l&&!!i,"has-text-color":o||n?.color?.text,"has-background":t||n?.color?.background||r||n?.color?.gradient,"has-link-color":n?.elements?.link?.color}),d=n?.color||{},f=ga({color:d});return{className:u||void 0,style:f}}function pY(e){let{backgroundColor:t,textColor:o,gradient:r}=e,[n,i,s,a,l,u]=Le("color.palette.custom","color.palette.theme","color.palette.default","color.gradients.custom","color.gradients.theme","color.gradients.default"),d=(0,fY.useMemo)(()=>[...n||[],...i||[],...s||[]],[n,i,s]),f=(0,fY.useMemo)(()=>[...a||[],...l||[],...u||[]],[a,l,u]),p=aF(e);if(t){let h=jc(d,t);p.style.backgroundColor=h.color}if(r&&(p.style.background=KB(f,r)),o){let h=jc(d,o);p.style.color=h.color}return p}function mY(e){let{style:t}=e,o=t?.spacing||{};return{style:ga({spacing:o})}}var pIe=c(U(),1);var{kebabCase:Wet}=H(pIe.privateApis);function hY(e,t){let o=e?.style?.typography||{};o={...o,fontSize:ld({size:e?.style?.typography?.fontSize},t)};let r=ga({typography:o}),n=e?.fontFamily?`has-${Wet(e.fontFamily)}-font-family`:"",i=e?.style?.typography?.textAlign?`has-text-align-${e?.style?.typography?.textAlign}`:"";return{className:K(n,i,yp(e?.fontSize)),style:r}}var lF=c(F(),1);function gY(e){let[t,o]=(0,lF.useState)(e);return(0,lF.useEffect)(()=>{e&&o(e)},[e]),t}S1e([kV,nV,nK,VK,N5,z5,YK,sV,C9,LPe,YPe,JPe,nY,H1e,oPe,rIe,fIe].filter(Boolean));k1e([kV,nV,cEe,N5,v$,fPe,YK,_$,w$,sV,m$,z5,C9,$Ce,nY]);_1e([kV,nV,nK,W1e,VK,m$,z5,sV,v$,N5,_$,w$]);var mIe={button:"wp-element-button",caption:"wp-element-caption"},$et=e=>mIe[e]?mIe[e]:"";var hIe=()=>"";var _x=c(F(),1),K1=c(ue(),1),yY=c(Ko(),1);var gIe=c(E(),1);function vY(e,t,o){if(e==null||e===!1)return;if(Array.isArray(e))return bY(e,t,o);switch(typeof e){case"string":case"number":return}let{type:r,props:n}=e;switch(r){case _x.StrictMode:case _x.Fragment:return bY(n.children,t,o);case _x.RawHTML:return;case $C.Content:return bIe(t,o);case jE:t.push(n.value);return}switch(typeof r){case"string":return typeof n.children<"u"?bY(n.children,t,o):void 0;case"function":let i=r.prototype&&typeof r.prototype.render=="function"?new r(n).render():r(n);return vY(i,t,o)}}function bY(e,...t){e=Array.isArray(e)?e:[e];for(let o=0;oo instanceof yY.RichTextData?o:yY.RichTextData.fromHTMLString(o))}var vIe=c(U(),1);var SY=c(E(),1);function SIe({clientId:e,resizableBoxProps:t,...o}){return(0,SY.jsx)(Xa,{clientId:e,__unstablePopoverSlot:"block-toolbar",...o,children:(0,SY.jsx)(vIe.ResizableBox,{...t})})}var q1=c(F(),1),cF=c(Q(),1),Vc=c(U(),1),Y1=c(G(),1);var Al=c(E(),1);function kIe({rules:e}){let[t,o]=(0,q1.useState)(!1),{clientIds:r,selectPrevious:n,message:i}=(0,cF.useSelect)(m=>H(m(C)).getRemovalPromptData()),{clearBlockRemovalPrompt:s,setBlockRemovalRules:a,privateRemoveBlocks:l}=H((0,cF.useDispatch)(C));if((0,q1.useEffect)(()=>(a(e),()=>{a()}),[e,a]),(0,q1.useEffect)(()=>{o(!1)},[r]),!i)return;let u=typeof i=="object"&&i!==null,d=u?i.description:i,f=u&&i.requireConfirmation,p=f&&!t,h=()=>{l(r,n,!0),s()};return(0,Al.jsx)(Vc.Modal,{title:(0,Y1.__)("Confirm deletion"),onRequestClose:s,size:"medium",children:(0,Al.jsxs)(Vc.__experimentalVStack,{spacing:4,children:[(0,Al.jsxs)("div",{children:[(0,Al.jsx)("p",{children:d}),u&&(i.warning||i.subtext)&&(0,Al.jsxs)("p",{children:[i.warning&&(0,Al.jsx)("strong",{children:i.warning}),i.warning&&i.subtext&&" ",i.subtext]})]}),f&&(0,Al.jsx)(Vc.CheckboxControl,{label:(0,Y1.__)("I understand the consequences"),checked:t,onChange:o}),(0,Al.jsxs)(Vc.__experimentalHStack,{justify:"right",children:[(0,Al.jsx)(Vc.Button,{variant:"tertiary",onClick:s,__next40pxDefaultSize:!0,children:(0,Y1.__)("Cancel")}),(0,Al.jsx)(Vc.Button,{variant:"primary",onClick:h,disabled:p,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,Y1.__)("Delete")})]})]})})}var kY=c(F(),1);var xx=c(U(),1),xIe=c(F(),1),Ds=c(G(),1),uF=c(E(),1),_Ie=[{value:"fill",label:(0,Ds._x)("Fill","Scale option for dimensions control"),help:(0,Ds.__)("Fill the space by stretching the content.")},{value:"contain",label:(0,Ds._x)("Contain","Scale option for dimensions control"),help:(0,Ds.__)("Fit the content to the space without clipping.")},{value:"cover",label:(0,Ds._x)("Cover","Scale option for dimensions control"),help:(0,Ds.__)("Fill the space by clipping what doesn't fit.")},{value:"none",label:(0,Ds._x)("None","Scale option for dimensions control"),help:(0,Ds.__)("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,Ds._x)("Scale down","Scale option for dimensions control"),help:(0,Ds.__)("Scale down the content to fit the space if it is too big. Content that is too small will have additional padding.")}];function wIe({panelId:e,value:t,onChange:o,options:r=_Ie,defaultValue:n=_Ie[0].value,isShownByDefault:i=!0}){let s=t??n,a=(0,xIe.useMemo)(()=>r.reduce((l,u)=>(l[u.value]=u.help,l),{}),[r]);return(0,uF.jsx)(xx.__experimentalToolsPanelItem,{label:(0,Ds._x)("Scale","Image scaling options"),isShownByDefault:i,hasValue:()=>s!==n,onDeselect:()=>o(n),panelId:e,children:(0,uF.jsx)(xx.__experimentalToggleGroupControl,{label:(0,Ds._x)("Scale","Image scaling options"),isBlock:!0,help:a[s],value:s,onChange:o,children:r.map(l=>(0,uF.jsx)(xx.__experimentalToggleGroupControlOption,{...l},l.value))})})}var wx=c(U(),1),My=c(G(),1),Gf=c(E(),1);function CIe({panelId:e,value:t={},onChange:o=()=>{},units:r,isShownByDefault:n=!0}){let i=t.width==="auto"?"":t.width??"",s=t.height==="auto"?"":t.height??"",a=l=>u=>{let d={...t};u?d[l]=u:delete d[l],o(d)};return(0,Gf.jsxs)(Gf.Fragment,{children:[(0,Gf.jsx)(wx.__experimentalToolsPanelItem,{style:{gridColumn:"span 1"},label:(0,My.__)("Width"),isShownByDefault:n,hasValue:()=>i!=="",onDeselect:a("width"),panelId:e,children:(0,Gf.jsx)(wx.__experimentalUnitControl,{label:(0,My.__)("Width"),placeholder:(0,My.__)("Auto"),labelPosition:"top",units:r,min:0,value:i,onChange:a("width")})}),(0,Gf.jsx)(wx.__experimentalToolsPanelItem,{style:{gridColumn:"span 1"},label:(0,My.__)("Height"),isShownByDefault:n,hasValue:()=>s!=="",onDeselect:a("height"),panelId:e,children:(0,Gf.jsx)(wx.__experimentalUnitControl,{label:(0,My.__)("Height"),placeholder:(0,My.__)("Auto"),labelPosition:"top",units:r,min:0,value:s,onChange:a("height")})})]})}var Uh=c(E(),1);function Ket({panelId:e,value:t={},onChange:o=()=>{},aspectRatioOptions:r,defaultAspectRatio:n="auto",scaleOptions:i,defaultScale:s="cover",unitsOptions:a,tools:l=["aspectRatio","widthHeight","scale"]}){let u=t.width===void 0||t.width==="auto"?null:t.width,d=t.height===void 0||t.height==="auto"?null:t.height,f=t.aspectRatio===void 0||t.aspectRatio==="auto"?null:t.aspectRatio,p=t.scale===void 0?null:t.scale,[h,m]=(0,kY.useState)(p),[g,b]=(0,kY.useState)(f),y=!!(u&&d)?"custom":f,k=f||u&&d;return(0,Uh.jsxs)(Uh.Fragment,{children:[l.includes("aspectRatio")&&(0,Uh.jsx)(_D,{panelId:e,options:r,defaultValue:n,value:y,onChange:S=>{let _={...t};S=S==="auto"?null:S,b(S),S?_.aspectRatio=S:delete _.aspectRatio,S?h?_.scale=h:(_.scale=s,m(s)):delete _.scale,S!=="custom"&&u&&d&&delete _.height,o(_)}}),l.includes("widthHeight")&&(0,Uh.jsx)(CIe,{panelId:e,units:a,value:{width:u,height:d},onChange:({width:S,height:_})=>{let x={...t};S=S==="auto"?null:S,_=_==="auto"?null:_,S?x.width=S:delete x.width,_?x.height=_:delete x.height,S&&_?delete x.aspectRatio:g&&(x.aspectRatio=g),!g&&!!S!=!!_?delete x.scale:h?x.scale=h:(x.scale=s,m(s)),o(x)}}),l.includes("scale")&&k&&(0,Uh.jsx)(wIe,{panelId:e,options:i,defaultValue:s,value:h,onChange:S=>{let _={...t};m(S),S?_.scale=S:delete _.scale,o(_)}})]})}var EIe=Ket;var dF=c(U(),1),Wf=c(G(),1),_Y=c(E(),1),TIe=[{label:(0,Wf._x)("Thumbnail","Image size option for resolution control"),value:"thumbnail"},{label:(0,Wf._x)("Medium","Image size option for resolution control"),value:"medium"},{label:(0,Wf._x)("Large","Image size option for resolution control"),value:"large"},{label:(0,Wf._x)("Full Size","Image size option for resolution control"),value:"full"}];function RIe({panelId:e,value:t,onChange:o,options:r=TIe,defaultValue:n=TIe[0].value,isShownByDefault:i=!0,resetAllFilter:s}){let a=t??n;return(0,_Y.jsx)(dF.__experimentalToolsPanelItem,{hasValue:()=>a!==n,label:(0,Wf.__)("Resolution"),onDeselect:()=>o(n),isShownByDefault:i,panelId:e,resetAllFilter:s,children:(0,_Y.jsx)(dF.SelectControl,{label:(0,Wf.__)("Resolution"),value:a,options:r,onChange:o,help:(0,Wf.__)("Select the size of the source image.")})})}var Ny=c(G(),1),Cx=c(U(),1),PIe=c(Q(),1);var Fc=c(G(),1),BIe={a:(0,Fc.__)("The element should be used for links that navigate to a different page or to a different section within the same page."),article:(0,Fc.__)("The
element should represent a self-contained, syndicatable portion of the document."),aside:(0,Fc.__)("The