Read more: %1$s"),t||(0,tt.__)("(no title)")),{a:(0,Je.jsx)("a",{className:"wp-block-latest-posts__read-more",href:e.link,rel:"noopener noreferrer",onClick:M}),span:(0,Je.jsx)("span",{className:"screen-reader-text"})})]}):o;return(0,Je.jsxs)("li",{children:[l&&(0,Je.jsx)("div",{className:s,children:k?(0,Je.jsx)("a",{href:e.link,rel:"noreferrer noopener",onClick:M,children:c}):c}),(0,Je.jsx)("a",{className:"wp-block-latest-posts__post-title",href:e.link,rel:"noreferrer noopener",dangerouslySetInnerHTML:t?{__html:t}:void 0,onClick:M,children:t?null:(0,tt.__)("(no title)")}),g&&n&&(0,Je.jsx)("div",{className:"wp-block-latest-posts__post-author",children:(0,tt.sprintf)((0,tt.__)("by %s"),n.name)}),m&&e.date_gmt&&(0,Je.jsx)("time",{dateTime:(0,Ir.format)("c",e.date_gmt),className:"wp-block-latest-posts__post-date",children:(0,Ir.dateI18n)(V,e.date_gmt)}),p&&"excerpt"===d&&(0,Je.jsx)("div",{className:"wp-block-latest-posts__post-excerpt",children:h}),p&&"full_post"===d&&(0,Je.jsx)("div",{className:"wp-block-latest-posts__post-full-content",dangerouslySetInnerHTML:{__html:e.content.raw.trim()}})]},e.id)}))})]})},deprecated:Ip},Hp=()=>Xe({name:Ap,metadata:Rp,settings:Lp}),Dp={A:"upper-alpha",a:"lower-alpha",I:"upper-roman",i:"lower-roman"};function Fp(e){const{values:t,start:o,reversed:n,ordered:r,type:a,...i}=e,s=document.createElement(r?"ol":"ul");s.innerHTML=t,o&&s.setAttribute("start",o),n&&s.setAttribute("reversed",!0),a&&s.setAttribute("type",a);const[l]=(0,Qe.rawHandler)({HTML:s.outerHTML});return[{...i,...l.attributes},l.innerBlocks]}const Vp={attributes:{ordered:{type:"boolean",default:!1,__experimentalRole:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",__experimentalRole:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,className:!1,typography:{fontSize:!0,__experimentalFontFamily:!0},color:{gradients:!0,link:!0},__unstablePasteTextInline:!0,__experimentalSelector:"ol,ul",__experimentalSlashInserter:!0},save({attributes:e}){const{ordered:t,values:o,type:n,reversed:r,start:a}=e,i=t?"ol":"ul";return(0,Je.jsx)(i,{...ot.useBlockProps.save({type:n,reversed:r,start:a}),children:(0,Je.jsx)(ot.RichText.Content,{value:o,multiline:"li"})})},migrate:so,isEligible:({style:e})=>e?.typography?.fontFamily},Ep={attributes:{ordered:{type:"boolean",default:!1,__experimentalRole:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",__experimentalRole:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,className:!1,typography:{fontSize:!0,__experimentalFontFamily:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},__unstablePasteTextInline:!0,__experimentalSelector:"ol,ul",__experimentalSlashInserter:!0},save({attributes:e}){const{ordered:t,values:o,type:n,reversed:r,start:a}=e,i=t?"ol":"ul";return(0,Je.jsx)(i,{...ot.useBlockProps.save({type:n,reversed:r,start:a}),children:(0,Je.jsx)(ot.RichText.Content,{value:o,multiline:"li"})})},migrate:Fp},$p={attributes:{ordered:{type:"boolean",default:!1,__experimentalRole:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",__experimentalRole:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,className:!1,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},__unstablePasteTextInline:!0,__experimentalSelector:"ol,ul",__experimentalSlashInserter:!0},isEligible:({type:e})=>!!e,save({attributes:e}){const{ordered:t,type:o,reversed:n,start:r}=e,a=t?"ol":"ul";return(0,Je.jsx)(a,{...ot.useBlockProps.save({type:o,reversed:n,start:r}),children:(0,Je.jsx)(ot.InnerBlocks.Content,{})})},migrate:function(e){const{type:t}=e;return t&&Dp[t]?{...e,type:Dp[t]}:e}},Gp={attributes:{ordered:{type:"boolean",default:!1,__experimentalRole:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",__experimentalRole:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,className:!1,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},__unstablePasteTextInline:!0,__experimentalSelector:"ol,ul",__experimentalOnMerge:"true",__experimentalSlashInserter:!0},save({attributes:e}){const{ordered:t,type:o,reversed:n,start:r}=e,a=t?"ol":"ul";return(0,Je.jsx)(a,{...ot.useBlockProps.save({reversed:n,start:r,style:{listStyleType:t&&"decimal"!==o?o:void 0}}),children:(0,Je.jsx)(ot.InnerBlocks.Content,{})})}},Op=[Gp,$p,Ep,Vp],Up=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM15.4697 14.9697L18.4393 12L15.4697 9.03033L16.5303 7.96967L20.0303 11.4697L20.5607 12L20.0303 12.5303L16.5303 16.0303L15.4697 14.9697Z"})}),qp=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-4-4.6l-4 4 4 4 1-1-3-3 3-3-1-1z"})}),Wp=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"})}),Zp=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})}),Qp=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M3.8 15.8h8.9v-1.5H3.8v1.5zm0-7h8.9V7.2H3.8v1.6zm14.7-2.1V10h1V5.3l-2.2.7.3 1 .9-.3zm1.2 6.1c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5H20v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3 0-.8-.3-1.1z"})}),Kp=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM5 6.7V10h1V5.3L3.8 6l.4 1 .8-.3zm-.4 5.7c-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-1c.3-.6.8-1.4.9-2.1.1-.3 0-.8-.2-1.1-.5-.6-1.3-.5-1.7-.4z"})}),Jp=window.wp.deprecated;var Yp=o.n(Jp);const Xp=({setAttributes:e,reversed:t,start:o,type:n})=>(0,Je.jsx)(ot.InspectorControls,{children:(0,Je.jsxs)(et.PanelBody,{title:(0,tt.__)("Settings"),children:[(0,Je.jsx)(et.TextControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Start value"),type:"number",onChange:t=>{const o=parseInt(t,10);e({start:isNaN(o)?void 0:o})},value:Number.isInteger(o)?o.toString(10):"",step:"1"}),(0,Je.jsx)(et.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Numbering style"),options:[{label:(0,tt.__)("Numbers"),value:"decimal"},{label:(0,tt.__)("Uppercase letters"),value:"upper-alpha"},{label:(0,tt.__)("Lowercase letters"),value:"lower-alpha"},{label:(0,tt.__)("Uppercase Roman numerals"),value:"upper-roman"},{label:(0,tt.__)("Lowercase Roman numerals"),value:"lower-roman"}],value:n,onChange:t=>e({type:t})}),(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Reverse list numbering"),checked:t||!1,onChange:t=>{e({reversed:t||void 0})}})]})});const em=(0,bt.forwardRef)((function(e,t){const{ordered:o,...n}=e,r=o?"ol":"ul";return(0,Je.jsx)(r,{ref:t,...n})})),tm={name:"core/list-item"},om=[["core/list-item"]];function nm({clientId:e}){const t=function(e){const{replaceBlocks:t,selectionChange:o}=(0,gt.useDispatch)(ot.store),{getBlockRootClientId:n,getBlockAttributes:r,getBlock:a}=(0,gt.useSelect)(ot.store);return(0,bt.useCallback)((()=>{const i=n(e),s=r(i),l=(0,Qe.createBlock)("core/list-item",s),{innerBlocks:c}=a(e);t([i],[l,...c]),o(c[c.length-1].clientId)}),[e])}(e),o=(0,gt.useSelect)((t=>{const{getBlockRootClientId:o,getBlockName:n}=t(ot.store);return"core/list-item"===n(o(e))}),[e]);return(0,Je.jsx)(Je.Fragment,{children:(0,Je.jsx)(et.ToolbarButton,{icon:(0,tt.isRTL)()?Up:qp,title:(0,tt.__)("Outdent"),describedBy:(0,tt.__)("Outdent list item"),disabled:!o,onClick:t})})}function rm({phrasingContentSchema:e}){const t={...e,ul:{},ol:{attributes:["type","start","reversed"]}};return["ul","ol"].forEach((e=>{t[e].children={li:{children:t}}})),t}function am(e){return e.flatMap((({name:e,attributes:t,innerBlocks:o=[]})=>"core/list-item"===e?[t.content,...am(o)]:am(o)))}const im={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph","core/heading"],transform:e=>{let t=[];if(e.length>1)t=e.map((({content:e})=>(0,Qe.createBlock)("core/list-item",{content:e})));else if(1===e.length){const o=(0,Ao.create)({html:e[0].content});t=(0,Ao.split)(o,"\n").map((e=>(0,Qe.createBlock)("core/list-item",{content:(0,Ao.toHTMLString)({value:e})})))}return(0,Qe.createBlock)("core/list",{anchor:e.anchor},t)}},{type:"raw",selector:"ol,ul",schema:e=>({ol:rm(e).ol,ul:rm(e).ul}),transform:function e(t){const o=t.getAttribute("type"),n={ordered:"OL"===t.tagName,anchor:""===t.id?void 0:t.id,start:t.getAttribute("start")?parseInt(t.getAttribute("start"),10):void 0,reversed:!!t.hasAttribute("reversed")||void 0,type:o&&Dp[o]?Dp[o]:void 0},r=Array.from(t.children).map((t=>{const o=Array.from(t.childNodes).filter((e=>e.nodeType!==e.TEXT_NODE||0!==e.textContent.trim().length));o.reverse();const[n,...r]=o;if(!("UL"===n?.tagName||"OL"===n?.tagName))return(0,Qe.createBlock)("core/list-item",{content:t.innerHTML});const a=r.map((e=>e.nodeType===e.TEXT_NODE?e.textContent:e.outerHTML));a.reverse();const i={content:a.join("").trim()},s=[e(n)];return(0,Qe.createBlock)("core/list-item",i,s)}));return(0,Qe.createBlock)("core/list",n,r)}},...["*","-"].map((e=>({type:"prefix",prefix:e,transform:e=>(0,Qe.createBlock)("core/list",{},[(0,Qe.createBlock)("core/list-item",{content:e})])}))),...["1.","1)"].map((e=>({type:"prefix",prefix:e,transform:e=>(0,Qe.createBlock)("core/list",{ordered:!0},[(0,Qe.createBlock)("core/list-item",{content:e})])})))],to:[...["core/paragraph","core/heading"].map((e=>({type:"block",blocks:[e],transform:(t,o)=>am(o).map((t=>(0,Qe.createBlock)(e,{content:t})))})))]},sm=im,lm={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/list",title:"List",category:"text",allowedBlocks:["core/list-item"],description:"Create a bulleted or numbered list.",keywords:["bullet list","ordered list","numbered list"],textdomain:"default",attributes:{ordered:{type:"boolean",default:!1,__experimentalRole:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",__experimentalRole:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,html:!1,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},__unstablePasteTextInline:!0,__experimentalOnMerge:!0,__experimentalSlashInserter:!0,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-list-editor",style:"wp-block-list"},{name:cm}=lm,um={icon:Pp,example:{innerBlocks:[{name:"core/list-item",attributes:{content:(0,tt.__)("Alice.")}},{name:"core/list-item",attributes:{content:(0,tt.__)("The White Rabbit.")}},{name:"core/list-item",attributes:{content:(0,tt.__)("The Cheshire Cat.")}},{name:"core/list-item",attributes:{content:(0,tt.__)("The Mad Hatter.")}},{name:"core/list-item",attributes:{content:(0,tt.__)("The Queen of Hearts.")}}]},transforms:sm,edit:function({attributes:e,setAttributes:t,clientId:o,style:n}){const{ordered:r,type:a,reversed:i,start:s}=e,l=(0,ot.useBlockProps)({style:{...bt.Platform.isNative&&n,listStyleType:r&&"decimal"!==a?a:void 0}}),c=(0,ot.useInnerBlocksProps)(l,{defaultBlock:tm,directInsert:!0,template:om,templateLock:!1,templateInsertUpdatesSelection:!0,...bt.Platform.isNative&&{marginVertical:8,marginHorizontal:8,renderAppender:!1},__experimentalCaptureToolbars:!0});!function(e,t){const o=(0,gt.useRegistry)(),{updateBlockAttributes:n,replaceInnerBlocks:r}=(0,gt.useDispatch)(ot.store);(0,bt.useEffect)((()=>{if(!e.values)return;const[a,i]=Fp(e);Yp()("Value attribute on the list block",{since:"6.0",version:"6.5",alternative:"inner blocks"}),o.batch((()=>{n(t,a),r(t,i)}))}),[e.values])}(e,o);const u=(0,Je.jsxs)(ot.BlockControls,{group:"block",children:[(0,Je.jsx)(et.ToolbarButton,{icon:(0,tt.isRTL)()?Wp:Zp,title:(0,tt.__)("Unordered"),describedBy:(0,tt.__)("Convert to unordered list"),isActive:!1===r,onClick:()=>{t({ordered:!1})}}),(0,Je.jsx)(et.ToolbarButton,{icon:(0,tt.isRTL)()?Qp:Kp,title:(0,tt.__)("Ordered"),describedBy:(0,tt.__)("Convert to ordered list"),isActive:!0===r,onClick:()=>{t({ordered:!0})}}),(0,Je.jsx)(nm,{clientId:o})]});return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(em,{ordered:r,reversed:i,start:s,...c}),u,r&&(0,Je.jsx)(Xp,{setAttributes:t,reversed:i,start:s,type:a})]})},save:function({attributes:e}){const{ordered:t,type:o,reversed:n,start:r}=e,a=t?"ol":"ul";return(0,Je.jsx)(a,{...ot.useBlockProps.save({reversed:n,start:r,style:{listStyleType:t&&"decimal"!==o?o:void 0}}),children:(0,Je.jsx)(ot.InnerBlocks.Content,{})})},deprecated:Op},dm=()=>Xe({name:cm,metadata:lm,settings:um}),pm=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M12 11v1.5h8V11h-8zm-6-1c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})}),mm=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM20.0303 9.03033L17.0607 12L20.0303 14.9697L18.9697 16.0303L15.4697 12.5303L14.9393 12L15.4697 11.4697L18.9697 7.96967L20.0303 9.03033Z"})}),gm=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-8-3.5l3 3-3 3 1 1 4-4-4-4-1 1z"})});function hm(e){const{replaceBlocks:t,selectionChange:o,multiSelect:n}=(0,gt.useDispatch)(ot.store),{getBlock:r,getPreviousBlockClientId:a,getSelectionStart:i,getSelectionEnd:s,hasMultiSelection:l,getMultiSelectedBlockClientIds:c}=(0,gt.useSelect)(ot.store);return(0,bt.useCallback)((()=>{const u=l(),d=u?c():[e],p=d.map((e=>(0,Qe.cloneBlock)(r(e)))),m=a(e),g=(0,Qe.cloneBlock)(r(m));g.innerBlocks?.length||(g.innerBlocks=[(0,Qe.createBlock)("core/list")]),g.innerBlocks[g.innerBlocks.length-1].innerBlocks.push(...p);const h=i(),x=s();return t([m,...d],[g]),u?n(p[0].clientId,p[p.length-1].clientId):o(p[0].clientId,x.attributeKey,x.clientId===h.clientId?h.offset:x.offset,x.offset),!0}),[e])}function xm(){const e=(0,gt.useRegistry)(),{moveBlocksToPosition:t,removeBlock:o,insertBlock:n,updateBlockListSettings:r}=(0,gt.useDispatch)(ot.store),{getBlockRootClientId:a,getBlockName:i,getBlockOrder:s,getBlockIndex:l,getSelectedBlockClientIds:c,getBlock:u,getBlockListSettings:d}=(0,gt.useSelect)(ot.store);return(0,bt.useCallback)(((p=c())=>{if(Array.isArray(p)||(p=[p]),!p.length)return;const m=p[0];if("core/list-item"!==i(m))return;const g=function(e){const t=a(e),o=a(t);if(o&&"core/list-item"===i(o))return o}(m);if(!g)return;const h=a(m),x=p[p.length-1],b=s(h).slice(l(x)+1);return e.batch((()=>{if(b.length){let e=s(m)[0];if(!e){const t=(0,Qe.cloneBlock)(u(h),{},[]);e=t.clientId,n(t,0,m,!1),r(e,d(h))}t(b,h,e)}if(t(p,h,a(g),l(g)+1),!s(h).length){o(h,!1)}})),!0}),[])}function bm(e,t){const o=(0,gt.useRegistry)(),{getPreviousBlockClientId:n,getNextBlockClientId:r,getBlockOrder:a,getBlockRootClientId:i,getBlockName:s}=(0,gt.useSelect)(ot.store),{mergeBlocks:l,moveBlocksToPosition:c}=(0,gt.useDispatch)(ot.store),u=xm();function d(e){const t=a(e);return t.length?d(t[t.length-1]):e}function p(e){const t=i(e),o=i(t);if(o&&"core/list-item"===s(o))return o}function m(e){const t=r(e);if(t)return t;const o=p(e);return o?m(o):void 0}function g(e){const t=a(e);return t.length?a(t[0])[0]:m(e)}return r=>{function s(e,t){o.batch((()=>{const[o]=a(t);o&&(n(t)!==e||a(e).length?c(a(o),o,i(e)):c([o],t,e)),l(e,t)}))}if(r){const o=g(e);if(!o)return void t(r);p(o)?u(o):s(e,o)}else{const o=n(e);if(p(e))u(e);else if(o){s(d(o),e)}else t(r)}}}function _m({clientId:e}){const t=hm(e),o=xm(),{canIndent:n,canOutdent:r}=(0,gt.useSelect)((t=>{const{getBlockIndex:o,getBlockRootClientId:n,getBlockName:r}=t(ot.store);return{canIndent:o(e)>0,canOutdent:"core/list-item"===r(n(n(e)))}}),[e]);return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(et.ToolbarButton,{icon:(0,tt.isRTL)()?Up:qp,title:(0,tt.__)("Outdent"),describedBy:(0,tt.__)("Outdent list item"),disabled:!r,onClick:()=>o()}),(0,Je.jsx)(et.ToolbarButton,{icon:(0,tt.isRTL)()?mm:gm,title:(0,tt.__)("Indent"),describedBy:(0,tt.__)("Indent list item"),isDisabled:!n,onClick:()=>t()})]})}const ym={to:[{type:"block",blocks:["core/paragraph"],transform:(e,t=[])=>[(0,Qe.createBlock)("core/paragraph",e),...t.map((e=>(0,Qe.cloneBlock)(e)))]}]},vm=ym,fm={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/list-item",title:"List item",category:"text",parent:["core/list"],allowedBlocks:["core/list"],description:"Create a list item.",textdomain:"default",attributes:{placeholder:{type:"string"},content:{type:"rich-text",source:"rich-text",selector:"li",__experimentalRole:"content"}},supports:{className:!1,__experimentalSelector:".wp-block-list > li",splitting:!0,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}},{name:km}=fm,wm={icon:pm,edit:function({attributes:e,setAttributes:t,clientId:o,mergeBlocks:n}){const{placeholder:r,content:a}=e,i=(0,ot.useBlockProps)(),s=(0,ot.useInnerBlocksProps)(i,{renderAppender:!1,__unstableDisableDropZone:!0}),l=function(e){const{replaceBlocks:t,selectionChange:o}=(0,gt.useDispatch)(ot.store),{getBlock:n,getBlockRootClientId:r,getBlockIndex:a,getBlockName:i}=(0,gt.useSelect)(ot.store),s=(0,bt.useRef)(e);s.current=e;const l=xm();return(0,Ut.useRefEffect)((e=>{function c(e){if(e.defaultPrevented||e.keyCode!==fo.ENTER)return;const{content:c,clientId:u}=s.current;if(c.length)return;if(e.preventDefault(),"core/list-item"===i(r(r(s.current.clientId))))return void l();const d=n(r(u)),p=a(u),m=(0,Qe.cloneBlock)({...d,innerBlocks:d.innerBlocks.slice(0,p)}),g=(0,Qe.createBlock)((0,Qe.getDefaultBlockName)()),h=[...d.innerBlocks[p].innerBlocks[0]?.innerBlocks||[],...d.innerBlocks.slice(p+1)],x=h.length?[(0,Qe.cloneBlock)({...d,innerBlocks:h})]:[];t(d.clientId,[m,g,...x],1),o(g.clientId)}return e.addEventListener("keydown",c),()=>{e.removeEventListener("keydown",c)}}),[])}({content:a,clientId:o}),c=function(e){const{getSelectionStart:t,getSelectionEnd:o,getBlockIndex:n}=(0,gt.useSelect)(ot.store),r=hm(e),a=xm();return(0,Ut.useRefEffect)((i=>{function s(i){const{keyCode:s,shiftKey:l,altKey:c,metaKey:u,ctrlKey:d}=i;if(i.defaultPrevented||s!==fo.SPACE&&s!==fo.TAB||c||u||d)return;const p=t(),m=o();0===p.offset&&0===m.offset&&(l?s===fo.TAB&&a()&&i.preventDefault():0!==n(e)&&r()&&i.preventDefault())}return i.addEventListener("keydown",s),()=>{i.removeEventListener("keydown",s)}}),[e,r])}(o),u=bm(o,n);return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)("li",{...s,children:[(0,Je.jsx)(ot.RichText,{ref:(0,Ut.useMergeRefs)([l,c]),identifier:"content",tagName:"div",onChange:e=>t({content:e}),value:a,"aria-label":(0,tt.__)("List text"),placeholder:r||(0,tt.__)("List"),onMerge:u}),s.children]}),(0,Je.jsx)(ot.BlockControls,{group:"block",children:(0,Je.jsx)(_m,{clientId:o})})]})},save:function({attributes:e}){return(0,Je.jsxs)("li",{...ot.useBlockProps.save(),children:[(0,Je.jsx)(ot.RichText.Content,{value:e.content}),(0,Je.jsx)(ot.InnerBlocks.Content,{})]})},merge:(e,t)=>({...e,content:e.content+t.content}),transforms:vm,[Ht(ot.privateApis).requiresWrapperOnCopy]:!0},Cm=()=>Xe({name:km,metadata:fm,settings:wm}),jm=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M11 14.5l1.1 1.1 3-3 .5-.5-.6-.6-3-3-1 1 1.7 1.7H5v1.5h7.7L11 14.5zM16.8 5h-7c-1.1 0-2 .9-2 2v1.5h1.5V7c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v10c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5v-1.5H7.8V17c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2z"})});const Sm={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/loginout",title:"Login/out",category:"theme",description:"Show login & logout links.",keywords:["login","logout","form"],textdomain:"default",attributes:{displayLoginAsForm:{type:"boolean",default:!1},redirectToCurrent:{type:"boolean",default:!0}},supports:{className:!0,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}},{name:Bm}=Sm,Nm={icon:jm,edit:function({attributes:e,setAttributes:t}){const{displayLoginAsForm:o,redirectToCurrent:n}=e;return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.InspectorControls,{children:(0,Je.jsxs)(et.PanelBody,{title:(0,tt.__)("Settings"),children:[(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Display login as form"),checked:o,onChange:()=>t({displayLoginAsForm:!o})}),(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Redirect to current URL"),checked:n,onChange:()=>t({redirectToCurrent:!n})})]})}),(0,Je.jsx)("div",{...(0,ot.useBlockProps)({className:"logged-in"}),children:(0,Je.jsx)("a",{href:"#login-pseudo-link",children:(0,tt.__)("Log out")})})]})}},Tm=()=>Xe({name:Bm,metadata:Sm,settings:Nm}),Im=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M3 6v11.5h8V6H3Zm11 3h7V7.5h-7V9Zm7 3.5h-7V11h7v1.5ZM14 16h7v-1.5h-7V16Z"})}),Pm="full",Mm="media",zm="attachment",Rm=[["core/paragraph",{placeholder:(0,tt._x)("Content…","content placeholder")}]],Am=(e,t)=>e?{backgroundImage:`url(${e})`,backgroundPosition:t?`${100*t.x}% ${100*t.y}%`:"50% 50%"}:{},Lm=50,Hm=()=>{},Dm=e=>{if(!e.customBackgroundColor)return e;const t={color:{background:e.customBackgroundColor}},{customBackgroundColor:o,...n}=e;return{...n,style:t}},Fm=e=>e.align?e:{...e,align:"wide"},Vm={align:{type:"string",default:"wide"},mediaAlt:{type:"string",source:"attribute",selector:"figure img",attribute:"alt",default:""},mediaPosition:{type:"string",default:"left"},mediaId:{type:"number"},mediaType:{type:"string"},mediaWidth:{type:"number",default:50},isStackedOnMobile:{type:"boolean",default:!1}},Em={...Vm,isStackedOnMobile:{type:"boolean",default:!0},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src"},mediaLink:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure a",attribute:"target"},href:{type:"string",source:"attribute",selector:"figure a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure a",attribute:"class"},mediaSizeSlug:{type:"string"},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"}},$m={anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,link:!0}},Gm={attributes:{...Em,mediaAlt:{type:"string",source:"attribute",selector:"figure img",attribute:"alt",default:"",__experimentalRole:"content"},mediaId:{type:"number",__experimentalRole:"content"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src",__experimentalRole:"content"},href:{type:"string",source:"attribute",selector:"figure a",attribute:"href",__experimentalRole:"content"},mediaType:{type:"string",__experimentalRole:"content"}},supports:{...$m,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}}},save({attributes:e}){const{isStackedOnMobile:t,mediaAlt:o,mediaPosition:n,mediaType:r,mediaUrl:a,mediaWidth:i,mediaId:s,verticalAlignment:l,imageFill:c,focalPoint:u,linkClass:d,href:p,linkTarget:m,rel:g}=e,h=e.mediaSizeSlug||Pm,x=g||void 0,b=dt({[`wp-image-${s}`]:s&&"image"===r,[`size-${h}`]:s&&"image"===r});let _=(0,Je.jsx)("img",{src:a,alt:o,className:b||null});p&&(_=(0,Je.jsx)("a",{className:d,href:p,target:m,rel:x,children:_}));const y={image:()=>_,video:()=>(0,Je.jsx)("video",{controls:!0,src:a})},v=dt({"has-media-on-the-right":"right"===n,"is-stacked-on-mobile":t,[`is-vertically-aligned-${l}`]:l,"is-image-fill":c}),f=c?((e,t)=>e?{backgroundImage:`url(${e})`,backgroundPosition:t?`${Math.round(100*t.x)}% ${Math.round(100*t.y)}%`:"50% 50%"}:{})(a,u):{};let k;i!==Lm&&(k="right"===n?`auto ${i}%`:`${i}% auto`);const w={gridTemplateColumns:k};return"right"===n?(0,Je.jsxs)("div",{...ot.useBlockProps.save({className:v,style:w}),children:[(0,Je.jsx)("div",{...ot.useInnerBlocksProps.save({className:"wp-block-media-text__content"})}),(0,Je.jsx)("figure",{className:"wp-block-media-text__media",style:f,children:(y[r]||Hm)()})]}):(0,Je.jsxs)("div",{...ot.useBlockProps.save({className:v,style:w}),children:[(0,Je.jsx)("figure",{className:"wp-block-media-text__media",style:f,children:(y[r]||Hm)()}),(0,Je.jsx)("div",{...ot.useInnerBlocksProps.save({className:"wp-block-media-text__content"})})]})},migrate:Fm,isEligible(e,t,{block:o}){const{attributes:n}=o;return void 0===e.align&&!!n.className?.includes("alignwide")}},Om={attributes:Em,supports:$m,save({attributes:e}){const{isStackedOnMobile:t,mediaAlt:o,mediaPosition:n,mediaType:r,mediaUrl:a,mediaWidth:i,mediaId:s,verticalAlignment:l,imageFill:c,focalPoint:u,linkClass:d,href:p,linkTarget:m,rel:g}=e,h=e.mediaSizeSlug||Pm,x=g||void 0,b=dt({[`wp-image-${s}`]:s&&"image"===r,[`size-${h}`]:s&&"image"===r});let _=(0,Je.jsx)("img",{src:a,alt:o,className:b||null});p&&(_=(0,Je.jsx)("a",{className:d,href:p,target:m,rel:x,children:_}));const y={image:()=>_,video:()=>(0,Je.jsx)("video",{controls:!0,src:a})},v=dt({"has-media-on-the-right":"right"===n,"is-stacked-on-mobile":t,[`is-vertically-aligned-${l}`]:l,"is-image-fill":c}),f=c?Am(a,u):{};let k;i!==Lm&&(k="right"===n?`auto ${i}%`:`${i}% auto`);const w={gridTemplateColumns:k};return"right"===n?(0,Je.jsxs)("div",{...ot.useBlockProps.save({className:v,style:w}),children:[(0,Je.jsx)("div",{...ot.useInnerBlocksProps.save({className:"wp-block-media-text__content"})}),(0,Je.jsx)("figure",{className:"wp-block-media-text__media",style:f,children:(y[r]||Hm)()})]}):(0,Je.jsxs)("div",{...ot.useBlockProps.save({className:v,style:w}),children:[(0,Je.jsx)("figure",{className:"wp-block-media-text__media",style:f,children:(y[r]||Hm)()}),(0,Je.jsx)("div",{...ot.useInnerBlocksProps.save({className:"wp-block-media-text__content"})})]})},migrate:Fm},Um={attributes:Em,supports:$m,save({attributes:e}){const{isStackedOnMobile:t,mediaAlt:o,mediaPosition:n,mediaType:r,mediaUrl:a,mediaWidth:i,mediaId:s,verticalAlignment:l,imageFill:c,focalPoint:u,linkClass:d,href:p,linkTarget:m,rel:g}=e,h=e.mediaSizeSlug||Pm,x=g||void 0,b=dt({[`wp-image-${s}`]:s&&"image"===r,[`size-${h}`]:s&&"image"===r});let _=(0,Je.jsx)("img",{src:a,alt:o,className:b||null});p&&(_=(0,Je.jsx)("a",{className:d,href:p,target:m,rel:x,children:_}));const y={image:()=>_,video:()=>(0,Je.jsx)("video",{controls:!0,src:a})},v=dt({"has-media-on-the-right":"right"===n,"is-stacked-on-mobile":t,[`is-vertically-aligned-${l}`]:l,"is-image-fill":c}),f=c?Am(a,u):{};let k;i!==Lm&&(k="right"===n?`auto ${i}%`:`${i}% auto`);const w={gridTemplateColumns:k};return(0,Je.jsxs)("div",{...ot.useBlockProps.save({className:v,style:w}),children:[(0,Je.jsx)("figure",{className:"wp-block-media-text__media",style:f,children:(y[r]||Hm)()}),(0,Je.jsx)("div",{...ot.useInnerBlocksProps.save({className:"wp-block-media-text__content"})})]})},migrate:Fm},qm={attributes:{...Vm,isStackedOnMobile:{type:"boolean",default:!0},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},mediaLink:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure a",attribute:"target"},href:{type:"string",source:"attribute",selector:"figure a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure a",attribute:"class"},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"}},migrate:(0,Ut.compose)(Dm,Fm),save({attributes:e}){const{backgroundColor:t,customBackgroundColor:o,isStackedOnMobile:n,mediaAlt:r,mediaPosition:a,mediaType:i,mediaUrl:s,mediaWidth:l,mediaId:c,verticalAlignment:u,imageFill:d,focalPoint:p,linkClass:m,href:g,linkTarget:h,rel:x}=e,b=x||void 0;let _=(0,Je.jsx)("img",{src:s,alt:r,className:c&&"image"===i?`wp-image-${c}`:null});g&&(_=(0,Je.jsx)("a",{className:m,href:g,target:h,rel:b,children:_}));const y={image:()=>_,video:()=>(0,Je.jsx)("video",{controls:!0,src:s})},v=(0,ot.getColorClassName)("background-color",t),f=dt({"has-media-on-the-right":"right"===a,"has-background":v||o,[v]:v,"is-stacked-on-mobile":n,[`is-vertically-aligned-${u}`]:u,"is-image-fill":d}),k=d?Am(s,p):{};let w;l!==Lm&&(w="right"===a?`auto ${l}%`:`${l}% auto`);const C={backgroundColor:v?void 0:o,gridTemplateColumns:w};return(0,Je.jsxs)("div",{className:f,style:C,children:[(0,Je.jsx)("figure",{className:"wp-block-media-text__media",style:k,children:(y[i]||Hm)()}),(0,Je.jsx)("div",{className:"wp-block-media-text__content",children:(0,Je.jsx)(ot.InnerBlocks.Content,{})})]})}},Wm={attributes:{...Vm,backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src"},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"}},migrate:(0,Ut.compose)(Dm,Fm),save({attributes:e}){const{backgroundColor:t,customBackgroundColor:o,isStackedOnMobile:n,mediaAlt:r,mediaPosition:a,mediaType:i,mediaUrl:s,mediaWidth:l,mediaId:c,verticalAlignment:u,imageFill:d,focalPoint:p}=e,m={image:()=>(0,Je.jsx)("img",{src:s,alt:r,className:c&&"image"===i?`wp-image-${c}`:null}),video:()=>(0,Je.jsx)("video",{controls:!0,src:s})},g=(0,ot.getColorClassName)("background-color",t),h=dt({"has-media-on-the-right":"right"===a,[g]:g,"is-stacked-on-mobile":n,[`is-vertically-aligned-${u}`]:u,"is-image-fill":d}),x=d?Am(s,p):{};let b;l!==Lm&&(b="right"===a?`auto ${l}%`:`${l}% auto`);const _={backgroundColor:g?void 0:o,gridTemplateColumns:b};return(0,Je.jsxs)("div",{className:h,style:_,children:[(0,Je.jsx)("figure",{className:"wp-block-media-text__media",style:x,children:(m[i]||Hm)()}),(0,Je.jsx)("div",{className:"wp-block-media-text__content",children:(0,Je.jsx)(ot.InnerBlocks.Content,{})})]})}},Zm={attributes:{...Vm,backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src"}},migrate:Fm,save({attributes:e}){const{backgroundColor:t,customBackgroundColor:o,isStackedOnMobile:n,mediaAlt:r,mediaPosition:a,mediaType:i,mediaUrl:s,mediaWidth:l}=e,c={image:()=>(0,Je.jsx)("img",{src:s,alt:r}),video:()=>(0,Je.jsx)("video",{controls:!0,src:s})},u=(0,ot.getColorClassName)("background-color",t),d=dt({"has-media-on-the-right":"right"===a,[u]:u,"is-stacked-on-mobile":n});let p;l!==Lm&&(p="right"===a?`auto ${l}%`:`${l}% auto`);const m={backgroundColor:u?void 0:o,gridTemplateColumns:p};return(0,Je.jsxs)("div",{className:d,style:m,children:[(0,Je.jsx)("figure",{className:"wp-block-media-text__media",children:(c[i]||Hm)()}),(0,Je.jsx)("div",{className:"wp-block-media-text__content",children:(0,Je.jsx)(ot.InnerBlocks.Content,{})})]})}},Qm=[Gm,Om,Um,qm,Wm,Zm],Km=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M4 18h6V6H4v12zm9-9.5V10h7V8.5h-7zm0 7h7V14h-7v1.5z"})}),Jm=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M14 6v12h6V6h-6zM4 10h7V8.5H4V10zm0 5.5h7V14H4v1.5z"})}),Ym=(0,Je.jsxs)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Je.jsx)(Ke.Path,{d:"m7 6.5 4 2.5-4 2.5z"}),(0,Je.jsx)(Ke.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"m5 3c-1.10457 0-2 .89543-2 2v14c0 1.1046.89543 2 2 2h14c1.1046 0 2-.8954 2-2v-14c0-1.10457-.8954-2-2-2zm14 1.5h-14c-.27614 0-.5.22386-.5.5v10.7072l3.62953-2.6465c.25108-.1831.58905-.1924.84981-.0234l2.92666 1.8969 3.5712-3.4719c.2911-.2831.7545-.2831 1.0456 0l2.9772 2.8945v-9.3568c0-.27614-.2239-.5-.5-.5zm-14.5 14.5v-1.4364l4.09643-2.987 2.99567 1.9417c.2936.1903.6798.1523.9307-.0917l3.4772-3.3806 3.4772 3.3806.0228-.0234v2.5968c0 .2761-.2239.5-.5.5h-14c-.27614 0-.5-.2239-.5-.5z"})]}),Xm=["image","video"],eg=()=>{};function tg(e,t){return e?{backgroundImage:`url(${e})`,backgroundPosition:t?`${Math.round(100*t.x)}% ${Math.round(100*t.y)}%`:"50% 50%"}:{}}const og=(0,bt.forwardRef)((({isSelected:e,isStackedOnMobile:t,...o},n)=>{const r=(0,Ut.useViewportMatch)("small","<");return(0,Je.jsx)(et.ResizableBox,{ref:n,showHandle:e&&(!r||!t),...o})}));function ng({mediaId:e,mediaUrl:t,onSelectMedia:o,toggleUseFeaturedImage:n,useFeaturedImage:r,featuredImageURL:a}){return(0,Je.jsx)(ot.BlockControls,{group:"other",children:(0,Je.jsx)(ot.MediaReplaceFlow,{mediaId:e,mediaUrl:r&&a?a:t,allowedTypes:Xm,accept:"image/*,video/*",onSelect:o,onToggleFeaturedImage:n,useFeaturedImage:r})})}function rg({className:e,mediaUrl:t,onSelectMedia:o,toggleUseFeaturedImage:n}){const{createErrorNotice:r}=(0,gt.useDispatch)(Pt.store);return(0,Je.jsx)(ot.MediaPlaceholder,{icon:(0,Je.jsx)(ot.BlockIcon,{icon:Ym}),labels:{title:(0,tt.__)("Media area")},className:e,onSelect:o,accept:"image/*,video/*",onToggleFeaturedImage:n,allowedTypes:Xm,onError:e=>{r(e,{type:"snackbar"})},disableMediaButtons:t})}const ag=(0,bt.forwardRef)((function(e,t){const{className:o,commitWidthChange:n,focalPoint:r,imageFill:a,isSelected:i,isStackedOnMobile:s,mediaAlt:l,mediaId:c,mediaPosition:u,mediaType:d,mediaUrl:p,mediaWidth:m,onSelectMedia:g,onWidthChange:h,enableResize:x,toggleUseFeaturedImage:b,useFeaturedImage:_,featuredImageURL:y,featuredImageAlt:v}=e,f=!c&&(0,It.isBlobURL)(p),{toggleSelection:k}=(0,gt.useDispatch)(ot.store);if(p||y||_){const w=()=>{k(!1)},C=(e,t,o)=>{h(parseInt(o.style.width))},j=(e,t,o)=>{k(!0),n(parseInt(o.style.width))},S={right:x&&"left"===u,left:x&&"right"===u},B="image"===d&&a?tg(p||y,r):{},N={image:()=>_&&y?(0,Je.jsx)("img",{src:y,alt:v}):p&&(0,Je.jsx)("img",{src:p,alt:l}),video:()=>(0,Je.jsx)("video",{controls:!0,src:p})};return(0,Je.jsxs)(og,{as:"figure",className:dt(o,"editor-media-container__resizer",{"is-transient":f}),style:B,size:{width:m+"%"},minWidth:"10%",maxWidth:"100%",enable:S,onResizeStart:w,onResize:C,onResizeStop:j,axis:"x",isSelected:i,isStackedOnMobile:s,ref:t,children:[(0,Je.jsx)(ng,{onSelectMedia:g,mediaUrl:_&&y?y:p,mediaId:c,toggleUseFeaturedImage:b,useFeaturedImage:_}),(N[d]||eg)(),f&&(0,Je.jsx)(et.Spinner,{}),!_&&(0,Je.jsx)(rg,{...e}),!y&&_&&(0,Je.jsx)(et.Placeholder,{className:"wp-block-media-text--placeholder-image",withIllustration:!0})]})}return(0,Je.jsx)(rg,{...e})})),{ResolutionTool:ig}=Ht(ot.privateApis),sg=e=>Math.max(15,Math.min(e,85));function lg(e,t){return e?.media_details?.sizes?.[t]?.source_url}const cg=function({attributes:e,isSelected:t,setAttributes:o,context:{postId:n,postType:r}}){const{focalPoint:a,href:i,imageFill:s,isStackedOnMobile:l,linkClass:c,linkDestination:u,linkTarget:d,mediaAlt:p,mediaId:m,mediaPosition:g,mediaType:h,mediaUrl:x,mediaWidth:b,rel:_,verticalAlignment:y,allowedBlocks:v,useFeaturedImage:f}=e,k=e.mediaSizeSlug||Pm,[w]=(0,mt.useEntityProp)("postType",r,"featured_media",n),C=(0,gt.useSelect)((e=>w&&e(mt.store).getMedia(w,{context:"view"})),[w]),j=f?C?.source_url:"",S=f?C?.alt_text:"",{imageSizes:B,image:N}=(0,gt.useSelect)((e=>{const{getSettings:o}=e(ot.store);return{image:m&&t?e(mt.store).getMedia(m,{context:"view"}):null,imageSizes:o()?.imageSizes}}),[t,m]),T=(0,bt.useRef)(),I=e=>{const{style:t}=T.current.resizable,{x:o,y:n}=e;t.backgroundPosition=`${100*o}% ${100*n}%`},[P,M]=(0,bt.useState)(null),z=function({attributes:{linkDestination:e,href:t},setAttributes:o}){return n=>{if(!n||!n.url)return void o({mediaAlt:void 0,mediaId:void 0,mediaType:void 0,mediaUrl:void 0,mediaLink:void 0,href:void 0,focalPoint:void 0});let r,a;(0,It.isBlobURL)(n.url)&&(n.type=(0,It.getBlobTypeByURL)(n.url)),r=n.media_type?"image"===n.media_type?"image":"video":n.type,"image"===r&&(a=n.sizes?.large?.url||n.media_details?.sizes?.large?.source_url);let i=t;e===Mm&&(i=n.url),e===zm&&(i=n.link),o({mediaAlt:n.alt,mediaId:n.id,mediaType:r,mediaUrl:a||n.url,mediaLink:n.link||void 0,href:i,focalPoint:void 0})}}({attributes:e,setAttributes:o}),R=e=>{o({mediaWidth:sg(e)}),M(null)},A=dt({"has-media-on-the-right":"right"===g,"is-selected":t,"is-stacked-on-mobile":l,[`is-vertically-aligned-${y}`]:y,"is-image-fill":s}),L=`${P||b}%`,H="right"===g?`1fr ${L}`:`${L} 1fr`,D={gridTemplateColumns:H,msGridColumns:H},F=B.filter((({slug:e})=>lg(N,e))).map((({name:e,slug:t})=>({value:t,label:e}))),V=Zt(),E=(0,Je.jsxs)(et.__experimentalToolsPanel,{label:(0,tt.__)("Settings"),resetAll:()=>{o({isStackedOnMobile:!0,imageFill:!1,mediaAlt:"",focalPoint:void 0,mediaWidth:50,mediaSizeSlug:void 0})},dropdownMenuProps:V,children:[(0,Je.jsx)(et.__experimentalToolsPanelItem,{label:(0,tt.__)("Media width"),isShownByDefault:!0,hasValue:()=>50!==b,onDeselect:()=>o({mediaWidth:50}),children:(0,Je.jsx)(et.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,tt.__)("Media width"),value:P||b,onChange:R,min:15,max:85})}),(0,Je.jsx)(et.__experimentalToolsPanelItem,{label:(0,tt.__)("Stack on mobile"),isShownByDefault:!0,hasValue:()=>!l,onDeselect:()=>o({isStackedOnMobile:!0}),children:(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Stack on mobile"),checked:l,onChange:()=>o({isStackedOnMobile:!l})})}),"image"===h&&(0,Je.jsx)(et.__experimentalToolsPanelItem,{label:(0,tt.__)("Crop image to fill"),isShownByDefault:!0,hasValue:()=>!!s,onDeselect:()=>o({imageFill:!1}),children:(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Crop image to fill"),checked:!!s,onChange:()=>o({imageFill:!s})})}),s&&(x||j)&&"image"===h&&(0,Je.jsx)(et.__experimentalToolsPanelItem,{label:(0,tt.__)("Focal point"),isShownByDefault:!0,hasValue:()=>!!a,onDeselect:()=>o({focalPoint:void 0}),children:(0,Je.jsx)(et.FocalPointPicker,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,tt.__)("Focal point"),url:f&&j?j:x,value:a,onChange:e=>o({focalPoint:e}),onDragStart:I,onDrag:I})}),"image"===h&&x&&!f&&(0,Je.jsx)(et.__experimentalToolsPanelItem,{label:(0,tt.__)("Alternative text"),isShownByDefault:!0,hasValue:()=>!!p,onDeselect:()=>o({mediaAlt:""}),children:(0,Je.jsx)(et.TextareaControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Alternative text"),value:p,onChange:e=>{o({mediaAlt:e})},help:(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(et.ExternalLink,{href:(0,tt.__)("https://www.w3.org/WAI/tutorials/images/decision-tree/"),children:(0,tt.__)("Describe the purpose of the image.")}),(0,Je.jsx)("br",{}),(0,tt.__)("Leave empty if decorative.")]})})}),"image"===h&&!f&&(0,Je.jsx)(ig,{value:k,options:F,onChange:e=>{const t=lg(N,e);if(!t)return null;o({mediaUrl:t,mediaSizeSlug:e})}})]}),$=(0,ot.useBlockProps)({className:A,style:D}),G=(0,ot.useInnerBlocksProps)({className:"wp-block-media-text__content"},{template:Rm,allowedBlocks:v}),O=(0,ot.useBlockEditingMode)();return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.InspectorControls,{children:E}),(0,Je.jsxs)(ot.BlockControls,{group:"block",children:["default"===O&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.BlockVerticalAlignmentControl,{onChange:e=>{o({verticalAlignment:e})},value:y}),(0,Je.jsx)(et.ToolbarButton,{icon:Km,title:(0,tt.__)("Show media on left"),isActive:"left"===g,onClick:()=>o({mediaPosition:"left"})}),(0,Je.jsx)(et.ToolbarButton,{icon:Jm,title:(0,tt.__)("Show media on right"),isActive:"right"===g,onClick:()=>o({mediaPosition:"right"})})]}),"image"===h&&!f&&(0,Je.jsx)(ot.__experimentalImageURLInputUI,{url:i||"",onChangeUrl:e=>{o(e)},linkDestination:u,mediaType:h,mediaUrl:N&&N.source_url,mediaLink:N&&N.link,linkTarget:d,linkClass:c,rel:_})]}),(0,Je.jsxs)("div",{...$,children:["right"===g&&(0,Je.jsx)("div",{...G}),(0,Je.jsx)(ag,{className:"wp-block-media-text__media",onSelectMedia:z,onWidthChange:e=>{M(sg(e))},commitWidthChange:R,ref:T,enableResize:"default"===O,toggleUseFeaturedImage:()=>{o({imageFill:!1,mediaType:"image",mediaId:void 0,mediaUrl:void 0,mediaAlt:void 0,mediaLink:void 0,linkDestination:void 0,linkTarget:void 0,linkClass:void 0,rel:void 0,href:void 0,useFeaturedImage:!f})},focalPoint:a,imageFill:s,isSelected:t,isStackedOnMobile:l,mediaAlt:p,mediaId:m,mediaPosition:g,mediaType:h,mediaUrl:x,mediaWidth:b,useFeaturedImage:f,featuredImageURL:j,featuredImageAlt:S}),"right"!==g&&(0,Je.jsx)("div",{...G})]})]})},ug=()=>{};const dg={from:[{type:"block",blocks:["core/image"],transform:({alt:e,url:t,id:o,anchor:n})=>(0,Qe.createBlock)("core/media-text",{mediaAlt:e,mediaId:o,mediaUrl:t,mediaType:"image",anchor:n})},{type:"block",blocks:["core/video"],transform:({src:e,id:t,anchor:o})=>(0,Qe.createBlock)("core/media-text",{mediaId:t,mediaUrl:e,mediaType:"video",anchor:o})},{type:"block",blocks:["core/cover"],transform:({align:e,alt:t,anchor:o,backgroundType:n,customGradient:r,customOverlayColor:a,gradient:i,id:s,overlayColor:l,style:c,textColor:u,url:d},p)=>{let m={};return r?m={style:{color:{gradient:r}}}:a&&(m={style:{color:{background:a}}}),c?.color?.text&&(m.style={color:{...m.style?.color,text:c.color.text}}),(0,Qe.createBlock)("core/media-text",{align:e,anchor:o,backgroundColor:l,gradient:i,mediaAlt:t,mediaId:s,mediaType:n,mediaUrl:d,textColor:u,...m},p)}}],to:[{type:"block",blocks:["core/image"],isMatch:({mediaType:e,mediaUrl:t})=>!t||"image"===e,transform:({mediaAlt:e,mediaId:t,mediaUrl:o,anchor:n})=>(0,Qe.createBlock)("core/image",{alt:e,id:t,url:o,anchor:n})},{type:"block",blocks:["core/video"],isMatch:({mediaType:e,mediaUrl:t})=>!t||"video"===e,transform:({mediaId:e,mediaUrl:t,anchor:o})=>(0,Qe.createBlock)("core/video",{id:e,src:t,anchor:o})},{type:"block",blocks:["core/cover"],transform:({align:e,anchor:t,backgroundColor:o,focalPoint:n,gradient:r,mediaAlt:a,mediaId:i,mediaType:s,mediaUrl:l,style:c,textColor:u},d)=>{const p={};c?.color?.gradient?p.customGradient=c.color.gradient:c?.color?.background&&(p.customOverlayColor=c.color.background),c?.color?.text&&(p.style={color:{text:c.color.text}});const m={align:e,alt:a,anchor:t,backgroundType:s,dimRatio:l?50:100,focalPoint:n,gradient:r,id:i,overlayColor:o,textColor:u,url:l,...p};return(0,Qe.createBlock)("core/cover",m,d)}}]},pg=dg,mg={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/media-text",title:"Media & Text",category:"media",description:"Set media and words side-by-side for a richer layout.",keywords:["image","video"],textdomain:"default",attributes:{align:{type:"string",default:"none"},mediaAlt:{type:"string",source:"attribute",selector:"figure img",attribute:"alt",default:"",__experimentalRole:"content"},mediaPosition:{type:"string",default:"left"},mediaId:{type:"number",__experimentalRole:"content"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src",__experimentalRole:"content"},mediaLink:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure a",attribute:"target"},href:{type:"string",source:"attribute",selector:"figure a",attribute:"href",__experimentalRole:"content"},rel:{type:"string",source:"attribute",selector:"figure a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure a",attribute:"class"},mediaType:{type:"string",__experimentalRole:"content"},mediaWidth:{type:"number",default:50},mediaSizeSlug:{type:"string"},isStackedOnMobile:{type:"boolean",default:!0},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"},allowedBlocks:{type:"array"},useFeaturedImage:{type:"boolean",default:!1}},usesContext:["postId","postType"],supports:{anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,heading:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-media-text-editor",style:"wp-block-media-text"},{name:gg}=mg,hg={icon:Im,example:{viewportWidth:601,attributes:{mediaType:"image",mediaUrl:"https://s.w.org/images/core/5.3/Biologia_Centrali-Americana_-_Cantorchilus_semibadius_1902.jpg"},innerBlocks:[{name:"core/paragraph",attributes:{content:(0,tt.__)("The wren
Earns his living
Noiselessly.")}},{name:"core/paragraph",attributes:{content:(0,tt.__)("— Kobayashi Issa (一茶)")}}]},transforms:pg,edit:cg,save:function({attributes:e}){const{isStackedOnMobile:t,mediaAlt:o,mediaPosition:n,mediaType:r,mediaUrl:a,mediaWidth:i,mediaId:s,verticalAlignment:l,imageFill:c,focalPoint:u,linkClass:d,href:p,linkTarget:m,rel:g}=e,h=e.mediaSizeSlug||Pm,x=g||void 0,b=dt({[`wp-image-${s}`]:s&&"image"===r,[`size-${h}`]:s&&"image"===r});let _=a?(0,Je.jsx)("img",{src:a,alt:o,className:b||null}):null;p&&(_=(0,Je.jsx)("a",{className:d,href:p,target:m,rel:x,children:_}));const y={image:()=>_,video:()=>(0,Je.jsx)("video",{controls:!0,src:a})},v=dt({"has-media-on-the-right":"right"===n,"is-stacked-on-mobile":t,[`is-vertically-aligned-${l}`]:l,"is-image-fill":c}),f=c?tg(a,u):{};let k;50!==i&&(k="right"===n?`auto ${i}%`:`${i}% auto`);const w={gridTemplateColumns:k};return"right"===n?(0,Je.jsxs)("div",{...ot.useBlockProps.save({className:v,style:w}),children:[(0,Je.jsx)("div",{...ot.useInnerBlocksProps.save({className:"wp-block-media-text__content"})}),(0,Je.jsx)("figure",{className:"wp-block-media-text__media",style:f,children:(y[r]||ug)()})]}):(0,Je.jsxs)("div",{...ot.useBlockProps.save({className:v,style:w}),children:[(0,Je.jsx)("figure",{className:"wp-block-media-text__media",style:f,children:(y[r]||ug)()}),(0,Je.jsx)("div",{...ot.useInnerBlocksProps.save({className:"wp-block-media-text__content"})})]})},deprecated:Qm},xg=()=>Xe({name:gg,metadata:mg,settings:hg});const bg=(0,gt.withDispatch)(((e,{clientId:t,attributes:o})=>{const{replaceBlock:n}=e(ot.store);return{convertToHTML(){n(t,(0,Qe.createBlock)("core/html",{content:o.originalUndelimitedContent}))}}}))((function({attributes:e,convertToHTML:t,clientId:o}){const{originalName:n,originalUndelimitedContent:r}=e,a=!!r,{hasFreeformBlock:i,hasHTMLBlock:s}=(0,gt.useSelect)((e=>{const{canInsertBlockType:t,getBlockRootClientId:n}=e(ot.store);return{hasFreeformBlock:t("core/freeform",n(o)),hasHTMLBlock:t("core/html",n(o))}}),[o]),l=[];let c;const u=(0,Je.jsx)(et.Button,{onClick:t,variant:"primary",children:(0,tt.__)("Keep as HTML")},"convert");return!a||i||n?a&&s?(c=(0,tt.sprintf)((0,tt.__)('Your site doesn’t include support for the "%s" block. You can leave this block intact, convert its content to a Custom HTML block, or remove it entirely.'),n),l.push(u)):c=(0,tt.sprintf)((0,tt.__)('Your site doesn’t include support for the "%s" block. You can leave this block intact or remove it entirely.'),n):s?(c=(0,tt.__)("It appears you are trying to use the deprecated Classic block. You can leave this block intact, convert its content to a Custom HTML block, or remove it entirely. Alternatively, you can refresh the page to use the Classic block."),l.push(u)):c=(0,tt.__)("It appears you are trying to use the deprecated Classic block. You can leave this block intact, or remove it entirely. Alternatively, you can refresh the page to use the Classic block."),(0,Je.jsxs)("div",{...(0,ot.useBlockProps)({className:"has-warning"}),children:[(0,Je.jsx)(ot.Warning,{actions:l,children:c}),(0,Je.jsx)(bt.RawHTML,{children:(0,sc.safeHTML)(r)})]})})),_g=bg;const yg={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/missing",title:"Unsupported",category:"text",description:"Your site doesn’t include support for this block.",textdomain:"default",attributes:{originalName:{type:"string"},originalUndelimitedContent:{type:"string"},originalContent:{type:"string",source:"raw"}},supports:{className:!1,customClassName:!1,inserter:!1,html:!1,reusable:!1,interactivity:{clientNavigation:!0}}},{name:vg}=yg,fg={name:vg,__experimentalLabel(e,{context:t}){if("accessibility"===t){const{originalName:t}=e,o=t?(0,Qe.getBlockType)(t):void 0;return o?o.settings.title||t:""}},edit:_g,save:function({attributes:e}){return(0,Je.jsx)(bt.RawHTML,{children:e.originalContent})}},kg=()=>Xe({name:vg,metadata:yg,settings:fg}),wg=(0,Je.jsx)(Ke.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ke.Path,{d:"M4 9v1.5h16V9H4zm12 5.5h4V13h-4v1.5zm-6 0h4V13h-4v1.5zm-6 0h4V13H4v1.5z"})}),Cg=(0,tt.__)("Read more");const jg={from:[{type:"raw",schema:{"wp-block":{attributes:["data-block"]}},isMatch:e=>e.dataset&&"core/more"===e.dataset.block,transform(e){const{customText:t,noTeaser:o}=e.dataset,n={};return t&&(n.customText=t),""===o&&(n.noTeaser=!0),(0,Qe.createBlock)("core/more",n)}}]},Sg={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/more",title:"More",category:"design",description:"Content before this block will be shown in the excerpt on your archives page.",keywords:["read more"],textdomain:"default",attributes:{customText:{type:"string",default:""},noTeaser:{type:"boolean",default:!1}},supports:{customClassName:!1,className:!1,html:!1,multiple:!1,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-more-editor"},{name:Bg}=Sg,Ng={icon:wg,example:{},__experimentalLabel(e,{context:t}){const o=e?.metadata?.name;return"list-view"===t&&o?o:"accessibility"===t?e.customText:void 0},transforms:jg,edit:function({attributes:{customText:e,noTeaser:t},insertBlocksAfter:o,setAttributes:n}){const r={width:`${(e||Cg).length+1.2}em`};return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.InspectorControls,{children:(0,Je.jsx)(et.PanelBody,{children:(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Hide the excerpt on the full content page"),checked:!!t,onChange:()=>n({noTeaser:!t}),help:e=>e?(0,tt.__)("The excerpt is hidden."):(0,tt.__)("The excerpt is visible.")})})}),(0,Je.jsx)("div",{...(0,ot.useBlockProps)(),children:(0,Je.jsx)("input",{"aria-label":(0,tt.__)("“Read more” link text"),type:"text",value:e,placeholder:Cg,onChange:e=>{n({customText:e.target.value})},onKeyDown:({keyCode:e})=>{e===fo.ENTER&&o([(0,Qe.createBlock)((0,Qe.getDefaultBlockName)())])},style:r})})]})},save:function({attributes:{customText:e,noTeaser:t}}){const o=e?`\x3c!--more ${e}--\x3e`:"\x3c!--more--\x3e",n=t?"\x3c!--noteaser--\x3e":"";return(0,Je.jsx)(bt.RawHTML,{children:[o,n].filter(Boolean).join("\n")})}},Tg=()=>Xe({name:Bg,metadata:Sg,settings:Ng}),Ig=(0,Je.jsx)(Ke.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ke.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"})}),Pg=window.wp.a11y;const Mg=(0,bt.forwardRef)((function({icon:e,size:t=24,...o},n){return(0,bt.cloneElement)(e,{width:t,height:t,...o,ref:n})})),zg=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})}),Rg={name:"core/navigation-link"},Ag=["core/navigation-link/page","core/navigation-link"],Lg={per_page:100,status:["publish","draft"],order:"desc",orderby:"date"},Hg=["postType","wp_navigation",Lg];function Dg(e){const t=(0,mt.useResourcePermissions)("navigation",e),{navigationMenu:o,isNavigationMenuResolved:n,isNavigationMenuMissing:r}=(0,gt.useSelect)((t=>function(e,t){if(!t)return{isNavigationMenuResolved:!1,isNavigationMenuMissing:!0};const{getEntityRecord:o,getEditedEntityRecord:n,hasFinishedResolution:r}=e(mt.store),a=["postType","wp_navigation",t],i=o(...a),s=n(...a),l=r("getEditedEntityRecord",a),c="publish"===s.status||"draft"===s.status;return{isNavigationMenuResolved:l,isNavigationMenuMissing:l&&(!i||!c),navigationMenu:c?s:null}}(t,e)),[e]),{canCreate:a,canUpdate:i,canDelete:s,isResolving:l,hasResolved:c}=t,{records:u,isResolving:d,hasResolved:p}=(0,mt.useEntityRecords)("postType","wp_navigation",Lg);return{navigationMenu:o,isNavigationMenuResolved:n,isNavigationMenuMissing:r,navigationMenus:u,isResolvingNavigationMenus:d,hasResolvedNavigationMenus:p,canSwitchNavigationMenu:e?u?.length>1:u?.length>0,canUserCreateNavigationMenus:a,isResolvingCanUserCreateNavigationMenus:l,hasResolvedCanUserCreateNavigationMenus:c,canUserUpdateNavigationMenu:i,hasResolvedCanUserUpdateNavigationMenu:e?c:void 0,canUserDeleteNavigationMenu:s,hasResolvedCanUserDeleteNavigationMenu:e?c:void 0}}function Fg(e){const{records:t,isResolving:o,hasResolved:n}=(0,mt.useEntityRecords)("root","menu",{per_page:-1,context:"view"}),{records:r,isResolving:a,hasResolved:i}=(0,mt.useEntityRecords)("postType","page",{parent:0,order:"asc",orderby:"id",per_page:-1,context:"view"}),{records:s,hasResolved:l}=(0,mt.useEntityRecords)("root","menuItem",{menus:e,per_page:-1,context:"view"},{enabled:!!e});return{pages:r,isResolvingPages:a,hasResolvedPages:i,hasPages:!(!i||!r?.length),menus:t,isResolvingMenus:o,hasResolvedMenus:n,hasMenus:!(!n||!t?.length),menuItems:s,hasResolvedMenuItems:l}}const Vg=({isVisible:e=!0})=>(0,Je.jsx)("div",{"aria-hidden":!e||void 0,className:"wp-block-navigation-placeholder__preview",children:(0,Je.jsxs)("div",{className:"wp-block-navigation-placeholder__actions__indicator",children:[(0,Je.jsx)(Mg,{icon:Ig}),(0,tt.__)("Navigation")]})}),Eg=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});const $g=function({currentMenuId:e,onSelectNavigationMenu:t,onSelectClassicMenu:o,onCreateNew:n,actionLabel:r,createNavigationMenuIsSuccess:a,createNavigationMenuIsError:i}){const s=(0,tt.__)("Create from '%s'"),[l,c]=(0,bt.useState)(!1);r=r||s;const{menus:u}=Fg(),{navigationMenus:d,isResolvingNavigationMenus:p,hasResolvedNavigationMenus:m,canUserCreateNavigationMenus:g,canSwitchNavigationMenu:h}=Dg(),[x]=(0,mt.useEntityProp)("postType","wp_navigation","title"),b=(0,bt.useMemo)((()=>d?.map((({id:e,title:t,status:o},n)=>{const a=function(e,t,o){return e?"publish"===o?(0,Xo.decodeEntities)(e):(0,tt.sprintf)((0,tt.__)("%1$s (%2$s)"),(0,Xo.decodeEntities)(e),o):(0,tt.sprintf)((0,tt.__)("(no title %s)"),t)}(t?.rendered,n+1,o);return{value:e,label:a,ariaLabel:(0,tt.sprintf)(r,a),disabled:l||p||!m}}))||[]),[d,r,p,m,l]),_=!!d?.length,y=!!u?.length,v=!!h,f=!!g,k=_&&!e,w=!_&&m,C=m&&null===e;let j="";j=p?(0,tt.__)("Loading…"):k||w||C?(0,tt.__)("Choose or create a Navigation Menu"):x,(0,bt.useEffect)((()=>{l&&(a||i)&&c(!1)}),[m,a,g,i,l,C,w,k]);const S=(0,Je.jsx)(et.DropdownMenu,{label:j,icon:Eg,toggleProps:{size:"small"},children:({onClose:r})=>(0,Je.jsxs)(Je.Fragment,{children:[v&&_&&(0,Je.jsx)(et.MenuGroup,{label:(0,tt.__)("Menus"),children:(0,Je.jsx)(et.MenuItemsChoice,{value:e,onSelect:e=>{t(e),r()},choices:b})}),f&&y&&(0,Je.jsx)(et.MenuGroup,{label:(0,tt.__)("Import Classic Menus"),children:u?.map((e=>{const t=(0,Xo.decodeEntities)(e.name);return(0,Je.jsx)(et.MenuItem,{onClick:async()=>{c(!0),await o(e),c(!1),r()},"aria-label":(0,tt.sprintf)(s,t),disabled:l||p||!m,children:t},e.id)}))}),g&&(0,Je.jsx)(et.MenuGroup,{label:(0,tt.__)("Tools"),children:(0,Je.jsx)(et.MenuItem,{onClick:async()=>{c(!0),await n(),c(!1),r()},disabled:l||p||!m,children:(0,tt.__)("Create new Menu")})})]})});return S};function Gg({isSelected:e,currentMenuId:t,clientId:o,canUserCreateNavigationMenus:n=!1,isResolvingCanUserCreateNavigationMenus:r,onSelectNavigationMenu:a,onSelectClassicMenu:i,onCreateEmpty:s}){const{isResolvingMenus:l,hasResolvedMenus:c}=Fg();(0,bt.useEffect)((()=>{e&&(l&&(0,Pg.speak)((0,tt.__)("Loading navigation block setup options…")),c&&(0,Pg.speak)((0,tt.__)("Navigation block setup options ready.")))}),[c,l,e]);const u=l&&r;return(0,Je.jsx)(Je.Fragment,{children:(0,Je.jsxs)(et.Placeholder,{className:"wp-block-navigation-placeholder",children:[(0,Je.jsx)(Vg,{isVisible:!e}),(0,Je.jsx)("div",{"aria-hidden":!e||void 0,className:"wp-block-navigation-placeholder__controls",children:(0,Je.jsxs)("div",{className:"wp-block-navigation-placeholder__actions",children:[(0,Je.jsxs)("div",{className:"wp-block-navigation-placeholder__actions__indicator",children:[(0,Je.jsx)(Mg,{icon:Ig})," ",(0,tt.__)("Navigation")]}),(0,Je.jsx)("hr",{}),u&&(0,Je.jsx)(et.Spinner,{}),(0,Je.jsx)($g,{currentMenuId:t,clientId:o,onSelectNavigationMenu:a,onSelectClassicMenu:i}),(0,Je.jsx)("hr",{}),n&&(0,Je.jsx)(et.Button,{variant:"tertiary",onClick:s,children:(0,tt.__)("Start empty")})]})})]})})}const Og=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z"})});function Ug({icon:e}){return"menu"===e?(0,Je.jsx)(Mg,{icon:Og}):(0,Je.jsxs)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",children:[(0,Je.jsx)(Ke.Rect,{x:"4",y:"7.5",width:"16",height:"1.5"}),(0,Je.jsx)(Ke.Rect,{x:"4",y:"15",width:"16",height:"1.5"})]})}function qg({children:e,id:t,isOpen:o,isResponsive:n,onToggle:r,isHiddenByDefault:a,overlayBackgroundColor:i,overlayTextColor:s,hasIcon:l,icon:c}){if(!n)return e;const u=dt("wp-block-navigation__responsive-container",{"has-text-color":!!s.color||!!s?.class,[(0,ot.getColorClassName)("color",s?.slug)]:!!s?.slug,"has-background":!!i.color||i?.class,[(0,ot.getColorClassName)("background-color",i?.slug)]:!!i?.slug,"is-menu-open":o,"hidden-by-default":a}),d={color:!s?.slug&&s?.color,backgroundColor:!i?.slug&&i?.color&&i.color},p=dt("wp-block-navigation__responsive-container-open",{"always-shown":a}),m=`${t}-modal`,g={className:"wp-block-navigation__responsive-dialog",...o&&{role:"dialog","aria-modal":!0,"aria-label":(0,tt.__)("Menu")}};return(0,Je.jsxs)(Je.Fragment,{children:[!o&&(0,Je.jsxs)(et.Button,{"aria-haspopup":"true","aria-label":l&&(0,tt.__)("Open menu"),className:p,onClick:()=>r(!0),children:[l&&(0,Je.jsx)(Ug,{icon:c}),!l&&(0,tt.__)("Menu")]}),(0,Je.jsx)("div",{className:u,style:d,id:m,children:(0,Je.jsx)("div",{className:"wp-block-navigation__responsive-close",tabIndex:"-1",children:(0,Je.jsxs)("div",{...g,children:[(0,Je.jsxs)(et.Button,{className:"wp-block-navigation__responsive-container-close","aria-label":l&&(0,tt.__)("Close menu"),onClick:()=>r(!1),children:[l&&(0,Je.jsx)(Mg,{icon:zg}),!l&&(0,tt.__)("Close")]}),(0,Je.jsx)("div",{className:"wp-block-navigation__responsive-container-content",id:`${m}-content`,children:e})]})})})]})}function Wg({clientId:e,hasCustomPlaceholder:t,orientation:o,templateLock:n}){const{isImmediateParentOfSelectedBlock:r,selectedBlockHasChildren:a,isSelected:i}=(0,gt.useSelect)((t=>{const{getBlockCount:o,hasSelectedInnerBlock:n,getSelectedBlockClientId:r}=t(ot.store),a=r();return{isImmediateParentOfSelectedBlock:n(e,!1),selectedBlockHasChildren:!!o(a),isSelected:a===e}}),[e]),[s,l,c]=(0,mt.useEntityBlockEditor)("postType","wp_navigation"),u=i||r&&!a,d=(0,bt.useMemo)((()=>(0,Je.jsx)(Vg,{})),[]),p=!t&&!!!s?.length&&!i,m=(0,ot.useInnerBlocksProps)({className:"wp-block-navigation__container"},{value:s,onInput:l,onChange:c,prioritizedInserterBlocks:Ag,defaultBlock:Rg,directInsert:!0,orientation:o,templateLock:n,renderAppender:!!(i||r&&!a||u)&&ot.InnerBlocks.ButtonBlockAppender,placeholder:p?d:void 0,__experimentalCaptureToolbars:!0,__unstableDisableLayoutClassNames:!0});return(0,Je.jsx)("div",{...m})}function Zg(){const[e,t]=(0,mt.useEntityProp)("postType","wp_navigation","title");return(0,Je.jsx)(et.TextControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Menu name"),value:e,onChange:t})}const Qg=(e,t,o)=>{if(e===t)return!0;if("object"==typeof e&&null!=e&&"object"==typeof t&&null!=t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e){if(!t.hasOwnProperty(n))return!1;if(o&&o(n,e))return!0;if(!Qg(e[n],t[n],o))return!1}return!0}return!1},Kg={};function Jg({blocks:e,createNavigationMenu:t,hasSelection:o}){const n=(0,bt.useRef)();(0,bt.useEffect)((()=>{n?.current||(n.current=e)}),[e]);const r=function(e,t){return!Qg(e,t,((e,t)=>{if("core/page-list"===t?.name&&"innerBlocks"===e)return!0}))}(n?.current,e),a=(0,bt.useContext)(et.Disabled.Context),i=(0,ot.useInnerBlocksProps)({className:"wp-block-navigation__container"},{renderAppender:!!o&&void 0,defaultBlock:Rg,directInsert:!0}),{isSaving:s,hasResolvedAllNavigationMenus:l}=(0,gt.useSelect)((e=>{if(a)return Kg;const{hasFinishedResolution:t,isSavingEntityRecord:o}=e(mt.store);return{isSaving:o("postType","wp_navigation"),hasResolvedAllNavigationMenus:t("getEntityRecords",Hg)}}),[a]);(0,bt.useEffect)((()=>{!a&&!s&&l&&o&&r&&t(null,e)}),[e,t,a,s,l,r,o]);const c=s?et.Disabled:"div";return(0,Je.jsx)(c,{...i})}function Yg({onDelete:e}){const[t,o]=(0,bt.useState)(!1),n=(0,mt.useEntityId)("postType","wp_navigation"),{deleteEntityRecord:r}=(0,gt.useDispatch)(mt.store);return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(et.Button,{className:"wp-block-navigation-delete-menu-button",variant:"secondary",isDestructive:!0,onClick:()=>{o(!0)},children:(0,tt.__)("Delete menu")}),t&&(0,Je.jsx)(et.__experimentalConfirmDialog,{isOpen:!0,onConfirm:()=>{r("postType","wp_navigation",n,{force:!0}),e()},onCancel:()=>{o(!1)},confirmButtonText:(0,tt.__)("Delete"),children:(0,tt.__)("Are you sure you want to delete this Navigation Menu?")})]})}const Xg=function({name:e,message:t=""}={}){const o=(0,bt.useRef)(),{createWarningNotice:n,removeNotice:r}=(0,gt.useDispatch)(Pt.store);return[(0,bt.useCallback)((r=>{o.current||(o.current=e,n(r||t,{id:o.current,type:"snackbar"}))}),[o,n,t,e]),(0,bt.useCallback)((()=>{o.current&&(r(o.current),o.current=null)}),[o,r])]};function eh({setAttributes:e,hasIcon:t,icon:o}){return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Show icon button"),help:(0,tt.__)("Configure the visual appearance of the button that toggles the overlay menu."),onChange:t=>e({hasIcon:t}),checked:t}),(0,Je.jsxs)(et.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Icon"),value:o,onChange:t=>e({icon:t}),isBlock:!0,children:[(0,Je.jsx)(et.__experimentalToggleGroupControlOption,{value:"handle","aria-label":(0,tt.__)("handle"),label:(0,Je.jsx)(Ug,{icon:"handle"})}),(0,Je.jsx)(et.__experimentalToggleGroupControlOption,{value:"menu","aria-label":(0,tt.__)("menu"),label:(0,Je.jsx)(Ug,{icon:"menu"})})]})]})}function th(e){if(!e)return null;const t=oh(function(e,t="id",o="parent"){const n=Object.create(null),r=[];for(const a of e)n[a[t]]={...a,children:[]},a[o]?(n[a[o]]=n[a[o]]||{},n[a[o]].children=n[a[o]].children||[],n[a[o]].children.push(n[a[t]])):r.push(n[a[t]]);return r}(e));return(0,fs.applyFilters)("blocks.navigation.__unstableMenuItemsToBlocks",t,e)}function oh(e,t=0){let o={};const n=[...e].sort(((e,t)=>e.menu_order-t.menu_order)),r=n.map((e=>{if("block"===e.type){const[t]=(0,Qe.parse)(e.content.raw);return t||(0,Qe.createBlock)("core/freeform",{content:e.content})}const n=e.children?.length?"core/navigation-submenu":"core/navigation-link",r=function({title:e,xfn:t,classes:o,attr_title:n,object:r,object_id:a,description:i,url:s,type:l,target:c},u,d){r&&"post_tag"===r&&(r="tag");return{label:e?.rendered||"",...r?.length&&{type:r},kind:l?.replace("_","-")||"custom",url:s||"",...t?.length&&t.join(" ").trim()&&{rel:t.join(" ").trim()},...o?.length&&o.join(" ").trim()&&{className:o.join(" ").trim()},...n?.length&&{title:n},...a&&"custom"!==r&&{id:a},...i?.length&&{description:i},..."_blank"===c&&{opensInNewTab:!0},..."core/navigation-submenu"===u&&{isTopLevelItem:0===d},..."core/navigation-link"===u&&{isTopLevelLink:0===d}}}(e,n,t),{innerBlocks:a=[],mapping:i={}}=e.children?.length?oh(e.children,t+1):{};o={...o,...i};const s=(0,Qe.createBlock)(n,r,a);return o[e.id]=s.clientId,s}));return{innerBlocks:r,mapping:o}}const nh="success",rh="error",ah="pending";let ih=null;const sh=function(e,{throwOnError:t=!1}={}){const o=(0,gt.useRegistry)(),{editEntityRecord:n}=(0,gt.useDispatch)(mt.store),[r,a]=(0,bt.useState)("idle"),[i,s]=(0,bt.useState)(null),l=(0,bt.useCallback)((async(t,r,a="publish")=>{let i,s;try{s=await o.resolveSelect(mt.store).getMenuItems({menus:t,per_page:-1,context:"view"})}catch(e){throw new Error((0,tt.sprintf)((0,tt.__)('Unable to fetch classic menu "%s" from API.'),r),{cause:e})}if(null===s)throw new Error((0,tt.sprintf)((0,tt.__)('Unable to fetch classic menu "%s" from API.'),r));const{innerBlocks:l}=th(s);try{i=await e(r,l,a),await n("postType","wp_navigation",i.id,{status:"publish"},{throwOnError:!0})}catch(e){throw new Error((0,tt.sprintf)((0,tt.__)('Unable to create Navigation Menu "%s".'),r),{cause:e})}return i}),[e,n,o]);return{convert:(0,bt.useCallback)((async(e,o,n)=>{if(ih!==e)return ih=e,e&&o?(a(ah),s(null),await l(e,o,n).then((e=>(a(nh),ih=null,e))).catch((e=>{if(s(e?.message),a(rh),ih=null,t)throw new Error((0,tt.sprintf)((0,tt.__)('Unable to create Navigation Menu "%s".'),o),{cause:e})}))):(s("Unable to convert menu. Missing menu details."),void a(rh))}),[l,t]),status:r,error:i}};function lh(e,t){return e&&t?e+"//"+t:null}const ch=["postType","wp_navigation",{status:"draft",per_page:-1}],uh=["postType","wp_navigation",{per_page:-1,status:"publish"}];function dh(e){const t=(0,bt.useContext)(et.Disabled.Context),o=function(e){return(0,gt.useSelect)((t=>{if(!e)return;const{getBlock:o,getBlockParentsByBlockName:n}=t(ot.store),r=n(e,"core/template-part",!0);if(!r?.length)return;const a=t("core/editor").__experimentalGetDefaultTemplatePartAreas(),{getCurrentTheme:i,getEditedEntityRecord:s}=t(mt.store);for(const e of r){const t=o(e),{theme:n=i()?.stylesheet,slug:r}=t.attributes,l=s("postType","wp_template_part",lh(n,r));if(l?.area)return a.find((e=>"uncategorized"!==e.area&&e.area===l.area))?.label}}),[e])}(t?void 0:e),n=(0,gt.useRegistry)();return(0,bt.useCallback)((async()=>{if(t)return"";const{getEntityRecords:e}=n.resolveSelect(mt.store),[r,a]=await Promise.all([e(...ch),e(...uh)]),i=o?(0,tt.sprintf)((0,tt.__)("%s navigation"),o):(0,tt.__)("Navigation"),s=[...r,...a].reduce(((e,t)=>t?.title?.raw?.startsWith(i)?e+1:e),0);return(s>0?`${i} ${s+1}`:i)||""}),[t,o,n])}const ph="success",mh="error",gh="pending",hh="idle";const xh=[];function bh(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function _h(e,t,o){if(!e)return;t(bh(e).color);let n=e,r=bh(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===r&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,r=bh(n).backgroundColor;o(r)}function yh(e,t){const{textColor:o,customTextColor:n,backgroundColor:r,customBackgroundColor:a,overlayTextColor:i,customOverlayTextColor:s,overlayBackgroundColor:l,customOverlayBackgroundColor:c,style:u}=e,d={};return t&&s?d.customTextColor=s:t&&i?d.textColor=i:n?d.customTextColor=n:o?d.textColor=o:u?.color?.text&&(d.customTextColor=u.color.text),t&&c?d.customBackgroundColor=c:t&&l?d.backgroundColor=l:a?d.customBackgroundColor=a:r?d.backgroundColor=r:u?.color?.background&&(d.customTextColor=u.color.background),d}function vh(e){return{className:dt("wp-block-navigation__submenu-container",{"has-text-color":!(!e.textColor&&!e.customTextColor),[`has-${e.textColor}-color`]:!!e.textColor,"has-background":!(!e.backgroundColor&&!e.customBackgroundColor),[`has-${e.backgroundColor}-background-color`]:!!e.backgroundColor}),style:{color:e.customTextColor,backgroundColor:e.customBackgroundColor}}}const fh=({className:e="",disabled:t,isMenuItem:o=!1})=>{let n=et.Button;return o&&(n=et.MenuItem),(0,Je.jsx)(n,{variant:"link",disabled:t,className:e,href:(0,pt.addQueryArgs)("edit.php",{post_type:"wp_navigation"}),children:(0,tt.__)("Manage menus")})};const kh=function({onCreateNew:e}){return(0,Je.jsx)(ot.Warning,{children:(0,bt.createInterpolateElement)((0,tt.__)("Navigation Menu has been deleted or is unavailable. "),{button:(0,Je.jsx)(et.Button,{onClick:e,variant:"link"})})})},wh=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M2 12c0 3.6 2.4 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.5 0-4.5-1.5-4.5-4s2-4.5 4.5-4.5h3.5V6H8c-3.6 0-6 2.4-6 6zm19.5-1h-8v1.5h8V11zm0 5h-8v1.5h8V16zm0-10h-8v1.5h8V6z"})}),Ch=(0,Je.jsx)(Ke.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ke.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})}),jh=(0,Je.jsx)(Ke.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ke.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})}),Sh={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"},Bh=["core/navigation-link","core/navigation-submenu"];function Nh({block:e,onClose:t,expandedState:o,expand:n,setInsertedBlock:r}){const{insertBlock:a,replaceBlock:i,replaceInnerBlocks:s}=(0,gt.useDispatch)(ot.store),l=e.clientId,c=!Bh.includes(e.name);return(0,Je.jsx)(et.MenuItem,{icon:wh,disabled:c,onClick:()=>{const c=(0,Qe.createBlock)("core/navigation-link");if("core/navigation-submenu"===e.name)a(c,e.innerBlocks.length,l,false);else{const t=(0,Qe.createBlock)("core/navigation-submenu",e.attributes,e.innerBlocks);i(l,t),s(t.clientId,[c],false)}r(c),o[e.clientId]||n(e.clientId),t()},children:(0,tt.__)("Add submenu link")})}function Th(e){const{block:t}=e,{clientId:o}=t,{moveBlocksDown:n,moveBlocksUp:r,removeBlocks:a}=(0,gt.useDispatch)(ot.store),i=(0,tt.sprintf)((0,tt.__)("Remove %s"),(0,ot.BlockTitle)({clientId:o,maximumLength:25})),s=(0,gt.useSelect)((e=>{const{getBlockRootClientId:t}=e(ot.store);return t(o)}),[o]);return(0,Je.jsx)(et.DropdownMenu,{icon:Eg,label:(0,tt.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:Sh,noIcons:!0,...e,children:({onClose:l})=>(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)(et.MenuGroup,{children:[(0,Je.jsx)(et.MenuItem,{icon:Ch,onClick:()=>{r([o],s),l()},children:(0,tt.__)("Move up")}),(0,Je.jsx)(et.MenuItem,{icon:jh,onClick:()=>{n([o],s),l()},children:(0,tt.__)("Move down")}),(0,Je.jsx)(Nh,{block:t,onClose:l,expanded:!0,expandedState:e.expandedState,expand:e.expand,setInsertedBlock:e.setInsertedBlock})]}),(0,Je.jsx)(et.MenuGroup,{children:(0,Je.jsx)(et.MenuItem,{onClick:()=>{a([o],!1),l()},children:i})})]})})}const Ih=window.wp.escapeHtml,Ph=(e={},t,o={})=>{const{label:n="",kind:r="",type:a=""}=o,{title:i="",url:s="",opensInNewTab:l,id:c,kind:u=r,type:d=a}=e,p=i.replace(/http(s?):\/\//gi,""),m=s.replace(/http(s?):\/\//gi,""),g=i&&i!==n&&p!==m?(0,Ih.escapeHTML)(i):n||(0,Ih.escapeHTML)(m),h="post_tag"===d?"tag":d.replace("-","_"),x=["post","page","tag","category"].indexOf(h)>-1,b=!u&&!x||"custom"===u?"custom":u;t({...s&&{url:encodeURI((0,pt.safeDecodeURI)(s))},...g&&{label:g},...void 0!==l&&{opensInNewTab:l},...c&&Number.isInteger(c)&&{id:c},...b&&{kind:b},...h&&"URL"!==h&&{type:h}})},Mh=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})}),zh=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})}),{PrivateQuickInserter:Rh}=Ht(ot.privateApis);function Ah(e,t){switch(e){case"post":case"page":return{type:"post",subtype:e};case"category":return{type:"term",subtype:"category"};case"tag":return{type:"term",subtype:"post_tag"};case"post_format":return{type:"post-format"};default:return"taxonomy"===t?{type:"term",subtype:e}:"post-type"===t?{type:"post",subtype:e}:{initialSuggestionsSearchOptions:{type:"post",subtype:"page",perPage:20}}}}function Lh({clientId:e,onBack:t,onSelectBlock:o}){const{rootBlockClientId:n}=(0,gt.useSelect)((t=>{const{getBlockRootClientId:o}=t(ot.store);return{rootBlockClientId:o(e)}}),[e]),r=(0,Ut.useFocusOnMount)("firstElement"),a=(0,Ut.useInstanceId)(ot.__experimentalLinkControl,"link-ui-block-inserter__title"),i=(0,Ut.useInstanceId)(ot.__experimentalLinkControl,"link-ui-block-inserter__description");return e?(0,Je.jsxs)("div",{className:"link-ui-block-inserter",role:"dialog","aria-labelledby":a,"aria-describedby":i,ref:r,children:[(0,Je.jsxs)(et.VisuallyHidden,{children:[(0,Je.jsx)("h2",{id:a,children:(0,tt.__)("Add block")}),(0,Je.jsx)("p",{id:i,children:(0,tt.__)("Choose a block to add to your Navigation.")})]}),(0,Je.jsx)(et.Button,{className:"link-ui-block-inserter__back",icon:Mh,onClick:e=>{e.preventDefault(),t()},size:"small",children:(0,tt.__)("Back")}),(0,Je.jsx)(Rh,{rootClientId:n,clientId:e,isAppender:!1,prioritizePatterns:!1,selectBlockOnInsert:!0,hasSearch:!1,onSelect:o})]}):null}const Hh=(0,bt.forwardRef)((function(e,t){const[o,n]=(0,bt.useState)(!1),[r,a]=(0,bt.useState)(!1),{saveEntityRecord:i}=(0,gt.useDispatch)(mt.store),s=(0,mt.useResourcePermissions)("pages"),l=(0,mt.useResourcePermissions)("posts"),{label:c,url:u,opensInNewTab:d,type:p,kind:m}=e.link;let g=!1;p&&"page"!==p?"post"===p&&(g=l.canCreate):g=s.canCreate;const h=(0,bt.useMemo)((()=>({url:u,opensInNewTab:d,title:c&&(0,sc.__unstableStripHTML)(c)})),[c,d,u]),x=(0,Ut.useInstanceId)(Hh,"link-ui-link-control__title"),b=(0,Ut.useInstanceId)(Hh,"link-ui-link-control__description"),{onClose:_}=e;return(0,Je.jsxs)(et.Popover,{ref:t,placement:"bottom",onClose:e.onClose,anchor:e.anchor,shift:!0,children:[!o&&(0,Je.jsxs)("div",{role:"dialog","aria-labelledby":x,"aria-describedby":b,children:[(0,Je.jsxs)(et.VisuallyHidden,{children:[(0,Je.jsx)("h2",{id:x,children:(0,tt.__)("Add link")}),(0,Je.jsx)("p",{id:b,children:(0,tt.__)("Search for and add a link to your Navigation.")})]}),(0,Je.jsx)(ot.__experimentalLinkControl,{hasTextControl:!0,hasRichPreviews:!0,value:h,showInitialSuggestions:!0,withCreateSuggestion:g,createSuggestion:async function(t){const o=e.link.type||"page",n=await i("postType",o,{title:t,status:"draft"});return{id:n.id,type:o,title:(0,Xo.decodeEntities)(n.title.rendered),url:n.link,kind:"post-type"}},createSuggestionButtonText:e=>{let t;return t="post"===p?(0,tt.__)("Create draft post: %s"):(0,tt.__)("Create draft page: %s"),(0,bt.createInterpolateElement)((0,tt.sprintf)(t,e),{mark:(0,Je.jsx)("mark",{})})},noDirectEntry:!!p,noURLSuggestion:!!p,suggestionsQuery:Ah(p,m),onChange:e.onChange,onRemove:e.onRemove,onCancel:e.onCancel,renderControlBottom:()=>!h?.url?.length&&(0,Je.jsx)(Dh,{focusAddBlockButton:r,setAddingBlock:()=>{n(!0),a(!1)}})})]}),o&&(0,Je.jsx)(Lh,{clientId:e.clientId,onBack:()=>{n(!1),a(!0)},onSelectBlock:_})]})})),Dh=({setAddingBlock:e,focusAddBlockButton:t})=>{const o=(0,bt.useRef)();return(0,bt.useEffect)((()=>{t&&o.current?.focus()}),[t]),(0,Je.jsx)(et.__experimentalVStack,{className:"link-ui-tools",children:(0,Je.jsx)(et.Button,{ref:o,icon:zh,onClick:t=>{t.preventDefault(),e(!0)},"aria-haspopup":"listbox",children:(0,tt.__)("Add block")})})},Fh=(0,tt.__)("Switch to '%s'"),Vh=["core/navigation-link","core/navigation-submenu"],{PrivateListView:Eh}=Ht(ot.privateApis);function $h({block:e,insertedBlock:t,setInsertedBlock:o}){const{updateBlockAttributes:n}=(0,gt.useDispatch)(ot.store),r=Vh?.includes(t?.name),a=t?.clientId===e.clientId;if(!(r&&a))return null;return(0,Je.jsx)(Hh,{clientId:t?.clientId,link:t?.attributes,onClose:()=>{o(null)},onChange:e=>{var r;Ph(e,(r=t?.clientId,e=>{r&&n(r,e)}),t?.attributes),o(null)},onCancel:()=>{o(null)}})}const Gh=({clientId:e,currentMenuId:t,isLoading:o,isNavigationMenuMissing:n,onCreateNew:r})=>{const a=(0,gt.useSelect)((t=>!!t(ot.store).getBlockCount(e)),[e]),{navigationMenu:i}=Dg(t);if(t&&n)return(0,Je.jsx)(kh,{onCreateNew:r});if(o)return(0,Je.jsx)(et.Spinner,{});const s=i?(0,tt.sprintf)((0,tt.__)("Structure for Navigation Menu: %s"),i?.title||(0,tt.__)("Untitled menu")):(0,tt.__)("You have not yet created any menus. Displaying a list of your Pages");return(0,Je.jsxs)("div",{className:"wp-block-navigation__menu-inspector-controls",children:[!a&&(0,Je.jsx)("p",{className:"wp-block-navigation__menu-inspector-controls__empty-message",children:(0,tt.__)("This Navigation Menu is empty.")}),(0,Je.jsx)(Eh,{rootClientId:e,isExpanded:!0,description:s,showAppender:!0,blockSettingsMenu:Th,additionalBlockContent:$h})]})},Oh=e=>{const{createNavigationMenuIsSuccess:t,createNavigationMenuIsError:o,currentMenuId:n=null,onCreateNew:r,onSelectClassicMenu:a,onSelectNavigationMenu:i,isManageMenusButtonDisabled:s,blockEditingMode:l}=e;return(0,Je.jsx)(ot.InspectorControls,{group:"list",children:(0,Je.jsxs)(et.PanelBody,{title:null,children:[(0,Je.jsxs)(et.__experimentalHStack,{className:"wp-block-navigation-off-canvas-editor__header",children:[(0,Je.jsx)(et.__experimentalHeading,{className:"wp-block-navigation-off-canvas-editor__title",level:2,children:(0,tt.__)("Menu")}),"default"===l&&(0,Je.jsx)($g,{currentMenuId:n,onSelectClassicMenu:a,onSelectNavigationMenu:i,onCreateNew:r,createNavigationMenuIsSuccess:t,createNavigationMenuIsError:o,actionLabel:Fh,isManageMenusButtonDisabled:s})]}),(0,Je.jsx)(Gh,{...e})]})})};function Uh({id:e,children:t}){return(0,Je.jsx)(et.VisuallyHidden,{children:(0,Je.jsx)("div",{id:e,className:"wp-block-navigation__description",children:t})})}function qh({id:e}){const[t]=(0,mt.useEntityProp)("postType","wp_navigation","title"),o=(0,tt.sprintf)((0,tt.__)('Navigation Menu: "%s"'),t);return(0,Je.jsx)(Uh,{id:e,children:o})}function Wh({textColor:e,setTextColor:t,backgroundColor:o,setBackgroundColor:n,overlayTextColor:r,setOverlayTextColor:a,overlayBackgroundColor:i,setOverlayBackgroundColor:s,clientId:l,navRef:c}){const[u,d]=(0,bt.useState)(),[p,m]=(0,bt.useState)(),[g,h]=(0,bt.useState)(),[x,b]=(0,bt.useState)(),_="web"===bt.Platform.OS;(0,bt.useEffect)((()=>{if(!_)return;_h(c.current,m,d);const e=c.current?.querySelector('[data-type="core/navigation-submenu"] [data-type="core/navigation-link"]');e&&(r.color||i.color)&&_h(e,b,h)}),[_,r.color,i.color,c]);const y=(0,ot.__experimentalUseMultipleOriginColorsAndGradients)();return y.hasColorsOrGradients?(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.__experimentalColorGradientSettingsDropdown,{__experimentalIsRenderedInSidebar:!0,settings:[{colorValue:e.color,label:(0,tt.__)("Text"),onColorChange:t,resetAllFilter:()=>t()},{colorValue:o.color,label:(0,tt.__)("Background"),onColorChange:n,resetAllFilter:()=>n()},{colorValue:r.color,label:(0,tt.__)("Submenu & overlay text"),onColorChange:a,resetAllFilter:()=>a()},{colorValue:i.color,label:(0,tt.__)("Submenu & overlay background"),onColorChange:s,resetAllFilter:()=>s()}],panelId:l,...y,gradients:[],disableCustomGradients:!0}),_&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.ContrastChecker,{backgroundColor:u,textColor:p}),(0,Je.jsx)(ot.ContrastChecker,{backgroundColor:g,textColor:x})]})]}):null}const Zh=(0,ot.withColors)({textColor:"color"},{backgroundColor:"color"},{overlayBackgroundColor:"color"},{overlayTextColor:"color"})((function({attributes:e,setAttributes:t,clientId:o,isSelected:n,className:r,backgroundColor:a,setBackgroundColor:i,textColor:s,setTextColor:l,overlayBackgroundColor:c,setOverlayBackgroundColor:u,overlayTextColor:d,setOverlayTextColor:p,hasSubmenuIndicatorSetting:m=!0,customPlaceholder:g=null,__unstableLayoutClassNames:h}){const{openSubmenusOnClick:x,overlayMenu:b,showSubmenuIcon:_,templateLock:y,layout:{justifyContent:v,orientation:f="horizontal",flexWrap:k="wrap"}={},hasIcon:w,icon:C="handle"}=e,j=e.ref,S=(0,bt.useCallback)((e=>{t({ref:e})}),[t]),B=`navigationMenu/${j}`,N=(0,ot.useHasRecursion)(B),T=(0,ot.useBlockEditingMode)(),{menus:I}=Fg(),[P,M]=Xg({name:"block-library/core/navigation/status"}),[z,R]=Xg({name:"block-library/core/navigation/classic-menu-conversion"}),[A,L]=Xg({name:"block-library/core/navigation/permissions/update"}),{create:H,status:D,error:F,value:V,isPending:E,isSuccess:$,isError:G}=function(e){const[t,o]=(0,bt.useState)(hh),[n,r]=(0,bt.useState)(null),[a,i]=(0,bt.useState)(null),{saveEntityRecord:s,editEntityRecord:l}=(0,gt.useDispatch)(mt.store),c=dh(e),u=(0,bt.useCallback)((async(e=null,t=[],n)=>{if(e&&"string"!=typeof e)throw i("Invalid title supplied when creating Navigation Menu."),o(mh),new Error("Value of supplied title argument was not a string.");o(gh),r(null),i(null),e||(e=await c().catch((e=>{throw i(e?.message),o(mh),new Error("Failed to create title when saving new Navigation Menu.",{cause:e})})));const a={title:e,content:(0,Qe.serialize)(t),status:n};return s("postType","wp_navigation",a).then((e=>(r(e),o(ph),"publish"!==n&&l("postType","wp_navigation",e.id,{status:"publish"}),e))).catch((e=>{throw i(e?.message),o(mh),new Error("Unable to save new Navigation Menu",{cause:e})}))}),[s,l,c]);return{create:u,status:t,value:n,error:a,isIdle:t===hh,isPending:t===gh,isSuccess:t===ph,isError:t===mh}}(o),O=async()=>{await H("")},{hasUncontrolledInnerBlocks:U,uncontrolledInnerBlocks:q,isInnerBlockSelected:W,innerBlocks:Z}=function(e){return(0,gt.useSelect)((t=>{const{getBlock:o,getBlocks:n,hasSelectedInnerBlock:r}=t(ot.store),a=o(e).innerBlocks,i=!!a?.length,s=i?xh:n(e);return{innerBlocks:i?a:s,hasUncontrolledInnerBlocks:i,uncontrolledInnerBlocks:a,controlledInnerBlocks:s,isInnerBlockSelected:r(e,!0)}}),[e])}(o),Q=!!Z.find((e=>"core/navigation-submenu"===e.name)),{replaceInnerBlocks:K,selectBlock:J,__unstableMarkNextChangeAsNotPersistent:Y}=(0,gt.useDispatch)(ot.store),[X,ee]=(0,bt.useState)(!1),[te,oe]=(0,bt.useState)(!1),{hasResolvedNavigationMenus:ne,isNavigationMenuResolved:re,isNavigationMenuMissing:ae,canUserUpdateNavigationMenu:ie,hasResolvedCanUserUpdateNavigationMenu:se,canUserDeleteNavigationMenu:le,hasResolvedCanUserDeleteNavigationMenu:ce,canUserCreateNavigationMenus:ue,isResolvingCanUserCreateNavigationMenus:de,hasResolvedCanUserCreateNavigationMenus:pe}=Dg(j),me=ne&&ae,{convert:ge,status:he,error:xe}=sh(H),be=he===ah,_e=(0,bt.useCallback)(((e,t={focusNavigationBlock:!1})=>{const{focusNavigationBlock:n}=t;S(e),n&&J(o)}),[J,o,S]),ye=!ae&&re,ve=U&&!ye,{getNavigationFallbackId:fe}=Ht((0,gt.useSelect)(mt.store)),ke=j||ve?null:fe();(0,bt.useEffect)((()=>{j||ve||!ke||(Y(),S(ke))}),[j,S,ve,ke,Y]);const we=(0,bt.useRef)(),Ce="nav",je=!j&&!E&&!be&&ne&&0===I?.length&&!U,Se=!ne||E||be||!(!j||ye||be),Be=e.style?.typography?.textDecoration,Ne=(0,gt.useSelect)((e=>e(ot.store).__unstableHasActiveBlockOverlayActive(o)),[o]),Te="never"!==b,Ie=(0,ot.useBlockProps)({ref:we,className:dt(r,{"items-justified-right":"right"===v,"items-justified-space-between":"space-between"===v,"items-justified-left":"left"===v,"items-justified-center":"center"===v,"is-vertical":"vertical"===f,"no-wrap":"nowrap"===k,"is-responsive":Te,"has-text-color":!!s.color||!!s?.class,[(0,ot.getColorClassName)("color",s?.slug)]:!!s?.slug,"has-background":!!a.color||a.class,[(0,ot.getColorClassName)("background-color",a?.slug)]:!!a?.slug,[`has-text-decoration-${Be}`]:Be,"block-editor-block-content-overlay":Ne},h),style:{color:!s?.slug&&s?.color,backgroundColor:!a?.slug&&a?.color}}),Pe=async e=>ge(e.id,e.name,"draft"),Me=e=>{_e(e)};(0,bt.useEffect)((()=>{M(),E&&(0,Pg.speak)((0,tt.__)("Creating Navigation Menu.")),$&&(_e(V?.id,{focusNavigationBlock:!0}),P((0,tt.__)("Navigation Menu successfully created."))),G&&P((0,tt.__)("Failed to create Navigation Menu."))}),[D,F,V?.id,G,$,E,_e,M,P]),(0,bt.useEffect)((()=>{R(),he===ah&&(0,Pg.speak)((0,tt.__)("Classic menu importing.")),he===nh&&(z((0,tt.__)("Classic menu imported successfully.")),_e(V?.id,{focusNavigationBlock:!0})),he===rh&&z((0,tt.__)("Classic menu import failed."))}),[he,xe,R,z,V?.id,_e]),(0,bt.useEffect)((()=>{n||W||L(),(n||W)&&(j&&!me&&se&&!ie&&A((0,tt.__)("You do not have permission to edit this Menu. Any changes made will not be saved.")),j||!pe||ue||A((0,tt.__)("You do not have permission to create Navigation Menus.")))}),[n,W,ie,se,ue,pe,j,L,A,me]);const ze=ue||ie,Re=dt("wp-block-navigation__overlay-menu-preview",{open:te}),Ae=_||x?"":(0,tt.__)('The current menu options offer reduced accessibility for users and are not recommended. Enabling either "Open on Click" or "Show arrow" offers enhanced accessibility by allowing keyboard users to browse submenus selectively.'),Le=(0,bt.useRef)(!0);(0,bt.useEffect)((()=>{!Le.current&&Ae&&(0,Pg.speak)(Ae),Le.current=!1}),[Ae]);const He=(0,Ut.useInstanceId)(eh,"overlay-menu-preview"),De=(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.InspectorControls,{children:m&&(0,Je.jsxs)(et.PanelBody,{title:(0,tt.__)("Display"),children:[Te&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)(et.Button,{className:Re,onClick:()=>{oe(!te)},"aria-label":(0,tt.__)("Overlay menu controls"),"aria-controls":He,"aria-expanded":te,children:[w&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(Ug,{icon:C}),(0,Je.jsx)(Mg,{icon:zg})]}),!w&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("span",{children:(0,tt.__)("Menu")}),(0,Je.jsx)("span",{children:(0,tt.__)("Close")})]})]}),(0,Je.jsx)("div",{id:He,children:te&&(0,Je.jsx)(eh,{setAttributes:t,hasIcon:w,icon:C,hidden:!te})})]}),(0,Je.jsx)("h3",{children:(0,tt.__)("Overlay Menu")}),(0,Je.jsxs)(et.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Configure overlay menu"),value:b,help:(0,tt.__)("Collapses the navigation options in a menu icon opening an overlay."),onChange:e=>t({overlayMenu:e}),isBlock:!0,hideLabelFromVision:!0,children:[(0,Je.jsx)(et.__experimentalToggleGroupControlOption,{value:"never",label:(0,tt.__)("Off")}),(0,Je.jsx)(et.__experimentalToggleGroupControlOption,{value:"mobile",label:(0,tt.__)("Mobile")}),(0,Je.jsx)(et.__experimentalToggleGroupControlOption,{value:"always",label:(0,tt.__)("Always")})]}),Q&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("h3",{children:(0,tt.__)("Submenus")}),(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,checked:x,onChange:e=>{t({openSubmenusOnClick:e,...e&&{showSubmenuIcon:!0}})},label:(0,tt.__)("Open on click")}),(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,checked:_,onChange:e=>{t({showSubmenuIcon:e})},disabled:e.openSubmenusOnClick,label:(0,tt.__)("Show arrow")}),Ae&&(0,Je.jsx)("div",{children:(0,Je.jsx)(et.Notice,{spokenMessage:null,status:"warning",isDismissible:!1,children:Ae})})]})]})}),(0,Je.jsx)(ot.InspectorControls,{group:"color",children:(0,Je.jsx)(Wh,{textColor:s,setTextColor:l,backgroundColor:a,setBackgroundColor:i,overlayTextColor:d,setOverlayTextColor:p,overlayBackgroundColor:c,setOverlayBackgroundColor:u,clientId:o,navRef:we})})]}),Fe=`${o}-desc`,Ve=!ze||!ne;if(ve&&!E)return(0,Je.jsxs)(Ce,{...Ie,"aria-describedby":je?void 0:Fe,children:[(0,Je.jsx)(Uh,{id:Fe,children:(0,tt.__)("Unsaved Navigation Menu.")}),(0,Je.jsx)(Oh,{clientId:o,createNavigationMenuIsSuccess:$,createNavigationMenuIsError:G,currentMenuId:j,isNavigationMenuMissing:ae,isManageMenusButtonDisabled:Ve,onCreateNew:O,onSelectClassicMenu:Pe,onSelectNavigationMenu:Me,isLoading:Se,blockEditingMode:T}),"default"===T&&De,(0,Je.jsx)(qg,{id:o,onToggle:ee,isOpen:X,hasIcon:w,icon:C,isResponsive:Te,isHiddenByDefault:"always"===b,overlayBackgroundColor:c,overlayTextColor:d,children:(0,Je.jsx)(Jg,{createNavigationMenu:H,blocks:q,hasSelection:n||W})})]});if(j&&ae)return(0,Je.jsxs)(Ce,{...Ie,children:[(0,Je.jsx)(Oh,{clientId:o,createNavigationMenuIsSuccess:$,createNavigationMenuIsError:G,currentMenuId:j,isNavigationMenuMissing:ae,isManageMenusButtonDisabled:Ve,onCreateNew:O,onSelectClassicMenu:Pe,onSelectNavigationMenu:Me,isLoading:Se,blockEditingMode:T}),(0,Je.jsx)(kh,{onCreateNew:O})]});if(ye&&N)return(0,Je.jsx)("div",{...Ie,children:(0,Je.jsx)(ot.Warning,{children:(0,tt.__)("Block cannot be rendered inside itself.")})});const Ee=g||Gg;return je&&g?(0,Je.jsx)(Ce,{...Ie,children:(0,Je.jsx)(Ee,{isSelected:n,currentMenuId:j,clientId:o,canUserCreateNavigationMenus:ue,isResolvingCanUserCreateNavigationMenus:de,onSelectNavigationMenu:Me,onSelectClassicMenu:Pe,onCreateEmpty:O})}):(0,Je.jsx)(mt.EntityProvider,{kind:"postType",type:"wp_navigation",id:j,children:(0,Je.jsxs)(ot.RecursionProvider,{uniqueId:B,children:[(0,Je.jsx)(Oh,{clientId:o,createNavigationMenuIsSuccess:$,createNavigationMenuIsError:G,currentMenuId:j,isNavigationMenuMissing:ae,isManageMenusButtonDisabled:Ve,onCreateNew:O,onSelectClassicMenu:Pe,onSelectNavigationMenu:Me,isLoading:Se,blockEditingMode:T}),"default"===T&&De,"default"===T&&ye&&(0,Je.jsxs)(ot.InspectorControls,{group:"advanced",children:[se&&ie&&(0,Je.jsx)(Zg,{}),ce&&le&&(0,Je.jsx)(Yg,{onDelete:()=>{K(o,[]),P((0,tt.__)("Navigation Menu successfully deleted."))}}),(0,Je.jsx)(fh,{disabled:Ve,className:"wp-block-navigation-manage-menus-button"})]}),(0,Je.jsxs)(Ce,{...Ie,"aria-describedby":je||Se?void 0:Fe,children:[Se&&(0,Je.jsx)("div",{className:"wp-block-navigation__loading-indicator-container",children:(0,Je.jsx)(et.Spinner,{className:"wp-block-navigation__loading-indicator"})}),!Se&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(qh,{id:Fe}),(0,Je.jsx)(qg,{id:o,onToggle:ee,hasIcon:w,icon:C,isOpen:X,isResponsive:Te,isHiddenByDefault:"always"===b,overlayBackgroundColor:c,overlayTextColor:d,children:ye&&(0,Je.jsx)(Wg,{clientId:o,hasCustomPlaceholder:!!g,templateLock:y,orientation:f})})]})]})]})})}));const Qh={fontStyle:"var:preset|font-style|",fontWeight:"var:preset|font-weight|",textDecoration:"var:preset|text-decoration|",textTransform:"var:preset|text-transform|"},Kh=({navigationMenuId:e,...t})=>({...t,ref:e}),Jh=e=>{if(e.layout)return e;const{itemsJustification:t,orientation:o,...n}=e;return(t||o)&&Object.assign(n,{layout:{type:"flex",...t&&{justifyContent:t},...o&&{orientation:o}}}),n},Yh={attributes:{navigationMenuId:{type:"number"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},overlayMenu:{type:"string",default:"mobile"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{blockGap:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}},layout:{allowSwitching:!1,allowInheriting:!1,default:{type:"flex"}}},save:()=>(0,Je.jsx)(ot.InnerBlocks.Content,{}),isEligible:({navigationMenuId:e})=>!!e,migrate:Kh},Xh={attributes:{navigationMenuId:{type:"number"},orientation:{type:"string",default:"horizontal"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},overlayMenu:{type:"string",default:"never"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{blockGap:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}}},save:()=>(0,Je.jsx)(ot.InnerBlocks.Content,{}),isEligible:({itemsJustification:e,orientation:t})=>!!e||!!t,migrate:(0,Ut.compose)(Kh,Jh)},ex={attributes:{orientation:{type:"string",default:"horizontal"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},overlayMenu:{type:"string",default:"never"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0},spacing:{blockGap:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}}},save:()=>(0,Je.jsx)(ot.InnerBlocks.Content,{}),migrate:(0,Ut.compose)(Kh,Jh,so),isEligible:({style:e})=>e?.typography?.fontFamily},tx=[Yh,Xh,ex,{attributes:{orientation:{type:"string",default:"horizontal"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},isResponsive:{type:"boolean",default:"false"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0}},isEligible:e=>e.isResponsive,migrate:(0,Ut.compose)(Kh,Jh,so,(function(e){return delete e.isResponsive,{...e,overlayMenu:"mobile"}})),save:()=>(0,Je.jsx)(ot.InnerBlocks.Content,{})},{attributes:{orientation:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,fontSize:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,color:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0},save:()=>(0,Je.jsx)(ot.InnerBlocks.Content,{}),isEligible(e){if(!e.style||!e.style.typography)return!1;for(const t in Qh){const o=e.style.typography[t];if(o&&o.startsWith(Qh[t]))return!0}return!1},migrate:(0,Ut.compose)(Kh,Jh,so,(function(e){var t;return{...e,style:{...e.style,typography:Object.fromEntries(Object.entries(null!==(t=e.style.typography)&&void 0!==t?t:{}).map((([e,t])=>{const o=Qh[e];if(o&&t.startsWith(o)){const n=t.slice(o.length);return"textDecoration"===e&&"strikethrough"===n?[e,"line-through"]:[e,n]}return[e,t]})))}}}))},{attributes:{className:{type:"string"},textColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean"}},isEligible:e=>e.rgbTextColor||e.rgbBackgroundColor,supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0},migrate:(0,Ut.compose)(Kh,(e=>{const{rgbTextColor:t,rgbBackgroundColor:o,...n}=e;return{...n,customTextColor:e.textColor?void 0:e.rgbTextColor,customBackgroundColor:e.backgroundColor?void 0:e.rgbBackgroundColor}})),save:()=>(0,Je.jsx)(ot.InnerBlocks.Content,{})}],ox=tx,nx={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/navigation",title:"Navigation",category:"theme",allowedBlocks:["core/navigation-link","core/search","core/social-links","core/page-list","core/spacer","core/home-link","core/site-title","core/site-logo","core/navigation-submenu","core/loginout","core/buttons"],description:"A collection of blocks that allow visitors to get around your site.",keywords:["menu","navigation","links"],textdomain:"default",attributes:{ref:{type:"number"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},overlayMenu:{type:"string",default:"mobile"},icon:{type:"string",default:"handle"},hasIcon:{type:"boolean",default:!0},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"},maxNestingLevel:{type:"number",default:5},templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]}},providesContext:{textColor:"textColor",customTextColor:"customTextColor",backgroundColor:"backgroundColor",customBackgroundColor:"customBackgroundColor",overlayTextColor:"overlayTextColor",customOverlayTextColor:"customOverlayTextColor",overlayBackgroundColor:"overlayBackgroundColor",customOverlayBackgroundColor:"customOverlayBackgroundColor",fontSize:"fontSize",customFontSize:"customFontSize",showSubmenuIcon:"showSubmenuIcon",openSubmenusOnClick:"openSubmenusOnClick",style:"style",maxNestingLevel:"maxNestingLevel"},supports:{align:["wide","full"],ariaLabel:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalLetterSpacing:!0,__experimentalTextDecoration:!0,__experimentalSkipSerialization:["textDecoration"],__experimentalDefaultControls:{fontSize:!0}},spacing:{blockGap:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}},layout:{allowSwitching:!1,allowInheriting:!1,allowVerticalAlignment:!1,allowSizingOnChildren:!0,default:{type:"flex"}},interactivity:!0,renaming:!1},editorStyle:"wp-block-navigation-editor",style:"wp-block-navigation"},{name:rx}=nx,ax={icon:Ig,example:{attributes:{overlayMenu:"never"},innerBlocks:[{name:"core/navigation-link",attributes:{label:(0,tt.__)("Home"),url:"https://make.wordpress.org/"}},{name:"core/navigation-link",attributes:{label:(0,tt.__)("About"),url:"https://make.wordpress.org/"}},{name:"core/navigation-link",attributes:{label:(0,tt.__)("Contact"),url:"https://make.wordpress.org/"}}]},edit:Zh,save:function({attributes:e}){if(!e.ref)return(0,Je.jsx)(ot.InnerBlocks.Content,{})},deprecated:ox},ix=()=>Xe({name:rx,metadata:nx,settings:ax}),sx=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M12.5 14.5h-1V16h1c2.2 0 4-1.8 4-4s-1.8-4-4-4h-1v1.5h1c1.4 0 2.5 1.1 2.5 2.5s-1.1 2.5-2.5 2.5zm-4 1.5v-1.5h-1C6.1 14.5 5 13.4 5 12s1.1-2.5 2.5-2.5h1V8h-1c-2.2 0-4 1.8-4 4s1.8 4 4 4h1zm-1-3.2h5v-1.5h-5v1.5zM18 4H9c-1.1 0-2 .9-2 2v.5h1.5V6c0-.3.2-.5.5-.5h9c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5v-.5H7v.5c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2z"})}),lx={name:"core/navigation-link"};function cx({attributes:e,setAttributes:t,setIsLabelFieldFocused:o}){const{label:n,url:r,description:a,title:i,rel:s}=e;return(0,Je.jsxs)(et.PanelBody,{title:(0,tt.__)("Settings"),children:[(0,Je.jsx)(et.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:n?(0,sc.__unstableStripHTML)(n):"",onChange:e=>{t({label:e})},label:(0,tt.__)("Text"),autoComplete:"off",onFocus:()=>o(!0),onBlur:()=>o(!1)}),(0,Je.jsx)(et.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:r?(0,pt.safeDecodeURI)(r):"",onChange:o=>{Ph({url:o},t,e)},label:(0,tt.__)("Link"),autoComplete:"off"}),(0,Je.jsx)(et.TextareaControl,{__nextHasNoMarginBottom:!0,value:a||"",onChange:e=>{t({description:e})},label:(0,tt.__)("Description"),help:(0,tt.__)("The description will be displayed in the menu if the current theme supports it.")}),(0,Je.jsx)(et.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:i||"",onChange:e=>{t({title:e})},label:(0,tt.__)("Title attribute"),autoComplete:"off",help:(0,tt.__)("Additional information to help clarify the purpose of the link.")}),(0,Je.jsx)(et.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:s||"",onChange:e=>{t({rel:e})},label:(0,tt.__)("Rel attribute"),autoComplete:"off",help:(0,tt.__)("The relationship of the linked URL as space-separated link types.")})]})}const ux=(0,Je.jsxs)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Je.jsx)(Ke.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,Je.jsx)(Ke.Path,{d:"M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"})]}),dx=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M4.75 4a.75.75 0 0 0-.75.75v7.826c0 .2.08.39.22.53l6.72 6.716a2.313 2.313 0 0 0 3.276-.001l5.61-5.611-.531-.53.532.528a2.315 2.315 0 0 0 0-3.264L13.104 4.22a.75.75 0 0 0-.53-.22H4.75ZM19 12.576a.815.815 0 0 1-.236.574l-5.61 5.611a.814.814 0 0 1-1.153 0L5.5 12.264V5.5h6.763l6.5 6.502a.816.816 0 0 1 .237.574ZM8.75 9.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"})}),px=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4zm.8-4l.7.7 2-2V12h1V9.2l2 2 .7-.7-2-2H12v-1H9.2l2-2-.7-.7-2 2V4h-1v2.8l-2-2-.7.7 2 2H4v1h2.8l-2 2z"})});function mx(e){switch(e){case"post":return Np;case"page":return ux;case"tag":return dx;case"category":return Yo;default:return px}}function gx(e,t){if("core/navigation-link"!==t)return e;if(e.variations){const t=(e,t)=>e.type===t.type,o=e.variations.map((e=>({...e,...!e.icon&&{icon:mx(e.name)},...!e.isActive&&{isActive:t}})));return{...e,variations:o}}return e}const hx={from:[{type:"block",blocks:["core/site-logo"],transform:()=>(0,Qe.createBlock)("core/navigation-link")},{type:"block",blocks:["core/spacer"],transform:()=>(0,Qe.createBlock)("core/navigation-link")},{type:"block",blocks:["core/home-link"],transform:()=>(0,Qe.createBlock)("core/navigation-link")},{type:"block",blocks:["core/social-links"],transform:()=>(0,Qe.createBlock)("core/navigation-link")},{type:"block",blocks:["core/search"],transform:()=>(0,Qe.createBlock)("core/navigation-link")},{type:"block",blocks:["core/page-list"],transform:()=>(0,Qe.createBlock)("core/navigation-link")},{type:"block",blocks:["core/buttons"],transform:()=>(0,Qe.createBlock)("core/navigation-link")}],to:[{type:"block",blocks:["core/navigation-submenu"],transform:(e,t)=>(0,Qe.createBlock)("core/navigation-submenu",e,t)},{type:"block",blocks:["core/spacer"],transform:()=>(0,Qe.createBlock)("core/spacer")},{type:"block",blocks:["core/site-logo"],transform:()=>(0,Qe.createBlock)("core/site-logo")},{type:"block",blocks:["core/home-link"],transform:()=>(0,Qe.createBlock)("core/home-link")},{type:"block",blocks:["core/social-links"],transform:()=>(0,Qe.createBlock)("core/social-links")},{type:"block",blocks:["core/search"],transform:()=>(0,Qe.createBlock)("core/search",{showLabel:!1,buttonUseIcon:!0,buttonPosition:"button-inside"})},{type:"block",blocks:["core/page-list"],transform:()=>(0,Qe.createBlock)("core/page-list")},{type:"block",blocks:["core/buttons"],transform:({label:e,url:t,rel:o,title:n,opensInNewTab:r})=>(0,Qe.createBlock)("core/buttons",{},[(0,Qe.createBlock)("core/button",{text:e,url:t,rel:o,title:n,linkTarget:r?"_blank":void 0})])}]},xx=hx,bx={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/navigation-link",title:"Custom Link",category:"design",parent:["core/navigation"],allowedBlocks:["core/navigation-link","core/navigation-submenu","core/page-list"],description:"Add a page, link, or another item to your navigation.",textdomain:"default",attributes:{label:{type:"string"},type:{type:"string"},description:{type:"string"},rel:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"},title:{type:"string"},kind:{type:"string"},isTopLevelLink:{type:"boolean"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","maxNestingLevel","style"],supports:{reusable:!1,html:!1,__experimentalSlashInserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},renaming:!1,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-navigation-link-editor",style:"wp-block-navigation-link"},{name:_x}=bx,yx={icon:sx,__experimentalLabel:({label:e})=>e,merge:(e,{label:t=""})=>({...e,label:e.label+t}),edit:function({attributes:e,isSelected:t,setAttributes:o,insertBlocksAfter:n,mergeBlocks:r,onReplace:a,context:i,clientId:s}){const{id:l,label:c,type:u,url:d,description:p,kind:m}=e,[g,h]=((e,t,o)=>{const n="post-type"===e||"post"===t||"page"===t,r=Number.isInteger(o),a=(0,gt.useSelect)((e=>{if(!n)return null;const{getEntityRecord:r}=e(mt.store);return r("postType",t,o)?.status}),[n,t,o]);return[n&&r&&a&&"trash"===a,"draft"===a]})(m,u,l),{maxNestingLevel:x}=i,{replaceBlock:b,__unstableMarkNextChangeAsNotPersistent:_,selectBlock:y,selectPreviousBlock:v}=(0,gt.useDispatch)(ot.store),[f,k]=(0,bt.useState)(t&&!d),[w,C]=(0,bt.useState)(null),[j,S]=(0,bt.useState)(null),B=(0,bt.useRef)(null),N=(e=>{const[t,o]=(0,bt.useState)(!1);return(0,bt.useEffect)((()=>{const{ownerDocument:t}=e.current;function n(e){a(e)}function r(){o(!1)}function a(t){e.current.contains(t.target)?o(!0):o(!1)}return t.addEventListener("dragstart",n),t.addEventListener("dragend",r),t.addEventListener("dragenter",a),()=>{t.removeEventListener("dragstart",n),t.removeEventListener("dragend",r),t.removeEventListener("dragenter",a)}}),[e]),t})(B),T=(0,tt.__)("Add label…"),I=(0,bt.useRef)(),P=(0,bt.useRef)(),M=(0,Ut.usePrevious)(d),[z,R]=(0,bt.useState)(!1),{isAtMaxNesting:A,isTopLevelLink:L,isParentOfSelectedBlock:H,hasChildren:D}=(0,gt.useSelect)((e=>{const{getBlockCount:t,getBlockName:o,getBlockRootClientId:n,hasSelectedInnerBlock:r,getBlockParentsByBlockName:a}=e(ot.store);return{isAtMaxNesting:a(s,["core/navigation-link","core/navigation-submenu"]).length>=x,isTopLevelLink:"core/navigation"===o(n(s)),isParentOfSelectedBlock:r(s,!0),hasChildren:!!t(s)}}),[s,x]),{getBlocks:F}=(0,gt.useSelect)(ot.store),V=()=>{let t=F(s);0===t.length&&(t=[(0,Qe.createBlock)("core/navigation-link")],y(t[0].clientId));const o=(0,Qe.createBlock)("core/navigation-submenu",e,t);b(s,o)};(0,bt.useEffect)((()=>{D&&(_(),V())}),[D]),(0,bt.useEffect)((()=>{!M&&d&&f&&(0,pt.isURL)((0,pt.prependHTTP)(c))&&/^.+\.[a-z]+/.test(c)&&function(){I.current.focus();const{ownerDocument:e}=I.current,{defaultView:t}=e,o=t.getSelection(),n=e.createRange();n.selectNodeContents(I.current),o.removeAllRanges(),o.addRange(n)}()}),[M,d,f,c]);const{textColor:E,customTextColor:$,backgroundColor:G,customBackgroundColor:O}=yh(i,!L),U=(0,ot.useBlockProps)({ref:(0,Ut.useMergeRefs)([S,B]),className:dt("wp-block-navigation-item",{"is-editing":t||H,"is-dragging-within":N,"has-link":!!d,"has-child":D,"has-text-color":!!E||!!$,[(0,ot.getColorClassName)("color",E)]:!!E,"has-background":!!G||O,[(0,ot.getColorClassName)("background-color",G)]:!!G}),style:{color:!E&&$,backgroundColor:!G&&O},onKeyDown:function(e){fo.isKeyboardEvent.primary(e,"k")&&(e.preventDefault(),e.stopPropagation(),k(!0),C(I.current))}}),q=(0,ot.useInnerBlocksProps)({...U,className:"remove-outline"},{defaultBlock:lx,directInsert:!0,renderAppender:!1});(!d||g||h)&&(U.onClick=()=>{k(!0),C(I.current)});const W=dt("wp-block-navigation-item__content",{"wp-block-navigation-link__placeholder":!d||g||h}),Z=function(e){let t="";switch(e){case"post":t=(0,tt.__)("Select post");break;case"page":t=(0,tt.__)("Select page");break;case"category":t=(0,tt.__)("Select category");break;case"tag":t=(0,tt.__)("Select tag");break;default:t=(0,tt.__)("Add link")}return t}(u),Q=`(${g?(0,tt.__)("Invalid"):(0,tt.__)("Draft")})`,K=g||h?(0,tt.__)("This item has been deleted, or is a draft"):(0,tt.__)("This item is missing a link");return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.BlockControls,{children:(0,Je.jsxs)(et.ToolbarGroup,{children:[(0,Je.jsx)(et.ToolbarButton,{name:"link",icon:ko,title:(0,tt.__)("Link"),shortcut:fo.displayShortcut.primary("k"),onClick:e=>{k(!0),C(e.currentTarget)}}),!A&&(0,Je.jsx)(et.ToolbarButton,{name:"submenu",icon:wh,title:(0,tt.__)("Add submenu"),onClick:V})]})}),(0,Je.jsx)(ot.InspectorControls,{children:(0,Je.jsx)(cx,{attributes:e,setAttributes:o,setIsLabelFieldFocused:R})}),(0,Je.jsxs)("div",{...U,children:[(0,Je.jsxs)("a",{className:W,children:[d?(0,Je.jsxs)(Je.Fragment,{children:[!g&&!h&&!z&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.RichText,{ref:I,identifier:"label",className:"wp-block-navigation-item__label",value:c,onChange:e=>o({label:e}),onMerge:r,onReplace:a,__unstableOnSplitAtEnd:()=>n((0,Qe.createBlock)("core/navigation-link")),"aria-label":(0,tt.__)("Navigation link text"),placeholder:T,withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic","core/image","core/strikethrough"]}),p&&(0,Je.jsx)("span",{className:"wp-block-navigation-item__description",children:p})]}),(g||h||z)&&(0,Je.jsx)("div",{className:"wp-block-navigation-link__placeholder-text wp-block-navigation-link__label",children:(0,Je.jsx)(et.Tooltip,{text:K,children:(0,Je.jsx)("span",{"aria-label":(0,tt.__)("Navigation link text"),children:`${(0,Xo.decodeEntities)(c)} ${g||h?Q:""}`.trim()})})})]}):(0,Je.jsx)("div",{className:"wp-block-navigation-link__placeholder-text",children:(0,Je.jsx)(et.Tooltip,{text:K,children:(0,Je.jsx)("span",{children:Z})})}),f&&(0,Je.jsx)(Hh,{ref:P,clientId:s,link:e,onClose:()=>{if(!d)return P.current.contains(window.document.activeElement)&&v(s,!0),void a([]);k(!1),w?(w.focus(),C(null)):I.current?I.current.focus():v(s,!0)},anchor:j,onRemove:function(){o({url:void 0,label:void 0,id:void 0,kind:void 0,type:void 0,opensInNewTab:!1}),k(!1)},onChange:t=>{Ph(t,o,e)}})]}),(0,Je.jsx)("div",{...q})]})]})},save:function(){return(0,Je.jsx)(ot.InnerBlocks.Content,{})},example:{attributes:{label:(0,tt._x)("Example Link","navigation link preview example"),url:"https://example.com"}},deprecated:[{isEligible:e=>e.nofollow,attributes:{label:{type:"string"},type:{type:"string"},nofollow:{type:"boolean"},description:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"}},migrate:({nofollow:e,...t})=>({rel:e?"nofollow":"",...t}),save:()=>(0,Je.jsx)(ot.InnerBlocks.Content,{})}],transforms:xx},vx=()=>((0,fs.addFilter)("blocks.registerBlockType","core/navigation-link",gx),Xe({name:_x,metadata:bx,settings:yx})),fx=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"m13.955 20.748 8-17.5-.91-.416L19.597 6H13.5v1.5h5.411l-1.6 3.5H13.5v1.5h3.126l-1.6 3.5H13.5l.028 1.5h.812l-1.295 2.832.91.416ZM17.675 16l-.686 1.5h4.539L21.5 16h-3.825Zm2.286-5-.686 1.5H21.5V11h-1.54ZM2 12c0 3.58 2.42 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.48 0-4.5-1.52-4.5-4S5.52 7.5 8 7.5h3.5V6H8c-3.58 0-6 2.42-6 6Z"})}),kx=()=>(0,Je.jsx)(et.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:(0,Je.jsx)(et.Path,{d:"M1.50002 4L6.00002 8L10.5 4",strokeWidth:"1.5"})}),wx=["core/navigation-link","core/navigation-submenu","core/page-list"],Cx={name:"core/navigation-link"};const jx={to:[{type:"block",blocks:["core/navigation-link"],isMatch:(e,t)=>0===t?.innerBlocks?.length,transform:e=>(0,Qe.createBlock)("core/navigation-link",e)},{type:"block",blocks:["core/spacer"],isMatch:(e,t)=>0===t?.innerBlocks?.length,transform:()=>(0,Qe.createBlock)("core/spacer")},{type:"block",blocks:["core/site-logo"],isMatch:(e,t)=>0===t?.innerBlocks?.length,transform:()=>(0,Qe.createBlock)("core/site-logo")},{type:"block",blocks:["core/home-link"],isMatch:(e,t)=>0===t?.innerBlocks?.length,transform:()=>(0,Qe.createBlock)("core/home-link")},{type:"block",blocks:["core/social-links"],isMatch:(e,t)=>0===t?.innerBlocks?.length,transform:()=>(0,Qe.createBlock)("core/social-links")},{type:"block",blocks:["core/search"],isMatch:(e,t)=>0===t?.innerBlocks?.length,transform:()=>(0,Qe.createBlock)("core/search")}]},Sx=jx,Bx={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/navigation-submenu",title:"Submenu",category:"design",parent:["core/navigation"],description:"Add a submenu to your navigation.",textdomain:"default",attributes:{label:{type:"string"},type:{type:"string"},description:{type:"string"},rel:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"},title:{type:"string"},kind:{type:"string"},isTopLevelItem:{type:"boolean"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","maxNestingLevel","openSubmenusOnClick","style"],supports:{reusable:!1,html:!1,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-navigation-submenu-editor",style:"wp-block-navigation-submenu"},{name:Nx}=Bx,Tx={icon:({context:e})=>"list-view"===e?ux:wh,__experimentalLabel(e,{context:t}){const{label:o}=e,n=e?.metadata?.name;return"list-view"===t&&(n||o)&&e?.metadata?.name||o},edit:function({attributes:e,isSelected:t,setAttributes:o,mergeBlocks:n,onReplace:r,context:a,clientId:i}){const{label:s,type:l,url:c,description:u,rel:d,title:p}=e,{showSubmenuIcon:m,maxNestingLevel:g,openSubmenusOnClick:h}=a,{__unstableMarkNextChangeAsNotPersistent:x,replaceBlock:b,selectBlock:_}=(0,gt.useDispatch)(ot.store),[y,v]=(0,bt.useState)(!1),[f,k]=(0,bt.useState)(null),[w,C]=(0,bt.useState)(null),j=(0,bt.useRef)(null),S=(e=>{const[t,o]=(0,bt.useState)(!1);return(0,bt.useEffect)((()=>{const{ownerDocument:t}=e.current;function n(e){a(e)}function r(){o(!1)}function a(t){e.current.contains(t.target)?o(!0):o(!1)}return t.addEventListener("dragstart",n),t.addEventListener("dragend",r),t.addEventListener("dragenter",a),()=>{t.removeEventListener("dragstart",n),t.removeEventListener("dragend",r),t.removeEventListener("dragenter",a)}}),[]),t})(j),B=(0,tt.__)("Add text…"),N=(0,bt.useRef)(),T=(0,mt.useResourcePermissions)("pages"),I=(0,mt.useResourcePermissions)("posts"),{parentCount:P,isParentOfSelectedBlock:M,isImmediateParentOfSelectedBlock:z,hasChildren:R,selectedBlockHasChildren:A,onlyDescendantIsEmptyLink:L}=(0,gt.useSelect)((e=>{const{hasSelectedInnerBlock:t,getSelectedBlockClientId:o,getBlockParentsByBlockName:n,getBlock:r,getBlockCount:a,getBlockOrder:s}=e(ot.store);let l;const c=s(o());if(1===c?.length){const e=r(c[0]);l="core/navigation-link"===e?.name&&!e?.attributes?.label}return{parentCount:n(i,"core/navigation-submenu").length,isParentOfSelectedBlock:t(i,!0),isImmediateParentOfSelectedBlock:t(i,!1),hasChildren:!!a(i),selectedBlockHasChildren:!!c?.length,onlyDescendantIsEmptyLink:l}}),[i]),H=(0,Ut.usePrevious)(R);(0,bt.useEffect)((()=>{h||c||v(!0)}),[]),(0,bt.useEffect)((()=>{t||v(!1)}),[t]),(0,bt.useEffect)((()=>{y&&c&&(0,pt.isURL)((0,pt.prependHTTP)(s))&&/^.+\.[a-z]+/.test(s)&&function(){N.current.focus();const{ownerDocument:e}=N.current,{defaultView:t}=e,o=t.getSelection(),n=e.createRange();n.selectNodeContents(N.current),o.removeAllRanges(),o.addRange(n)}()}),[c]);let D=!1;l&&"page"!==l?"post"===l&&(D=I.canCreate):D=T.canCreate;const{textColor:F,customTextColor:V,backgroundColor:E,customBackgroundColor:$}=yh(a,P>0),G=(0,ot.useBlockProps)({ref:(0,Ut.useMergeRefs)([C,j]),className:dt("wp-block-navigation-item",{"is-editing":t||M,"is-dragging-within":S,"has-link":!!c,"has-child":R,"has-text-color":!!F||!!V,[(0,ot.getColorClassName)("color",F)]:!!F,"has-background":!!E||$,[(0,ot.getColorClassName)("background-color",E)]:!!E,"open-on-click":h}),style:{color:!F&&V,backgroundColor:!E&&$},onKeyDown:function(e){fo.isKeyboardEvent.primary(e,"k")&&(e.preventDefault(),e.stopPropagation(),v(!0),k(N.current))}}),O=yh(a,!0),U=P>=g?wx.filter((e=>"core/navigation-submenu"!==e)):wx,q=vh(O),W=(0,ot.useInnerBlocksProps)(q,{allowedBlocks:U,defaultBlock:Cx,directInsert:!0,__experimentalCaptureToolbars:!0,renderAppender:!!(t||z&&!A||R)&&ot.InnerBlocks.ButtonBlockAppender}),Z=h?"button":"a";function Q(){const t=(0,Qe.createBlock)("core/navigation-link",e);b(i,t)}(0,bt.useEffect)((()=>{!R&&H&&(x(),Q())}),[R,H]);const K=!A||L;return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.BlockControls,{children:(0,Je.jsxs)(et.ToolbarGroup,{children:[!h&&(0,Je.jsx)(et.ToolbarButton,{name:"link",icon:ko,title:(0,tt.__)("Link"),shortcut:fo.displayShortcut.primary("k"),onClick:e=>{v(!0),k(e.currentTarget)}}),(0,Je.jsx)(et.ToolbarButton,{name:"revert",icon:fx,title:(0,tt.__)("Convert to Link"),onClick:Q,className:"wp-block-navigation__submenu__revert",isDisabled:!K})]})}),(0,Je.jsx)(ot.InspectorControls,{children:(0,Je.jsxs)(et.PanelBody,{title:(0,tt.__)("Settings"),children:[(0,Je.jsx)(et.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:s||"",onChange:e=>{o({label:e})},label:(0,tt.__)("Text"),autoComplete:"off"}),(0,Je.jsx)(et.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:c||"",onChange:e=>{o({url:e})},label:(0,tt.__)("Link"),autoComplete:"off"}),(0,Je.jsx)(et.TextareaControl,{__nextHasNoMarginBottom:!0,value:u||"",onChange:e=>{o({description:e})},label:(0,tt.__)("Description"),help:(0,tt.__)("The description will be displayed in the menu if the current theme supports it.")}),(0,Je.jsx)(et.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:p||"",onChange:e=>{o({title:e})},label:(0,tt.__)("Title attribute"),autoComplete:"off",help:(0,tt.__)("Additional information to help clarify the purpose of the link.")}),(0,Je.jsx)(et.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:d||"",onChange:e=>{o({rel:e})},label:(0,tt.__)("Rel attribute"),autoComplete:"off",help:(0,tt.__)("The relationship of the linked URL as space-separated link types.")})]})}),(0,Je.jsxs)("div",{...G,children:[(0,Je.jsxs)(Z,{className:"wp-block-navigation-item__content",children:[(0,Je.jsx)(ot.RichText,{ref:N,identifier:"label",className:"wp-block-navigation-item__label",value:s,onChange:e=>o({label:e}),onMerge:n,onReplace:r,"aria-label":(0,tt.__)("Navigation link text"),placeholder:B,withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic","core/image","core/strikethrough"],onClick:()=>{h||c||(v(!0),k(N.current))}}),!h&&y&&(0,Je.jsx)(Hh,{clientId:i,link:e,onClose:()=>{v(!1),f?(f.focus(),k(null)):_(i)},anchor:w,hasCreateSuggestion:D,onRemove:()=>{o({url:""}),(0,Pg.speak)((0,tt.__)("Link removed."),"assertive")},onChange:t=>{Ph(t,o,e)}})]}),(m||h)&&(0,Je.jsx)("span",{className:"wp-block-navigation__submenu-icon",children:(0,Je.jsx)(kx,{})}),(0,Je.jsx)("div",{...W})]})]})},save:function(){return(0,Je.jsx)(ot.InnerBlocks.Content,{})},transforms:Sx},Ix=()=>Xe({name:Nx,metadata:Bx,settings:Tx}),Px=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M17.5 9V6a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v3H8V6a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v3h1.5Zm0 6.5V18a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2v-2.5H8V18a.5.5 0 0 0 .5.5h7a.5.5 0 0 0 .5-.5v-2.5h1.5ZM4 13h16v-1.5H4V13Z"})});const Mx={from:[{type:"raw",schema:{"wp-block":{attributes:["data-block"]}},isMatch:e=>e.dataset&&"core/nextpage"===e.dataset.block,transform:()=>(0,Qe.createBlock)("core/nextpage",{})}]},zx={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/nextpage",title:"Page Break",category:"design",description:"Separate your content into a multi-page experience.",keywords:["next page","pagination"],parent:["core/post-content"],textdomain:"default",supports:{customClassName:!1,className:!1,html:!1,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-nextpage-editor"},{name:Rx}=zx,Ax={icon:Px,example:{},transforms:Mx,edit:function(){return(0,Je.jsx)("div",{...(0,ot.useBlockProps)(),children:(0,Je.jsx)("span",{children:(0,tt.__)("Page break")})})},save:function(){return(0,Je.jsx)(bt.RawHTML,{children:"\x3c!--nextpage--\x3e"})}},Lx=()=>Xe({name:Rx,metadata:zx,settings:Ax}),Hx=new WeakMap;function Dx(){const e=(0,gt.useRegistry)();if(!Hx.has(e)){const t=new Map;Hx.set(e,Fx.bind(null,t))}return Hx.get(e)}function Fx(e,{name:t,blocks:o}){const n=[...o];for(;n.length;){const o=n.shift();for(const e of null!==(r=o.innerBlocks)&&void 0!==r?r:[]){var r;n.unshift(e)}"core/pattern"===o.name&&Vx(e,t,o.attributes.slug)}}function Vx(e,t,o){if(e.has(t)||e.set(t,new Set),e.get(t).add(o),Ex(e,t))throw new TypeError(`Pattern ${t} has a circular dependency and cannot be rendered.`)}function Ex(e,t,o=new Set,n=new Set){var r;o.add(t),n.add(t);const a=null!==(r=e.get(t))&&void 0!==r?r:new Set;for(const t of a)if(o.has(t)){if(n.has(t))return!0}else if(Ex(e,t,o,n))return!0;return n.delete(t),!1}const $x=({attributes:e,clientId:t})=>{const o=(0,gt.useRegistry)(),n=(0,gt.useSelect)((t=>t(ot.store).__experimentalGetParsedPattern(e.slug)),[e.slug]),r=(0,gt.useSelect)((e=>e(mt.store).getCurrentTheme()?.stylesheet),[]),{replaceBlocks:a,setBlockEditingMode:i,__unstableMarkNextChangeAsNotPersistent:s}=(0,gt.useDispatch)(ot.store),{getBlockRootClientId:l,getBlockEditingMode:c}=(0,gt.useSelect)(ot.store),[u,d]=(0,bt.useState)(!1),p=Dx();(0,bt.useEffect)((()=>{if(!u&&n?.blocks){try{p(n)}catch(e){return void d(!0)}window.queueMicrotask((()=>{const e=l(t),u=n.blocks.map((e=>(0,Qe.cloneBlock)(function(e){return e.innerBlocks.find((e=>"core/template-part"===e.name))&&(e.innerBlocks=e.innerBlocks.map((e=>("core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=r),e)))),"core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=r),e}(e))));1===u.length&&n.categories?.length>0&&(u[0].attributes={...u[0].attributes,metadata:{...u[0].attributes.metadata,categories:n.categories,patternName:n.name,name:u[0].attributes.metadata.name||n.title}});const d=c(e);o.batch((()=>{s(),i(e,"default"),s(),a(t,u),s(),i(e,d)}))}))}}),[t,u,n,s,a,c,i,l]);const m=(0,ot.useBlockProps)();return u?(0,Je.jsx)("div",{...m,children:(0,Je.jsx)(ot.Warning,{children:(0,tt.sprintf)((0,tt.__)('Pattern "%s" cannot be rendered inside itself.'),n?.name)})}):(0,Je.jsx)("div",{...m})},Gx={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/pattern",title:"Pattern placeholder",category:"theme",description:"Show a block pattern.",supports:{html:!1,inserter:!1,renaming:!1,interactivity:{clientNavigation:!0}},textdomain:"default",attributes:{slug:{type:"string"}}},{name:Ox}=Gx,Ux={edit:$x},qx=()=>Xe({name:Ox,metadata:Gx,settings:Ux}),Wx=(0,Je.jsxs)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Je.jsx)(Ke.Path,{d:"M14.5 5.5h-7V7h7V5.5ZM7.5 9h7v1.5h-7V9Zm7 3.5h-7V14h7v-1.5Z"}),(0,Je.jsx)(Ke.Path,{d:"M16 2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2ZM6 3.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5Z"}),(0,Je.jsx)(Ke.Path,{d:"M20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z"})]});function Zx(e,t){for(const o of e){if(o.attributes.id===t)return o;if(o.innerBlocks&&o.innerBlocks.length){const e=Zx(o.innerBlocks,t);if(e)return e}}return null}function Qx(e=[],t=null){let o=function(e=[]){const t={},o=[];return e.forEach((({id:e,title:n,link:r,type:a,parent:i})=>{var s;const l=null!==(s=t[e]?.innerBlocks)&&void 0!==s?s:[];t[e]=(0,Qe.createBlock)("core/navigation-link",{id:e,label:n.rendered,url:r,type:a,kind:"post-type"},l),i?(t[i]||(t[i]={innerBlocks:[]}),t[i].innerBlocks.push(t[e])):o.push(t[e])})),o}(e);if(t){const e=Zx(o,t);e&&e.innerBlocks&&(o=e.innerBlocks)}const n=e=>{e.forEach(((e,t,o)=>{const{attributes:r,innerBlocks:a}=e;if(0!==a.length){n(a);const e=(0,Qe.createBlock)("core/navigation-submenu",r,a);o[t]=e}}))};return n(o),o}function Kx({clientId:e,pages:t,parentClientId:o,parentPageID:n}){const{replaceBlock:r,selectBlock:a}=(0,gt.useDispatch)(ot.store);return()=>{const i=Qx(t,n);r(e,i),a(o)}}const Jx=(0,tt.__)("This Navigation Menu displays your website's pages. Editing it will enable you to add, delete, or reorder pages. However, new pages will no longer be added automatically.");function Yx({onClick:e,onClose:t,disabled:o}){return(0,Je.jsxs)(et.Modal,{onRequestClose:t,title:(0,tt.__)("Edit Page List"),className:"wp-block-page-list-modal",aria:{describedby:(0,Ut.useInstanceId)(Yx,"wp-block-page-list-modal__description")},children:[(0,Je.jsx)("p",{id:(0,Ut.useInstanceId)(Yx,"wp-block-page-list-modal__description"),children:Jx}),(0,Je.jsxs)("div",{className:"wp-block-page-list-modal-buttons",children:[(0,Je.jsx)(et.Button,{variant:"tertiary",onClick:t,children:(0,tt.__)("Cancel")}),(0,Je.jsx)(et.Button,{variant:"primary",__experimentalIsFocusable:!0,disabled:o,onClick:e,children:(0,tt.__)("Edit")})]})]})}const Xx=()=>{};function eb({blockProps:e,innerBlocksProps:t,hasResolvedPages:o,blockList:n,pages:r,parentPageID:a}){if(!o)return(0,Je.jsx)("div",{...e,children:(0,Je.jsx)("div",{className:"wp-block-page-list__loading-indicator-container",children:(0,Je.jsx)(et.Spinner,{className:"wp-block-page-list__loading-indicator"})})});if(null===r)return(0,Je.jsx)("div",{...e,children:(0,Je.jsx)(et.Notice,{status:"warning",isDismissible:!1,children:(0,tt.__)("Page List: Cannot retrieve Pages.")})});if(0===r.length)return(0,Je.jsx)("div",{...e,children:(0,Je.jsx)(et.Notice,{status:"info",isDismissible:!1,children:(0,tt.__)("Page List: Cannot retrieve Pages.")})});if(0===n.length){const t=r.find((e=>e.id===a));return t?.title?.rendered?(0,Je.jsx)("div",{...e,children:(0,Je.jsx)(ot.Warning,{children:(0,tt.sprintf)((0,tt.__)('Page List: "%s" page has no children.'),t.title.rendered)})}):(0,Je.jsx)("div",{...e,children:(0,Je.jsx)(et.Notice,{status:"warning",isDismissible:!1,children:(0,tt.__)("Page List: Cannot retrieve Pages.")})})}return r.length>0?(0,Je.jsx)("ul",{...t}):void 0}const tb={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/page-list",title:"Page List",category:"widgets",allowedBlocks:["core/page-list-item"],description:"Display a list of all pages.",keywords:["menu","navigation"],textdomain:"default",attributes:{parentPageID:{type:"integer",default:0},isNested:{type:"boolean",default:!1}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","style","openSubmenusOnClick"],supports:{reusable:!1,html:!1,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-page-list-editor",style:"wp-block-page-list"},{name:ob}=tb,nb={icon:Wx,example:{},edit:function({context:e,clientId:t,attributes:o,setAttributes:n}){const{parentPageID:r}=o,[a,i]=(0,bt.useState)(!1),s=(0,bt.useCallback)((()=>i(!0)),[]),{records:l,hasResolved:c}=(0,mt.useEntityRecords)("postType","page",{per_page:100,_fields:["id","link","menu_order","parent","title","type"],orderby:"menu_order",order:"asc"}),u="showSubmenuIcon"in e&&l?.length>0&&l?.length<=100,d=(0,bt.useMemo)((()=>{if(null===l)return new Map;const e=l.sort(((e,t)=>e.menu_order===t.menu_order?e.title.rendered.localeCompare(t.title.rendered):e.menu_order-t.menu_order));return e.reduce(((e,t)=>{const{parent:o}=t;return e.has(o)?e.get(o).push(t):e.set(o,[t]),e}),new Map)}),[l]),p=(0,ot.useBlockProps)({className:dt("wp-block-page-list",{"has-text-color":!!e.textColor,[(0,ot.getColorClassName)("color",e.textColor)]:!!e.textColor,"has-background":!!e.backgroundColor,[(0,ot.getColorClassName)("background-color",e.backgroundColor)]:!!e.backgroundColor}),style:{...e.style?.color}}),m=(0,bt.useMemo)((function e(t=0,o=0){const n=d.get(t);return n?.length?n.reduce(((t,n)=>{const r=d.has(n.id),a={value:n.id,label:"— ".repeat(o)+n.title.rendered,rawName:n.title.rendered};return t.push(a),r&&t.push(...e(n.id,o+1)),t}),[]):[]}),[d]),g=(0,bt.useMemo)((function e(t=r){const o=d.get(t);return o?.length?o.reduce(((t,o)=>{const n=d.has(o.id),r={id:o.id,label:""!==o.title?.rendered?.trim()?o.title?.rendered:(0,tt.__)("(no title)"),title:o.title?.rendered,link:o.url,hasChildren:n};let a=null;const i=e(o.id);return a=(0,Qe.createBlock)("core/page-list-item",r,i),t.push(a),t}),[]):[]}),[d,r]),{isNested:h,hasSelectedChild:x,parentClientId:b,hasDraggedChild:_,isChildOfNavigation:y}=(0,gt.useSelect)((e=>{const{getBlockParentsByBlockName:o,hasSelectedInnerBlock:n,hasDraggedInnerBlock:r}=e(ot.store),a=o(t,"core/navigation-submenu",!0),i=o(t,"core/navigation",!0);return{isNested:a.length>0,isChildOfNavigation:i.length>0,hasSelectedChild:n(t,!0),hasDraggedChild:r(t,!0),parentClientId:i[0]}}),[t]),v=Kx({clientId:t,pages:l,parentClientId:b,parentPageID:r}),f=(0,ot.useInnerBlocksProps)(p,{renderAppender:!1,__unstableDisableDropZone:!0,templateLock:!y&&"all",onInput:Xx,onChange:Xx,value:g}),{selectBlock:k}=(0,gt.useDispatch)(ot.store);return(0,bt.useEffect)((()=>{(x||_)&&(s(),k(b))}),[x,_,b,k,s]),(0,bt.useEffect)((()=>{n({isNested:h})}),[h,n]),(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)(ot.InspectorControls,{children:[m.length>0&&(0,Je.jsx)(et.PanelBody,{children:(0,Je.jsx)(et.ComboboxControl,{__next40pxDefaultSize:!0,className:"editor-page-attributes__parent",label:(0,tt.__)("Parent"),value:r,options:m,onChange:e=>n({parentPageID:null!=e?e:0}),help:(0,tt.__)("Choose a page to show only its subpages.")})}),u&&(0,Je.jsxs)(et.PanelBody,{title:(0,tt.__)("Edit this menu"),children:[(0,Je.jsx)("p",{children:Jx}),(0,Je.jsx)(et.Button,{variant:"primary",__experimentalIsFocusable:!0,disabled:!c,onClick:v,children:(0,tt.__)("Edit")})]})]}),u&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.BlockControls,{group:"other",children:(0,Je.jsx)(et.ToolbarButton,{title:(0,tt.__)("Edit"),onClick:s,children:(0,tt.__)("Edit")})}),a&&(0,Je.jsx)(Yx,{onClick:v,onClose:()=>i(!1),disabled:!c})]}),(0,Je.jsx)(eb,{blockProps:p,innerBlocksProps:f,hasResolvedPages:c,blockList:g,pages:l,parentPageID:r})]})}},rb=()=>Xe({name:ob,metadata:tb,settings:nb}),ab=()=>(0,Je.jsx)(et.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:(0,Je.jsx)(et.Path,{d:"M1.50002 4L6.00002 8L10.5 4",strokeWidth:"1.5"})});const ib={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/page-list-item",title:"Page List Item",category:"widgets",parent:["core/page-list"],description:"Displays a page inside a list of all pages.",keywords:["page","menu","navigation"],textdomain:"default",attributes:{id:{type:"number"},label:{type:"string"},title:{type:"string"},link:{type:"string"},hasChildren:{type:"boolean"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","style","openSubmenusOnClick"],supports:{reusable:!1,html:!1,lock:!1,inserter:!1,__experimentalToolbar:!1,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-page-list-editor",style:"wp-block-page-list"},{name:sb}=ib,lb={__experimentalLabel:({label:e})=>e,icon:ux,example:{},edit:function({context:e,attributes:t}){const{id:o,label:n,link:r,hasChildren:a,title:i}=t,s="showSubmenuIcon"in e,l=(0,gt.useSelect)((e=>{if(!e(mt.store).canUser("read","settings"))return;const t=e(mt.store).getEntityRecord("root","site");return"page"===t?.show_on_front&&t?.page_on_front}),[]),c=vh(yh(e,!0)),u=(0,ot.useBlockProps)(c,{className:"wp-block-pages-list__item"}),d=(0,ot.useInnerBlocksProps)(u);return(0,Je.jsxs)("li",{className:dt("wp-block-pages-list__item",{"has-child":a,"wp-block-navigation-item":s,"open-on-click":e.openSubmenusOnClick,"open-on-hover-click":!e.openSubmenusOnClick&&e.showSubmenuIcon,"menu-item-home":o===l}),children:[a&&e.openSubmenusOnClick?(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("button",{type:"button",className:"wp-block-navigation-item__content wp-block-navigation-submenu__toggle","aria-expanded":"false",children:(0,Xo.decodeEntities)(n)}),(0,Je.jsx)("span",{className:"wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon",children:(0,Je.jsx)(ab,{})})]}):(0,Je.jsx)("a",{className:dt("wp-block-pages-list__item__link",{"wp-block-navigation-item__content":s}),href:r,children:(0,Xo.decodeEntities)(i)}),a&&(0,Je.jsxs)(Je.Fragment,{children:[!e.openSubmenusOnClick&&e.showSubmenuIcon&&(0,Je.jsx)("button",{className:"wp-block-navigation-item__content wp-block-navigation-submenu__toggle wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon","aria-expanded":"false",type:"button",children:(0,Je.jsx)(ab,{})}),(0,Je.jsx)("ul",{...d})]})]},o)}},cb=()=>Xe({name:sb,metadata:ib,settings:lb}),ub=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"m9.99609 14v-.2251l.00391.0001v6.225h1.5v-14.5h2.5v14.5h1.5v-14.5h3v-1.5h-8.50391c-2.76142 0-5 2.23858-5 5 0 2.7614 2.23858 5 5 5z"})}),db={className:!1},pb={align:{type:"string"},content:{type:"string",source:"html",selector:"p",default:""},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},textColor:{type:"string"},backgroundColor:{type:"string"},fontSize:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]},style:{type:"object"}},mb=e=>{if(!e.customTextColor&&!e.customBackgroundColor&&!e.customFontSize)return e;const t={};(e.customTextColor||e.customBackgroundColor)&&(t.color={}),e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),e.customFontSize&&(t.typography={fontSize:e.customFontSize});const{customTextColor:o,customBackgroundColor:n,customFontSize:r,...a}=e;return{...a,style:t}},{style:gb,...hb}=pb,xb=[{supports:db,attributes:{...hb,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},save({attributes:e}){const{align:t,content:o,dropCap:n,direction:r}=e,a=dt({"has-drop-cap":t!==((0,tt.isRTL)()?"left":"right")&&"center"!==t&&n,[`has-text-align-${t}`]:t});return(0,Je.jsx)("p",{...ot.useBlockProps.save({className:a,dir:r}),children:(0,Je.jsx)(ot.RichText.Content,{value:o})})}},{supports:db,attributes:{...hb,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:mb,save({attributes:e}){const{align:t,content:o,dropCap:n,backgroundColor:r,textColor:a,customBackgroundColor:i,customTextColor:s,fontSize:l,customFontSize:c,direction:u}=e,d=(0,ot.getColorClassName)("color",a),p=(0,ot.getColorClassName)("background-color",r),m=(0,ot.getFontSizeClass)(l),g=dt({"has-text-color":a||s,"has-background":r||i,"has-drop-cap":n,[`has-text-align-${t}`]:t,[m]:m,[d]:d,[p]:p}),h={backgroundColor:p?void 0:i,color:d?void 0:s,fontSize:m?void 0:c};return(0,Je.jsx)(ot.RichText.Content,{tagName:"p",style:h,className:g||void 0,value:o,dir:u})}},{supports:db,attributes:{...hb,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:mb,save({attributes:e}){const{align:t,content:o,dropCap:n,backgroundColor:r,textColor:a,customBackgroundColor:i,customTextColor:s,fontSize:l,customFontSize:c,direction:u}=e,d=(0,ot.getColorClassName)("color",a),p=(0,ot.getColorClassName)("background-color",r),m=(0,ot.getFontSizeClass)(l),g=dt({"has-text-color":a||s,"has-background":r||i,"has-drop-cap":n,[m]:m,[d]:d,[p]:p}),h={backgroundColor:p?void 0:i,color:d?void 0:s,fontSize:m?void 0:c,textAlign:t};return(0,Je.jsx)(ot.RichText.Content,{tagName:"p",style:h,className:g||void 0,value:o,dir:u})}},{supports:db,attributes:{...hb,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"},width:{type:"string"}},migrate:mb,save({attributes:e}){const{width:t,align:o,content:n,dropCap:r,backgroundColor:a,textColor:i,customBackgroundColor:s,customTextColor:l,fontSize:c,customFontSize:u}=e,d=(0,ot.getColorClassName)("color",i),p=(0,ot.getColorClassName)("background-color",a),m=c&&`is-${c}-text`,g=dt({[`align${t}`]:t,"has-background":a||s,"has-drop-cap":r,[m]:m,[d]:d,[p]:p}),h={backgroundColor:p?void 0:s,color:d?void 0:l,fontSize:m?void 0:u,textAlign:o};return(0,Je.jsx)(ot.RichText.Content,{tagName:"p",style:h,className:g||void 0,value:n})}},{supports:db,attributes:{...hb,fontSize:{type:"number"}},save({attributes:e}){const{width:t,align:o,content:n,dropCap:r,backgroundColor:a,textColor:i,fontSize:s}=e,l=dt({[`align${t}`]:t,"has-background":a,"has-drop-cap":r}),c={backgroundColor:a,color:i,fontSize:s,textAlign:o};return(0,Je.jsx)("p",{style:c,className:l||void 0,children:n})},migrate:e=>mb({...e,customFontSize:Number.isFinite(e.fontSize)?e.fontSize:void 0,customTextColor:e.textColor&&"#"===e.textColor[0]?e.textColor:void 0,customBackgroundColor:e.backgroundColor&&"#"===e.backgroundColor[0]?e.backgroundColor:void 0})},{supports:db,attributes:{...pb,content:{type:"string",source:"html",default:""}},save:({attributes:e})=>(0,Je.jsx)(bt.RawHTML,{children:e.content}),migrate:e=>e}],bb=xb,_b=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM14 14l5-4-5-4v8z"})});function yb(e){const{batch:t}=(0,gt.useRegistry)(),{moveBlocksToPosition:o,replaceInnerBlocks:n,duplicateBlocks:r,insertBlock:a}=(0,gt.useDispatch)(ot.store),{getBlockRootClientId:i,getBlockIndex:s,getBlockOrder:l,getBlockName:c,getBlock:u,getNextBlockClientId:d,canInsertBlockType:p}=(0,gt.useSelect)(ot.store),m=(0,bt.useRef)(e);return m.current=e,(0,Ut.useRefEffect)((e=>{function g(e){if(e.defaultPrevented)return;if(e.keyCode!==fo.ENTER)return;const{content:g,clientId:h}=m.current;if(g.length)return;const x=i(h);if(!(0,Qe.hasBlockSupport)(c(x),"__experimentalOnEnter",!1))return;const b=l(x),_=b.indexOf(h);if(_===b.length-1){let t=x;for(;!p(c(h),i(t));)t=i(t);return void("string"==typeof t&&(e.preventDefault(),o([h],x,i(t),s(t)+1)))}const y=(0,Qe.getDefaultBlockName)();if(!p(y,i(x)))return;e.preventDefault();const v=u(x);t((()=>{r([x]);const e=s(x);n(x,v.innerBlocks.slice(0,_)),n(d(x),v.innerBlocks.slice(_+1)),a((0,Qe.createBlock)(y),e+1,i(x),!0)}))}return e.addEventListener("keydown",g),()=>{e.removeEventListener("keydown",g)}}),[])}function vb({direction:e,setDirection:t}){return(0,tt.isRTL)()&&(0,Je.jsx)(et.ToolbarButton,{icon:_b,title:(0,tt._x)("Left to right","editor button"),isActive:"ltr"===e,onClick:()=>{t("ltr"===e?void 0:"ltr")}})}function fb(e){return e===((0,tt.isRTL)()?"left":"right")||"center"===e}function kb({clientId:e,attributes:t,setAttributes:o}){const[n]=(0,ot.useSettings)("typography.dropCap");if(!n)return null;const{align:r,dropCap:a}=t;let i;return i=fb(r)?(0,tt.__)("Not available for aligned text."):a?(0,tt.__)("Showing large initial letter."):(0,tt.__)("Toggle to show a large initial letter."),(0,Je.jsx)(et.__experimentalToolsPanelItem,{hasValue:()=>!!a,label:(0,tt.__)("Drop cap"),onDeselect:()=>o({dropCap:void 0}),resetAllFilter:()=>({dropCap:void 0}),panelId:e,children:(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Drop cap"),checked:!!a,onChange:()=>o({dropCap:!a}),help:i,disabled:!!fb(r)})})}const wb=function({attributes:e,mergeBlocks:t,onReplace:o,onRemove:n,setAttributes:r,clientId:a}){const{align:i,content:s,direction:l,dropCap:c,placeholder:u}=e,d=(0,ot.useBlockProps)({ref:yb({clientId:a,content:s}),className:dt({"has-drop-cap":!fb(i)&&c,[`has-text-align-${i}`]:i}),style:{direction:l}}),p=(0,ot.useBlockEditingMode)();return(0,Je.jsxs)(Je.Fragment,{children:["default"===p&&(0,Je.jsxs)(ot.BlockControls,{group:"block",children:[(0,Je.jsx)(ot.AlignmentControl,{value:i,onChange:e=>r({align:e,dropCap:!fb(e)&&c})}),(0,Je.jsx)(vb,{direction:l,setDirection:e=>r({direction:e})})]}),(0,Je.jsx)(ot.InspectorControls,{group:"typography",children:(0,Je.jsx)(kb,{clientId:a,attributes:e,setAttributes:r})}),(0,Je.jsx)(ot.RichText,{identifier:"content",tagName:"p",...d,value:s,onChange:e=>r({content:e}),onMerge:t,onReplace:o,onRemove:n,"aria-label":ot.RichText.isEmpty(s)?(0,tt.__)("Empty block; start writing or type forward slash to choose a block"):(0,tt.__)("Block: Paragraph"),"data-empty":ot.RichText.isEmpty(s),placeholder:u||(0,tt.__)("Type / to choose a block"),"data-custom-placeholder":!!u||void 0,__unstableEmbedURLOnPaste:!0,__unstableAllowPrefixTransformations:!0})]})};const{name:Cb}={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/paragraph",title:"Paragraph",category:"text",description:"Start with the basic building block of all narrative.",keywords:["text"],textdomain:"default",attributes:{align:{type:"string"},content:{type:"rich-text",source:"rich-text",selector:"p",__experimentalRole:"content"},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]}},supports:{splitting:!0,anchor:!0,className:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalSelector:"p",__unstablePasteTextInline:!0,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-paragraph-editor",style:"wp-block-paragraph"},jb={from:[{type:"raw",priority:20,selector:"p",schema:({phrasingContentSchema:e,isPaste:t})=>({p:{children:e,attributes:t?[]:["style","id"]}}),transform(e){const t=(0,Qe.getBlockAttributes)(Cb,e.outerHTML),{textAlign:o}=e.style||{};return"left"!==o&&"center"!==o&&"right"!==o||(t.align=o),(0,Qe.createBlock)(Cb,t)}}]},Sb=jb,Bb={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/paragraph",title:"Paragraph",category:"text",description:"Start with the basic building block of all narrative.",keywords:["text"],textdomain:"default",attributes:{align:{type:"string"},content:{type:"rich-text",source:"rich-text",selector:"p",__experimentalRole:"content"},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]}},supports:{splitting:!0,anchor:!0,className:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalSelector:"p",__unstablePasteTextInline:!0,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-paragraph-editor",style:"wp-block-paragraph"},{name:Nb}=Bb,Tb={icon:ub,example:{attributes:{content:(0,tt.__)("In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.")}},__experimentalLabel(e,{context:t}){const o=e?.metadata?.name;if("list-view"===t&&o)return o;if("accessibility"===t){if(o)return o;const{content:t}=e;return t&&0!==t.length?t:(0,tt.__)("Empty")}},transforms:Sb,deprecated:bb,merge:(e,t)=>({content:(e.content||"")+(t.content||"")}),edit:wb,save:function({attributes:e}){const{align:t,content:o,dropCap:n,direction:r}=e,a=dt({"has-drop-cap":t!==((0,tt.isRTL)()?"left":"right")&&"center"!==t&&n,[`has-text-align-${t}`]:t});return(0,Je.jsx)("p",{...ot.useBlockProps.save({className:a,dir:r}),children:(0,Je.jsx)(ot.RichText.Content,{value:o})})}},Ib=()=>Xe({name:Nb,metadata:Bb,settings:Tb}),Pb=(0,Je.jsx)(Ke.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ke.Path,{d:"M10 4.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zm2.25 7.5v-1A2.75 2.75 0 0011 8.25H7A2.75 2.75 0 004.25 11v1h1.5v-1c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v1h1.5zM4 20h9v-1.5H4V20zm16-4H4v-1.5h16V16z",fillRule:"evenodd",clipRule:"evenodd"})}),Mb={who:"authors",per_page:100};const zb=function({isSelected:e,context:{postType:t,postId:o,queryId:n},attributes:r,setAttributes:a}){const i=Number.isFinite(n),{authorId:s,authorDetails:l,authors:c}=(0,gt.useSelect)((e=>{const{getEditedEntityRecord:n,getUser:r,getUsers:a}=e(mt.store),i=n("postType",t,o)?.author;return{authorId:i,authorDetails:i?r(i):null,authors:a(Mb)}}),[t,o]),{editEntityRecord:u}=(0,gt.useDispatch)(mt.store),{textAlign:d,showAvatar:p,showBio:m,byline:g,isLink:h,linkTarget:x}=r,b=[],_=l?.name||(0,tt.__)("Post Author");l?.avatar_urls&&Object.keys(l.avatar_urls).forEach((e=>{b.push({value:e,label:`${e} x ${e}`})}));const y=(0,ot.useBlockProps)({className:dt({[`has-text-align-${d}`]:d})}),v=c?.length?c.map((({id:e,name:t})=>({value:e,label:t}))):[],f=e=>{u("postType",t,o,{author:e})},k=v.length>=25,w=!!o&&!i&&v.length>0;return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.InspectorControls,{children:(0,Je.jsxs)(et.PanelBody,{title:(0,tt.__)("Settings"),children:[w&&(k&&(0,Je.jsx)(et.ComboboxControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Author"),options:v,value:s,onChange:f,allowReset:!1})||(0,Je.jsx)(et.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Author"),value:s,options:v,onChange:f})),(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Show avatar"),checked:p,onChange:()=>a({showAvatar:!p})}),p&&(0,Je.jsx)(et.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Avatar size"),value:r.avatarSize,options:b,onChange:e=>{a({avatarSize:Number(e)})}}),(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Show bio"),checked:m,onChange:()=>a({showBio:!m})}),(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Link author name to author page"),checked:h,onChange:()=>a({isLink:!h})}),h&&(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Open in new tab"),onChange:e=>a({linkTarget:e?"_blank":"_self"}),checked:"_blank"===x})]})}),(0,Je.jsx)(ot.BlockControls,{group:"block",children:(0,Je.jsx)(ot.AlignmentControl,{value:d,onChange:e=>{a({textAlign:e})}})}),(0,Je.jsxs)("div",{...y,children:[p&&l?.avatar_urls&&(0,Je.jsx)("div",{className:"wp-block-post-author__avatar",children:(0,Je.jsx)("img",{width:r.avatarSize,src:l.avatar_urls[r.avatarSize],alt:l.name})}),(0,Je.jsxs)("div",{className:"wp-block-post-author__content",children:[(!ot.RichText.isEmpty(g)||e)&&(0,Je.jsx)(ot.RichText,{identifier:"byline",className:"wp-block-post-author__byline","aria-label":(0,tt.__)("Post author byline text"),placeholder:(0,tt.__)("Write byline…"),value:g,onChange:e=>a({byline:e})}),(0,Je.jsx)("p",{className:"wp-block-post-author__name",children:h?(0,Je.jsx)("a",{href:"#post-author-pseudo-link",onClick:e=>e.preventDefault(),children:_}):_}),m&&(0,Je.jsx)("p",{className:"wp-block-post-author__bio",dangerouslySetInnerHTML:{__html:l?.description}})]})]})]})},Rb={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-author",title:"Author",category:"theme",description:"Display post author details such as name, avatar, and bio.",textdomain:"default",attributes:{textAlign:{type:"string"},avatarSize:{type:"number",default:48},showAvatar:{type:"boolean",default:!0},showBio:{type:"boolean"},byline:{type:"string"},isLink:{type:"boolean",default:!1},linkTarget:{type:"string",default:"_self"}},usesContext:["postType","postId","queryId"],supports:{html:!1,spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDuotone:".wp-block-post-author__avatar img",__experimentalDefaultControls:{background:!0,text:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-post-author"},{name:Ab}=Rb,Lb={icon:Pb,edit:zb},Hb=()=>Xe({name:Ab,metadata:Rb,settings:Lb});const Db=function({context:{postType:e,postId:t},attributes:{textAlign:o,isLink:n,linkTarget:r},setAttributes:a}){const{authorName:i}=(0,gt.useSelect)((o=>{const{getEditedEntityRecord:n,getUser:r}=o(mt.store),a=n("postType",e,t)?.author;return{authorName:a?r(a):null}}),[e,t]),s=(0,ot.useBlockProps)({className:dt({[`has-text-align-${o}`]:o})}),l=i?.name||(0,tt.__)("Author Name"),c=n?(0,Je.jsx)("a",{href:"#author-pseudo-link",onClick:e=>e.preventDefault(),className:"wp-block-post-author-name__link",children:l}):l;return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.BlockControls,{group:"block",children:(0,Je.jsx)(ot.AlignmentControl,{value:o,onChange:e=>{a({textAlign:e})}})}),(0,Je.jsx)(ot.InspectorControls,{children:(0,Je.jsxs)(et.PanelBody,{title:(0,tt.__)("Settings"),children:[(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Link to author archive"),onChange:()=>a({isLink:!n}),checked:n}),n&&(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Open in new tab"),onChange:e=>a({linkTarget:e?"_blank":"_self"}),checked:"_blank"===r})]})}),(0,Je.jsxs)("div",{...s,children:[" ",c," "]})]})},Fb={from:[{type:"block",blocks:["core/post-author"],transform:({textAlign:e})=>(0,Qe.createBlock)("core/post-author-name",{textAlign:e})}],to:[{type:"block",blocks:["core/post-author"],transform:({textAlign:e})=>(0,Qe.createBlock)("core/post-author",{textAlign:e})}]},Vb={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-author-name",title:"Author Name",category:"theme",description:"The author name.",textdomain:"default",attributes:{textAlign:{type:"string"},isLink:{type:"boolean",default:!1},linkTarget:{type:"string",default:"_self"}},usesContext:["postType","postId"],supports:{html:!1,spacing:{margin:!0,padding:!0},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}},{name:Eb}=Vb,$b={icon:Pb,transforms:Fb,edit:Db},Gb=()=>Xe({name:Eb,metadata:Vb,settings:$b});const Ob=function({context:{postType:e,postId:t},attributes:{textAlign:o},setAttributes:n}){const{authorDetails:r}=(0,gt.useSelect)((o=>{const{getEditedEntityRecord:n,getUser:r}=o(mt.store),a=n("postType",e,t)?.author;return{authorDetails:a?r(a):null}}),[e,t]),a=(0,ot.useBlockProps)({className:dt({[`has-text-align-${o}`]:o})}),i=r?.description||(0,tt.__)("Author Biography");return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.BlockControls,{group:"block",children:(0,Je.jsx)(ot.AlignmentControl,{value:o,onChange:e=>{n({textAlign:e})}})}),(0,Je.jsx)("div",{...a,dangerouslySetInnerHTML:{__html:i}})]})},Ub={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-author-biography",title:"Author Biography",category:"theme",description:"The author biography.",textdomain:"default",attributes:{textAlign:{type:"string"}},usesContext:["postType","postId"],supports:{spacing:{margin:!0,padding:!0},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}},{name:qb}=Ub,Wb={icon:Pb,edit:Ob},Zb=()=>Xe({name:qb,metadata:Ub,settings:Wb}),Qb=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})}),Kb=[["core/avatar"],["core/comment-author-name"],["core/comment-date"],["core/comment-content"],["core/comment-reply-link"],["core/comment-edit-link"]];const Jb={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:"fse",name:"core/post-comment",title:"Comment (deprecated)",category:"theme",allowedBlocks:["core/avatar","core/comment-author-name","core/comment-content","core/comment-date","core/comment-edit-link","core/comment-reply-link"],description:"This block is deprecated. Please use the Comments block instead.",textdomain:"default",attributes:{commentId:{type:"number"}},providesContext:{commentId:"commentId"},supports:{html:!1,inserter:!1,interactivity:{clientNavigation:!0}}},{name:Yb}=Jb,Xb={icon:wp,edit:function({attributes:{commentId:e},setAttributes:t}){const[o,n]=(0,bt.useState)(e),r=(0,ot.useBlockProps)(),a=(0,ot.useInnerBlocksProps)(r,{template:Kb});return e?(0,Je.jsx)("div",{...a}):(0,Je.jsx)("div",{...r,children:(0,Je.jsxs)(et.Placeholder,{icon:Qb,label:(0,tt._x)("Post Comment","block title"),instructions:(0,tt.__)("To show a comment, input the comment ID."),children:[(0,Je.jsx)(et.TextControl,{__nextHasNoMarginBottom:!0,value:e,onChange:e=>n(parseInt(e))}),(0,Je.jsx)(et.Button,{variant:"primary",onClick:()=>{t({commentId:o})},children:(0,tt.__)("Save")})]})})},save:function(){const e=ot.useBlockProps.save(),t=ot.useInnerBlocksProps.save(e);return(0,Je.jsx)("div",{...t})}},e_=()=>Xe({name:Yb,metadata:Jb,settings:Xb}),t_=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-2.2 6.6H7l1.6-2.2c.3-.4.5-.7.6-.9.1-.2.2-.4.2-.5 0-.2-.1-.3-.1-.4-.1-.1-.2-.1-.4-.1s-.4 0-.6.1c-.3.1-.5.3-.7.4l-.2.2-.2-1.2.1-.1c.3-.2.5-.3.8-.4.3-.1.6-.1.9-.1.3 0 .6.1.9.2.2.1.4.3.6.5.1.2.2.5.2.7 0 .3-.1.6-.2.9-.1.3-.4.7-.7 1.1l-.5.6h1.6v1.2z"})});const o_={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:"fse",name:"core/post-comments-count",title:"Comments Count",category:"theme",description:"Display a post's comments count.",textdomain:"default",attributes:{textAlign:{type:"string"}},usesContext:["postId"],supports:{html:!1,color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}},{name:n_}=o_,r_={icon:t_,edit:function({attributes:e,context:t,setAttributes:o}){const{textAlign:n}=e,{postId:r}=t,[a,i]=(0,bt.useState)(),s=(0,ot.useBlockProps)({className:dt({[`has-text-align-${n}`]:n})});(0,bt.useEffect)((()=>{if(!r)return;const e=r;Kr()({path:(0,pt.addQueryArgs)("/wp/v2/comments",{post:r}),parse:!1}).then((t=>{e===r&&i(t.headers.get("X-WP-Total"))}))}),[r]);const l=r&&void 0!==a,c={...s.style,textDecoration:l?s.style?.textDecoration:void 0};return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.BlockControls,{group:"block",children:(0,Je.jsx)(ot.AlignmentControl,{value:n,onChange:e=>{o({textAlign:e})}})}),(0,Je.jsx)("div",{...s,style:c,children:l?a:(0,Je.jsx)(ot.Warning,{children:(0,tt.__)("Post Comments Count block: post not found.")})})]})}},a_=()=>Xe({name:n_,metadata:o_,settings:r_}),i_=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-.5 6.6H6.7l-1.2 1.2v-6.3h7v5.1z"})});const s_={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-comments-form",title:"Comments Form",category:"theme",description:"Display a post's comments form.",textdomain:"default",attributes:{textAlign:{type:"string"}},usesContext:["postId","postType"],supports:{html:!1,color:{gradients:!0,heading:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}}},editorStyle:"wp-block-post-comments-form-editor",style:["wp-block-post-comments-form","wp-block-buttons","wp-block-button"]},{name:l_}=s_,c_={icon:i_,edit:function e({attributes:t,context:o,setAttributes:n}){const{textAlign:r}=t,{postId:a,postType:i}=o,s=(0,Ut.useInstanceId)(e),l=(0,tt.sprintf)("comments-form-edit-%d-desc",s),c=(0,ot.useBlockProps)({className:dt({[`has-text-align-${r}`]:r}),"aria-describedby":l});return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.BlockControls,{group:"block",children:(0,Je.jsx)(ot.AlignmentControl,{value:r,onChange:e=>{n({textAlign:e})}})}),(0,Je.jsxs)("div",{...c,children:[(0,Je.jsx)(ar,{postId:a,postType:i}),(0,Je.jsx)(et.VisuallyHidden,{id:l,children:(0,tt.__)("Comments form disabled in editor.")})]})]})}},u_=()=>Xe({name:l_,metadata:s_,settings:c_});const d_=function({context:e,attributes:t,setAttributes:o}){const{textAlign:n}=t,{postType:r,postId:a}=e,[i,s]=(0,bt.useState)(),l=(0,ot.useBlockProps)({className:dt({[`has-text-align-${n}`]:n})});(0,bt.useEffect)((()=>{if(!a)return;const e=a;Kr()({path:(0,pt.addQueryArgs)("/wp/v2/comments",{post:a}),parse:!1}).then((t=>{e===a&&s(t.headers.get("X-WP-Total"))}))}),[a]);const c=(0,gt.useSelect)((e=>e(mt.store).getEditedEntityRecord("postType",r,a)),[r,a]);if(!c)return null;const{link:u}=c;let d;if(void 0!==i){const e=parseInt(i);d=0===e?(0,tt.__)("No comments"):(0,tt.sprintf)((0,tt._n)("%s comment","%s comments",e),e.toLocaleString())}return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.BlockControls,{group:"block",children:(0,Je.jsx)(ot.AlignmentControl,{value:n,onChange:e=>{o({textAlign:e})}})}),(0,Je.jsx)("div",{...l,children:u&&void 0!==d?(0,Je.jsx)("a",{href:u+"#comments",onClick:e=>e.preventDefault(),children:d}):(0,Je.jsx)(ot.Warning,{children:(0,tt.__)("Post Comments Link block: post not found.")})})]})},p_={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:"fse",name:"core/post-comments-link",title:"Comments Link",category:"theme",description:"Displays the link to the current post comments.",textdomain:"default",usesContext:["postType","postId"],attributes:{textAlign:{type:"string"}},supports:{html:!1,color:{link:!0,text:!1,__experimentalDefaultControls:{background:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}},{name:m_}=p_,g_={edit:d_,icon:t_},h_=()=>Xe({name:m_,metadata:p_,settings:g_}),x_=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M4 6h12V4.5H4V6Zm16 4.5H4V9h16v1.5ZM4 15h16v-1.5H4V15Zm0 4.5h16V18H4v1.5Z"})});function b_({layoutClassNames:e,userCanEdit:t,postType:o,postId:n}){const[,,r]=(0,mt.useEntityProp)("postType",o,"content",n),a=(0,ot.useBlockProps)({className:e});return r?.protected&&!t?(0,Je.jsx)("div",{...a,children:(0,Je.jsx)(ot.Warning,{children:(0,tt.__)("This content is password protected.")})}):(0,Je.jsx)("div",{...a,dangerouslySetInnerHTML:{__html:r?.rendered}})}function __({context:e={}}){const{postType:t,postId:o}=e,[n,r,a]=(0,mt.useEntityBlockEditor)("postType",t,{id:o}),i=(0,gt.useSelect)((e=>e(mt.store).getEntityRecord("postType",t,o)),[t,o]),s=!!i?.content?.raw||n?.length,l=(0,ot.useInnerBlocksProps)((0,ot.useBlockProps)({className:"entry-content"}),{value:n,onInput:r,onChange:a,template:s?void 0:[["core/paragraph"]]});return(0,Je.jsx)("div",{...l})}function y_(e){const{context:{queryId:t,postType:o,postId:n}={},layoutClassNames:r}=e,a=qt("postType",o,n);if(void 0===a)return null;const i=Number.isFinite(t);return a&&!i?(0,Je.jsx)(__,{...e}):(0,Je.jsx)(b_,{layoutClassNames:r,userCanEdit:a,postType:o,postId:n})}function v_({layoutClassNames:e}){const t=(0,ot.useBlockProps)({className:e});return(0,Je.jsxs)("div",{...t,children:[(0,Je.jsx)("p",{children:(0,tt.__)("This is the Content block, it will display all the blocks in any single post or page.")}),(0,Je.jsx)("p",{children:(0,tt.__)("That might be a simple arrangement like consecutive paragraphs in a blog post, or a more elaborate composition that includes image galleries, videos, tables, columns, and any other block types.")}),(0,Je.jsx)("p",{children:(0,tt.__)("If there are any Custom Post Types registered at your site, the Content block can display the contents of those entries as well.")})]})}function f_(){const e=(0,ot.useBlockProps)();return(0,Je.jsx)("div",{...e,children:(0,Je.jsx)(ot.Warning,{children:(0,tt.__)("Block cannot be rendered inside itself.")})})}const k_={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-content",title:"Content",category:"theme",description:"Displays the contents of a post or page.",textdomain:"default",usesContext:["postId","postType","queryId"],supports:{align:["wide","full"],html:!1,layout:!0,dimensions:{minHeight:!0},spacing:{blockGap:!0},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!1,text:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}}},editorStyle:"wp-block-post-content-editor"},{name:w_}=k_,C_={icon:x_,edit:function({context:e,__unstableLayoutClassNames:t}){const{postId:o,postType:n}=e,r=(0,ot.useHasRecursion)(o);return o&&n&&r?(0,Je.jsx)(f_,{}):(0,Je.jsx)(ot.RecursionProvider,{uniqueId:o,children:o&&n?(0,Je.jsx)(y_,{context:e,layoutClassNames:t}):(0,Je.jsx)(v_,{layoutClassNames:t})})}},j_=()=>Xe({name:w_,metadata:k_,settings:C_});function S_(e){return/(?:^|[^\\])[aAgh]/.test(e)}const B_={attributes:{textAlign:{type:"string"},format:{type:"string"},isLink:{type:"boolean",default:!1}},supports:{html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalLetterSpacing:!0}},save:()=>null,migrate:so,isEligible:({style:e})=>e?.typography?.fontFamily},N_=[B_],T_=[{name:"post-date-modified",title:(0,tt.__)("Modified Date"),description:(0,tt.__)("Display a post's last updated date."),attributes:{displayType:"modified"},scope:["block","inserter"],isActive:e=>"modified"===e.displayType,icon:Tr}],I_=T_,P_={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-date",title:"Date",category:"theme",description:"Display the publish date for an entry such as a post or page.",textdomain:"default",attributes:{textAlign:{type:"string"},format:{type:"string"},isLink:{type:"boolean",default:!1},displayType:{type:"string",default:"date"}},usesContext:["postId","postType","queryId"],supports:{html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}},{name:M_}=P_,z_={icon:Tr,edit:function({attributes:{textAlign:e,format:t,isLink:o,displayType:n},context:{postId:r,postType:a,queryId:i},setAttributes:s}){const l=(0,ot.useBlockProps)({className:dt({[`has-text-align-${e}`]:e,"wp-block-post-date__modified-date":"modified"===n})}),[c,u]=(0,bt.useState)(null),d=(0,bt.useMemo)((()=>({anchor:c})),[c]),p=Number.isFinite(i),m=(0,Ir.getSettings)(),[g=m.formats.date]=(0,mt.useEntityProp)("root","site","date_format"),[h=m.formats.time]=(0,mt.useEntityProp)("root","site","time_format"),[x,b]=(0,mt.useEntityProp)("postType",a,n,r),_=(0,gt.useSelect)((e=>a?e(mt.store).getPostType(a):null),[a]),y="date"===n?(0,tt.__)("Post Date"):(0,tt.__)("Post Modified Date");let v=x?(0,Je.jsx)("time",{dateTime:(0,Ir.dateI18n)("c",x),ref:u,children:(0,Ir.dateI18n)(t||g,x)}):y;return o&&x&&(v=(0,Je.jsx)("a",{href:"#post-date-pseudo-link",onClick:e=>e.preventDefault(),children:v})),(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)(ot.BlockControls,{group:"block",children:[(0,Je.jsx)(ot.AlignmentControl,{value:e,onChange:e=>{s({textAlign:e})}}),x&&"date"===n&&!p&&(0,Je.jsx)(et.ToolbarGroup,{children:(0,Je.jsx)(et.Dropdown,{popoverProps:d,renderContent:({onClose:e})=>(0,Je.jsx)(ot.__experimentalPublishDateTimePicker,{currentDate:x,onChange:b,is12Hour:S_(h),onClose:e}),renderToggle:({isOpen:e,onToggle:t})=>(0,Je.jsx)(et.ToolbarButton,{"aria-expanded":e,icon:$s,title:(0,tt.__)("Change Date"),onClick:t,onKeyDown:o=>{e||o.keyCode!==fo.DOWN||(o.preventDefault(),t())}})})})]}),(0,Je.jsx)(ot.InspectorControls,{children:(0,Je.jsxs)(et.PanelBody,{title:(0,tt.__)("Settings"),children:[(0,Je.jsx)(ot.__experimentalDateFormatPicker,{format:t,defaultFormat:g,onChange:e=>s({format:e})}),(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:_?.labels.singular_name?(0,tt.sprintf)((0,tt.__)("Link to %s"),_.labels.singular_name.toLowerCase()):(0,tt.__)("Link to post"),onChange:()=>s({isLink:!o}),checked:o}),(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Display last modified date"),onChange:e=>s({displayType:e?"modified":"date"}),checked:"modified"===n,help:(0,tt.__)("Only shows if the post has been modified")})]})}),(0,Je.jsx)("div",{...l,children:v})]})},deprecated:N_,variations:I_},R_=()=>Xe({name:M_,metadata:P_,settings:z_}),A_=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M8.001 3.984V9.47c0 1.518-.98 2.5-2.499 2.5h-.5v-1.5h.5c.69 0 1-.31 1-1V6.984H4v-3h4.001ZM4 20h9v-1.5H4V20Zm16-4H4v-1.5h16V16ZM13.001 3.984V9.47c0 1.518-.98 2.5-2.499 2.5h-.5v-1.5h.5c.69 0 1-.31 1-1V6.984H9v-3h4.001Z"})});const L_={from:[{type:"block",blocks:["core/post-content"],transform:()=>(0,Qe.createBlock)("core/post-excerpt")}],to:[{type:"block",blocks:["core/post-content"],transform:()=>(0,Qe.createBlock)("core/post-content")}]},H_={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-excerpt",title:"Excerpt",category:"theme",description:"Display the excerpt.",textdomain:"default",attributes:{textAlign:{type:"string"},moreText:{type:"string"},showMoreOnNewLine:{type:"boolean",default:!0},excerptLength:{type:"number",default:55}},usesContext:["postId","postType","queryId"],supports:{html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-post-excerpt-editor",style:"wp-block-post-excerpt"},{name:D_}=H_,F_={icon:A_,transforms:L_,edit:function({attributes:{textAlign:e,moreText:t,showMoreOnNewLine:o,excerptLength:n},setAttributes:r,isSelected:a,context:{postId:i,postType:s,queryId:l}}){const c=Number.isFinite(l),u=qt("postType",s,i),[d,p,{rendered:m,protected:g}={}]=(0,mt.useEntityProp)("postType",s,"excerpt",i),h=(0,gt.useSelect)((e=>"page"===s||!!e(mt.store).getPostType(s)?.supports?.excerpt),[s]),x=u&&!c&&h,b=(0,ot.useBlockProps)({className:dt({[`has-text-align-${e}`]:e})}),_=(0,tt._x)("words","Word count type. Do not translate!"),y=(0,bt.useMemo)((()=>{if(!m)return"";const e=(new window.DOMParser).parseFromString(m,"text/html");return e.body.textContent||e.body.innerText||""}),[m]);if(!s||!i)return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.BlockControls,{children:(0,Je.jsx)(ot.AlignmentToolbar,{value:e,onChange:e=>r({textAlign:e})})}),(0,Je.jsx)("div",{...b,children:(0,Je.jsx)("p",{children:(0,tt.__)("This block will display the excerpt.")})})]});if(g&&!u)return(0,Je.jsx)("div",{...b,children:(0,Je.jsx)(ot.Warning,{children:(0,tt.__)("The content is currently protected and does not have the available excerpt.")})});const v=(0,Je.jsx)(ot.RichText,{identifier:"moreText",className:"wp-block-post-excerpt__more-link",tagName:"a","aria-label":(0,tt.__)("“Read more” link text"),placeholder:(0,tt.__)('Add "read more" link text'),value:t,onChange:e=>r({moreText:e}),withoutInteractiveFormatting:!0}),f=dt("wp-block-post-excerpt__excerpt",{"is-inline":!o}),k=(d||y).trim();let w="";if("words"===_)w=k.split(" ",n).join(" ");else if("characters_excluding_spaces"===_){const e=k.split("",n).join(""),t=e.length-e.replaceAll(" ","").length;w=k.split("",n+t).join("")}else"characters_including_spaces"===_&&(w=k.split("",n).join(""));const C=w!==k,j=x?(0,Je.jsx)(ot.RichText,{className:f,"aria-label":(0,tt.__)("Excerpt text"),value:a?k:(C?w+"…":k)||(0,tt.__)("No excerpt found"),onChange:p,tagName:"p"}):(0,Je.jsx)("p",{className:f,children:C?w+"…":k||(0,tt.__)("No excerpt found")});return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.BlockControls,{children:(0,Je.jsx)(ot.AlignmentToolbar,{value:e,onChange:e=>r({textAlign:e})})}),(0,Je.jsx)(ot.InspectorControls,{children:(0,Je.jsxs)(et.PanelBody,{title:(0,tt.__)("Settings"),children:[(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Show link on new line"),checked:o,onChange:e=>r({showMoreOnNewLine:e})}),(0,Je.jsx)(et.RangeControl,{label:(0,tt.__)("Max number of words"),value:n,onChange:e=>{r({excerptLength:e})},min:"10",max:"100"})]})}),(0,Je.jsxs)("div",{...b,children:[j,!o&&" ",o?(0,Je.jsx)("p",{className:"wp-block-post-excerpt__more-text",children:v}):v]})]})}},V_=()=>Xe({name:D_,metadata:H_,settings:F_}),E_=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"})}),$_=(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(et.__experimentalToggleGroupControlOption,{value:"cover",label:(0,tt._x)("Cover","Scale option for Image dimension control")}),(0,Je.jsx)(et.__experimentalToggleGroupControlOption,{value:"contain",label:(0,tt._x)("Contain","Scale option for Image dimension control")}),(0,Je.jsx)(et.__experimentalToggleGroupControlOption,{value:"fill",label:(0,tt._x)("Fill","Scale option for Image dimension control")})]}),G_="cover",O_={cover:(0,tt.__)("Image is scaled and cropped to fill the entire space without being distorted."),contain:(0,tt.__)("Image is scaled to fill the space without clipping nor distorting."),fill:(0,tt.__)("Image will be stretched and distorted to completely fill the space.")},U_=({clientId:e,attributes:{aspectRatio:t,width:o,height:n,scale:r,sizeSlug:a},setAttributes:i,media:s})=>{const[l,c,u,d]=(0,ot.useSettings)("spacing.units","dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios"),p=(0,et.__experimentalUseCustomUnits)({availableUnits:l||["px","%","vw","em","rem"]}),m=(0,gt.useSelect)((e=>e(ot.store).getSettings().imageSizes),[]).filter((({slug:e})=>s?.media_details?.sizes?.[e]?.source_url)).map((({name:e,slug:t})=>({value:t,label:e}))),g=(e,t)=>{const o=parseFloat(t);isNaN(o)&&t||i({[e]:o<0?"0":t})},h=(0,tt._x)("Scale","Image scaling options"),x=n||t&&"auto"!==t,b=u?.map((({name:e,ratio:t})=>({label:e,value:t}))),_=c?.map((({name:e,ratio:t})=>({label:e,value:t}))),y=[{label:(0,tt._x)("Original","Aspect ratio option for dimensions control"),value:"auto"},...d?_:[],...b||[]];return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(et.__experimentalToolsPanelItem,{hasValue:()=>!!t,label:(0,tt.__)("Aspect ratio"),onDeselect:()=>i({aspectRatio:void 0}),resetAllFilter:()=>({aspectRatio:void 0}),isShownByDefault:!0,panelId:e,children:(0,Je.jsx)(et.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Aspect ratio"),value:t,options:y,onChange:e=>i({aspectRatio:e})})}),(0,Je.jsx)(et.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>!!n,label:(0,tt.__)("Height"),onDeselect:()=>i({height:void 0}),resetAllFilter:()=>({height:void 0}),isShownByDefault:!0,panelId:e,children:(0,Je.jsx)(et.__experimentalUnitControl,{label:(0,tt.__)("Height"),labelPosition:"top",value:n||"",min:0,onChange:e=>g("height",e),units:p})}),(0,Je.jsx)(et.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>!!o,label:(0,tt.__)("Width"),onDeselect:()=>i({width:void 0}),resetAllFilter:()=>({width:void 0}),isShownByDefault:!0,panelId:e,children:(0,Je.jsx)(et.__experimentalUnitControl,{label:(0,tt.__)("Width"),labelPosition:"top",value:o||"",min:0,onChange:e=>g("width",e),units:p})}),x&&(0,Je.jsx)(et.__experimentalToolsPanelItem,{hasValue:()=>!!r&&r!==G_,label:h,onDeselect:()=>i({scale:G_}),resetAllFilter:()=>({scale:G_}),isShownByDefault:!0,panelId:e,children:(0,Je.jsx)(et.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:h,value:r,help:O_[r],onChange:e=>i({scale:e}),isBlock:!0,children:$_})}),!!m.length&&(0,Je.jsx)(et.__experimentalToolsPanelItem,{hasValue:()=>!!a,label:(0,tt.__)("Resolution"),onDeselect:()=>i({sizeSlug:void 0}),resetAllFilter:()=>({sizeSlug:void 0}),isShownByDefault:!1,panelId:e,children:(0,Je.jsx)(et.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Resolution"),value:a||"full",options:m,onChange:e=>i({sizeSlug:e}),help:(0,tt.__)("Select the size of the source image.")})})]})},q_=(0,Ut.compose)([(0,ot.withColors)({overlayColor:"background-color"})])((({clientId:e,attributes:t,setAttributes:o,overlayColor:n,setOverlayColor:r})=>{const{dimRatio:a}=t,{gradientValue:i,setGradient:s}=(0,ot.__experimentalUseGradient)(),l=(0,ot.__experimentalUseMultipleOriginColorsAndGradients)();return l.hasColorsOrGradients?(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.__experimentalColorGradientSettingsDropdown,{__experimentalIsRenderedInSidebar:!0,settings:[{colorValue:n.color,gradientValue:i,label:(0,tt.__)("Overlay"),onColorChange:r,onGradientChange:s,isShownByDefault:!0,resetAllFilter:()=>({overlayColor:void 0,customOverlayColor:void 0,gradient:void 0,customGradient:void 0})}],panelId:e,...l}),(0,Je.jsx)(et.__experimentalToolsPanelItem,{hasValue:()=>void 0!==a,label:(0,tt.__)("Overlay opacity"),onDeselect:()=>o({dimRatio:0}),resetAllFilter:()=>({dimRatio:0}),isShownByDefault:!0,panelId:e,children:(0,Je.jsx)(et.RangeControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Overlay opacity"),value:a,onChange:e=>o({dimRatio:e}),min:0,max:100,step:10,required:!0,__next40pxDefaultSize:!0})})]}):null}));const W_=(0,Ut.compose)([(0,ot.withColors)({overlayColor:"background-color"})])((({attributes:e,overlayColor:t})=>{const{dimRatio:o}=e,{gradientClass:n,gradientValue:r}=(0,ot.__experimentalUseGradient)(),a=(0,ot.__experimentalUseMultipleOriginColorsAndGradients)(),i=(0,ot.__experimentalUseBorderProps)(e),s={backgroundColor:t.color,backgroundImage:r,...i.style};return a.hasColorsOrGradients&&o?(0,Je.jsx)("span",{"aria-hidden":"true",className:dt("wp-block-post-featured-image__overlay",(l=o,void 0===l?null:"has-background-dim-"+10*Math.round(l/10)),{[t.class]:t.class,"has-background-dim":void 0!==o,"has-background-gradient":r,[n]:n},i.className),style:s}):null;var l})),Z_=["image"];const Q_={onClick:e=>e.preventDefault(),"aria-disabled":!0};const K_={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-featured-image",title:"Featured Image",category:"theme",description:"Display a post's featured image.",textdomain:"default",attributes:{isLink:{type:"boolean",default:!1},aspectRatio:{type:"string"},width:{type:"string"},height:{type:"string"},scale:{type:"string",default:"cover"},sizeSlug:{type:"string"},rel:{type:"string",attribute:"rel",default:""},linkTarget:{type:"string",default:"_self"},overlayColor:{type:"string"},customOverlayColor:{type:"string"},dimRatio:{type:"number",default:0},gradient:{type:"string"},customGradient:{type:"string"},useFirstImageFromPost:{type:"boolean",default:!1}},usesContext:["postId","postType","queryId"],supports:{align:["left","right","center","wide","full"],color:{text:!1,background:!1},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,width:!0}},filter:{duotone:!0},shadow:{__experimentalSkipSerialization:!0},html:!1,spacing:{margin:!0,padding:!0},interactivity:{clientNavigation:!0}},selectors:{border:".wp-block-post-featured-image img, .wp-block-post-featured-image .block-editor-media-placeholder, .wp-block-post-featured-image .wp-block-post-featured-image__overlay",shadow:".wp-block-post-featured-image img, .wp-block-post-featured-image .components-placeholder",filter:{duotone:".wp-block-post-featured-image img, .wp-block-post-featured-image .wp-block-post-featured-image__placeholder, .wp-block-post-featured-image .components-placeholder__illustration, .wp-block-post-featured-image .components-placeholder::before"}},editorStyle:"wp-block-post-featured-image-editor",style:"wp-block-post-featured-image"},{name:J_}=K_,Y_={icon:E_,edit:function({clientId:e,attributes:t,setAttributes:o,context:{postId:n,postType:r,queryId:a}}){const i=Number.isFinite(a),{isLink:s,aspectRatio:l,height:c,width:u,scale:d,sizeSlug:p,rel:m,linkTarget:g,useFirstImageFromPost:h}=t,[x,b]=(0,bt.useState)(),[_,y]=(0,mt.useEntityProp)("postType",r,"featured_media",n),[v]=(0,mt.useEntityProp)("postType",r,"content",n),f=(0,bt.useMemo)((()=>{if(_)return _;if(!h)return;const e=/).)*)?}\s+)?-->/.exec(v);return e?.groups?.attrs&&JSON.parse(e.groups.attrs)?.id}),[_,h,v]),{media:k,postType:w,postPermalink:C}=(0,gt.useSelect)((e=>{const{getMedia:t,getPostType:o,getEditedEntityRecord:a}=e(mt.store);return{media:f&&t(f,{context:"view"}),postType:r&&o(r),postPermalink:a("postType",r,n)?.link}}),[f,r,n]),j=function(e,t){return e?.media_details?.sizes?.[t]?.source_url||e?.source_url}(k,p),S=(0,ot.useBlockProps)({style:{width:u,height:c,aspectRatio:l},className:dt({"is-transient":x})}),B=(0,ot.__experimentalUseBorderProps)(t),N=(0,ot.__experimentalGetShadowClassesAndStyles)(t),T=(0,ot.useBlockEditingMode)(),I=e=>(0,Je.jsx)(et.Placeholder,{className:dt("block-editor-media-placeholder",B.className),withIllustration:!0,style:{height:!!l&&"100%",width:!!l&&"100%",...B.style,...N.style},children:e}),P=e=>{e?.id&&y(e.id),e?.url&&(0,It.isBlobURL)(e.url)&&b(e.url)};(0,bt.useEffect)((()=>{j&&x&&b()}),[j,x]);const{createErrorNotice:M}=(0,gt.useDispatch)(Pt.store),z=e=>{M(e,{type:"snackbar"}),b()},R="default"===T&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.InspectorControls,{group:"color",children:(0,Je.jsx)(q_,{attributes:t,setAttributes:o,clientId:e})}),(0,Je.jsx)(ot.InspectorControls,{group:"dimensions",children:(0,Je.jsx)(U_,{clientId:e,attributes:t,setAttributes:o,media:k})}),(0,Je.jsx)(ot.InspectorControls,{children:(0,Je.jsxs)(et.PanelBody,{title:(0,tt.__)("Settings"),children:[(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:w?.labels.singular_name?(0,tt.sprintf)((0,tt.__)("Link to %s"),w.labels.singular_name):(0,tt.__)("Link to post"),onChange:()=>o({isLink:!s}),checked:s}),s&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Open in new tab"),onChange:e=>o({linkTarget:e?"_blank":"_self"}),checked:"_blank"===g}),(0,Je.jsx)(et.TextControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Link rel"),value:m,onChange:e=>o({rel:e})})]})]})})]});let A;if(!f&&(i||!n))return(0,Je.jsxs)(Je.Fragment,{children:[R,(0,Je.jsxs)("div",{...S,children:[s?(0,Je.jsx)("a",{href:C,target:g,...Q_,children:I()}):I(),(0,Je.jsx)(W_,{attributes:t,setAttributes:o,clientId:e})]})]});const L=(0,tt.__)("Add a featured image"),H={...B.style,...N.style,height:l?"100%":c,width:!!l&&"100%",objectFit:!(!c&&!l)&&d};return A=f||x?k||x?(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("img",{className:B.className,src:x||j,alt:k&&k?.alt_text?(0,tt.sprintf)((0,tt.__)("Featured image: %s"),k.alt_text):(0,tt.__)("Featured image"),style:H}),x&&(0,Je.jsx)(et.Spinner,{})]}):I():(0,Je.jsx)(ot.MediaPlaceholder,{onSelect:P,accept:"image/*",allowedTypes:Z_,onError:z,placeholder:I,mediaLibraryButton:({open:e})=>(0,Je.jsx)(et.Button,{icon:ip,variant:"primary",label:L,showTooltip:!0,tooltipPosition:"top center",onClick:()=>{e()}})}),(0,Je.jsxs)(Je.Fragment,{children:[!x&&R,!!k&&!i&&(0,Je.jsx)(ot.BlockControls,{group:"other",children:(0,Je.jsx)(ot.MediaReplaceFlow,{mediaId:f,mediaURL:j,allowedTypes:Z_,accept:"image/*",onSelect:P,onError:z,children:(0,Je.jsx)(et.MenuItem,{onClick:()=>y(0),children:(0,tt.__)("Reset")})})}),(0,Je.jsxs)("figure",{...S,children:[s?(0,Je.jsx)("a",{href:C,target:g,...Q_,children:A}):A,(0,Je.jsx)(W_,{attributes:t,setAttributes:o,clientId:e})]})]})}},X_=()=>Xe({name:J_,metadata:K_,settings:Y_});const ey=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"})}),ty=(0,Je.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ke.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"})}),oy=[{isDefault:!0,name:"post-next",title:(0,tt.__)("Next post"),description:(0,tt.__)("Displays the post link that follows the current post."),icon:ey,attributes:{type:"next"},scope:["inserter","transform"]},{name:"post-previous",title:(0,tt.__)("Previous post"),description:(0,tt.__)("Displays the post link that precedes the current post."),icon:ty,attributes:{type:"previous"},scope:["inserter","transform"]}];oy.forEach((e=>{e.isActive||(e.isActive=(e,t)=>e.type===t.type)}));const ny=oy,ry={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-navigation-link",title:"Post Navigation Link",category:"theme",description:"Displays the next or previous post link that is adjacent to the current post.",textdomain:"default",attributes:{textAlign:{type:"string"},type:{type:"string",default:"next"},label:{type:"string"},showTitle:{type:"boolean",default:!1},linkLabel:{type:"boolean",default:!1},arrow:{type:"string",default:"none"},taxonomy:{type:"string",default:""}},usesContext:["postType"],supports:{reusable:!1,html:!1,color:{link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-post-navigation-link"},{name:ay}=ry,iy={edit:function({context:{postType:e},attributes:{type:t,label:o,showTitle:n,textAlign:r,linkLabel:a,arrow:i,taxonomy:s},setAttributes:l}){const c="next"===t;let u=c?(0,tt.__)("Next"):(0,tt.__)("Previous");const d={none:"",arrow:c?"→":"←",chevron:c?"»":"«"}[i];n&&(u=c?(0,tt.__)("Next: "):(0,tt.__)("Previous: "));const p=c?(0,tt.__)("Next post"):(0,tt.__)("Previous post"),m=(0,ot.useBlockProps)({className:dt({[`has-text-align-${r}`]:r})}),g=(0,gt.useSelect)((t=>{const{getTaxonomies:o}=t(mt.store);return o({type:e,per_page:-1})}),[e]);return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.InspectorControls,{children:(0,Je.jsxs)(et.PanelBody,{children:[(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Display the title as a link"),help:(0,tt.__)("If you have entered a custom label, it will be prepended before the title."),checked:!!n,onChange:()=>l({showTitle:!n})}),n&&(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Include the label as part of the link"),checked:!!a,onChange:()=>l({linkLabel:!a})}),(0,Je.jsxs)(et.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Arrow"),value:i,onChange:e=>{l({arrow:e})},help:(0,tt.__)("A decorative arrow for the next and previous link."),isBlock:!0,children:[(0,Je.jsx)(et.__experimentalToggleGroupControlOption,{value:"none",label:(0,tt._x)("None","Arrow option for Next/Previous link")}),(0,Je.jsx)(et.__experimentalToggleGroupControlOption,{value:"arrow",label:(0,tt._x)("Arrow","Arrow option for Next/Previous link")}),(0,Je.jsx)(et.__experimentalToggleGroupControlOption,{value:"chevron",label:(0,tt._x)("Chevron","Arrow option for Next/Previous link")})]})]})}),(0,Je.jsx)(ot.InspectorControls,{group:"advanced",children:(0,Je.jsx)(et.SelectControl,{label:(0,tt.__)("Filter by taxonomy"),value:s,options:[{label:(0,tt.__)("Unfiltered"),value:""},...(null!=g?g:[]).filter((({visibility:e})=>!!e?.publicly_queryable)).map((e=>({value:e.slug,label:e.name})))],onChange:e=>l({taxonomy:e}),help:(0,tt.__)("Only link to posts that have the same taxonomy terms as the current post. For example the same tags or categories.")})}),(0,Je.jsx)(ot.BlockControls,{children:(0,Je.jsx)(ot.AlignmentToolbar,{value:r,onChange:e=>{l({textAlign:e})}})}),(0,Je.jsxs)("div",{...m,children:[!c&&d&&(0,Je.jsx)("span",{className:`wp-block-post-navigation-link__arrow-previous is-arrow-${i}`,children:d}),(0,Je.jsx)(ot.RichText,{tagName:"a",identifier:"label","aria-label":p,placeholder:u,value:o,allowedFormats:["core/bold","core/italic"],onChange:e=>l({label:e})}),n&&(0,Je.jsx)("a",{href:"#post-navigation-pseudo-link",onClick:e=>e.preventDefault(),children:(0,tt.__)("An example title")}),c&&d&&(0,Je.jsx)("span",{className:`wp-block-post-navigation-link__arrow-next is-arrow-${i}`,"aria-hidden":!0,children:d})]})]})},variations:ny},sy=()=>Xe({name:ay,metadata:ry,settings:iy}),ly=[["core/post-title"],["core/post-date"],["core/post-excerpt"]];function cy({classList:e}){const t=(0,ot.useInnerBlocksProps)({className:dt("wp-block-post",e)},{template:ly,__unstableDisableLayoutClassNames:!0});return(0,Je.jsx)("li",{...t})}const uy=(0,bt.memo)((function({blocks:e,blockContextId:t,classList:o,isHidden:n,setActiveBlockContextId:r}){const a=(0,ot.__experimentalUseBlockPreview)({blocks:e,props:{className:dt("wp-block-post",o)}}),i=()=>{r(t)},s={display:n?"none":void 0};return(0,Je.jsx)("li",{...a,tabIndex:0,role:"button",onClick:i,onKeyPress:i,style:s})}));const dy={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-template",title:"Post Template",category:"theme",parent:["core/query"],description:"Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.",textdomain:"default",usesContext:["queryId","query","displayLayout","templateSlug","previewPostType","enhancedPagination"],supports:{reusable:!1,html:!1,align:["wide","full"],layout:!0,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{blockGap:{__experimentalDefault:"1.25em"},__experimentalDefaultControls:{blockGap:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-post-template",editorStyle:"wp-block-post-template-editor"},{name:py}=dy,my={icon:Zr,edit:function({setAttributes:e,clientId:t,context:{query:{perPage:o,offset:n=0,postType:r,order:a,orderBy:i,author:s,search:l,exclude:c,sticky:u,inherit:d,taxQuery:p,parents:m,pages:g,...h}={},templateSlug:x,previewPostType:b},attributes:{layout:_},__unstableLayoutClassNames:y}){const{type:v,columnCount:f=3}=_||{},[k,w]=(0,bt.useState)(),{posts:C,blocks:j}=(0,gt.useSelect)((e=>{const{getEntityRecords:g,getTaxonomies:_}=e(mt.store),{getBlocks:y}=e(ot.store),v=d&&x?.startsWith("category-")&&g("taxonomy","category",{context:"view",per_page:1,_fields:["id"],slug:x.replace("category-","")}),f={offset:n||0,order:a,orderby:i};if(p&&!d){const e=_({type:r,per_page:-1,context:"view"}),t=Object.entries(p).reduce(((t,[o,n])=>{const r=e?.find((({slug:e})=>e===o));return r?.rest_base&&(t[r?.rest_base]=n),t}),{});Object.keys(t).length&&Object.assign(f,t)}o&&(f.per_page=o),s&&(f.author=s),l&&(f.search=l),c?.length&&(f.exclude=c),m?.length&&(f.parent=m),u&&(f.sticky="only"===u),d&&(x?.startsWith("archive-")?(f.postType=x.replace("archive-",""),r=f.postType):v&&(f.categories=v[0]?.id));return{posts:g("postType",b||r,{...f,...h}),blocks:y(t)}}),[o,n,a,i,t,s,l,r,c,u,d,x,p,m,h,b]),S=(0,bt.useMemo)((()=>C?.map((e=>{var t;return{postType:e.type,postId:e.id,classList:null!==(t=e.class_list)&&void 0!==t?t:""}}))),[C]),B=(0,ot.useBlockProps)({className:dt(y,{[`columns-${f}`]:"grid"===v&&f})});if(!C)return(0,Je.jsx)("p",{...B,children:(0,Je.jsx)(et.Spinner,{})});if(!C.length)return(0,Je.jsxs)("p",{...B,children:[" ",(0,tt.__)("No results found.")]});const N=t=>e({layout:{..._,...t}}),T=[{icon:Pp,title:(0,tt._x)("List view","Post template block display setting"),onClick:()=>N({type:"default"}),isActive:"default"===v||"constrained"===v},{icon:nd,title:(0,tt._x)("Grid view","Post template block display setting"),onClick:()=>N({type:"grid",columnCount:f}),isActive:"grid"===v}];return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.BlockControls,{children:(0,Je.jsx)(et.ToolbarGroup,{controls:T})}),(0,Je.jsx)("ul",{...B,children:S&&S.map((e=>(0,Je.jsxs)(ot.BlockContextProvider,{value:e,children:[e.postId===(k||S[0]?.postId)?(0,Je.jsx)(cy,{classList:e.classList}):null,(0,Je.jsx)(uy,{blocks:j,blockContextId:e.postId,classList:e.classList,setActiveBlockContextId:w,isHidden:e.postId===(k||S[0]?.postId)})]},e.postId)))})]})},save:function(){return(0,Je.jsx)(ot.InnerBlocks.Content,{})}},gy=()=>Xe({name:py,metadata:dy,settings:my}),hy=(0,Je.jsx)(Ke.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ke.Path,{d:"M20 4H4v1.5h16V4zm-2 9h-3c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3zM4 9.5h9V8H4v1.5zM9 13H6c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3z",fillRule:"evenodd",clipRule:"evenodd"})}),xy=[];const by=["core/bold","core/image","core/italic","core/link","core/strikethrough","core/text-color"];const _y=(0,Je.jsx)(Ke.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ke.Path,{d:"M8.1 12.3c.1.1.3.3.5.3.2.1.4.1.6.1.2 0 .4 0 .6-.1.2-.1.4-.2.5-.3l3-3c.3-.3.5-.7.5-1.1 0-.4-.2-.8-.5-1.1L9.7 3.5c-.1-.2-.3-.3-.5-.3H5c-.4 0-.8.4-.8.8v4.2c0 .2.1.4.2.5l3.7 3.6zM5.8 4.8h3.1l3.4 3.4v.1l-3 3 .5.5-.7-.5-3.3-3.4V4.8zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})}),yy={category:hy,post_tag:_y};function vy(e,t){if("core/post-terms"!==t)return e;const o=e.variations.map((e=>{var t;return{...e,icon:null!==(t=yy[e.name])&&void 0!==t?t:hy}}));return{...e,variations:o}}const fy={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-terms",title:"Post Terms",category:"theme",description:"Post terms.",textdomain:"default",attributes:{term:{type:"string"},textAlign:{type:"string"},separator:{type:"string",default:", "},prefix:{type:"string",default:""},suffix:{type:"string",default:""}},usesContext:["postId","postType"],supports:{html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-post-terms"},{name:ky}=fy,wy={icon:hy,edit:function({attributes:e,clientId:t,context:o,isSelected:n,setAttributes:r,insertBlocksAfter:a}){const{term:i,textAlign:s,separator:l,prefix:c,suffix:u}=e,{postId:d,postType:p}=o,m=(0,gt.useSelect)((e=>{if(!i)return{};const{getTaxonomy:t}=e(mt.store),o=t(i);return o?.visibility?.publicly_queryable?o:{}}),[i]),{postTerms:g,hasPostTerms:h,isLoading:x}=function({postId:e,term:t}){const{slug:o}=t;return(0,gt.useSelect)((n=>{const r=t?.visibility?.publicly_queryable;if(!r)return{postTerms:xy,isLoading:!1,hasPostTerms:!1};const{getEntityRecords:a,isResolving:i}=n(mt.store),s=["taxonomy",o,{post:e,per_page:-1,context:"view"}],l=a(...s);return{postTerms:l,isLoading:i("getEntityRecords",s),hasPostTerms:!!l?.length}}),[e,t?.visibility?.publicly_queryable,o])}({postId:d,term:m}),b=d&&p,_=(0,ot.useBlockDisplayInformation)(t),y=(0,ot.useBlockProps)({className:dt({[`has-text-align-${s}`]:s,[`taxonomy-${i}`]:i})});return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.BlockControls,{children:(0,Je.jsx)(ot.AlignmentToolbar,{value:s,onChange:e=>{r({textAlign:e})}})}),(0,Je.jsx)(ot.InspectorControls,{group:"advanced",children:(0,Je.jsx)(et.TextControl,{__nextHasNoMarginBottom:!0,autoComplete:"off",label:(0,tt.__)("Separator"),value:l||"",onChange:e=>{r({separator:e})},help:(0,tt.__)("Enter character(s) used to separate terms.")})}),(0,Je.jsxs)("div",{...y,children:[x&&b&&(0,Je.jsx)(et.Spinner,{}),!x&&(n||c)&&(0,Je.jsx)(ot.RichText,{identifier:"prefix",allowedFormats:by,className:"wp-block-post-terms__prefix","aria-label":(0,tt.__)("Prefix"),placeholder:(0,tt.__)("Prefix")+" ",value:c,onChange:e=>r({prefix:e}),tagName:"span"}),(!b||!i)&&(0,Je.jsx)("span",{children:_.title}),b&&!x&&h&&g.map((e=>(0,Je.jsx)("a",{href:e.link,onClick:e=>e.preventDefault(),children:(0,Xo.decodeEntities)(e.name)},e.id))).reduce(((e,t)=>(0,Je.jsxs)(Je.Fragment,{children:[e,(0,Je.jsx)("span",{className:"wp-block-post-terms__separator",children:l||" "}),t]}))),b&&!x&&!h&&(m?.labels?.no_terms||(0,tt.__)("Term items not found.")),!x&&(n||u)&&(0,Je.jsx)(ot.RichText,{identifier:"suffix",allowedFormats:by,className:"wp-block-post-terms__suffix","aria-label":(0,tt.__)("Suffix"),placeholder:" "+(0,tt.__)("Suffix"),value:u,onChange:e=>r({suffix:e}),tagName:"span",__unstableOnSplitAtEnd:()=>a((0,Qe.createBlock)((0,Qe.getDefaultBlockName)()))})]})]})}},Cy=()=>((0,fs.addFilter)("blocks.registerBlockType","core/template-part",vy),Xe({name:ky,metadata:fy,settings:wy})),jy=window.wp.wordcount;const Sy=function({attributes:e,setAttributes:t,context:o}){const{textAlign:n}=e,{postId:r,postType:a}=o,[i]=(0,mt.useEntityProp)("postType",a,"content",r),[s]=(0,mt.useEntityBlockEditor)("postType",a,{id:r}),l=(0,bt.useMemo)((()=>{let e;e=i instanceof Function?i({blocks:s}):s?(0,Qe.__unstableSerializeAndClean)(s):i;const t=(0,tt._x)("words","Word count type. Do not translate!"),o=Math.max(1,Math.round((0,jy.count)(e||"",t)/189));return(0,tt.sprintf)((0,tt._n)("%d minute","%d minutes",o),o)}),[i,s]),c=(0,ot.useBlockProps)({className:dt({[`has-text-align-${n}`]:n})});return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.BlockControls,{group:"block",children:(0,Je.jsx)(ot.AlignmentControl,{value:n,onChange:e=>{t({textAlign:e})}})}),(0,Je.jsx)("div",{...c,children:l})]})},By=(0,Je.jsx)(et.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:(0,Je.jsx)(et.Path,{d:"M12 3c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16.5c-4.1 0-7.5-3.4-7.5-7.5S7.9 4.5 12 4.5s7.5 3.4 7.5 7.5-3.4 7.5-7.5 7.5zM12 7l-1 5c0 .3.2.6.4.8l4.2 2.8-2.7-4.1L12 7z"})}),Ny={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:!0,name:"core/post-time-to-read",title:"Time To Read",category:"theme",description:"Show minutes required to finish reading the post.",textdomain:"default",usesContext:["postId","postType"],attributes:{textAlign:{type:"string"}},supports:{color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},html:!1,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}},{name:Ty}=Ny,Iy={icon:By,edit:Sy},Py=()=>Xe({name:Ty,metadata:Ny,settings:Iy});const My={attributes:{textAlign:{type:"string"},level:{type:"number",default:2},isLink:{type:"boolean",default:!1},rel:{type:"string",attribute:"rel",default:""},linkTarget:{type:"string",default:"_self"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0},spacing:{margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0}},save:()=>null,migrate:so,isEligible:({style:e})=>e?.typography?.fontFamily},zy=[My],Ry={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-title",title:"Title",category:"theme",description:"Displays the title of a post, page, or any other content-type.",textdomain:"default",usesContext:["postId","postType","queryId"],attributes:{textAlign:{type:"string"},level:{type:"number",default:2},isLink:{type:"boolean",default:!1},rel:{type:"string",attribute:"rel",default:""},linkTarget:{type:"string",default:"_self"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-post-title"},{name:Ay}=Ry,Ly={icon:Pa,edit:function({attributes:{level:e,textAlign:t,isLink:o,rel:n,linkTarget:r},setAttributes:a,context:{postType:i,postId:s,queryId:l},insertBlocksAfter:c}){const u=0===e?"p":`h${e}`,d=Number.isFinite(l),p=(0,gt.useSelect)((e=>!d&&e(mt.store).canUserEditEntityRecord("postType",i,s)),[d,i,s]),[m="",g,h]=(0,mt.useEntityProp)("postType",i,"title",s),[x]=(0,mt.useEntityProp)("postType",i,"link",s),b=()=>{c((0,Qe.createBlock)((0,Qe.getDefaultBlockName)()))},_=(0,ot.useBlockProps)({className:dt({[`has-text-align-${t}`]:t})}),y=(0,ot.useBlockEditingMode)();let v=(0,Je.jsx)(u,{..._,children:(0,tt.__)("Title")});return i&&s&&(v=p?(0,Je.jsx)(ot.PlainText,{tagName:u,placeholder:(0,tt.__)("No Title"),value:m,onChange:g,__experimentalVersion:2,__unstableOnSplitAtEnd:b,..._}):(0,Je.jsx)(u,{..._,dangerouslySetInnerHTML:{__html:h?.rendered}})),o&&i&&s&&(v=p?(0,Je.jsx)(u,{..._,children:(0,Je.jsx)(ot.PlainText,{tagName:"a",href:x,target:r,rel:n,placeholder:m.length?null:(0,tt.__)("No Title"),value:m,onChange:g,__experimentalVersion:2,__unstableOnSplitAtEnd:b})}):(0,Je.jsx)(u,{..._,children:(0,Je.jsx)("a",{href:x,target:r,rel:n,onClick:e=>e.preventDefault(),dangerouslySetInnerHTML:{__html:h?.rendered}})})),(0,Je.jsxs)(Je.Fragment,{children:["default"===y&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)(ot.BlockControls,{group:"block",children:[(0,Je.jsx)(ot.HeadingLevelDropdown,{value:e,onChange:e=>a({level:e})}),(0,Je.jsx)(ot.AlignmentControl,{value:t,onChange:e=>{a({textAlign:e})}})]}),(0,Je.jsx)(ot.InspectorControls,{children:(0,Je.jsxs)(et.PanelBody,{title:(0,tt.__)("Settings"),children:[(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Make title a link"),onChange:()=>a({isLink:!o}),checked:o}),o&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Open in new tab"),onChange:e=>a({linkTarget:e?"_blank":"_self"}),checked:"_blank"===r}),(0,Je.jsx)(et.TextControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Link rel"),value:n,onChange:e=>a({rel:e})})]})]})})]}),v]})},deprecated:zy},Hy=()=>Xe({name:Ay,metadata:Ry,settings:Ly}),Dy=(0,Je.jsx)(Ke.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ke.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 16.5h6V15H7v1.5zm4-4h6V11h-6v1.5zM9 11H7v1.5h2V11zm6 5.5h2V15h-2v1.5z"})});const Fy={from:[{type:"block",blocks:["core/code","core/paragraph"],transform:({content:e,anchor:t})=>(0,Qe.createBlock)("core/preformatted",{content:e,anchor:t})},{type:"raw",isMatch:e=>"PRE"===e.nodeName&&!(1===e.children.length&&"CODE"===e.firstChild.nodeName),schema:({phrasingContentSchema:e})=>({pre:{children:e}})}],to:[{type:"block",blocks:["core/paragraph"],transform:e=>(0,Qe.createBlock)("core/paragraph",e)},{type:"block",blocks:["core/code"],transform:e=>(0,Qe.createBlock)("core/code",e)}]},Vy=Fy,Ey={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/preformatted",title:"Preformatted",category:"text",description:"Add text that respects your spacing and tabs, and also allows styling.",textdomain:"default",attributes:{content:{type:"rich-text",source:"rich-text",selector:"pre",__unstablePreserveWhiteSpace:!0,__experimentalRole:"content"}},supports:{anchor:!0,color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{padding:!0,margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-preformatted"},{name:$y}=Ey,Gy={icon:Dy,example:{attributes:{content:(0,tt.__)("EXT. XANADU - FAINT DAWN - 1940 (MINIATURE)\nWindow, very small in the distance, illuminated.\nAll around this is an almost totally black screen. Now, as the camera moves slowly towards the window which is almost a postage stamp in the frame, other forms appear;")}},transforms:Vy,edit:function({attributes:e,mergeBlocks:t,setAttributes:o,onRemove:n,insertBlocksAfter:r,style:a}){const{content:i}=e,s=(0,ot.useBlockProps)({style:a});return(0,Je.jsx)(ot.RichText,{tagName:"pre",identifier:"content",preserveWhiteSpace:!0,value:i,onChange:e=>{o({content:e})},onRemove:n,"aria-label":(0,tt.__)("Preformatted text"),placeholder:(0,tt.__)("Write preformatted text…"),onMerge:t,...s,__unstablePastePlainText:!0,__unstableOnSplitAtDoubleLineEnd:()=>r((0,Qe.createBlock)((0,Qe.getDefaultBlockName)()))})},save:function({attributes:e}){const{content:t}=e;return(0,Je.jsx)("pre",{...ot.useBlockProps.save(),children:(0,Je.jsx)(ot.RichText.Content,{value:t})})},merge:(e,t)=>({content:e.content+"\n\n"+t.content})},Oy=()=>Xe({name:$y,metadata:Ey,settings:Gy}),Uy=(0,Je.jsx)(Ke.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ke.Path,{d:"M18 8H6c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v4zM4 4v1.5h16V4H4zm0 16h16v-1.5H4V20z"})}),qy="is-style-solid-color",Wy={value:{type:"string",source:"html",selector:"blockquote",multiline:"p"},citation:{type:"string",source:"html",selector:"cite",default:""},mainColor:{type:"string"},customMainColor:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"}};function Zy(e){if(!e)return;const t=e.match(/border-color:([^;]+)[;]?/);return t&&t[1]?t[1]:void 0}function Qy(e){const t=`${e=e||""}`.split("
");return t.shift(),t.pop(),t.join("
")}const Ky={attributes:{value:{type:"string",source:"html",selector:"blockquote",multiline:"p",__experimentalRole:"content"},citation:{type:"string",source:"html",selector:"cite",default:"",__experimentalRole:"content"},textAlign:{type:"string"}},save({attributes:e}){const{textAlign:t,citation:o,value:n}=e,r=!ot.RichText.isEmpty(o);return(0,Je.jsx)("figure",{...ot.useBlockProps.save({className:dt({[`has-text-align-${t}`]:t})}),children:(0,Je.jsxs)("blockquote",{children:[(0,Je.jsx)(ot.RichText.Content,{value:n,multiline:!0}),r&&(0,Je.jsx)(ot.RichText.Content,{tagName:"cite",value:o})]})})},migrate:({value:e,...t})=>({value:Qy(e),...t})},Jy={attributes:{...Wy},save({attributes:e}){const{mainColor:t,customMainColor:o,customTextColor:n,textColor:r,value:a,citation:i,className:s}=e,l=s?.includes(qy);let c,u;if(l){const e=(0,ot.getColorClassName)("background-color",t);c=dt({"has-background":e||o,[e]:e}),u={backgroundColor:e?void 0:o}}else o&&(u={borderColor:o});const d=(0,ot.getColorClassName)("color",r),p=dt({"has-text-color":r||n,[d]:d}),m=d?void 0:{color:n};return(0,Je.jsx)("figure",{...ot.useBlockProps.save({className:c,style:u}),children:(0,Je.jsxs)("blockquote",{className:p,style:m,children:[(0,Je.jsx)(ot.RichText.Content,{value:a,multiline:!0}),!ot.RichText.isEmpty(i)&&(0,Je.jsx)(ot.RichText.Content,{tagName:"cite",value:i})]})})},migrate({value:e,className:t,mainColor:o,customMainColor:n,customTextColor:r,...a}){const i=t?.includes(qy);let s;return n&&(s=i?{color:{background:n}}:{border:{color:n}}),r&&s&&(s.color={...s.color,text:r}),{value:Qy(e),className:t,backgroundColor:i?o:void 0,borderColor:i?void 0:o,textAlign:i?"left":void 0,style:s,...a}}},Yy={attributes:{...Wy,figureStyle:{source:"attribute",selector:"figure",attribute:"style"}},save({attributes:e}){const{mainColor:t,customMainColor:o,textColor:n,customTextColor:r,value:a,citation:i,className:s,figureStyle:l}=e,c=s?.includes(qy);let u,d;if(c){const e=(0,ot.getColorClassName)("background-color",t);u=dt({"has-background":e||o,[e]:e}),d={backgroundColor:e?void 0:o}}else if(o)d={borderColor:o};else if(t){d={borderColor:Zy(l)}}const p=(0,ot.getColorClassName)("color",n),m=(n||r)&&dt("has-text-color",{[p]:p}),g=p?void 0:{color:r};return(0,Je.jsx)("figure",{className:u,style:d,children:(0,Je.jsxs)("blockquote",{className:m,style:g,children:[(0,Je.jsx)(ot.RichText.Content,{value:a,multiline:!0}),!ot.RichText.isEmpty(i)&&(0,Je.jsx)(ot.RichText.Content,{tagName:"cite",value:i})]})})},migrate({value:e,className:t,figureStyle:o,mainColor:n,customMainColor:r,customTextColor:a,...i}){const s=t?.includes(qy);let l;if(r&&(l=s?{color:{background:r}}:{border:{color:r}}),a&&l&&(l.color={...l.color,text:a}),!s&&n&&o){const n=Zy(o);if(n)return{value:Qy(e),...i,className:t,style:{border:{color:n}}}}return{value:Qy(e),className:t,backgroundColor:s?n:void 0,borderColor:s?void 0:n,textAlign:s?"left":void 0,style:l,...i}}},Xy={attributes:Wy,save({attributes:e}){const{mainColor:t,customMainColor:o,textColor:n,customTextColor:r,value:a,citation:i,className:s}=e,l=s?.includes(qy);let c,u;if(l)c=(0,ot.getColorClassName)("background-color",t),c||(u={backgroundColor:o});else if(o)u={borderColor:o};else if(t){var d;const e=null!==(d=(0,gt.select)(ot.store).getSettings().colors)&&void 0!==d?d:[];u={borderColor:(0,ot.getColorObjectByAttributeValues)(e,t).color}}const p=(0,ot.getColorClassName)("color",n),m=n||r?dt("has-text-color",{[p]:p}):void 0,g=p?void 0:{color:r};return(0,Je.jsx)("figure",{className:c,style:u,children:(0,Je.jsxs)("blockquote",{className:m,style:g,children:[(0,Je.jsx)(ot.RichText.Content,{value:a,multiline:!0}),!ot.RichText.isEmpty(i)&&(0,Je.jsx)(ot.RichText.Content,{tagName:"cite",value:i})]})})},migrate({value:e,className:t,mainColor:o,customMainColor:n,customTextColor:r,...a}){const i=t?.includes(qy);let s={};return n&&(s=i?{color:{background:n}}:{border:{color:n}}),r&&s&&(s.color={...s.color,text:r}),{value:Qy(e),className:t,backgroundColor:i?o:void 0,borderColor:i?void 0:o,textAlign:i?"left":void 0,style:s,...a}}},ev={attributes:{...Wy},save({attributes:e}){const{value:t,citation:o}=e;return(0,Je.jsxs)("blockquote",{children:[(0,Je.jsx)(ot.RichText.Content,{value:t,multiline:!0}),!ot.RichText.isEmpty(o)&&(0,Je.jsx)(ot.RichText.Content,{tagName:"cite",value:o})]})},migrate:({value:e,...t})=>({value:Qy(e),...t})},tv={attributes:{...Wy,citation:{type:"string",source:"html",selector:"footer"},align:{type:"string",default:"none"}},save({attributes:e}){const{value:t,citation:o,align:n}=e;return(0,Je.jsxs)("blockquote",{className:`align${n}`,children:[(0,Je.jsx)(ot.RichText.Content,{value:t,multiline:!0}),!ot.RichText.isEmpty(o)&&(0,Je.jsx)(ot.RichText.Content,{tagName:"footer",value:o})]})},migrate:({value:e,...t})=>({value:Qy(e),...t})},ov=[Ky,Jy,Yy,Xy,ev,tv],nv="web"===bt.Platform.OS;const rv=function({attributes:e,setAttributes:t,isSelected:o,insertBlocksAfter:n}){const{textAlign:r,citation:a,value:i}=e,s=(0,ot.useBlockProps)({className:dt({[`has-text-align-${r}`]:r})}),l=!ot.RichText.isEmpty(a)||o;return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ot.BlockControls,{group:"block",children:(0,Je.jsx)(ot.AlignmentControl,{value:r,onChange:e=>{t({textAlign:e})}})}),(0,Je.jsx)("figure",{...s,children:(0,Je.jsxs)("blockquote",{children:[(0,Je.jsx)(ot.RichText,{identifier:"value",tagName:"p",value:i,onChange:e=>t({value:e}),"aria-label":(0,tt.__)("Pullquote text"),placeholder:(0,tt.__)("Add quote"),textAlign:"center"}),l&&(0,Je.jsx)(ot.RichText,{identifier:"citation",tagName:nv?"cite":void 0,style:{display:"block"},value:a,"aria-label":(0,tt.__)("Pullquote citation text"),placeholder:(0,tt.__)("Add citation"),onChange:e=>t({citation:e}),className:"wp-block-pullquote__citation",__unstableMobileNoFocusOnMount:!0,textAlign:"center",__unstableOnSplitAtEnd:()=>n((0,Qe.createBlock)((0,Qe.getDefaultBlockName)()))})]})})]})};const av={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>(0,Qe.createBlock)("core/pullquote",{value:(0,Ao.toHTMLString)({value:(0,Ao.join)(e.map((({content:e})=>(0,Ao.create)({html:e}))),"\n")}),anchor:e.anchor})},{type:"block",blocks:["core/heading"],transform:({content:e,anchor:t})=>(0,Qe.createBlock)("core/pullquote",{value:e,anchor:t})}],to:[{type:"block",blocks:["core/paragraph"],transform:({value:e,citation:t})=>{const o=[];return e&&o.push((0,Qe.createBlock)("core/paragraph",{content:e})),t&&o.push((0,Qe.createBlock)("core/paragraph",{content:t})),0===o.length?(0,Qe.createBlock)("core/paragraph",{content:""}):o}},{type:"block",blocks:["core/heading"],transform:({value:e,citation:t})=>{if(!e)return(0,Qe.createBlock)("core/heading",{content:t});const o=(0,Qe.createBlock)("core/heading",{content:e});return t?[o,(0,Qe.createBlock)("core/heading",{content:t})]:o}}]},iv=av,sv={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/pullquote",title:"Pullquote",category:"text",description:"Give special visual emphasis to a quote from your text.",textdomain:"default",attributes:{value:{type:"rich-text",source:"rich-text",selector:"p",__experimentalRole:"content"},citation:{type:"rich-text",source:"rich-text",selector:"cite",__experimentalRole:"content"},textAlign:{type:"string"}},supports:{anchor:!0,align:["left","right","wide","full"],color:{gradients:!0,background:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},__experimentalStyle:{typography:{fontSize:"1.5em",lineHeight:"1.6"}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-pullquote-editor",style:"wp-block-pullquote"},{name:lv}=sv,cv={icon:Uy,example:{attributes:{value:(0,tt.__)("One of the hardest things to do in technology is disrupt yourself."),citation:(0,tt.__)("Matt Mullenweg")}},transforms:iv,edit:rv,save:function({attributes:e}){const{textAlign:t,citation:o,value:n}=e,r=!ot.RichText.isEmpty(o);return(0,Je.jsx)("figure",{...ot.useBlockProps.save({className:dt({[`has-text-align-${t}`]:t})}),children:(0,Je.jsxs)("blockquote",{children:[(0,Je.jsx)(ot.RichText.Content,{tagName:"p",value:n}),r&&(0,Je.jsx)(ot.RichText.Content,{tagName:"cite",value:o})]})})},deprecated:ov},uv=()=>Xe({name:lv,metadata:sv,settings:cv}),dv=(0,Je.jsx)(Ke.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ke.Path,{d:"M18.1823 11.6392C18.1823 13.0804 17.0139 14.2487 15.5727 14.2487C14.3579 14.2487 13.335 13.4179 13.0453 12.2922L13.0377 12.2625L13.0278 12.2335L12.3985 10.377L12.3942 10.3785C11.8571 8.64997 10.246 7.39405 8.33961 7.39405C5.99509 7.39405 4.09448 9.29465 4.09448 11.6392C4.09448 13.9837 5.99509 15.8843 8.33961 15.8843C8.88499 15.8843 9.40822 15.781 9.88943 15.5923L9.29212 14.0697C8.99812 14.185 8.67729 14.2487 8.33961 14.2487C6.89838 14.2487 5.73003 13.0804 5.73003 11.6392C5.73003 10.1979 6.89838 9.02959 8.33961 9.02959C9.55444 9.02959 10.5773 9.86046 10.867 10.9862L10.8772 10.9836L11.4695 12.7311C11.9515 14.546 13.6048 15.8843 15.5727 15.8843C17.9172 15.8843 19.8178 13.9837 19.8178 11.6392C19.8178 9.29465 17.9172 7.39404 15.5727 7.39404C15.0287 7.39404 14.5066 7.4968 14.0264 7.6847L14.6223 9.20781C14.9158 9.093 15.2358 9.02959 15.5727 9.02959C17.0139 9.02959 18.1823 10.1979 18.1823 11.6392Z"})}),pv=(0,Je.jsxs)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Je.jsx)(Ke.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,Je.jsx)(Ke.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})]}),mv=e=>{const t=e?.reduce(((e,t)=>{const{mapById:o,mapByName:n,names:r}=e;return o[t.id]=t,n[t.name]=t,r.push(t.name),e}),{mapById:{},mapByName:{},names:[]});return{entities:e,...t}},gv=(e,t)=>{const o=t.split(".");let n=e;return o.forEach((e=>{n=n?.[e]})),n},hv=(e,t)=>(e||[]).map((e=>({...e,name:(0,Xo.decodeEntities)(gv(e,t))}))),xv=()=>{const e=(0,gt.useSelect)((e=>{const{getPostTypes:t}=e(mt.store),o=["attachment"],n=t({per_page:-1})?.filter((({viewable:e,slug:t})=>e&&!o.includes(t)));return n}),[]);return{postTypesTaxonomiesMap:(0,bt.useMemo)((()=>{if(e?.length)return e.reduce(((e,t)=>(e[t.slug]=t.taxonomies,e)),{})}),[e]),postTypesSelectOptions:(0,bt.useMemo)((()=>(e||[]).map((({labels:e,slug:t})=>({label:e.singular_name,value:t})))),[e])}},bv=e=>{const t=(0,gt.useSelect)((t=>{const{getTaxonomies:o}=t(mt.store);return o({type:e,per_page:-1})}),[e]);return(0,bt.useMemo)((()=>t?.filter((({visibility:e})=>!!e?.publicly_queryable))),[t])};function _v(e,t){return!e||e.includes(t)}function yv(e,t){const o=(0,gt.useSelect)((e=>e(Qe.store).getActiveBlockVariation("core/query",t)?.name),[t]),n=`core/query/${o}`;return(0,gt.useSelect)((t=>{if(!o)return!1;const{getBlockRootClientId:r,getPatternsByBlockTypes:a}=t(ot.store),i=r(e);return a(n,i).length>0}),[e,o,n])?n:"core/query"}const vv=(e,t)=>(0,gt.useSelect)((o=>{const{getBlockRootClientId:n,getPatternsByBlockTypes:r}=o(ot.store),a=n(e);return r(t,a)}),[t,e]),fv=e=>(0,gt.useSelect)((t=>{const{getClientIdsOfDescendants:o,getBlockName:n}=t(ot.store),r={};return o(e).forEach((e=>{const t=n(e),o=Object.is((0,Qe.getBlockSupport)(t,"interactivity"),!0),a=(0,Qe.getBlockSupport)(t,"interactivity.clientNavigation");o||a?"core/post-content"===t&&(r.hasPostContentBlock=!0):r.hasBlocksFromPlugins=!0})),r.hasUnsupportedBlocks=r.hasBlocksFromPlugins||r.hasPostContentBlock,r}),[e]);function kv({attributes:{query:e},setQuery:t,openPatternSelectionModal:o,name:n,clientId:r}){const a=!!vv(r,n).length,i=(0,Ut.useInstanceId)(kv,"blocks-query-pagination-max-page-input");return(0,Je.jsxs)(Je.Fragment,{children:[!e.inherit&&(0,Je.jsx)(et.ToolbarGroup,{children:(0,Je.jsx)(et.Dropdown,{contentClassName:"block-library-query-toolbar__popover",renderToggle:({onToggle:e})=>(0,Je.jsx)(et.ToolbarButton,{icon:pv,label:(0,tt.__)("Display settings"),onClick:e}),renderContent:()=>(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(et.BaseControl,{children:(0,Je.jsx)(et.__experimentalNumberControl,{__unstableInputWidth:"60px",label:(0,tt.__)("Items per Page"),labelPosition:"edge",min:1,max:100,onChange:e=>{isNaN(e)||e<1||e>100||t({perPage:e})},step:"1",value:e.perPage,isDragEnabled:!1})}),(0,Je.jsx)(et.BaseControl,{children:(0,Je.jsx)(et.__experimentalNumberControl,{__unstableInputWidth:"60px",label:(0,tt.__)("Offset"),labelPosition:"edge",min:0,max:100,onChange:e=>{isNaN(e)||e<0||e>100||t({offset:e})},step:"1",value:e.offset,isDragEnabled:!1})}),(0,Je.jsx)(et.BaseControl,{id:i,help:(0,tt.__)("Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero)."),children:(0,Je.jsx)(et.__experimentalNumberControl,{id:i,__unstableInputWidth:"60px",label:(0,tt.__)("Max page to show"),labelPosition:"edge",min:0,onChange:e=>{isNaN(e)||e<0||t({pages:e})},step:"1",value:e.pages,isDragEnabled:!1})})]})})}),a&&(0,Je.jsx)(et.ToolbarGroup,{className:"wp-block-template-part__block-control-group",children:(0,Je.jsx)(et.ToolbarButton,{onClick:o,children:(0,tt.__)("Replace")})})]})}const wv=[{label:(0,tt.__)("Newest to oldest"),value:"date/desc"},{label:(0,tt.__)("Oldest to newest"),value:"date/asc"},{label:(0,tt.__)("A → Z"),value:"title/asc"},{label:(0,tt.__)("Z → A"),value:"title/desc"}];const Cv=function({order:e,orderBy:t,onChange:o}){return(0,Je.jsx)(et.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Order by"),value:`${t}/${e}`,options:wv,onChange:e=>{const[t,n]=e.split("/");o({order:n,orderBy:t})}})},jv={who:"authors",per_page:-1,_fields:"id,name",context:"view"};const Sv=function({value:e,onChange:t}){const o=(0,gt.useSelect)((e=>{const{getUsers:t}=e(mt.store);return t(jv)}),[]);if(!o)return null;const n=mv(o),r=(e?e.toString().split(","):[]).reduce(((e,t)=>{const o=n.mapById[t];return o&&e.push({id:t,value:o.name}),e}),[]);return(0,Je.jsx)(et.FormTokenField,{label:(0,tt.__)("Authors"),value:r,suggestions:n.names,onChange:e=>{const o=Array.from(e.reduce(((e,t)=>{const o=((e,t)=>{const o=t?.id||e[t]?.id;if(o)return o})(n.mapByName,t);return o&&e.add(o),e}),new Set));t({author:o.join(",")})},__experimentalShowHowTo:!1})},Bv=[],Nv={order:"asc",_fields:"id,title",context:"view"};const Tv=function({parents:e,postType:t,onChange:o}){const[n,r]=(0,bt.useState)(""),[a,i]=(0,bt.useState)(Bv),[s,l]=(0,bt.useState)(Bv),c=(0,Ut.useDebounce)(r,250),{searchResults:u,searchHasResolved:d}=(0,gt.useSelect)((o=>{if(!n)return{searchResults:Bv,searchHasResolved:!0};const{getEntityRecords:r,hasFinishedResolution:a}=o(mt.store),i=["postType",t,{...Nv,search:n,orderby:"relevance",exclude:e,per_page:20}];return{searchResults:r(...i),searchHasResolved:a("getEntityRecords",i)}}),[n,e]),p=(0,gt.useSelect)((o=>{if(!e?.length)return Bv;const{getEntityRecords:n}=o(mt.store);return n("postType",t,{...Nv,include:e,per_page:e.length})}),[e]);(0,bt.useEffect)((()=>{if(e?.length||i(Bv),!p?.length)return;const t=mv(hv(p,"title.rendered")),o=e.reduce(((e,o)=>{const n=t.mapById[o];return n&&e.push({id:o,value:n.name}),e}),[]);i(o)}),[e,p]);const m=(0,bt.useMemo)((()=>u?.length?mv(hv(u,"title.rendered")):Bv),[u]);return(0,bt.useEffect)((()=>{d&&l(m.names)}),[m.names,d]),(0,Je.jsx)(et.FormTokenField,{label:(0,tt.__)("Parents"),value:a,onInputChange:c,suggestions:s,onChange:e=>{const t=Array.from(e.reduce(((e,t)=>{const o=((e,t)=>{const o=t?.id||e?.[t]?.id;if(o)return o})(m.mapByName,t);return o&&e.add(o),e}),new Set));l(Bv),o({parents:t})},__experimentalShowHowTo:!1})},Iv=[],Pv={order:"asc",_fields:"id,name",context:"view"},Mv=(e,t)=>{const o=t?.id||e?.find((e=>e.name===t))?.id;if(o)return o;const n=t.toLocaleLowerCase();return e?.find((e=>e.name.toLocaleLowerCase()===n))?.id};function zv({onChange:e,query:t}){const{postType:o,taxQuery:n}=t,r=bv(o);return r&&0!==r.length?(0,Je.jsx)(Je.Fragment,{children:r.map((t=>{const o=n?.[t.slug]||[];return(0,Je.jsx)(Rv,{taxonomy:t,termIds:o,onChange:o=>e({taxQuery:{...n,[t.slug]:o}})},t.slug)}))}):null}function Rv({taxonomy:e,termIds:t,onChange:o}){const[n,r]=(0,bt.useState)(""),[a,i]=(0,bt.useState)(Iv),[s,l]=(0,bt.useState)(Iv),c=(0,Ut.useDebounce)(r,250),{searchResults:u,searchHasResolved:d}=(0,gt.useSelect)((o=>{if(!n)return{searchResults:Iv,searchHasResolved:!0};const{getEntityRecords:r,hasFinishedResolution:a}=o(mt.store),i=["taxonomy",e.slug,{...Pv,search:n,orderby:"name",exclude:t,per_page:20}];return{searchResults:r(...i),searchHasResolved:a("getEntityRecords",i)}}),[n,t]),p=(0,gt.useSelect)((o=>{if(!t?.length)return Iv;const{getEntityRecords:n}=o(mt.store);return n("taxonomy",e.slug,{...Pv,include:t,per_page:t.length})}),[t]);(0,bt.useEffect)((()=>{if(t?.length||i(Iv),!p?.length)return;const e=t.reduce(((e,t)=>{const o=p.find((e=>e.id===t));return o&&e.push({id:t,value:o.name}),e}),[]);i(e)}),[t,p]),(0,bt.useEffect)((()=>{d&&l(u.map((e=>e.name)))}),[u,d]);return(0,Je.jsx)("div",{className:"block-library-query-inspector__taxonomy-control",children:(0,Je.jsx)(et.FormTokenField,{label:e.name,value:a,onInputChange:c,suggestions:s,displayTransform:Xo.decodeEntities,onChange:e=>{const t=new Set;for(const o of e){const e=Mv(u,o);e&&t.add(e)}l(Iv),o(Array.from(t))},__experimentalShowHowTo:!1})})}const Av=[{label:(0,tt.__)("Include"),value:""},{label:(0,tt.__)("Exclude"),value:"exclude"},{label:(0,tt.__)("Only"),value:"only"}];function Lv({value:e,onChange:t}){return(0,Je.jsx)(et.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Sticky posts"),options:Av,value:e,onChange:t,help:(0,tt.__)("Blog posts can be “stickied”, a feature that places them at the top of the front page of posts, keeping it there until new sticky posts are published.")})}function Hv({enhancedPagination:e,setAttributes:t,clientId:o}){const{hasUnsupportedBlocks:n}=fv(o),r=window.__experimentalFullPageClientSideNavigation;let a=(0,tt.__)("Browsing between pages requires a full page reload.");return r?a=(0,tt.__)("Experimental full-page client-side navigation setting enabled."):e?a=(0,tt.__)("Browsing between pages won't require a full page reload, unless non-compatible blocks are detected."):n&&(a=(0,tt.__)("Force page reload can't be disabled because there are non-compatible blocks inside the Query block.")),(0,Je.jsx)(Je.Fragment,{children:(0,Je.jsx)(et.ToggleControl,{label:(0,tt.__)("Force page reload"),help:a,checked:!e&&!r,disabled:n||r,onChange:e=>{t({enhancedPagination:!e})}})})}const Dv=({attributes:{query:{postType:e}={}}={}})=>{if(!e)return null;const t=(0,pt.addQueryArgs)("post-new.php",{post_type:e});return(0,Je.jsx)("div",{className:"wp-block-query__create-new-link",children:(0,bt.createInterpolateElement)((0,tt.__)("Add new post"),{a:(0,Je.jsx)("a",{href:t})})})},{BlockInfo:Fv}=Ht(ot.privateApis);function Vv(e){const{attributes:t,setQuery:o,setDisplayLayout:n,setAttributes:r,clientId:a}=e,{query:i,displayLayout:s,enhancedPagination:l}=t,{order:c,orderBy:u,author:d,postType:p,sticky:m,inherit:g,taxQuery:h,parents:x}=i,b=function(e){return(0,gt.useSelect)((t=>t(Qe.store).getActiveBlockVariation("core/query",e)?.allowedControls),[e])}(t),[_,y]=(0,bt.useState)("post"===p),{postTypesTaxonomiesMap:v,postTypesSelectOptions:f}=xv(),k=bv(p),w=function(e){return(0,gt.useSelect)((t=>{const o=t(mt.store).getPostType(e);return o?.viewable&&o?.hierarchical}),[e])}(p);(0,bt.useEffect)((()=>{y("post"===p)}),[p]);const[C,j]=(0,bt.useState)(i.search),S=(0,bt.useCallback)((0,Ut.debounce)((()=>{i.search!==C&&o({search:C})}),250),[C,i.search]);(0,bt.useEffect)((()=>(S(),S.cancel)),[C,S]);const B=_v(b,"inherit"),N=!g&&_v(b,"postType"),T=!g&&_v(b,"order"),I=!g&&_&&_v(b,"sticky"),P=B||N||T||I,M=!!k?.length&&_v(b,"taxQuery"),z=_v(b,"author"),R=_v(b,"search"),A=_v(b,"parents")&&w,L=M||z||R||A,H=Zt();return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(Fv,{children:(0,Je.jsx)(Dv,{...e})}),P&&(0,Je.jsxs)(et.PanelBody,{title:(0,tt.__)("Settings"),children:[B&&(0,Je.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Inherit query from template"),help:(0,tt.__)("Toggle to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently."),checked:!!g,onChange:e=>o({inherit:!!e})}),N&&(0,Je.jsx)(et.SelectControl,{__nextHasNoMarginBottom:!0,options:f,value:p,label:(0,tt.__)("Post type"),onChange:e=>{const t={postType:e},n=v[e],r=Object.entries(h||{}).reduce(((e,[t,o])=>(n.includes(t)&&(e[t]=o),e)),{});t.taxQuery=Object.keys(r).length?r:void 0,"post"!==e&&(t.sticky=""),t.parents=[],o(t)},help:(0,tt.__)("WordPress contains different types of content and they are divided into collections called “Post types”. By default there are a few different ones such as blog posts and pages, but plugins could add more.")}),false,T&&(0,Je.jsx)(Cv,{order:c,orderBy:u,onChange:o}),I&&(0,Je.jsx)(Lv,{value:m,onChange:e=>o({sticky:e})}),(0,Je.jsx)(Hv,{enhancedPagination:l,setAttributes:r,clientId:a})]}),!g&&L&&(0,Je.jsxs)(et.__experimentalToolsPanel,{className:"block-library-query-toolspanel__filters",label:(0,tt.__)("Filters"),resetAll:()=>{o({author:"",parents:[],search:"",taxQuery:null}),j("")},dropdownMenuProps:H,children:[M&&(0,Je.jsx)(et.__experimentalToolsPanelItem,{label:(0,tt.__)("Taxonomies"),hasValue:()=>Object.values(h||{}).some((e=>!!e.length)),onDeselect:()=>o({taxQuery:null}),children:(0,Je.jsx)(zv,{onChange:o,query:i})}),z&&(0,Je.jsx)(et.__experimentalToolsPanelItem,{hasValue:()=>!!d,label:(0,tt.__)("Authors"),onDeselect:()=>o({author:""}),children:(0,Je.jsx)(Sv,{value:d,onChange:o})}),R&&(0,Je.jsx)(et.__experimentalToolsPanelItem,{hasValue:()=>!!C,label:(0,tt.__)("Keyword"),onDeselect:()=>j(""),children:(0,Je.jsx)(et.TextControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Keyword"),value:C,onChange:j})}),A&&(0,Je.jsx)(et.__experimentalToolsPanelItem,{hasValue:()=>!!x?.length,label:(0,tt.__)("Parents"),onDeselect:()=>o({parents:[]}),children:(0,Je.jsx)(Tv,{parents:x,postType:p,onChange:o})})]})]})}const Ev="wp-block-query-enhanced-pagination-modal__description";function $v({clientId:e,attributes:{enhancedPagination:t},setAttributes:o}){const[n,r]=(0,bt.useState)(!1),{hasBlocksFromPlugins:a,hasPostContentBlock:i,hasUnsupportedBlocks:s}=fv(e);(0,bt.useEffect)((()=>{t&&s&&!window.__experimentalFullPageClientSideNavigation&&(o({enhancedPagination:!1}),r(!0))}),[t,s,o]);const l=()=>{r(!1)};let c=(0,tt.__)('If you still want to prevent full page reloads, remove that block, then disable "Force page reload" again in the Query Block settings.');return a?c=(0,tt.__)("Currently, avoiding full page reloads is not possible when non-interactive or non-client Navigation compatible blocks from plugins are present inside the Query block.")+" "+c:i&&(c=(0,tt.__)("Currently, avoiding full page reloads is not possible when a Content block is present inside the Query block.")+" "+c),n&&(0,Je.jsx)(et.Modal,{title:(0,tt.__)("Query block: Force page reload enabled"),className:"wp-block-query__enhanced-pagination-modal",aria:{describedby:Ev},role:"alertdialog",focusOnMount:"firstElement",isDismissible:!1,onRequestClose:l,children:(0,Je.jsxs)(et.__experimentalVStack,{alignment:"right",spacing:5,children:[(0,Je.jsx)("span",{id:Ev,children:c}),(0,Je.jsx)(et.Button,{variant:"primary",onClick:l,children:(0,tt.__)("OK")})]})})}const Gv=[["core/post-template"]];function Ov({attributes:e,setAttributes:t,openPatternSelectionModal:o,name:n,clientId:r}){const{queryId:a,query:i,displayLayout:s,tagName:l="div",query:{inherit:c}={}}=e,{__unstableMarkNextChangeAsNotPersistent:u}=(0,gt.useDispatch)(ot.store),d=(0,Ut.useInstanceId)(Ov),p=(0,ot.useBlockProps)(),m=(0,ot.useInnerBlocksProps)(p,{template:Gv}),{postsPerPage:g}=(0,gt.useSelect)((e=>{const{getSettings:t}=e(ot.store),{getEntityRecord:o,canUser:n}=e(mt.store);return{postsPerPage:(n("read","settings")?+o("root","site")?.posts_per_page:+t().postsPerPage)||3}}),[]);(0,bt.useEffect)((()=>{const e={};(c&&i.perPage!==g||!i.perPage&&g)&&(e.perPage=g),Object.keys(e).length&&(u(),h(e))}),[i.perPage,g,c]),(0,bt.useEffect)((()=>{Number.isFinite(a)||(u(),t({queryId:d}))}),[a,d]);const h=e=>t({query:{...i,...e}}),x={main:(0,tt.__)("The element should be used for the primary content of your document only. "),section:(0,tt.__)("The element should represent a standalone portion of the document that can't be better represented by another element."),aside:(0,tt.__)("The