[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 /*! This file is auto-generated */ 2 (()=>{var e={66:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===s}(e)}(e)};var s="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((s=e,Array.isArray(s)?[]:{}),e,t):e;var s}function o(e,t,s){return e.concat(t).map((function(e){return n(e,s)}))}function r(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function i(e,t){try{return t in e}catch(e){return!1}}function a(e,t,s){var o={};return s.isMergeableObject(e)&&r(e).forEach((function(t){o[t]=n(e[t],s)})),r(t).forEach((function(r){(function(e,t){return i(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,r)||(i(e,r)&&s.isMergeableObject(t[r])?o[r]=function(e,t){if(!t.customMerge)return l;var s=t.customMerge(e);return"function"==typeof s?s:l}(r,s)(e[r],t[r],s):o[r]=n(t[r],s))})),o}function l(e,s,r){(r=r||{}).arrayMerge=r.arrayMerge||o,r.isMergeableObject=r.isMergeableObject||t,r.cloneUnlessOtherwiseSpecified=n;var i=Array.isArray(s);return i===Array.isArray(e)?i?r.arrayMerge(e,s,r):a(e,s,r):n(s,r)}l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,s){return l(e,s,t)}),{})};var c=l;e.exports=c},461:(e,t,s)=>{var n=s(6109);e.exports=function(e){var t=n(e,"line-height"),s=parseFloat(t,10);if(t===s+""){var o=e.style.lineHeight;e.style.lineHeight=t+"em",t=n(e,"line-height"),s=parseFloat(t,10),o?e.style.lineHeight=o:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(s*=4,s/=3):-1!==t.indexOf("mm")?(s*=96,s/=25.4):-1!==t.indexOf("cm")?(s*=96,s/=2.54):-1!==t.indexOf("in")?s*=96:-1!==t.indexOf("pc")&&(s*=16),s=Math.round(s),"normal"===t){var r=e.nodeName,i=document.createElement(r);i.innerHTML=" ","TEXTAREA"===r.toUpperCase()&&i.setAttribute("rows","1");var a=n(e,"font-size");i.style.fontSize=a,i.style.padding="0px",i.style.border="0px";var l=document.body;l.appendChild(i),s=i.offsetHeight,l.removeChild(i)}return s}},628:(e,t,s)=>{"use strict";var n=s(4067);function o(){}function r(){}r.resetWarningCache=o,e.exports=function(){function e(e,t,s,o,r,i){if(i!==n){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var s={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:o};return s.PropTypes=s,s}},1609:e=>{"use strict";e.exports=window.React},4067:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4132:(e,t,s)=>{"use strict";var n=s(4462);t.A=n.TextareaAutosize},4306:function(e,t){var s,n,o; 3 /*! 4 autosize 4.0.4 5 license: MIT 6 http://www.jacklmoore.com/autosize 7 */n=[e,t],s=function(e,t){"use strict";var s,n,o="function"==typeof Map?new Map:(s=[],n=[],{has:function(e){return s.indexOf(e)>-1},get:function(e){return n[s.indexOf(e)]},set:function(e,t){-1===s.indexOf(e)&&(s.push(e),n.push(t))},delete:function(e){var t=s.indexOf(e);t>-1&&(s.splice(t,1),n.splice(t,1))}}),r=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){r=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!o.has(e)){var t=null,s=null,n=null,i=function(){e.clientWidth!==s&&p()},a=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",p,!1),e.removeEventListener("keyup",p,!1),e.removeEventListener("autosize:destroy",a,!1),e.removeEventListener("autosize:update",p,!1),Object.keys(t).forEach((function(s){e.style[s]=t[s]})),o.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",a,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",p,!1),window.addEventListener("resize",i,!1),e.addEventListener("input",p,!1),e.addEventListener("autosize:update",p,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",o.set(e,{destroy:a,update:p}),l()}function l(){var s=window.getComputedStyle(e,null);"vertical"===s.resize?e.style.resize="none":"both"===s.resize&&(e.style.resize="horizontal"),t="content-box"===s.boxSizing?-(parseFloat(s.paddingTop)+parseFloat(s.paddingBottom)):parseFloat(s.borderTopWidth)+parseFloat(s.borderBottomWidth),isNaN(t)&&(t=0),p()}function c(t){var s=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=s,e.style.overflowY=t}function d(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}function u(){if(0!==e.scrollHeight){var n=d(e),o=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",s=e.clientWidth,n.forEach((function(e){e.node.scrollTop=e.scrollTop})),o&&(document.documentElement.scrollTop=o)}}function p(){u();var t=Math.round(parseFloat(e.style.height)),s=window.getComputedStyle(e,null),o="content-box"===s.boxSizing?Math.round(parseFloat(s.height)):e.offsetHeight;if(o<t?"hidden"===s.overflowY&&(c("scroll"),u(),o="content-box"===s.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==s.overflowY&&(c("hidden"),u(),o="content-box"===s.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),n!==o){n=o;var i=r("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function a(e){var t=o.get(e);t&&t.destroy()}function l(e){var t=o.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return i(e,t)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],l),e}),t.default=c,e.exports=t.default},void 0===(o="function"==typeof s?s.apply(t,n):s)||(e.exports=o)},4462:function(e,t,s){"use strict";var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])},function(e,t){function s(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)}),r=this&&this.__assign||Object.assign||function(e){for(var t,s=1,n=arguments.length;s<n;s++)for(var o in t=arguments[s])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i=this&&this.__rest||function(e,t){var s={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&(s[n[o]]=e[n[o]])}return s};t.__esModule=!0;var a=s(1609),l=s(5826),c=s(4306),d=s(461),u="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:d(t.textarea)})},t.onChange=function(e){var s=t.props.onChange;t.currentValue=e.currentTarget.value,s&&s(e)},t}return o(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,s=t.maxRows,n=t.async;"number"==typeof s&&this.updateLineHeight(),"number"==typeof s||n?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(u,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(u,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,s=(t.onResize,t.maxRows),n=(t.onChange,t.style),o=(t.innerRef,t.children),l=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,d=s&&c?c*s:null;return a.createElement("textarea",r({},l,{onChange:this.onChange,style:d?r({},n,{maxHeight:d}):n,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),o)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:l.number,maxRows:l.number,onResize:l.func,innerRef:l.any,async:l.bool},t}(a.Component);t.TextareaAutosize=a.forwardRef((function(e,t){return a.createElement(p,r({},e,{innerRef:t}))}))},5215:e=>{"use strict";e.exports=function e(t,s){if(t===s)return!0;if(t&&s&&"object"==typeof t&&"object"==typeof s){if(t.constructor!==s.constructor)return!1;var n,o,r;if(Array.isArray(t)){if((n=t.length)!=s.length)return!1;for(o=n;0!=o--;)if(!e(t[o],s[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===s.source&&t.flags===s.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===s.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===s.toString();if((n=(r=Object.keys(t)).length)!==Object.keys(s).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(s,r[o]))return!1;for(o=n;0!=o--;){var i=r[o];if(!e(t[i],s[i]))return!1}return!0}return t!=t&&s!=s}},5826:(e,t,s)=>{e.exports=s(628)()},6109:e=>{e.exports=function(e,t,s){return((s=window.getComputedStyle)?s(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},9681:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},s=Object.keys(t).join("|"),n=new RegExp(s,"g"),o=new RegExp(s,"");function r(e){return t[e]}var i=function(e){return e.replace(n,r)};e.exports=i,e.exports.has=function(e){return!!e.match(o)},e.exports.remove=i}},t={};function s(n){var o=t[n];if(void 0!==o)return o.exports;var r=t[n]={exports:{}};return e[n].call(r.exports,r,r.exports,s),r.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";s.r(n),s.d(n,{AlignmentToolbar:()=>Zh,Autocomplete:()=>Wh,AutosaveMonitor:()=>Lc,BlockAlignmentToolbar:()=>Yh,BlockControls:()=>qh,BlockEdit:()=>Kh,BlockEditorKeyboardShortcuts:()=>Qh,BlockFormatControls:()=>Xh,BlockIcon:()=>Jh,BlockInspector:()=>eg,BlockList:()=>tg,BlockMover:()=>sg,BlockNavigationDropdown:()=>ng,BlockSelectionClearer:()=>og,BlockSettingsMenu:()=>rg,BlockTitle:()=>ig,BlockToolbar:()=>ag,CharacterCount:()=>Lh,ColorPalette:()=>lg,ContrastChecker:()=>cg,CopyHandler:()=>dg,DefaultBlockAppender:()=>ug,DocumentBar:()=>Hc,DocumentOutline:()=>Jc,DocumentOutlineCheck:()=>ed,EditorHistoryRedo:()=>od,EditorHistoryUndo:()=>rd,EditorKeyboardShortcuts:()=>Cl,EditorKeyboardShortcutsRegister:()=>td,EditorNotices:()=>ad,EditorProvider:()=>Ml,EditorSnackbars:()=>cd,EntitiesSavedStates:()=>bd,ErrorBoundary:()=>Sd,FontSizePicker:()=>pg,InnerBlocks:()=>hg,Inserter:()=>mg,InspectorAdvancedControls:()=>gg,InspectorControls:()=>_g,LocalAutosaveMonitor:()=>jd,MediaPlaceholder:()=>wg,MediaUpload:()=>Sg,MediaUploadCheck:()=>kg,MultiSelectScrollIntoView:()=>Cg,NavigableToolbar:()=>Pg,ObserveTyping:()=>jg,PageAttributesCheck:()=>Ed,PageAttributesOrder:()=>Id,PageAttributesPanel:()=>$d,PageAttributesParent:()=>zd,PageTemplate:()=>su,PanelColorSettings:()=>fg,PlainText:()=>bg,PluginBlockSettingsMenuItem:()=>gu,PluginDocumentSettingPanel:()=>hu,PluginMoreMenuItem:()=>_u,PluginPostPublishPanel:()=>xu,PluginPostStatusInfo:()=>ku,PluginPrePublishPanel:()=>Eu,PluginPreviewMenuItem:()=>Tu,PluginSidebar:()=>Bu,PluginSidebarMoreMenuItem:()=>Iu,PostAuthor:()=>$u,PostAuthorCheck:()=>Wu,PostAuthorPanel:()=>Yu,PostComments:()=>Ku,PostDiscussionPanel:()=>tp,PostExcerpt:()=>sp,PostExcerptCheck:()=>np,PostExcerptPanel:()=>dp,PostFeaturedImage:()=>vp,PostFeaturedImageCheck:()=>hp,PostFeaturedImagePanel:()=>Sp,PostFormat:()=>Pp,PostFormatCheck:()=>kp,PostLastRevision:()=>Bp,PostLastRevisionCheck:()=>jp,PostLastRevisionPanel:()=>Ip,PostLockedModal:()=>Np,PostPendingStatus:()=>Dp,PostPendingStatusCheck:()=>Rp,PostPingbacks:()=>Qu,PostPreviewButton:()=>Ap,PostPublishButton:()=>Fp,PostPublishButtonLabel:()=>Mp,PostPublishPanel:()=>Zm,PostSavedState:()=>sh,PostSchedule:()=>im,PostScheduleCheck:()=>nh,PostScheduleLabel:()=>lm,PostSchedulePanel:()=>rh,PostSticky:()=>Qm,PostStickyCheck:()=>Km,PostSwitchToDraftButton:()=>ih,PostSyncStatus:()=>ah,PostTaxonomies:()=>ch,PostTaxonomiesCheck:()=>dh,PostTaxonomiesFlatTermSelector:()=>vm,PostTaxonomiesHierarchicalTermSelector:()=>Rm,PostTaxonomiesPanel:()=>ph,PostTemplatePanel:()=>Fu,PostTextEditor:()=>hh,PostTitle:()=>xh,PostTitleRaw:()=>vh,PostTrash:()=>Sh,PostTrashCheck:()=>wh,PostTypeSupportCheck:()=>Td,PostURL:()=>kh,PostURLCheck:()=>Ch,PostURLLabel:()=>Ph,PostURLPanel:()=>Eh,PostVisibility:()=>zp,PostVisibilityCheck:()=>Ih,PostVisibilityLabel:()=>Hp,RichText:()=>$h,RichTextShortcut:()=>yg,RichTextToolbarButton:()=>xg,ServerSideRender:()=>zh(),SkipToSelectedBlock:()=>Eg,TableOfContents:()=>Fh,TextEditorGlobalKeyboardShortcuts:()=>Gg,ThemeSupportCheck:()=>mp,TimeToRead:()=>Mh,URLInput:()=>Tg,URLInputButton:()=>Bg,URLPopover:()=>Ig,UnsavedChangesWarning:()=>Vh,VisualEditorGlobalKeyboardShortcuts:()=>Hg,Warning:()=>Ng,WordCount:()=>Dh,WritingFlow:()=>Rg,__unstableRichTextInputEvent:()=>vg,cleanForSlug:()=>$g,createCustomColorsHOC:()=>Dg,getColorClassName:()=>Ag,getColorObjectByAttributeValues:()=>Mg,getColorObjectByColorValue:()=>Lg,getFontSize:()=>Og,getFontSizeClass:()=>Fg,getTemplatePartIcon:()=>z,mediaUpload:()=>xi,privateApis:()=>Yy,registerEntityAction:()=>qy,registerEntityField:()=>Qy,store:()=>xc,storeConfig:()=>yc,transformStyles:()=>g.transformStyles,unregisterEntityAction:()=>Ky,unregisterEntityField:()=>Xy,useEntitiesSavedStatesIsDirty:()=>_d,usePostScheduleLabel:()=>cm,usePostURLLabel:()=>jh,usePostVisibilityLabel:()=>Gp,userAutocompleter:()=>wc,withColorContext:()=>Vg,withColors:()=>Ug,withFontSizes:()=>zg});var e={};s.r(e),s.d(e,{__experimentalGetDefaultTemplatePartAreas:()=>ls,__experimentalGetDefaultTemplateType:()=>cs,__experimentalGetDefaultTemplateTypes:()=>as,__experimentalGetTemplateInfo:()=>ds,__unstableIsEditorReady:()=>et,canInsertBlockType:()=>ns,canUserUseUnfilteredHTML:()=>$e,didPostSaveRequestFail:()=>Ee,didPostSaveRequestSucceed:()=>je,getActivePostLock:()=>Ge,getAdjacentBlockClientId:()=>Et,getAutosaveAttribute:()=>me,getBlock:()=>mt,getBlockAttributes:()=>pt,getBlockCount:()=>yt,getBlockHierarchyRootClientId:()=>jt,getBlockIndex:()=>zt,getBlockInsertionPoint:()=>Xt,getBlockListSettings:()=>is,getBlockMode:()=>qt,getBlockName:()=>dt,getBlockOrder:()=>Ut,getBlockRootClientId:()=>Pt,getBlockSelectionEnd:()=>vt,getBlockSelectionStart:()=>xt,getBlocks:()=>ht,getBlocksByClientId:()=>bt,getClientIdsOfDescendants:()=>gt,getClientIdsWithDescendants:()=>_t,getCurrentPost:()=>ne,getCurrentPostAttribute:()=>de,getCurrentPostId:()=>re,getCurrentPostLastRevisionId:()=>le,getCurrentPostRevisionsCount:()=>ae,getCurrentPostType:()=>oe,getCurrentTemplateId:()=>ie,getDeviceType:()=>nt,getEditedPostAttribute:()=>pe,getEditedPostContent:()=>Re,getEditedPostPreviewLink:()=>Ie,getEditedPostSlug:()=>Le,getEditedPostVisibility:()=>he,getEditorBlocks:()=>Ze,getEditorMode:()=>it,getEditorSelection:()=>Je,getEditorSelectionEnd:()=>Xe,getEditorSelectionStart:()=>Qe,getEditorSettings:()=>tt,getFirstMultiSelectedBlockClientId:()=>Dt,getGlobalBlockCount:()=>ft,getInserterItems:()=>os,getLastMultiSelectedBlockClientId:()=>At,getMultiSelectedBlockClientIds:()=>Nt,getMultiSelectedBlocks:()=>Rt,getMultiSelectedBlocksEndClientId:()=>Vt,getMultiSelectedBlocksStartClientId:()=>Ft,getNextBlockClientId:()=>Bt,getPermalink:()=>Me,getPermalinkParts:()=>Oe,getPostEdits:()=>ce,getPostLockUser:()=>He,getPostTypeLabel:()=>us,getPreviousBlockClientId:()=>Tt,getRenderingMode:()=>st,getSelectedBlock:()=>Ct,getSelectedBlockClientId:()=>kt,getSelectedBlockCount:()=>wt,getSelectedBlocksInitialCaretPosition:()=>It,getStateBeforeOptimisticTransaction:()=>at,getSuggestedPostFormat:()=>Ne,getTemplate:()=>ts,getTemplateLock:()=>ss,hasChangedContent:()=>J,hasEditorRedo:()=>Q,hasEditorUndo:()=>K,hasInserterItems:()=>rs,hasMultiSelection:()=>Wt,hasNonPostEntityChanges:()=>te,hasSelectedBlock:()=>St,hasSelectedInnerBlock:()=>Gt,inSomeHistory:()=>lt,isAncestorMultiSelected:()=>Ot,isAutosavingPost:()=>Te,isBlockInsertionPointVisible:()=>Jt,isBlockMultiSelected:()=>Lt,isBlockSelected:()=>Ht,isBlockValid:()=>ut,isBlockWithinSelection:()=>$t,isCaretWithinFormattedText:()=>Qt,isCleanNewPost:()=>se,isCurrentPostPending:()=>ge,isCurrentPostPublished:()=>_e,isCurrentPostScheduled:()=>fe,isDeletingPost:()=>ke,isEditedPostAutosaveable:()=>ve,isEditedPostBeingScheduled:()=>we,isEditedPostDateFloating:()=>Se,isEditedPostDirty:()=>ee,isEditedPostEmpty:()=>xe,isEditedPostNew:()=>X,isEditedPostPublishable:()=>be,isEditedPostSaveable:()=>ye,isEditorPanelEnabled:()=>qe,isEditorPanelOpened:()=>Ke,isEditorPanelRemoved:()=>Ye,isFirstMultiSelectedBlock:()=>Mt,isInserterOpened:()=>rt,isListViewOpened:()=>ot,isMultiSelecting:()=>Zt,isPermalinkEditable:()=>Ae,isPostAutosavingLocked:()=>Ue,isPostLockTakeover:()=>ze,isPostLocked:()=>Fe,isPostSavingLocked:()=>Ve,isPreviewingPost:()=>Be,isPublishSidebarEnabled:()=>We,isPublishSidebarOpened:()=>ps,isPublishingPost:()=>De,isSavingNonPostEntityChanges:()=>Pe,isSavingPost:()=>Ce,isSelectionEnabled:()=>Yt,isTyping:()=>Kt,isValidTemplate:()=>es});var t={};s.r(t),s.d(t,{__experimentalTearDownEditor:()=>vs,__unstableSaveForPreview:()=>Is,autosave:()=>Bs,clearSelectedBlock:()=>hn,closePublishSidebar:()=>sn,createUndoLevel:()=>Ds,disablePublishSidebar:()=>Ls,editPost:()=>Ps,enablePublishSidebar:()=>Ms,enterFormattedText:()=>Rn,exitFormattedText:()=>Dn,hideInsertionPoint:()=>kn,insertBlock:()=>vn,insertBlocks:()=>wn,insertDefaultBlock:()=>An,lockPostAutosaving:()=>Vs,lockPostSaving:()=>Os,mergeBlocks:()=>jn,moveBlockToPosition:()=>xn,moveBlocksDown:()=>bn,moveBlocksUp:()=>yn,multiSelect:()=>mn,openPublishSidebar:()=>tn,receiveBlocks:()=>an,redo:()=>Ns,refreshPost:()=>Es,removeBlock:()=>Tn,removeBlocks:()=>En,removeEditorPanel:()=>Ys,replaceBlock:()=>fn,replaceBlocks:()=>_n,resetBlocks:()=>rn,resetEditorBlocks:()=>zs,resetPost:()=>ws,savePost:()=>js,selectBlock:()=>dn,setDeviceType:()=>$s,setEditedPost:()=>Cs,setIsInserterOpened:()=>qs,setIsListViewOpened:()=>Ks,setRenderingMode:()=>Gs,setTemplateValidity:()=>Cn,setupEditor:()=>xs,setupEditorState:()=>ks,showInsertionPoint:()=>Sn,startMultiSelect:()=>un,startTyping:()=>In,stopMultiSelect:()=>pn,stopTyping:()=>Nn,switchEditorMode:()=>en,synchronizeTemplate:()=>Pn,toggleBlockMode:()=>Bn,toggleDistractionFree:()=>Qs,toggleEditorPanelEnabled:()=>Ws,toggleEditorPanelOpened:()=>Zs,togglePublishSidebar:()=>nn,toggleSelection:()=>gn,toggleSpotlightMode:()=>Xs,toggleTopToolbar:()=>Js,trashPost:()=>Ts,undo:()=>Rs,unlockPostAutosaving:()=>Us,unlockPostSaving:()=>Fs,updateBlock:()=>ln,updateBlockAttributes:()=>cn,updateBlockListSettings:()=>Mn,updateEditorSettings:()=>Hs,updatePost:()=>Ss,updatePostLock:()=>As});var o={};s.r(o),s.d(o,{closeModal:()=>va,disableComplementaryArea:()=>ha,enableComplementaryArea:()=>ma,openModal:()=>xa,pinItem:()=>ga,setDefaultComplementaryArea:()=>pa,setFeatureDefaults:()=>ya,setFeatureValue:()=>ba,toggleFeature:()=>fa,unpinItem:()=>_a});var r={};s.r(r),s.d(r,{getActiveComplementaryArea:()=>wa,isComplementaryAreaLoading:()=>Sa,isFeatureActive:()=>Ca,isItemPinned:()=>ka,isModalActive:()=>Pa});var i={};s.r(i),s.d(i,{ActionItem:()=>Ra,ComplementaryArea:()=>Ua,ComplementaryAreaMoreMenuItem:()=>Aa,FullscreenMode:()=>za,InterfaceSkeleton:()=>Za,PinnedItems:()=>La,store:()=>Ea});var a={};s.r(a),s.d(a,{createTemplate:()=>Yl,hideBlockTypes:()=>Kl,registerEntityAction:()=>Ul,registerEntityField:()=>Hl,registerPostTypeSchema:()=>Wl,removeTemplates:()=>Jl,revertTemplate:()=>Xl,saveDirtyEntities:()=>Ql,setCurrentTemplateId:()=>Zl,setDefaultRenderingMode:()=>ec,setIsReady:()=>$l,showBlockTypes:()=>ql,unregisterEntityAction:()=>zl,unregisterEntityField:()=>Gl});var l={};s.r(l),s.d(l,{getDefaultRenderingMode:()=>bc,getEntityActions:()=>hc,getEntityFields:()=>_c,getInserter:()=>lc,getInserterSidebarToggleRef:()=>dc,getListViewToggleRef:()=>cc,getPostBlocksByName:()=>fc,getPostIcon:()=>pc,hasPostMetaChanges:()=>mc,isEntityReady:()=>gc});const c=window.ReactJSXRuntime,d=window.wp.data,u=window.wp.coreData,p=window.wp.element,m=window.wp.compose,h=window.wp.hooks,g=window.wp.blockEditor,_={...g.SETTINGS_DEFAULTS,richEditingEnabled:!0,codeEditingEnabled:!0,fontLibraryEnabled:!0,enableCustomFields:void 0,defaultRenderingMode:"post-only"};var f=(0,d.combineReducers)({actions:function(e={},t){switch(t.type){case"REGISTER_ENTITY_ACTION":return{...e,[t.kind]:{...e[t.kind],[t.name]:[...(e[t.kind]?.[t.name]??[]).filter((e=>e.id!==t.config.id)),t.config]}};case"UNREGISTER_ENTITY_ACTION":return{...e,[t.kind]:{...e[t.kind],[t.name]:(e[t.kind]?.[t.name]??[]).filter((e=>e.id!==t.actionId))}}}return e},fields:function(e={},t){switch(t.type){case"REGISTER_ENTITY_FIELD":return{...e,[t.kind]:{...e[t.kind],[t.name]:[...(e[t.kind]?.[t.name]??[]).filter((e=>e.id!==t.config.id)),t.config]}};case"UNREGISTER_ENTITY_FIELD":return{...e,[t.kind]:{...e[t.kind],[t.name]:(e[t.kind]?.[t.name]??[]).filter((e=>e.id!==t.fieldId))}}}return e},isReady:function(e={},t){return"SET_IS_READY"===t.type?{...e,[t.kind]:{...e[t.kind],[t.name]:!0}}:e}});function b(e){return e&&"object"==typeof e&&"raw"in e?e.raw:e}var y=(0,d.combineReducers)({postId:function(e=null,t){return"SET_EDITED_POST"===t.type?t.postId:e},postType:function(e=null,t){return"SET_EDITED_POST"===t.type?t.postType:e},templateId:function(e=null,t){return"SET_CURRENT_TEMPLATE_ID"===t.type?t.id:e},saving:function(e={},t){switch(t.type){case"REQUEST_POST_UPDATE_START":case"REQUEST_POST_UPDATE_FINISH":return{pending:"REQUEST_POST_UPDATE_START"===t.type,options:t.options||{}}}return e},deleting:function(e={},t){switch(t.type){case"REQUEST_POST_DELETE_START":case"REQUEST_POST_DELETE_FINISH":return{pending:"REQUEST_POST_DELETE_START"===t.type}}return e},postLock:function(e={isLocked:!1},t){return"UPDATE_POST_LOCK"===t.type?t.lock:e},template:function(e={isValid:!0},t){return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},postSavingLock:function(e={},t){switch(t.type){case"LOCK_POST_SAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_SAVING":{const{[t.lockName]:s,...n}=e;return n}}return e},editorSettings:function(e=_,t){return"UPDATE_EDITOR_SETTINGS"===t.type?{...e,...t.settings}:e},postAutosavingLock:function(e={},t){switch(t.type){case"LOCK_POST_AUTOSAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_AUTOSAVING":{const{[t.lockName]:s,...n}=e;return n}}return e},renderingMode:function(e="post-only",t){return"SET_RENDERING_MODE"===t.type?t.mode:e},deviceType:function(e="Desktop",t){return"SET_DEVICE_TYPE"===t.type?t.deviceType:e},removedPanels:function(e=[],t){if("REMOVE_PANEL"===t.type)if(!e.includes(t.panelName))return[...e,t.panelName];return e},blockInserterPanel:function(e=!1,t){switch(t.type){case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value}return e},inserterSidebarToggleRef:function(e={current:null}){return e},listViewPanel:function(e=!1,t){switch(t.type){case"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e},listViewToggleRef:function(e={current:null}){return e},publishSidebarActive:function(e=!1,t){switch(t.type){case"OPEN_PUBLISH_SIDEBAR":return!0;case"CLOSE_PUBLISH_SIDEBAR":return!1;case"TOGGLE_PUBLISH_SIDEBAR":return!e}return e},dataviews:f});const x=window.wp.blocks,v=window.wp.date,w=window.wp.url,S=window.wp.deprecated;var k=s.n(S);const C=window.wp.preferences,P=new Set(["meta"]),j=/%(?:postname|pagename)%/,E=6e4,T=["title","excerpt","content"],B="wp_template",I="wp_template_part",N="wp_block",R="wp_navigation",D="custom",A=["wp_template","wp_template_part"],M=[...A,"wp_block","wp_navigation"],L=window.wp.primitives;var O=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M18.5 10.5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),F=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",d:"M18 5.5h-8v8h8.5V6a.5.5 0 00-.5-.5zm-9.5 8h-3V6a.5.5 0 01.5-.5h2.5v8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),V=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),U=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})});function z(e){return"header"===e?O:"footer"===e?F:"sidebar"===e?V:U}const H=window.wp.privateApis,{lock:G,unlock:$}=(0,H.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/editor");var W=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})});const Z={},Y=e=>{if(!e)return Z;const{templateTypes:t,templateAreas:s,template:n}=e,{description:o,slug:r,title:i,area:a}=n,{title:l,description:c}=Object.values(t).find((e=>e.slug===r))??Z,d="string"==typeof i?i:i?.rendered,u="string"==typeof o?o:o?.raw,p=s?.map((e=>({...e,icon:z(e.icon)}))),m=p?.find((e=>a===e.area))?.icon||W;return{title:d&&d!==r?d:l||r,description:u||c,icon:m}},q={},K=(0,d.createRegistrySelector)((e=>()=>e(u.store).hasUndo())),Q=(0,d.createRegistrySelector)((e=>()=>e(u.store).hasRedo()));function X(e){return"auto-draft"===ne(e).status}function J(e){return"content"in ce(e)}const ee=(0,d.createRegistrySelector)((e=>t=>{const s=oe(t),n=re(t);return e(u.store).hasEditsForEntityRecord("postType",s,n)})),te=(0,d.createRegistrySelector)((e=>t=>{const s=e(u.store).__experimentalGetDirtyEntityRecords(),{type:n,id:o}=ne(t);return s.some((e=>"postType"!==e.kind||e.name!==n||e.key!==o))}));function se(e){return!ee(e)&&X(e)}const ne=(0,d.createRegistrySelector)((e=>t=>{const s=re(t),n=oe(t),o=e(u.store).getRawEntityRecord("postType",n,s);return o||q}));function oe(e){return e.postType}function re(e){return e.postId}function ie(e){return e.templateId}function ae(e){return ne(e)._links?.["version-history"]?.[0]?.count??0}function le(e){return ne(e)._links?.["predecessor-version"]?.[0]?.id??null}const ce=(0,d.createRegistrySelector)((e=>t=>{const s=oe(t),n=re(t);return e(u.store).getEntityRecordEdits("postType",s,n)||q}));function de(e,t){switch(t){case"type":return oe(e);case"id":return re(e);default:const s=ne(e);if(!s.hasOwnProperty(t))break;return b(s[t])}}const ue=(0,d.createSelector)(((e,t)=>{const s=ce(e);return s.hasOwnProperty(t)?{...de(e,t),...s[t]}:de(e,t)}),((e,t)=>[de(e,t),ce(e)[t]]));function pe(e,t){if("content"===t)return Re(e);const s=ce(e);return s.hasOwnProperty(t)?P.has(t)?ue(e,t):s[t]:de(e,t)}const me=(0,d.createRegistrySelector)((e=>(t,s)=>{if(!T.includes(s)&&"preview_link"!==s)return;const n=oe(t);if("wp_template"===n)return!1;const o=re(t),r=e(u.store).getCurrentUser()?.id,i=e(u.store).getAutosave(n,o,r);return i?b(i[s]):void 0}));function he(e){if("private"===pe(e,"status"))return"private";return pe(e,"password")?"password":"public"}function ge(e){return"pending"===ne(e).status}function _e(e,t){const s=t||ne(e);return-1!==["publish","private"].indexOf(s.status)||"future"===s.status&&!(0,v.isInTheFuture)(new Date(Number((0,v.getDate)(s.date))-E))}function fe(e){return"future"===ne(e).status&&!_e(e)}function be(e){const t=ne(e);return ee(e)||-1===["publish","private","future"].indexOf(t.status)}function ye(e){return!Ce(e)&&(!!pe(e,"title")||!!pe(e,"excerpt")||!xe(e)||"native"===p.Platform.OS)}const xe=(0,d.createRegistrySelector)((e=>t=>{const s=re(t),n=oe(t),o=e(u.store).getEditedEntityRecord("postType",n,s);if("function"!=typeof o.content)return!o.content;const r=pe(t,"blocks");if(0===r.length)return!0;if(r.length>1)return!1;const i=r[0].name;return(i===(0,x.getDefaultBlockName)()||i===(0,x.getFreeformContentHandlerName)())&&!Re(t)})),ve=(0,d.createRegistrySelector)((e=>t=>{if(!ye(t))return!1;if(Ue(t))return!1;const s=oe(t),n=e(u.store).getPostType(s);if("wp_template"===s||!n?.supports?.autosave)return!1;const o=re(t),r=e(u.store).hasFetchedAutosaves(s,o),i=e(u.store).getCurrentUser()?.id,a=e(u.store).getAutosave(s,o,i);return!!r&&(!a||(!!J(t)||["title","excerpt","meta"].some((e=>b(a[e])!==pe(t,e)))))}));function we(e){const t=pe(e,"date"),s=new Date(Number((0,v.getDate)(t))-E);return(0,v.isInTheFuture)(s)}function Se(e){const t=pe(e,"date"),s=pe(e,"modified"),n=ne(e).status;return("draft"===n||"auto-draft"===n||"pending"===n)&&(t===s||null===t)}function ke(e){return!!e.deleting.pending}function Ce(e){return!!e.saving.pending}const Pe=(0,d.createRegistrySelector)((e=>t=>{const s=e(u.store).__experimentalGetEntitiesBeingSaved(),{type:n,id:o}=ne(t);return s.some((e=>"postType"!==e.kind||e.name!==n||e.key!==o))})),je=(0,d.createRegistrySelector)((e=>t=>{const s=oe(t),n=re(t);return!e(u.store).getLastEntitySaveError("postType",s,n)})),Ee=(0,d.createRegistrySelector)((e=>t=>{const s=oe(t),n=re(t);return!!e(u.store).getLastEntitySaveError("postType",s,n)}));function Te(e){return Ce(e)&&Boolean(e.saving.options?.isAutosave)}function Be(e){return Ce(e)&&Boolean(e.saving.options?.isPreview)}function Ie(e){if(e.saving.pending||Ce(e))return;let t=me(e,"preview_link");t&&"draft"!==ne(e).status||(t=pe(e,"link"),t&&(t=(0,w.addQueryArgs)(t,{preview:!0})));const s=pe(e,"featured_media");return t&&s?(0,w.addQueryArgs)(t,{_thumbnail_id:s}):t}const Ne=(0,d.createRegistrySelector)((e=>()=>{const t=e(g.store).getBlocks();if(t.length>2)return null;let s;if(1===t.length&&(s=t[0].name,"core/embed"===s)){const e=t[0].attributes?.providerNameSlug;["youtube","vimeo"].includes(e)?s="core/video":["spotify","soundcloud"].includes(e)&&(s="core/audio")}switch(2===t.length&&"core/paragraph"===t[1].name&&(s=t[0].name),s){case"core/image":return"image";case"core/quote":case"core/pullquote":return"quote";case"core/gallery":return"gallery";case"core/video":return"video";case"core/audio":return"audio";default:return null}})),Re=(0,d.createRegistrySelector)((e=>t=>{const s=re(t),n=oe(t),o=e(u.store).getEditedEntityRecord("postType",n,s);if(o){if("function"==typeof o.content)return o.content(o);if(o.blocks)return(0,x.__unstableSerializeAndClean)(o.blocks);if(o.content)return o.content}return""}));function De(e){return Ce(e)&&!_e(e)&&"publish"===pe(e,"status")}function Ae(e){const t=pe(e,"permalink_template");return j.test(t)}function Me(e){const t=Oe(e);if(!t)return null;const{prefix:s,postName:n,suffix:o}=t;return Ae(e)?s+n+o:s}function Le(e){return pe(e,"slug")||(0,w.cleanForSlug)(pe(e,"title"))||re(e)}function Oe(e){const t=pe(e,"permalink_template");if(!t)return null;const s=pe(e,"slug")||pe(e,"generated_slug"),[n,o]=t.split(j);return{prefix:n,postName:s,suffix:o}}function Fe(e){return e.postLock.isLocked}function Ve(e){return Object.keys(e.postSavingLock).length>0}function Ue(e){return Object.keys(e.postAutosavingLock).length>0}function ze(e){return e.postLock.isTakeover}function He(e){return e.postLock.user}function Ge(e){return e.postLock.activePostLock}function $e(e){return Boolean(ne(e)._links?.hasOwnProperty("wp:action-unfiltered-html"))}const We=(0,d.createRegistrySelector)((e=>()=>!!e(C.store).get("core","isPublishSidebarEnabled"))),Ze=(0,d.createSelector)((e=>pe(e,"blocks")||(0,x.parse)(Re(e))),(e=>[pe(e,"blocks"),Re(e)]));function Ye(e,t){return e.removedPanels.includes(t)}const qe=(0,d.createRegistrySelector)((e=>(t,s)=>{const n=e(C.store).get("core","inactivePanels");return!Ye(t,s)&&!n?.includes(s)})),Ke=(0,d.createRegistrySelector)((e=>(t,s)=>{const n=e(C.store).get("core","openPanels");return!!n?.includes(s)}));function Qe(e){return k()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),pe(e,"selection")?.selectionStart}function Xe(e){return k()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),pe(e,"selection")?.selectionEnd}function Je(e){return pe(e,"selection")}function et(e){return!!e.postId}function tt(e){return e.editorSettings}function st(e){return e.renderingMode}const nt=(0,d.createRegistrySelector)((e=>t=>$(e(g.store)).isZoomOut()?"Desktop":t.deviceType));function ot(e){return e.listViewPanel}function rt(e){return!!e.blockInserterPanel}const it=(0,d.createRegistrySelector)((e=>()=>e(C.store).get("core","editorMode")??"visual"));function at(){return k()("select('core/editor').getStateBeforeOptimisticTransaction",{since:"5.7",hint:"No state history is kept on this store anymore"}),null}function lt(){return k()("select('core/editor').inSomeHistory",{since:"5.7",hint:"No state history is kept on this store anymore"}),!1}function ct(e){return(0,d.createRegistrySelector)((t=>(s,...n)=>(k()("`wp.data.select( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.select( 'core/block-editor' )."+e+"`",version:"6.2"}),t(g.store)[e](...n))))}const dt=ct("getBlockName"),ut=ct("isBlockValid"),pt=ct("getBlockAttributes"),mt=ct("getBlock"),ht=ct("getBlocks"),gt=ct("getClientIdsOfDescendants"),_t=ct("getClientIdsWithDescendants"),ft=ct("getGlobalBlockCount"),bt=ct("getBlocksByClientId"),yt=ct("getBlockCount"),xt=ct("getBlockSelectionStart"),vt=ct("getBlockSelectionEnd"),wt=ct("getSelectedBlockCount"),St=ct("hasSelectedBlock"),kt=ct("getSelectedBlockClientId"),Ct=ct("getSelectedBlock"),Pt=ct("getBlockRootClientId"),jt=ct("getBlockHierarchyRootClientId"),Et=ct("getAdjacentBlockClientId"),Tt=ct("getPreviousBlockClientId"),Bt=ct("getNextBlockClientId"),It=ct("getSelectedBlocksInitialCaretPosition"),Nt=ct("getMultiSelectedBlockClientIds"),Rt=ct("getMultiSelectedBlocks"),Dt=ct("getFirstMultiSelectedBlockClientId"),At=ct("getLastMultiSelectedBlockClientId"),Mt=ct("isFirstMultiSelectedBlock"),Lt=ct("isBlockMultiSelected"),Ot=ct("isAncestorMultiSelected"),Ft=ct("getMultiSelectedBlocksStartClientId"),Vt=ct("getMultiSelectedBlocksEndClientId"),Ut=ct("getBlockOrder"),zt=ct("getBlockIndex"),Ht=ct("isBlockSelected"),Gt=ct("hasSelectedInnerBlock"),$t=ct("isBlockWithinSelection"),Wt=ct("hasMultiSelection"),Zt=ct("isMultiSelecting"),Yt=ct("isSelectionEnabled"),qt=ct("getBlockMode"),Kt=ct("isTyping"),Qt=ct("isCaretWithinFormattedText"),Xt=ct("getBlockInsertionPoint"),Jt=ct("isBlockInsertionPointVisible"),es=ct("isValidTemplate"),ts=ct("getTemplate"),ss=ct("getTemplateLock"),ns=ct("canInsertBlockType"),os=ct("getInserterItems"),rs=ct("hasInserterItems"),is=ct("getBlockListSettings"),as=(0,d.createRegistrySelector)((e=>()=>(k()("select('core/editor').__experimentalGetDefaultTemplateTypes",{since:"6.8",alternative:"select('core/core-data').getCurrentTheme()?.default_template_types"}),e(u.store).getCurrentTheme()?.default_template_types))),ls=(0,d.createRegistrySelector)((e=>(0,d.createSelector)((()=>{k()("select('core/editor').__experimentalGetDefaultTemplatePartAreas",{since:"6.8",alternative:"select('core/core-data').getCurrentTheme()?.default_template_part_areas"});return(e(u.store).getCurrentTheme()?.default_template_part_areas||[]).map((e=>({...e,icon:z(e.icon)})))})))),cs=(0,d.createRegistrySelector)((e=>(0,d.createSelector)(((t,s)=>{k()("select('core/editor').__experimentalGetDefaultTemplateType",{since:"6.8"});const n=e(u.store).getCurrentTheme()?.default_template_types;return n?Object.values(n).find((e=>e.slug===s))??q:q})))),ds=(0,d.createRegistrySelector)((e=>(0,d.createSelector)(((t,s)=>{if(k()("select('core/editor').__experimentalGetTemplateInfo",{since:"6.8"}),!s)return q;const n=e(u.store).getCurrentTheme(),o=n?.default_template_types||[];return Y({template:s,templateAreas:n?.default_template_part_areas||[],templateTypes:o})})))),us=(0,d.createRegistrySelector)((e=>t=>{const s=oe(t),n=e(u.store).getPostType(s);return n?.labels?.singular_name}));function ps(e){return e.publishSidebarActive}const ms=window.wp.a11y,hs=window.wp.apiFetch;var gs=s.n(hs);const _s=window.wp.notices,fs=window.wp.i18n;function bs(e,t){return`wp-autosave-block-editor-post-$t?"auto-draft":e}`}function ys(e,t){window.sessionStorage.removeItem(bs(e,t))}const xs=(e,t,s)=>({dispatch:n})=>{n.setEditedPost(e.type,e.id);if("auto-draft"===e.status&&s){let o;o="content"in t?t.content:e.content.raw;let r=(0,x.parse)(o);r=(0,x.synchronizeBlocksWithTemplate)(r,s),n.resetEditorBlocks(r,{__unstableShouldCreateUndoLevel:!1})}t&&Object.values(t).some((([t,s])=>s!==(e[t]?.raw??e[t])))&&n.editPost(t)};function vs(){return k()("wp.data.dispatch( 'core/editor' ).__experimentalTearDownEditor",{since:"6.5"}),{type:"DO_NOTHING"}}function ws(){return k()("wp.data.dispatch( 'core/editor' ).resetPost",{since:"6.0",version:"6.3",alternative:"Initialize the editor with the setupEditorState action"}),{type:"DO_NOTHING"}}function Ss(){return k()("wp.data.dispatch( 'core/editor' ).updatePost",{since:"5.7",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function ks(e){return k()("wp.data.dispatch( 'core/editor' ).setupEditorState",{since:"6.5",alternative:"wp.data.dispatch( 'core/editor' ).setEditedPost"}),Cs(e.type,e.id)}function Cs(e,t){return{type:"SET_EDITED_POST",postType:e,postId:t}}const Ps=(e,t)=>({select:s,registry:n})=>{const{id:o,type:r}=s.getCurrentPost();n.dispatch(u.store).editEntityRecord("postType",r,o,e,t)},js=(e={})=>async({select:t,dispatch:s,registry:n})=>{if(!t.isEditedPostSaveable())return;const o=t.getEditedPostContent();e.isAutosave||s.editPost({content:o},{undoIgnore:!0});const r=t.getCurrentPost();let i={id:r.id,...n.select(u.store).getEntityRecordNonTransientEdits("postType",r.type,r.id),content:o};s({type:"REQUEST_POST_UPDATE_START",options:e});let a=!1;try{i=await(0,h.applyFiltersAsync)("editor.preSavePost",i,e)}catch(e){a=e}if(!a)try{await n.dispatch(u.store).saveEntityRecord("postType",r.type,i,e)}catch(e){a=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("An error occurred while updating.")}if(a||(a=n.select(u.store).getLastEntitySaveError("postType",r.type,r.id)),!a)try{await(0,h.applyFilters)("editor.__unstableSavePost",Promise.resolve(),e)}catch(e){a=e}if(!a)try{await(0,h.doActionAsync)("editor.savePost",{id:r.id,type:r.type},e)}catch(e){a=e}if(s({type:"REQUEST_POST_UPDATE_FINISH",options:e}),e.isAutosave||"wp_template"!==r.type||"number"!=typeof r.id&&!/^\d+$/.test(r.id)||async function({select:e,registry:t}){const s=e.getEditorSettings();if(s.onNavigateToPreviousEntityRecord)return;const{id:n,slug:o}=e.getCurrentPost(),r=await t.select(u.store).getEntityRecord("root","site");if(r.active_templates[o]===n)return;const i=await t.resolveSelect(u.store).getCurrentTheme(),a=i?.default_template_types.find((e=>e.slug===o));await t.dispatch(_s.store).createNotice("info",(0,fs.sprintf)((0,fs.__)('Do you want to activate this "%s" template?'),a?.title??o),{id:"template-activate-notice",actions:[{label:(0,fs.__)("Activate"),onClick:async()=>{await t.dispatch(_s.store).createNotice("info",(0,fs.__)("Activating template…"),{id:"template-activate-notice"});try{const e=await t.select(u.store).getEntityRecord("root","site");await t.dispatch(u.store).saveEntityRecord("root","site",{active_templates:{...e.active_templates,[o]:n}},{throwOnError:!0}),await t.dispatch(_s.store).createSuccessNotice((0,fs.__)("Template activated."),{id:"template-activate-notice"})}catch(e){throw await t.dispatch(_s.store).createErrorNotice((0,fs.__)("Template activation failed."),{id:"template-activate-notice"}),e}}}]})}({select:t,dispatch:s,registry:n}),a){const e=function(e){const{post:t,edits:s,error:n}=e;if(n&&"rest_autosave_no_changes"===n.code)return[];const o=-1!==["publish","private","future"].indexOf(t.status);if("offline_error"===n.code){const e={publish:(0,fs.__)("Publishing failed because you were offline."),private:(0,fs.__)("Publishing failed because you were offline."),future:(0,fs.__)("Scheduling failed because you were offline."),default:(0,fs.__)("Updating failed because you were offline.")};return[!o&&s.status in e?e[s.status]:e.default,{id:"editor-save"}]}const r={publish:(0,fs.__)("Publishing failed."),private:(0,fs.__)("Publishing failed."),future:(0,fs.__)("Scheduling failed."),default:(0,fs.__)("Updating failed.")};let i=!o&&s.status in r?r[s.status]:r.default;return n.message&&!/<\/?[^>]*>/.test(n.message)&&(i=[i,n.message].join(" ")),[i,{id:"editor-save"}]}({post:r,edits:i,error:a});e.length&&n.dispatch(_s.store).createErrorNotice(...e)}else{const s=t.getCurrentPost(),o=function(e){const{previousPost:t,post:s,postType:n}=e;if(e.options?.isAutosave)return[];const o=["publish","private","future"],r=o.includes(t.status),i=o.includes(s.status),a="trash"===s.status&&"trash"!==t.status;let l,c,d=n?.viewable??!1;a?(l=n.labels.item_trashed,d=!1):r||i?r&&!i?(l=n.labels.item_reverted_to_draft,d=!1):l=!r&&i?{publish:n.labels.item_published,private:n.labels.item_published_privately,future:n.labels.item_scheduled}[s.status]:n.labels.item_updated:(l=(0,fs.__)("Draft saved."),c=!0);const u=[];return d&&u.push({label:c?(0,fs.__)("View Preview"):n.labels.view_item,url:s.link,openInNewTab:!0}),[l,{id:"editor-save",type:"snackbar",actions:u}]}({previousPost:r,post:s,postType:await n.resolveSelect(u.store).getPostType(s.type),options:e});o.length&&n.dispatch(_s.store).createSuccessNotice(...o),e.isAutosave||n.dispatch(g.store).__unstableMarkLastChangeAsPersistent()}};function Es(){return k()("wp.data.dispatch( 'core/editor' ).refreshPost",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}const Ts=()=>async({select:e,dispatch:t,registry:s})=>{const n=e.getCurrentPostType(),o=await s.resolveSelect(u.store).getPostType(n),{rest_base:r,rest_namespace:i="wp/v2"}=o;t({type:"REQUEST_POST_DELETE_START"});try{const s=e.getCurrentPost();await gs()({path:`/$i}/$r}/$s.id}`,method:"DELETE"}),await t.savePost()}catch(e){s.dispatch(_s.store).createErrorNotice(...(a={error:e},[a.error.message&&"unknown_error"!==a.error.code?a.error.message:(0,fs.__)("Trashing failed"),{id:"editor-trash-fail"}]))}var a;t({type:"REQUEST_POST_DELETE_FINISH"})},Bs=({local:e=!1,...t}={})=>async({select:s,dispatch:n})=>{const o=s.getCurrentPost();if("wp_template"!==o.type)if(e){const e=s.isEditedPostNew(),t=s.getEditedPostAttribute("title"),n=s.getEditedPostAttribute("content"),r=s.getEditedPostAttribute("excerpt");!function(e,t,s,n,o){window.sessionStorage.setItem(bs(e,t),JSON.stringify({post_title:s,content:n,excerpt:o}))}(o.id,e,t,n,r)}else await n.savePost({isAutosave:!0,...t})},Is=({forceIsAutosaveable:e}={})=>async({select:t,dispatch:s})=>{if((e||t.isEditedPostAutosaveable())&&!t.isPostLocked()){["draft","auto-draft"].includes(t.getEditedPostAttribute("status"))?await s.savePost({isPreview:!0}):await s.autosave({isPreview:!0})}return t.getEditedPostPreviewLink()},Ns=()=>({registry:e})=>{e.dispatch(u.store).redo()},Rs=()=>({registry:e})=>{e.dispatch(u.store).undo()};function Ds(){return k()("wp.data.dispatch( 'core/editor' ).createUndoLevel",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function As(e){return{type:"UPDATE_POST_LOCK",lock:e}}const Ms=()=>({registry:e})=>{e.dispatch(C.store).set("core","isPublishSidebarEnabled",!0)},Ls=()=>({registry:e})=>{e.dispatch(C.store).set("core","isPublishSidebarEnabled",!1)};function Os(e){return{type:"LOCK_POST_SAVING",lockName:e}}function Fs(e){return{type:"UNLOCK_POST_SAVING",lockName:e}}function Vs(e){return{type:"LOCK_POST_AUTOSAVING",lockName:e}}function Us(e){return{type:"UNLOCK_POST_AUTOSAVING",lockName:e}}const zs=(e,t={})=>({select:s,dispatch:n,registry:o})=>{const{__unstableShouldCreateUndoLevel:r,selection:i}=t,a={blocks:e,selection:i};if(!1!==r){const{id:e,type:t}=s.getCurrentPost();if(o.select(u.store).getEditedEntityRecord("postType",t,e).blocks===a.blocks)return void o.dispatch(u.store).__unstableCreateUndoLevel("postType",t,e);a.content=({blocks:e=[]})=>(0,x.__unstableSerializeAndClean)(e)}n.editPost(a)};function Hs(e){return{type:"UPDATE_EDITOR_SETTINGS",settings:e}}const Gs=e=>({dispatch:t,registry:s,select:n})=>{n.__unstableIsEditorReady()&&(s.dispatch(g.store).clearSelectedBlock(),t.editPost({selection:void 0},{undoIgnore:!0})),t({type:"SET_RENDERING_MODE",mode:e})};function $s(e){return{type:"SET_DEVICE_TYPE",deviceType:e}}const Ws=e=>({registry:t})=>{const s=t.select(C.store).get("core","inactivePanels")??[];let n;n=!!s?.includes(e)?s.filter((t=>t!==e)):[...s,e],t.dispatch(C.store).set("core","inactivePanels",n)},Zs=e=>({registry:t})=>{const s=t.select(C.store).get("core","openPanels")??[];let n;n=!!s?.includes(e)?s.filter((t=>t!==e)):[...s,e],t.dispatch(C.store).set("core","openPanels",n)};function Ys(e){return{type:"REMOVE_PANEL",panelName:e}}const qs=e=>({dispatch:t,registry:s})=>{"object"==typeof e&&e.hasOwnProperty("rootClientId")&&e.hasOwnProperty("insertionIndex")&&$(s.dispatch(g.store)).setInsertionPoint({rootClientId:e.rootClientId,index:e.insertionIndex}),t({type:"SET_IS_INSERTER_OPENED",value:e})};function Ks(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}const Qs=({createNotice:e=!0}={})=>({dispatch:t,registry:s})=>{const n=s.select(C.store).get("core","distractionFree");n&&s.dispatch(C.store).set("core","fixedToolbar",!1),n||s.batch((()=>{s.dispatch(C.store).set("core","fixedToolbar",!0),t.setIsInserterOpened(!1),t.setIsListViewOpened(!1),$(s.dispatch(g.store)).resetZoomLevel()})),s.batch((()=>{s.dispatch(C.store).set("core","distractionFree",!n),e&&s.dispatch(_s.store).createInfoNotice(n?(0,fs.__)("Distraction free mode deactivated."):(0,fs.__)("Distraction free mode activated."),{id:"core/editor/distraction-free-mode/notice",type:"snackbar",actions:[{label:(0,fs.__)("Undo"),onClick:()=>{s.batch((()=>{s.dispatch(C.store).set("core","fixedToolbar",n),s.dispatch(C.store).toggle("core","distractionFree")}))}}]})}))},Xs=()=>({registry:e})=>{e.dispatch(C.store).toggle("core","focusMode");const t=e.select(C.store).get("core","focusMode");e.dispatch(_s.store).createInfoNotice(t?(0,fs.__)("Spotlight mode activated."):(0,fs.__)("Spotlight mode deactivated."),{id:"core/editor/toggle-spotlight-mode/notice",type:"snackbar",actions:[{label:(0,fs.__)("Undo"),onClick:()=>{e.dispatch(C.store).toggle("core","focusMode")}}]})},Js=()=>({registry:e})=>{e.dispatch(C.store).toggle("core","fixedToolbar");const t=e.select(C.store).get("core","fixedToolbar");e.dispatch(_s.store).createInfoNotice(t?(0,fs.__)("Top toolbar activated."):(0,fs.__)("Top toolbar deactivated."),{id:"core/editor/toggle-top-toolbar/notice",type:"snackbar",actions:[{label:(0,fs.__)("Undo"),onClick:()=>{e.dispatch(C.store).toggle("core","fixedToolbar")}}]})},en=e=>({dispatch:t,registry:s})=>{if(s.dispatch(C.store).set("core","editorMode",e),"visual"!==e&&(s.dispatch(g.store).clearSelectedBlock(),$(s.dispatch(g.store)).resetZoomLevel()),"visual"===e)(0,ms.speak)((0,fs.__)("Visual editor selected"),"assertive");else if("text"===e){s.select(C.store).get("core","distractionFree")&&t.toggleDistractionFree(),(0,ms.speak)((0,fs.__)("Code editor selected"),"assertive")}};function tn(){return{type:"OPEN_PUBLISH_SIDEBAR"}}function sn(){return{type:"CLOSE_PUBLISH_SIDEBAR"}}function nn(){return{type:"TOGGLE_PUBLISH_SIDEBAR"}}const on=e=>(...t)=>({registry:s})=>{k()("`wp.data.dispatch( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.dispatch( 'core/block-editor' )."+e+"`",version:"6.2"}),s.dispatch(g.store)[e](...t)},rn=on("resetBlocks"),an=on("receiveBlocks"),ln=on("updateBlock"),cn=on("updateBlockAttributes"),dn=on("selectBlock"),un=on("startMultiSelect"),pn=on("stopMultiSelect"),mn=on("multiSelect"),hn=on("clearSelectedBlock"),gn=on("toggleSelection"),_n=on("replaceBlocks"),fn=on("replaceBlock"),bn=on("moveBlocksDown"),yn=on("moveBlocksUp"),xn=on("moveBlockToPosition"),vn=on("insertBlock"),wn=on("insertBlocks"),Sn=on("showInsertionPoint"),kn=on("hideInsertionPoint"),Cn=on("setTemplateValidity"),Pn=on("synchronizeTemplate"),jn=on("mergeBlocks"),En=on("removeBlocks"),Tn=on("removeBlock"),Bn=on("toggleBlockMode"),In=on("startTyping"),Nn=on("stopTyping"),Rn=on("enterFormattedText"),Dn=on("exitFormattedText"),An=on("insertDefaultBlock"),Mn=on("updateBlockListSettings"),Ln=window.wp.htmlEntities;function On(e){return!!e&&(e.source===D&&(Boolean(e?.plugin)||e?.has_theme_file))}const Fn=window.wp.components;function Vn(e){return"wp_template"===e.type||"wp_template_part"===e.type}function Un(e,t=(0,fs.__)("(no title)")){let s="";return"string"==typeof e.title?s=(0,Ln.decodeEntities)(e.title):e.title&&"rendered"in e.title?s=(0,Ln.decodeEntities)(e.title.rendered):e.title&&"raw"in e.title&&(s=(0,Ln.decodeEntities)(e.title.raw)),s||t}const zn={id:"duplicate-post",label:(0,fs._x)("Duplicate","action label"),isEligible:({status:e})=>"trash"!==e,modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[n,o]=(0,p.useState)({...e[0],title:(0,fs.sprintf)((0,fs._x)("%s (Copy)","post"),Un(e[0]))}),[r,i]=(0,p.useState)(!1),{saveEntityRecord:a}=(0,d.useDispatch)(u.store),{createSuccessNotice:l,createErrorNotice:m}=(0,d.useDispatch)(_s.store);return(0,c.jsx)("form",{onSubmit:async function(e){if(e.preventDefault(),r)return;const o="wp_template"===n.type||"wp_registered_template"===n.type,c={status:o?"publish":"draft",title:n.title,slug:o?n.slug:n.title||(0,fs.__)("No title"),comment_status:n.comment_status,content:"string"==typeof n.content?n.content:n.content.raw,excerpt:"string"==typeof n.excerpt?n.excerpt:n.excerpt?.raw,meta:n.meta,parent:n.parent,password:n.password,template:n.template,format:n.format,featured_media:n.featured_media,menu_order:n.menu_order,ping_status:n.ping_status},d="wp:action-assign-";Object.keys(n?._links||{}).filter((e=>e.startsWith(d))).map((e=>e.slice(17))).forEach((e=>{n.hasOwnProperty(e)&&(c[e]=n[e])})),i(!0);try{const e=await a("postType","wp_registered_template"===n.type?"wp_template":n.type,c,{throwOnError:!0});l((0,fs.sprintf)((0,fs.__)('"%s" successfully created.'),Un(e)),{id:"duplicate-post-action",type:"snackbar"}),s&&s([e])}catch(e){const t=e,s=t.message&&"unknown_error"!==t.code?t.message:(0,fs.__)("An error occurred while duplicating the page.");m(s,{type:"snackbar"})}finally{i(!1),t?.()}},children:(0,c.jsxs)(Fn.__experimentalVStack,{spacing:3,children:["wp_registered_template"===n.type&&(0,c.jsx)("div",{children:(0,fs.__)("You are about to duplicate a bundled template. Changes will not be live until you activate the new template.")}),(0,c.jsx)(Fn.__experimentalInputControl,{__next40pxDefaultSize:!0,label:(0,fs.__)("Title"),placeholder:(0,fs.__)("No title"),value:Un(n),onChange:e=>o((t=>({...t,title:e||(0,fs.__)("No title")})))}),(0,c.jsxs)(Fn.__experimentalHStack,{spacing:2,justify:"end",children:[(0,c.jsx)(Fn.Button,{variant:"tertiary",onClick:t,__next40pxDefaultSize:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Fn.Button,{variant:"primary",type:"submit",isBusy:r,"aria-disabled":r,__next40pxDefaultSize:!0,children:(0,fs._x)("Duplicate","action label")})]})]})})}};var Hn=zn,Gn=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})});var $n={id:"view-post",label:(0,fs._x)("View","verb"),isPrimary:!0,icon:Gn,isEligible:e=>"trash"!==e.status,callback(e,{onActionPerformed:t}){const s=e[0];window.open(s?.link,"_blank"),t&&t(e)}};var Wn={id:"view-post-revisions",context:"list",label(e){const t=e[0]._links?.["version-history"]?.[0]?.count??0;return(0,fs.sprintf)((0,fs.__)("View revisions (%d)"),t)},isEligible(e){if("trash"===e.status)return!1;return!!(e?._links?.["predecessor-version"]?.[0]?.id??null)&&(e?._links?.["version-history"]?.[0]?.count??0)>1},callback(e,{onActionPerformed:t}){const s=e[0],n=(0,w.addQueryArgs)("revision.php",{revision:s?._links?.["predecessor-version"]?.[0]?.id});document.location.href=n,t&&t(e)}},Zn=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z"})});var Yn=function(){return Yn=Object.assign||function(e){for(var t,s=1,n=arguments.length;s<n;s++)for(var o in t=arguments[s])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Yn.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function qn(e){return e.toLowerCase()}var Kn=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],Qn=/[^A-Z0-9]+/gi;function Xn(e,t,s){return t instanceof RegExp?e.replace(t,s):t.reduce((function(e,t){return e.replace(t,s)}),e)}function Jn(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var s=t.splitRegexp,n=void 0===s?Kn:s,o=t.stripRegexp,r=void 0===o?Qn:o,i=t.transform,a=void 0===i?qn:i,l=t.delimiter,c=void 0===l?" ":l,d=Xn(Xn(e,n,"$1\0$2"),r,"\0"),u=0,p=d.length;"\0"===d.charAt(u);)u++;for(;"\0"===d.charAt(p-1);)p--;return d.slice(u,p).split("\0").map(a).join(c)}(e,Yn({delimiter:"."},t))}function eo(e,t){return void 0===t&&(t={}),Jn(e,Yn({delimiter:"-"},t))}function to(e,t){return`fields-create-template-part-modal__area-option-$e}-$t}`}function so(e,t){return`fields-create-template-part-modal__area-option-description-$e}-$t}`}function no({modalTitle:e,...t}){const s=(0,d.useSelect)((e=>e(u.store).getPostType("wp_template_part")?.labels?.add_new_item),[]);return(0,c.jsx)(Fn.Modal,{title:e||s,onRequestClose:t.closeModal,overlayClassName:"fields-create-template-part-modal",focusOnMount:"firstContentElement",size:"medium",children:(0,c.jsx)(ro,{...t})})}const oo=e=>"header"===e?O:"footer"===e?F:"sidebar"===e?V:U;function ro({defaultArea:e="uncategorized",blocks:t=[],confirmLabel:s=(0,fs.__)("Add"),closeModal:n,onCreate:o,onError:r,defaultTitle:i=""}){const{createErrorNotice:a}=(0,d.useDispatch)(_s.store),{saveEntityRecord:l}=(0,d.useDispatch)(u.store),h=(0,d.useSelect)((e=>e(u.store).getEntityRecords("postType","wp_template_part",{per_page:-1})),[])??[],[g,_]=(0,p.useState)(i),[f,b]=(0,p.useState)(e),[y,v]=(0,p.useState)(!1),w=(0,m.useInstanceId)(no),S=(0,d.useSelect)((e=>e(u.store).getCurrentTheme()?.default_template_part_areas),[]);async function k(){if(g&&!y)try{v(!0);const e=((e,t)=>{const s=e.toLowerCase(),n=t.map((e=>e.title.rendered.toLowerCase()));if(!n.includes(s))return e;let o=2;for(;n.includes(`$s} $o}`);)o++;return`$e} $o}`})(g,h),s=(e=>eo(e).replace(/[^\w-]+/g,"")||"wp-custom-part")(e),n=await l("postType","wp_template_part",{slug:s,title:e,content:(0,x.serialize)(t),area:f},{throwOnError:!0});await o(n)}catch(e){const t=e instanceof Error&&"code"in e&&e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("An error occurred while creating the template part.");a(t,{type:"snackbar"}),r?.()}finally{v(!1)}}return(0,c.jsx)("form",{onSubmit:async e=>{e.preventDefault(),await k()},children:(0,c.jsxs)(Fn.__experimentalVStack,{spacing:"4",children:[(0,c.jsx)(Fn.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,fs.__)("Name"),value:g,onChange:_,required:!0}),(0,c.jsxs)("fieldset",{className:"fields-create-template-part-modal__area-fieldset",children:[(0,c.jsx)(Fn.BaseControl.VisualLabel,{as:"legend",children:(0,fs.__)("Area")}),(0,c.jsx)("div",{className:"fields-create-template-part-modal__area-radio-group",children:(S??[]).map((e=>{const t=oo(e.icon);return(0,c.jsxs)("div",{className:"fields-create-template-part-modal__area-radio-wrapper",children:[(0,c.jsx)("input",{type:"radio",id:to(e.area,w),name:`fields-create-template-part-modal__area-$w}`,value:e.area,checked:f===e.area,onChange:()=>{b(e.area)},"aria-describedby":so(e.area,w)}),(0,c.jsx)(Fn.Icon,{icon:t,className:"fields-create-template-part-modal__area-radio-icon"}),(0,c.jsx)("label",{htmlFor:to(e.area,w),className:"fields-create-template-part-modal__area-radio-label",children:e.label}),(0,c.jsx)(Fn.Icon,{icon:Zn,className:"fields-create-template-part-modal__area-radio-checkmark"}),(0,c.jsx)("p",{className:"fields-create-template-part-modal__area-radio-description",id:so(e.area,w),children:e.description})]},e.area)}))})]}),(0,c.jsxs)(Fn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{n()},children:(0,fs.__)("Cancel")}),(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit","aria-disabled":!g||y,isBusy:y,children:s})]})]})})}const io={id:"duplicate-template-part",label:(0,fs._x)("Duplicate","action label"),isEligible:e=>"wp_template_part"===e.type,modalHeader:(0,fs._x)("Duplicate template part","action label"),modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t})=>{const[s]=e,n=(0,p.useMemo)((()=>s.blocks??(0,x.parse)("string"==typeof s.content?s.content:s.content.raw,{__unstableSkipMigrationLogs:!0})),[s.content,s.blocks]),{createSuccessNotice:o}=(0,d.useDispatch)(_s.store);return(0,c.jsx)(ro,{blocks:n,defaultArea:s.area,defaultTitle:(0,fs.sprintf)((0,fs._x)("%s (Copy)","template part"),Un(s)),onCreate:function(e){o((0,fs.sprintf)((0,fs._x)('"%s" duplicated.',"template part"),Un(e)),{type:"snackbar",id:"edit-site-patterns-success"}),t?.()},onError:t,confirmLabel:(0,fs._x)("Duplicate","action label"),closeModal:t??(()=>{})})}};var ao=io;const lo=window.wp.patterns,{lock:co,unlock:uo}=(0,H.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/fields"),{CreatePatternModalContents:po,useDuplicatePatternProps:mo}=uo(lo.privateApis),ho={id:"duplicate-pattern",label:(0,fs._x)("Duplicate","action label"),isEligible:e=>"wp_template_part"!==e.type,modalHeader:(0,fs._x)("Duplicate pattern","action label"),modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t})=>{const[s]=e,n=mo({pattern:s,onSuccess:()=>t?.()});return(0,c.jsx)(po,{onClose:t,confirmLabel:(0,fs._x)("Duplicate","action label"),...n})}};var go=ho;const{PATTERN_TYPES:_o}=uo(lo.privateApis),fo={id:"rename-post",label:(0,fs.__)("Rename"),modalFocusOnMount:"firstContentElement",isEligible:e=>"trash"!==e.status&&(["wp_template_part",...Object.values(_o)].includes(e.type)?function(e){return"wp_template_part"===e.type}(e)?"custom"===e.source&&!e?.has_theme_file&&e.permissions?.update:e.type===_o.user&&e.permissions?.update:e.permissions?.update),RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[n]=e,[o,r]=(0,p.useState)((()=>Un(n,""))),{editEntityRecord:i,saveEditedEntityRecord:a}=(0,d.useDispatch)(u.store),{createSuccessNotice:l,createErrorNotice:m}=(0,d.useDispatch)(_s.store);return(0,c.jsx)("form",{onSubmit:async function(c){c.preventDefault();try{await i("postType",n.type,n.id,{title:o}),r(""),t?.(),await a("postType",n.type,n.id,{throwOnError:!0}),l((0,fs.__)("Name updated"),{type:"snackbar"}),s?.(e)}catch(e){const t=e,s=t.message&&"unknown_error"!==t.code?t.message:(0,fs.__)("An error occurred while updating the name");m(s,{type:"snackbar"})}},children:(0,c.jsxs)(Fn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Fn.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,fs.__)("Name"),value:o,onChange:r,required:!0}),(0,c.jsxs)(Fn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},children:(0,fs.__)("Cancel")}),(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,fs.__)("Save")})]})]})})}};var bo=fo;const yo={id:"order-pages",label:(0,fs.__)("Order"),isEligible:({status:e})=>"trash"!==e,modalFocusOnMount:"firstContentElement",RenderModal:function({items:e,closeModal:t,onActionPerformed:s}){const[n,o]=(0,p.useState)(e[0]),{editEntityRecord:r,saveEditedEntityRecord:i}=(0,d.useDispatch)(u.store),{createSuccessNotice:a,createErrorNotice:l}=(0,d.useDispatch)(_s.store),m=function(e){return"number"==typeof e.menu_order&&Number.isInteger(e.menu_order)&&e.menu_order>0}(n);return(0,c.jsx)("form",{onSubmit:async function(o){if(o.preventDefault(),m)try{await r("postType",n.type,n.id,{menu_order:n.menu_order}),t?.(),await i("postType",n.type,n.id,{throwOnError:!0}),a((0,fs.__)("Order updated."),{type:"snackbar"}),s?.(e)}catch(e){const t=e,s=t.message&&"unknown_error"!==t.code?t.message:(0,fs.__)("An error occurred while updating the order");l(s,{type:"snackbar"})}},children:(0,c.jsxs)(Fn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)("div",{children:(0,fs.__)("Determines the order of pages. Pages with the same order value are sorted alphabetically. Negative order values are supported.")}),(0,c.jsx)(Fn.__experimentalInputControl,{__next40pxDefaultSize:!0,label:(0,fs.__)("Order"),type:"number",value:"number"==typeof n.menu_order&&Number.isInteger(n.menu_order)?String(n.menu_order):"",onChange:e=>{const t=parseInt(e,10);o({...n,menu_order:isNaN(t)?void 0:t})}}),(0,c.jsxs)(Fn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},children:(0,fs.__)("Cancel")}),(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",accessibleWhenDisabled:!0,disabled:!m,children:(0,fs.__)("Save")})]})]})})}};var xo=yo;"stream"in Blob.prototype||Object.defineProperty(Blob.prototype,"stream",{value(){return new Response(this).body}}),"setBigUint64"in DataView.prototype||Object.defineProperty(DataView.prototype,"setBigUint64",{value(e,t,s){const n=Number(0xffffffffn&t),o=Number(t>>32n);this.setUint32(e+(s?0:4),n,s),this.setUint32(e+(s?4:0),o,s)}});var vo=e=>new DataView(new ArrayBuffer(e)),wo=e=>new Uint8Array(e.buffer||e),So=e=>(new TextEncoder).encode(String(e)),ko=e=>Math.min(4294967295,Number(e)),Co=e=>Math.min(65535,Number(e));function Po(e,t,s){void 0===t||t instanceof Date||(t=new Date(t));const n=void 0!==e;if(s||(s=n?436:509),e instanceof File)return{isFile:n,t:t||new Date(e.lastModified),bytes:e.stream(),mode:s};if(e instanceof Response)return{isFile:n,t:t||new Date(e.headers.get("Last-Modified")||Date.now()),bytes:e.body,mode:s};if(void 0===t)t=new Date;else if(isNaN(t))throw new Error("Invalid modification date.");if(!n)return{isFile:n,t,mode:s};if("string"==typeof e)return{isFile:n,t,bytes:So(e),mode:s};if(e instanceof Blob)return{isFile:n,t,bytes:e.stream(),mode:s};if(e instanceof Uint8Array||e instanceof ReadableStream)return{isFile:n,t,bytes:e,mode:s};if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return{isFile:n,t,bytes:wo(e),mode:s};if(Symbol.asyncIterator in e)return{isFile:n,t,bytes:jo(e[Symbol.asyncIterator]()),mode:s};throw new TypeError("Unsupported input format.")}function jo(e,t=e){return new ReadableStream({async pull(t){let s=0;for(;t.desiredSize>s;){const n=await e.next();if(!n.value){t.close();break}{const e=Eo(n.value);t.enqueue(e),s+=e.byteLength}}},cancel(e){t.throw?.(e)}})}function Eo(e){return"string"==typeof e?So(e):e instanceof Uint8Array?e:wo(e)}function To(e,t,s){let[n,o]=function(e){return e?e instanceof Uint8Array?[e,1]:ArrayBuffer.isView(e)||e instanceof ArrayBuffer?[wo(e),1]:[So(e),0]:[void 0,0]}(t);if(e instanceof File)return{i:Io(n||So(e.name)),o:BigInt(e.size),u:o};if(e instanceof Response){const t=e.headers.get("content-disposition"),r=t&&t.match(/;\s*filename\*?\s*=\s*(?:UTF-\d+''|)["']?([^;"'\r\n]*)["']?(?:;|$)/i),i=r&&r[1]||e.url&&new URL(e.url).pathname.split("/").findLast(Boolean),a=i&&decodeURIComponent(i),l=s||+e.headers.get("content-length");return{i:Io(n||So(a)),o:BigInt(l),u:o}}return n=Io(n,void 0!==e||void 0!==s),"string"==typeof e?{i:n,o:BigInt(So(e).length),u:o}:e instanceof Blob?{i:n,o:BigInt(e.size),u:o}:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?{i:n,o:BigInt(e.byteLength),u:o}:{i:n,o:Bo(e,s),u:o}}function Bo(e,t){return t>-1?BigInt(t):e?void 0:0n}function Io(e,t=1){if(!e||e.every((e=>47===e)))throw new Error("The file must have a name.");if(t)for(;47===e[e.length-1];)e=e.subarray(0,-1);else 47!==e[e.length-1]&&(e=new Uint8Array([...e,47]));return e}var No=new Uint32Array(256);for(let e=0;e<256;++e){let t=e;for(let e=0;e<8;++e)t=t>>>1^(1&t&&3988292384);No[e]=t}function Ro(e,t=0){t=~t;for(var s=0,n=e.length;s<n;s++)t=t>>>8^No[255&t^e[s]];return~t>>>0}function Do(e,t,s=0){const n=e.getSeconds()>>1|e.getMinutes()<<5|e.getHours()<<11,o=e.getDate()|e.getMonth()+1<<5|e.getFullYear()-1980<<9;t.setUint16(s,n,1),t.setUint16(s+2,o,1)}function Ao({i:e,u:t},s){return 8*(!t||(s??function(e){try{Mo.decode(e)}catch{return 0}return 1}(e)))}var Mo=new TextDecoder("utf8",{fatal:1});function Lo(e,t=0){const s=vo(30);return s.setUint32(0,1347093252),s.setUint32(4,754976768|t),Do(e.t,s,10),s.setUint16(26,e.i.length,1),wo(s)}async function*Oo(e){let{bytes:t}=e;if("then"in t&&(t=await t),t instanceof Uint8Array)yield t,e.l=Ro(t,0),e.o=BigInt(t.length);else{e.o=0n;const s=t.getReader();for(;;){const{value:t,done:n}=await s.read();if(n)break;e.l=Ro(t,e.l),e.o+=BigInt(t.length),yield t}}}function Fo(e,t){const s=vo(16+(t?8:0));return s.setUint32(0,1347094280),s.setUint32(4,e.isFile?e.l:0,1),t?(s.setBigUint64(8,e.o,1),s.setBigUint64(16,e.o,1)):(s.setUint32(8,ko(e.o),1),s.setUint32(12,ko(e.o),1)),wo(s)}function Vo(e,t,s=0,n=0){const o=vo(46);return o.setUint32(0,1347092738),o.setUint32(4,755182848),o.setUint16(8,2048|s),Do(e.t,o,12),o.setUint32(16,e.isFile?e.l:0,1),o.setUint32(20,ko(e.o),1),o.setUint32(24,ko(e.o),1),o.setUint16(28,e.i.length,1),o.setUint16(30,n,1),o.setUint16(40,e.mode|(e.isFile?32768:16384),1),o.setUint32(42,ko(t),1),wo(o)}function Uo(e,t,s){const n=vo(s);return n.setUint16(0,1,1),n.setUint16(2,s-4,1),16&s&&(n.setBigUint64(4,e.o,1),n.setBigUint64(12,e.o,1)),n.setBigUint64(s-8,t,1),wo(n)}function zo(e){return e instanceof File||e instanceof Response?[[e],[e]]:[[e.input,e.name,e.size],[e.input,e.lastModified,e.mode]]}function Ho(e,t={}){const s={"Content-Type":"application/zip","Content-Disposition":"attachment"};return("bigint"==typeof t.length||Number.isInteger(t.length))&&t.length>0&&(s["Content-Length"]=String(t.length)),t.metadata&&(s["Content-Length"]=String((e=>function(e){let t=BigInt(22),s=0n,n=0;for(const o of e){if(!o.i)throw new Error("Every file must have a non-empty name.");if(void 0===o.o)throw new Error(`Missing size for file "${(new TextDecoder).decode(o.i)}".`);const e=o.o>=0xffffffffn,r=s>=0xffffffffn;s+=BigInt(46+o.i.length+(e&&8))+o.o,t+=BigInt(o.i.length+46+(12*r|28*e)),n||(n=e)}return(n||s>=0xffffffffn)&&(t+=BigInt(76)),t+s}(function*(e){for(const t of e)yield To(...zo(t)[0])}(e)))(t.metadata))),new Response(Go(e,t),{headers:s})}function Go(e,t={}){const s=function(e){const t=e[Symbol.iterator in e?Symbol.iterator:Symbol.asyncIterator]();return{async next(){const e=await t.next();if(e.done)return e;const[s,n]=zo(e.value);return{done:0,value:Object.assign(Po(...n),To(...s))}},throw:t.throw?.bind(t),[Symbol.asyncIterator](){return this}}}(e);return jo(async function*(e,t){const s=[];let n=0n,o=0n,r=0;for await(const i of e){const e=Ao(i,t.buffersAreUTF8);yield Lo(i,e),yield new Uint8Array(i.i),i.isFile&&(yield*Oo(i));const a=i.o>=0xffffffffn,l=12*(n>=0xffffffffn)|28*a;yield Fo(i,a),s.push(Vo(i,n,e,l)),s.push(i.i),l&&s.push(Uo(i,n,l)),a&&(n+=8n),o++,n+=BigInt(46+i.i.length)+i.o,r||(r=a)}let i=0n;for(const e of s)yield e,i+=BigInt(e.length);if(r||n>=0xffffffffn){const e=vo(76);e.setUint32(0,1347094022),e.setBigUint64(4,BigInt(44),1),e.setUint32(12,755182848),e.setBigUint64(24,o,1),e.setBigUint64(32,o,1),e.setBigUint64(40,i,1),e.setBigUint64(48,n,1),e.setUint32(56,1347094023),e.setBigUint64(64,n+i,1),e.setUint32(72,1,1),yield wo(e)}const a=vo(22);a.setUint32(0,1347093766),a.setUint16(8,Co(o),1),a.setUint16(10,Co(o),1),a.setUint32(12,ko(i),1),a.setUint32(16,ko(n),1),yield wo(a)}(s,t),s)}const $o=window.wp.blob;var Wo=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"})});function Zo(e){return JSON.stringify({__file:e.type,title:Un(e),content:"string"==typeof e.content?e.content:e.content?.raw,syncStatus:e.wp_pattern_sync_status},null,2)}var Yo={id:"export-pattern",label:(0,fs.__)("Export as JSON"),icon:Wo,supportsBulk:!0,isEligible:e=>"wp_block"===e.type,callback:async e=>{if(1===e.length)return(0,$o.downloadBlob)(`$eo(Un(e[0])||e[0].slug)}.json`,Zo(e[0]),"application/json");const t={},s=e.map((e=>{const s=eo(Un(e)||e.slug);return t[s]=(t[s]||0)+1,{name:s+(t[s]>1?"-"+(t[s]-1):"")+".json",lastModified:new Date,input:Zo(e)}}));return(0,$o.downloadBlob)((0,fs.__)("patterns-export")+".zip",await Ho(s).blob(),"application/zip")}},qo=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z"})});var Ko={id:"restore",label:(0,fs.__)("Restore"),isPrimary:!0,icon:qo,supportsBulk:!0,isEligible:e=>!Vn(e)&&"wp_block"!==e.type&&"trash"===e.status&&e.permissions?.update,async callback(e,{registry:t,onActionPerformed:s}){const{createSuccessNotice:n,createErrorNotice:o}=t.dispatch(_s.store),{editEntityRecord:r,saveEditedEntityRecord:i}=t.dispatch(u.store);await Promise.allSettled(e.map((e=>r("postType",e.type,e.id,{status:"draft"}))));const a=await Promise.allSettled(e.map((e=>i("postType",e.type,e.id,{throwOnError:!0}))));if(a.every((({status:e})=>"fulfilled"===e))){let t;t=1===e.length?(0,fs.sprintf)((0,fs.__)('"%s" has been restored.'),Un(e[0])):"page"===e[0].type?(0,fs.sprintf)((0,fs.__)("%d pages have been restored."),e.length):(0,fs.sprintf)((0,fs.__)("%d posts have been restored."),e.length),n(t,{type:"snackbar",id:"restore-post-action"}),s&&s(e)}else{let e;if(1===a.length){const t=a[0];e=t.reason?.message?t.reason.message:(0,fs.__)("An error occurred while restoring the post.")}else{const t=new Set,s=a.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}e=0===t.size?(0,fs.__)("An error occurred while restoring the posts."):1===t.size?(0,fs.sprintf)((0,fs.__)("An error occurred while restoring the posts: %s"),[...t][0]):(0,fs.sprintf)((0,fs.__)("Some errors occurred while restoring the posts: %s"),[...t].join(","))}o(e,{type:"snackbar"})}}};const Qo=async(e,{allowUndo:t=!0}={})=>{const s="edit-site-template-reverted";var n;if((0,d.dispatch)(_s.store).removeNotice(s),(n=e)&&"custom"===n.source&&(Boolean(n?.plugin)||n?.has_theme_file))try{const n=(0,d.select)(u.store).getEntityConfig("postType",e.type);if(!n)return void(0,d.dispatch)(_s.store).createErrorNotice((0,fs.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const o=(0,w.addQueryArgs)(`$n.baseURL}/$e.id}`,{context:"edit",source:e.origin}),r=await gs()({path:o});if(!r)return void(0,d.dispatch)(_s.store).createErrorNotice((0,fs.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const i=({blocks:e=[]})=>(0,x.__unstableSerializeAndClean)(e),a=(0,d.select)(u.store).getEditedEntityRecord("postType",e.type,e.id);(0,d.dispatch)(u.store).editEntityRecord("postType",e.type,e.id,{content:i,blocks:a.blocks,source:"custom"},{undoIgnore:!0});const l=(0,x.parse)(r?.content?.raw);if((0,d.dispatch)(u.store).editEntityRecord("postType",e.type,r.id,{content:i,blocks:l,source:"theme"}),t){const t=()=>{(0,d.dispatch)(u.store).editEntityRecord("postType",e.type,a.id,{content:i,blocks:a.blocks,source:"custom"})};(0,d.dispatch)(_s.store).createSuccessNotice((0,fs.__)("Template reset."),{type:"snackbar",id:s,actions:[{label:(0,fs.__)("Undo"),onClick:t}]})}}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("Template revert failed. Please reload.");(0,d.dispatch)(_s.store).createErrorNotice(t,{type:"snackbar"})}else(0,d.dispatch)(_s.store).createErrorNotice((0,fs.__)("This template is not revertable."),{type:"snackbar"})},Xo={id:"reset-post",label:(0,fs.__)("Reset"),isEligible:e=>Vn(e)&&"custom"===e?.source&&(Boolean("wp_template"===e.type&&e?.plugin)||e?.has_theme_file),icon:qo,supportsBulk:!0,hideModalHeader:!0,modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[n,o]=(0,p.useState)(!1),{saveEditedEntityRecord:r}=(0,d.useDispatch)(u.store),{createSuccessNotice:i,createErrorNotice:a}=(0,d.useDispatch)(_s.store);return(0,c.jsxs)(Fn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Fn.__experimentalText,{children:(0,fs.__)("Reset to default and clear all customizations?")}),(0,c.jsxs)(Fn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,disabled:n,accessibleWhenDisabled:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:async()=>{o(!0),await(async()=>{try{for(const t of e)await Qo(t,{allowUndo:!1}),await r("postType",t.type,t.id);i(e.length>1?(0,fs.sprintf)((0,fs.__)("%d items reset."),e.length):(0,fs.sprintf)((0,fs.__)('"%s" reset.'),Un(e[0])),{type:"snackbar",id:"revert-template-action"})}catch(t){let s;s="wp_template"===e[0].type?1===e.length?(0,fs.__)("An error occurred while reverting the template."):(0,fs.__)("An error occurred while reverting the templates."):1===e.length?(0,fs.__)("An error occurred while reverting the template part."):(0,fs.__)("An error occurred while reverting the template parts.");const n=t,o=n.message&&"unknown_error"!==n.code?n.message:s;a(o,{type:"snackbar"})}})(),s?.(e),o(!1),t?.()},isBusy:n,disabled:n,accessibleWhenDisabled:!0,children:(0,fs.__)("Reset")})]})]})}};var Jo=Xo,er=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})});function tr(e){const t=new Set;if(1===e.length){const s=e[0];s.reason?.message&&t.add(s.reason.message)}else{const s=e.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}}return t}const{PATTERN_TYPES:sr}=uo(lo.privateApis),nr={id:"delete-post",label:(0,fs.__)("Delete"),isPrimary:!0,icon:er,isEligible:e=>Vn(e)?function(e){return!!e&&[e.source,e.source].includes("custom")&&!Boolean("wp_template"===e.type&&e?.plugin)&&!e.has_theme_file}(e):e.type===sr.user,supportsBulk:!0,hideModalHeader:!0,modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[n,o]=(0,p.useState)(!1),r=e.every((e=>Vn(e)&&e?.has_theme_file));return(0,c.jsxs)(Fn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Fn.__experimentalText,{children:e.length>1?(0,fs.sprintf)((0,fs._n)("Delete %d item?","Delete %d items?",e.length),e.length):(0,fs.sprintf)((0,fs._x)('Delete "%s"?',"template part"),Un(e[0]))}),(0,c.jsxs)(Fn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Fn.Button,{variant:"tertiary",onClick:t,disabled:n,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Fn.Button,{variant:"primary",onClick:async()=>{o(!0);const n={success:{messages:{getMessage:e=>r?(0,fs.sprintf)((0,fs.__)('"%s" reset.'),(0,Ln.decodeEntities)(Un(e))):(0,fs.sprintf)((0,fs._x)('"%s" deleted.',"template part"),(0,Ln.decodeEntities)(Un(e))),getBatchMessage:()=>r?(0,fs.__)("Items reset."):(0,fs.__)("Items deleted.")}},error:{messages:{getMessage:e=>1===e.size?[...e][0]:r?(0,fs.__)("An error occurred while reverting the item."):(0,fs.__)("An error occurred while deleting the item."),getBatchMessage:e=>0===e.size?r?(0,fs.__)("An error occurred while reverting the items."):(0,fs.__)("An error occurred while deleting the items."):1===e.size?r?(0,fs.sprintf)((0,fs.__)("An error occurred while reverting the items: %s"),[...e][0]):(0,fs.sprintf)((0,fs.__)("An error occurred while deleting the items: %s"),[...e][0]):r?(0,fs.sprintf)((0,fs.__)("Some errors occurred while reverting the items: %s"),[...e].join(",")):(0,fs.sprintf)((0,fs.__)("Some errors occurred while deleting the items: %s"),[...e].join(","))}}};await(async(e,t,s)=>{const{createSuccessNotice:n,createErrorNotice:o}=(0,d.dispatch)(_s.store),{deleteEntityRecord:r}=(0,d.dispatch)(u.store),i=await Promise.allSettled(e.map((e=>r("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(i.every((({status:e})=>"fulfilled"===e))){let o;o=1===i.length?t.success.messages.getMessage(e[0]):t.success.messages.getBatchMessage(e),n(o,{type:t.success.type??"snackbar",id:t.success.id}),s.onActionPerformed?.(e)}else{const e=tr(i);let n="";n=1===i.length?t.error.messages.getMessage(e):t.error.messages.getBatchMessage(e),o(n,{type:t.error.type??"snackbar",id:t.error.id}),s.onActionError?.()}})(e,n,{onActionPerformed:s}),o(!1),t?.()},isBusy:n,disabled:n,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,fs.__)("Delete")})]})]})}};var or=nr;const rr={id:"move-to-trash",label:(0,fs.__)("Move to trash"),isPrimary:!0,icon:er,isEligible:e=>"wp_template_part"!==e.type&&"wp_block"!==e.type&&(!!e.status&&!["auto-draft","trash"].includes(e.status)&&e.permissions?.delete),supportsBulk:!0,hideModalHeader:!0,modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[n,o]=(0,p.useState)(!1),{createSuccessNotice:r,createErrorNotice:i}=(0,d.useDispatch)(_s.store),{deleteEntityRecord:a}=(0,d.useDispatch)(u.store);return(0,c.jsxs)(Fn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Fn.__experimentalText,{children:1===e.length?(0,fs.sprintf)((0,fs.__)('Are you sure you want to move "%s" to the trash?'),Un(e[0])):(0,fs.sprintf)((0,fs._n)("Are you sure you want to move %d item to the trash ?","Are you sure you want to move %d items to the trash ?",e.length),e.length)}),(0,c.jsxs)(Fn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,disabled:n,accessibleWhenDisabled:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:async()=>{o(!0);const n=await Promise.allSettled(e.map((e=>a("postType",e.type,e.id.toString(),{},{throwOnError:!0}))));if(n.every((({status:e})=>"fulfilled"===e))){let t;t=1===n.length?(0,fs.sprintf)((0,fs.__)('"%s" moved to the trash.'),Un(e[0])):(0,fs.sprintf)((0,fs._n)("%d item moved to the trash.","%d items moved to the trash.",e.length),e.length),r(t,{type:"snackbar",id:"move-to-trash-action"})}else{let e;if(1===n.length){const t=n[0];e=t.reason?.message?t.reason.message:(0,fs.__)("An error occurred while moving the item to the trash.")}else{const t=new Set,s=n.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}e=0===t.size?(0,fs.__)("An error occurred while moving the items to the trash."):1===t.size?(0,fs.sprintf)((0,fs.__)("An error occurred while moving the item to the trash: %s"),[...t][0]):(0,fs.sprintf)((0,fs.__)("Some errors occurred while moving the items to the trash: %s"),[...t].join(","))}i(e,{type:"snackbar"})}s&&s(e),o(!1),t?.()},isBusy:n,disabled:n,accessibleWhenDisabled:!0,children:(0,fs._x)("Trash","verb")})]})]})}};var ir=rr;const ar={id:"permanently-delete",label:(0,fs.__)("Permanently delete"),supportsBulk:!0,icon:er,isEligible(e){if(Vn(e)||"wp_block"===e.type)return!1;const{status:t,permissions:s}=e;return"trash"===t&&s?.delete},hideModalHeader:!0,modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[n,o]=(0,p.useState)(!1),{createSuccessNotice:r,createErrorNotice:i}=(0,d.useDispatch)(_s.store),{deleteEntityRecord:a}=(0,d.useDispatch)(u.store);return(0,c.jsxs)(Fn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Fn.__experimentalText,{children:e.length>1?(0,fs.sprintf)((0,fs._n)("Are you sure you want to permanently delete %d item?","Are you sure you want to permanently delete %d items?",e.length),e.length):(0,fs.sprintf)((0,fs.__)('Are you sure you want to permanently delete "%s"?'),(0,Ln.decodeEntities)(Un(e[0])))}),(0,c.jsxs)(Fn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Fn.Button,{variant:"tertiary",onClick:t,disabled:n,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Fn.Button,{variant:"primary",onClick:async()=>{o(!0);const n=await Promise.allSettled(e.map((e=>a("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(n.every((({status:e})=>"fulfilled"===e))){let t;t=1===n.length?(0,fs.sprintf)((0,fs.__)('"%s" permanently deleted.'),Un(e[0])):(0,fs.__)("The items were permanently deleted."),r(t,{type:"snackbar",id:"permanently-delete-post-action"}),s?.(e)}else{let e;if(1===n.length){const t=n[0];e=t.reason?.message?t.reason.message:(0,fs.__)("An error occurred while permanently deleting the item.")}else{const t=new Set,s=n.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}e=0===t.size?(0,fs.__)("An error occurred while permanently deleting the items."):1===t.size?(0,fs.sprintf)((0,fs.__)("An error occurred while permanently deleting the items: %s"),[...t][0]):(0,fs.sprintf)((0,fs.__)("Some errors occurred while permanently deleting the items: %s"),[...t].join(","))}i(e,{type:"snackbar"})}o(!1),t?.()},isBusy:n,disabled:n,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,fs.__)("Delete permanently")})]})]})}};var lr=ar;const cr=window.wp.mediaUtils;var dr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M5 11.25h14v1.5H5z"})});const ur={id:"featured_media",type:"media",label:(0,fs.__)("Featured Image"),Edit:({data:e,field:t,onChange:s})=>{const{id:n}=t,o=t.getValue({item:e}),r=(0,d.useSelect)((e=>{const{getEntityRecord:t}=e(u.store);return t("postType","attachment",o)}),[o]),i=(0,p.useCallback)((e=>s({[n]:e})),[n,s]),a=r?.source_url,l=r?.title?.rendered,m=(0,p.useRef)(null);return(0,c.jsx)("fieldset",{className:"fields-controls__featured-image",children:(0,c.jsx)("div",{className:"fields-controls__featured-image-container",children:(0,c.jsx)(cr.MediaUpload,{onSelect:e=>{i(e.id)},allowedTypes:["image"],render:({open:e})=>(0,c.jsx)("div",{ref:m,role:"button",tabIndex:-1,onClick:()=>{e()},onKeyDown:e,children:(0,c.jsxs)(Fn.__experimentalGrid,{rowGap:0,columnGap:8,templateColumns:"24px 1fr 24px",children:[a&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("img",{className:"fields-controls__featured-image-image",alt:"",width:24,height:24,src:a}),(0,c.jsx)("span",{className:"fields-controls__featured-image-title",children:l})]}),!a&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"fields-controls__featured-image-placeholder",style:{width:"24px",height:"24px"}}),(0,c.jsx)("span",{className:"fields-controls__featured-image-title",children:(0,fs.__)("Choose an image…")})]}),a&&(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(Fn.Button,{size:"small",className:"fields-controls__featured-image-remove-button",icon:dr,onClick:e=>{e.stopPropagation(),i(0)}})})]})})})})})},render:({item:e,config:t})=>{const s=e?._embedded?.["wp:featuredmedia"]?.[0],n=s?.source_url;return n?(0,c.jsx)("img",{className:"fields-controls__featured-image-image",src:n,alt:"",srcSet:s?.media_details?.sizes?Object.values(s.media_details.sizes).map((e=>`$e.source_url} $e.width}w`)).join(", "):void 0,sizes:t?.sizes||"100vw"}):(0,c.jsx)("span",{className:"fields-controls__featured-image-placeholder"})},enableSorting:!1,filterBy:!1};var pr=ur;function mr(e){var t,s,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(s=mr(e[t]))&&(n&&(n+=" "),n+=s)}else for(s in e)e[s]&&(n&&(n+=" "),n+=s);return n}const hr=function(){for(var e,t,s=0,n="",o=arguments.length;s<o;s++)(e=arguments[s])&&(t=mr(e))&&(n&&(n+=" "),n+=t);return n};var gr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",d:"M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",clipRule:"evenodd"})});var _r=function({item:e}){const t=e?._embedded?.author?.[0]?.name,s=e?._embedded?.author?.[0]?.avatar_urls?.[48],[n,o]=(0,p.useState)(!1);return(0,c.jsxs)(Fn.__experimentalHStack,{alignment:"left",spacing:0,children:[!!s&&(0,c.jsx)("div",{className:hr("page-templates-author-field__avatar",{"is-loaded":n}),children:(0,c.jsx)("img",{onLoad:()=>o(!0),alt:(0,fs.__)("Author avatar"),src:s})}),!s&&(0,c.jsx)("div",{className:"page-templates-author-field__icon",children:(0,c.jsx)(Fn.Icon,{icon:gr})}),(0,c.jsx)("span",{className:"page-templates-author-field__name",children:t})]})};const fr={label:(0,fs.__)("Author"),id:"author",type:"integer",getElements:async()=>(await(0,d.resolveSelect)(u.store).getEntityRecords("root","user",{per_page:-1})??[]).map((({id:e,name:t})=>({value:e,label:t}))),render:_r,sort:(e,t,s)=>{const n=e._embedded?.author?.[0]?.name||"",o=t._embedded?.author?.[0]?.name||"";return"asc"===s?n.localeCompare(o):o.localeCompare(n)},filterBy:{operators:["isAny","isNone"]}};var br=fr,yr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 0 4-4H8a4 4 0 0 0 4 4Z"})}),xr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm9 1V8h-1.5v3.5h-2V13H13Z"})}),vr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 1-4-4h4V8a4 4 0 0 1 0 8Z"})}),wr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5A6.5 6.5 0 0 1 6.93 7.931l9.139 9.138A6.473 6.473 0 0 1 12 18.5Zm5.123-2.498a6.5 6.5 0 0 0-9.124-9.124l9.124 9.124ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z"})}),Sr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z"})});var kr=[{value:"draft",label:(0,fs.__)("Draft"),icon:yr,description:(0,fs.__)("Not ready to publish.")},{value:"future",label:(0,fs.__)("Scheduled"),icon:xr,description:(0,fs.__)("Publish automatically on a chosen date.")},{value:"pending",label:(0,fs.__)("Pending Review"),icon:vr,description:(0,fs.__)("Waiting for review before publishing.")},{value:"private",label:(0,fs.__)("Private"),icon:wr,description:(0,fs.__)("Only visible to site admins and editors.")},{value:"publish",label:(0,fs.__)("Published"),icon:Sr,description:(0,fs.__)("Visible to everyone.")},{value:"trash",label:(0,fs.__)("Trash"),icon:er}];var Cr=function({item:e}){const t=kr.find((({value:t})=>t===e.status)),s=t?.label||e.status,n=t?.icon;return(0,c.jsxs)(Fn.__experimentalHStack,{alignment:"left",spacing:0,children:[n&&(0,c.jsx)("div",{className:"edit-site-post-list__status-icon",children:(0,c.jsx)(Fn.Icon,{icon:n})}),(0,c.jsx)("span",{children:s})]})};var Pr={label:(0,fs.__)("Status"),id:"status",type:"text",elements:kr,render:Cr,Edit:"radio",enableSorting:!1,filterBy:{operators:["isAny"]}};const jr=e=>(0,v.dateI18n)((0,v.getSettings)().formats.datetimeAbbreviated,(0,v.getDate)(e));var Er=({item:e})=>{if(["draft","private"].includes(e.status??""))return(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs.__)("<span>Modified: <time>%s</time></span>"),jr(e.date??null)),{span:(0,c.jsx)("span",{}),time:(0,c.jsx)("time",{})});if("future"===e.status)return(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs.__)("<span>Scheduled: <time>%s</time></span>"),jr(e.date??null)),{span:(0,c.jsx)("span",{}),time:(0,c.jsx)("time",{})});if("publish"===e.status)return(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs.__)("<span>Published: <time>%s</time></span>"),jr(e.date??null)),{span:(0,c.jsx)("span",{}),time:(0,c.jsx)("time",{})});const t=(0,v.getDate)(e.modified??null)>(0,v.getDate)(e.date??null)?e.modified:e.date;return"pending"===e.status?(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs.__)("<span>Modified: <time>%s</time></span>"),jr(t??null)),{span:(0,c.jsx)("span",{}),time:(0,c.jsx)("time",{})}):(0,c.jsx)("time",{children:jr(e.date??null)})};var Tr={id:"date",type:"datetime",label:(0,fs.__)("Date"),render:Er,filterBy:!1},Br=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.625 5.5h9.75c.069 0 .125.056.125.125v9.75a.125.125 0 0 1-.125.125h-9.75a.125.125 0 0 1-.125-.125v-9.75c0-.069.056-.125.125-.125ZM4 5.625C4 4.728 4.728 4 5.625 4h9.75C16.273 4 17 4.728 17 5.625v9.75c0 .898-.727 1.625-1.625 1.625h-9.75A1.625 1.625 0 0 1 4 15.375v-9.75Zm14.5 11.656v-9H20v9C20 18.8 18.77 20 17.251 20H6.25v-1.5h11.001c.69 0 1.249-.528 1.249-1.219Z"})});const Ir=e=>"object"!=typeof e?"":e.slug||(0,w.cleanForSlug)(Un(e))||e.id.toString(),Nr=({field:e,onChange:t,data:s})=>{const{id:n}=e,o=e.getValue({item:s})||Ir(s),r=s.permalink_template||"",i=/%(?:postname|pagename)%/,[a,l]=r.split(i),u=a,h=l,g=i.test(r),_=(0,p.useRef)(o),f=o||_.current,b=g?`$u}$f}$h}`:(0,w.safeDecodeURIComponent)(s.link||"");(0,p.useEffect)((()=>{o&&void 0===_.current&&(_.current=o)}),[o]);const y=(0,p.useCallback)((e=>t({[n]:e})),[n,t]),{createNotice:x}=(0,d.useDispatch)(_s.store),v=(0,m.useCopyToClipboard)(b,(()=>{x("info",(0,fs.__)("Copied Permalink to clipboard."),{isDismissible:!0,type:"snackbar"})})),S="editor-post-url__slug-description-"+(0,m.useInstanceId)(Nr);return(0,c.jsxs)("fieldset",{className:"fields-controls__slug",children:[g&&(0,c.jsxs)(Fn.__experimentalVStack,{children:[(0,c.jsxs)(Fn.__experimentalVStack,{spacing:"0px",children:[(0,c.jsx)("span",{children:(0,fs.__)("Customize the last part of the Permalink.")}),(0,c.jsx)(Fn.ExternalLink,{href:"https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink",children:(0,fs.__)("Learn more")})]}),(0,c.jsx)(Fn.__experimentalInputControl,{__next40pxDefaultSize:!0,prefix:(0,c.jsx)(Fn.__experimentalInputControlPrefixWrapper,{children:"/"}),suffix:(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,icon:Br,ref:v,label:(0,fs.__)("Copy")}),label:(0,fs.__)("Link"),hideLabelFromVision:!0,value:o,autoComplete:"off",spellCheck:"false",type:"text",className:"fields-controls__slug-input",onChange:e=>{y(e)},onBlur:()=>{""===o&&y(_.current)},"aria-describedby":S}),(0,c.jsxs)("div",{className:"fields-controls__slug-help",children:[(0,c.jsx)("span",{className:"fields-controls__slug-help-visual-label",children:(0,fs.__)("Permalink:")}),(0,c.jsxs)(Fn.ExternalLink,{className:"fields-controls__slug-help-link",href:b,children:[(0,c.jsx)("span",{className:"fields-controls__slug-help-prefix",children:u}),(0,c.jsx)("span",{className:"fields-controls__slug-help-slug",children:f}),(0,c.jsx)("span",{className:"fields-controls__slug-help-suffix",children:h})]})]})]}),!g&&(0,c.jsx)(Fn.ExternalLink,{className:"fields-controls__slug-help",href:b,children:b})]})};var Rr=Nr;var Dr=({item:e})=>{const t=Ir(e),s=(0,p.useRef)(t);(0,p.useEffect)((()=>{t&&void 0===s.current&&(s.current=t)}),[t]);return`$t||s.current}`};var Ar={id:"slug",type:"text",label:(0,fs.__)("Slug"),Edit:Rr,render:Dr,filterBy:!1},Mr=s(9681),Lr=s.n(Mr);function Or(e){return"object"==typeof e.title&&"rendered"in e.title&&e.title.rendered?(0,Ln.decodeEntities)(e.title.rendered):`#$e?.id} (${(0,fs.__)("no title")})`}const Fr=(e,t)=>{const s=Lr()(e||"").toLowerCase(),n=Lr()(t||"").toLowerCase();return s===n?0:s.startsWith(n)?s.length:1/0};function Vr({data:e,onChangeControl:t}){const[s,n]=(0,p.useState)(null),o=e.parent,r=e.id,i=e.type,{parentPostTitle:a,pageItems:l,isHierarchical:h}=(0,d.useSelect)((e=>{const{getEntityRecord:t,getEntityRecords:n,getPostType:a}=e(u.store),l=a(i),c=l?.hierarchical&&l.viewable,d=o?t("postType",i,o):null,p={per_page:100,exclude:r,parent_exclude:r,orderby:"menu_order",order:"asc",_fields:"id,title,parent",...null!==s&&{search:s}};return{isHierarchical:c,parentPostTitle:d?Or(d):"",pageItems:c?n("postType",i,p):null}}),[s,o,r,i]),g=(0,p.useMemo)((()=>{const e=(t,n=0)=>{const o=t.map((t=>[{value:t.id,label:"— ".repeat(n)+(0,Ln.decodeEntities)(t.name),rawName:t.name},...e(t.children||[],n+1)])).sort((([e],[t])=>Fr(e.rawName,s??"")>=Fr(t.rawName,s??"")?1:-1));return o.flat()};if(!l)return[];let t=l.map((e=>({id:e.id,parent:e.parent??null,name:Or(e)})));s||(t=function(e){const t=e.map((e=>({children:[],...e})));if(t.some((({parent:e})=>null==e)))return t;const s=t.reduce(((e,t)=>{const{parent:s}=t;return e[s]||(e[s]=[]),e[s].push(t),e}),{}),n=e=>e.map((e=>{const t=s[e.id];return{...e,children:t&&t.length?n(t):[]}}));return n(s[0]||[])}(t));const n=e(t),r=n.find((e=>e.value===o));return o&&a&&!r&&n.unshift({value:o,label:a,rawName:""}),n.map((e=>({...e,value:e.value.toString()})))}),[l,s,a,o]);if(!h)return null;return(0,c.jsx)(Fn.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,fs.__)("Parent"),help:(0,fs.__)("Choose a parent page."),value:o?.toString(),options:g,onFilterValueChange:(0,m.debounce)((e=>{n(e)}),300),onChange:e=>{if(e)return t(parseInt(e,10)??0);t(0)},hideLabelFromVision:!0})}var Ur={id:"parent",type:"text",label:(0,fs.__)("Parent"),Edit:({data:e,field:t,onChange:s})=>{const{id:n}=t,o=(0,d.useSelect)((e=>e(u.store).getEntityRecord("root","__unstableBase")?.home),[]),r=(0,p.useCallback)((e=>s({[n]:e})),[n,s]);return(0,c.jsx)("fieldset",{className:"fields-controls__parent",children:(0,c.jsxs)("div",{children:[(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs.__)('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %1$s<wbr />/services<wbr />/pricing.'),(0,w.filterURLForDisplay)(o).replace(/([/.])/g,"<wbr />$1")),{wbr:(0,c.jsx)("wbr",{})}),(0,c.jsx)("p",{children:(0,p.createInterpolateElement)((0,fs.__)("They also show up as sub-items in the default navigation menu. <a>Learn more.</a>"),{a:(0,c.jsx)(Fn.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes"),children:void 0})})}),(0,c.jsx)(Vr,{data:e,onChangeControl:r})]})})},render:({item:e})=>{const t=(0,d.useSelect)((t=>{const{getEntityRecord:s}=t(u.store);return e?.parent?s("postType",e.type,e.parent):null}),[e.parent,e.type]);return t?(0,c.jsx)(c.Fragment,{children:Or(t)}):(0,c.jsx)(c.Fragment,{children:(0,fs.__)("None")})},enableSorting:!0,filterBy:!1};var zr={id:"comment_status",label:(0,fs.__)("Comments"),type:"text",Edit:"radio",enableSorting:!1,enableHiding:!1,filterBy:!1,elements:[{value:"open",label:(0,fs.__)("Open"),description:(0,fs.__)("Visitors can add new comments and replies.")},{value:"closed",label:(0,fs.__)("Closed"),description:(0,fs.__)("Visitors cannot add new comments or replies. Existing comments remain visible.")}]};var Hr={id:"ping_status",label:(0,fs.__)("Trackbacks & Pingbacks"),type:"text",Edit:function({data:e,onChange:t}){const s=e?.ping_status??"open";return(0,c.jsx)(Fn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Enable pingbacks & trackbacks"),checked:"open"===s,onChange:s=>{t({...e,ping_status:s?"open":"closed"})},help:(0,c.jsx)(Fn.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/trackbacks-and-pingbacks/"),children:(0,fs.__)("Learn more about pingbacks & trackbacks")})})},enableSorting:!1,enableHiding:!1,filterBy:!1,elements:[{value:"open",label:(0,fs.__)("Allow"),description:(0,fs.__)("Allow link notifications from other blogs (pingbacks and trackbacks) on new articles.")},{value:"closed",label:(0,fs.__)("Don't allow"),description:(0,fs.__)("Don't allow link notifications from other blogs (pingbacks and trackbacks) on new articles.")}]};var Gr={id:"discussion",label:(0,fs.__)("Discussion"),type:"text",render:({item:e})=>{const t="open"===e.comment_status,s="open"===e.ping_status;return t&&s?(0,fs.__)("Open"):t&&!s?(0,fs.__)("Comments only"):!t&&s?(0,fs.__)("Pings only"):(0,fs.__)("Closed")},filterBy:!1};const $r=[],Wr={id:"template",type:"text",label:(0,fs.__)("Template"),Edit:({data:e,field:t,onChange:s})=>{const{id:n}=t,o=e.type,r="number"==typeof e.id?e.id:parseInt(e.id,10),i=e.slug,{canSwitchTemplate:a,templates:l}=(0,d.useSelect)((e=>{const t=e(u.store).getEntityRecords("postType","wp_template",{per_page:-1,post_type:o})??$r,{getHomePage:s,getPostsPageId:n}=uo(e(u.store)),i=n()===+r,a="page"===o&&s()?.postId===+r;return{templates:t,canSwitchTemplate:!i&&!a}}),[r,o]),h=(0,p.useMemo)((()=>a?l.filter((t=>t.is_custom&&t.slug!==e.template&&!!t.content.raw)).map((e=>({name:e.slug,blocks:(0,x.parse)(e.content.raw),title:(0,Ln.decodeEntities)(e.title.rendered),id:e.id}))):[]),[a,e.template,l]),_=(0,m.useAsyncList)(h),f=t.getValue({item:e}),b=l.find((e=>e.slug===f)),y=(0,d.useSelect)((e=>{if(b)return b;let t;if(t=i?"page"===o?`$o}-$i}`:`single-$o}-$i}`:"page"===o?"page":`single-$o}`,o){const s=e(u.store).getDefaultTemplateId({slug:t});return e(u.store).getEntityRecord("postType","wp_template",s)}}),[b,o,i]),[v,w]=(0,p.useState)(!1),S=(0,p.useCallback)((e=>s({[n]:e})),[n,s]);return(0,c.jsxs)("fieldset",{className:"fields-controls__template",children:[(0,c.jsx)(Fn.Dropdown,{popoverProps:{placement:"bottom-start"},renderToggle:({onToggle:e})=>(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",size:"compact",onClick:e,children:y?Un(y):""}),renderContent:({onToggle:e})=>(0,c.jsxs)(Fn.MenuGroup,{children:[(0,c.jsx)(Fn.MenuItem,{onClick:()=>{w(!0),e()},children:(0,fs.__)("Change template")}),""!==f&&(0,c.jsx)(Fn.MenuItem,{onClick:()=>{S(""),e()},children:(0,fs.__)("Use default template")})]})}),v&&(0,c.jsx)(Fn.Modal,{title:(0,fs.__)("Choose a template"),onRequestClose:()=>w(!1),overlayClassName:"fields-controls__template-modal",isFullScreen:!0,children:(0,c.jsx)("div",{className:"fields-controls__template-content",children:(0,c.jsx)(g.__experimentalBlockPatternsList,{label:(0,fs.__)("Templates"),blockPatterns:h,shownPatterns:_,onClickPattern:e=>{S(e.name),w(!1)}})})})]})},enableSorting:!1,filterBy:!1};var Zr=Wr;var Yr=function({data:e,onChange:t,field:s}){const[n,o]=(0,p.useState)(!!s.getValue({item:e}));return(0,c.jsxs)(Fn.__experimentalVStack,{as:"fieldset",spacing:4,className:"fields-controls__password",children:[(0,c.jsx)(Fn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Password protected"),help:(0,fs.__)("Only visible to those who know the password"),checked:n,onChange:e=>{o(e),e||t({password:""})}}),n&&(0,c.jsx)("div",{className:"fields-controls__password-input",children:(0,c.jsx)(Fn.TextControl,{label:(0,fs.__)("Password"),onChange:e=>t({password:e}),value:s.getValue({item:e})||"",placeholder:(0,fs.__)("Use a secure password"),type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,maxLength:255})})]})};var qr={id:"password",type:"text",label:(0,fs.__)("Password"),Edit:Yr,enableSorting:!1,enableHiding:!1,isVisible:e=>"private"!==e.status,filterBy:!1};function Kr({item:e,className:t,children:s}){const n=Un(e);return(0,c.jsxs)(Fn.__experimentalHStack,{className:hr("fields-field__title",t),alignment:"center",justify:"flex-start",children:[(0,c.jsx)("span",{children:n||(0,fs.__)("(no title)")}),s]})}function Qr({item:e}){return(0,c.jsx)(Kr,{item:e})}const{Badge:Xr}=uo(Fn.privateApis);var Jr={type:"text",id:"title",label:(0,fs.__)("Title"),placeholder:(0,fs.__)("No title"),getValue:({item:e})=>Un(e),render:function({item:e}){const{frontPageId:t,postsPageId:s}=(0,d.useSelect)((e=>{const{getEntityRecord:t}=e(u.store),s=t("root","site");return{frontPageId:s?.page_on_front,postsPageId:s?.page_for_posts}}),[]);return(0,c.jsx)(Kr,{item:e,className:"fields-field__page-title",children:[t,s].includes(e.id)&&(0,c.jsx)(Xr,{children:e.id===t?(0,fs.__)("Homepage"):(0,fs.__)("Posts Page")})})},enableHiding:!1,enableGlobalSearch:!0,filterBy:!1};var ei={type:"text",label:(0,fs.__)("Template"),placeholder:(0,fs.__)("No title"),id:"title",getValue:({item:e})=>Un(e),render:Qr,enableHiding:!1,enableGlobalSearch:!0,filterBy:!1},ti=(0,p.forwardRef)((({icon:e,size:t=24,...s},n)=>(0,p.cloneElement)(e,{width:t,height:t,...s,ref:n}))),si=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z"})});const{PATTERN_TYPES:ni}=uo(lo.privateApis);var oi={type:"text",id:"title",label:(0,fs.__)("Title"),placeholder:(0,fs.__)("No title"),getValue:({item:e})=>Un(e),render:function({item:e}){return(0,c.jsx)(Kr,{item:e,className:"fields-field__pattern-title",children:e.type===ni.theme&&(0,c.jsx)(Fn.Tooltip,{placement:"top",text:(0,fs.__)("This pattern cannot be edited."),children:(0,c.jsx)(ti,{icon:si,size:24})})})},enableHiding:!1,enableGlobalSearch:!0,filterBy:!1};var ri={type:"text",id:"title",label:(0,fs.__)("Title"),placeholder:(0,fs.__)("No title"),getValue:({item:e})=>Un(e),render:Qr,enableHiding:!0,enableGlobalSearch:!0,filterBy:!1};var ii=(0,m.createHigherOrderComponent)((e=>({useSubRegistry:t=!0,...s})=>{const n=(0,d.useRegistry)(),[o]=(0,p.useState)((()=>new WeakMap)),r=function(e,t,s){if(!s)return t;let n=e.get(t);return n||(n=(0,d.createRegistry)({"core/block-editor":g.storeConfig},t),n.registerStore("core/editor",yc),e.set(t,n)),n}(o,n,t);return r===n?(0,c.jsx)(e,{registry:n,...s}):(0,c.jsx)(d.RegistryProvider,{value:r,children:(0,c.jsx)(e,{registry:r,...s})})}),"withRegistryProvider");const ai=(e,t)=>`<a $li(e)}>$t}</a>`,li=e=>`href="$e}" target="_blank" rel="noreferrer noopener"`,ci=e=>{const{title:t,foreign_landing_url:s,creator:n,creator_url:o,license:r,license_version:i,license_url:a}=e,l=((e,t)=>{let s=e.trim();return"pdm"!==e&&(s=e.toUpperCase().replace("SAMPLING","Sampling")),t&&(s+=` $t}`),["pdm","cc0"].includes(e)||(s=`CC $s}`),s})(r,i),c=(0,Ln.decodeEntities)(n);let d;return d=c?t?(0,fs.sprintf)((0,fs._x)('"%1$s" by %2$s/ %3$s',"caption"),ai(s,(0,Ln.decodeEntities)(t)),o?ai(o,c):c,a?ai(`$a}?ref=openverse`,l):l):(0,fs.sprintf)((0,fs._x)("<a %1$s>Work</a> by %2$s/ %3$s","caption"),li(s),o?ai(o,c):c,a?ai(`$a}?ref=openverse`,l):l):t?(0,fs.sprintf)((0,fs._x)('"%1$s"/ %2$s',"caption"),ai(s,(0,Ln.decodeEntities)(t)),a?ai(`$a}?ref=openverse`,l):l):(0,fs.sprintf)((0,fs._x)("<a %1$s>Work</a>/ %2$s","caption"),li(s),a?ai(`$a}?ref=openverse`,l):l),d.replace(/\s{2}/g," ")},di=async(e={})=>(await(0,d.resolveSelect)(u.store).getEntityRecords("postType","attachment",{...e,orderBy:e?.search?"relevance":"date"})).map((e=>({...e,alt:e.alt_text,url:e.source_url,previewUrl:e.media_details?.sizes?.medium?.source_url,caption:e.caption?.raw})));var ui=[{name:"images",labels:{name:(0,fs.__)("Images"),search_items:(0,fs.__)("Search images")},mediaType:"image",fetch:async(e={})=>di({...e,media_type:"image"})},{name:"videos",labels:{name:(0,fs.__)("Videos"),search_items:(0,fs.__)("Search videos")},mediaType:"video",fetch:async(e={})=>di({...e,media_type:"video"})},{name:"audio",labels:{name:(0,fs.__)("Audio"),search_items:(0,fs.__)("Search audio")},mediaType:"audio",fetch:async(e={})=>di({...e,media_type:"audio"})},{name:"openverse",labels:{name:(0,fs.__)("Openverse"),search_items:(0,fs.__)("Search Openverse")},mediaType:"image",async fetch(e={}){const t={...e,mature:!1,excluded_source:"flickr,inaturalist,wikimedia",license:"pdm,cc0"},s={per_page:"page_size",search:"q"},n=new URL("https://api.openverse.org/v1/images/");Object.entries(t).forEach((([e,t])=>{const o=s[e]||e;n.searchParams.set(o,t)}));const o=await window.fetch(n,{headers:{"User-Agent":"WordPress/inserter-media-fetch"}});return(await o.json()).results.map((e=>({...e,title:e.title?.toLowerCase().startsWith("file:")?e.title.slice(5):e.title,sourceId:e.id,id:void 0,caption:ci(e),previewUrl:e.thumbnail})))},getReportUrl:({sourceId:e})=>`https://wordpress.org/openverse/image/$e}/report/`,isExternalResource:!0}];const pi={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let mi;const hi=new Uint8Array(16);function gi(){if(!mi&&(mi="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!mi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return mi(hi)}const _i=[];for(let e=0;e<256;++e)_i.push((e+256).toString(16).slice(1));function fi(e,t=0){return _i[e[t+0]]+_i[e[t+1]]+_i[e[t+2]]+_i[e[t+3]]+"-"+_i[e[t+4]]+_i[e[t+5]]+"-"+_i[e[t+6]]+_i[e[t+7]]+"-"+_i[e[t+8]]+_i[e[t+9]]+"-"+_i[e[t+10]]+_i[e[t+11]]+_i[e[t+12]]+_i[e[t+13]]+_i[e[t+14]]+_i[e[t+15]]}const bi=function(e,t,s){if(pi.randomUUID&&!t&&!e)return pi.randomUUID();const n=(e=e||{}).random||(e.rng||gi)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){s=s||0;for(let e=0;e<16;++e)t[s+e]=n[e];return t}return fi(n)},yi=()=>{};function xi({additionalData:e={},allowedTypes:t,filesList:s,maxUploadFileSize:n,onError:o=yi,onFileChange:r,onSuccess:i,multiple:a=!0}){const{receiveEntityRecords:l}=(0,d.dispatch)(u.store),{getCurrentPost:c,getEditorSettings:p}=(0,d.select)(xc),{lockPostAutosaving:m,unlockPostAutosaving:h,lockPostSaving:g,unlockPostSaving:_}=(0,d.dispatch)(xc),f=p().allowedMimeTypes,b=`image-upload-$bi()}`;let y=!1;n=n||p().maxUploadFileSize;const x=c(),v="number"==typeof x?.id?x.id:x?.wp_id,w=v?{post:v}:{},S=()=>{_(b),h(b),y=!1};(0,cr.uploadMedia)({allowedTypes:t,filesList:s,onFileChange:e=>{y?S():(g(b),m(b),y=!0),r?.(e);const t=e.filter((e=>e?.id));if(t?.length){l("postType","attachment",t,void 0,!0)}},onSuccess:i,additionalData:{...w,...e},maxUploadFileSize:n,onError:({message:e})=>{S(),o(e)},wpAllowedMimeTypes:f,multiple:a})}const{sideloadMedia:vi}=$(cr.privateApis);var wi=vi,Si=s(66),ki=s.n(Si); 8 /*! 9 * is-plain-object <https://github.com/jonschlinkert/is-plain-object> 10 * 11 * Copyright (c) 2014-2017, Jon Schlinkert. 12 * Released under the MIT License. 13 */ 14 function Ci(e){return"[object Object]"===Object.prototype.toString.call(e)}function Pi(e){var t,s;return!1!==Ci(e)&&(void 0===(t=e.constructor)||!1!==Ci(s=t.prototype)&&!1!==s.hasOwnProperty("isPrototypeOf"))}const{GlobalStylesContext:ji,cleanEmptyObject:Ei}=$(g.privateApis);function Ti(e,t){return ki()(e,t,{isMergeableObject:Pi,customMerge:e=>{if("backgroundImage"===e)return(e,t)=>t}})}function Bi(){const[e,t,s]=function(){const{globalStylesId:e,isReady:t,settings:s,styles:n,_links:o}=(0,d.useSelect)((e=>{const{getEntityRecord:t,getEditedEntityRecord:s,hasFinishedResolution:n,canUser:o}=e(u.store),r=e(u.store).__experimentalGetCurrentGlobalStylesId();let i;const a=r?o("update",{kind:"root",name:"globalStyles",id:r}):null;r&&"boolean"==typeof a&&(i=a?s("root","globalStyles",r):t("root","globalStyles",r,{context:"view"}));let l=!1;return n("__experimentalGetCurrentGlobalStylesId")&&(l=!r||(a?n("getEditedEntityRecord",["root","globalStyles",r]):n("getEntityRecord",["root","globalStyles",r,{context:"view"}]))),{globalStylesId:r,isReady:l,settings:i?.settings,styles:i?.styles,_links:i?._links}}),[]),{getEditedEntityRecord:r}=(0,d.useSelect)(u.store),{editEntityRecord:i}=(0,d.useDispatch)(u.store);return[t,(0,p.useMemo)((()=>({settings:s??{},styles:n??{},_links:o??{}})),[s,n,o]),(0,p.useCallback)(((t,s={})=>{const n=r("root","globalStyles",e),o="function"==typeof t?t({styles:n?.styles??{},settings:n?.settings??{},_links:n?._links??{}}):t;i("root","globalStyles",e,{styles:Ei(o.styles)||{},settings:Ei(o.settings)||{},_links:Ei(o._links)||{}},s)}),[e,i,r])]}(),[n,o]=function(){const e=(0,d.useSelect)((e=>e(u.store).__experimentalGetCurrentThemeBaseGlobalStyles()),[]);return[!!e,e]}(),r=(0,p.useMemo)((()=>o&&t?Ti(o,t):{}),[t,o]);return(0,p.useMemo)((()=>({isReady:e&&n,user:t,base:o,merged:r,setUserConfig:s})),[r,t,o,s,e,n])}const Ii={};function Ni(e){const{RECEIVE_INTERMEDIATE_RESULTS:t}=$(u.privateApis),{getEntityRecords:s}=e(u.store);return s("postType","wp_block",{per_page:-1,[t]:!0})}const Ri=["__experimentalBlockBindingsSupportedAttributes","__experimentalBlockDirectory","__experimentalDiscussionSettings","__experimentalFeatures","__experimentalGlobalStylesBaseStyles","alignWide","blockInspectorTabs","maxUploadFileSize","allowedMimeTypes","bodyPlaceholder","canLockBlocks","canUpdateBlockBindings","capabilities","clearBlockSelection","codeEditingEnabled","colors","disableCustomColors","disableCustomFontSizes","disableCustomSpacingSizes","disableCustomGradients","disableLayoutStyles","enableCustomLineHeight","enableCustomSpacing","enableCustomUnits","enableOpenverseMediaCategory","fontSizes","gradients","generateAnchors","onNavigateToEntityRecord","imageDefaultSize","imageDimensions","imageEditing","imageSizes","isPreviewMode","isRTL","locale","maxWidth","postContentAttributes","postsPerPage","readOnly","styles","titlePlaceholder","supportsLayout","widgetTypesToHideFromLegacyWidgetBlock","__unstableHasCustomAppender","__unstableResolvedAssets","__unstableIsBlockBasedTheme"],{globalStylesDataKey:Di,globalStylesLinksDataKey:Ai,selectBlockPatternsKey:Mi,reusableBlocksSelectKey:Li,sectionRootClientIdKey:Oi,mediaEditKey:Fi}=$(g.privateApis);var Vi=function(e,t,s,n){const o=(0,m.useViewportMatch)("medium"),{allowRightClickOverrides:r,blockTypes:i,focusMode:a,hasFixedToolbar:l,isDistractionFree:c,keepCaretInsideBlock:h,hasUploadPermissions:_,hiddenBlockTypes:f,canUseUnfilteredHTML:b,userCanCreatePages:y,pageOnFront:v,pageForPosts:w,userPatternCategories:S,restBlockPatternCategories:k,sectionRootClientId:P}=(0,d.useSelect)((e=>{const{canUser:r,getRawEntityRecord:i,getEntityRecord:a,getUserPatternCategories:l,getBlockPatternCategories:c}=e(u.store),{get:d}=e(C.store),{getBlockTypes:p}=e(x.store),{getBlocksByName:m,getBlockAttributes:h}=e(g.store),_=r("read",{kind:"root",name:"site"})?a("root","site"):void 0;return{allowRightClickOverrides:d("core","allowRightClickOverrides"),blockTypes:p(),canUseUnfilteredHTML:i("postType",t,s)?._links?.hasOwnProperty("wp:action-unfiltered-html"),focusMode:d("core","focusMode"),hasFixedToolbar:d("core","fixedToolbar")||!o,hiddenBlockTypes:d("core","hiddenBlockTypes"),isDistractionFree:d("core","distractionFree"),keepCaretInsideBlock:d("core","keepCaretInsideBlock"),hasUploadPermissions:r("create",{kind:"postType",name:"attachment"})??!0,userCanCreatePages:r("create",{kind:"postType",name:"page"}),pageOnFront:_?.page_on_front,pageForPosts:_?.page_for_posts,userPatternCategories:l(),restBlockPatternCategories:c(),sectionRootClientId:"template-locked"===n?m("core/post-content")?.[0]??"":m("core/group").find((e=>"main"===h(e)?.tagName))??""}}),[t,s,o,n]),{merged:j}=Bi(),E=j.styles??Ii,T=j._links??Ii,B=e.__experimentalAdditionalBlockPatterns??e.__experimentalBlockPatterns,I=e.__experimentalAdditionalBlockPatternCategories??e.__experimentalBlockPatternCategories,N=(0,p.useMemo)((()=>[...B||[]].filter((({postTypes:e})=>!e||Array.isArray(e)&&e.includes(t)))),[B,t]),R=(0,p.useMemo)((()=>[...I||[],...k||[]].filter(((e,t,s)=>t===s.findIndex((t=>e.name===t.name))))),[I,k]),{undo:D,setIsInserterOpened:A}=(0,d.useDispatch)(xc),{editMediaEntity:M}=$((0,d.useDispatch)(u.store)),{saveEntityRecord:L}=(0,d.useDispatch)(u.store),O=(0,p.useCallback)((e=>y?L("postType","page",e):Promise.reject({message:(0,fs.__)("You do not have permission to create Pages.")})),[L,y]),F=(0,p.useMemo)((()=>{if(f&&f.length>0){return(!0===e.allowedBlockTypes?i.map((({name:e})=>e)):e.allowedBlockTypes||[]).filter((e=>!f.includes(e)))}return e.allowedBlockTypes}),[e.allowedBlockTypes,f,i]),V=!1===e.focusMode;return(0,p.useMemo)((()=>{const s={...Object.fromEntries(Object.entries(e).filter((([e])=>Ri.includes(e)))),[Di]:E,[Ai]:T,allowedBlockTypes:F,allowRightClickOverrides:r,focusMode:a&&!V,hasFixedToolbar:l,isDistractionFree:c,keepCaretInsideBlock:h,[Fi]:_?M:void 0,mediaUpload:_?xi:void 0,mediaSideload:_?wi:void 0,__experimentalBlockPatterns:N,[Mi]:e=>{const{hasFinishedResolution:s,getBlockPatternsForPostType:n}=$(e(u.store)),o=n(t);return s("getBlockPatterns")?o:void 0},[Li]:Ni,__experimentalBlockPatternCategories:R,__experimentalUserPatternCategories:S,__experimentalFetchLinkSuggestions:(t,s)=>(0,u.__experimentalFetchLinkSuggestions)(t,s,e),inserterMediaCategories:ui,__experimentalFetchRichUrlData:u.__experimentalFetchUrlData,__experimentalCanUserUseUnfilteredHTML:b,__experimentalUndo:D,outlineMode:!c&&"wp_template"===t,__experimentalCreatePageEntity:O,__experimentalUserCanCreatePages:y,pageOnFront:v,pageForPosts:w,__experimentalPreferPatternsOnRoot:"wp_template"===t,templateLock:"wp_navigation"===t?"insert":e.templateLock,template:"wp_navigation"===t?[["core/navigation",{},[]]]:e.template,__experimentalSetIsInserterOpened:A,[Oi]:P,editorTool:"post-only"===n&&"wp_template"!==t?"edit":void 0};return s}),[F,r,a,V,l,c,h,e,_,S,N,R,b,D,O,y,v,w,t,A,P,E,T,n,M])};const Ui=["core/post-title","core/post-featured-image","core/post-content"];function zi(){const e=(0,p.useMemo)((()=>[...(0,h.applyFilters)("editor.postContentBlockTypes",Ui)]),[]),t=(0,d.useSelect)((t=>{const{getPostBlocksByName:s}=$(t(xc));return s(e)}),[e]);return t}function Hi(){const e=zi(),{templateParts:t}=(0,d.useSelect)((e=>{const{getBlocksByName:t}=e(g.store);return{templateParts:t("core/template-part")}}),[]),s=(0,d.useSelect)((e=>{const{getBlockOrder:s}=e(g.store);return t.flatMap((e=>s(e)))}),[t]),n=(0,d.useRegistry)();return(0,p.useEffect)((()=>{const{setBlockEditingMode:e,unsetBlockEditingMode:t}=n.dispatch(g.store);return e("","disabled"),()=>{t("")}}),[n]),(0,p.useEffect)((()=>{const{setBlockEditingMode:t,unsetBlockEditingMode:s}=n.dispatch(g.store);return n.batch((()=>{for(const s of e)t(s,"contentOnly")})),()=>{n.batch((()=>{for(const t of e)s(t)}))}}),[e,n]),(0,p.useEffect)((()=>{const{setBlockEditingMode:e,unsetBlockEditingMode:s}=n.dispatch(g.store);return n.batch((()=>{for(const s of t)e(s,"contentOnly")})),()=>{n.batch((()=>{for(const e of t)s(e)}))}}),[t,n]),(0,p.useEffect)((()=>{const{setBlockEditingMode:e,unsetBlockEditingMode:t}=n.dispatch(g.store);return n.batch((()=>{for(const t of s)e(t,"disabled")})),()=>{n.batch((()=>{for(const e of s)t(e)}))}}),[s,n]),null}function Gi(){const e=(0,d.useSelect)((e=>e(g.store).getBlockOrder()?.[0]),[]),{setBlockEditingMode:t,unsetBlockEditingMode:s}=(0,d.useDispatch)(g.store);(0,p.useEffect)((()=>{if(e)return t(e,"contentOnly"),()=>{s(e)}}),[e,s,t])}const $i=["wp_block","wp_template","wp_template_part"];var Wi=(0,c.jsxs)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,c.jsx)(L.Path,{d:"m16 15.5h-8v-1.5h8zm-7.5-2.5h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm-9-3h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2z"}),(0,c.jsx)(L.Path,{d:"m18.5 6.5h-13a.5.5 0 0 0 -.5.5v9.5a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-9.5a.5.5 0 0 0 -.5-.5zm-13-1.5h13a2 2 0 0 1 2 2v9.5a2 2 0 0 1 -2 2h-13a2 2 0 0 1 -2-2v-9.5a2 2 0 0 1 2-2z"})]}),Zi=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})}),Yi=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"})}),qi=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",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-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z"})}),Ki=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",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-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"})}),Qi=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.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"})}),Xi=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.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"})}),Ji=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})}),ea=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})}),ta=(0,c.jsxs)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,c.jsx)(L.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,c.jsx)(L.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"})]}),sa=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"})}),na=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M12 4V2.2L9 4.8l3 2.5V5.5c3.6 0 6.5 2.9 6.5 6.5 0 2.9-1.9 5.3-4.5 6.2v.2l-.1-.2c-.4.1-.7.2-1.1.2l.2 1.5c.3 0 .6-.1 1-.2 3.5-.9 6-4 6-7.7 0-4.4-3.6-8-8-8zm-7.9 7l1.5.2c.1-1.2.5-2.3 1.2-3.2l-1.1-.9C4.8 8.2 4.3 9.6 4.1 11zm1.5 1.8l-1.5.2c.1.7.3 1.4.5 2 .3.7.6 1.3 1 1.8l1.2-.8c-.3-.5-.6-1-.8-1.5s-.4-1.1-.4-1.7zm1.5 5.5c1.1.9 2.4 1.4 3.8 1.6l.2-1.5c-1.1-.1-2.2-.5-3.1-1.2l-.9 1.1z"})});const oa=window.wp.commands;var ra=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"})}),ia=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"})});const aa=window.wp.viewport,la=window.wp.plugins;var ca=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})});function da(e){return["core/edit-post","core/edit-site"].includes(e)?(k()(`$e} interface scope`,{alternative:"core interface scope",hint:"core/edit-post and core/edit-site are merging.",version:"6.6"}),"core"):e}function ua(e,t){return"core"===e&&"edit-site/template"===t?(k()("edit-site/template sidebar",{alternative:"edit-post/document",version:"6.6"}),"edit-post/document"):"core"===e&&"edit-site/block-inspector"===t?(k()("edit-site/block-inspector sidebar",{alternative:"edit-post/block",version:"6.6"}),"edit-post/block"):t}const pa=(e,t)=>({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e=da(e),area:t=ua(e,t)}),ma=(e,t)=>({registry:s,dispatch:n})=>{if(!t)return;e=da(e),t=ua(e,t);s.select(C.store).get(e,"isComplementaryAreaVisible")||s.dispatch(C.store).set(e,"isComplementaryAreaVisible",!0),n({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},ha=e=>({registry:t})=>{e=da(e);t.select(C.store).get(e,"isComplementaryAreaVisible")&&t.dispatch(C.store).set(e,"isComplementaryAreaVisible",!1)},ga=(e,t)=>({registry:s})=>{if(!t)return;e=da(e),t=ua(e,t);const n=s.select(C.store).get(e,"pinnedItems");!0!==n?.[t]&&s.dispatch(C.store).set(e,"pinnedItems",{...n,[t]:!0})},_a=(e,t)=>({registry:s})=>{if(!t)return;e=da(e),t=ua(e,t);const n=s.select(C.store).get(e,"pinnedItems");s.dispatch(C.store).set(e,"pinnedItems",{...n,[t]:!1})};function fa(e,t){return function({registry:s}){k()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),s.dispatch(C.store).toggle(e,t)}}function ba(e,t,s){return function({registry:n}){k()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),n.dispatch(C.store).set(e,t,!!s)}}function ya(e,t){return function({registry:s}){k()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),s.dispatch(C.store).setDefaults(e,t)}}function xa(e){return{type:"OPEN_MODAL",name:e}}function va(){return{type:"CLOSE_MODAL"}}const wa=(0,d.createRegistrySelector)((e=>(t,s)=>{s=da(s);const n=e(C.store).get(s,"isComplementaryAreaVisible");if(void 0!==n)return!1===n?null:t?.complementaryAreas?.[s]})),Sa=(0,d.createRegistrySelector)((e=>(t,s)=>{s=da(s);const n=e(C.store).get(s,"isComplementaryAreaVisible"),o=t?.complementaryAreas?.[s];return n&&void 0===o})),ka=(0,d.createRegistrySelector)((e=>(t,s,n)=>{n=ua(s=da(s),n);const o=e(C.store).get(s,"pinnedItems");return o?.[n]??!0})),Ca=(0,d.createRegistrySelector)((e=>(t,s,n)=>(k()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(C.store).get(s,n))));function Pa(e,t){return e.activeModal===t}var ja=(0,d.combineReducers)({complementaryAreas:function(e={},t){switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:s,area:n}=t;return e[s]?e:{...e,[s]:n}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:s,area:n}=t;return{...e,[s]:n}}}return e},activeModal:function(e=null,t){switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e}});const Ea=(0,d.createReduxStore)("core/interface",{reducer:ja,actions:o,selectors:r});function Ta({as:e=Fn.Button,scope:t,identifier:s,icon:n,selectedIcon:o,name:r,shortcut:i,...a}){const l=e,u=(0,la.usePluginContext)(),p=n||u.icon,m=s||`$u.name}/$r}`,h=(0,d.useSelect)((e=>e(Ea).getActiveComplementaryArea(t)===m),[m,t]),{enableComplementaryArea:g,disableComplementaryArea:_}=(0,d.useDispatch)(Ea);return(0,c.jsx)(l,{icon:o&&h?o:p,"aria-controls":m.replace("/",":"),"aria-checked":(f=a.role,["checkbox","option","radio","switch","menuitemcheckbox","menuitemradio","treeitem"].includes(f)?h:void 0),onClick:()=>{h?_(t):g(t,m)},shortcut:i,...a});var f}(0,d.register)(Ea);var Ba=({children:e,className:t,toggleButtonProps:s})=>{const n=(0,c.jsx)(Ta,{icon:ca,...s});return(0,c.jsxs)("div",{className:hr("components-panel__header","interface-complementary-area-header",t),tabIndex:-1,children:[e,n]})};const Ia=()=>{};function Na({name:e,as:t=Fn.Button,onClick:s,...n}){return(0,c.jsx)(Fn.Fill,{name:e,children:({onClick:e})=>(0,c.jsx)(t,{onClick:s||e?(...t)=>{(s||Ia)(...t),(e||Ia)(...t)}:void 0,...n})})}Na.Slot=function({name:e,as:t=Fn.MenuGroup,fillProps:s={},bubblesVirtually:n,...o}){return(0,c.jsx)(Fn.Slot,{name:e,bubblesVirtually:n,fillProps:s,children:e=>{if(!p.Children.toArray(e).length)return null;const s=[];p.Children.forEach(e,(({props:{__unstableExplicitMenuItem:e,__unstableTarget:t}})=>{t&&e&&s.push(t)}));const n=p.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&s.includes(e.props.__unstableTarget)?null:e));return(0,c.jsx)(t,{...o,children:n})}})};var Ra=Na;const Da=({__unstableExplicitMenuItem:e,__unstableTarget:t,...s})=>(0,c.jsx)(Fn.MenuItem,{...s});function Aa({scope:e,target:t,__unstableExplicitMenuItem:s,...n}){return(0,c.jsx)(Ta,{as:n=>(0,c.jsx)(Ra,{__unstableExplicitMenuItem:s,__unstableTarget:`$e}/$t}`,as:Da,name:`$e}/plugin-more-menu`,...n}),role:"menuitemcheckbox",selectedIcon:Zn,name:t,scope:e,...n})}function Ma({scope:e,...t}){return(0,c.jsx)(Fn.Fill,{name:`PinnedItems/$e}`,...t})}Ma.Slot=function({scope:e,className:t,...s}){return(0,c.jsx)(Fn.Slot,{name:`PinnedItems/$e}`,...s,children:e=>e?.length>0&&(0,c.jsx)("div",{className:hr(t,"interface-pinned-items"),children:e})})};var La=Ma;const Oa={open:{width:280},closed:{width:0},mobileOpen:{width:"100vw"}};function Fa({activeArea:e,isActive:t,scope:s,children:n,className:o,id:r}){const i=(0,m.useReducedMotion)(),a=(0,m.useViewportMatch)("medium","<"),l=(0,m.usePrevious)(e),d=(0,m.usePrevious)(t),[,u]=(0,p.useState)({});(0,p.useEffect)((()=>{u({})}),[t]);const h={type:"tween",duration:i||a||l&&e&&e!==l?0:.3,ease:[.6,0,.4,1]};return(0,c.jsx)(Fn.Fill,{name:`ComplementaryArea/$s}`,children:(0,c.jsx)(Fn.__unstableAnimatePresence,{initial:!1,children:(d||t)&&(0,c.jsx)(Fn.__unstableMotion.div,{variants:Oa,initial:"closed",animate:a?"mobileOpen":"open",exit:"closed",transition:h,className:"interface-complementary-area__fill",children:(0,c.jsx)("div",{id:r,className:o,style:{width:a?"100vw":280},children:n})})})})}function Va({children:e,className:t,closeLabel:s=(0,fs.__)("Close plugin"),identifier:n,header:o,headerClassName:r,icon:i,isPinnable:a=!0,panelClassName:l,scope:u,name:h,title:g,toggleShortcut:_,isActiveByDefault:f}){const b=(0,la.usePluginContext)(),y=i||b.icon,x=n||`$b.name}/$h}`,[v,w]=(0,p.useState)(!1),{isLoading:S,isActive:k,isPinned:P,activeArea:j,isSmall:E,isLarge:T,showIconLabels:B}=(0,d.useSelect)((e=>{const{getActiveComplementaryArea:t,isComplementaryAreaLoading:s,isItemPinned:n}=e(Ea),{get:o}=e(C.store),r=t(u);return{isLoading:s(u),isActive:r===x,isPinned:n(u,x),activeArea:r,isSmall:e(aa.store).isViewportMatch("< medium"),isLarge:e(aa.store).isViewportMatch("large"),showIconLabels:o("core","showIconLabels")}}),[x,u]),I=(0,m.useViewportMatch)("medium","<");!function(e,t,s,n,o){const r=(0,p.useRef)(!1),i=(0,p.useRef)(!1),{enableComplementaryArea:a,disableComplementaryArea:l}=(0,d.useDispatch)(Ea);(0,p.useEffect)((()=>{n&&o&&!r.current?(l(e),i.current=!0):i.current&&!o&&r.current?(i.current=!1,a(e,t)):i.current&&s&&s!==t&&(i.current=!1),o!==r.current&&(r.current=o)}),[n,o,e,t,s,l,a])}(u,x,j,k,E);const{enableComplementaryArea:N,disableComplementaryArea:R,pinItem:D,unpinItem:A}=(0,d.useDispatch)(Ea);if((0,p.useEffect)((()=>{f&&void 0===j&&!E?N(u,x):void 0===j&&E&&R(u,x),w(!0)}),[j,f,u,x,E,N,R]),v)return(0,c.jsxs)(c.Fragment,{children:[a&&(0,c.jsx)(La,{scope:u,children:P&&(0,c.jsx)(Ta,{scope:u,identifier:x,isPressed:k&&(!B||T),"aria-expanded":k,"aria-disabled":S,label:g,icon:B?Zn:y,showTooltip:!B,variant:B?"tertiary":void 0,size:"compact",shortcut:_})}),h&&a&&(0,c.jsx)(Aa,{target:h,scope:u,icon:y,children:g}),(0,c.jsxs)(Fa,{activeArea:j,isActive:k,className:hr("interface-complementary-area",t),scope:u,id:x.replace("/",":"),children:[(0,c.jsx)(Ba,{className:r,closeLabel:s,onClose:()=>R(u),toggleButtonProps:{label:s,size:"compact",shortcut:_,scope:u,identifier:x},children:o||(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("h2",{className:"interface-complementary-area-header__title",children:g}),a&&!I&&(0,c.jsx)(Fn.Button,{className:"interface-complementary-area__pin-unpin-item",icon:P?ra:ia,label:P?(0,fs.__)("Unpin from toolbar"):(0,fs.__)("Pin to toolbar"),onClick:()=>(P?A:D)(u,x),isPressed:P,"aria-expanded":P,size:"compact"})]})}),(0,c.jsx)(Fn.Panel,{className:l,children:e})]})]})}Va.Slot=function({scope:e,...t}){return(0,c.jsx)(Fn.Slot,{name:`ComplementaryArea/$e}`,...t})};var Ua=Va;var za=({isActive:e})=>((0,p.useEffect)((()=>{let e=!1;return document.body.classList.contains("sticky-menu")&&(e=!0,document.body.classList.remove("sticky-menu")),()=>{e&&document.body.classList.add("sticky-menu")}}),[]),(0,p.useEffect)((()=>(e?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode"),()=>{e&&document.body.classList.remove("is-fullscreen-mode")})),[e]),null);const Ha=(0,p.forwardRef)((({children:e,className:t,ariaLabel:s,as:n="div",...o},r)=>(0,c.jsx)(n,{ref:r,className:hr("admin-ui-navigable-region",t),"aria-label":s,role:"region",tabIndex:"-1",...o,children:e})));Ha.displayName="NavigableRegion";var Ga=Ha;const $a={type:"tween",duration:.25,ease:[.6,0,.4,1]};const Wa={hidden:{opacity:1,marginTop:-60},visible:{opacity:1,marginTop:0},distractionFreeHover:{opacity:1,marginTop:0,transition:{...$a,delay:.2,delayChildren:.2}},distractionFreeHidden:{opacity:0,marginTop:-60},distractionFreeDisabled:{opacity:0,marginTop:0,transition:{...$a,delay:.8,delayChildren:.8}}};var Za=(0,p.forwardRef)((function({isDistractionFree:e,footer:t,header:s,editorNotices:n,sidebar:o,secondarySidebar:r,content:i,actions:a,labels:l,className:d},u){const[h,g]=(0,m.useResizeObserver)(),_=(0,m.useViewportMatch)("medium","<"),f={type:"tween",duration:(0,m.useReducedMotion)()?0:.25,ease:[.6,0,.4,1]};!function(e){(0,p.useEffect)((()=>{const t=document&&document.querySelector(`html:not(.$e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}}),[e])}("interface-interface-skeleton__html-container");const b={...{header:(0,fs._x)("Header","header landmark area"),body:(0,fs.__)("Content"),secondarySidebar:(0,fs.__)("Block Library"),sidebar:(0,fs._x)("Settings","settings landmark area"),actions:(0,fs.__)("Publish"),footer:(0,fs.__)("Footer")},...l};return(0,c.jsxs)("div",{ref:u,className:hr(d,"interface-interface-skeleton",!!t&&"has-footer"),children:[(0,c.jsxs)("div",{className:"interface-interface-skeleton__editor",children:[(0,c.jsx)(Fn.__unstableAnimatePresence,{initial:!1,children:!!s&&(0,c.jsx)(Ga,{as:Fn.__unstableMotion.div,className:"interface-interface-skeleton__header","aria-label":b.header,initial:e&&!_?"distractionFreeHidden":"hidden",whileHover:e&&!_?"distractionFreeHover":"visible",animate:e&&!_?"distractionFreeDisabled":"visible",exit:e&&!_?"distractionFreeHidden":"hidden",variants:Wa,transition:f,children:s})}),e&&(0,c.jsx)("div",{className:"interface-interface-skeleton__header",children:n}),(0,c.jsxs)("div",{className:"interface-interface-skeleton__body",children:[(0,c.jsx)(Fn.__unstableAnimatePresence,{initial:!1,children:!!r&&(0,c.jsx)(Ga,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:b.secondarySidebar,as:Fn.__unstableMotion.div,initial:"closed",animate:"open",exit:"closed",variants:{open:{width:g.width},closed:{width:0}},transition:f,children:(0,c.jsxs)(Fn.__unstableMotion.div,{style:{position:"absolute",width:_?"100vw":"fit-content",height:"100%",left:0},variants:{open:{x:0},closed:{x:"-100%"}},transition:f,children:[h,r]})})}),(0,c.jsx)(Ga,{className:"interface-interface-skeleton__content",ariaLabel:b.body,children:i}),!!o&&(0,c.jsx)(Ga,{className:"interface-interface-skeleton__sidebar",ariaLabel:b.sidebar,children:o}),!!a&&(0,c.jsx)(Ga,{className:"interface-interface-skeleton__actions",ariaLabel:b.actions,children:a})]})]}),!!t&&(0,c.jsx)(Ga,{className:"interface-interface-skeleton__footer",ariaLabel:b.footer,children:t})]})}));const{RenamePatternModal:Ya}=$(lo.privateApis),qa="editor/pattern-rename";function Ka(){const{record:e,postType:t}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(xc),{getEditedEntityRecord:n}=e(u.store),o=t();return{record:n("postType",o,s()),postType:o}}),[]),{closeModal:s}=(0,d.useDispatch)(Ea);return(0,d.useSelect)((e=>e(Ea).isModalActive(qa)))&&t===N?(0,c.jsx)(Ya,{onClose:s,pattern:e}):null}const{DuplicatePatternModal:Qa}=$(lo.privateApis),Xa="editor/pattern-duplicate";function Ja(){const{record:e,postType:t}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(xc),{getEditedEntityRecord:n}=e(u.store),o=t();return{record:n("postType",o,s()),postType:o}}),[]),{closeModal:s}=(0,d.useDispatch)(Ea);return(0,d.useSelect)((e=>e(Ea).isModalActive(Xa)))&&t===N?(0,c.jsx)(Qa,{onClose:s,onSuccess:()=>s(),pattern:e}):null}const{BlockRemovalWarningModal:el}=$(g.privateApis),tl=["core/post-content","core/post-template","core/query"],sl=[{postTypes:["wp_template","wp_template_part"],callback(e){if(e.filter((({name:e})=>tl.includes(e))).length)return(0,fs._n)("Deleting this block will stop your post or page content from displaying on this template. It is not recommended.","Some of the deleted blocks will stop your post or page content from displaying on this template. It is not recommended.",e.length)}},{postTypes:["wp_block"],callback(e){if(e.filter((({attributes:e})=>e?.metadata?.bindings&&Object.values(e.metadata.bindings).some((e=>"core/pattern-overrides"===e.source)))).length)return(0,fs._n)("The deleted block allows instance overrides. Removing it may result in content not displaying where this pattern is used. Are you sure you want to proceed?","Some of the deleted blocks allow instance overrides. Removing them may result in content not displaying where this pattern is used. Are you sure you want to proceed?",e.length)}}];function nl(){const e=(0,d.useSelect)((e=>e(xc).getCurrentPostType()),[]),t=(0,p.useMemo)((()=>sl.filter((t=>t.postTypes.includes(e)))),[e]);return el&&t?(0,c.jsx)(el,{rules:t}):null}function ol({blockPatterns:e,onChoosePattern:t}){const{editEntityRecord:s}=(0,d.useDispatch)(u.store),{postType:n,postId:o}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(xc);return{postType:t(),postId:s()}}),[]);return(0,c.jsx)(g.__experimentalBlockPatternsList,{blockPatterns:e,onClickPattern:(e,r)=>{s("postType",n,o,{blocks:r,content:({blocks:e=[]})=>(0,x.__unstableSerializeAndClean)(e)}),t()}})}function rl({onClose:e}){const[t,s]=(0,p.useState)(!0),{set:n}=(0,d.useDispatch)(C.store),o=function(){const{blockPatternsWithPostContentBlockType:e,postType:t}=(0,d.useSelect)((e=>{const{getPatternsByBlockTypes:t,getBlocksByName:s}=e(g.store),{getCurrentPostType:n,getRenderingMode:o}=e(xc);return{blockPatternsWithPostContentBlockType:t("core/post-content","post-only"===o()?"":s("core/post-content")?.[0]),postType:n()}}),[]);return(0,p.useMemo)((()=>e?.length?e.filter((e=>"page"===t&&!e.postTypes||Array.isArray(e.postTypes)&&e.postTypes.includes(t))):[]),[t,e])}();if(!(o.length>0))return null;function r(){e(),n("core","enableChoosePatternModal",t)}return(0,c.jsxs)(Fn.Modal,{className:"editor-start-page-options__modal",title:(0,fs.__)("Choose a pattern"),isFullScreen:!0,onRequestClose:r,children:[(0,c.jsx)("div",{className:"editor-start-page-options__modal-content",children:(0,c.jsx)(ol,{blockPatterns:o,onChoosePattern:r})}),(0,c.jsx)(Fn.Flex,{className:"editor-start-page-options__modal__actions",justify:"flex-end",expanded:!1,children:(0,c.jsx)(Fn.FlexItem,{children:(0,c.jsx)(Fn.ToggleControl,{__nextHasNoMarginBottom:!0,checked:t,label:(0,fs.__)("Show starter patterns"),help:(0,fs.__)("Shows starter patterns when creating a new page."),onChange:e=>{s(e)}})})})]})}function il(){const[e,t]=(0,p.useState)(!1),{isEditedPostDirty:s,isEditedPostEmpty:n}=(0,d.useSelect)(xc),{isModalActive:o}=(0,d.useSelect)(Ea),{enabled:r,postId:i}=(0,d.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s}=e(xc),n=e(C.store).get("core","enableChoosePatternModal");return{postId:t(),enabled:n&&B!==s()}}),[]);return(0,p.useEffect)((()=>{const e=!s()&&n(),i=o("editor/preferences");r&&e&&!i&&t(!0)}),[r,i,s,n,o]),e?(0,c.jsx)(rl,{onClose:()=>t(!1)}):null}const al=window.wp.keyboardShortcuts,ll=[{keyCombination:{modifier:"primary",character:"b"},description:(0,fs.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,fs.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,fs.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,fs.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,fs.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,fs.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,fs.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,fs.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}],description:(0,fs.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,fs.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")},{keyCombination:{modifier:"primaryShift",character:"SPACE"},description:(0,fs.__)("Add non breaking space.")}],cl=window.wp.keycodes;function dl({keyCombination:e,forceAriaLabel:t}){const s=e.modifier?cl.displayShortcutList[e.modifier](e.character):e.character,n=e.modifier?cl.shortcutAriaLabel[e.modifier](e.character):e.character;return(0,c.jsx)("kbd",{className:"editor-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||n,children:(Array.isArray(s)?s:[s]).map(((e,t)=>"+"===e?(0,c.jsx)(p.Fragment,{children:e},t):(0,c.jsx)("kbd",{className:"editor-keyboard-shortcut-help-modal__shortcut-key",children:e},t)))})}var ul=function({description:e,keyCombination:t,aliases:s=[],ariaLabel:n}){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"editor-keyboard-shortcut-help-modal__shortcut-description",children:e}),(0,c.jsxs)("div",{className:"editor-keyboard-shortcut-help-modal__shortcut-term",children:[(0,c.jsx)(dl,{keyCombination:t,forceAriaLabel:n}),s.map(((e,t)=>(0,c.jsx)(dl,{keyCombination:e,forceAriaLabel:n},t)))]})]})};var pl=function({name:e}){const{keyCombination:t,description:s,aliases:n}=(0,d.useSelect)((t=>{const{getShortcutKeyCombination:s,getShortcutDescription:n,getShortcutAliases:o}=t(al.store);return{keyCombination:s(e),aliases:o(e),description:n(e)}}),[e]);return t?(0,c.jsx)(ul,{keyCombination:t,description:s,aliases:n}):null};const ml="editor/keyboard-shortcut-help",hl=({shortcuts:e})=>(0,c.jsx)("ul",{className:"editor-keyboard-shortcut-help-modal__shortcut-list",role:"list",children:e.map(((e,t)=>(0,c.jsx)("li",{className:"editor-keyboard-shortcut-help-modal__shortcut",children:"string"==typeof e?(0,c.jsx)(pl,{name:e}):(0,c.jsx)(ul,{...e})},t)))}),gl=({title:e,shortcuts:t,className:s})=>(0,c.jsxs)("section",{className:hr("editor-keyboard-shortcut-help-modal__section",s),children:[!!e&&(0,c.jsx)("h2",{className:"editor-keyboard-shortcut-help-modal__section-title",children:e}),(0,c.jsx)(hl,{shortcuts:t})]}),_l=({title:e,categoryName:t,additionalShortcuts:s=[]})=>{const n=(0,d.useSelect)((e=>e(al.store).getCategoryShortcuts(t)),[t]);return(0,c.jsx)(gl,{title:e,shortcuts:n.concat(s)})};var fl=function(){const e=(0,d.useSelect)((e=>e(Ea).isModalActive(ml)),[]),{openModal:t,closeModal:s}=(0,d.useDispatch)(Ea),n=()=>{e?s():t(ml)};return(0,al.useShortcut)("core/editor/keyboard-shortcuts",n),e?(0,c.jsxs)(Fn.Modal,{className:"editor-keyboard-shortcut-help-modal",title:(0,fs.__)("Keyboard shortcuts"),closeButtonLabel:(0,fs.__)("Close"),onRequestClose:n,children:[(0,c.jsx)(gl,{className:"editor-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/editor/keyboard-shortcuts"]}),(0,c.jsx)(_l,{title:(0,fs.__)("Global shortcuts"),categoryName:"global"}),(0,c.jsx)(_l,{title:(0,fs.__)("Selection shortcuts"),categoryName:"selection"}),(0,c.jsx)(_l,{title:(0,fs.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,fs.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,fs.__)("Forward-slash")}]}),(0,c.jsx)(gl,{title:(0,fs.__)("Text formatting"),shortcuts:ll}),(0,c.jsx)(_l,{title:(0,fs.__)("List View shortcuts"),categoryName:"list-view"})]}):null};function bl({clientId:e,onClose:t}){const s=zi(),{entity:n,onNavigateToEntityRecord:o,canEditTemplates:r}=(0,d.useSelect)((t=>{const{getBlockParentsByBlockName:n,getSettings:o,getBlockAttributes:r,getBlockParents:i}=t(g.store),{getCurrentTemplateId:a,getRenderingMode:l}=t(xc),c=n(e,"core/block",!0)[0];let d;if(c?d=t(u.store).getEntityRecord("postType","wp_block",r(c).ref):"template-locked"!==l()||i(e).some((e=>s.includes(e)))||(d=t(u.store).getEntityRecord("postType","wp_template",a())),!d)return{};return{canEditTemplates:t(u.store).canUser("create",{kind:"postType",name:"wp_template"}),entity:d,onNavigateToEntityRecord:o().onNavigateToEntityRecord}}),[e,s]);if(!n)return(0,c.jsx)(yl,{clientId:e,onClose:t});const i="wp_block"===n.type;let a=i?(0,fs.__)("Edit the pattern to move, delete, or make further changes to this block."):(0,fs.__)("Edit the template to move, delete, or make further changes to this block.");return r||(a=(0,fs.__)("Only users with permissions to edit the template can move or delete this block")),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__unstableBlockSettingsMenuFirstItem,{children:(0,c.jsx)(Fn.MenuItem,{onClick:()=>{o({postId:n.id,postType:n.type})},disabled:!r,children:i?(0,fs.__)("Edit pattern"):(0,fs.__)("Edit template")})}),(0,c.jsx)(Fn.__experimentalText,{variant:"muted",as:"p",className:"editor-content-only-settings-menu__description",children:a})]})}function yl({clientId:e,onClose:t}){const{contentLockingParent:s}=(0,d.useSelect)((t=>{const{getContentLockingParent:s}=$(t(g.store));return{contentLockingParent:s(e)}}),[e]),n=(0,g.useBlockDisplayInformation)(s),o=(0,d.useDispatch)(g.store);if(!n?.title)return null;const{modifyContentLockBlock:r}=$(o);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__unstableBlockSettingsMenuFirstItem,{children:(0,c.jsx)(Fn.MenuItem,{onClick:()=>{r(s),t()},children:(0,fs._x)("Unlock","Unlock content locked blocks")})}),(0,c.jsx)(Fn.__experimentalText,{variant:"muted",as:"p",className:"editor-content-only-settings-menu__description",children:(0,fs.__)("Temporarily unlock the parent block to edit, delete or make further changes to this block.")})]})}function xl(){return(0,c.jsx)(g.BlockSettingsMenuControls,{children:({selectedClientIds:e,onClose:t})=>1===e.length&&(0,c.jsx)(bl,{clientId:e[0],onClose:t})})}function vl(e){const{slug:t,patterns:s}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(xc),{getEntityRecord:n,getBlockPatterns:o}=e(u.store),r=s();return{slug:n("postType",t(),r).slug,patterns:o()}}),[]),n=(0,d.useSelect)((e=>e(u.store).getCurrentTheme().stylesheet));return(0,p.useMemo)((()=>[{name:"fallback",blocks:(0,x.parse)(e),title:(0,fs.__)("Fallback content")},...s.filter((e=>Array.isArray(e.templateTypes)&&e.templateTypes.some((e=>t.startsWith(e))))).map((e=>({...e,blocks:(0,x.parse)(e.content).map((e=>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=n),e)))),"core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=n),e}(e)))})))]),[e,t,s])}function wl({fallbackContent:e,onChoosePattern:t,postType:s}){const[,,n]=(0,u.useEntityBlockEditor)("postType",s),o=vl(e);return(0,c.jsx)(g.__experimentalBlockPatternsList,{blockPatterns:o,onClickPattern:(e,s)=>{n(s,{selection:void 0}),t()}})}function Sl({slug:e,isCustom:t,onClose:s,postType:n}){const o=function(e,t=!1){return(0,d.useSelect)((s=>{const{getEntityRecord:n,getDefaultTemplateId:o}=s(u.store),r=o({slug:e,is_custom:t,ignore_empty:!0});return r?n("postType",B,r)?.content?.raw:void 0}),[e,t])}(e,t);return o?(0,c.jsxs)(Fn.Modal,{className:"editor-start-template-options__modal",title:(0,fs.__)("Choose a pattern"),closeLabel:(0,fs.__)("Cancel"),focusOnMount:"firstElement",onRequestClose:s,isFullScreen:!0,children:[(0,c.jsx)("div",{className:"editor-start-template-options__modal-content",children:(0,c.jsx)(wl,{fallbackContent:o,slug:e,isCustom:t,postType:n,onChoosePattern:()=>{s()}})}),(0,c.jsx)(Fn.Flex,{className:"editor-start-template-options__modal__actions",justify:"flex-end",expanded:!1,children:(0,c.jsx)(Fn.FlexItem,{children:(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:s,children:(0,fs.__)("Skip")})})})]}):null}function kl(){const[e,t]=(0,p.useState)(!1),{shouldOpenModal:s,slug:n,isCustom:o,postType:r,postId:i}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(xc),n=t(),o=s(),{getEditedEntityRecord:r,hasEditsForEntityRecord:i}=e(u.store),a=r("postType",n,o);return{shouldOpenModal:!i("postType",n,o)&&""===a.content&&B===n,slug:a.slug,isCustom:a.is_custom,postType:n,postId:o}}),[]);return(0,p.useEffect)((()=>{t(!1)}),[r,i]),!s||e?null:(0,c.jsx)(Sl,{slug:n,isCustom:o,postType:r,onClose:()=>t(!0)})}function Cl(){const e=(0,d.useSelect)((e=>{const{richEditingEnabled:t,codeEditingEnabled:s}=e(xc).getEditorSettings();return!t||!s}),[]),{getBlockSelectionStart:t}=(0,d.useSelect)(g.store),{getActiveComplementaryArea:s}=(0,d.useSelect)(Ea),{enableComplementaryArea:n,disableComplementaryArea:o}=(0,d.useDispatch)(Ea),{redo:r,undo:i,savePost:a,setIsListViewOpened:l,switchEditorMode:c,toggleDistractionFree:u}=(0,d.useDispatch)(xc),{isEditedPostDirty:p,isPostSavingLocked:m,isListViewOpened:h,getEditorMode:_}=(0,d.useSelect)(xc);return(0,al.useShortcut)("core/editor/toggle-mode",(()=>{c("visual"===_()?"text":"visual")}),{isDisabled:e}),(0,al.useShortcut)("core/editor/toggle-distraction-free",(()=>{u()})),(0,al.useShortcut)("core/editor/undo",(e=>{i(),e.preventDefault()})),(0,al.useShortcut)("core/editor/redo",(e=>{r(),e.preventDefault()})),(0,al.useShortcut)("core/editor/save",(e=>{e.preventDefault(),m()||p()&&a()})),(0,al.useShortcut)("core/editor/toggle-list-view",(e=>{h()||(e.preventDefault(),l(!0))})),(0,al.useShortcut)("core/editor/toggle-sidebar",(e=>{e.preventDefault();if(["edit-post/document","edit-post/block"].includes(s("core")))o("core");else{const e=t()?"edit-post/block":"edit-post/document";n("core",e)}})),null}function Pl({clientId:e,onClose:t}){const{getBlocks:s}=(0,d.useSelect)(g.store),{replaceBlocks:n}=(0,d.useDispatch)(g.store);return(0,d.useSelect)((t=>t(g.store).canRemoveBlock(e)),[e])?(0,c.jsx)(Fn.MenuItem,{onClick:()=>{n(e,s(e)),t()},children:(0,fs.__)("Detach")}):null}function jl({clientIds:e,blocks:t}){const[s,n]=(0,p.useState)(!1),{replaceBlocks:o}=(0,d.useDispatch)(g.store),{createSuccessNotice:r}=(0,d.useDispatch)(_s.store),{isBlockBasedTheme:i,canCreate:a}=(0,d.useSelect)((e=>({isBlockBasedTheme:e(u.store).getCurrentTheme()?.is_block_theme,canCreate:e(g.store).canInsertBlockType("core/template-part")})),[]);if(!i||!a)return null;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Fn.MenuItem,{icon:U,onClick:()=>{n(!0)},"aria-expanded":s,"aria-haspopup":"dialog",children:(0,fs.__)("Create template part")}),s&&(0,c.jsx)(no,{closeModal:()=>{n(!1)},blocks:t,onCreate:async t=>{o(e,(0,x.createBlock)("core/template-part",{slug:t.slug,theme:t.theme})),r((0,fs.__)("Template part created."),{type:"snackbar"})}})]})}function El(){return(0,c.jsx)(g.BlockSettingsMenuControls,{children:({selectedClientIds:e,onClose:t})=>(0,c.jsx)(Tl,{clientIds:e,onClose:t})})}function Tl({clientIds:e,onClose:t}){const{blocks:s}=(0,d.useSelect)((t=>{const{getBlocksByClientId:s}=t(g.store);return{blocks:s(e)}}),[e]);return 1===s.length&&"core/template-part"===s[0]?.name?(0,c.jsx)(Pl,{clientId:e[0],onClose:t}):(0,c.jsx)(jl,{clientIds:e,blocks:s})}const{ExperimentalBlockEditorProvider:Bl}=$(g.privateApis),{PatternsMenuItems:Il}=$(lo.privateApis),Nl=()=>{},Rl=["wp_block","wp_navigation","wp_template_part"];const Dl=ii((({post:e,settings:t,recovery:s,initialEdits:n,children:o,BlockEditorProviderComponent:r=Bl,__unstableTemplate:i})=>{const a=!!i,{editorSettings:l,selection:m,isReady:_,mode:f,defaultMode:b,postTypeEntities:y}=(0,d.useSelect)((t=>{const{getEditorSettings:s,getEditorSelection:n,getRenderingMode:o,__unstableIsEditorReady:r,getDefaultRenderingMode:i}=$(t(xc)),{getEntitiesConfig:l}=t(u.store),c=o(),d=i(e.type),p="template-locked"===d?a:void 0!==d,m=void 0!==d;return{editorSettings:s(),isReady:r(),mode:m?c:void 0,defaultMode:p?d:void 0,selection:n(),postTypeEntities:"wp_template"===e.type?l("postType"):null}}),[e.type,a]),v=a&&"post-only"!==f,w=v?i:e,S=(0,p.useMemo)((()=>{const t={};if("wp_template"===e.type||"wp_registered_template"===e.type){if("page"===e.slug)t.postType="page";else if("single"===e.slug)t.postType="post";else if("single"===e.slug.split("-")[0]){const s=y?.map((e=>e.name))||[],n=e.slug.match(`^single-($s.join("|")})(?:-.+)?$`);n&&(t.postType=n[1])}}else Rl.includes(w.type)&&!v||(t.postId=e.id,t.postType=e.type);return{...t,templateSlug:"wp_template"===w.type?w.slug:void 0}}),[v,e.id,e.type,e.slug,w.type,w.slug,y]),{id:k,type:P}=w,j=Vi(l,P,k,f),[E,T,R]=function(e,t,s){const n="template-locked"===s?"template":"post",[o,r,i]=(0,u.useEntityBlockEditor)("postType",e.type,{id:e.id}),[a,l,c]=(0,u.useEntityBlockEditor)("postType",t?.type,{id:t?.id}),d=(0,p.useMemo)((()=>{if("wp_navigation"===e.type)return[(0,x.createBlock)("core/navigation",{ref:e.id,templateLock:!1})]}),[e.type,e.id]),m=(0,p.useMemo)((()=>d||("template"===n?a:o)),[d,n,a,o]);return t&&"template-locked"===s||"wp_navigation"===e.type?[m,Nl,Nl]:[m,"post"===n?r:l,"post"===n?i:c]}(e,i,f),{updatePostLock:D,setupEditor:A,updateEditorSettings:M,setCurrentTemplateId:L,setEditedPost:O,setRenderingMode:F}=$((0,d.useDispatch)(xc)),{createWarningNotice:V,removeNotice:U}=(0,d.useDispatch)(_s.store);return(0,p.useLayoutEffect)((()=>{s||(D(t.postLock),A(e,n,t.template),t.autosave&&V((0,fs.__)("There is an autosave of this post that is more recent than the version below."),{id:"autosave-exists",actions:[{label:(0,fs.__)("View the autosave"),url:t.autosave.editLink}]}))}),[]),(0,p.useEffect)((()=>{O(e.type,e.id),U("template-activate-notice")}),[e.type,e.id,O,U]),(0,p.useEffect)((()=>{M(t)}),[t,M]),(0,p.useEffect)((()=>{L(i?.id)}),[i?.id,L]),(0,p.useEffect)((()=>{b&&F(b)}),[b,F]),function(e,t){(0,p.useEffect)((()=>((0,h.addFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter",((s,n)=>!(!$i.includes(e)&&"core/template-part"===n.name&&"post-only"===t)&&s)),(0,h.addFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter",((t,s,n,{getBlockParentsByBlockName:o})=>$i.includes(e)||"core/post-content"!==s.name?t:o(n,"core/query").length>0)),()=>{(0,h.removeFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter"),(0,h.removeFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter")})),[e,t])}(e.type,f),(0,oa.useCommandLoader)({name:"core/editor/edit-ui",hook:function(){const{editorMode:e,isListViewOpen:t,showBlockBreadcrumbs:s,isDistractionFree:n,isFocusMode:o,isPreviewMode:r,isViewable:i,isCodeEditingEnabled:a,isRichEditingEnabled:l,isPublishSidebarEnabled:c}=(0,d.useSelect)((e=>{const{get:t}=e(C.store),{isListViewOpened:s,getCurrentPostType:n,getEditorSettings:o}=e(xc),{getSettings:r}=e(g.store),{getPostType:i}=e(u.store);return{editorMode:t("core","editorMode")??"visual",isListViewOpen:s(),showBlockBreadcrumbs:t("core","showBlockBreadcrumbs"),isDistractionFree:t("core","distractionFree"),isFocusMode:t("core","focusMode"),isPreviewMode:r().isPreviewMode,isViewable:i(n())?.viewable??!1,isCodeEditingEnabled:o().codeEditingEnabled,isRichEditingEnabled:o().richEditingEnabled,isPublishSidebarEnabled:e(xc).isPublishSidebarEnabled()}}),[]),{getActiveComplementaryArea:p}=(0,d.useSelect)(Ea),{toggle:m}=(0,d.useDispatch)(C.store),{createInfoNotice:h}=(0,d.useDispatch)(_s.store),{__unstableSaveForPreview:_,setIsListViewOpened:f,switchEditorMode:b,toggleDistractionFree:y,toggleSpotlightMode:x,toggleTopToolbar:v}=(0,d.useDispatch)(xc),{openModal:w,enableComplementaryArea:S,disableComplementaryArea:k}=(0,d.useDispatch)(Ea),{getCurrentPostId:P}=(0,d.useSelect)(xc),j=a&&l;if(r)return{commands:[],isLoading:!1};const E=[];return E.push({name:"core/open-shortcut-help",label:(0,fs.__)("Keyboard shortcuts"),icon:Wi,callback:({close:e})=>{e(),w("editor/keyboard-shortcut-help")}}),E.push({name:"core/toggle-distraction-free",label:n?(0,fs.__)("Exit Distraction free"):(0,fs.__)("Enter Distraction free"),callback:({close:e})=>{y(),e()}}),E.push({name:"core/open-preferences",label:(0,fs.__)("Editor preferences"),callback:({close:e})=>{e(),w("editor/preferences")}}),E.push({name:"core/toggle-spotlight-mode",label:o?(0,fs.__)("Exit Spotlight mode"):(0,fs.__)("Enter Spotlight mode"),callback:({close:e})=>{x(),e()}}),E.push({name:"core/toggle-list-view",label:t?(0,fs.__)("Close List View"):(0,fs.__)("Open List View"),icon:Zi,callback:({close:e})=>{f(!t),e(),h(t?(0,fs.__)("List View off."):(0,fs.__)("List View on."),{id:"core/editor/toggle-list-view/notice",type:"snackbar"})}}),E.push({name:"core/toggle-top-toolbar",label:(0,fs.__)("Top toolbar"),callback:({close:e})=>{v(),e()}}),j&&E.push({name:"core/toggle-code-editor",label:"visual"===e?(0,fs.__)("Open code editor"):(0,fs.__)("Exit code editor"),icon:Yi,callback:({close:t})=>{b("visual"===e?"text":"visual"),t()}}),E.push({name:"core/toggle-breadcrumbs",label:s?(0,fs.__)("Hide block breadcrumbs"):(0,fs.__)("Show block breadcrumbs"),callback:({close:e})=>{m("core","showBlockBreadcrumbs"),e(),h(s?(0,fs.__)("Breadcrumbs hidden."):(0,fs.__)("Breadcrumbs visible."),{id:"core/editor/toggle-breadcrumbs/notice",type:"snackbar"})}}),E.push({name:"core/open-settings-sidebar",label:(0,fs.__)("Show or hide the Settings panel"),icon:(0,fs.isRTL)()?qi:Ki,callback:({close:e})=>{const t=p("core");e(),"edit-post/document"===t?k("core"):S("core","edit-post/document")}}),E.push({name:"core/open-block-inspector",label:(0,fs.__)("Show or hide the Block settings panel"),icon:Qi,callback:({close:e})=>{const t=p("core");e(),"edit-post/block"===t?k("core"):S("core","edit-post/block")}}),E.push({name:"core/toggle-publish-sidebar",label:c?(0,fs.__)("Disable pre-publish checks"):(0,fs.__)("Enable pre-publish checks"),icon:Xi,callback:({close:e})=>{e(),m("core","isPublishSidebarEnabled"),h(c?(0,fs.__)("Pre-publish checks disabled."):(0,fs.__)("Pre-publish checks enabled."),{id:"core/editor/publish-sidebar/notice",type:"snackbar"})}}),i&&E.push({name:"core/preview-link",label:(0,fs.__)("Preview in a new tab"),icon:Gn,callback:async({close:e})=>{e();const t=P(),s=await _();window.open(s,`wp-preview-$t}`)}}),{commands:E,isLoading:!1}}}),(0,oa.useCommandLoader)({name:"core/editor/contextual-commands",hook:function(){const{postType:e}=(0,d.useSelect)((e=>{const{getCurrentPostType:t}=e(xc);return{postType:t()}}),[]),{openModal:t}=(0,d.useDispatch)(Ea),s=[];return e===N&&(s.push({name:"core/rename-pattern",label:(0,fs.__)("Rename pattern"),icon:Ji,callback:({close:e})=>{t(qa),e()}}),s.push({name:"core/duplicate-pattern",label:(0,fs.__)("Duplicate pattern"),icon:ea,callback:({close:e})=>{t(Xa),e()}})),{isLoading:!1,commands:s}},context:"entity-edit"}),(0,oa.useCommandLoader)({name:"core/editor/page-content-focus",hook:function(){const{onNavigateToEntityRecord:e,goBack:t,templateId:s,isPreviewMode:n}=(0,d.useSelect)((e=>{const{getRenderingMode:t,getEditorSettings:s,getCurrentTemplateId:n}=$(e(xc)),o=s();return{isTemplateHidden:"post-only"===t(),onNavigateToEntityRecord:o.onNavigateToEntityRecord,getEditorSettings:s,goBack:o.onNavigateToPreviousEntityRecord,templateId:n(),isPreviewMode:o.isPreviewMode}}),[]),{editedRecord:o,hasResolved:r}=(0,u.useEntityRecord)("postType","wp_template",s);if(n)return{isLoading:!1,commands:[]};const i=[];return s&&r&&i.push({name:"core/switch-to-template-focus",label:(0,fs.sprintf)((0,fs.__)("Edit template: %s"),(0,Ln.decodeEntities)(o.title)),icon:W,callback:({close:t})=>{e({postId:s,postType:"wp_template"}),t()}}),t&&i.push({name:"core/switch-to-previous-entity",label:(0,fs.__)("Go back"),icon:ta,callback:({close:e})=>{t(),e()}}),{isLoading:!1,commands:i}},context:"entity-edit"}),(0,oa.useCommandLoader)({name:"core/edit-site/manipulate-document",hook:function(){const{postType:e,postId:t}=(0,d.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s}=e(xc);return{postType:s(),postId:t()}}),[]),{editedRecord:s,hasResolved:n}=(0,u.useEntityRecord)("postType",e,t),{revertTemplate:o}=$((0,d.useDispatch)(xc));if(!n||![I,B].includes(e))return{isLoading:!0,commands:[]};const r=[];if(On(s)){const e=s.type===B?(0,fs.sprintf)((0,fs.__)("Reset template: %s"),(0,Ln.decodeEntities)(s.title)):(0,fs.sprintf)((0,fs.__)("Reset template part: %s"),(0,Ln.decodeEntities)(s.title));r.push({name:"core/reset-template",label:e,icon:(0,fs.isRTL)()?sa:na,callback:({close:e})=>{o(s),e()}})}return{isLoading:!n,commands:r}}}),_&&f?(0,c.jsx)(u.EntityProvider,{kind:"root",type:"site",children:(0,c.jsx)(u.EntityProvider,{kind:"postType",type:e.type,id:e.id,children:(0,c.jsx)(g.BlockContextProvider,{value:S,children:(0,c.jsxs)(r,{value:E,onChange:R,onInput:T,selection:m,settings:j,useSubRegistry:!1,children:[o,!t.isPreviewMode&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Il,{}),(0,c.jsx)(El,{}),(0,c.jsx)(xl,{}),"template-locked"===f&&(0,c.jsx)(Hi,{}),"wp_navigation"===P&&(0,c.jsx)(Gi,{}),(0,c.jsx)(Cl,{}),(0,c.jsx)(fl,{}),(0,c.jsx)(nl,{}),(0,c.jsx)(il,{}),(0,c.jsx)(kl,{}),(0,c.jsx)(Ka,{}),(0,c.jsx)(Ja,{})]})]})})})}):null}));function Al(e){return(0,c.jsx)(Dl,{...e,BlockEditorProviderComponent:g.BlockEditorProvider,children:e.children})}var Ml=Al;const{useGlobalStyle:Ll}=$(g.privateApis);function Ol({template:e,post:t}){const[s="white"]=Ll("color.background"),[n]=(0,u.useEntityBlockEditor)("postType",t.type,{id:t.id}),[o]=(0,u.useEntityBlockEditor)("postType",e?.type,{id:e?.id}),r=e&&o?o:n,i=!r?.length;return(0,c.jsxs)("div",{className:"editor-fields-content-preview",style:{backgroundColor:s},children:[i&&(0,c.jsx)("span",{className:"editor-fields-content-preview__empty",children:(0,fs.__)("Empty content")}),!i&&(0,c.jsx)(g.BlockPreview.Async,{children:(0,c.jsx)(g.BlockPreview,{blocks:r})})]})}const Fl={type:"media",id:"content-preview",label:(0,fs.__)("Content preview"),render:function({item:e}){const{settings:t,template:s}=(0,d.useSelect)((t=>{const{canUser:s,getPostType:n,getTemplateId:o,getEntityRecord:r}=$(t(u.store)),i=s("read",{kind:"postType",name:"wp_template"}),a=t(xc).getEditorSettings(),l=a.supportsTemplateMode,c=n(e.type)?.viewable??!1,d=l&&c&&i?o(e.type,e.id):null;return{settings:a,template:d?r("postType","wp_template",d):void 0}}),[e.type,e.id]);return(0,c.jsx)(Al,{post:e,settings:t,__unstableTemplate:s,children:(0,c.jsx)(Ol,{template:s,post:e})})},enableSorting:!1};var Vl=Fl;function Ul(e,t,s){return{type:"REGISTER_ENTITY_ACTION",kind:e,name:t,config:s}}function zl(e,t,s){return{type:"UNREGISTER_ENTITY_ACTION",kind:e,name:t,actionId:s}}function Hl(e,t,s){return{type:"REGISTER_ENTITY_FIELD",kind:e,name:t,config:s}}function Gl(e,t,s){return{type:"UNREGISTER_ENTITY_FIELD",kind:e,name:t,fieldId:s}}function $l(e,t){return{type:"SET_IS_READY",kind:e,name:t}}const Wl=e=>async({registry:t})=>{if($(t.select(xc)).isEntityReady("postType",e))return;$(t.dispatch(xc)).setIsReady("postType",e);const s=await t.resolveSelect(u.store).getPostType(e),n=await t.resolveSelect(u.store).canUser("create",{kind:"postType",name:e}),o=await t.resolveSelect(u.store).getCurrentTheme();let r=!["wp_block","wp_template_part"].includes(s.slug)&&n&&Hn;"wp_template"!==s.slug&&(r=void 0);const i=[s.viewable?$n:void 0,s.supports?.revisions?Wn:void 0,r,"wp_template_part"===s.slug&&n&&o?.is_block_theme?ao:void 0,n&&"wp_block"===s.slug?go:void 0,s.supports?.title?bo:void 0,s.supports?.["page-attributes"]?xo:void 0,"wp_block"===s.slug?Yo:void 0,Ko,Jo,or,ir,lr].filter(Boolean),a=[s.supports?.thumbnail&&o?.theme_supports?.["post-thumbnails"]&&pr,s.supports?.author&&br,Pr,Tr,Ar,s.supports?.["page-attributes"]&&Ur,s.supports?.comments&&zr,s.supports?.trackbacks&&Hr,(s.supports?.comments||s.supports?.trackbacks)&&Gr,Zr,qr,s.supports?.editor&&s.viewable&&Vl].filter(Boolean);if(s.supports?.title){let t;t="page"===e?Jr:"wp_template"===e?ei:"wp_block"===e?oi:ri,a.push(t)}t.batch((()=>{i.forEach((s=>{$(t.dispatch(xc)).registerEntityAction("postType",e,s)})),a.forEach((s=>{$(t.dispatch(xc)).registerEntityField("postType",e,s)}))})),(0,h.doAction)("core.registerPostTypeSchema",e)};function Zl(e){return{type:"SET_CURRENT_TEMPLATE_ID",id:e}}const Yl=e=>async({select:t,dispatch:s,registry:n})=>{const o=await n.dispatch(u.store).saveEntityRecord("postType","wp_template",e);return n.dispatch(u.store).editEntityRecord("postType",t.getCurrentPostType(),t.getCurrentPostId(),{template:o.slug}),n.dispatch(_s.store).createSuccessNotice((0,fs.__)("Custom template created. You're in template mode now."),{type:"snackbar",actions:[{label:(0,fs.__)("Go back"),onClick:()=>s.setRenderingMode(t.getEditorSettings().defaultRenderingMode)}]}),o},ql=e=>({registry:t})=>{const s=(t.select(C.store).get("core","hiddenBlockTypes")??[]).filter((t=>!(Array.isArray(e)?e:[e]).includes(t)));t.dispatch(C.store).set("core","hiddenBlockTypes",s)},Kl=e=>({registry:t})=>{const s=t.select(C.store).get("core","hiddenBlockTypes")??[],n=new Set([...s,...Array.isArray(e)?e:[e]]);t.dispatch(C.store).set("core","hiddenBlockTypes",[...n])},Ql=({onSave:e,dirtyEntityRecords:t=[],entitiesToSkip:s=[],close:n}={})=>({registry:o})=>{const r=[{kind:"postType",name:"wp_navigation"}],i="site-editor-save-success",a=o.select(u.store).getEntityRecord("root","__unstableBase")?.home;o.dispatch(_s.store).removeNotice(i);const l=t.filter((({kind:e,name:t,key:n,property:o})=>!s.some((s=>s.kind===e&&s.name===t&&s.key===n&&s.property===o))));n?.(l);const c=[],d=[];l.forEach((({kind:e,name:t,key:s,property:n})=>{"root"===e&&"site"===t?c.push(n):(r.some((s=>s.kind===e&&s.name===t))&&o.dispatch(u.store).editEntityRecord(e,t,s,{status:"publish"}),d.push(o.dispatch(u.store).saveEditedEntityRecord(e,t,s)))})),c.length&&d.push(o.dispatch(u.store).__experimentalSaveSpecifiedEntityEdits("root","site",void 0,c)),o.dispatch(g.store).__unstableMarkLastChangeAsPersistent(),Promise.all(d).then((t=>e?e(t):t)).then((e=>{e.some((e=>void 0===e))?o.dispatch(_s.store).createErrorNotice((0,fs.__)("Saving failed.")):o.dispatch(_s.store).createSuccessNotice((0,fs.__)("Site updated."),{type:"snackbar",id:i,actions:[{label:(0,fs.__)("View site"),url:a,openInNewTab:!0}]})})).catch((e=>o.dispatch(_s.store).createErrorNotice(`${(0,fs.__)("Saving failed.")} $e}`)))},Xl=(e,{allowUndo:t=!0}={})=>async({registry:s})=>{const n="edit-site-template-reverted";if(s.dispatch(_s.store).removeNotice(n),On(e))try{const o=s.select(u.store).getEntityConfig("postType",e.type);if(!o)return void s.dispatch(_s.store).createErrorNotice((0,fs.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const r=(0,w.addQueryArgs)(`$o.baseURL}/$e.id}`,{context:"edit",source:e.origin}),i=await gs()({path:r});if(!i)return void s.dispatch(_s.store).createErrorNotice((0,fs.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const a=({blocks:e=[]})=>(0,x.__unstableSerializeAndClean)(e),l=s.select(u.store).getEditedEntityRecord("postType",e.type,e.id);s.dispatch(u.store).editEntityRecord("postType",e.type,e.id,{content:a,blocks:l.blocks,source:"custom"},{undoIgnore:!0});const c=(0,x.parse)(i?.content?.raw);if(s.dispatch(u.store).editEntityRecord("postType",e.type,i.id,{content:a,blocks:c,source:"theme"}),t){const t=()=>{s.dispatch(u.store).editEntityRecord("postType",e.type,l.id,{content:a,blocks:l.blocks,source:"custom"})};s.dispatch(_s.store).createSuccessNotice((0,fs.__)("Template reset."),{type:"snackbar",id:n,actions:[{label:(0,fs.__)("Undo"),onClick:t}]})}}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("Template revert failed. Please reload.");s.dispatch(_s.store).createErrorNotice(t,{type:"snackbar"})}else s.dispatch(_s.store).createErrorNotice((0,fs.__)("This template is not revertable."),{type:"snackbar"})},Jl=e=>async({registry:t})=>{const s=e.every((e=>e?.has_theme_file)),n=await Promise.allSettled(e.map((e=>t.dispatch(u.store).deleteEntityRecord("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(n.every((({status:e})=>"fulfilled"===e))){let n;if(1===e.length){let t;"string"==typeof e[0].title?t=e[0].title:"string"==typeof e[0].title?.rendered?t=e[0].title?.rendered:"string"==typeof e[0].title?.raw&&(t=e[0].title?.raw),n=s?(0,fs.sprintf)((0,fs.__)('"%s" reset.'),(0,Ln.decodeEntities)(t)):(0,fs.sprintf)((0,fs._x)('"%s" deleted.',"template part"),(0,Ln.decodeEntities)(t))}else n=s?(0,fs.__)("Items reset."):(0,fs.__)("Items deleted.");t.dispatch(_s.store).createSuccessNotice(n,{type:"snackbar",id:"editor-template-deleted-success"})}else{let e;if(1===n.length)e=n[0].reason?.message?n[0].reason.message:s?(0,fs.__)("An error occurred while reverting the item."):(0,fs.__)("An error occurred while deleting the item.");else{const t=new Set,o=n.filter((({status:e})=>"rejected"===e));for(const e of o)e.reason?.message&&t.add(e.reason.message);e=0===t.size?(0,fs.__)("An error occurred while deleting the items."):1===t.size?s?(0,fs.sprintf)((0,fs.__)("An error occurred while reverting the items: %s"),[...t][0]):(0,fs.sprintf)((0,fs.__)("An error occurred while deleting the items: %s"),[...t][0]):s?(0,fs.sprintf)((0,fs.__)("Some errors occurred while reverting the items: %s"),[...t].join(",")):(0,fs.sprintf)((0,fs.__)("Some errors occurred while deleting the items: %s"),[...t].join(","))}t.dispatch(_s.store).createErrorNotice(e,{type:"snackbar"})}},ec=e=>({select:t,registry:s})=>{const n=t.getCurrentPostType(),o=s.select(u.store).getCurrentTheme()?.stylesheet,r=s.select(C.store).get("core","renderingModes")?.[o]??{};if(r[n]===e)return;const i={[o]:{...r,[n]:e}};s.dispatch(C.store).set("core","renderingModes",i)};var tc=s(5215),sc=s.n(tc),nc=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.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"})}),oc=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{d:"M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"})});const rc=[];const ic={rootClientId:void 0,insertionIndex:void 0,filterValue:void 0},ac=["post-only","template-locked"],lc=(0,d.createRegistrySelector)((e=>(0,d.createSelector)((t=>{if("object"==typeof t.blockInserterPanel)return t.blockInserterPanel;if("template-locked"===st(t)){const[t]=e(g.store).getBlocksByName("core/post-content");if(t)return{rootClientId:t,insertionIndex:void 0,filterValue:void 0}}return ic}),(t=>{const[s]=e(g.store).getBlocksByName("core/post-content");return[t.blockInserterPanel,st(t),s]}))));function cc(e){return e.listViewToggleRef}function dc(e){return e.inserterSidebarToggleRef}const uc={wp_block:ea,wp_navigation:nc,page:ta,post:oc},pc=(0,d.createRegistrySelector)((e=>(t,s,n)=>{{if("wp_template_part"===s||"wp_template"===s){const t=(e(u.store).getCurrentTheme()?.default_template_part_areas||[]).find((e=>n.area===e.area));return t?.icon?z(t.icon):W}if(uc[s])return uc[s];const t=e(u.store).getPostType(s);return"string"==typeof t?.icon&&t.icon.startsWith("dashicons-")?t.icon.slice(10):ta}})),mc=(0,d.createRegistrySelector)((e=>(t,s,n)=>{const{type:o,id:r}=ne(t),i=e(u.store).getEntityRecordNonTransientEdits("postType",s||o,n||r);if(!i?.meta)return!1;const a=e(u.store).getEntityRecord("postType",s||o,n||r)?.meta;return!sc()({...a,footnotes:void 0},{...i.meta,footnotes:void 0})}));function hc(e,...t){return function(e,t,s){return e.actions[t]?.[s]??rc}(e.dataviews,...t)}function gc(e,...t){return function(e,t,s){return e.isReady[t]?.[s]}(e.dataviews,...t)}function _c(e,...t){return function(e,t,s){return e.fields[t]?.[s]??rc}(e.dataviews,...t)}const fc=(0,d.createRegistrySelector)((e=>(0,d.createSelector)(((t,s)=>{s=Array.isArray(s)?s:[s];const{getBlocksByName:n,getBlockParents:o,getBlockName:r}=e(g.store);return n(s).filter((e=>o(e).every((e=>{const t=r(e);return"core/query"!==t&&!s.includes(t)}))))}),(()=>[e(g.store).getBlocks()])))),bc=(0,d.createRegistrySelector)((e=>(t,s)=>{const{getPostType:n,getCurrentTheme:o,hasFinishedResolution:r}=e(u.store),i=o(),a=n(s);if(!r("getPostType",[s])||!r("getCurrentTheme"))return;const l=i?.stylesheet,c=e(C.store).get("core","renderingModes")?.[l]?.[s],d=Array.isArray(a?.supports?.editor)?a.supports.editor.find((e=>"default-mode"in e))?.["default-mode"]:void 0,p=c||d;return ac.includes(p)?p:"post-only"})),yc={reducer:y,selectors:e,actions:t},xc=(0,d.createReduxStore)("core/editor",{...yc});(0,d.register)(xc),$(xc).registerPrivateActions(a),$(xc).registerPrivateSelectors(l);function vc(e){const t=e.avatar_urls&&e.avatar_urls[24]?(0,c.jsx)("img",{className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls[24]}):(0,c.jsx)("span",{className:"editor-autocompleters__no-avatar"});return(0,c.jsxs)(c.Fragment,{children:[t,(0,c.jsx)("span",{className:"editor-autocompleters__user-name",children:e.name}),(0,c.jsx)("span",{className:"editor-autocompleters__user-slug",children:e.slug})]})}(0,h.addFilter)("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",(function(e){const t=Object.fromEntries(Object.entries(e.attributes??{}).filter((([,{source:e}])=>"meta"===e)).map((([e,{meta:t}])=>[e,t])));return Object.entries(t).length&&(e.edit=(e=>(0,m.createHigherOrderComponent)((t=>({attributes:s,setAttributes:n,...o})=>{const r=(0,d.useSelect)((e=>e(xc).getCurrentPostType()),[]),[i,a]=(0,u.useEntityProp)("postType",r,"meta"),l=(0,p.useMemo)((()=>({...s,...Object.fromEntries(Object.entries(e).map((([e,t])=>[e,i[t]])))})),[s,i]);return(0,c.jsx)(t,{attributes:l,setAttributes:t=>{const s=Object.fromEntries(Object.entries(t??{}).filter((([t])=>t in e)).map((([t,s])=>[e[t],s])));Object.entries(s).length&&a(s),n(t)},...o})}),"withMetaAttributeSource"))(t)(e.edit)),e}));var wc={name:"users",className:"editor-autocompleters__user",triggerPrefix:"@",useItems(e){const t=(0,d.useSelect)((t=>{const{getUsers:s}=t(u.store);return s({context:"view",search:encodeURIComponent(e)})}),[e]);return[(0,p.useMemo)((()=>t?t.map((e=>({key:`user-$e.slug}`,value:e,label:vc(e)}))):[]),[t])]},getOptionCompletion:e=>`@$e.slug}`};(0,h.addFilter)("editor.Autocomplete.completers","editor/autocompleters/set-default-completers",(function(e=[]){return e.push({...wc}),e})),(0,h.addFilter)("editor.MediaUpload","core/editor/components/media-upload",(()=>cr.MediaUpload));const{PatternOverridesControls:Sc,ResetOverridesControl:kc,PatternOverridesBlockControls:Cc,PATTERN_TYPES:Pc,PARTIAL_SYNCING_SUPPORTED_BLOCKS:jc,PATTERN_SYNC_TYPES:Ec}=$(lo.privateApis),Tc=(0,m.createHigherOrderComponent)((e=>t=>{const s=!!jc[t.name];return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(e,{...t},"edit"),t.isSelected&&s&&(0,c.jsx)(Bc,{...t}),s&&(0,c.jsx)(Cc,{})]})}),"withPatternOverrideControls");function Bc(e){const t=(0,g.useBlockEditingMode)(),{hasPatternOverridesSource:s,isEditingSyncedPattern:n}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getEditedPostAttribute:s}=e(xc);return{hasPatternOverridesSource:!!(0,x.getBlockBindingsSource)("core/pattern-overrides"),isEditingSyncedPattern:t()===Pc.user&&s("meta")?.wp_pattern_sync_status!==Ec.unsynced&&s("wp_pattern_sync_status")!==Ec.unsynced}}),[]),o=e.attributes.metadata?.bindings,r=!!o&&Object.values(o).some((e=>"core/pattern-overrides"===e.source)),i=n&&"default"===t,a=!n&&!!e.attributes.metadata?.name&&"disabled"!==t&&r;return s?(0,c.jsxs)(c.Fragment,{children:[i&&(0,c.jsx)(Sc,{...e}),a&&(0,c.jsx)(kc,{...e})]}):null}(0,h.addFilter)("editor.BlockEdit","core/editor/with-pattern-override-controls",Tc);const Ic=["core/navigation-link","core/navigation-submenu"];function Nc({attributes:e}){const{kind:t,id:s,type:n}=e,o=(0,g.useBlockEditingMode)(),r=(0,d.useSelect)((e=>e(g.store).getSettings().onNavigateToEntityRecord),[]),i=(0,p.useCallback)((()=>{"post-type"===t&&"page"===n&&s&&r&&r({postId:s,postType:n})}),[t,s,n,r]);return"post-type"===t&&"page"===n&&s&&r&&"contentOnly"===o?(0,c.jsx)(g.__unstableBlockToolbarLastItem,{children:(0,c.jsx)(Fn.ToolbarGroup,{children:(0,c.jsx)(Fn.ToolbarButton,{name:"view",title:(0,fs.__)("View"),onClick:i,children:(0,fs.__)("View")})})}):null}const Rc=(0,m.createHigherOrderComponent)((e=>t=>{const s=Ic.includes(t.name);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(e,{...t},"edit"),t.isSelected&&s&&(0,c.jsx)(Nc,{...t})]})}),"withNavigationViewButton");(0,h.addFilter)("editor.BlockEdit","core/editor/with-navigation-view-button",Rc);function Dc({clientId:e}){const{selectBlock:t,flashBlock:s}=(0,d.useDispatch)(g.store),{enableComplementaryArea:n}=(0,d.useDispatch)(Ea),{hasNavigationBlocks:o,firstNavigationBlockId:r,isNavigationEditable:i}=(0,d.useSelect)((t=>{const{getClientIdsOfDescendants:s,getBlockName:n,getBlockEditingMode:o}=t(g.store),r=s(e).filter((e=>"core/navigation"===n(e))),i=r.length>0,a=i?r[0]:null;return{hasNavigationBlocks:i,firstNavigationBlockId:a,isNavigationEditable:"disabled"!==o(a)}}),[e]),a=(0,p.useCallback)((()=>{r&&(t(r),s(r,500),n("core","edit-post/block"))}),[r,t,s,n]);return o&&i?(0,c.jsx)(g.BlockControls,{group:"other",children:(0,c.jsxs)(Fn.ToolbarGroup,{children:[(0,c.jsx)(Fn.__experimentalDivider,{orientation:"vertical",marginEnd:3}),(0,c.jsx)(Fn.ToolbarButton,{label:(0,fs.__)("Edit navigation"),onClick:a,children:(0,fs.__)("Edit navigation")})]})}):null}const Ac=(0,m.createHigherOrderComponent)((e=>t=>{const s="core/template-part"===t.name;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(e,{...t},"edit"),t.isSelected&&s&&(0,c.jsx)(Dc,{clientId:t.clientId})]})}),"withTemplatePartNavigationEditButton");(0,h.addFilter)("editor.BlockEdit","core/editor/with-template-part-navigation-edit-button",Ac);class Mc extends p.Component{constructor(e){super(e),this.needsAutosave=!(!e.isDirty||!e.isAutosaveable)}componentDidMount(){this.props.disableIntervalChecks||this.setAutosaveTimer()}componentDidUpdate(e){this.props.disableIntervalChecks?this.props.editsReference!==e.editsReference&&this.props.autosave():(this.props.interval!==e.interval&&(clearTimeout(this.timerId),this.setAutosaveTimer()),this.props.isDirty&&(!this.props.isAutosaving||e.isAutosaving)?this.props.editsReference!==e.editsReference&&(this.needsAutosave=!0):this.needsAutosave=!1)}componentWillUnmount(){clearTimeout(this.timerId)}setAutosaveTimer(e=1e3*this.props.interval){this.timerId=setTimeout((()=>{this.autosaveTimerHandler()}),e)}autosaveTimerHandler(){this.props.isAutosaveable?(this.needsAutosave&&(this.needsAutosave=!1,this.props.autosave()),this.setAutosaveTimer()):this.setAutosaveTimer(1e3)}render(){return null}}var Lc=(0,m.compose)([(0,d.withSelect)(((e,t)=>{const{getReferenceByDistinctEdits:s}=e(u.store),{isEditedPostDirty:n,isEditedPostAutosaveable:o,isAutosavingPost:r,getEditorSettings:i}=e(xc),{interval:a=i().autosaveInterval}=t;return{editsReference:s(),isDirty:n(),isAutosaveable:o(),isAutosaving:r(),interval:a}})),(0,d.withDispatch)(((e,t)=>({autosave(){const{autosave:s=e(xc).autosave}=t;s()}})))])(Mc),Oc=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})}),Fc=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})});const Vc=window.wp.dom;function Uc(e){const{isFrontPage:t,isPostsPage:s}=(0,d.useSelect)((t=>{const{canUser:s,getEditedEntityRecord:n}=t(u.store),o=s("read",{kind:"root",name:"site"})?n("root","site"):void 0,r=parseInt(e,10);return{isFrontPage:o?.page_on_front===r,isPostsPage:o?.page_for_posts===r}}));return t?(0,fs.__)("Homepage"):!!s&&(0,fs.__)("Posts Page")}const zc=Fn.__unstableMotion.create(Fn.Button);function Hc(e){const{postId:t,postType:s,postTypeLabel:n,documentTitle:o,isNotFound:r,templateTitle:i,onNavigateToPreviousEntityRecord:a,isTemplatePreview:l}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s,getEditorSettings:n,getRenderingMode:o}=e(xc),{getEditedEntityRecord:r,getPostType:i,getCurrentTheme:a,isResolving:l}=e(u.store),c=t(),d=s(),p=r("postType",c,d),{default_template_types:m=[]}=a()??{},h=Y({templateTypes:m,template:p}),g=i(c)?.labels?.singular_name;return{postId:d,postType:c,postTypeLabel:g,documentTitle:p.title,isNotFound:!p&&!l("getEditedEntityRecord","postType",c,d),templateTitle:h.title,onNavigateToPreviousEntityRecord:n().onNavigateToPreviousEntityRecord,isTemplatePreview:"template-locked"===o()}}),[]),{open:h}=(0,d.useDispatch)(oa.store),_=(0,m.useReducedMotion)(),f=A.includes(s),b=!!a,y=f?i:o,x=e.title||y,v=e.icon,w=Uc(t),S=(0,p.useRef)(!1);return(0,p.useEffect)((()=>{S.current=!0}),[]),(0,c.jsxs)("div",{className:hr("editor-document-bar",{"has-back-button":b}),children:[(0,c.jsx)(Fn.__unstableAnimatePresence,{children:b&&(0,c.jsx)(zc,{className:"editor-document-bar__back",icon:(0,fs.isRTL)()?Oc:Fc,onClick:e=>{e.stopPropagation(),a()},size:"compact",initial:!!S.current&&{opacity:0,transform:"translateX(15%)"},animate:{opacity:1,transform:"translateX(0%)"},exit:{opacity:0,transform:"translateX(15%)"},transition:_?{duration:0}:void 0,children:(0,fs.__)("Back")})}),!f&&l&&!b&&(0,c.jsx)(g.BlockIcon,{icon:W,className:"editor-document-bar__icon-layout"}),r?(0,c.jsx)(Fn.__experimentalText,{children:(0,fs.__)("Document not found")}):(0,c.jsxs)(Fn.Button,{className:"editor-document-bar__command",onClick:()=>h(),size:"compact",children:[(0,c.jsxs)(Fn.__unstableMotion.div,{className:"editor-document-bar__title",initial:!!S.current&&{opacity:0,transform:b?"translateX(15%)":"translateX(-15%)"},animate:{opacity:1,transform:"translateX(0%)"},transition:_?{duration:0}:void 0,children:[v&&(0,c.jsx)(g.BlockIcon,{icon:v}),(0,c.jsxs)(Fn.__experimentalText,{size:"body",as:"h1",children:[(0,c.jsx)("span",{className:"editor-document-bar__post-title",children:x?(0,Vc.__unstableStripHTML)(x):(0,fs.__)("No title")}),w&&(0,c.jsx)("span",{className:"editor-document-bar__post-type-label",children:`· $w}`}),n&&!e.title&&!w&&(0,c.jsx)("span",{className:"editor-document-bar__post-type-label",children:`· ${(0,Ln.decodeEntities)(n)}`})]})]},b),(0,c.jsx)("span",{className:"editor-document-bar__shortcut",children:cl.displayShortcut.primary("k")})]})]})}const Gc=window.wp.richText;var $c=({children:e,isValid:t,isDisabled:s,level:n,href:o,onSelect:r})=>(0,c.jsx)("li",{className:hr("document-outline__item",`is-$n.toLowerCase()}`,{"is-invalid":!t,"is-disabled":s}),children:(0,c.jsxs)("a",{href:o,className:"document-outline__button","aria-disabled":s,onClick:function(e){s?e.preventDefault():r()},children:[(0,c.jsx)("span",{className:"document-outline__emdash","aria-hidden":"true"}),(0,c.jsx)("strong",{className:"document-outline__level",children:n}),(0,c.jsx)("span",{className:"document-outline__item-content",children:e})]})});const Wc=(0,c.jsx)("em",{children:(0,fs.__)("(Empty heading)")}),Zc=[(0,c.jsx)("br",{},"incorrect-break"),(0,c.jsx)("em",{children:(0,fs.__)("(Incorrect heading level)")},"incorrect-message")],Yc=[(0,c.jsx)("br",{},"incorrect-break-h1"),(0,c.jsx)("em",{children:(0,fs.__)("(Your theme may already use a H1 for the post title)")},"incorrect-message-h1")],qc=[(0,c.jsx)("br",{},"incorrect-break-multiple-h1"),(0,c.jsx)("em",{children:(0,fs.__)("(Multiple H1 headings are not recommended)")},"incorrect-message-multiple-h1")];function Kc(){return(0,c.jsxs)(Fn.SVG,{width:"138",height:"148",viewBox:"0 0 138 148",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,c.jsx)(Fn.Rect,{width:"138",height:"148",rx:"4",fill:"#F0F6FC"}),(0,c.jsx)(Fn.Line,{x1:"44",y1:"28",x2:"24",y2:"28",stroke:"#DDDDDD"}),(0,c.jsx)(Fn.Rect,{x:"48",y:"16",width:"27",height:"23",rx:"4",fill:"#DDDDDD"}),(0,c.jsx)(Fn.Path,{d:"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z",fill:"black"}),(0,c.jsx)(Fn.Line,{x1:"55",y1:"59",x2:"24",y2:"59",stroke:"#DDDDDD"}),(0,c.jsx)(Fn.Rect,{x:"59",y:"47",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,c.jsx)(Fn.Path,{d:"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z",fill:"black"}),(0,c.jsx)(Fn.Line,{x1:"80",y1:"90",x2:"24",y2:"90",stroke:"#DDDDDD"}),(0,c.jsx)(Fn.Rect,{x:"84",y:"78",width:"30",height:"23",rx:"4",fill:"#F0B849"}),(0,c.jsx)(Fn.Path,{d:"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z",fill:"black"}),(0,c.jsx)(Fn.Line,{x1:"66",y1:"121",x2:"24",y2:"121",stroke:"#DDDDDD"}),(0,c.jsx)(Fn.Rect,{x:"70",y:"109",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,c.jsx)(Fn.Path,{d:"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z",fill:"black"})]})}const Qc=(e=[])=>e.filter((e=>"core/heading"===e.name)).map((e=>({...e,level:e.attributes.level,isEmpty:Xc(e)}))),Xc=e=>!e.attributes.content||0===e.attributes.content.trim().length;function Jc({onSelect:e,hasOutlineItemsDisabled:t}){const{selectBlock:s}=(0,d.useDispatch)(g.store),{title:n,isTitleSupported:o}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(xc),{getPostType:s}=e(u.store),n=s(t("type"));return{title:t("title"),isTitleSupported:n?.supports?.title??!1}})),r=(0,d.useSelect)((e=>{const{getClientIdsWithDescendants:t,getBlock:s}=e(g.store);return t().map((e=>s(e)))})),i=(0,d.useSelect)((e=>{if("post-only"===e(xc).getRenderingMode())return;const{getBlocksByName:t,getClientIdsOfDescendants:s}=e(g.store),[n]=t("core/post-content");return n?s(n):void 0}),[]),a=(0,p.useRef)(1),l=(0,p.useMemo)((()=>Qc(r)),[r]);if(l.length<1)return(0,c.jsxs)("div",{className:"editor-document-outline has-no-headings",children:[(0,c.jsx)(Kc,{}),(0,c.jsx)("p",{children:(0,fs.__)("Navigate the structure of your document and address issues like empty or incorrect heading levels.")})]});const m=document.querySelector(".editor-post-title__input"),h=o&&n&&m,_=l.reduce(((e,t)=>({...e,[t.level]:(e[t.level]||0)+1})),{})[1]>1;return(0,c.jsx)("div",{className:"document-outline",children:(0,c.jsxs)("ul",{children:[h&&(0,c.jsx)($c,{level:(0,fs.__)("Title"),isValid:!0,onSelect:e,href:`#$m.id}`,isDisabled:t,children:n}),l.map((n=>{const o=n.level>a.current+1,r=!(n.isEmpty||o||!n.level||1===n.level&&(_||h));return a.current=n.level,(0,c.jsxs)($c,{level:`H$n.level}`,isValid:r,isDisabled:t||(l=n.clientId,!(!Array.isArray(i)||i.includes(l))),href:`#block-$n.clientId}`,onSelect:()=>{s(n.clientId),e?.()},children:[n.isEmpty?Wc:(0,Gc.getTextContent)((0,Gc.create)({html:n.attributes.content})),o&&Zc,1===n.level&&_&&qc,h&&1===n.level&&!_&&Yc]},n.clientId);var l}))]})})}function ed({children:e}){const t=(0,d.useSelect)((e=>{const{getGlobalBlockCount:t}=e(g.store);return t("core/heading")>0}));return t?e:null}var td=function(){const{registerShortcut:e}=(0,d.useDispatch)(al.store);return(0,p.useEffect)((()=>{e({name:"core/editor/toggle-mode",category:"global",description:(0,fs.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}}),e({name:"core/editor/save",category:"global",description:(0,fs.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/editor/undo",category:"global",description:(0,fs.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/editor/redo",category:"global",description:(0,fs.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,cl.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/editor/toggle-list-view",category:"global",description:(0,fs.__)("Show or hide the List View."),keyCombination:{modifier:"access",character:"o"}}),e({name:"core/editor/toggle-distraction-free",category:"global",description:(0,fs.__)("Enter or exit distraction free mode."),keyCombination:{modifier:"primaryShift",character:"\\"}}),e({name:"core/editor/toggle-sidebar",category:"global",description:(0,fs.__)("Show or hide the Settings panel."),keyCombination:{modifier:"primaryShift",character:","}}),e({name:"core/editor/keyboard-shortcuts",category:"main",description:(0,fs.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/editor/next-region",category:"global",description:(0,fs.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/editor/previous-region",category:"global",description:(0,fs.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]})}),[e]),(0,c.jsx)(g.BlockEditorKeyboardShortcuts.Register,{})},sd=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"})}),nd=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"})});var od=(0,p.forwardRef)((function(e,t){const s=(0,cl.isAppleOS)()?cl.displayShortcut.primaryShift("z"):cl.displayShortcut.primary("y"),n=(0,d.useSelect)((e=>e(xc).hasEditorRedo()),[]),{redo:o}=(0,d.useDispatch)(xc);return(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,...e,ref:t,icon:(0,fs.isRTL)()?nd:sd,label:(0,fs.__)("Redo"),shortcut:s,"aria-disabled":!n,onClick:n?o:void 0,className:"editor-history__redo"})}));var rd=(0,p.forwardRef)((function(e,t){const s=(0,d.useSelect)((e=>e(xc).hasEditorUndo()),[]),{undo:n}=(0,d.useDispatch)(xc);return(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,...e,ref:t,icon:(0,fs.isRTL)()?sd:nd,label:(0,fs.__)("Undo"),shortcut:cl.displayShortcut.primary("z"),"aria-disabled":!s,onClick:s?n:void 0,className:"editor-history__undo"})}));function id(){const[e,t]=(0,p.useState)(!1),s=(0,d.useSelect)((e=>e(g.store).isValidTemplate()),[]),{setTemplateValidity:n,synchronizeTemplate:o}=(0,d.useDispatch)(g.store);return s?null:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Fn.Notice,{className:"editor-template-validation-notice",isDismissible:!1,status:"warning",actions:[{label:(0,fs.__)("Keep it as is"),onClick:()=>n(!0)},{label:(0,fs.__)("Reset the template"),onClick:()=>t(!0)}],children:(0,fs.__)("The content of your post doesn’t match the template assigned to your post type.")}),(0,c.jsx)(Fn.__experimentalConfirmDialog,{isOpen:e,confirmButtonText:(0,fs.__)("Reset"),onConfirm:()=>{t(!1),o()},onCancel:()=>t(!1),size:"medium",children:(0,fs.__)("Resetting the template may result in loss of content, do you want to continue?")})]})}var ad=function(){const{notices:e}=(0,d.useSelect)((e=>({notices:e(_s.store).getNotices()})),[]),{removeNotice:t}=(0,d.useDispatch)(_s.store),s=e.filter((({isDismissible:e,type:t})=>e&&"default"===t)),n=e.filter((({isDismissible:e,type:t})=>!e&&"default"===t));return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Fn.NoticeList,{notices:n,className:"components-editor-notices__pinned"}),(0,c.jsx)(Fn.NoticeList,{notices:s,className:"components-editor-notices__dismissible",onRemove:t,children:(0,c.jsx)(id,{})})]})};const ld=-3;function cd(){const e=(0,d.useSelect)((e=>e(_s.store).getNotices()),[]),{removeNotice:t}=(0,d.useDispatch)(_s.store),s=e.filter((({type:e})=>"snackbar"===e)).slice(ld);return(0,c.jsx)(Fn.SnackbarList,{notices:s,className:"components-editor-notices__snackbar",onRemove:t})}function dd({record:e,checked:t,onChange:s}){const{name:n,kind:o,title:r,key:i}=e,{entityRecordTitle:a,hasPostMetaChanges:l}=(0,d.useSelect)((e=>{if("postType"!==o||"wp_template"!==n)return{entityRecordTitle:r,hasPostMetaChanges:$(e(xc)).hasPostMetaChanges(n,i)};const t=e(u.store).getEditedEntityRecord(o,n,i),{default_template_types:s=[]}=e(u.store).getCurrentTheme()??{};return{entityRecordTitle:Y({template:t,templateTypes:s}).title,hasPostMetaChanges:$(e(xc)).hasPostMetaChanges(n,i)}}),[n,o,r,i]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Fn.PanelRow,{children:(0,c.jsx)(Fn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,Ln.decodeEntities)(a)||(0,fs.__)("Untitled"),checked:t,onChange:s,className:"entities-saved-states__change-control"})}),l&&(0,c.jsx)("ul",{className:"entities-saved-states__changes",children:(0,c.jsx)("li",{children:(0,fs.__)("Post Meta.")})})]})}const{getGlobalStylesChanges:ud,GlobalStylesContext:pd}=$(g.privateApis);function md({record:e}){const{user:t}=(0,p.useContext)(pd),s=(0,d.useSelect)((t=>t(u.store).getEntityRecord(e.kind,e.name,e.key)),[e.kind,e.name,e.key]),n=ud(t,s,{maxResults:10});return n.length?(0,c.jsx)("ul",{className:"entities-saved-states__changes",children:n.map((e=>(0,c.jsx)("li",{children:e},e)))}):null}function hd({record:e,count:t}){if("globalStyles"===e?.name)return null;const s=function(e,t){switch(e){case"site":return 1===t?(0,fs.__)("This change will affect your whole site."):(0,fs.__)("These changes will affect your whole site.");case"wp_template":return(0,fs.__)("This change will affect other parts of your site that use this template.");case"page":case"post":return(0,fs.__)("The following has been modified.")}}(e?.name,t);return s?(0,c.jsx)(Fn.PanelRow,{children:s}):null}function gd({list:e,unselectedEntities:t,setUnselectedEntities:s}){const n=e.length,o=e[0];let r=(0,d.useSelect)((e=>e(u.store).getEntityConfig(o.kind,o.name)),[o.kind,o.name]).label;return"wp_template_part"===o?.name&&(r=1===n?(0,fs.__)("Template Part"):(0,fs.__)("Template Parts")),(0,c.jsxs)(Fn.PanelBody,{title:r,initialOpen:!0,className:"entities-saved-states__panel-body",children:[(0,c.jsx)(hd,{record:o,count:n}),e.map((e=>(0,c.jsx)(dd,{record:e,checked:!t.some((t=>t.kind===e.kind&&t.name===e.name&&t.key===e.key&&t.property===e.property)),onChange:t=>s(e,t)},e.key||e.property))),"globalStyles"===o?.name&&(0,c.jsx)(md,{record:o})]})}const _d=()=>{const{editedEntities:e,siteEdits:t,siteEntityConfig:s}=(0,d.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,getEntityRecordEdits:s,getEntityConfig:n}=e(u.store);return{editedEntities:t(),siteEdits:s("root","site"),siteEntityConfig:n("root","site")}}),[]),n=(0,p.useMemo)((()=>{const n=e.filter((e=>!("root"===e.kind&&"site"===e.name))),o=s?.meta?.labels??{},r=[];for(const e in t)r.push({kind:"root",name:"site",title:o[e]||e,property:e});return[...n,...r]}),[e,t,s]),[o,r]=(0,p.useState)([]);return{dirtyEntityRecords:n,isDirty:n.length-o.length>0,setUnselectedEntities:({kind:e,name:t,key:s,property:n},i)=>{r(i?o.filter((o=>o.kind!==e||o.name!==t||o.key!==s||o.property!==n)):[...o,{kind:e,name:t,key:s,property:n}])},unselectedEntities:o}};function fd(e){return e}function bd({close:e,renderDialog:t,variant:s}){const n=_d();return(0,c.jsx)(yd,{close:e,renderDialog:t,variant:s,...n})}function yd({additionalPrompt:e,close:t,onSave:s=fd,saveEnabled:n,saveLabel:o=(0,fs.__)("Save"),renderDialog:r,dirtyEntityRecords:i,isDirty:a,setUnselectedEntities:l,unselectedEntities:u,variant:h="default"}){const g=(0,p.useRef)(),{saveDirtyEntities:_}=$((0,d.useDispatch)(xc)),f=i.reduce(((e,t)=>{const{name:s}=t;return e[s]||(e[s]=[]),e[s].push(t),e}),{}),{site:b,wp_template:y,wp_template_part:x,...v}=f,w=[b,y,x,...Object.values(v)].filter(Array.isArray),S=n??a,k=(0,p.useCallback)((()=>t()),[t]),[C,P]=(0,m.__experimentalUseDialog)({onClose:()=>k()}),j=(0,m.useInstanceId)(yd,"entities-saved-states__panel-label"),E=(0,m.useInstanceId)(yd,"entities-saved-states__panel-description"),T=i.length?(0,fs.__)("Select the items you want to save."):void 0,B="inline"===h,I=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Fn.FlexItem,{isBlock:!B,as:Fn.Button,variant:B?"tertiary":"secondary",size:B?void 0:"compact",onClick:k,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Fn.FlexItem,{isBlock:!B,as:Fn.Button,ref:g,variant:"primary",size:B?void 0:"compact",disabled:!S,accessibleWhenDisabled:!0,onClick:()=>_({onSave:s,dirtyEntityRecords:i,entitiesToSkip:u,close:t}),className:"editor-entities-saved-states__save-button",children:o})]});return(0,c.jsxs)("div",{ref:r?C:void 0,...r&&P,className:hr("entities-saved-states__panel",{"is-inline":B}),role:r?"dialog":void 0,"aria-labelledby":r?j:void 0,"aria-describedby":r?E:void 0,children:[!B&&(0,c.jsx)(Fn.Flex,{className:"entities-saved-states__panel-header",gap:2,children:I}),(0,c.jsxs)("div",{className:"entities-saved-states__text-prompt",children:[(0,c.jsx)("div",{className:"entities-saved-states__text-prompt--header-wrapper",children:(0,c.jsx)("strong",{id:r?j:void 0,className:"entities-saved-states__text-prompt--header",children:(0,fs.__)("Are you ready to save?")})}),(0,c.jsxs)("div",{id:r?E:void 0,children:[e,(0,c.jsx)("p",{className:"entities-saved-states__text-prompt--changes-count",children:a?(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs._n)("There is <strong>%d site change</strong> waiting to be saved.","There are <strong>%d site changes</strong> waiting to be saved.",i.length),i.length),{strong:(0,c.jsx)("strong",{})}):T})]})]}),w.map((e=>(0,c.jsx)(gd,{list:e,unselectedEntities:u,setUnselectedEntities:l},e[0].name))),B&&(0,c.jsx)(Fn.Flex,{direction:"row",justify:"flex-end",className:"entities-saved-states__panel-footer",children:I})]})}function xd(){try{return(0,d.select)(xc).getEditedPostContent()}catch(e){}}function vd({text:e,children:t,variant:s="secondary"}){const n=(0,m.useCopyToClipboard)(e);return(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:s,ref:n,children:t})}class wd extends p.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){(0,h.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}render(){const{error:e}=this.state,{canCopyContent:t=!1}=this.props;return e?(0,c.jsxs)(Fn.__experimentalHStack,{className:"editor-error-boundary",alignment:"baseline",spacing:4,justify:"space-between",expanded:!1,wrap:!0,children:[(0,c.jsx)(Fn.__experimentalText,{as:"p",children:(0,fs.__)("The editor has encountered an unexpected error.")}),(0,c.jsxs)(Fn.__experimentalHStack,{expanded:!1,children:[t&&(0,c.jsx)(vd,{text:xd,children:(0,fs.__)("Copy contents")}),(0,c.jsx)(vd,{variant:"primary",text:e?.stack,children:(0,fs.__)("Copy error")})]})]}):this.props.children}}var Sd=wd;const kd=window.requestIdleCallback?window.requestIdleCallback:window.requestAnimationFrame;let Cd;function Pd(){const{postId:e,isEditedPostNew:t,hasRemoteAutosave:s}=(0,d.useSelect)((e=>({postId:e(xc).getCurrentPostId(),isEditedPostNew:e(xc).isEditedPostNew(),hasRemoteAutosave:!!e(xc).getEditorSettings().autosave})),[]),{getEditedPostAttribute:n}=(0,d.useSelect)(xc),{createWarningNotice:o,removeNotice:r}=(0,d.useDispatch)(_s.store),{editPost:i,resetEditorBlocks:a}=(0,d.useDispatch)(xc);(0,p.useEffect)((()=>{let l=function(e,t){return window.sessionStorage.getItem(bs(e,t))}(e,t);if(!l)return;try{l=JSON.parse(l)}catch{return}const{post_title:c,content:d,excerpt:u}=l,p={title:c,content:d,excerpt:u};if(!Object.keys(p).some((e=>p[e]!==n(e))))return void ys(e,t);if(s)return;const m="wpEditorAutosaveRestore";o((0,fs.__)("The backup of this post in your browser is different from the version below."),{id:m,actions:[{label:(0,fs.__)("Restore the backup"),onClick(){const{content:e,...t}=p;i(t),a((0,x.parse)(p.content)),r(m)}}]})}),[t,e])}var jd=(0,m.ifCondition)((()=>{if(void 0!==Cd)return Cd;try{window.sessionStorage.setItem("__wpEditorTestSessionStorage",""),window.sessionStorage.removeItem("__wpEditorTestSessionStorage"),Cd=!0}catch{Cd=!1}return Cd}))((function(){const{autosave:e}=(0,d.useDispatch)(xc),t=(0,p.useCallback)((()=>{kd((()=>e({local:!0})))}),[]);Pd(),function(){const{postId:e,isEditedPostNew:t,isDirty:s,isAutosaving:n,didError:o}=(0,d.useSelect)((e=>({postId:e(xc).getCurrentPostId(),isEditedPostNew:e(xc).isEditedPostNew(),isDirty:e(xc).isEditedPostDirty(),isAutosaving:e(xc).isAutosavingPost(),didError:e(xc).didPostSaveRequestFail()})),[]),r=(0,p.useRef)(s),i=(0,p.useRef)(n);(0,p.useEffect)((()=>{!o&&(i.current&&!n||r.current&&!s)&&ys(e,t),r.current=s,i.current=n}),[s,n,o]);const a=(0,m.usePrevious)(t),l=(0,m.usePrevious)(e);(0,p.useEffect)((()=>{l===e&&a&&!t&&ys(e,!0)}),[t,e])}();const s=(0,d.useSelect)((e=>e(xc).getEditorSettings().localAutosaveInterval),[]);return(0,c.jsx)(Lc,{interval:s,autosave:t})}));var Ed=function({children:e}){const t=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(xc),{getPostType:s}=e(u.store),n=s(t("type"));return!!n?.supports?.["page-attributes"]}),[]);return t?e:null};var Td=function({children:e,supportKeys:t}){const s=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(xc),{getPostType:s}=e(u.store);return s(t("type"))}),[]);let n=!!s;return s&&(n=(Array.isArray(t)?t:[t]).some((e=>function(e={},t){if(void 0!==e[t])return!!e[t];const[s,n]=t.split("."),[o]=Array.isArray(e[s])?e[s]:[];return Array.isArray(o)?o.includes(n):!!o?.[n]}(s.supports,e)))),n?e:null};function Bd(){const e=(0,d.useSelect)((e=>e(xc).getEditedPostAttribute("menu_order")??0),[]),{editPost:t}=(0,d.useDispatch)(xc),[s,n]=(0,p.useState)(null),o=s??e;return(0,c.jsx)(Fn.Flex,{children:(0,c.jsx)(Fn.FlexBlock,{children:(0,c.jsx)(Fn.__experimentalNumberControl,{__next40pxDefaultSize:!0,label:(0,fs.__)("Order"),help:(0,fs.__)("Set the page order."),value:o,onChange:e=>{n(e);const s=Number(e);Number.isInteger(s)&&""!==e.trim?.()&&t({menu_order:s})},hideLabelFromVision:!0,onBlur:()=>{n(null)}})})})}function Id(){return(0,c.jsx)(Td,{supportKeys:"page-attributes",children:(0,c.jsx)(Bd,{})})}var Nd=(0,p.forwardRef)((({className:e,label:t,children:s},n)=>(0,c.jsxs)(Fn.__experimentalHStack,{className:hr("editor-post-panel__row",e),ref:n,children:[t&&(0,c.jsx)("div",{className:"editor-post-panel__row-label",children:t}),(0,c.jsx)("div",{className:"editor-post-panel__row-control",children:s})]})));function Rd(e){const t=e.map((e=>({children:[],parent:void 0,...e})));if(t.some((({parent:e})=>void 0===e)))return t;const s=t.reduce(((e,t)=>{const{parent:s}=t;return e[s]||(e[s]=[]),e[s].push(t),e}),{}),n=e=>e.map((e=>{const t=s[e.id];return{...e,children:t&&t.length?n(t):[]}}));return n(s[0]||[])}const Dd=e=>(0,Ln.decodeEntities)(e),Ad=e=>({...e,name:Dd(e.name)}),Md=e=>(e??[]).map(Ad);function Ld(e){return e?.title?.rendered?(0,Ln.decodeEntities)(e.title.rendered):`#$e.id} (${(0,fs.__)("no title")})`}const Od=(e,t)=>{const s=Lr()(e||"").toLowerCase(),n=Lr()(t||"").toLowerCase();return s===n?0:s.startsWith(n)?s.length:1/0};function Fd(){const{editPost:e}=(0,d.useDispatch)(xc),[t,s]=(0,p.useState)(!1),{isHierarchical:n,parentPostId:o,parentPostTitle:r,pageItems:i,isLoading:a}=(0,d.useSelect)((e=>{const{getPostType:s,getEntityRecords:n,getEntityRecord:o,isResolving:r}=e(u.store),{getCurrentPostId:i,getEditedPostAttribute:a}=e(xc),l=a("type"),c=a("parent"),d=s(l),p=i(),m=d?.hierarchical??!1,h={per_page:100,exclude:p,parent_exclude:p,orderby:"menu_order",order:"asc",_fields:"id,title,parent"};t&&(h.search=t);const g=c?o("postType",l,c):null;return{isHierarchical:m,parentPostId:c,parentPostTitle:g?Ld(g):"",pageItems:m?n("postType",l,h):null,isLoading:!!m&&r("getEntityRecords",["postType",l,h])}}),[t]),l=(0,p.useMemo)((()=>{const e=(s,n=0)=>{const o=s.map((t=>[{value:t.id,label:"— ".repeat(n)+(0,Ln.decodeEntities)(t.name),rawName:t.name},...e(t.children||[],n+1)])).sort((([e],[s])=>Od(e.rawName,t)>=Od(s.rawName,t)?1:-1));return o.flat()};if(!i)return[];let s=i.map((e=>({id:e.id,parent:e.parent,name:Ld(e)})));t||(s=Rd(s));const n=e(s),a=n.find((e=>e.value===o));return r&&!a&&n.unshift({value:o,label:r}),n}),[i,t,r,o]);if(!n)return null;return(0,c.jsx)(Fn.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"editor-page-attributes__parent",label:(0,fs.__)("Parent"),help:(0,fs.__)("Choose a parent page."),value:o,options:l,onFilterValueChange:(0,m.debounce)((e=>{s(e)}),300),onChange:t=>{e({parent:t})},hideLabelFromVision:!0,isLoading:a})}function Vd({isOpen:e,onClick:t}){const s=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(xc),s=t("parent");if(!s)return null;const{getEntityRecord:n}=e(u.store);return n("postType",t("type"),s)}),[]),n=(0,p.useMemo)((()=>s?Ld(s):(0,fs.__)("None")),[s]);return(0,c.jsx)(Fn.Button,{size:"compact",className:"editor-post-parent__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change parent: %s"),n),onClick:t,children:n})}function Ud(){const e=(0,d.useSelect)((e=>e(u.store).getEntityRecord("root","__unstableBase")?.home),[]),[t,s]=(0,p.useState)(null),n=(0,p.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]);return(0,c.jsx)(Nd,{label:(0,fs.__)("Parent"),ref:s,children:(0,c.jsx)(Fn.Dropdown,{popoverProps:n,className:"editor-post-parent__panel-dropdown",contentClassName:"editor-post-parent__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(Vd,{isOpen:e,onClick:t}),renderContent:({onClose:t})=>(0,c.jsxs)("div",{className:"editor-post-parent",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Parent"),onClose:t}),(0,c.jsxs)("div",{children:[(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs.__)('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %s<wbr />/services<wbr />/pricing.'),(0,w.filterURLForDisplay)(e).replace(/([/.])/g,"<wbr />$1")),{wbr:(0,c.jsx)("wbr",{})}),(0,c.jsx)("p",{children:(0,p.createInterpolateElement)((0,fs.__)("They also show up as sub-items in the default navigation menu. <a>Learn more.</a>"),{a:(0,c.jsx)(Fn.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes")})})})]}),(0,c.jsx)(Fd,{})]})})})}var zd=Fd;const Hd="page-attributes";function Gd(){const{isEnabled:e,postType:t}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,isEditorPanelEnabled:s}=e(xc),{getPostType:n}=e(u.store);return{isEnabled:s(Hd),postType:n(t("type"))}}),[]);return e&&t?(0,c.jsx)(Ud,{}):null}function $d(){return(0,c.jsx)(Ed,{children:(0,c.jsx)(Gd,{})})}var Wd=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18.5 5.5V8H20V5.5H22.5V4H20V1.5H18.5V4H16V5.5H18.5ZM13.9624 4H6C4.89543 4 4 4.89543 4 6V18C4 19.1046 4.89543 20 6 20H18C19.1046 20 20 19.1046 20 18V10.0391H18.5V18C18.5 18.2761 18.2761 18.5 18 18.5H10L10 10.4917L16.4589 10.5139L16.4641 9.01389L5.5 8.97618V6C5.5 5.72386 5.72386 5.5 6 5.5H13.9624V4ZM5.5 10.4762V18C5.5 18.2761 5.72386 18.5 6 18.5H8.5L8.5 10.4865L5.5 10.4762Z"})});const Zd=(0,fs.__)("Custom Template");function Yd({onClose:e}){const{defaultBlockTemplate:t,onNavigateToEntityRecord:s}=(0,d.useSelect)((e=>{const{getEditorSettings:t,getCurrentTemplateId:s}=e(xc);return{defaultBlockTemplate:t().defaultBlockTemplate,onNavigateToEntityRecord:t().onNavigateToEntityRecord,getTemplateId:s}})),{createTemplate:n}=$((0,d.useDispatch)(xc)),[o,r]=(0,p.useState)(""),[i,a]=(0,p.useState)(!1),l=()=>{r(""),e()};return(0,c.jsx)(Fn.Modal,{title:(0,fs.__)("Create custom template"),onRequestClose:l,focusOnMount:"firstContentElement",size:"small",overlayClassName:"editor-post-template__create-template-modal",children:(0,c.jsx)("form",{className:"editor-post-template__create-form",onSubmit:async e=>{if(e.preventDefault(),i)return;a(!0);const r=t??(0,x.serialize)([(0,x.createBlock)("core/group",{tagName:"header",layout:{inherit:!0}},[(0,x.createBlock)("core/site-title"),(0,x.createBlock)("core/site-tagline")]),(0,x.createBlock)("core/separator"),(0,x.createBlock)("core/group",{tagName:"main"},[(0,x.createBlock)("core/group",{layout:{inherit:!0}},[(0,x.createBlock)("core/post-title")]),(0,x.createBlock)("core/post-content",{layout:{inherit:!0}})])]),c=await n({slug:eo(o||Zd)||"wp-custom-template",content:r,title:o||Zd,status:"publish"});a(!1),s({postId:c.id,postType:"wp_template"}),l()},children:(0,c.jsxs)(Fn.__experimentalVStack,{spacing:"3",children:[(0,c.jsx)(Fn.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,fs.__)("Name"),value:o,onChange:r,placeholder:Zd,disabled:i,help:(0,fs.__)('Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.')}),(0,c.jsxs)(Fn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:l,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",isBusy:i,"aria-disabled":i,children:(0,fs.__)("Create")})]})]})})})}function qd(){return(0,d.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s}=e(xc);return{postId:t(),postType:s()}}),[])}function Kd(){const{postType:e,postId:t}=qd();return(0,d.useSelect)((s=>{const{canUser:n,getEntityRecord:o,getEntityRecords:r}=s(u.store),i=n("read",{kind:"root",name:"site"})?o("root","site"):void 0,a=+t===i?.page_for_posts,l="page"===e&&+t===i?.page_on_front,c=l?r("postType","wp_template",{per_page:-1}):[],d=l&&!!c?.some((({slug:e})=>"front-page"===e));return!a&&!d}),[t,e])}function Qd(e){const{defaultTemplateTypes:t,registeredTemplates:s,userTemplates:n}=(0,d.useSelect)((t=>({defaultTemplateTypes:t(u.store).getCurrentTheme()?.default_template_types,registeredTemplates:t(u.store).getEntityRecords("postType","wp_registered_template",{per_page:-1,post_type:e}),userTemplates:t(u.store).getEntityRecords("postType","wp_template",{per_page:-1,combinedTemplates:!1})})),[e]);return(0,p.useMemo)((()=>t&&s&&n?[...s,...n.filter((e=>!e.meta.is_wp_suggestion&&!t.find((t=>t.slug===e.slug))))]:[]),[s,n,t])}function Xd(e){const t=Jd(),s=Kd(),n=Qd(e);return(0,p.useMemo)((()=>s&&n?.filter((e=>(e.is_custom||"wp_template"===e.type)&&e.slug!==t&&!!e.content.raw))),[n,t,s])}function Jd(){const{postType:e,postId:t}=qd(),s=Qd(e),n=(0,d.useSelect)((s=>{const n=s(u.store).getEditedEntityRecord("postType",e,t);return n?.template}),[e,t]);if(n)return s?.find((e=>e.slug===n))?.slug}function eu({isOpen:e,onClick:t}){const s=(0,d.useSelect)((e=>{const t=e(xc).getEditedPostAttribute("template"),{supportsTemplateMode:s,availableTemplates:n}=e(xc).getEditorSettings();if(!s&&n[t])return n[t];const o=e(u.store).canUser("create",{kind:"postType",name:"wp_template"})&&e(xc).getCurrentTemplateId();return o?.title||o?.slug||n?.[t]}),[]);return(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.__)("Template options"),onClick:t,children:s??(0,fs.__)("Default template")})}function tu({onClose:e}){const t=Kd(),{availableTemplates:s,fetchedTemplates:n,selectedTemplateSlug:o,canCreate:r,canEdit:i,currentTemplateId:a,onNavigateToEntityRecord:l,getEditorSettings:m}=(0,d.useSelect)((e=>{const{canUser:s,getEntityRecords:n}=e(u.store),o=e(xc).getEditorSettings(),r=s("create",{kind:"postType",name:"wp_template"}),i=e(xc).getCurrentTemplateId();return{availableTemplates:o.availableTemplates,fetchedTemplates:r?n("postType","wp_template",{post_type:e(xc).getCurrentPostType(),per_page:-1}):void 0,selectedTemplateSlug:e(xc).getEditedPostAttribute("template"),canCreate:t&&r&&o.supportsTemplateMode,canEdit:t&&r&&o.supportsTemplateMode&&!!i,currentTemplateId:i,onNavigateToEntityRecord:o.onNavigateToEntityRecord,getEditorSettings:e(xc).getEditorSettings}}),[t]),h=(0,p.useMemo)((()=>Object.entries({...s,...Object.fromEntries((n??[]).map((({slug:e,title:t})=>[e,t.rendered])))}).map((([e,t])=>({value:e,label:t})))),[s,n]),_=h.find((e=>e.value===o))??h.find((e=>!e.value)),{editPost:f}=(0,d.useDispatch)(xc),{createSuccessNotice:b}=(0,d.useDispatch)(_s.store),[y,x]=(0,p.useState)(!1);return(0,c.jsxs)("div",{className:"editor-post-template__classic-theme-dropdown",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Template"),help:(0,fs.__)("Templates define the way content is displayed when viewing your site."),actions:r?[{icon:Wd,label:(0,fs.__)("Add template"),onClick:()=>x(!0)}]:[],onClose:e}),t?(0,c.jsx)(Fn.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,label:(0,fs.__)("Template"),value:_?.value??"",options:h,onChange:e=>f({template:e||""})}):(0,c.jsx)(Fn.Notice,{status:"warning",isDismissible:!1,children:(0,fs.__)("The posts page template cannot be changed.")}),i&&l&&(0,c.jsx)("p",{children:(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>{l({postId:a,postType:"wp_template"}),e(),b((0,fs.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:[{label:(0,fs.__)("Go back"),onClick:()=>m().onNavigateToPreviousEntityRecord()}]})},children:(0,fs.__)("Edit template")})}),y&&(0,c.jsx)(Yd,{onClose:()=>x(!1)})]})}var su=function(){const[e,t]=(0,p.useState)(null),s=(0,p.useMemo)((()=>({anchor:e,className:"editor-post-template__dropdown",placement:"left-start",offset:36,shift:!0})),[e]);return(0,c.jsx)(Nd,{label:(0,fs.__)("Template"),ref:t,children:(0,c.jsx)(Fn.Dropdown,{popoverProps:s,focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(eu,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,c.jsx)(tu,{onClose:e})})})};const nu=window.wp.warning;var ou=s.n(nu);const{PreferenceBaseOption:ru}=$(C.privateApis);function iu(e){const{toggleEditorPanelEnabled:t}=(0,d.useDispatch)(xc),{isChecked:s,isRemoved:n}=(0,d.useSelect)((t=>{const{isEditorPanelEnabled:s,isEditorPanelRemoved:n}=t(xc);return{isChecked:s(e.panelName),isRemoved:n(e.panelName)}}),[e.panelName]);return n?null:(0,c.jsx)(ru,{isChecked:s,onChange:()=>t(e.panelName),...e})}const{Fill:au,Slot:lu}=(0,Fn.createSlotFill)("EnablePluginDocumentSettingPanelOption"),cu=({label:e,panelName:t})=>(0,c.jsx)(au,{children:(0,c.jsx)(iu,{label:e,panelName:t})});cu.Slot=lu;var du=cu;const{Fill:uu,Slot:pu}=(0,Fn.createSlotFill)("PluginDocumentSettingPanel"),mu=({name:e,className:t,title:s,icon:n,children:o})=>{const{name:r}=(0,la.usePluginContext)(),i=`$r}/$e}`,{opened:a,isEnabled:l}=(0,d.useSelect)((e=>{const{isEditorPanelOpened:t,isEditorPanelEnabled:s}=e(xc);return{opened:t(i),isEnabled:s(i)}}),[i]),{toggleEditorPanelOpened:u}=(0,d.useDispatch)(xc);return void 0===e&&ou()("PluginDocumentSettingPanel requires a name property."),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(du,{label:s,panelName:i}),(0,c.jsx)(uu,{children:l&&(0,c.jsx)(Fn.PanelBody,{className:t,title:s,icon:n,opened:a,onToggle:()=>u(i),children:o})})]})};mu.Slot=pu;var hu=mu;var gu=({allowedBlocks:e,icon:t,label:s,onClick:n,small:o,role:r})=>(0,c.jsx)(g.BlockSettingsMenuControls,{children:({selectedBlocks:i,onClose:a})=>((e,t)=>{return!Array.isArray(t)||(s=t,0===e.filter((e=>!s.includes(e))).length);var s})(i,e)?(0,c.jsx)(Fn.MenuItem,{onClick:(0,m.compose)(n,a),icon:t,label:o?s:void 0,role:r,children:!o&&s}):null});function _u(e){const t=(0,la.usePluginContext)();return(0,c.jsx)(Ra,{name:"core/plugin-more-menu",as:e.as??Fn.MenuItem,icon:e.icon||t.icon,...e})}const{Fill:fu,Slot:bu}=(0,Fn.createSlotFill)("PluginPostPublishPanel"),yu=({children:e,className:t,title:s,initialOpen:n=!1,icon:o})=>{const{icon:r}=(0,la.usePluginContext)();return(0,c.jsx)(fu,{children:(0,c.jsx)(Fn.PanelBody,{className:t,initialOpen:n||!s,title:s,icon:o??r,children:e})})};yu.Slot=bu;var xu=yu;const{Fill:vu,Slot:wu}=(0,Fn.createSlotFill)("PluginPostStatusInfo"),Su=({children:e,className:t})=>(0,c.jsx)(vu,{children:(0,c.jsx)(Fn.PanelRow,{className:t,children:e})});Su.Slot=wu;var ku=Su;const{Fill:Cu,Slot:Pu}=(0,Fn.createSlotFill)("PluginPrePublishPanel"),ju=({children:e,className:t,title:s,initialOpen:n=!1,icon:o})=>{const{icon:r}=(0,la.usePluginContext)();return(0,c.jsx)(Cu,{children:(0,c.jsx)(Fn.PanelBody,{className:t,initialOpen:n||!s,title:s,icon:o??r,children:e})})};ju.Slot=Pu;var Eu=ju;function Tu(e){const t=(0,la.usePluginContext)();return(0,c.jsx)(Ra,{name:"core/plugin-preview-menu",as:e.as??Fn.MenuItem,icon:e.icon||t.icon,...e})}function Bu({className:e,...t}){return(0,c.jsx)(Ua,{panelClassName:e,className:"editor-sidebar",scope:"core",...t})}function Iu(e){return(0,c.jsx)(Aa,{__unstableExplicitMenuItem:!0,scope:"core",...e})}function Nu(e=""){return e=(e=Lr()(e)).trim().toLowerCase()}function Ru(e,t){const s=Nu(t),n=Nu(e.title);let o=0;if(s===n)o+=30;else if(n.startsWith(s))o+=20;else{s.split(" ").every((e=>n.includes(e)))&&(o+=10)}return o}function Du({onClick:e}){const[t,s]=(0,p.useState)(!1),{postType:n,postId:o}=qd(),r=Xd(n),{editEntityRecord:i}=(0,d.useDispatch)(u.store);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Fn.MenuItem,{disabled:!r?.length,accessibleWhenDisabled:!0,onClick:()=>s(!0),children:(0,fs.__)("Change template")}),t&&(0,c.jsx)(Fn.Modal,{title:(0,fs.__)("Choose a template"),onRequestClose:()=>s(!1),overlayClassName:"editor-post-template__swap-template-modal",isFullScreen:!0,children:(0,c.jsx)("div",{className:"editor-post-template__swap-template-modal-content",children:(0,c.jsx)(Au,{postType:n,onSelect:async t=>{i("postType",n,o,{template:t.name},{undoIgnore:!0}),s(!1),e()}})})})]})}function Au({postType:e,onSelect:t}){const[s,n]=(0,p.useState)(""),o=Xd(e),r=(0,p.useMemo)((()=>o.map((e=>({name:e.slug,blocks:(0,x.parse)(e.content.raw),title:(0,Ln.decodeEntities)(e.title.rendered),id:e.id})))),[o]),i=(0,p.useMemo)((()=>function(e=[],t=""){if(!t)return e;const s=e.map((e=>[e,Ru(e,t)])).filter((([,e])=>e>0));return s.sort((([,e],[,t])=>t-e)),s.map((([e])=>e))}(r,s)),[r,s]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Fn.SearchControl,{__nextHasNoMarginBottom:!0,onChange:n,value:s,label:(0,fs.__)("Search"),placeholder:(0,fs.__)("Search"),className:"editor-post-template__swap-template-search"}),(0,c.jsx)(g.__experimentalBlockPatternsList,{label:(0,fs.__)("Templates"),blockPatterns:i,onClickPattern:t})]})}function Mu({onClick:e}){const t=Jd(),s=Kd(),{postType:n,postId:o}=qd(),{editEntityRecord:r}=(0,d.useDispatch)(u.store);return t&&s?(0,c.jsx)(Fn.MenuItem,{onClick:()=>{r("postType",n,o,{template:""},{undoIgnore:!0}),e()},children:(0,fs.__)("Use default template")}):null}function Lu(){const{canCreateTemplates:e}=(0,d.useSelect)((e=>{const{canUser:t}=e(u.store);return{canCreateTemplates:t("create",{kind:"postType",name:"wp_template"})}}),[]),[t,s]=(0,p.useState)(!1),n=Kd();return e&&n?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Fn.MenuItem,{onClick:()=>{s(!0)},children:(0,fs.__)("Create new template")}),t&&(0,c.jsx)(Yd,{onClose:()=>{s(!1)}})]}):null}function Ou({id:e}){const{isTemplateHidden:t,onNavigateToEntityRecord:s,getEditorSettings:n,hasGoBack:o,hasSpecificTemplate:r}=(0,d.useSelect)((e=>{const{getRenderingMode:t,getEditorSettings:s,getCurrentPost:n}=$(e(xc)),o=s(),r=n();return{isTemplateHidden:"post-only"===t(),onNavigateToEntityRecord:o.onNavigateToEntityRecord,getEditorSettings:s,hasGoBack:o.hasOwnProperty("onNavigateToPreviousEntityRecord"),hasSpecificTemplate:!!r.template}}),[]),{get:i}=(0,d.useSelect)(C.store),{editedRecord:a,hasResolved:l}=(0,u.useEntityRecord)("postType","wp_template",e),{getEntityRecord:m}=(0,d.useSelect)(u.store),{editEntityRecord:h}=(0,d.useDispatch)(u.store),{createSuccessNotice:g}=(0,d.useDispatch)(_s.store),{setRenderingMode:_,setDefaultRenderingMode:f}=$((0,d.useDispatch)(xc)),b=(0,d.useSelect)((e=>!!e(u.store).canUser("create",{kind:"postType",name:"wp_template"})),[]),[y,x]=(0,p.useState)(null),v=(0,p.useMemo)((()=>({anchor:y,className:"editor-post-template__dropdown",placement:"left-start",offset:36,shift:!0})),[y]);if(!l)return null;const w=o?[{label:(0,fs.__)("Go back"),onClick:()=>n().onNavigateToPreviousEntityRecord()}]:void 0;return(0,c.jsx)(Nd,{label:(0,fs.__)("Template"),ref:x,children:(0,c.jsx)(Fn.DropdownMenu,{popoverProps:v,focusOnMount:!0,toggleProps:{size:"compact",variant:"tertiary",tooltipPosition:"middle left"},label:(0,fs.__)("Template options"),text:(0,Ln.decodeEntities)(a.title),icon:null,children:({onClose:e})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(Fn.MenuGroup,{children:[b&&(0,c.jsx)(Fn.MenuItem,{onClick:async()=>{if(s({postId:a.id,postType:"wp_template"}),!r){const e=await m("root","site").active_templates;e[a.slug]!==a.id&&h("root","site",void 0,{active_templates:{...e,[a.slug]:a.id}})}e(),i("core/edit-site","welcomeGuideTemplate")||g((0,fs.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:w})},children:(0,fs.__)("Edit template")}),(0,c.jsx)(Du,{onClick:e}),(0,c.jsx)(Mu,{onClick:e}),b&&(0,c.jsx)(Lu,{})]}),(0,c.jsx)(Fn.MenuGroup,{children:(0,c.jsx)(Fn.MenuItem,{icon:t?void 0:Zn,isSelected:!t,role:"menuitemcheckbox",onClick:()=>{const e=t?"template-locked":"post-only";_(e),f(e)},children:(0,fs.__)("Show template")})})]})})})}function Fu(){const{templateId:e,isBlockTheme:t}=(0,d.useSelect)((e=>{const{getCurrentTemplateId:t,getEditorSettings:s}=e(xc);return{templateId:t(),isBlockTheme:s().__unstableIsBlockBasedTheme}}),[]),s=(0,d.useSelect)((e=>{const t=e(xc).getCurrentPostType(),s=e(u.store).getPostType(t);if(!s?.viewable)return!1;const n=e(xc).getEditorSettings();if(!!n.availableTemplates&&Object.keys(n.availableTemplates).length>0)return!0;if(!n.supportsTemplateMode)return!1;return e(u.store).canUser("create",{kind:"postType",name:"wp_template"})??!1}),[]),n=(0,d.useSelect)((e=>e(u.store).canUser("read",{kind:"postType",name:"wp_template"})??!1),[]);return t&&n||!s?t&&e?(0,c.jsx)(Ou,{id:e}):null:(0,c.jsx)(su,{})}const Vu={_fields:"id,name",context:"view"},Uu={who:"authors",per_page:100,...Vu};function zu(e){const{authorId:t,authors:s,postAuthor:n,isLoading:o}=(0,d.useSelect)((t=>{const{getUser:s,getUsers:n,isResolving:o}=t(u.store),{getEditedPostAttribute:r}=t(xc),i=r("author"),a={...Uu};return e&&(a.search=e,a.search_columns=["name"]),{authorId:i,authors:n(a),postAuthor:s(i,Vu),isLoading:o("getUsers",[a])}}),[e]);return{authorId:t,authorOptions:(0,p.useMemo)((()=>{const e=(s??[]).map((e=>({value:e.id,label:(0,Ln.decodeEntities)(e.name)}))),t=e.findIndex((({value:e})=>n?.id===e));let o=[];return t<0&&n?o=[{value:n.id,label:(0,Ln.decodeEntities)(n.name)}]:t<0&&!n&&(o=[{value:0,label:(0,fs.__)("(No author)")}]),[...o,...e]}),[s,n]),postAuthor:n,isLoading:o}}function Hu(){const[e,t]=(0,p.useState)(),{editPost:s}=(0,d.useDispatch)(xc),{authorId:n,authorOptions:o,isLoading:r}=zu(e);return(0,c.jsx)(Fn.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,fs.__)("Author"),options:o,value:n,onFilterValueChange:(0,m.debounce)(t,300),onChange:e=>{e&&s({author:e})},allowReset:!1,hideLabelFromVision:!0,isLoading:r})}function Gu(){const{editPost:e}=(0,d.useDispatch)(xc),{authorId:t,authorOptions:s}=zu();return(0,c.jsx)(Fn.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"post-author-selector",label:(0,fs.__)("Author"),options:s,onChange:t=>{const s=Number(t);e({author:s})},value:t,hideLabelFromVision:!0})}var $u=function(){return(0,d.useSelect)((e=>{const t=e(u.store).getUsers(Uu);return t?.length>=25}),[])?(0,c.jsx)(Hu,{}):(0,c.jsx)(Gu,{})};function Wu({children:e}){const{hasAssignAuthorAction:t}=(0,d.useSelect)((e=>{const t=e(xc).getCurrentPost();return{hasAssignAuthorAction:!!t?._links?.["wp:action-assign-author"]}}),[]);return t?(0,c.jsx)(Td,{supportKeys:"author",children:e}):null}function Zu({isOpen:e,onClick:t}){const{postAuthor:s}=(0,d.useSelect)((e=>{const t=e(xc).getEditedPostAttribute("author");return{postAuthor:e(u.store).getUser(t,Vu)}}),[]),n=(0,Ln.decodeEntities)(s?.name)||(0,fs.__)("(No author)");return(0,c.jsx)(Fn.Button,{size:"compact",className:"editor-post-author__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change author: %s"),n),onClick:t,children:n})}var Yu=function(){const[e,t]=(0,p.useState)(null),s=(0,p.useMemo)((()=>({anchor:e,placement:"left-start",offset:36,shift:!0})),[e]);return(0,c.jsx)(Wu,{children:(0,c.jsx)(Nd,{label:(0,fs.__)("Author"),ref:t,children:(0,c.jsx)(Fn.Dropdown,{popoverProps:s,contentClassName:"editor-post-author__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(Zu,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,c.jsxs)("div",{className:"editor-post-author",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Author"),onClose:e}),(0,c.jsx)($u,{onClose:e})]})})})})};const qu=[{label:(0,fs._x)("Open",'Adjective: e.g. "Comments are open"'),value:"open",description:(0,fs.__)("Visitors can add new comments and replies.")},{label:(0,fs.__)("Closed"),value:"closed",description:[(0,fs.__)("Visitors cannot add new comments or replies."),(0,fs.__)("Existing comments remain visible.")].join(" ")}];var Ku=function(){const e=(0,d.useSelect)((e=>e(xc).getEditedPostAttribute("comment_status")??"open"),[]),{editPost:t}=(0,d.useDispatch)(xc);return(0,c.jsx)("form",{children:(0,c.jsx)(Fn.__experimentalVStack,{spacing:4,children:(0,c.jsx)(Fn.RadioControl,{className:"editor-change-status__options",hideLabelFromVision:!0,label:(0,fs.__)("Comment status"),options:qu,onChange:e=>t({comment_status:e}),selected:e})})})};var Qu=function(){const e=(0,d.useSelect)((e=>e(xc).getEditedPostAttribute("ping_status")??"open"),[]),{editPost:t}=(0,d.useDispatch)(xc);return(0,c.jsx)(Fn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Enable pingbacks & trackbacks"),checked:"open"===e,onChange:()=>t({ping_status:"open"===e?"closed":"open"}),help:(0,c.jsx)(Fn.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/trackbacks-and-pingbacks/"),children:(0,fs.__)("Learn more about pingbacks & trackbacks")})})};const Xu="discussion-panel";function Ju({onClose:e}){return(0,c.jsxs)("div",{className:"editor-post-discussion",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Discussion"),onClose:e}),(0,c.jsxs)(Fn.__experimentalVStack,{spacing:4,children:[(0,c.jsx)(Td,{supportKeys:"comments",children:(0,c.jsx)(Ku,{})}),(0,c.jsx)(Td,{supportKeys:"trackbacks",children:(0,c.jsx)(Qu,{})})]})]})}function ep({isOpen:e,onClick:t}){const{commentStatus:s,pingStatus:n,commentsSupported:o,trackbacksSupported:r}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(xc),{getPostType:s}=e(u.store),n=s(t("type"));return{commentStatus:t("comment_status")??"open",pingStatus:t("ping_status")??"open",commentsSupported:!!n.supports.comments,trackbacksSupported:!!n.supports.trackbacks}}),[]);let i;return i="open"===s?"open"===n?(0,fs._x)("Open",'Adjective: e.g. "Comments are open"'):r?(0,fs.__)("Comments only"):(0,fs._x)("Open",'Adjective: e.g. "Comments are open"'):"open"===n?o?(0,fs.__)("Pings only"):(0,fs.__)("Pings enabled"):(0,fs.__)("Closed"),(0,c.jsx)(Fn.Button,{size:"compact",className:"editor-post-discussion__panel-toggle",variant:"tertiary","aria-label":(0,fs.__)("Change discussion options"),"aria-expanded":e,onClick:t,children:i})}function tp(){const{isEnabled:e}=(0,d.useSelect)((e=>{const{isEditorPanelEnabled:t}=e(xc);return{isEnabled:t(Xu)}}),[]),[t,s]=(0,p.useState)(null),n=(0,p.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]);return e?(0,c.jsx)(Td,{supportKeys:["comments","trackbacks"],children:(0,c.jsx)(Nd,{label:(0,fs.__)("Discussion"),ref:s,children:(0,c.jsx)(Fn.Dropdown,{popoverProps:n,className:"editor-post-discussion__panel-dropdown",contentClassName:"editor-post-discussion__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(ep,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,c.jsx)(Ju,{onClose:e})})})}):null}function sp({hideLabelFromVision:e=!1,updateOnBlur:t=!1}){const{excerpt:s,shouldUseDescriptionLabel:n,usedAttribute:o}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getEditedPostAttribute:s}=e(xc),n=t(),o=["wp_template","wp_template_part"].includes(n)?"description":"excerpt";return{excerpt:s(o),shouldUseDescriptionLabel:["wp_template","wp_template_part","wp_block"].includes(n),usedAttribute:o}}),[]),{editPost:r}=(0,d.useDispatch)(xc),[i,a]=(0,p.useState)((0,Ln.decodeEntities)(s)),l=e=>{r({[o]:e})},u=n?(0,fs.__)("Write a description (optional)"):(0,fs.__)("Write an excerpt (optional)");return(0,c.jsx)("div",{className:"editor-post-excerpt",children:(0,c.jsx)(Fn.TextareaControl,{__nextHasNoMarginBottom:!0,label:u,hideLabelFromVision:e,className:"editor-post-excerpt__textarea",onChange:t?a:l,onBlur:t?()=>l(i):void 0,value:t?i:s,help:n?(0,fs.__)("Write a description"):(0,c.jsx)(Fn.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#excerpt"),children:(0,fs.__)("Learn more about manual excerpts")})})})}var np=function({children:e}){return(0,c.jsx)(Td,{supportKeys:"excerpt",children:e})};const{Fill:op,Slot:rp}=(0,Fn.createSlotFill)("PluginPostExcerpt"),ip=({children:e,className:t})=>(0,c.jsx)(op,{children:(0,c.jsx)(Fn.PanelRow,{className:t,children:e})});ip.Slot=rp;var ap=ip;const lp="post-excerpt";function cp(){const{isOpened:e,isEnabled:t,postType:s}=(0,d.useSelect)((e=>{const{isEditorPanelOpened:t,isEditorPanelEnabled:s,getCurrentPostType:n}=e(xc);return{isOpened:t(lp),isEnabled:s(lp),postType:n()}}),[]),{toggleEditorPanelOpened:n}=(0,d.useDispatch)(xc);if(!t)return null;const o=["wp_template","wp_template_part","wp_block"].includes(s);return(0,c.jsx)(Fn.PanelBody,{title:o?(0,fs.__)("Description"):(0,fs.__)("Excerpt"),opened:e,onToggle:()=>n(lp),children:(0,c.jsx)(ap.Slot,{children:e=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(sp,{}),e]})})})}function dp(){return(0,c.jsx)(np,{children:(0,c.jsx)(cp,{})})}function up(){return(0,c.jsx)(np,{children:(0,c.jsx)(pp,{})})}function pp(){const{shouldRender:e,excerpt:t,shouldBeUsedAsDescription:s,allowEditing:n}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s,getEditedPostAttribute:n,isEditorPanelEnabled:o}=e(xc),r=t(),i=["wp_template","wp_template_part"].includes(r),a="wp_block"===r,l=i||a,c=n(i?"description":"excerpt"),d=i&&e(u.store).getEntityRecord("postType",r,s()),p=!c&&i?Y({template:d,templateTypes:e(u.store).getCurrentTheme()?.default_template_types})?.description:void 0,m=o(lp)||l;return{excerpt:c??p,shouldRender:m,shouldBeUsedAsDescription:l,allowEditing:m&&(!l||a||d&&d.source===D&&!d.has_theme_file&&d.is_custom)}}),[]),[o,r]=(0,p.useState)(null),i=s?(0,fs.__)("Description"):(0,fs.__)("Excerpt"),a=(0,p.useMemo)((()=>({anchor:o,"aria-label":i,headerTitle:i,placement:"left-start",offset:36,shift:!0})),[o,i]);if(!e)return!1;const l=!!t&&(0,c.jsx)(Fn.__experimentalText,{align:"left",numberOfLines:4,truncate:n,children:(0,Ln.decodeEntities)(t)});if(!n)return l;const m=s?(0,fs.__)("Add a description…"):(0,fs.__)("Add an excerpt…"),h=s?(0,fs.__)("Edit description"):(0,fs.__)("Edit excerpt");return(0,c.jsxs)(Fn.__experimentalVStack,{children:[l,(0,c.jsx)(Fn.Dropdown,{className:"editor-post-excerpt__dropdown",contentClassName:"editor-post-excerpt__dropdown__content",popoverProps:a,focusOnMount:!0,ref:r,renderToggle:({onToggle:e})=>(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,onClick:e,variant:"link",children:l?h:m}),renderContent:({onClose:e})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:i,onClose:e}),(0,c.jsx)(Fn.__experimentalVStack,{spacing:4,children:(0,c.jsx)(ap.Slot,{children:e=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(sp,{hideLabelFromVision:!0,updateOnBlur:!0}),e]})})})]})})]})}function mp({children:e,supportKeys:t}){const{postType:s,themeSupports:n}=(0,d.useSelect)((e=>({postType:e(xc).getEditedPostAttribute("type"),themeSupports:e(u.store).getThemeSupports()})),[]);return(Array.isArray(t)?t:[t]).some((e=>{const t=n?.[e]??!1;return"post-thumbnails"===e&&Array.isArray(t)?t.includes(s):t}))?e:null}var hp=function({children:e}){return(0,c.jsx)(mp,{supportKeys:"post-thumbnails",children:(0,c.jsx)(Td,{supportKeys:"thumbnail",children:e})})};const gp=["image"],_p=(0,fs.__)("Featured image"),fp=(0,fs.__)("Add a featured image"),bp=(0,c.jsx)("p",{children:(0,fs.__)("To edit the featured image, you need permission to upload media.")});const yp=(0,d.withSelect)((e=>{const{getEntityRecord:t,getPostType:s,hasFinishedResolution:n}=e(u.store),{getCurrentPostId:o,getEditedPostAttribute:r}=e(xc),i=r("featured_media");return{media:i?t("postType","attachment",i,{context:"view"}):null,currentPostId:o(),postType:s(r("type")),featuredImageId:i,isRequestingFeaturedImageMedia:!!i&&!n("getEntityRecord",["postType","attachment",i,{context:"view"}])}})),xp=(0,d.withDispatch)(((e,{noticeOperations:t},{select:s})=>{const{editPost:n}=e(xc);return{onUpdateImage(e){n({featured_media:e.id})},onDropImage(e){s(g.store).getSettings().mediaUpload({allowedTypes:["image"],filesList:e,onFileChange([e]){n({featured_media:e.id})},onError(e){t.removeAllNotices(),t.createErrorNotice(e)},multiple:!1})},onRemoveImage(){n({featured_media:0})}}}));var vp=(0,m.compose)(Fn.withNotices,yp,xp,(0,Fn.withFilters)("editor.PostFeaturedImage"))((function({currentPostId:e,featuredImageId:t,onUpdateImage:s,onRemoveImage:n,media:o,postType:r,noticeUI:i,noticeOperations:a,isRequestingFeaturedImageMedia:l}){const u=(0,p.useRef)(!1),[m,_]=(0,p.useState)(!1),{getSettings:f}=(0,d.useSelect)(g.store),{mediaSourceUrl:b}=function(e,t){if(!e)return{};const s=(0,h.applyFilters)("editor.PostFeaturedImage.imageSize","large",e.id,t);if(s in(e?.media_details?.sizes??{}))return{mediaWidth:e.media_details.sizes[s].width,mediaHeight:e.media_details.sizes[s].height,mediaSourceUrl:e.media_details.sizes[s].source_url};const n=(0,h.applyFilters)("editor.PostFeaturedImage.imageSize","thumbnail",e.id,t);return n in(e?.media_details?.sizes??{})?{mediaWidth:e.media_details.sizes[n].width,mediaHeight:e.media_details.sizes[n].height,mediaSourceUrl:e.media_details.sizes[n].source_url}:{mediaWidth:e.media_details.width,mediaHeight:e.media_details.height,mediaSourceUrl:e.source_url}}(o,e);function y(e){f().mediaUpload({allowedTypes:gp,filesList:e,onFileChange([e]){(0,$o.isBlobURL)(e?.url)?_(!0):(e&&s(e),_(!1))},onError(e){a.removeAllNotices(),a.createErrorNotice(e)},multiple:!1})}function x(e){return e.alt_text?(0,fs.sprintf)((0,fs.__)("Current image: %s"),e.alt_text):(0,fs.sprintf)((0,fs.__)("The current image has no alternative text. The file name is: %s"),e.media_details.sizes?.full?.file||e.slug)}function v(e){u.current&&e&&(e.focus(),u.current=!1)}const w=!l&&!!t&&!o;return(0,c.jsxs)(hp,{children:[i,(0,c.jsxs)("div",{className:"editor-post-featured-image",children:[o&&(0,c.jsx)("div",{id:`editor-post-featured-image-$t}-describedby`,className:"hidden",children:x(o)}),(0,c.jsx)(g.MediaUploadCheck,{fallback:bp,children:(0,c.jsx)(g.MediaUpload,{title:r?.labels?.featured_image||_p,onSelect:s,unstableFeaturedImageFlow:!0,allowedTypes:gp,modalClass:"editor-post-featured-image__media-modal",render:({open:e})=>(0,c.jsxs)("div",{className:"editor-post-featured-image__container",children:[w?(0,c.jsx)(Fn.Notice,{status:"warning",isDismissible:!1,children:(0,fs.__)("Could not retrieve the featured image data.")}):(0,c.jsxs)(Fn.Button,{__next40pxDefaultSize:!0,ref:v,className:t?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:e,"aria-label":t?(0,fs.__)("Edit or replace the featured image"):null,"aria-describedby":t?`editor-post-featured-image-$t}-describedby`:null,"aria-haspopup":"dialog",disabled:m,accessibleWhenDisabled:!0,children:[!!t&&o&&(0,c.jsx)("img",{className:"editor-post-featured-image__preview-image",src:b,alt:x(o)}),(m||l)&&(0,c.jsx)(Fn.Spinner,{}),!t&&!m&&(r?.labels?.set_featured_image||fp)]}),!!t&&(0,c.jsxs)(Fn.__experimentalHStack,{className:hr("editor-post-featured-image__actions",{"editor-post-featured-image__actions-missing-image":w,"editor-post-featured-image__actions-is-requesting-image":l}),children:[(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,className:"editor-post-featured-image__action",onClick:e,"aria-haspopup":"dialog",variant:w?"secondary":void 0,children:(0,fs.__)("Replace")}),(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,className:"editor-post-featured-image__action",onClick:()=>{n(),u.current=!0},variant:w?"secondary":void 0,isDestructive:w,children:(0,fs.__)("Remove")})]}),(0,c.jsx)(Fn.DropZone,{onFilesDrop:y})]}),value:t})})]})]})}));const wp="featured-image";function Sp({withPanelBody:e=!0}){const{postType:t,isEnabled:s,isOpened:n}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,isEditorPanelEnabled:s,isEditorPanelOpened:n}=e(xc),{getPostType:o}=e(u.store);return{postType:o(t("type")),isEnabled:s(wp),isOpened:n(wp)}}),[]),{toggleEditorPanelOpened:o}=(0,d.useDispatch)(xc);return s?e?(0,c.jsx)(hp,{children:(0,c.jsx)(Fn.PanelBody,{title:t?.labels?.featured_image??(0,fs.__)("Featured image"),opened:n,onToggle:()=>o(wp),children:(0,c.jsx)(vp,{})})}):(0,c.jsx)(hp,{children:(0,c.jsx)(vp,{})}):null}function kp({children:e}){return(0,d.useSelect)((e=>e(xc).getEditorSettings().disablePostFormats),[])?null:(0,c.jsx)(Td,{supportKeys:"post-formats",children:e})}const Cp=[{id:"aside",caption:(0,fs.__)("Aside")},{id:"audio",caption:(0,fs.__)("Audio")},{id:"chat",caption:(0,fs.__)("Chat")},{id:"gallery",caption:(0,fs.__)("Gallery")},{id:"image",caption:(0,fs.__)("Image")},{id:"link",caption:(0,fs.__)("Link")},{id:"quote",caption:(0,fs.__)("Quote")},{id:"standard",caption:(0,fs.__)("Standard")},{id:"status",caption:(0,fs.__)("Status")},{id:"video",caption:(0,fs.__)("Video")}].sort(((e,t)=>{const s=e.caption.toUpperCase(),n=t.caption.toUpperCase();return s<n?-1:s>n?1:0}));function Pp(){const e=`post-format-selector-${(0,m.useInstanceId)(Pp)}`,{postFormat:t,suggestedFormat:s,supportedFormats:n}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:s}=e(xc),n=t("format"),o=e(u.store).getThemeSupports();return{postFormat:n??"standard",suggestedFormat:s(),supportedFormats:o.formats}}),[]),o=Cp.filter((e=>n?.includes(e.id)||t===e.id)),r=o.find((e=>e.id===s)),{editPost:i}=(0,d.useDispatch)(xc),a=e=>i({format:e});return(0,c.jsx)(kp,{children:(0,c.jsxs)("div",{className:"editor-post-format",children:[(0,c.jsx)(Fn.RadioControl,{className:"editor-post-format__options",label:(0,fs.__)("Post Format"),selected:t,onChange:e=>a(e),id:e,options:o.map((e=>({label:e.caption,value:e.id}))),hideLabelFromVision:!0}),r&&r.id!==t&&(0,c.jsx)("p",{className:"editor-post-format__suggestion",children:(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>a(r.id),children:(0,fs.sprintf)((0,fs.__)("Apply suggested format: %s"),r.caption)})})]})})}var jp=function({children:e}){const{lastRevisionId:t,revisionsCount:s}=(0,d.useSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:s}=e(xc);return{lastRevisionId:t(),revisionsCount:s()}}),[]);return!t||s<2?null:(0,c.jsx)(Td,{supportKeys:"revisions",children:e})};function Ep(){return(0,d.useSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:s}=e(xc);return{lastRevisionId:t(),revisionsCount:s()}}),[])}function Tp(){const{lastRevisionId:e,revisionsCount:t}=Ep();return(0,c.jsx)(jp,{children:(0,c.jsx)(Nd,{label:(0,fs.__)("Revisions"),children:(0,c.jsx)(Fn.Button,{href:(0,w.addQueryArgs)("revision.php",{revision:e}),className:"editor-private-post-last-revision__button",text:t,variant:"tertiary",size:"compact"})})})}var Bp=function(){const{lastRevisionId:e,revisionsCount:t}=Ep();return(0,c.jsx)(jp,{children:(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,href:(0,w.addQueryArgs)("revision.php",{revision:e}),className:"editor-post-last-revision__title",icon:qo,iconPosition:"right",text:(0,fs.sprintf)((0,fs.__)("Revisions (%s)"),t)})})};var Ip=function(){return(0,c.jsx)(jp,{children:(0,c.jsx)(Fn.PanelBody,{className:"editor-post-last-revision__panel",children:(0,c.jsx)(Bp,{})})})};var Np=function e(){const t="core/editor/post-locked-modal-"+(0,m.useInstanceId)(e),{autosave:s,updatePostLock:n}=(0,d.useDispatch)(xc),{isLocked:o,isTakeover:r,user:i,postId:a,postLockUtils:l,activePostLock:g,postType:_,previewLink:f}=(0,d.useSelect)((e=>{const{isPostLocked:t,isPostLockTakeover:s,getPostLockUser:n,getCurrentPostId:o,getActivePostLock:r,getEditedPostAttribute:i,getEditedPostPreviewLink:a,getEditorSettings:l}=e(xc),{getPostType:c}=e(u.store);return{isLocked:t(),isTakeover:s(),user:n(),postId:o(),postLockUtils:l().postLockUtils,activePostLock:r(),postType:c(i("type")),previewLink:a()}}),[]);if((0,p.useEffect)((()=>{function e(){if(o||!g)return;const e=new window.FormData;if(e.append("action","wp-remove-post-lock"),e.append("_wpnonce",l.unlockNonce),e.append("post_ID",a),e.append("active_post_lock",g),window.navigator.sendBeacon)window.navigator.sendBeacon(l.ajaxUrl,e);else{const t=new window.XMLHttpRequest;t.open("POST",l.ajaxUrl,!1),t.send(e)}}return(0,h.addAction)("heartbeat.send",t,(function(e){o||(e["wp-refresh-post-lock"]={lock:g,post_id:a})})),(0,h.addAction)("heartbeat.tick",t,(function(e){if(!e["wp-refresh-post-lock"])return;const t=e["wp-refresh-post-lock"];t.lock_error?(s(),n({isLocked:!0,isTakeover:!0,user:{name:t.lock_error.name,avatar:t.lock_error.avatar_src_2x}})):t.new_lock&&n({isLocked:!1,activePostLock:t.new_lock})})),window.addEventListener("beforeunload",e),()=>{(0,h.removeAction)("heartbeat.send",t),(0,h.removeAction)("heartbeat.tick",t),window.removeEventListener("beforeunload",e)}}),[]),!o)return null;const b=i.name,y=i.avatar,x=(0,w.addQueryArgs)("post.php",{"get-post-lock":"1",lockKey:!0,post:a,action:"edit",_wpnonce:l.nonce}),v=(0,w.addQueryArgs)("edit.php",{post_type:_?.slug}),S=(0,fs.__)("Exit editor");return(0,c.jsx)(Fn.Modal,{title:r?(0,fs.__)("Someone else has taken over this post"):(0,fs.__)("This post is already being edited"),focusOnMount:!0,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,isDismissible:!1,className:"editor-post-locked-modal",size:"medium",children:(0,c.jsxs)(Fn.__experimentalHStack,{alignment:"top",spacing:6,children:[!!y&&(0,c.jsx)("img",{src:y,alt:(0,fs.__)("Avatar"),className:"editor-post-locked-modal__avatar",width:64,height:64}),(0,c.jsxs)("div",{children:[!!r&&(0,c.jsx)("p",{children:(0,p.createInterpolateElement)(b?(0,fs.sprintf)((0,fs.__)("<strong>%s</strong> now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved."),b):(0,fs.__)("Another user now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved."),{strong:(0,c.jsx)("strong",{}),PreviewLink:(0,c.jsx)(Fn.ExternalLink,{href:f,children:(0,fs.__)("preview")})})}),!r&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{children:(0,p.createInterpolateElement)(b?(0,fs.sprintf)((0,fs.__)("<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over."),b):(0,fs.__)("Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over."),{strong:(0,c.jsx)("strong",{}),PreviewLink:(0,c.jsx)(Fn.ExternalLink,{href:f,children:(0,fs.__)("preview")})})}),(0,c.jsx)("p",{children:(0,fs.__)("If you take over, the other user will lose editing control to the post, but their changes will be saved.")})]}),(0,c.jsxs)(Fn.__experimentalHStack,{className:"editor-post-locked-modal__buttons",justify:"flex-end",children:[!r&&(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",href:x,children:(0,fs.__)("Take over")}),(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"primary",href:v,children:S})]})]})]})})};var Rp=function({children:e}){const{hasPublishAction:t,isPublished:s}=(0,d.useSelect)((e=>{const{isCurrentPostPublished:t,getCurrentPost:s}=e(xc);return{hasPublishAction:s()._links?.["wp:action-publish"]??!1,isPublished:t()}}),[]);return s||!t?null:e};var Dp=function(){const e=(0,d.useSelect)((e=>e(xc).getEditedPostAttribute("status")),[]),{editPost:t}=(0,d.useDispatch)(xc);return(0,c.jsx)(Rp,{children:(0,c.jsx)(Fn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Pending review"),checked:"pending"===e,onChange:()=>{t({status:"pending"===e?"draft":"pending"})}})})};function Ap({className:e,textContent:t,forceIsAutosaveable:s,role:n,onPreview:o}){const{postId:r,currentPostLink:i,previewLink:a,isSaveable:l,isViewable:m}=(0,d.useSelect)((e=>{const t=e(xc),s=e(u.store).getPostType(t.getCurrentPostType("type")),n=s?.viewable??!1;return n?{postId:t.getCurrentPostId(),currentPostLink:t.getCurrentPostAttribute("link"),previewLink:t.getEditedPostPreviewLink(),isSaveable:t.isEditedPostSaveable(),isViewable:n}:{isViewable:n}}),[]),{__unstableSaveForPreview:g}=(0,d.useDispatch)(xc);if(!m)return null;const _=`wp-preview-$r}`,f=a||i;return(0,c.jsx)(Fn.Button,{variant:e?void 0:"tertiary",className:e||"editor-post-preview",href:f,target:_,accessibleWhenDisabled:!0,disabled:!l,onClick:async e=>{e.preventDefault();const t=window.open("",_);t.focus(),function(e){let t=(0,p.renderToString)((0,c.jsxs)("div",{className:"editor-post-preview-button__interstitial-message",children:[(0,c.jsxs)(Fn.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 96 96",children:[(0,c.jsx)(Fn.Path,{className:"outer",d:"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",fill:"none"}),(0,c.jsx)(Fn.Path,{className:"inner",d:"M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z",fill:"none"})]}),(0,c.jsx)("p",{children:(0,fs.__)("Generating preview…")})]}));t+='\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n\t\t\t}\n\t\t</style>\n\t',t=(0,h.applyFilters)("editor.PostPreview.interstitialMarkup",t),e.write(t),e.title=(0,fs.__)("Generating preview…"),e.close()}(t.document);const n=await g({forceIsAutosaveable:s});t.location=n,o?.()},role:n,size:"compact",children:t||(0,c.jsxs)(c.Fragment,{children:[(0,fs._x)("Preview","imperative verb"),(0,c.jsx)(Fn.VisuallyHidden,{as:"span",children:(0,fs.__)("(opens in a new tab)")})]})})}function Mp(){const e=(0,m.useViewportMatch)("medium","<"),{isPublished:t,isBeingScheduled:s,isSaving:n,isPublishing:o,hasPublishAction:r,isAutosaving:i,hasNonPostEntityChanges:a,postStatusHasChanged:l,postStatus:c}=(0,d.useSelect)((e=>{const{isCurrentPostPublished:t,isEditedPostBeingScheduled:s,isSavingPost:n,isPublishingPost:o,getCurrentPost:r,getCurrentPostType:i,isAutosavingPost:a,getPostEdits:l,getEditedPostAttribute:c}=e(xc);return{isPublished:t(),isBeingScheduled:s(),isSaving:n(),isPublishing:o(),hasPublishAction:r()._links?.["wp:action-publish"]??!1,postType:i(),isAutosaving:a(),hasNonPostEntityChanges:e(xc).hasNonPostEntityChanges(),postStatusHasChanged:!!l()?.status,postStatus:c("status")}}),[]);return o?(0,fs.__)("Publishing…"):(t||s)&&n&&!i?(0,fs.__)("Saving…"):r?a||t||l&&!["future","publish"].includes(c)||!l&&"future"===c?(0,fs.__)("Save"):s?(0,fs.__)("Schedule"):(0,fs.__)("Publish"):e?(0,fs.__)("Publish"):(0,fs.__)("Submit for Review")}const Lp=()=>{};class Op extends p.Component{constructor(e){super(e),this.createOnClick=this.createOnClick.bind(this),this.closeEntitiesSavedStates=this.closeEntitiesSavedStates.bind(this),this.state={entitiesSavedStatesCallback:!1}}createOnClick(e){return(...t)=>{const{hasNonPostEntityChanges:s,setEntitiesSavedStatesCallback:n}=this.props;return s&&n?(this.setState({entitiesSavedStatesCallback:()=>e(...t)}),n((()=>this.closeEntitiesSavedStates)),Lp):e(...t)}}closeEntitiesSavedStates(e){const{postType:t,postId:s}=this.props,{entitiesSavedStatesCallback:n}=this.state;this.setState({entitiesSavedStatesCallback:!1},(()=>{e&&e.some((e=>"postType"===e.kind&&e.name===t&&e.key===s))&&n()}))}render(){const{forceIsDirty:e,hasPublishAction:t,isBeingScheduled:s,isOpen:n,isPostSavingLocked:o,isPublishable:r,isPublished:i,isSaveable:a,isSaving:l,isAutoSaving:d,isToggle:u,savePostStatus:p,onSubmit:m=Lp,onToggle:h,visibility:g,hasNonPostEntityChanges:_,isSavingNonPostEntityChanges:f,postStatus:b,postStatusHasChanged:y}=this.props,x=(l||!a||o||!r&&!e)&&(!_||f),v=(i||l||!a||!r&&!e)&&(!_||f);let w="publish";y?w=b:t?"private"===g?w="private":s&&(w="future"):w="pending";const S={"aria-disabled":x,className:"editor-post-publish-button",isBusy:!d&&l,variant:"primary",onClick:this.createOnClick((()=>{x||(m(),p(w))})),"aria-haspopup":_?"dialog":void 0},k={"aria-disabled":v,"aria-expanded":n,className:"editor-post-publish-panel__toggle",isBusy:l&&i,variant:"primary",size:"compact",onClick:this.createOnClick((()=>{v||h()})),"aria-haspopup":_?"dialog":void 0},C=u?k:S;return(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(Fn.Button,{...C,className:`$C.className} editor-post-publish-button__button`,size:"compact",children:(0,c.jsx)(Mp,{})})})}}var Fp=(0,m.compose)([(0,d.withSelect)((e=>{const{isSavingPost:t,isAutosavingPost:s,isEditedPostBeingScheduled:n,getEditedPostVisibility:o,isCurrentPostPublished:r,isEditedPostSaveable:i,isEditedPostPublishable:a,isPostSavingLocked:l,getCurrentPost:c,getCurrentPostType:d,getCurrentPostId:u,hasNonPostEntityChanges:p,isSavingNonPostEntityChanges:m,getEditedPostAttribute:h,getPostEdits:g}=e(xc);return{isSaving:t(),isAutoSaving:s(),isBeingScheduled:n(),visibility:o(),isSaveable:i(),isPostSavingLocked:l(),isPublishable:a(),isPublished:r(),hasPublishAction:c()._links?.["wp:action-publish"]??!1,postType:d(),postId:u(),postStatus:h("status"),postStatusHasChanged:g()?.status,hasNonPostEntityChanges:p(),isSavingNonPostEntityChanges:m()}})),(0,d.withDispatch)((e=>{const{editPost:t,savePost:s}=e(xc);return{savePostStatus:e=>{t({status:e},{undoIgnore:!0}),s()}}}))])(Op),Vp=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,c.jsx)(L.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"})});const Up=[{label:(0,fs.__)("Public"),value:"public",description:(0,fs.__)("Visible to everyone.")},{label:(0,fs.__)("Private"),value:"private",description:(0,fs.__)("Only visible to site admins and editors.")},{label:(0,fs.__)("Password protected"),value:"password",description:(0,fs.__)("Only visible to those who know the password.")}];function zp({onClose:e}){const t=(0,m.useInstanceId)(zp),{status:s,visibility:n,password:o}=(0,d.useSelect)((e=>({status:e(xc).getEditedPostAttribute("status"),visibility:e(xc).getEditedPostVisibility(),password:e(xc).getEditedPostAttribute("password")}))),{editPost:r}=(0,d.useDispatch)(xc),[i,a]=(0,p.useState)(!!o);return(0,c.jsxs)("div",{className:"editor-post-visibility",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Visibility"),help:(0,fs.__)("Control how this post is viewed."),onClose:e}),(0,c.jsxs)(Fn.__experimentalVStack,{spacing:4,children:[(0,c.jsx)(Fn.RadioControl,{label:(0,fs.__)("Visibility"),hideLabelFromVision:!0,options:Up,selected:i?"password":n,onChange:function(e){r({public:{status:"private"===n?"draft":s,password:""},private:{status:"private",password:""},password:{status:"private"===n?"draft":s,password:o||""}}[e]),a("password"===e)}}),i&&(0,c.jsx)(Fn.TextControl,{label:(0,fs.__)("Password"),onChange:e=>{r({password:e})},value:o,placeholder:(0,fs.__)("Use a secure password"),type:"text",id:`editor-post-visibility__password-input-$t}`,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,maxLength:255})]})]})}function Hp(){return Gp()}function Gp(){const e=(0,d.useSelect)((e=>e(xc).getEditedPostVisibility()),[]);return Up.find((t=>t.value===e))?.label}function $p(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function Wp(e){const t=$p(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Zp(e){const t=$p(e),s=t.getMonth();return t.setFullYear(t.getFullYear(),s+1,0),t.setHours(23,59,59,999),t}Math.pow(10,8);const Yp=6e4,qp=36e5;function Kp(e,t){const s=t?.additionalDigits??2,n=function(e){const t={},s=e.split(Qp.dateTimeDelimiter);let n;if(s.length>2)return t;/:/.test(s[0])?n=s[0]:(t.date=s[0],n=s[1],Qp.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Qp.timeZoneDelimiter)[0],n=e.substr(t.date.length,e.length)));if(n){const e=Qp.timezone.exec(n);e?(t.time=n.replace(e[1],""),t.timezone=e[1]):t.time=n}return t}(e);let o;if(n.date){const e=function(e,t){const s=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(s);if(!n)return{year:NaN,restDateString:""};const o=n[1]?parseInt(n[1]):null,r=n[2]?parseInt(n[2]):null;return{year:null===r?o:100*r,restDateString:e.slice((n[1]||n[2]).length)}}(n.date,s);o=function(e,t){if(null===t)return new Date(NaN);const s=e.match(Xp);if(!s)return new Date(NaN);const n=!!s[4],o=tm(s[1]),r=tm(s[2])-1,i=tm(s[3]),a=tm(s[4]),l=tm(s[5])-1;if(n)return function(e,t,s){return t>=1&&t<=53&&s>=0&&s<=6}(0,a,l)?function(e,t,s){const n=new Date(0);n.setUTCFullYear(e,0,4);const o=n.getUTCDay()||7,r=7*(t-1)+s+1-o;return n.setUTCDate(n.getUTCDate()+r),n}(t,a,l):new Date(NaN);{const e=new Date(0);return function(e,t,s){return t>=0&&t<=11&&s>=1&&s<=(nm[t]||(om(e)?29:28))}(t,r,i)&&function(e,t){return t>=1&&t<=(om(e)?366:365)}(t,o)?(e.setUTCFullYear(t,r,Math.max(o,i)),e):new Date(NaN)}}(e.restDateString,e.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);const r=o.getTime();let i,a=0;if(n.time&&(a=function(e){const t=e.match(Jp);if(!t)return NaN;const s=sm(t[1]),n=sm(t[2]),o=sm(t[3]);if(!function(e,t,s){if(24===e)return 0===t&&0===s;return s>=0&&s<60&&t>=0&&t<60&&e>=0&&e<25}(s,n,o))return NaN;return s*qp+n*Yp+1e3*o}(n.time),isNaN(a)))return new Date(NaN);if(!n.timezone){const e=new Date(r+a),t=new Date(0);return t.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),t.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),t}return i=function(e){if("Z"===e)return 0;const t=e.match(em);if(!t)return 0;const s="+"===t[1]?-1:1,n=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;if(!function(e,t){return t>=0&&t<=59}(0,o))return NaN;return s*(n*qp+o*Yp)}(n.timezone),isNaN(i)?new Date(NaN):new Date(r+a+i)}const Qp={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Xp=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Jp=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,em=/^([+-])(\d{2})(?::?(\d{2}))?$/;function tm(e){return e?parseInt(e):1}function sm(e){return e&&parseFloat(e.replace(",","."))||0}const nm=[31,null,31,30,31,30,31,31,30,31,30,31];function om(e){return e%400==0||e%4==0&&e%100!=0}const{PrivatePublishDateTimePicker:rm}=$(g.privateApis);function im(e){return(0,c.jsx)(am,{...e,showPopoverHeaderActions:!0,isCompact:!1})}function am({onClose:e,showPopoverHeaderActions:t,isCompact:s}){const{postDate:n,postType:o}=(0,d.useSelect)((e=>({postDate:e(xc).getEditedPostAttribute("date"),postType:e(xc).getCurrentPostType()})),[]),{editPost:r}=(0,d.useDispatch)(xc),[i,a]=(0,p.useState)(Wp(new Date(n))),l=(0,d.useSelect)((e=>e(u.store).getEntityRecords("postType",o,{status:"publish,future",after:Wp(i).toISOString(),before:Zp(i).toISOString(),exclude:[e(xc).getCurrentPostId()],per_page:100,_fields:"id,date"})),[i,o]),m=(0,p.useMemo)((()=>(l||[]).map((({date:e})=>({date:new Date(e)})))),[l]),h=(0,v.getSettings)(),g=/a(?!\\)/i.test(h.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,c.jsx)(rm,{currentDate:n,onChange:e=>r({date:e}),is12Hour:g,dateOrder:(0,fs._x)("dmy","date order"),events:m,onMonthPreviewed:e=>a(Kp(e)),onClose:e,isCompact:s,showPopoverHeaderActions:t})}function lm(e){return cm(e)}function cm({full:e=!1}={}){const{date:t,isFloating:s}=(0,d.useSelect)((e=>({date:e(xc).getEditedPostAttribute("date"),isFloating:e(xc).isEditedPostDateFloating()})),[]);return e?dm(t):function(e,{isFloating:t=!1,now:s=new Date}={}){if(!e||t)return(0,fs.__)("Immediately");if(!function(e){const{timezone:t}=(0,v.getSettings)(),s=Number(t.offset),n=e.getTimezoneOffset()/60*-1;return s===n}(s))return dm(e);const n=(0,v.getDate)(e);if(um(n,s))return(0,fs.sprintf)((0,fs.__)("Today at %s"),(0,v.dateI18n)((0,fs._x)("g:i a","post schedule time format"),n));const o=new Date(s);if(o.setDate(o.getDate()+1),um(n,o))return(0,fs.sprintf)((0,fs.__)("Tomorrow at %s"),(0,v.dateI18n)((0,fs._x)("g:i a","post schedule time format"),n));if(n.getFullYear()===s.getFullYear())return(0,v.dateI18n)((0,fs._x)("F j g:i a","post schedule date format without year"),n);return(0,v.dateI18n)((0,fs._x)("F j, Y g:i a","post schedule full date format"),n)}(t,{isFloating:s})}function dm(e){const t=(0,v.getDate)(e),s=function(){const{timezone:e}=(0,v.getSettings)();if(e.abbr&&isNaN(Number(e.abbr)))return e.abbr;return`UTC$e.offset<0?"":"+"}$e.offsetFormatted}`}(),n=(0,v.dateI18n)((0,fs._x)("F j, Y g:i a","post schedule full date format"),t);return(0,fs.isRTL)()?`$s} $n}`:`$n} $s}`}function um(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}const pm=3,mm={per_page:10,orderby:"count",order:"desc",hide_empty:!0,_fields:"id,name,count",context:"view"};function hm({onSelect:e,taxonomy:t}){const{_terms:s,showTerms:n}=(0,d.useSelect)((e=>{const s=e(u.store).getEntityRecords("taxonomy",t.slug,mm);return{_terms:s,showTerms:s?.length>=pm}}),[t.slug]);if(!n)return null;const o=Md(s);return(0,c.jsxs)("div",{className:"editor-post-taxonomies__flat-term-most-used",children:[(0,c.jsx)(Fn.BaseControl.VisualLabel,{as:"h3",className:"editor-post-taxonomies__flat-term-most-used-label",children:t.labels.most_used}),(0,c.jsx)("ul",{role:"list",className:"editor-post-taxonomies__flat-term-most-used-list",children:o.map((t=>(0,c.jsx)("li",{children:(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>e(t),children:t.name})},t.id)))})]})}const gm=[],_m=100,fm={per_page:_m,_fields:"id,name",context:"view"},bm=(e,t)=>Dd(e).toLowerCase()===Dd(t).toLowerCase(),ym=(e,t)=>e.map((e=>t.find((t=>bm(t.name,e)))?.id)).filter((e=>void 0!==e)),xm=({children:e,__nextHasNoMarginBottom:t})=>t?(0,c.jsx)(Fn.__experimentalVStack,{spacing:4,children:e}):(0,c.jsx)(p.Fragment,{children:e});function vm({slug:e,__nextHasNoMarginBottom:t}){const[s,n]=(0,p.useState)([]),[o,r]=(0,p.useState)(""),i=(0,m.useDebounce)(r,500);t||k()("Bottom margin styles for wp.editor.PostTaxonomiesFlatTermSelector",{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."});const{terms:a,termIds:l,taxonomy:h,hasAssignAction:g,hasCreateAction:_,hasResolvedTerms:f}=(0,d.useSelect)((t=>{const{getCurrentPost:s,getEditedPostAttribute:n}=t(xc),{getEntityRecords:o,getEntityRecord:r,hasFinishedResolution:i}=t(u.store),a=s(),l=r("root","taxonomy",e),c=l?n(l.rest_base):gm,d={...fm,include:c?.join(","),per_page:-1};return{hasCreateAction:!!l&&(a._links?.["wp:action-create-"+l.rest_base]??!1),hasAssignAction:!!l&&(a._links?.["wp:action-assign-"+l.rest_base]??!1),taxonomy:l,termIds:c,terms:c?.length?o("taxonomy",e,d):gm,hasResolvedTerms:i("getEntityRecords",["taxonomy",e,d])}}),[e]),{searchResults:b}=(0,d.useSelect)((t=>{const{getEntityRecords:s}=t(u.store);return{searchResults:o?s("taxonomy",e,{...fm,search:o}):gm}}),[o,e]);(0,p.useEffect)((()=>{if(f){const e=(a??[]).map((e=>Dd(e.name)));n(e)}}),[a,f]);const y=(0,p.useMemo)((()=>(b??[]).map((e=>Dd(e.name)))),[b]),{editPost:x}=(0,d.useDispatch)(xc),{saveEntityRecord:v}=(0,d.useDispatch)(u.store),{createErrorNotice:w}=(0,d.useDispatch)(_s.store);if(!g)return null;function S(e){x({[h.rest_base]:e})}const C=h?.labels?.add_new_item??("post_tag"===e?(0,fs.__)("Add Tag"):(0,fs.__)("Add Term")),P=h?.labels?.singular_name??("post_tag"===e?(0,fs.__)("Tag"):(0,fs.__)("Term")),j=(0,fs.sprintf)((0,fs._x)("%s added","term"),P),E=(0,fs.sprintf)((0,fs._x)("%s removed","term"),P),T=(0,fs.sprintf)((0,fs._x)("Remove %s","term"),P);return(0,c.jsxs)(xm,{__nextHasNoMarginBottom:t,children:[(0,c.jsx)(Fn.FormTokenField,{__next40pxDefaultSize:!0,value:s,suggestions:y,onChange:function(t){const s=[...a??[],...b??[]],o=t.reduce(((e,t)=>(e.some((e=>e.toLowerCase()===t.toLowerCase()))||e.push(t),e)),[]),r=o.filter((e=>!s.find((t=>bm(t.name,e)))));n(o),0!==r.length?_&&Promise.all(r.map((t=>async function(t){try{const s=await v("taxonomy",e,t,{throwOnError:!0});return Ad(s)}catch(e){if("term_exists"!==e.code)throw e;return{id:e.data.term_id,name:t.name}}}({name:t})))).then((e=>{const t=s.concat(e);S(ym(o,t))})).catch((e=>{w(e.message,{type:"snackbar"}),S(ym(o,s))})):S(ym(o,s))},onInputChange:i,maxSuggestions:_m,label:C,messages:{added:j,removed:E,remove:T},__nextHasNoMarginBottom:t}),(0,c.jsx)(hm,{taxonomy:h,onSelect:function(t){if(l.includes(t.id))return;const s=[...l,t.id],n="post_tag"===e?(0,fs.__)("Tag"):(0,fs.__)("Term"),o=(0,fs.sprintf)((0,fs._x)("%s added","term"),h?.labels?.singular_name??n);(0,ms.speak)(o,"assertive"),S(s)}})]})}var wm=(0,Fn.withFilters)("editor.PostTaxonomyType")(vm);const Sm=()=>{const e=(0,d.useSelect)((e=>{const t=e(u.store).getTaxonomy("post_tag");return t?.labels}),[]),t=e?.add_new_item??(0,fs.__)("Add tag"),s=e?.name??(0,fs.__)("Tags"),n=[(0,fs.__)("Suggestion:"),(0,c.jsx)("span",{className:"editor-post-publish-panel__link",children:t},"label")];return(0,c.jsxs)(Fn.PanelBody,{initialOpen:!1,title:n,children:[(0,c.jsx)("p",{children:(0,fs.sprintf)((0,fs.__)("%s help users and search engines navigate your site and find your content. Add a few keywords to describe your post."),s)}),(0,c.jsx)(wm,{slug:"post_tag",__nextHasNoMarginBottom:!0})]})};var km=()=>{const{postHasTags:e,siteHasTags:t,isPostTypeSupported:s}=(0,d.useSelect)((e=>{const t=e(xc).getCurrentPostType(),s=e(u.store).getEntityRecord("root","taxonomy","post_tag"),n=s?.types?.includes(t),o=void 0!==s,r=s&&e(xc).getEditedPostAttribute(s.rest_base),i=!!n&&!!e(u.store).getEntityRecords("taxonomy","post_tag",{per_page:1})?.length;return{postHasTags:!!r?.length,siteHasTags:i,isPostTypeSupported:o&&n}}),[]),[n]=(0,p.useState)(e);return s&&t?n?null:(0,c.jsx)(Sm,{}):null};const Cm=(e,t)=>Cp.filter((t=>e?.includes(t.id))).find((e=>e.id===t)),Pm=({suggestedPostFormat:e,suggestionText:t,onUpdatePostFormat:s})=>(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>s(e),children:t});function jm(){const{currentPostFormat:e,suggestion:t}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:s}=e(xc),n=e(u.store).getThemeSupports().formats??[];return{currentPostFormat:t("format"),suggestion:Cm(n,s())}}),[]),{editPost:s}=(0,d.useDispatch)(xc),n=[(0,fs.__)("Suggestion:"),(0,c.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,fs.__)("Use a post format")},"label")];return t&&t.id!==e?(0,c.jsxs)(Fn.PanelBody,{initialOpen:!1,title:n,children:[(0,c.jsx)("p",{children:(0,fs.__)("Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.")}),(0,c.jsx)("p",{children:(0,c.jsx)(Pm,{onUpdatePostFormat:e=>s({format:e}),suggestedPostFormat:t.id,suggestionText:(0,fs.sprintf)((0,fs.__)('Apply the "%1$s" format.'),t.caption)})})]}):null}const{normalizeTextString:Em}=$(Fn.privateApis),{RECEIVE_INTERMEDIATE_RESULTS:Tm}=$(u.privateApis),Bm={per_page:-1,orderby:"name",order:"asc",_fields:"id,name,parent",context:"view",[Tm]:!0},Im=8,Nm=[];function Rm({slug:e}){const[t,s]=(0,p.useState)(!1),[n,o]=(0,p.useState)(""),[r,i]=(0,p.useState)(""),[a,l]=(0,p.useState)(!1),[h,g]=(0,p.useState)(""),[_,f]=(0,p.useState)([]),b=(0,m.useDebounce)(ms.speak,500),{hasCreateAction:y,hasAssignAction:x,terms:v,loading:w,availableTerms:S,taxonomy:k}=(0,d.useSelect)((t=>{const{getCurrentPost:s,getEditedPostAttribute:n}=t(xc),{getEntityRecord:o,getEntityRecords:r,isResolving:i}=t(u.store),a=o("root","taxonomy",e),l=s();return{hasCreateAction:!!a&&!!l._links?.["wp:action-create-"+a.rest_base],hasAssignAction:!!a&&!!l._links?.["wp:action-assign-"+a.rest_base],terms:a?n(a.rest_base):Nm,loading:i("getEntityRecords",["taxonomy",e,Bm]),availableTerms:r("taxonomy",e,Bm)||Nm,taxonomy:a}}),[e]),{editPost:C}=(0,d.useDispatch)(xc),{saveEntityRecord:P}=(0,d.useDispatch)(u.store),j=(0,p.useMemo)((()=>function(e,t){const s=e=>-1!==t.indexOf(e.id)||void 0!==e.children&&e.children.map(s).filter((e=>e)).length>0,n=[...e];return n.sort(((e,t)=>{const n=s(e),o=s(t);return n===o?0:n&&!o?-1:!n&&o?1:0})),n}(Rd(S),v)),[S]),{createErrorNotice:E}=(0,d.useDispatch)(_s.store);if(!x)return null;const T=e=>{C({[k.rest_base]:e})},B=e=>e.map((e=>(0,c.jsxs)("div",{className:"editor-post-taxonomies__hierarchical-terms-choice",children:[(0,c.jsx)(Fn.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:-1!==v.indexOf(e.id),onChange:()=>{(e=>{const t=v.includes(e)?v.filter((t=>t!==e)):[...v,e];T(t)})(parseInt(e.id,10))},label:(0,Ln.decodeEntities)(e.name)}),!!e.children.length&&(0,c.jsx)("div",{className:"editor-post-taxonomies__hierarchical-terms-subchoices",children:B(e.children)})]},e.id))),I=(t,s,n)=>k?.labels?.[t]??("category"===e?s:n),N=I("add_new_item",(0,fs.__)("Add Category"),(0,fs.__)("Add Term")),R=I("new_item_name",(0,fs.__)("Add Category"),(0,fs.__)("Add Term")),D=I("parent_item",(0,fs.__)("Parent Category"),(0,fs.__)("Parent Term")),A=`— $D} —`,M=N,L=k?.labels?.search_items??(0,fs.__)("Search Terms"),O=k?.name??(0,fs.__)("Terms"),F=S.length>=Im;return(0,c.jsxs)(Fn.Flex,{direction:"column",gap:"4",children:[F&&!w&&(0,c.jsx)(Fn.SearchControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:L,placeholder:L,value:h,onChange:e=>{const t=j.map(function(e){const t=s=>{if(""===e)return s;const n={...s};return n.children.length>0&&(n.children=n.children.map(t).filter((e=>e))),(-1!==Em(n.name).indexOf(Em(e))||n.children.length>0)&&n};return t}(e)).filter((e=>e)),s=e=>{let t=0;for(let n=0;n<e.length;n++)t++,void 0!==e[n].children&&(t+=s(e[n].children));return t};g(e),f(t);const n=s(t),o=(0,fs.sprintf)((0,fs._n)("%d result found.","%d results found.",n),n);b(o,"assertive")}}),w&&(0,c.jsx)(Fn.Flex,{justify:"center",style:{height:"40px"},children:(0,c.jsx)(Fn.Spinner,{})}),(0,c.jsx)("div",{className:"editor-post-taxonomies__hierarchical-terms-list",tabIndex:"0",role:"group","aria-label":O,children:B(""!==h?_:j)}),!w&&y&&(0,c.jsx)(Fn.FlexItem,{children:(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,onClick:()=>{l(!a)},className:"editor-post-taxonomies__hierarchical-terms-add","aria-expanded":a,variant:"link",children:N})}),a&&(0,c.jsx)("form",{onSubmit:async a=>{if(a.preventDefault(),""===n||t)return;const l=function(e,t,s){return e.find((e=>(!e.parent&&!t||parseInt(e.parent)===parseInt(t))&&e.name.toLowerCase()===s.toLowerCase()))}(S,r,n);if(l)return v.some((e=>e===l.id))||T([...v,l.id]),o(""),void i("");let c;s(!0);try{c=await(d={name:n,parent:r||void 0},P("taxonomy",e,d,{throwOnError:!0}))}catch(e){return void E(e.message,{type:"snackbar"})}var d;const u="category"===e?(0,fs.__)("Category"):(0,fs.__)("Term"),p=(0,fs.sprintf)((0,fs._x)("%s added","term"),k?.labels?.singular_name??u);(0,ms.speak)(p,"assertive"),s(!1),o(""),i(""),T([...v,c.id])},children:(0,c.jsxs)(Fn.Flex,{direction:"column",gap:"4",children:[(0,c.jsx)(Fn.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"editor-post-taxonomies__hierarchical-terms-input",label:R,value:n,onChange:e=>{o(e)},required:!0}),!!S.length&&(0,c.jsx)(Fn.TreeSelect,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:D,noOptionLabel:A,onChange:e=>{i(e)},selectedId:r,tree:j}),(0,c.jsx)(Fn.FlexItem,{children:(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"secondary",type:"submit",className:"editor-post-taxonomies__hierarchical-terms-submit",children:M})})]})})]})}var Dm=(0,Fn.withFilters)("editor.PostTaxonomyType")(Rm);var Am=function(){const{hasNoCategory:e,hasSiteCategories:t}=(0,d.useSelect)((e=>{const t=e(xc).getCurrentPostType(),{canUser:s,getEntityRecord:n}=e(u.store),o=n("root","taxonomy","category"),r=s("read",{kind:"root",name:"site"})?n("root","site")?.default_category:void 0,i=r?n("taxonomy","category",r):void 0,a=o&&o.types.some((e=>e===t)),l=o&&e(xc).getEditedPostAttribute(o.rest_base),c=!!a&&!!e(u.store).getEntityRecords("taxonomy","category",{exclude:[r],per_page:1})?.length;return{hasNoCategory:!!o&&!!i&&a&&(0===l?.length||1===l?.length&&i?.id===l[0]),hasSiteCategories:c}}),[]),[s,n]=(0,p.useState)(!1);if((0,p.useEffect)((()=>{e&&n(!0)}),[e]),!s||!t)return null;const o=[(0,fs.__)("Suggestion:"),(0,c.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,fs.__)("Assign a category")},"label")];return(0,c.jsxs)(Fn.PanelBody,{initialOpen:!1,title:o,children:[(0,c.jsx)("p",{children:(0,fs.__)("Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.")}),(0,c.jsx)(Dm,{slug:"category"})]})};function Mm(e){return Object.fromEntries(Object.entries(function(e){const t=new Set;return Object.fromEntries(e.map((e=>{const s=(0,w.getFilename)(e);let n="";if(s){const e=s.split(".");e.length>1&&e.pop(),n=e.join(".")}return n||(n=bi()),t.has(n)&&(n=`$n}-$bi()}`),t.add(n),[e,n]})))}(e)).map((([e,t])=>{const s=window.fetch(e.includes("?")?e:e+"?").then((e=>e.blob())).then((e=>new File([e],`$t}.png`,{type:e.type})));return[e,s]})))}function Lm(e){const t=[];return e.forEach((e=>{t.push(e),t.push(...Lm(e.innerBlocks))})),t}function Om(e){if("core/image"===e.name||"core/cover"===e.name){const{url:t,alt:s,id:n}=e.attributes;return{url:t,alt:s,id:n}}if("core/media-text"===e.name){const{mediaUrl:t,mediaAlt:s,mediaId:n}=e.attributes;return{url:t,alt:s,id:n}}return{}}function Fm({clientId:e,alt:t,url:s}){const{selectBlock:n}=(0,d.useDispatch)(g.store);return(0,c.jsx)(Fn.__unstableMotion.img,{tabIndex:0,role:"button","aria-label":(0,fs.__)("Select image block."),onClick:()=>{n(e)},onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(n(e),t.preventDefault())},alt:t,src:s,animate:{opacity:1},exit:{opacity:0,scale:0},style:{width:"32px",height:"32px",objectFit:"cover",borderRadius:"2px",cursor:"pointer"},whileHover:{scale:1.08}},e)}function Vm(){const[e,t]=(0,p.useState)(!1),[s,n]=(0,p.useState)(!1),[o,r]=(0,p.useState)(!1),{editorBlocks:i,mediaUpload:a}=(0,d.useSelect)((e=>({editorBlocks:e(g.store).getBlocks(),mediaUpload:e(g.store).getSettings().mediaUpload})),[]),l=Lm(i).filter((e=>function(e){return"core/image"===e.name||"core/cover"===e.name?e.attributes.url&&!e.attributes.id:"core/media-text"===e.name?e.attributes.mediaUrl&&!e.attributes.mediaId:void 0}(e))),{updateBlockAttributes:u}=(0,d.useDispatch)(g.store);if(!a||!l.length)return null;const m=[(0,fs.__)("Suggestion:"),(0,c.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,fs.__)("External media")},"label")];return(0,c.jsxs)(Fn.PanelBody,{initialOpen:!0,title:m,children:[(0,c.jsx)("p",{children:(0,fs.__)("Upload external images to the Media Library. Images from different domains may load slowly, display incorrectly, or be removed unexpectedly.")}),(0,c.jsxs)("div",{style:{display:"inline-flex",flexWrap:"wrap",gap:"8px"},children:[(0,c.jsx)(Fn.__unstableAnimatePresence,{onExitComplete:()=>n(!1),children:l.map((e=>{const{url:t,alt:s}=Om(e);return(0,c.jsx)(Fm,{clientId:e.clientId,url:t,alt:s},e.clientId)}))}),e||s?(0,c.jsx)(Fn.Spinner,{}):(0,c.jsx)(Fn.Button,{size:"compact",variant:"primary",onClick:function(){t(!0),r(!1);const e=new Set(l.map((e=>{const{url:t}=Om(e);return t}))),s=Object.fromEntries(Object.entries(Mm([...e])).map((([e,t])=>[e,t.then((e=>new Promise(((t,s)=>{a({filesList:[e],onFileChange:([e])=>{(0,$o.isBlobURL)(e.url)||t(e)},onError(){s()}})}))))])));Promise.allSettled(l.map((e=>{const{url:t}=Om(e);return s[t].then((t=>function(e,t){"core/image"!==e.name&&"core/cover"!==e.name||u(e.clientId,{id:t.id,url:t.url}),"core/media-text"===e.name&&u(e.clientId,{mediaId:t.id,mediaUrl:t.url})}(e,t))).then((()=>n(!0))).catch((()=>r(!0)))}))).finally((()=>{t(!1)}))},children:(0,fs._x)("Upload","verb")})]}),o&&(0,c.jsx)("p",{children:(0,fs.__)("Upload failed, try again.")})]})}var Um=function({children:e}){const{isBeingScheduled:t,isRequestingSiteIcon:s,hasPublishAction:n,siteIconUrl:o,siteTitle:r,siteHome:i}=(0,d.useSelect)((e=>{const{getCurrentPost:t,isEditedPostBeingScheduled:s}=e(xc),{getEntityRecord:n,isResolving:o}=e(u.store),r=n("root","__unstableBase",void 0)||{};return{hasPublishAction:t()._links?.["wp:action-publish"]??!1,isBeingScheduled:s(),isRequestingSiteIcon:o("getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:r.site_icon_url,siteTitle:r.name,siteHome:r.home&&(0,w.filterURLForDisplay)(r.home)}}),[]);let a,l,p=(0,c.jsx)(Fn.Icon,{className:"components-site-icon",size:"36px",icon:Vp});return o&&(p=(0,c.jsx)("img",{alt:(0,fs.__)("Site Icon"),className:"components-site-icon",src:o})),s&&(p=null),n?t?(a=(0,fs.__)("Are you ready to schedule?"),l=(0,fs.__)("Your work will be published at the specified date and time.")):(a=(0,fs.__)("Are you ready to publish?"),l=(0,fs.__)("Double-check your settings before publishing.")):(a=(0,fs.__)("Are you ready to submit for review?"),l=(0,fs.__)("Your work will be reviewed and then approved.")),(0,c.jsxs)("div",{className:"editor-post-publish-panel__prepublish",children:[(0,c.jsx)("div",{children:(0,c.jsx)("strong",{children:a})}),(0,c.jsx)("p",{children:l}),(0,c.jsxs)("div",{className:"components-site-card",children:[p,(0,c.jsxs)("div",{className:"components-site-info",children:[(0,c.jsx)("span",{className:"components-site-name",children:(0,Ln.decodeEntities)(r)||(0,fs.__)("(Untitled)")}),(0,c.jsx)("span",{className:"components-site-home",children:i})]})]}),(0,c.jsx)(Vm,{}),n&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Fn.PanelBody,{initialOpen:!1,title:[(0,fs.__)("Visibility:"),(0,c.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,c.jsx)(Hp,{})},"label")],children:(0,c.jsx)(zp,{})}),(0,c.jsx)(Fn.PanelBody,{initialOpen:!1,title:[(0,fs.__)("Publish:"),(0,c.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,c.jsx)(lm,{})},"label")],children:(0,c.jsx)(im,{})})]}),(0,c.jsx)(jm,{}),(0,c.jsx)(km,{}),(0,c.jsx)(Am,{}),e]})};const zm="%postname%",Hm="%pagename%";function Gm({text:e}){const[t,s]=(0,p.useState)(!1),n=(0,p.useRef)(),o=(0,m.useCopyToClipboard)(e,(()=>{s(!0),n.current&&clearTimeout(n.current),n.current=setTimeout((()=>{s(!1)}),4e3)}));return(0,p.useEffect)((()=>()=>{n.current&&clearTimeout(n.current)}),[]),(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"secondary",ref:o,children:t?(0,fs.__)("Copied!"):(0,fs.__)("Copy")})}function $m({focusOnMount:e,children:t}){const{post:s,postType:n,isScheduled:o}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPost:s,isCurrentPostScheduled:n}=e(xc),{getPostType:o}=e(u.store);return{post:s(),postType:o(t("type")),isScheduled:n()}}),[]),r=n?.labels?.singular_name,i=n?.labels?.view_item,a=n?.labels?.add_new_item,l="future"===s.status?(e=>{const{slug:t}=e;return e.permalink_template.includes(zm)?e.permalink_template.replace(zm,t):e.permalink_template.includes(Hm)?e.permalink_template.replace(Hm,t):e.permalink_template})(s):s.link,m=(0,w.addQueryArgs)("post-new.php",{post_type:s.type}),h=(0,p.useCallback)((t=>{e&&t&&t.focus()}),[e]),g=o?(0,c.jsxs)(c.Fragment,{children:[(0,fs.__)("is now scheduled. It will go live on")," ",(0,c.jsx)(lm,{}),"."]}):(0,fs.__)("is now live.");return(0,c.jsxs)("div",{className:"post-publish-panel__postpublish",children:[(0,c.jsxs)(Fn.PanelBody,{className:"post-publish-panel__postpublish-header",children:[(0,c.jsx)(Fn.ExternalLink,{ref:h,href:l,children:(0,Ln.decodeEntities)(s.title)||(0,fs.__)("(no title)")})," ",g]}),(0,c.jsxs)(Fn.PanelBody,{children:[(0,c.jsx)("p",{className:"post-publish-panel__postpublish-subheader",children:(0,c.jsx)("strong",{children:(0,fs.__)("What’s next?")})}),(0,c.jsxs)("div",{className:"post-publish-panel__postpublish-post-address-container",children:[(0,c.jsx)(Fn.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"post-publish-panel__postpublish-post-address",readOnly:!0,label:(0,fs.sprintf)((0,fs.__)("%s address"),r),value:(0,w.safeDecodeURIComponent)(l),onFocus:e=>e.target.select()}),(0,c.jsx)("div",{className:"post-publish-panel__postpublish-post-address__copy-button-wrap",children:(0,c.jsx)(Gm,{text:l})})]}),(0,c.jsxs)("div",{className:"post-publish-panel__postpublish-buttons",children:[!o&&(0,c.jsxs)(Fn.Button,{variant:"primary",href:l,__next40pxDefaultSize:!0,icon:Gn,iconPosition:"right",target:"_blank",children:[i,(0,c.jsx)(Fn.VisuallyHidden,{as:"span",children:(0,fs.__)("(opens in a new tab)")})]}),(0,c.jsx)(Fn.Button,{variant:o?"primary":"secondary",__next40pxDefaultSize:!0,href:m,children:a})]})]}),t]})}class Wm extends p.Component{constructor(){super(...arguments),this.onSubmit=this.onSubmit.bind(this),this.cancelButtonNode=(0,p.createRef)()}componentDidMount(){this.timeoutID=setTimeout((()=>{this.cancelButtonNode.current.focus()}),0)}componentWillUnmount(){clearTimeout(this.timeoutID)}componentDidUpdate(e){(e.isPublished&&!this.props.isSaving&&this.props.isDirty||this.props.currentPostId!==e.currentPostId)&&this.props.onClose()}onSubmit(){const{onClose:e,hasPublishAction:t,isPostTypeViewable:s}=this.props;t&&s||e()}render(){const{forceIsDirty:e,isBeingScheduled:t,isPublished:s,isPublishSidebarEnabled:n,isScheduled:o,isSaving:r,isSavingNonPostEntityChanges:i,onClose:a,onTogglePublishSidebar:l,PostPublishExtension:d,PrePublishExtension:u,currentPostId:p,...m}=this.props,{hasPublishAction:h,isDirty:g,isPostTypeViewable:_,...f}=m,b=s||o&&t,y=!b&&!r,x=b&&!r;return(0,c.jsxs)("div",{className:"editor-post-publish-panel",...f,children:[(0,c.jsx)("div",{className:"editor-post-publish-panel__header",children:x?(0,c.jsx)(Fn.Button,{size:"compact",onClick:a,icon:ca,label:(0,fs.__)("Close panel")}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"editor-post-publish-panel__header-cancel-button",children:(0,c.jsx)(Fn.Button,{ref:this.cancelButtonNode,accessibleWhenDisabled:!0,disabled:i,onClick:a,variant:"secondary",size:"compact",children:(0,fs.__)("Cancel")})}),(0,c.jsx)("div",{className:"editor-post-publish-panel__header-publish-button",children:(0,c.jsx)(Fp,{onSubmit:this.onSubmit,forceIsDirty:e})})]})}),(0,c.jsxs)("div",{className:"editor-post-publish-panel__content",children:[y&&(0,c.jsx)(Um,{children:u&&(0,c.jsx)(u,{})}),x&&(0,c.jsx)($m,{focusOnMount:!0,children:d&&(0,c.jsx)(d,{})}),r&&(0,c.jsx)(Fn.Spinner,{})]}),(0,c.jsx)("div",{className:"editor-post-publish-panel__footer",children:(0,c.jsx)(Fn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Always show pre-publish checks."),checked:n,onChange:l})})]})}}var Zm=(0,m.compose)([(0,d.withSelect)((e=>{const{getPostType:t}=e(u.store),{getCurrentPost:s,getCurrentPostId:n,getEditedPostAttribute:o,isCurrentPostPublished:r,isCurrentPostScheduled:i,isEditedPostBeingScheduled:a,isEditedPostDirty:l,isAutosavingPost:c,isSavingPost:d,isSavingNonPostEntityChanges:p}=e(xc),{isPublishSidebarEnabled:m}=e(xc),h=t(o("type"));return{hasPublishAction:s()._links?.["wp:action-publish"]??!1,isPostTypeViewable:h?.viewable,isBeingScheduled:a(),isDirty:l(),isPublished:r(),isPublishSidebarEnabled:m(),isSaving:d()&&!c(),isSavingNonPostEntityChanges:p(),isScheduled:i(),currentPostId:n()}})),(0,d.withDispatch)(((e,{isPublishSidebarEnabled:t})=>{const{disablePublishSidebar:s,enablePublishSidebar:n}=e(xc);return{onTogglePublishSidebar:()=>{t?s():n()}}})),Fn.withFocusReturn,Fn.withConstrainedTabbing])(Wm),Ym=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M17.3 10.1C17.3 7.60001 15.2 5.70001 12.5 5.70001C10.3 5.70001 8.4 7.10001 7.9 9.00001H7.7C5.7 9.00001 4 10.7 4 12.8C4 14.9 5.7 16.6 7.7 16.6H9.5V15.2H7.7C6.5 15.2 5.5 14.1 5.5 12.9C5.5 11.7 6.5 10.5 7.7 10.5H9L9.3 9.40001C9.7 8.10001 11 7.20001 12.5 7.20001C14.3 7.20001 15.8 8.50001 15.8 10.1V11.4L17.1 11.6C17.9 11.7 18.5 12.5 18.5 13.4C18.5 14.4 17.7 15.2 16.8 15.2H14.5V16.6H16.7C18.5 16.6 19.9 15.1 19.9 13.3C20 11.7 18.8 10.4 17.3 10.1Z M14.1245 14.2426L15.1852 13.182L12.0032 10L8.82007 13.1831L9.88072 14.2438L11.25 12.8745V18H12.75V12.8681L14.1245 14.2426Z"})}),qm=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-9c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4h1.3l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8-.1 1-.9 1.8-1.8 1.8z"})});function Km({children:e}){const{hasStickyAction:t,postType:s}=(0,d.useSelect)((e=>{const t=e(xc).getCurrentPost();return{hasStickyAction:t._links?.["wp:action-sticky"]??!1,postType:e(xc).getCurrentPostType()}}),[]);return"post"===s&&t?e:null}function Qm(){const e=(0,d.useSelect)((e=>e(xc).getEditedPostAttribute("sticky")??!1),[]),{editPost:t}=(0,d.useDispatch)(xc);return(0,c.jsx)(Km,{children:(0,c.jsx)(Fn.CheckboxControl,{className:"editor-post-sticky__checkbox-control",label:(0,fs.__)("Sticky"),help:(0,fs.__)("Pin this post to the top of the blog."),checked:e,onChange:()=>t({sticky:!e}),__nextHasNoMarginBottom:!0})})}const Xm={"auto-draft":{label:(0,fs.__)("Draft"),icon:yr},draft:{label:(0,fs.__)("Draft"),icon:yr},pending:{label:(0,fs.__)("Pending"),icon:vr},private:{label:(0,fs.__)("Private"),icon:wr},future:{label:(0,fs.__)("Scheduled"),icon:xr},publish:{label:(0,fs.__)("Published"),icon:Sr}},Jm=[{label:(0,fs.__)("Draft"),value:"draft",description:(0,fs.__)("Not ready to publish.")},{label:(0,fs.__)("Pending"),value:"pending",description:(0,fs.__)("Waiting for review before publishing.")},{label:(0,fs.__)("Private"),value:"private",description:(0,fs.__)("Only visible to site admins and editors.")},{label:(0,fs.__)("Scheduled"),value:"future",description:(0,fs.__)("Publish automatically on a chosen date.")},{label:(0,fs.__)("Published"),value:"publish",description:(0,fs.__)("Visible to everyone.")}],eh=[B,I,N,R];function th(){const{status:e,date:t,password:s,postId:n,postType:o,canEdit:r}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostId:s,getCurrentPostType:n,getCurrentPost:o}=e(xc);return{status:t("status"),date:t("date"),password:t("password"),postId:s(),postType:n(),canEdit:o()._links?.["wp:action-publish"]??!1}}),[]),[i,a]=(0,p.useState)(!!s),l=(0,m.useInstanceId)(th,"editor-change-status__password-input"),{editEntityRecord:h}=(0,d.useDispatch)(u.store),[_,f]=(0,p.useState)(null),b=(0,p.useMemo)((()=>({anchor:_,"aria-label":(0,fs.__)("Status & visibility"),headerTitle:(0,fs.__)("Status & visibility"),placement:"left-start",offset:36,shift:!0})),[_]);if(eh.includes(o))return null;const y=({status:r=e,password:i=s,date:a=t})=>{h("postType",o,n,{status:r,date:a,password:i})},x=e=>{a(e),e||y({password:""})},v=n=>{let o=t,r=s;"future"===e&&new Date(t)>new Date&&(o=null),"private"===n&&s&&(r=""),y({status:n,date:o,password:r})};return(0,c.jsx)(Nd,{label:(0,fs.__)("Status"),ref:f,children:r?(0,c.jsx)(Fn.Dropdown,{className:"editor-post-status",contentClassName:"editor-change-status__content",popoverProps:b,focusOnMount:!0,renderToggle:({onToggle:t,isOpen:s})=>(0,c.jsx)(Fn.Button,{className:"editor-post-status__toggle",variant:"tertiary",size:"compact",onClick:t,icon:Xm[e]?.icon,"aria-label":(0,fs.sprintf)((0,fs.__)("Change status: %s"),Xm[e]?.label),"aria-expanded":s,children:Xm[e]?.label}),renderContent:({onClose:t})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Status & visibility"),onClose:t}),(0,c.jsx)("form",{onSubmit:e=>{e.preventDefault(),t()},children:(0,c.jsxs)(Fn.__experimentalVStack,{spacing:4,children:[(0,c.jsx)(Fn.RadioControl,{className:"editor-change-status__options",hideLabelFromVision:!0,label:(0,fs.__)("Status"),options:Jm,onChange:v,selected:"auto-draft"===e?"draft":e}),"future"===e&&(0,c.jsx)("div",{className:"editor-change-status__publish-date-wrapper",children:(0,c.jsx)(am,{showPopoverHeaderActions:!1,isCompact:!0})}),"private"!==e&&(0,c.jsxs)(Fn.__experimentalVStack,{as:"fieldset",spacing:4,className:"editor-change-status__password-fieldset",children:[(0,c.jsx)(Fn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Password protected"),help:(0,fs.__)("Only visible to those who know the password."),checked:i,onChange:x}),i&&(0,c.jsx)("div",{className:"editor-change-status__password-input",children:(0,c.jsx)(Fn.TextControl,{label:(0,fs.__)("Password"),onChange:e=>y({password:e}),value:s,placeholder:(0,fs.__)("Use a secure password"),type:"text",id:l,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,maxLength:255})})]}),(0,c.jsx)(Qm,{})]})})]})}):(0,c.jsx)("div",{className:"editor-post-status is-read-only",children:Xm[e]?.label})})}function sh({forceIsDirty:e}){const[t,s]=(0,p.useState)(!1),n=(0,m.useViewportMatch)("small"),{isAutosaving:o,isDirty:r,isNew:i,isPublished:a,isSaveable:l,isSaving:u,isScheduled:h,hasPublishAction:g,showIconLabels:_,postStatus:f,postStatusHasChanged:b}=(0,d.useSelect)((t=>{const{isEditedPostNew:s,isCurrentPostPublished:n,isCurrentPostScheduled:o,isEditedPostDirty:r,isSavingPost:i,isEditedPostSaveable:a,getCurrentPost:l,isAutosavingPost:c,getEditedPostAttribute:d,getPostEdits:u}=t(xc),{get:p}=t(C.store);return{isAutosaving:c(),isDirty:e||r(),isNew:s(),isPublished:n(),isSaving:i(),isSaveable:a(),isScheduled:o(),hasPublishAction:l()?._links?.["wp:action-publish"]??!1,showIconLabels:p("core","showIconLabels"),postStatus:d("status"),postStatusHasChanged:!!u()?.status}}),[e]),y="pending"===f,{savePost:x}=(0,d.useDispatch)(xc),v=(0,m.usePrevious)(u);if((0,p.useEffect)((()=>{let e;return v&&!u&&(s(!0),e=setTimeout((()=>{s(!1)}),1e3)),()=>clearTimeout(e)}),[u]),!g&&y)return null;const w=!["pending","draft","auto-draft"].includes(f)&&Jm.map((({value:e})=>e)).includes(f);if(a||h||w||b&&["pending","draft"].includes(f))return null;const S=y?(0,fs.__)("Save as pending"):(0,fs.__)("Save draft"),k=(0,fs.__)("Save"),P=t||!i&&!r,j=u||P,E=u||P||!l;let T;return u?T=o?(0,fs.__)("Autosaving"):(0,fs.__)("Saving"):P?T=(0,fs.__)("Saved"):n?T=S:_&&(T=k),(0,c.jsxs)(Fn.Button,{className:l||u?hr({"editor-post-save-draft":!j,"editor-post-saved-state":j,"is-saving":u,"is-autosaving":o,"is-saved":P,[(0,Fn.__unstableGetAnimateClassName)({type:"loading"})]:u}):void 0,onClick:E?void 0:()=>x(),shortcut:E?void 0:cl.displayShortcut.primary("s"),variant:"tertiary",size:"compact",icon:n?void 0:Ym,label:T||S,"aria-disabled":E,children:[j&&(0,c.jsx)(ti,{icon:P?Zn:qm}),T]})}function nh({children:e}){return(0,d.useSelect)((e=>e(xc).getCurrentPost()._links?.["wp:action-publish"]??!1),[])?e:null}const oh=[B,I,N,R];function rh(){const[e,t]=(0,p.useState)(null),s=(0,d.useSelect)((e=>e(xc).getCurrentPostType()),[]),n=(0,p.useMemo)((()=>({anchor:e,"aria-label":(0,fs.__)("Change publish date"),placement:"left-start",offset:36,shift:!0})),[e]),o=cm(),r=cm({full:!0});return oh.includes(s)?null:(0,c.jsx)(nh,{children:(0,c.jsx)(Nd,{label:(0,fs.__)("Publish"),ref:t,children:(0,c.jsx)(Fn.Dropdown,{popoverProps:n,focusOnMount:!0,className:"editor-post-schedule__panel-dropdown",contentClassName:"editor-post-schedule__dialog",renderToggle:({onToggle:e,isOpen:t})=>(0,c.jsx)(Fn.Button,{size:"compact",className:"editor-post-schedule__dialog-toggle",variant:"tertiary",tooltipPosition:"middle left",onClick:e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change date: %s"),o),label:r,showTooltip:o!==r,"aria-expanded":t,children:o}),renderContent:({onClose:e})=>(0,c.jsx)(im,{onClose:e})})})})}function ih(){k()("wp.editor.PostSwitchToDraftButton",{since:"6.7",version:"6.9"});const[e,t]=(0,p.useState)(!1),{editPost:s,savePost:n}=(0,d.useDispatch)(xc),{isSaving:o,isPublished:r,isScheduled:i}=(0,d.useSelect)((e=>{const{isSavingPost:t,isCurrentPostPublished:s,isCurrentPostScheduled:n}=e(xc);return{isSaving:t(),isPublished:s(),isScheduled:n()}}),[]),a=o||!r&&!i;let l,u;r?(l=(0,fs.__)("Are you sure you want to unpublish this post?"),u=(0,fs.__)("Unpublish")):i&&(l=(0,fs.__)("Are you sure you want to unschedule this post?"),u=(0,fs.__)("Unschedule"));return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,className:"editor-post-switch-to-draft",onClick:()=>{a||t(!0)},"aria-disabled":a,variant:"secondary",style:{flexGrow:"1",justifyContent:"center"},children:(0,fs.__)("Switch to draft")}),(0,c.jsx)(Fn.__experimentalConfirmDialog,{isOpen:e,onConfirm:()=>{t(!1),s({status:"draft"}),n()},onCancel:()=>t(!1),confirmButtonText:u,children:l})]})}function ah(){const{syncStatus:e,postType:t}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(xc),s=t("meta");return{syncStatus:"unsynced"===s?.wp_pattern_sync_status?"unsynced":t("wp_pattern_sync_status"),postType:t("type")}}));return"wp_block"!==t?null:(0,c.jsx)(Nd,{label:(0,fs.__)("Sync status"),children:(0,c.jsx)("div",{className:"editor-post-sync-status__value",children:"unsynced"===e?(0,fs._x)("Not synced","pattern (singular)"):(0,fs._x)("Synced","pattern (singular)")})})}const lh=e=>e;var ch=function({taxonomyWrapper:e=lh}){const{postType:t,taxonomies:s}=(0,d.useSelect)((e=>({postType:e(xc).getCurrentPostType(),taxonomies:e(u.store).getEntityRecords("root","taxonomy",{per_page:-1})})),[]);return(s??[]).filter((e=>e.types.includes(t)&&e.visibility?.show_ui)).map((t=>{const s=t.hierarchical?Dm:wm,n={slug:t.slug,...t.hierarchical?{}:{__nextHasNoMarginBottom:!0}};return(0,c.jsx)(p.Fragment,{children:e((0,c.jsx)(s,{...n}),t)},`taxonomy-$t.slug}`)}))};function dh({children:e}){const t=(0,d.useSelect)((e=>{const t=e(xc).getCurrentPostType(),s=e(u.store).getEntityRecords("root","taxonomy",{per_page:-1});return s?.some((e=>e.types.includes(t)))}),[]);return t?e:null}function uh({taxonomy:e,children:t}){const s=e?.slug,n=s?`taxonomy-panel-$s}`:"",{isEnabled:o,isOpened:r}=(0,d.useSelect)((e=>{const{isEditorPanelEnabled:t,isEditorPanelOpened:o}=e(xc);return{isEnabled:!!s&&t(n),isOpened:!!s&&o(n)}}),[n,s]),{toggleEditorPanelOpened:i}=(0,d.useDispatch)(xc);if(!o)return null;const a=e?.labels?.menu_name;return a?(0,c.jsx)(Fn.PanelBody,{title:a,opened:r,onToggle:()=>i(n),children:t}):null}function ph(){return(0,c.jsx)(dh,{children:(0,c.jsx)(ch,{taxonomyWrapper:(e,t)=>(0,c.jsx)(uh,{taxonomy:t,children:e})})})}var mh=s(4132);function hh(){const e=(0,m.useInstanceId)(hh),{content:t,blocks:s,type:n,id:o}=(0,d.useSelect)((e=>{const{getEditedEntityRecord:t}=e(u.store),{getCurrentPostType:s,getCurrentPostId:n}=e(xc),o=s(),r=n(),i=t("postType",o,r);return{content:i?.content,blocks:i?.blocks,type:o,id:r}}),[]),{editEntityRecord:r}=(0,d.useDispatch)(u.store),i=(0,p.useMemo)((()=>t instanceof Function?t({blocks:s}):s?(0,x.__unstableSerializeAndClean)(s):t),[t,s]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Fn.VisuallyHidden,{as:"label",htmlFor:`post-content-$e}`,children:(0,fs.__)("Type text or HTML")}),(0,c.jsx)(mh.A,{autoComplete:"off",dir:"auto",value:i,onChange:e=>{r("postType",n,o,{content:e.target.value,blocks:void 0,selection:void 0})},className:"editor-post-text-editor",id:`post-content-$e}`,placeholder:(0,fs.__)("Start writing with text or HTML")})]})}const gh="wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text",_h=/[\r\n]+/g;function fh(e){const t=(0,p.useRef)(),{isCleanNewPost:s}=(0,d.useSelect)((e=>{const{isCleanNewPost:t}=e(xc);return{isCleanNewPost:t()}}),[]);return(0,p.useImperativeHandle)(e,(()=>({focus:()=>{t?.current?.focus()}}))),(0,p.useEffect)((()=>{if(!t.current)return;const{defaultView:e}=t.current.ownerDocument,{name:n,parent:o}=e,r="editor-canvas"===n?o.document:e.document,{activeElement:i,body:a}=r;!s||i&&a!==i||t.current.focus()}),[s]),{ref:t}}function bh(){const{editPost:e}=(0,d.useDispatch)(xc),{title:t}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(xc);return{title:t("title")}}),[]);return{title:t,setTitle:function(t){e({title:t})}}}const yh=(0,p.forwardRef)(((e,t)=>{const{placeholder:s}=(0,d.useSelect)((e=>{const{getSettings:t}=e(g.store),{titlePlaceholder:s}=t();return{placeholder:s}}),[]),[n,o]=(0,p.useState)(!1),{ref:r}=fh(t),{title:i,setTitle:a}=bh(),[l,u]=(0,p.useState)({}),{clearSelectedBlock:h,insertBlocks:_,insertDefaultBlock:f}=(0,d.useDispatch)(g.store),b=(0,Ln.decodeEntities)(s)||(0,fs.__)("Add title"),{value:y,onChange:v,ref:w}=(0,Gc.__unstableUseRichText)({value:i,onChange(e){a(e.replace(_h," "))},placeholder:b,selectionStart:l.start,selectionEnd:l.end,onSelectionChange(e,t){u((s=>{const{start:n,end:o}=s;return n===e&&o===t?s:{start:e,end:t}}))},__unstableDisableFormats:!1});function S(e){_(e,0)}const k=hr(gh,{"is-selected":n});return(0,c.jsx)("h1",{ref:(0,m.useMergeRefs)([w,r]),contentEditable:!0,className:k,"aria-label":b,role:"textbox","aria-multiline":"true",onFocus:function(){o(!0),h()},onBlur:function(){o(!1),u({})},onKeyDown:function(e){e.keyCode===cl.ENTER&&(e.preventDefault(),f(void 0,void 0,0))},onPaste:function(e){const t=e.clipboardData;let s="",n="";try{s=t.getData("text/plain"),n=t.getData("text/html")}catch(e){return}window.console.log("Received HTML:\n\n",n),window.console.log("Received plain text:\n\n",s);const o=(0,x.pasteHandler)({HTML:n,plainText:s});if(e.preventDefault(),o.length)if("string"!=typeof o){const[e]=o;if(i||"core/heading"!==e.name&&"core/paragraph"!==e.name)S(o);else{const t=(0,Vc.__unstableStripHTML)(e.attributes.content);a(t),S(o.slice(1))}}else{const e=(0,Vc.__unstableStripHTML)(o);v((0,Gc.insert)(y,(0,Gc.create)({html:e})))}}})}));var xh=(0,p.forwardRef)(((e,t)=>(0,c.jsx)(Td,{supportKeys:"title",children:(0,c.jsx)(yh,{ref:t})})));var vh=(0,p.forwardRef)((function(e,t){const{placeholder:s}=(0,d.useSelect)((e=>{const{getSettings:t}=e(g.store),{titlePlaceholder:s}=t();return{placeholder:s}}),[]),[n,o]=(0,p.useState)(!1),{title:r,setTitle:i}=bh(),{ref:a}=fh(t),l=hr(gh,{"is-selected":n,"is-raw-text":!0}),u=(0,Ln.decodeEntities)(s)||(0,fs.__)("Add title");return(0,c.jsx)(Fn.TextareaControl,{ref:a,value:r,onChange:function(e){i(e.replace(_h," "))},onFocus:function(){o(!0)},onBlur:function(){o(!1)},label:s,className:l,placeholder:u,hideLabelFromVision:!0,autoComplete:"off",dir:"auto",rows:1,__nextHasNoMarginBottom:!0})}));function wh({children:e}){const{canTrashPost:t}=(0,d.useSelect)((e=>{const{isEditedPostNew:t,getCurrentPostId:s,getCurrentPostType:n}=e(xc),{canUser:o}=e(u.store),r=n(),i=s(),a=t(),l=!!i&&o("delete",{kind:"postType",name:r,id:i});return{canTrashPost:(!a||i)&&l&&!M.includes(r)}}),[]);return t?e:null}function Sh({onActionPerformed:e}){const t=(0,d.useRegistry)(),{isNew:s,isDeleting:n,postId:o,title:r}=(0,d.useSelect)((e=>{const t=e(xc);return{isNew:t.isEditedPostNew(),isDeleting:t.isDeletingPost(),postId:t.getCurrentPostId(),title:t.getCurrentPostAttribute("title")}}),[]),{trashPost:i}=(0,d.useDispatch)(xc),[a,l]=(0,p.useState)(!1);if(s||!o)return null;return(0,c.jsxs)(wh,{children:[(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,className:"editor-post-trash",isDestructive:!0,variant:"secondary",isBusy:n,"aria-disabled":n,onClick:n?void 0:()=>l(!0),children:(0,fs.__)("Move to trash")}),(0,c.jsx)(Fn.__experimentalConfirmDialog,{isOpen:a,onConfirm:async()=>{l(!1),await i();const s=await t.resolveSelect(xc).getCurrentPost();e?.("move-to-trash",[s])},onCancel:()=>l(!1),confirmButtonText:(0,fs.__)("Move to trash"),size:"small",children:(0,fs.sprintf)((0,fs.__)('Are you sure you want to move "%s" to the trash?'),r)})]})}function kh({onClose:e}){const{isEditable:t,postSlug:s,postLink:n,permalinkPrefix:o,permalinkSuffix:r,permalink:i}=(0,d.useSelect)((e=>{const t=e(xc).getCurrentPost(),s=e(xc).getCurrentPostType(),n=e(u.store).getPostType(s),o=e(xc).getPermalinkParts(),r=t?._links?.["wp:action-publish"]??!1;return{isEditable:e(xc).isPermalinkEditable()&&r,postSlug:(0,w.safeDecodeURIComponent)(e(xc).getEditedPostSlug()),viewPostLabel:n?.labels.view_item,postLink:t.link,permalinkPrefix:o?.prefix,permalinkSuffix:o?.suffix,permalink:(0,w.safeDecodeURIComponent)(e(xc).getPermalink())}}),[]),{editPost:a}=(0,d.useDispatch)(xc),{createNotice:l}=(0,d.useDispatch)(_s.store),[h,_]=(0,p.useState)(!1),f=(0,m.useCopyToClipboard)(i,(()=>{l("info",(0,fs.__)("Copied Permalink to clipboard."),{isDismissible:!0,type:"snackbar"})})),b="editor-post-url__slug-description-"+(0,m.useInstanceId)(kh);return(0,c.jsxs)("div",{className:"editor-post-url",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Slug"),onClose:e}),(0,c.jsxs)(Fn.__experimentalVStack,{spacing:3,children:[t&&(0,c.jsx)("p",{className:"editor-post-url__intro",children:(0,p.createInterpolateElement)((0,fs.__)("<span>Customize the last part of the Permalink.</span> <a>Learn more.</a>"),{span:(0,c.jsx)("span",{id:b}),a:(0,c.jsx)(Fn.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink")})})}),(0,c.jsxs)("div",{children:[t&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Fn.__experimentalInputControl,{__next40pxDefaultSize:!0,prefix:(0,c.jsx)(Fn.__experimentalInputControlPrefixWrapper,{children:"/"}),suffix:(0,c.jsx)(Fn.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,c.jsx)(Fn.Button,{icon:Br,ref:f,size:"small",label:"Copy"})}),label:(0,fs.__)("Slug"),hideLabelFromVision:!0,value:h?"":s,autoComplete:"off",spellCheck:"false",type:"text",className:"editor-post-url__input",onChange:e=>{a({slug:e}),e?h&&_(!1):h||_(!0)},onBlur:e=>{a({slug:(0,w.cleanForSlug)(e.target.value)}),h&&_(!1)},"aria-describedby":b}),(0,c.jsxs)("p",{className:"editor-post-url__permalink",children:[(0,c.jsx)("span",{className:"editor-post-url__permalink-visual-label",children:(0,fs.__)("Permalink:")}),(0,c.jsxs)(Fn.ExternalLink,{className:"editor-post-url__link",href:n,target:"_blank",children:[(0,c.jsx)("span",{className:"editor-post-url__link-prefix",children:o}),(0,c.jsx)("span",{className:"editor-post-url__link-slug",children:s}),(0,c.jsx)("span",{className:"editor-post-url__link-suffix",children:r})]})]})]}),!t&&(0,c.jsx)(Fn.ExternalLink,{className:"editor-post-url__link",href:n,target:"_blank",children:n})]})]})]})}function Ch({children:e}){const t=(0,d.useSelect)((e=>{const t=e(xc).getCurrentPostType(),s=e(u.store).getPostType(t);if(!s?.viewable)return!1;if(!e(xc).getCurrentPost().link)return!1;return!!e(xc).getPermalinkParts()}),[]);return t?e:null}function Ph(){return jh()}function jh(){const e=(0,d.useSelect)((e=>e(xc).getPermalink()),[]);return(0,w.filterURLForDisplay)((0,w.safeDecodeURIComponent)(e))}function Eh(){const{isFrontPage:e}=(0,d.useSelect)((e=>{const{getCurrentPostId:t}=e(xc),{getEditedEntityRecord:s,canUser:n}=e(u.store),o=n("read",{kind:"root",name:"site"})?s("root","site"):void 0,r=t();return{isFrontPage:o?.page_on_front===r}}),[]),[t,s]=(0,p.useState)(null),n=(0,p.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]),o=e?(0,fs.__)("Link"):(0,fs.__)("Slug");return(0,c.jsx)(Ch,{children:(0,c.jsxs)(Nd,{label:o,ref:s,children:[!e&&(0,c.jsx)(Fn.Dropdown,{popoverProps:n,className:"editor-post-url__panel-dropdown",contentClassName:"editor-post-url__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(Th,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,c.jsx)(kh,{onClose:e})}),e&&(0,c.jsx)(Bh,{})]})})}function Th({isOpen:e,onClick:t}){const{slug:s}=(0,d.useSelect)((e=>({slug:e(xc).getEditedPostSlug()})),[]),n=(0,w.safeDecodeURIComponent)(s);return(0,c.jsx)(Fn.Button,{size:"compact",className:"editor-post-url__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change link: %s"),n),onClick:t,children:(0,c.jsx)(c.Fragment,{children:n})})}function Bh(){const{postLink:e}=(0,d.useSelect)((e=>{const{getCurrentPost:t}=e(xc);return{postLink:t()?.link}}),[]);return(0,c.jsx)(Fn.ExternalLink,{className:"editor-post-url__front-page-link",href:e,target:"_blank",children:e})}function Ih({render:e}){return e({canEdit:(0,d.useSelect)((e=>e(xc).getCurrentPost()._links?.["wp:action-publish"]??!1))})}var Nh=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"})});const Rh=window.wp.wordcount;function Dh(){const e=(0,d.useSelect)((e=>e(xc).getEditedPostAttribute("content")),[]),t=(0,fs._x)("words","Word count type. Do not translate!");return(0,c.jsx)("span",{className:"word-count",children:(0,Rh.count)(e,t)})}const Ah=189;function Mh(){const e=(0,d.useSelect)((e=>e(xc).getEditedPostAttribute("content")),[]),t=(0,fs._x)("words","Word count type. Do not translate!"),s=Math.round((0,Rh.count)(e,t)/Ah),n=0===s?(0,p.createInterpolateElement)((0,fs.__)("<span>< 1</span> minute"),{span:(0,c.jsx)("span",{})}):(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs._n)("<span>%s</span> minute","<span>%s</span> minutes",s),s),{span:(0,c.jsx)("span",{})});return(0,c.jsx)("span",{className:"time-to-read",children:n})}function Lh(){const e=(0,d.useSelect)((e=>e(xc).getEditedPostAttribute("content")),[]);return(0,Rh.count)(e,"characters_including_spaces")}var Oh=function({hasOutlineItemsDisabled:e,onRequestClose:t}){const{headingCount:s,paragraphCount:n,numberOfBlocks:o}=(0,d.useSelect)((e=>{const{getGlobalBlockCount:t}=e(g.store);return{headingCount:t("core/heading"),paragraphCount:t("core/paragraph"),numberOfBlocks:t()}}),[]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"table-of-contents__wrapper",role:"note","aria-label":(0,fs.__)("Document Statistics"),tabIndex:"0",children:(0,c.jsxs)("ul",{role:"list",className:"table-of-contents__counts",children:[(0,c.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Words"),(0,c.jsx)(Dh,{})]}),(0,c.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Characters"),(0,c.jsx)("span",{className:"table-of-contents__number",children:(0,c.jsx)(Lh,{})})]}),(0,c.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Time to read"),(0,c.jsx)(Mh,{})]}),(0,c.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Headings"),(0,c.jsx)("span",{className:"table-of-contents__number",children:s})]}),(0,c.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Paragraphs"),(0,c.jsx)("span",{className:"table-of-contents__number",children:n})]}),(0,c.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Blocks"),(0,c.jsx)("span",{className:"table-of-contents__number",children:o})]})]})}),s>0&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("hr",{}),(0,c.jsx)("h2",{className:"table-of-contents__title",children:(0,fs.__)("Document Outline")}),(0,c.jsx)(Jc,{onSelect:t,hasOutlineItemsDisabled:e})]})]})};var Fh=(0,p.forwardRef)((function({hasOutlineItemsDisabled:e,repositionDropdown:t,...s},n){const o=(0,d.useSelect)((e=>!!e(g.store).getBlockCount()),[]);return(0,c.jsx)(Fn.Dropdown,{popoverProps:{placement:t?"right":"bottom"},className:"table-of-contents",contentClassName:"table-of-contents__popover",renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,...s,ref:n,onClick:o?t:void 0,icon:Nh,"aria-expanded":e,"aria-haspopup":"true",label:(0,fs.__)("Details"),tooltipPosition:"bottom","aria-disabled":!o}),renderContent:({onClose:t})=>(0,c.jsx)(Oh,{onRequestClose:t,hasOutlineItemsDisabled:e})})}));function Vh(){const{__experimentalGetDirtyEntityRecords:e}=(0,d.useSelect)(u.store);return(0,p.useEffect)((()=>{const t=t=>{if(e().length>0)return t.returnValue=(0,fs.__)("You have unsaved changes. If you proceed, they will be lost."),t.returnValue};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}}),[e]),null}const Uh=window.wp.serverSideRender;var zh=s.n(Uh);function Hh(e,t,s=[]){const n=(0,p.forwardRef)(((s,n)=>(k()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),(0,c.jsx)(t,{ref:n,...s}))));return s.forEach((s=>{n[s]=Hh(e+"."+s,t[s])})),n}function Gh(e,t){return(...s)=>(k()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),t(...s))}const $h=Hh("RichText",g.RichText,["Content"]);$h.isEmpty=Gh("RichText.isEmpty",g.RichText.isEmpty);const Wh=Hh("Autocomplete",g.Autocomplete),Zh=Hh("AlignmentToolbar",g.AlignmentToolbar),Yh=Hh("BlockAlignmentToolbar",g.BlockAlignmentToolbar),qh=Hh("BlockControls",g.BlockControls,["Slot"]),Kh=Hh("BlockEdit",g.BlockEdit),Qh=Hh("BlockEditorKeyboardShortcuts",g.BlockEditorKeyboardShortcuts),Xh=Hh("BlockFormatControls",g.BlockFormatControls,["Slot"]),Jh=Hh("BlockIcon",g.BlockIcon),eg=Hh("BlockInspector",g.BlockInspector),tg=Hh("BlockList",g.BlockList),sg=Hh("BlockMover",g.BlockMover),ng=Hh("BlockNavigationDropdown",g.BlockNavigationDropdown),og=Hh("BlockSelectionClearer",g.BlockSelectionClearer),rg=Hh("BlockSettingsMenu",g.BlockSettingsMenu),ig=Hh("BlockTitle",g.BlockTitle),ag=Hh("BlockToolbar",g.BlockToolbar),lg=Hh("ColorPalette",g.ColorPalette),cg=Hh("ContrastChecker",g.ContrastChecker),dg=Hh("CopyHandler",g.CopyHandler),ug=Hh("DefaultBlockAppender",g.DefaultBlockAppender),pg=Hh("FontSizePicker",g.FontSizePicker),mg=Hh("Inserter",g.Inserter),hg=Hh("InnerBlocks",g.InnerBlocks,["ButtonBlockAppender","DefaultBlockAppender","Content"]),gg=Hh("InspectorAdvancedControls",g.InspectorAdvancedControls,["Slot"]),_g=Hh("InspectorControls",g.InspectorControls,["Slot"]),fg=Hh("PanelColorSettings",g.PanelColorSettings),bg=Hh("PlainText",g.PlainText),yg=Hh("RichTextShortcut",g.RichTextShortcut),xg=Hh("RichTextToolbarButton",g.RichTextToolbarButton),vg=Hh("__unstableRichTextInputEvent",g.__unstableRichTextInputEvent),wg=Hh("MediaPlaceholder",g.MediaPlaceholder),Sg=Hh("MediaUpload",g.MediaUpload),kg=Hh("MediaUploadCheck",g.MediaUploadCheck),Cg=Hh("MultiSelectScrollIntoView",g.MultiSelectScrollIntoView),Pg=Hh("NavigableToolbar",g.NavigableToolbar),jg=Hh("ObserveTyping",g.ObserveTyping),Eg=Hh("SkipToSelectedBlock",g.SkipToSelectedBlock),Tg=Hh("URLInput",g.URLInput),Bg=Hh("URLInputButton",g.URLInputButton),Ig=Hh("URLPopover",g.URLPopover),Ng=Hh("Warning",g.Warning),Rg=Hh("WritingFlow",g.WritingFlow),Dg=Gh("createCustomColorsHOC",g.createCustomColorsHOC),Ag=Gh("getColorClassName",g.getColorClassName),Mg=Gh("getColorObjectByAttributeValues",g.getColorObjectByAttributeValues),Lg=Gh("getColorObjectByColorValue",g.getColorObjectByColorValue),Og=Gh("getFontSize",g.getFontSize),Fg=Gh("getFontSizeClass",g.getFontSizeClass),Vg=Gh("withColorContext",g.withColorContext),Ug=Gh("withColors",g.withColors),zg=Gh("withFontSizes",g.withFontSizes),Hg=Cl,Gg=Cl;function $g(e){return k()("wp.editor.cleanForSlug",{since:"12.7",plugin:"Gutenberg",alternative:"wp.url.cleanForSlug"}),(0,w.cleanForSlug)(e)}var Wg=(0,Fn.createSlotFill)(Symbol("EditCanvasContainerSlot"));const Zg="__experimentalMainDashboardButton",{Fill:Yg,Slot:qg}=(0,Fn.createSlotFill)(Zg),Kg=Yg;Kg.Slot=()=>{const e=(0,Fn.__experimentalUseSlotFills)(Zg);return(0,c.jsx)(qg,{bubblesVirtually:!0,fillProps:{length:e?e.length:0}})};var Qg=Kg,Xg=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z"})});const Jg="edit-post/collab-history-sidebar",e_="edit-post/collab-sidebar",t_=[Jg,e_];var s_=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});function n_(){}const o_=["#3858E9","#9fB1FF","#1D35B4","#1A1919","#E26F56","#33F078","#FFF972","#7A00DF"];function r_(e){return o_[e%o_.length]}function i_(e,t,s){if(!t)return;const n=e?`[role=listitem][id="comment-thread-$e}"]`:"[role=listitem]:not([id])",o=s?`$n} $s}`:n;return new Promise((e=>{if(t.querySelector(o))return e(t.querySelector(o));let s=null;const n=new window.MutationObserver((()=>{t.querySelector(o)&&(clearTimeout(s),n.disconnect(),e(t.querySelector(o)))}));n.observe(t,{childList:!0,subtree:!0}),s=setTimeout((()=>{n.disconnect(),e(null)}),3e3)})).then((e=>e?.focus()))}var a_=function({avatar:e,name:t,date:s,userId:n}){const o=(0,v.getSettings)(),{currentUserAvatar:r,currentUserName:i,currentUserId:a,dateFormat:l=o.formats.date}=(0,d.useSelect)((e=>{const{getCurrentUser:t,getEntityRecord:s}=e(u.store),{getSettings:n}=e(g.store),o=t(),{__experimentalDiscussionSettings:r}=n(),i=r?.avatarURL,a=s("root","site");return{currentUserAvatar:o?.avatar_urls?.[48]??i,currentUserName:o?.name,currentUserId:o?.id,dateFormat:a?.date_format}}),[]),p=(0,v.getDate)(s),m=(0,v.dateI18n)("c",p),h=Math.floor((new Date-p)/864e5)<30?(0,v.humanTimeDiff)(p):(0,v.dateI18n)(l,p),_=(0,v.dateI18n)((0,fs._x)("F j, Y g:i a","Note date full date format"),s);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("img",{src:e||r,className:"editor-collab-sidebar-panel__user-avatar",alt:(0,fs.__)("User avatar"),width:32,height:32,style:{borderColor:r_(n??a)}}),(0,c.jsxs)(Fn.__experimentalVStack,{spacing:"0",children:[(0,c.jsx)("span",{className:"editor-collab-sidebar-panel__user-name",children:t??i}),s&&(0,c.jsx)(Fn.Tooltip,{placement:"top",text:_,children:(0,c.jsx)("time",{dateTime:m,className:"editor-collab-sidebar-panel__user-time",children:h})})]})]})};var l_=function e({onSubmit:t,onCancel:s,thread:n,submitButtonText:o,labelText:r,reflowComments:i=n_}){const[a,l]=(0,p.useState)(n?.content?.raw??""),d=(0,m.useDebounce)(i,100),u=(0,m.useInstanceId)(e,"comment-input"),h=a===n?.content?.raw||!(g=a,g.trim()).length;var g;return(0,c.jsxs)(Fn.__experimentalVStack,{className:"editor-collab-sidebar-panel__comment-form",spacing:"4",children:[(0,c.jsx)(Fn.VisuallyHidden,{as:"label",htmlFor:u,children:r??(0,fs.__)("Note")}),(0,c.jsx)(mh.A,{id:u,value:a??"",onChange:e=>{var t;t=e.target.value,l(t),d()},rows:1,maxRows:20}),(0,c.jsxs)(Fn.__experimentalHStack,{spacing:"2",justify:"flex-end",wrap:!0,children:[(0,c.jsx)(Fn.Button,{size:"compact",variant:"tertiary",onClick:s,children:(0,c.jsx)(Fn.__experimentalTruncate,{children:(0,fs.__)("Cancel")})}),(0,c.jsx)(Fn.Button,{size:"compact",accessibleWhenDisabled:!0,variant:"primary",onClick:()=>{t(a),l("")},disabled:h,children:(0,c.jsx)(Fn.__experimentalTruncate,{children:o})})]})]})};Math.min,Math.max,Math.round,Math.floor;function c_(e){return e.split("-")[0]}function d_(e){return e.split("-")[1]}function u_(e){return"y"===e?"height":"width"}function p_(e){return["top","bottom"].includes(c_(e))?"y":"x"}function m_(e){return"x"===p_(e)?"y":"x"}function h_(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function g_(e,t,s){let{reference:n,floating:o}=e;const r=p_(t),i=m_(t),a=u_(i),l=c_(t),c="y"===r,d=n.x+n.width/2-o.width/2,u=n.y+n.height/2-o.height/2,p=n[a]/2-o[a]/2;let m;switch(l){case"top":m={x:d,y:n.y-o.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:u};break;case"left":m={x:n.x-o.width,y:u};break;default:m={x:n.x,y:n.y}}switch(d_(t)){case"start":m[i]-=p*(s&&c?-1:1);break;case"end":m[i]+=p*(s&&c?-1:1)}return m}const __=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:s,y:n}=t,o=await async function(e,t){const{placement:s,platform:n,elements:o}=e,r=await(null==n.isRTL?void 0:n.isRTL(o.floating)),i=c_(s),a=d_(s),l="y"===p_(s),c=["left","top"].includes(i)?-1:1,d=r&&l?-1:1,u=(m=e,"function"==typeof(p=t)?p(m):p);var p,m;let{mainAxis:h,crossAxis:g,alignmentAxis:_}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return a&&"number"==typeof _&&(g="end"===a?-1*_:_),l?{x:g*d,y:h*c}:{x:h*c,y:g*d}}(t,e);return{x:s+o.x,y:n+o.y,data:o}}}},f_=Math.min,b_=Math.max,y_=Math.round,x_=Math.floor,v_=e=>({x:e,y:e});function w_(){return"undefined"!=typeof window}function S_(e){return P_(e)?(e.nodeName||"").toLowerCase():"#document"}function k_(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function C_(e){var t;return null==(t=(P_(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function P_(e){return!!w_()&&(e instanceof Node||e instanceof k_(e).Node)}function j_(e){return!!w_()&&(e instanceof Element||e instanceof k_(e).Element)}function E_(e){return!!w_()&&(e instanceof HTMLElement||e instanceof k_(e).HTMLElement)}function T_(e){return!(!w_()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof k_(e).ShadowRoot)}function B_(e){const{overflow:t,overflowX:s,overflowY:n,display:o}=M_(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+s)&&!["inline","contents"].includes(o)}function I_(e){return["table","td","th"].includes(S_(e))}function N_(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function R_(e){const t=D_(),s=j_(e)?M_(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!s[e]&&"none"!==s[e]))||!!s.containerType&&"normal"!==s.containerType||!t&&!!s.backdropFilter&&"none"!==s.backdropFilter||!t&&!!s.filter&&"none"!==s.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(s.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(s.contain||"").includes(e)))}function D_(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function A_(e){return["html","body","#document"].includes(S_(e))}function M_(e){return k_(e).getComputedStyle(e)}function L_(e){return j_(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function O_(e){if("html"===S_(e))return e;const t=e.assignedSlot||e.parentNode||T_(e)&&e.host||C_(e);return T_(t)?t.host:t}function F_(e){const t=O_(e);return A_(t)?e.ownerDocument?e.ownerDocument.body:e.body:E_(t)&&B_(t)?t:F_(t)}function V_(e,t,s){var n;void 0===t&&(t=[]),void 0===s&&(s=!0);const o=F_(e),r=o===(null==(n=e.ownerDocument)?void 0:n.body),i=k_(o);if(r){const e=function(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}(i);return t.concat(i,i.visualViewport||[],B_(o)?o:[],e&&s?V_(e):[])}return t.concat(o,V_(o,[],s))}function U_(e){const t=M_(e);let s=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=E_(e),r=o?e.offsetWidth:s,i=o?e.offsetHeight:n,a=y_(s)!==r||y_(n)!==i;return a&&(s=r,n=i),{width:s,height:n,$:a}}function z_(e){return j_(e)?e:e.contextElement}function H_(e){const t=z_(e);if(!E_(t))return v_(1);const s=t.getBoundingClientRect(),{width:n,height:o,$:r}=U_(t);let i=(r?y_(s.width):s.width)/n,a=(r?y_(s.height):s.height)/o;return i&&Number.isFinite(i)||(i=1),a&&Number.isFinite(a)||(a=1),{x:i,y:a}}const G_=v_(0);function $_(e){const t=k_(e);return D_()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:G_}function W_(e,t,s,n){void 0===t&&(t=!1),void 0===s&&(s=!1);const o=e.getBoundingClientRect(),r=z_(e);let i=v_(1);t&&(n?j_(n)&&(i=H_(n)):i=H_(e));const a=function(e,t,s){return void 0===t&&(t=!1),!(!s||t&&s!==k_(e))&&t}(r,s,n)?$_(r):v_(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,d=o.width/i.x,u=o.height/i.y;if(r){const e=k_(r),t=n&&j_(n)?k_(n):n;let s=e,o=s.frameElement;for(;o&&n&&t!==s;){const e=H_(o),t=o.getBoundingClientRect(),n=M_(o),r=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=r,c+=i,s=k_(o),o=s.frameElement}}return h_({width:d,height:u,x:l,y:c})}const Z_=[":popover-open",":modal"];function Y_(e){return Z_.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function q_(e){return W_(C_(e)).left+L_(e).scrollLeft}function K_(e,t,s){let n;if("viewport"===t)n=function(e,t){const s=k_(e),n=C_(e),o=s.visualViewport;let r=n.clientWidth,i=n.clientHeight,a=0,l=0;if(o){r=o.width,i=o.height;const e=D_();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:r,height:i,x:a,y:l}}(e,s);else if("document"===t)n=function(e){const t=C_(e),s=L_(e),n=e.ownerDocument.body,o=b_(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),r=b_(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-s.scrollLeft+q_(e);const a=-s.scrollTop;return"rtl"===M_(n).direction&&(i+=b_(t.clientWidth,n.clientWidth)-o),{width:o,height:r,x:i,y:a}}(C_(e));else if(j_(t))n=function(e,t){const s=W_(e,!0,"fixed"===t),n=s.top+e.clientTop,o=s.left+e.clientLeft,r=E_(e)?H_(e):v_(1);return{width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:o*r.x,y:n*r.y}}(t,s);else{const s=$_(e);n={...t,x:t.x-s.x,y:t.y-s.y}}return h_(n)}function Q_(e,t){const s=O_(e);return!(s===t||!j_(s)||A_(s))&&("fixed"===M_(s).position||Q_(s,t))}function X_(e,t,s){const n=E_(t),o=C_(t),r="fixed"===s,i=W_(e,!0,r,t);let a={scrollLeft:0,scrollTop:0};const l=v_(0);if(n||!n&&!r)if(("body"!==S_(t)||B_(o))&&(a=L_(t)),n){const e=W_(t,!0,r,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=q_(o));return{x:i.left+a.scrollLeft-l.x,y:i.top+a.scrollTop-l.y,width:i.width,height:i.height}}function J_(e,t){return E_(e)&&"fixed"!==M_(e).position?t?t(e):e.offsetParent:null}function ef(e,t){const s=k_(e);if(!E_(e)||Y_(e))return s;let n=J_(e,t);for(;n&&I_(n)&&"static"===M_(n).position;)n=J_(n,t);return n&&("html"===S_(n)||"body"===S_(n)&&"static"===M_(n).position&&!R_(n))?s:n||function(e){let t=O_(e);for(;E_(t)&&!A_(t);){if(R_(t))return t;if(N_(t))return null;t=O_(t)}return null}(e)||s}const tf={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:s,offsetParent:n,strategy:o}=e;const r="fixed"===o,i=C_(n),a=!!t&&Y_(t.floating);if(n===i||a&&r)return s;let l={scrollLeft:0,scrollTop:0},c=v_(1);const d=v_(0),u=E_(n);if((u||!u&&!r)&&(("body"!==S_(n)||B_(i))&&(l=L_(n)),E_(n))){const e=W_(n);c=H_(n),d.x=e.x+n.clientLeft,d.y=e.y+n.clientTop}return{width:s.width*c.x,height:s.height*c.y,x:s.x*c.x-l.scrollLeft*c.x+d.x,y:s.y*c.y-l.scrollTop*c.y+d.y}},getDocumentElement:C_,getClippingRect:function(e){let{element:t,boundary:s,rootBoundary:n,strategy:o}=e;const r=[..."clippingAncestors"===s?function(e,t){const s=t.get(e);if(s)return s;let n=V_(e,[],!1).filter((e=>j_(e)&&"body"!==S_(e))),o=null;const r="fixed"===M_(e).position;let i=r?O_(e):e;for(;j_(i)&&!A_(i);){const t=M_(i),s=R_(i);s||"fixed"!==t.position||(o=null),(r?!s&&!o:!s&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||B_(i)&&!s&&Q_(e,i))?n=n.filter((e=>e!==i)):o=t,i=O_(i)}return t.set(e,n),n}(t,this._c):[].concat(s),n],i=r[0],a=r.reduce(((e,s)=>{const n=K_(t,s,o);return e.top=b_(n.top,e.top),e.right=f_(n.right,e.right),e.bottom=f_(n.bottom,e.bottom),e.left=b_(n.left,e.left),e}),K_(t,i,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:ef,getElementRects:async function(e){const t=this.getOffsetParent||ef,s=this.getDimensions;return{reference:X_(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await s(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:s}=U_(e);return{width:t,height:s}},getScale:H_,isElement:j_,isRTL:function(e){return"rtl"===M_(e).direction}};function sf(e,t,s,n){void 0===n&&(n={});const{ancestorScroll:o=!0,ancestorResize:r=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=z_(e),d=o||r?[...c?V_(c):[],...V_(t)]:[];d.forEach((e=>{o&&e.addEventListener("scroll",s,{passive:!0}),r&&e.addEventListener("resize",s)}));const u=c&&a?function(e,t){let s,n=null;const o=C_(e);function r(){var e;clearTimeout(s),null==(e=n)||e.disconnect(),n=null}return function i(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),r();const{left:c,top:d,width:u,height:p}=e.getBoundingClientRect();if(a||t(),!u||!p)return;const m={rootMargin:-x_(d)+"px "+-x_(o.clientWidth-(c+u))+"px "+-x_(o.clientHeight-(d+p))+"px "+-x_(c)+"px",threshold:b_(0,f_(1,l))||1};let h=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return i();t?i(!1,t):s=setTimeout((()=>{i(!1,1e-7)}),100)}h=!1}try{n=new IntersectionObserver(g,{...m,root:o.ownerDocument})}catch(e){n=new IntersectionObserver(g,m)}n.observe(e)}(!0),r}(c,s):null;let p,m=-1,h=null;i&&(h=new ResizeObserver((e=>{let[n]=e;n&&n.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),s()})),c&&!l&&h.observe(c),h.observe(t));let g=l?W_(e):null;return l&&function t(){const n=W_(e);!g||n.x===g.x&&n.y===g.y&&n.width===g.width&&n.height===g.height||s();g=n,p=requestAnimationFrame(t)}(),s(),()=>{var e;d.forEach((e=>{o&&e.removeEventListener("scroll",s),r&&e.removeEventListener("resize",s)})),null==u||u(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const nf=(e,t,s)=>{const n=new Map,o={platform:tf,...s},r={...o.platform,_c:n};return(async(e,t,s)=>{const{placement:n="bottom",strategy:o="absolute",middleware:r=[],platform:i}=s,a=r.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=g_(c,n,l),p=n,m={},h=0;for(let s=0;s<a.length;s++){const{name:r,fn:g}=a[s],{x:_,y:f,data:b,reset:y}=await g({x:d,y:u,initialPlacement:n,placement:p,strategy:o,middlewareData:m,rects:c,platform:i,elements:{reference:e,floating:t}});d=null!=_?_:d,u=null!=f?f:u,m={...m,[r]:{...m[r],...b}},y&&h<=50&&(h++,"object"==typeof y&&(y.placement&&(p=y.placement),y.rects&&(c=!0===y.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):y.rects),({x:d,y:u}=g_(c,p,l))),s=-1)}return{x:d,y:u,placement:p,strategy:o,middlewareData:m}})(e,t,{...o,platform:r})};var of=s(1609);const rf=window.ReactDOM;var af="undefined"!=typeof document?of.useLayoutEffect:of.useEffect;function lf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let s,n,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(s=e.length,s!==t.length)return!1;for(n=s;0!=n--;)if(!lf(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),s=o.length,s!==Object.keys(t).length)return!1;for(n=s;0!=n--;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=s;0!=n--;){const s=o[n];if(("_owner"!==s||!e.$$typeof)&&!lf(e[s],t[s]))return!1}return!0}return e!=e&&t!=t}function cf(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function df(e,t){const s=cf(e);return Math.round(t*s)/s}function uf(e){const t=of.useRef(e);return af((()=>{t.current=e})),t}const{useBlockElementRef:pf,cleanEmptyObject:mf}=$(g.privateApis);function hf({thread:e,calculatedOffset:t,setHeights:s,selectedThread:n,setBlockRef:o,commentLastUpdated:r}){const i=(0,p.useRef)();pf(e.blockClientId,i);const a=(0,p.useCallback)(((e,t)=>{s((s=>s[e]!==t?{...s,[e]:t}:s))}),[s]),{y:l,refs:c}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:s="absolute",middleware:n=[],platform:o,elements:{reference:r,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,u]=of.useState({x:0,y:0,strategy:s,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=of.useState(n);lf(p,n)||m(n);const[h,g]=of.useState(null),[_,f]=of.useState(null),b=of.useCallback((e=>{e!==w.current&&(w.current=e,g(e))}),[]),y=of.useCallback((e=>{e!==S.current&&(S.current=e,f(e))}),[]),x=r||h,v=i||_,w=of.useRef(null),S=of.useRef(null),k=of.useRef(d),C=null!=l,P=uf(l),j=uf(o),E=of.useCallback((()=>{if(!w.current||!S.current)return;const e={placement:t,strategy:s,middleware:p};j.current&&(e.platform=j.current),nf(w.current,S.current,e).then((e=>{const t={...e,isPositioned:!0};T.current&&!lf(k.current,t)&&(k.current=t,rf.flushSync((()=>{u(t)})))}))}),[p,t,s,j]);af((()=>{!1===c&&k.current.isPositioned&&(k.current.isPositioned=!1,u((e=>({...e,isPositioned:!1}))))}),[c]);const T=of.useRef(!1);af((()=>(T.current=!0,()=>{T.current=!1})),[]),af((()=>{if(x&&(w.current=x),v&&(S.current=v),x&&v){if(P.current)return P.current(x,v,E);E()}}),[x,v,E,P,C]);const B=of.useMemo((()=>({reference:w,floating:S,setReference:b,setFloating:y})),[b,y]),I=of.useMemo((()=>({reference:x,floating:v})),[x,v]),N=of.useMemo((()=>{const e={position:s,left:0,top:0};if(!I.floating)return e;const t=df(I.floating,d.x),n=df(I.floating,d.y);return a?{...e,transform:"translate("+t+"px, "+n+"px)",...cf(I.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:t,top:n}}),[s,a,I.floating,d.x,d.y]);return of.useMemo((()=>({...d,update:E,refs:B,elements:I,floatingStyles:N})),[d,E,B,I,N])}({placement:"right-start",middleware:[__({crossAxis:t||-16})],whileElementsMounted:sf});return(0,p.useEffect)((()=>{i.current&&c.setReference(i.current)}),[i,c]),(0,p.useEffect)((()=>{c.floating?.current&&o(e.id,i.current)}),[e.id,c.floating,o]),(0,p.useEffect)((()=>{if(c.floating?.current){const t=c.floating.current.scrollHeight;a(e.id,t)}}),[e.id,a,c.floating,n,r]),{blockRef:i,y:l,refs:c}}const{useBlockElement:gf}=$(g.privateApis),{Menu:_f}=$(Fn.privateApis);function ff({threads:e,onEditComment:t,onAddReply:s,onCommentDelete:n,setShowCommentBoard:o,commentSidebarRef:r,reflowComments:i,isFloating:a=!1,commentLastUpdated:l}){const[u,m]=(0,p.useState)({}),[h,_]=(0,p.useState)(null),[f,b]=(0,p.useState)({}),[y,x]=(0,p.useState)({}),{blockCommentId:v,selectedBlockClientId:w}=(0,d.useSelect)((e=>{const{getBlockAttributes:t,getSelectedBlockClientId:s}=e(g.store),n=s();return{blockCommentId:n?t(n)?.metadata?.noteId:null,selectedBlockClientId:n}}),[]),S=gf(w),k=async t=>{const s=e.findIndex((e=>e.id===t.id)),i=e[s+1],a=e[s-1];if(await n(t),0!==t.parent)return _(t.parent),void i_(t.parent,r.current);i?(_(i.id),i_(i.id,r.current)):a?(_(a.id),i_(a.id,r.current)):(_(null),o(!1),S?.focus())};(0,p.useEffect)((()=>{_(v??void 0)}),[v]);const C=(0,p.useCallback)(((e,t)=>{x((s=>({...s,[e]:t})))}),[]);(0,p.useEffect)((()=>{const t=(()=>{const t={};if(!a)return t;const s=e.findIndex((e=>e.id===h)),n=-1===s?0:s,o=e[n];if(!o||!y[o.id])return t;let r=y[o.id],i=r?.getBoundingClientRect();const l=i?.top||0,c=u[o.id]||0;t[o.id]=-16;let d={threadTop:l-16,threadHeight:c};for(let s=n+1;s<e.length;s++){const n=e[s];if(!y[n.id])continue;r=y[n.id],i=r?.getBoundingClientRect();const o=i?.top||0,a=u[n.id]||0;let l=-16;const c=d.threadTop+d.threadHeight;o<c+16&&(l=c-o+20),t[n.id]=l,d={threadTop:o+l,threadHeight:a}}let p={threadTop:l-16};for(let n=s-1;n>=0;n--){const s=e[n];if(!y[s.id])continue;r=y[s.id],i=r?.getBoundingClientRect();const o=i?.top||0,a=u[s.id]||0;let l=-16;o+a>p.threadTop&&(l=p.threadTop-o-a-20),t[s.id]=l,p={threadTop:o+l}}return t})();Object.keys(t).length>0&&b(t)}),[u,y,a,e,h]);return Array.isArray(e)&&e.length>0||a?(0,c.jsx)(Fn.__experimentalVStack,{spacing:"3",children:e.map((e=>(0,c.jsx)(bf,{thread:e,onAddReply:s,onCommentDelete:k,onEditComment:t,isSelected:h===e.id,setSelectedThread:_,setShowCommentBoard:o,commentSidebarRef:r,reflowComments:i,isFloating:a,calculatedOffset:f[e.id]??0,setHeights:m,setBlockRef:C,selectedThread:h,commentLastUpdated:l},e.id)))}):(0,c.jsxs)(Fn.__experimentalVStack,{alignment:"left",justify:"flex-start",spacing:"2",children:[(0,c.jsx)(Fn.__experimentalText,{as:"p",children:(0,fs.__)("No notes available.")}),(0,c.jsx)(Fn.__experimentalText,{as:"p",variant:"muted",children:(0,fs.__)("Only logged in users can see Notes.")})]})}function bf({thread:e,onEditComment:t,onAddReply:s,onCommentDelete:n,isSelected:o,setShowCommentBoard:r,commentSidebarRef:i,reflowComments:a,isFloating:l,calculatedOffset:u,setHeights:p,setBlockRef:h,setSelectedThread:_,selectedThread:f,commentLastUpdated:b}){const{toggleBlockHighlight:y,selectBlock:x,toggleBlockSpotlight:v}=$((0,d.useDispatch)(g.store)),w=gf(e.blockClientId),S=(0,m.useDebounce)(y,50),{y:k,refs:C}=hf({thread:e,calculatedOffset:u,setHeights:p,setBlockRef:h,selectedThread:f,commentLastUpdated:b}),P=()=>{S(e.blockClientId,!0)},j=()=>{S(e.blockClientId,!1)},E=()=>{r(!1),_(e.id),x(e.blockClientId,null),v(e.blockClientId,!0)},T=()=>{_(null),r(!1),v(e.blockClientId,!1)},B=e?.reply||[],I=B.length>0?B[B.length-1]:void 0,N=B.length>0?B.slice(0,-1):[],R=function(e,t=10){if(!e)return"";const s=(0,fs._x)("words","Word count type. Do not translate!"),n=e.trim();let o="";if("words"===s)o=n.split(" ",t).join(" ");else if("characters_excluding_spaces"===s){const e=n.split("",t).join(""),s=e.length-e.replaceAll(" ","").length;o=n.split("",t+s).join("")}else"characters_including_spaces"===s&&(o=n.split("",t).join(""));return o!==n?o+"…":o}((0,Vc.__unstableStripHTML)(e.content.rendered),10),D=w?(0,fs.sprintf)((0,fs.__)("Note: %s"),R):(0,fs.sprintf)((0,fs.__)("Original block deleted. Note: %s"),R);return(0,c.jsxs)(Fn.__experimentalVStack,{className:hr("editor-collab-sidebar-panel__thread",{"is-selected":o,"is-floating":l}),id:`comment-thread-$e.id}`,spacing:"3",onClick:E,onMouseEnter:P,onMouseLeave:j,onFocus:P,onBlur:j,onKeyDown:t=>{"Enter"===t.key&&t.currentTarget===t.target&&(o?T():E()),"Escape"===t.key&&(T(),i_(e.id,i.current))},tabIndex:0,role:"listitem","aria-label":D,"aria-expanded":o,ref:l?C.setFloating:void 0,style:l?{top:k}:void 0,children:[(0,c.jsx)(Fn.Button,{className:"editor-collab-sidebar-panel__skip-to-comment",variant:"secondary",size:"compact",onClick:()=>{i_(e.id,i.current,"textarea")},children:(0,fs.__)("Add new note")}),!w&&(0,c.jsx)(Fn.__experimentalText,{as:"p",weight:500,variant:"muted",children:(0,fs.__)("Original block deleted.")}),(0,c.jsx)(yf,{thread:e,isExpanded:o,onEdit:(s={})=>{const{status:n}=s;t(s),"approved"===n&&(T(),i_(e.id,i.current))},onDelete:n,reflowComments:a}),o&&B.map((s=>(0,c.jsx)(yf,{thread:s,parent:e,isExpanded:o,onEdit:t,onDelete:n,reflowComments:a},s.id))),!o&&N.length>0&&(0,c.jsx)(Fn.__experimentalHStack,{className:"editor-collab-sidebar-panel__more-reply-separator",children:(0,c.jsx)(Fn.Button,{size:"compact",variant:"tertiary",className:"editor-collab-sidebar-panel__more-reply-button",onClick:()=>{_(e.id),i_(e.id,i.current)},children:(0,fs.sprintf)((0,fs._n)("%s more reply","%s more replies",N.length),N.length)})}),!o&&I&&(0,c.jsx)(yf,{thread:I,parent:e,isExpanded:o,onEdit:t,onDelete:n,reflowComments:a}),o&&(0,c.jsxs)(Fn.__experimentalVStack,{spacing:"2",children:[(0,c.jsx)(Fn.__experimentalHStack,{alignment:"left",spacing:"3",justify:"flex-start",children:(0,c.jsx)(a_,{})}),(0,c.jsx)(Fn.__experimentalVStack,{spacing:"2",children:(0,c.jsx)(l_,{onSubmit:n=>{"approved"===e.status?t({id:e.id,status:"hold",content:n}):s({content:n,parent:e.id})},onCancel:t=>{t.stopPropagation(),T(),i_(e.id,i.current)},submitButtonText:"approved"===e.status?(0,fs.__)("Reopen & Reply"):(0,fs.__)("Reply"),rows:"approved"===e.status?2:4,labelText:(0,fs.sprintf)((0,fs.__)("Reply to note %1$s by %2$s"),e.id,e.author_name),reflowComments:a})})]}),(0,c.jsx)(Fn.Button,{className:"editor-collab-sidebar-panel__skip-to-block",variant:"secondary",size:"compact",onClick:e=>{e.stopPropagation(),w?.focus()},children:(0,fs.__)("Back to block")})]})}const yf=({thread:e,parent:t,isExpanded:s,onEdit:n,onDelete:o,reflowComments:r})=>{const[i,a]=(0,p.useState)(!1),[l,d]=(0,p.useState)(!1),u=()=>{a(!1),d(!1)},m="note"===e.type&&e.meta&&("resolved"===e.meta._wp_note_status||"reopen"===e.meta._wp_note_status),h=[{id:"edit",title:(0,fs.__)("Edit"),isEligible:({status:e})=>"approved"!==e,onClick:()=>{a("edit")}},{id:"reopen",title:(0,fs._x)("Reopen","Reopen note"),isEligible:({status:e})=>"approved"===e,onClick:()=>{n({id:e.id,status:"hold"})}},{id:"delete",title:(0,fs.__)("Delete"),isEligible:()=>!0,onClick:()=>{a("delete"),d(!0)}}],g=0===e.parent,_="approved"!==t?.status?h.filter((t=>t.isEligible(e))):[];return(0,c.jsxs)(Fn.__experimentalVStack,{spacing:"2",children:[(0,c.jsxs)(Fn.__experimentalHStack,{alignment:"left",spacing:"3",justify:"flex-start",children:[(0,c.jsx)(a_,{avatar:e?.author_avatar_urls?.[48],name:e?.author_name,date:e?.date,userId:e?.author}),s&&(0,c.jsx)(Fn.FlexItem,{className:"editor-collab-sidebar-panel__comment-status",onClick:e=>{e.stopPropagation()},children:(0,c.jsxs)(Fn.__experimentalHStack,{spacing:"0",children:[g&&(0,c.jsx)(Fn.Button,{label:(0,fs._x)("Resolve","Mark note as resolved"),size:"small",icon:Sr,disabled:"approved"===e.status,accessibleWhenDisabled:"approved"===e.status,onClick:()=>{n({id:e.id,status:"approved"})}}),(0,c.jsxs)(_f,{placement:"bottom-end",children:[(0,c.jsx)(_f.TriggerButton,{render:(0,c.jsx)(Fn.Button,{size:"small",icon:s_,label:(0,fs.__)("Actions"),disabled:!_.length,accessibleWhenDisabled:!0})}),(0,c.jsx)(_f.Popover,{children:_.map((e=>(0,c.jsx)(_f.Item,{onClick:()=>e.onClick(),children:(0,c.jsx)(_f.ItemLabel,{children:e.title})},e.id)))})]})]})})]}),"edit"===i?(0,c.jsx)(l_,{onSubmit:t=>{n({id:e.id,content:t}),a(!1)},onCancel:()=>u(),thread:e,submitButtonText:(0,fs._x)("Update","verb"),labelText:(0,fs.sprintf)((0,fs.__)("Edit note %1$s by %2$s"),e.id,e.author_name),reflowComments:r}):(0,c.jsx)(p.RawHTML,{className:hr("editor-collab-sidebar-panel__user-comment",{"editor-collab-sidebar-panel__resolution-text":m}),children:m?(()=>{const t="resolved"===e.meta._wp_note_status?(0,fs.__)("Marked as resolved"):(0,fs.__)("Reopened"),s=e?.content?.raw;return s&&"string"==typeof s&&""!==s.trim()?(0,fs.sprintf)((0,fs.__)("%1$s: %2$s"),t,s):t})():e?.content?.rendered}),"delete"===i&&(0,c.jsx)(Fn.__experimentalConfirmDialog,{isOpen:l,onConfirm:()=>{o(e),a(!1),d(!1)},onCancel:u,confirmButtonText:(0,fs.__)("Delete"),children:(0,fs.__)("Are you sure you want to delete this note?")})]})};const{useBlockElement:xf}=$(g.privateApis);function vf({onSubmit:e,showCommentBoard:t,setShowCommentBoard:s,commentSidebarRef:n}){const{clientId:o,blockCommentId:r}=(0,d.useSelect)((e=>{const{getSelectedBlock:t}=e(g.store),s=t();return{clientId:s?.clientId,blockCommentId:s?.attributes?.metadata?.noteId}}),[]),i=xf(o);return t&&o&&void 0===r?(0,c.jsxs)(Fn.__experimentalVStack,{className:"editor-collab-sidebar-panel__thread is-selected",spacing:"3",tabIndex:0,role:"listitem",children:[(0,c.jsx)(Fn.__experimentalHStack,{alignment:"left",spacing:"3",children:(0,c.jsx)(a_,{})}),(0,c.jsx)(l_,{onSubmit:async t=>{const{id:o}=await e({content:t});i_(o,n.current),s(!1)},onCancel:()=>{s(!1),i?.focus()},submitButtonText:(0,fs.__)("Add note"),labelText:(0,fs.__)("New Note")})]}):null}const{CommentIconSlotFill:wf}=$(g.privateApis);var Sf=({onClick:e})=>(0,c.jsx)(wf.Fill,{children:({onClose:t})=>(0,c.jsx)(Fn.MenuItem,{icon:Xg,onClick:()=>{e(),t()},"aria-haspopup":"dialog",children:(0,fs.__)("Add note")})});const{CommentIconToolbarSlotFill:kf}=$(g.privateApis);var Cf=({onClick:e,thread:t,hasMoreComments:s})=>{const n=(0,p.useMemo)((()=>{if(!t)return[];const e=new Map,s=[t,...t.reply];return s.sort(((e,t)=>new Date(e.date)-new Date(t.date))),s.forEach((s=>{if(s.author_name&&s.author_avatar_urls){const n=`$s.author}-$s.author_name}`;e.has(n)||e.set(n,{name:s.author_name,avatar:s.author_avatar_urls?.[48]||s.author_avatar_urls?.[96],id:s.author,isOriginalCommenter:s.id===t.id,date:s.date})}})),Array.from(e.values())}),[t]),o="approved"!==t?.status,r=s&&t?.reply&&1+t.reply.length>=100;if(!n.length)return null;const i=n.slice(0,3),a=Math.max(0,n.length-3),l=r&&a>0?(0,fs.__)("100+"):(0,fs.sprintf)((0,fs.__)("+%s"),a),d=r&&a>0?(0,fs.__)("100+ participants"):(0,fs.sprintf)((0,fs._n)("+%s more participant","+%s more participants",a),a);return(0,c.jsx)(kf.Fill,{children:(0,c.jsx)(Fn.ToolbarButton,{className:hr("comment-avatar-indicator",{"has-unresolved":o}),label:(0,fs.__)("View notes"),onClick:e,showTooltip:!0,children:(0,c.jsxs)("div",{className:"comment-avatar-stack",children:[i.map(((e,t)=>(0,c.jsx)("img",{src:e.avatar,alt:e.name,className:"comment-avatar",style:{zIndex:3-t,borderColor:r_(e.id)}},e.name+t))),a>0&&(0,c.jsx)("div",{className:"comment-avatar-overflow",style:{zIndex:0},title:d,children:l})]})})})};function Pf({showCommentBoard:e,setShowCommentBoard:t,styles:s,comments:n,commentSidebarRef:o,reflowComments:r,commentLastUpdated:i,isFloating:a=!1}){const{onCreate:l,onEdit:p,onDelete:m}=function(e=n_){const{createNotice:t}=(0,d.useDispatch)(_s.store),{saveEntityRecord:s,deleteEntityRecord:n}=(0,d.useDispatch)(u.store),{getCurrentPostId:o}=(0,d.useSelect)(xc),{getBlockAttributes:r,getSelectedBlockClientId:i}=(0,d.useSelect)(g.store),{updateBlockAttributes:a}=(0,d.useDispatch)(g.store),l=e=>{const s=e.message&&"unknown_error"!==e.code?(0,Ln.decodeEntities)(e.message):(0,fs.__)("An error occurred while performing an update.");t("error",s,{type:"snackbar",isDismissible:!0})};return{onCreate:async({content:n,parent:c})=>{try{const l=await s("root","comment",{post:o(),content:n,status:"hold",type:"note",parent:c||0},{throwOnError:!0});if(!c&&l?.id){const e=i(),t=r(e)?.metadata;a(e,{metadata:{...t,noteId:l.id}})}return t("snackbar",c?(0,fs.__)("Reply added."):(0,fs.__)("Note added."),{type:"snackbar",isDismissible:!0}),setTimeout(e,300),l}catch(t){e(),l(t)}},onEdit:async({id:n,content:r,status:i})=>{const a=i||"updated",c={approved:(0,fs.__)("Note marked as resolved."),hold:(0,fs.__)("Note reopened."),updated:(0,fs.__)("Note updated.")};try{if("approved"===i||"hold"===i){await s("root","comment",{id:n,status:i},{throwOnError:!0});const e={post:o(),content:r||"",type:"note",status:i,parent:n,meta:{_wp_note_status:"approved"===i?"resolved":"reopen"}};await s("root","comment",e,{throwOnError:!0})}else{const e={id:n,content:r,status:i};await s("root","comment",e,{throwOnError:!0})}t("snackbar",c[a]??(0,fs.__)("Note updated."),{type:"snackbar",isDismissible:!0}),e()}catch(t){e(),l(t)}},onDelete:async s=>{try{if(await n("root","comment",s.id,void 0,{throwOnError:!0}),!s.parent){const e=i(),t=r(e)?.metadata;a(e,{metadata:mf({...t,noteId:void 0})})}t("snackbar",(0,fs.__)("Note deleted."),{type:"snackbar",isDismissible:!0}),e()}catch(t){e(),l(t)}}}}(r);return(0,c.jsxs)(Fn.__experimentalVStack,{className:"editor-collab-sidebar-panel",style:s,role:"list",spacing:"3",justify:"flex-start",ref:e=>{o.current=e},children:[(0,c.jsx)(vf,{onSubmit:l,showCommentBoard:e,setShowCommentBoard:t,commentSidebarRef:o}),(0,c.jsx)(ff,{threads:n,onEditComment:p,onAddReply:l,onCommentDelete:m,showCommentBoard:e,setShowCommentBoard:t,commentSidebarRef:o,reflowComments:r,commentLastUpdated:i,isFloating:a})]})}function jf(){const[e,t]=(0,p.useState)(!1),{getActiveComplementaryArea:s}=(0,d.useSelect)(Ea),{enableComplementaryArea:n}=(0,d.useDispatch)(Ea),o=(0,m.useViewportMatch)("medium"),r=(0,p.useRef)(null),{postId:i}=(0,d.useSelect)((e=>{const{getCurrentPostId:t}=e(xc);return{postId:t()}}),[]),a=(0,d.useSelect)((e=>{const{getBlockAttributes:t,getSelectedBlockClientId:s}=e(g.store),n=s();return n?t(n)?.metadata?.noteId:null}),[]),{resultComments:l,unresolvedSortedThreads:h,totalPages:_,reflowComments:f,commentLastUpdated:b}=function(e){const[t,s]=(0,p.useReducer)((()=>Date.now()),0),n={post:e,type:"note",status:"all",per_page:100},{records:o,totalPages:r}=(0,u.useEntityRecords)("root","comment",n,{enabled:!!e&&"number"==typeof e}),{getBlockAttributes:i}=(0,d.useSelect)(g.store),{clientIds:a}=(0,d.useSelect)((e=>{const{getClientIdsWithDescendants:t}=e(g.store);return{clientIds:t()}}),[]),{resultComments:l,unresolvedSortedThreads:c}=(0,p.useMemo)((()=>{const e=a.reduce(((e,t)=>{const s=i(t)?.metadata?.noteId;return s&&(e[t]=s),e}),{}),t={},s=[],n=o??[];if(n.forEach((s=>{const n=Object.keys(e).find((t=>e[t]===s.id));t[s.id]={...s,reply:[],blockClientId:0===s.parent?n:null}})),n.forEach((e=>{0===e.parent?s.push(t[e.id]):t[e.parent]&&t[e.parent].reply.push(t[e.id])})),0===s?.length)return{resultComments:[],unresolvedSortedThreads:[]};const r=s.map((e=>({...e,reply:[...e.reply].reverse()}))),l=new Map(r.map((e=>[String(e.id),e]))),c=new Set(Object.values(e).map((e=>String(e)))),d=Object.values(e).map((e=>l.get(String(e)))).filter((e=>void 0!==e&&"hold"===e.status)),u=Object.values(e).map((e=>l.get(String(e)))).filter((e=>void 0!==e&&"approved"===e.status)),p=r.filter((e=>!c.has(String(e.id))));return{resultComments:[...d,...u,...p],unresolvedSortedThreads:d}}),[a,o,i]);return{resultComments:l,unresolvedSortedThreads:c,totalPages:r,reflowComments:s,commentLastUpdated:t}}(i);!function(e=!1){const t=(0,d.useRegistry)();(0,p.useEffect)((()=>{if(e)return t.subscribe((()=>{t.select(Ea).getActiveComplementaryArea("core")||t.dispatch(Ea).enableComplementaryArea("core",e_)}))}),[e,t])}(l.length>0);const y=_&&_>1,{merged:x}=Bi(),v=x?.styles?.color?.background,w=a?l.find((e=>e.id===a)):null;if(!i||"number"!=typeof i)return null;async function S(){const e=await s("core");t_.find((t=>t===e))||n("core",e_);const o=await s("core");t_.includes(o)&&(t(!a),i_(a,r.current,a?void 0:"textarea"))}return(0,c.jsxs)(c.Fragment,{children:[a&&(0,c.jsx)(Cf,{thread:w,hasMoreComments:y,onClick:S}),(0,c.jsx)(Sf,{onClick:S}),(0,c.jsx)(Bu,{identifier:Jg,title:(0,fs.__)("Notes"),icon:Xg,closeLabel:(0,fs.__)("Close Notes"),children:(0,c.jsx)(Pf,{comments:l,showCommentBoard:e,setShowCommentBoard:t,commentSidebarRef:r,reflowComments:f,commentLastUpdated:b})}),o&&(h.length>0||e)&&(0,c.jsx)(Bu,{isPinnable:!1,header:!1,identifier:e_,className:"editor-collab-sidebar",headerClassName:"editor-collab-sidebar__header",backgroundColor:v,children:(0,c.jsx)(Pf,{comments:h,showCommentBoard:e,setShowCommentBoard:t,commentSidebarRef:r,reflowComments:f,commentLastUpdated:b,styles:{backgroundColor:v},isFloating:!0})}),(0,c.jsx)(_u,{icon:Xg,onClick:()=>n("core",Jg),children:(0,fs.__)("Notes")})]})}var Ef=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.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"})}),Tf=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.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"})});const{useHasBlockToolbar:Bf}=$(g.privateApis);function If({isCollapsed:e,onToggle:t}){const{blockSelectionStart:s}=(0,d.useSelect)((e=>({blockSelectionStart:e(g.store).getBlockSelectionStart()})),[]),n=Bf(),o=!!s;return(0,p.useEffect)((()=>{s&&t(!1)}),[s,t]),n?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:hr("editor-collapsible-block-toolbar",{"is-collapsed":e||!o}),children:(0,c.jsx)(g.BlockToolbar,{hideDragHandle:!0})}),(0,c.jsx)(Fn.Popover.Slot,{name:"block-toolbar"}),(0,c.jsx)(Fn.Button,{className:"editor-collapsible-block-toolbar__toggle",icon:e?Ef:Tf,onClick:()=>{t(!e)},label:e?(0,fs.__)("Show block tools"):(0,fs.__)("Hide block tools"),size:"compact"})]}):null}var Nf=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})});var Rf=function({className:e,disableBlockTools:t=!1}){const{setIsInserterOpened:s,setIsListViewOpened:n}=(0,d.useDispatch)(xc),{isDistractionFree:o,isInserterOpened:r,isListViewOpen:i,listViewShortcut:a,inserterSidebarToggleRef:l,listViewToggleRef:u,showIconLabels:h}=(0,d.useSelect)((e=>{const{get:t}=e(C.store),{isListViewOpened:s,getEditorMode:n,getInserterSidebarToggleRef:o,getListViewToggleRef:r}=$(e(xc)),{getShortcutRepresentation:i}=e(al.store);return{isInserterOpened:e(xc).isInserterOpened(),isListViewOpen:s(),listViewShortcut:i("core/editor/toggle-list-view"),inserterSidebarToggleRef:o(),listViewToggleRef:r(),showIconLabels:t("core","showIconLabels"),isDistractionFree:t("core","distractionFree"),isVisualMode:"visual"===n()}}),[]),_=(0,m.useViewportMatch)("wide"),f=(0,fs.__)("Document tools"),b=(0,p.useCallback)((()=>n(!i)),[n,i]),y=(0,p.useCallback)((()=>s(!r)),[r,s]),x=(0,fs._x)("Block Inserter","Generic label for block inserter button"),v=r?(0,fs.__)("Close"):(0,fs.__)("Add");return(0,c.jsx)(g.NavigableToolbar,{className:hr("editor-document-tools","edit-post-header-toolbar",e),"aria-label":f,variant:"unstyled",children:(0,c.jsxs)("div",{className:"editor-document-tools__left",children:[!o&&(0,c.jsx)(Fn.ToolbarButton,{ref:l,className:"editor-document-tools__inserter-toggle",variant:"primary",isPressed:r,onMouseDown:e=>{r&&e.preventDefault()},onClick:y,disabled:t,icon:Nf,label:h?v:x,showTooltip:!h,"aria-expanded":r}),(_||!h)&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Fn.ToolbarItem,{as:rd,showTooltip:!h,variant:h?"tertiary":void 0,size:"compact"}),(0,c.jsx)(Fn.ToolbarItem,{as:od,showTooltip:!h,variant:h?"tertiary":void 0,size:"compact"}),!o&&(0,c.jsx)(Fn.ToolbarButton,{className:"editor-document-tools__document-overview-toggle",icon:Zi,disabled:t,isPressed:i,label:(0,fs.__)("Document Overview"),onClick:b,shortcut:a,showTooltip:!h,variant:h?"tertiary":void 0,"aria-expanded":i,ref:u})]})]})})};function Df(){const{createNotice:e}=(0,d.useDispatch)(_s.store),{getCurrentPostId:t,getCurrentPostType:s}=(0,d.useSelect)(xc),{getEditedEntityRecord:n}=(0,d.useSelect)(u.store);const o=(0,m.useCopyToClipboard)((function(){const e=n("postType",s(),t());return e?"function"==typeof e.content?e.content(e):e.blocks?(0,x.__unstableSerializeAndClean)(e.blocks):e.content?e.content:void 0:""}),(function(){e("info",(0,fs.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,c.jsx)(Fn.MenuItem,{ref:o,children:(0,fs.__)("Copy all blocks")})}const Af=[{value:"visual",label:(0,fs.__)("Visual editor")},{value:"text",label:(0,fs.__)("Code editor")}];var Mf=function(){const{shortcut:e,isRichEditingEnabled:t,isCodeEditingEnabled:s,mode:n}=(0,d.useSelect)((e=>({shortcut:e(al.store).getShortcutRepresentation("core/editor/toggle-mode"),isRichEditingEnabled:e(xc).getEditorSettings().richEditingEnabled,isCodeEditingEnabled:e(xc).getEditorSettings().codeEditingEnabled,mode:e(xc).getEditorMode()})),[]),{switchEditorMode:o}=(0,d.useDispatch)(xc);let r=n;t||"visual"!==n||(r="text"),s||"text"!==n||(r="visual");const i=Af.map((n=>(s||"text"!==n.value||(n={...n,disabled:!0}),t||"visual"!==n.value||(n={...n,disabled:!0,info:(0,fs.__)("You can enable the visual editor in your profile settings.")}),n.value===r||n.disabled?n:{...n,shortcut:e})));return(0,c.jsx)(Fn.MenuGroup,{label:(0,fs.__)("Editor"),children:(0,c.jsx)(Fn.MenuItemsChoice,{choices:i,value:r,onSelect:o})})};const{Fill:Lf,Slot:Of}=(0,Fn.createSlotFill)("ToolsMoreMenuGroup");Lf.Slot=({fillProps:e})=>(0,c.jsx)(Of,{fillProps:e});var Ff=Lf;const{Fill:Vf,Slot:Uf}=(0,Fn.createSlotFill)("web"===p.Platform.OS?Symbol("ViewMoreMenuGroup"):"ViewMoreMenuGroup");Vf.Slot=({fillProps:e})=>(0,c.jsx)(Uf,{fillProps:e});var zf=Vf;function Hf(){const{openModal:e}=(0,d.useDispatch)(Ea),{set:t}=(0,d.useDispatch)(C.store),{toggleDistractionFree:s}=(0,d.useDispatch)(xc),n=(0,d.useSelect)((e=>e(C.store).get("core","showIconLabels")),[]),o=()=>{t("core","distractionFree",!1)};return(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(Fn.DropdownMenu,{icon:s_,label:(0,fs.__)("Options"),popoverProps:{placement:"bottom-end",className:"more-menu-dropdown__content"},toggleProps:{showTooltip:!n,...n&&{variant:"tertiary"},tooltipPosition:"bottom",size:"compact"},children:({onClose:t})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(Fn.MenuGroup,{label:(0,fs._x)("View","noun"),children:[(0,c.jsx)(C.PreferenceToggleMenuItem,{scope:"core",name:"fixedToolbar",onToggle:o,label:(0,fs.__)("Top toolbar"),info:(0,fs.__)("Access all block and document tools in a single place"),messageActivated:(0,fs.__)("Top toolbar activated."),messageDeactivated:(0,fs.__)("Top toolbar deactivated.")}),(0,c.jsx)(C.PreferenceToggleMenuItem,{scope:"core",name:"distractionFree",label:(0,fs.__)("Distraction free"),info:(0,fs.__)("Write with calmness"),handleToggling:!1,onToggle:()=>s({createNotice:!1}),messageActivated:(0,fs.__)("Distraction free mode activated."),messageDeactivated:(0,fs.__)("Distraction free mode deactivated."),shortcut:cl.displayShortcut.primaryShift("\\")}),(0,c.jsx)(C.PreferenceToggleMenuItem,{scope:"core",name:"focusMode",label:(0,fs.__)("Spotlight mode"),info:(0,fs.__)("Focus on one block at a time"),messageActivated:(0,fs.__)("Spotlight mode activated."),messageDeactivated:(0,fs.__)("Spotlight mode deactivated.")}),(0,c.jsx)(zf.Slot,{fillProps:{onClose:t}})]}),(0,c.jsx)(Mf,{}),(0,c.jsx)(Ra.Slot,{name:"core/plugin-more-menu",label:(0,fs.__)("Plugins"),fillProps:{onClick:t}}),(0,c.jsxs)(Fn.MenuGroup,{label:(0,fs.__)("Tools"),children:[(0,c.jsx)(Fn.MenuItem,{onClick:()=>e("editor/keyboard-shortcut-help"),shortcut:cl.displayShortcut.access("h"),children:(0,fs.__)("Keyboard shortcuts")}),(0,c.jsx)(Df,{}),(0,c.jsxs)(Fn.MenuItem,{icon:Gn,href:(0,fs.__)("https://wordpress.org/documentation/article/wordpress-block-editor/"),target:"_blank",rel:"noopener noreferrer",children:[(0,fs.__)("Help"),(0,c.jsx)(Fn.VisuallyHidden,{as:"span",children:(0,fs.__)("(opens in a new tab)")})]}),(0,c.jsx)(Ff.Slot,{fillProps:{onClose:t}})]}),(0,c.jsx)(Fn.MenuGroup,{children:(0,c.jsx)(Fn.MenuItem,{onClick:()=>e("editor/preferences"),children:(0,fs.__)("Preferences")})})]})})})}const Gf="toggle",$f="button";function Wf({forceIsDirty:e,setEntitiesSavedStatesCallback:t}){let s;const n=(0,m.useViewportMatch)("medium","<"),{togglePublishSidebar:o}=(0,d.useDispatch)(xc),{hasPublishAction:r,isBeingScheduled:i,isPending:a,isPublished:l,isPublishSidebarEnabled:u,isPublishSidebarOpened:p,isScheduled:h,postStatus:g,postStatusHasChanged:_}=(0,d.useSelect)((e=>({hasPublishAction:!!e(xc).getCurrentPost()?._links?.["wp:action-publish"],isBeingScheduled:e(xc).isEditedPostBeingScheduled(),isPending:e(xc).isCurrentPostPending(),isPublished:e(xc).isCurrentPostPublished(),isPublishSidebarEnabled:e(xc).isPublishSidebarEnabled(),isPublishSidebarOpened:e(xc).isPublishSidebarOpened(),isScheduled:e(xc).isCurrentPostScheduled(),postStatus:e(xc).getEditedPostAttribute("status"),postStatusHasChanged:e(xc).getPostEdits()?.status})),[]);return s=l||_&&!["future","publish"].includes(g)||h&&i||a&&!r&&!n?$f:n||u?Gf:$f,(0,c.jsx)(Fp,{forceIsDirty:e,isOpen:p,isToggle:s===Gf,onToggle:o,setEntitiesSavedStatesCallback:t})}function Zf(){const{hasLoaded:e,permalink:t,isPublished:s,label:n,showIconLabels:o}=(0,d.useSelect)((e=>{const t=e(xc).getCurrentPostType(),s=e(u.store).getPostType(t),{get:n}=e(C.store);return{permalink:e(xc).getPermalink(),isPublished:e(xc).isCurrentPostPublished(),label:s?.labels.view_item,hasLoaded:!!s,showIconLabels:n("core","showIconLabels")}}),[]);return s&&t&&e?(0,c.jsx)(Fn.Button,{icon:Gn,label:n||(0,fs.__)("View post"),href:t,target:"_blank",showTooltip:!o,size:"compact"}):null}var Yf=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"})}),qf=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z"})}),Kf=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M17 4H7c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12zm-7.5-.5h4V16h-4v1.5z"})});function Qf({forceIsAutosaveable:e,disabled:t}){const{deviceType:s,homeUrl:n,isTemplate:o,isViewable:r,showIconLabels:i,isTemplateHidden:a,templateId:l}=(0,d.useSelect)((e=>{const{getDeviceType:t,getCurrentPostType:s,getCurrentTemplateId:n,getRenderingMode:o}=e(xc),{getEntityRecord:r,getPostType:i}=e(u.store),{get:a}=e(C.store),l=s();return{deviceType:t(),homeUrl:r("root","__unstableBase")?.home,isTemplate:"wp_template"===l,isViewable:i(l)?.viewable??!1,showIconLabels:a("core","showIconLabels"),isTemplateHidden:"post-only"===o(),templateId:n()}}),[]),{setDeviceType:p,setRenderingMode:h,setDefaultRenderingMode:_}=$((0,d.useDispatch)(xc)),{resetZoomLevel:f}=$((0,d.useDispatch)(g.store)),b=e=>{p(e),f()};if((0,m.useViewportMatch)("medium","<"))return null;const y={className:"editor-preview-dropdown__toggle",iconPosition:"right",size:"compact",showTooltip:!i,disabled:t,accessibleWhenDisabled:t},x={"aria-label":(0,fs.__)("View options")},v={desktop:Yf,mobile:qf,tablet:Kf},w=[{value:"Desktop",label:(0,fs.__)("Desktop"),icon:Yf},{value:"Tablet",label:(0,fs.__)("Tablet"),icon:Kf},{value:"Mobile",label:(0,fs.__)("Mobile"),icon:qf}];return(0,c.jsx)(Fn.DropdownMenu,{className:hr("editor-preview-dropdown",`editor-preview-dropdown--$s.toLowerCase()}`),popoverProps:{placement:"bottom-end"},toggleProps:y,menuProps:x,icon:v[s.toLowerCase()],label:(0,fs.__)("View"),disableOpenOnArrowDown:t,children:({onClose:t})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Fn.MenuGroup,{children:(0,c.jsx)(Fn.MenuItemsChoice,{choices:w,value:s,onSelect:b})}),o&&(0,c.jsx)(Fn.MenuGroup,{children:(0,c.jsxs)(Fn.MenuItem,{href:n,target:"_blank",icon:Gn,onClick:t,children:[(0,fs.__)("View site"),(0,c.jsx)(Fn.VisuallyHidden,{as:"span",children:(0,fs.__)("(opens in a new tab)")})]})}),!o&&!!l&&(0,c.jsx)(Fn.MenuGroup,{children:(0,c.jsx)(Fn.MenuItem,{icon:a?void 0:Zn,isSelected:!a,role:"menuitemcheckbox",onClick:()=>{const e=a?"template-locked":"post-only";h(e),_(e),f()},children:(0,fs.__)("Show template")})}),r&&(0,c.jsx)(Fn.MenuGroup,{children:(0,c.jsx)(Ap,{className:"editor-preview-dropdown__button-external",role:"menuitem",forceIsAutosaveable:e,"aria-label":(0,fs.__)("Preview in new tab"),textContent:(0,c.jsxs)(c.Fragment,{children:[(0,fs.__)("Preview in new tab"),(0,c.jsx)(Fn.Icon,{icon:Gn})]}),onPreview:t})}),(0,c.jsx)(Ra.Slot,{name:"core/plugin-preview-menu",fillProps:{onClick:t}})]})})}var Xf=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fill:"none",d:"M5.75 12.75V18.25H11.25M12.75 5.75H18.25V11.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"square"})});var Jf=({disabled:e})=>{const{isZoomOut:t,showIconLabels:s,isDistractionFree:n}=(0,d.useSelect)((e=>({isZoomOut:$(e(g.store)).isZoomOut(),showIconLabels:e(C.store).get("core","showIconLabels"),isDistractionFree:e(C.store).get("core","distractionFree")}))),{resetZoomLevel:o,setZoomLevel:r}=$((0,d.useDispatch)(g.store)),{registerShortcut:i,unregisterShortcut:a}=(0,d.useDispatch)(al.store);(0,p.useEffect)((()=>(i({name:"core/editor/zoom",category:"global",description:(0,fs.__)("Enter or exit zoom out."),keyCombination:{modifier:(0,cl.isAppleOS)()?"primaryShift":"secondary",character:"0"}}),()=>{a("core/editor/zoom")})),[i,a]),(0,al.useShortcut)("core/editor/zoom",(()=>{t?o():r("auto-scaled")}),{isDisabled:n});return(0,c.jsx)(Fn.Button,{accessibleWhenDisabled:!0,disabled:e,onClick:()=>{t?o():r("auto-scaled")},icon:Xf,label:(0,fs.__)("Zoom Out"),isPressed:t,size:"compact",showTooltip:!s,className:"editor-zoom-out-toggle"})};const eb={distractionFreeDisabled:{y:"-50px"},distractionFreeHover:{y:0},distractionFreeHidden:{y:"-50px"},visible:{y:0},hidden:{y:0}},tb={distractionFreeDisabled:{x:"-100%"},distractionFreeHover:{x:0},distractionFreeHidden:{x:"-100%"},visible:{x:0},hidden:{x:0}};var sb=function({customSaveButton:e,forceIsDirty:t,forceDisableBlockTools:s,setEntitiesSavedStatesCallback:n,title:o}){const r=(0,m.useViewportMatch)("large"),i=(0,m.useViewportMatch)("medium"),a=(0,m.useMediaQuery)("(max-width: 403px)"),{postType:l,isTextEditor:u,isPublishSidebarOpened:h,showIconLabels:_,hasFixedToolbar:f,hasBlockSelection:b,hasSectionRootClientId:y}=(0,d.useSelect)((e=>{const{get:t}=e(C.store),{getEditorMode:s,getCurrentPostType:n,isPublishSidebarOpened:o}=e(xc),{getBlockSelectionStart:r,getSectionRootClientId:i}=$(e(g.store));return{postType:n(),isTextEditor:"text"===s(),isPublishSidebarOpened:o(),showIconLabels:t("core","showIconLabels"),hasFixedToolbar:t("core","fixedToolbar"),hasBlockSelection:!!r(),hasSectionRootClientId:!!i()}}),[]),x=["post","page","wp_template"].includes(l)&&y,v=[R,I,N].includes(l)||s,[w,S]=(0,p.useState)(!0),k=!a&&(!f||f&&(!b||w)),P=(()=>{const e=(0,Fn.__experimentalUseSlotFills)(Zg);return Boolean(e&&e.length)})();return(0,c.jsxs)("div",{className:"editor-header edit-post-header",children:[P&&(0,c.jsx)(Fn.__unstableMotion.div,{className:"editor-header__back-button",variants:tb,transition:{type:"tween"},children:(0,c.jsx)(Qg.Slot,{})}),(0,c.jsxs)(Fn.__unstableMotion.div,{variants:eb,className:"editor-header__toolbar",transition:{type:"tween"},children:[(0,c.jsx)(Rf,{disableBlockTools:s||u}),f&&i&&(0,c.jsx)(If,{isCollapsed:w,onToggle:S})]}),k&&(0,c.jsx)(Fn.__unstableMotion.div,{className:"editor-header__center",variants:eb,transition:{type:"tween"},children:(0,c.jsx)(Hc,{title:o})}),(0,c.jsxs)(Fn.__unstableMotion.div,{variants:eb,transition:{type:"tween"},className:"editor-header__settings",children:[!e&&!h&&(0,c.jsx)(sh,{forceIsDirty:t}),(0,c.jsx)(Zf,{}),(0,c.jsx)(Qf,{forceIsAutosaveable:t,disabled:v}),(0,c.jsx)(Ap,{className:"editor-header__post-preview-button",forceIsAutosaveable:t}),r&&x&&(0,c.jsx)(Jf,{disabled:s}),(r||!_)&&(0,c.jsx)(La.Slot,{scope:"core"}),!e&&(0,c.jsx)(Wf,{forceIsDirty:t,setEntitiesSavedStatesCallback:n}),(0,c.jsx)(Td,{supportKeys:"editor.notes",children:(0,c.jsx)(jf,{})}),e,(0,c.jsx)(Hf,{})]})]})};const{PrivateInserterLibrary:nb}=$(g.privateApis);function ob(){const{blockSectionRootClientId:e,inserterSidebarToggleRef:t,inserter:s,showMostUsedBlocks:n,sidebarIsOpened:o}=(0,d.useSelect)((e=>{const{getInserterSidebarToggleRef:t,getInserter:s,isPublishSidebarOpened:n}=$(e(xc)),{getBlockRootClientId:o,isZoomOut:r,getSectionRootClientId:i}=$(e(g.store)),{get:a}=e(C.store),{getActiveComplementaryArea:l}=e(Ea);return{inserterSidebarToggleRef:t(),inserter:s(),showMostUsedBlocks:a("core","mostUsedBlocks"),blockSectionRootClientId:(()=>{if(r()){const e=i();if(e)return e}return o()})(),sidebarIsOpened:!(!l("core")&&!n())}}),[]),{setIsInserterOpened:r}=(0,d.useDispatch)(xc),{disableComplementaryArea:i}=(0,d.useDispatch)(Ea),a=(0,m.useViewportMatch)("medium","<"),l=(0,p.useRef)(),u=(0,p.useCallback)((()=>{r(!1),t.current?.focus()}),[t,r]),h=(0,p.useCallback)((e=>{e.keyCode!==cl.ESCAPE||e.defaultPrevented||(e.preventDefault(),u())}),[u]),_=(0,c.jsx)("div",{className:"editor-inserter-sidebar__content",children:(0,c.jsx)(nb,{showMostUsedBlocks:n,showInserterHelpPanel:!0,shouldFocusBlock:a,rootClientId:e,onSelect:s.onSelect,__experimentalInitialTab:s.tab,__experimentalInitialCategory:s.category,__experimentalFilterValue:s.filterValue,onPatternCategorySelection:o?()=>i("core"):void 0,ref:l,onClose:u})});return(0,c.jsx)("div",{onKeyDown:h,className:"editor-inserter-sidebar",children:_})}function rb(){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{className:"editor-list-view-sidebar__outline",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(Fn.__experimentalText,{children:(0,fs.__)("Characters:")}),(0,c.jsx)(Fn.__experimentalText,{children:(0,c.jsx)(Lh,{})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(Fn.__experimentalText,{children:(0,fs.__)("Words:")}),(0,c.jsx)(Dh,{})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(Fn.__experimentalText,{children:(0,fs.__)("Time to read:")}),(0,c.jsx)(Mh,{})]})]}),(0,c.jsx)(Jc,{})]})}const{TabbedSidebar:ib}=$(g.privateApis);function ab(){const{setIsListViewOpened:e}=(0,d.useDispatch)(xc),{getListViewToggleRef:t}=$((0,d.useSelect)(xc)),s=(0,m.useFocusOnMount)("firstElement"),n=(0,p.useCallback)((()=>{e(!1),t().current?.focus()}),[t,e]),o=(0,p.useCallback)((e=>{e.keyCode!==cl.ESCAPE||e.defaultPrevented||(e.preventDefault(),n())}),[n]),[r,i]=(0,p.useState)(null),[a,l]=(0,p.useState)("list-view"),u=(0,p.useRef)(),h=(0,p.useRef)(),_=(0,p.useRef)(),f=(0,m.useMergeRefs)([s,_,i]);const b=(0,p.useCallback)((()=>{u.current.contains(u.current.ownerDocument.activeElement)?n():function(e){const t=Vc.focus.tabbable.find(h.current)[0];if("list-view"===e){const e=Vc.focus.tabbable.find(_.current)[0];(u.current.contains(e)?e:t).focus()}else t.focus()}(a)}),[n,a]);return(0,al.useShortcut)("core/editor/toggle-list-view",b),(0,c.jsx)("div",{className:"editor-list-view-sidebar",onKeyDown:o,ref:u,children:(0,c.jsx)(ib,{tabs:[{name:"list-view",title:(0,fs._x)("List View","Post overview"),panel:(0,c.jsx)("div",{className:"editor-list-view-sidebar__list-view-container",children:(0,c.jsx)("div",{className:"editor-list-view-sidebar__list-view-panel-content",children:(0,c.jsx)(g.__experimentalListView,{dropZoneElement:r})})}),panelRef:f},{name:"outline",title:(0,fs._x)("Outline","Post overview"),panel:(0,c.jsx)("div",{className:"editor-list-view-sidebar__list-view-container",children:(0,c.jsx)(rb,{})})}],onClose:n,onSelect:e=>l(e),defaultTabId:"list-view",ref:h,closeButtonLabel:(0,fs.__)("Close")})})}const{Fill:lb,Slot:cb}=(0,Fn.createSlotFill)("ActionsPanel");function db({setEntitiesSavedStatesCallback:e,closeEntitiesSavedStates:t,isEntitiesSavedStatesOpen:s,forceIsDirtyPublishPanel:n}){const{closePublishSidebar:o,togglePublishSidebar:r}=(0,d.useDispatch)(xc),{publishSidebarOpened:i,isPublishable:a,isDirty:l,hasOtherEntitiesChanges:u}=(0,d.useSelect)((e=>{const{isPublishSidebarOpened:t,isEditedPostPublishable:s,isCurrentPostPublished:n,isEditedPostDirty:o,hasNonPostEntityChanges:r}=e(xc),i=r();return{publishSidebarOpened:t(),isPublishable:!n()&&s(),isDirty:i||o(),hasOtherEntitiesChanges:i}}),[]),m=(0,p.useCallback)((()=>e(!0)),[]);let h;return h=i?(0,c.jsx)(Zm,{onClose:o,forceIsDirty:n,PrePublishExtension:Eu.Slot,PostPublishExtension:xu.Slot}):a&&!u?(0,c.jsx)("div",{className:"editor-layout__toggle-publish-panel",children:(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:r,"aria-expanded":!1,children:(0,fs.__)("Open publish panel")})}):(0,c.jsx)("div",{className:"editor-layout__toggle-entities-saved-states-panel",children:(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:m,"aria-expanded":!1,"aria-haspopup":"dialog",disabled:!l,accessibleWhenDisabled:!0,children:(0,fs.__)("Open save panel")})}),(0,c.jsxs)(c.Fragment,{children:[s&&(0,c.jsx)(bd,{close:t,renderDialog:!0}),(0,c.jsx)(cb,{bubblesVirtually:!0}),!s&&h]})}function ub({autoFocus:e=!1}){const{switchEditorMode:t}=(0,d.useDispatch)(xc),{shortcut:s,isRichEditingEnabled:n}=(0,d.useSelect)((e=>{const{getEditorSettings:t}=e(xc),{getShortcutRepresentation:s}=e(al.store);return{shortcut:s("core/editor/toggle-mode"),isRichEditingEnabled:t().richEditingEnabled}}),[]),o=(0,p.useRef)();return(0,p.useEffect)((()=>{e||o?.current?.focus()}),[e]),(0,c.jsxs)("div",{className:"editor-text-editor",children:[n&&(0,c.jsxs)("div",{className:"editor-text-editor__toolbar",children:[(0,c.jsx)("h2",{children:(0,fs.__)("Editing code")}),(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t("visual"),shortcut:s,children:(0,fs.__)("Exit code editor")})]}),(0,c.jsxs)("div",{className:"editor-text-editor__body",children:[(0,c.jsx)(vh,{ref:o}),(0,c.jsx)(hh,{})]})]})}function pb({contentRef:e}){const{onNavigateToEntityRecord:t,templateId:s}=(0,d.useSelect)((e=>{const{getEditorSettings:t,getCurrentTemplateId:s}=e(xc);return{onNavigateToEntityRecord:t().onNavigateToEntityRecord,templateId:s()}}),[]),n=(0,d.useSelect)((e=>!!e(u.store).canUser("create",{kind:"postType",name:"wp_template"})),[]),[o,r]=(0,p.useState)(!1);return(0,p.useEffect)((()=>{const t=e=>{n&&e.target.classList.contains("is-root-container")&&"core/template-part"!==e.target.dataset?.type&&(e.defaultPrevented||(e.preventDefault(),r(!0)))},s=e.current;return s?.addEventListener("dblclick",t),()=>{s?.removeEventListener("dblclick",t)}}),[e,n]),n?(0,c.jsx)(Fn.__experimentalConfirmDialog,{isOpen:o,confirmButtonText:(0,fs.__)("Edit template"),onConfirm:()=>{r(!1),t({postId:s,postType:"wp_template"})},onCancel:()=>r(!1),size:"medium",children:(0,fs.__)("You’ve tried to select a block that is part of a template that may be used elsewhere on your site. Would you like to edit the template?")}):null}function mb({direction:e,resizeWidthBy:t}){const s=`resizable-editor__resize-help-$e}`;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Fn.Tooltip,{text:(0,fs.__)("Drag to resize"),children:(0,c.jsx)(Fn.__unstableMotion.button,{className:`editor-resizable-editor__resize-handle is-$e}`,"aria-label":(0,fs.__)("Drag to resize"),"aria-describedby":s,onKeyDown:function(s){const{keyCode:n}=s;n!==cl.LEFT&&n!==cl.RIGHT||(s.preventDefault(),"left"===e&&n===cl.LEFT||"right"===e&&n===cl.RIGHT?t(20):("left"===e&&n===cl.RIGHT||"right"===e&&n===cl.LEFT)&&t(-20))},variants:{active:{opacity:1,scaleY:1.3}},whileFocus:"active",whileHover:"active",whileTap:"active",role:"separator","aria-orientation":"vertical"},"handle")}),(0,c.jsx)(Fn.VisuallyHidden,{id:s,children:(0,fs.__)("Use left and right arrow keys to resize the canvas.")})]})}const hb={position:void 0,userSelect:void 0,cursor:void 0,width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0};var gb=function({className:e,enableResizing:t,height:s,children:n}){const[o,r]=(0,p.useState)("100%"),i=(0,p.useRef)(),a=(0,p.useCallback)((e=>{i.current&&r(i.current.offsetWidth+e)}),[]);return(0,c.jsx)(Fn.ResizableBox,{className:hr("editor-resizable-editor",e,{"is-resizable":t}),ref:e=>{i.current=e?.resizable},size:{width:t?o:"100%",height:t&&s?s:"100%"},onResizeStop:(e,t,s)=>{r(s.style.width)},minWidth:300,maxWidth:"100%",maxHeight:"100%",enable:{left:t,right:t},showHandle:t,resizeRatio:2,handleComponent:{left:(0,c.jsx)(mb,{direction:"left",resizeWidthBy:a}),right:(0,c.jsx)(mb,{direction:"right",resizeWidthBy:a})},handleClasses:void 0,handleStyles:{left:hb,right:hb},children:n})};function _b(e,t,s){return Math.min(Math.max(e,t),s)}function fb(e,t,s){const n=e-_b(e,s.left,s.right),o=t-_b(t,s.top,s.bottom);return Math.sqrt(n*n+o*o)}function bb({isEnabled:e=!0}={}){const{getEnabledClientIdsTree:t,getBlockName:s,getBlockOrder:n}=$((0,d.useSelect)(g.store)),{selectBlock:o}=(0,d.useDispatch)(g.store);return(0,m.useRefEffect)((r=>{if(!e)return;const i=e=>{(e.target===r||e.target.classList.contains("is-root-container"))&&((e,i)=>{const a=t().flatMap((({clientId:e})=>{const t=s(e);if("core/template-part"===t)return[];if("core/post-content"===t){const t=n(e);if(t.length)return t}return[e]}));let l=1/0,c=null;for(const t of a){const s=r.querySelector(`[data-block="$t}"]`);if(!s)continue;const n=fb(e,i,s.getBoundingClientRect());n<l&&n<500&&(l=n,c=t)}c&&o(c)})(e.clientX,e.clientY)};return r.addEventListener("click",i),()=>r.removeEventListener("click",i)}),[e])}function yb(){const{getSettings:e,isZoomOut:t}=$((0,d.useSelect)(g.store)),{resetZoomLevel:s}=$((0,d.useDispatch)(g.store));return(0,m.useRefEffect)((n=>{function o(n){if(t()&&!n.defaultPrevented){n.preventDefault();const{__experimentalSetIsInserterOpened:t}=e();"function"==typeof t&&t(!1),s()}}return n.addEventListener("dblclick",o),()=>{n.removeEventListener("dblclick",o)}}),[e,t,s])}const{LayoutStyle:xb,useLayoutClasses:vb,useLayoutStyles:wb,ExperimentalBlockCanvas:Sb,useFlashEditableBlocks:kb}=$(g.privateApis),Cb=[N,B,R,I];function Pb(e){for(let t=0;t<e.length;t++){if("core/post-content"===e[t].name)return e[t].attributes;if(e[t].innerBlocks.length){const s=Pb(e[t].innerBlocks);if(s)return s}}}function jb(e){for(let t=0;t<e.length;t++)if("core/post-content"===e[t].name)return!0;return!1}var Eb=function({autoFocus:e,styles:t,disableIframe:s=!1,iframeProps:n,contentRef:o,className:r}){const i=(0,m.useViewportMatch)("small","<"),{renderingMode:a,postContentAttributes:l,editedPostTemplate:h={},wrapperBlockName:_,wrapperUniqueId:f,deviceType:b,isFocusedEntity:y,isDesignPostType:v,postType:w,isPreview:S}=(0,d.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s,getCurrentTemplateId:n,getEditorSettings:o,getRenderingMode:r,getDeviceType:i}=e(xc),{getPostType:a,getEditedEntityRecord:l}=e(u.store),c=s(),d=r();let p;c===N?p="core/block":"post-only"===d&&(p="core/post-content");const m=o(),h=m.supportsTemplateMode,g=a(c),_=n(),f=_?l("postType",B,_):void 0;return{renderingMode:d,postContentAttributes:m.postContentAttributes,isDesignPostType:Cb.includes(c),editedPostTemplate:g?.viewable&&h?f:void 0,wrapperBlockName:p,wrapperUniqueId:t(),deviceType:i(),isFocusedEntity:!!m.onNavigateToPreviousEntityRecord,postType:c,isPreview:m.isPreviewMode}}),[]),{isCleanNewPost:k}=(0,d.useSelect)(xc),{hasRootPaddingAwareAlignments:C,themeHasDisabledLayoutStyles:P,themeSupportsLayout:j,isZoomedOut:E}=(0,d.useSelect)((e=>{const{getSettings:t,isZoomOut:s}=$(e(g.store)),n=t();return{themeHasDisabledLayoutStyles:n.disableLayoutStyles,themeSupportsLayout:n.supportsLayout,hasRootPaddingAwareAlignments:n.__experimentalFeatures?.useRootPaddingAwareAlignments,isZoomedOut:s()}}),[]),T=(0,g.__experimentalUseResizeCanvas)(b),[D]=(0,g.useSettings)("layout"),A=(0,p.useMemo)((()=>"post-only"!==a||v?{type:"default"}:j?{...D,type:"constrained"}:{type:"default"}),[a,j,D,v]),M=(0,p.useMemo)((()=>{if(!h?.content&&!h?.blocks&&l)return l;if(h?.blocks)return Pb(h?.blocks);const e="string"==typeof h?.content?h?.content:"";return Pb((0,x.parse)(e))||{}}),[h?.content,h?.blocks,l]),L=(0,p.useMemo)((()=>{if(!h?.content&&!h?.blocks)return!1;if(h?.blocks)return jb(h?.blocks);const e="string"==typeof h?.content?h?.content:"";return jb((0,x.parse)(e))||!1}),[h?.content,h?.blocks]),{layout:O={},align:F=""}=M||{},V=vb(M,"core/post-content"),U=hr({"is-layout-flow":!j},j&&V,F&&`align$F}`),z=wb(M,"core/post-content",".block-editor-block-list__layout.is-root-container"),H=(0,p.useMemo)((()=>O&&("constrained"===O?.type||O?.inherit||O?.contentSize||O?.wideSize)?{...D,...O,type:"constrained"}:{...D,...O,type:"default"}),[O?.type,O?.inherit,O?.contentSize,O?.wideSize,D]),G=l?H:A,W="default"!==G?.type||L?G:A,Z=(0,g.__unstableUseTypingObserver)(),Y=(0,p.useRef)();(0,p.useEffect)((()=>{e&&k()&&Y?.current?.focus()}),[e,k]);const q=[R,I,N].includes(w)&&!S&&!i&&!E,K=(0,p.useMemo)((()=>[...t??[],{css:`:where(.block-editor-iframe__body){display:flow-root;}.is-root-container{display:flow-root;$q?"min-height:0!important;":""}}\n\t\t\t\t$q?".block-editor-iframe__html{background:var(--wp-editor-canvas-background);display:flex;align-items:center;justify-content:center;min-height:100vh;}.block-editor-iframe__body{width:100%;}":""}`}]),[t,q]),Q=(0,p.useRef)(),X=(0,g.__unstableUseTypewriter)();return o=(0,m.useMergeRefs)([Q,o,"post-only"===a?X:null,kb({isEnabled:"template-locked"===a}),bb({isEnabled:"template-locked"===a}),yb()]),(0,c.jsx)("div",{className:hr("editor-visual-editor","edit-post-visual-editor",r,{"has-padding":y||q,"is-resizable":q,"is-iframed":!s}),children:(0,c.jsx)(gb,{enableResizing:q,height:"100%",children:(0,c.jsxs)(Sb,{shouldIframe:!s,contentRef:o,styles:K,height:"100%",iframeProps:{...n,style:{...n?.style,...T}},children:[j&&!P&&"post-only"===a&&!v&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(xb,{selector:".editor-visual-editor__post-title-wrapper",layout:A}),(0,c.jsx)(xb,{selector:".block-editor-block-list__layout.is-root-container",layout:W}),F&&(0,c.jsx)(xb,{css:".is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}\n\t\t.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}"}),z&&(0,c.jsx)(xb,{layout:H,css:z})]}),"post-only"===a&&!v&&(0,c.jsx)("div",{className:hr("editor-visual-editor__post-title-wrapper","edit-post-visual-editor__post-title-wrapper",{"has-global-padding":C}),contentEditable:!1,ref:Z,style:{marginTop:"4rem"},children:(0,c.jsx)(xh,{ref:Y})}),(0,c.jsxs)(g.RecursionProvider,{blockName:_,uniqueId:f,children:[(0,c.jsx)(g.BlockList,{className:hr("is-"+b.toLowerCase()+"-preview","post-only"!==a||v?"wp-site-blocks":`$U} wp-block-post-content`,{"has-global-padding":"post-only"===a&&!v&&C}),layout:G,dropZoneElement:s?Q.current:Q.current?.parentNode,__unstableDisableDropZone:"template-locked"===a}),"template-locked"===a&&(0,c.jsx)(pb,{contentRef:Q})]})]})})})};const Tb={header:(0,fs.__)("Editor top bar"),body:(0,fs.__)("Editor content"),sidebar:(0,fs.__)("Editor settings"),actions:(0,fs.__)("Editor publish"),footer:(0,fs.__)("Editor footer")};function Bb({className:e,styles:t,children:s,forceIsDirty:n,contentRef:o,disableIframe:r,autoFocus:i,customSaveButton:a,customSavePanel:l,forceDisableBlockTools:u,title:h,iframeProps:_}){const{mode:f,isInserterOpened:b,isListViewOpened:y,isDistractionFree:x,isPreviewMode:v,showBlockBreadcrumbs:w,documentLabel:S}=(0,d.useSelect)((e=>{const{get:t}=e(C.store),{getEditorSettings:s,getPostTypeLabel:n}=e(xc),o=s(),r=n();let i=e(xc).getEditorMode();return o.richEditingEnabled||"visual"!==i||(i="text"),o.codeEditingEnabled||"text"!==i||(i="visual"),{mode:i,isInserterOpened:e(xc).isInserterOpened(),isListViewOpened:e(xc).isListViewOpened(),isDistractionFree:t("core","distractionFree"),isPreviewMode:o.isPreviewMode,showBlockBreadcrumbs:t("core","showBlockBreadcrumbs"),documentLabel:r||(0,fs._x)("Document","noun, breadcrumb")}}),[]),k=(0,m.useViewportMatch)("medium"),P=y?(0,fs.__)("Document Overview"):(0,fs.__)("Block Library"),[j,E]=(0,p.useState)(!1),T=(0,p.useCallback)((e=>{"function"==typeof j&&j(e),E(!1)}),[j]);return(0,c.jsx)(Za,{isDistractionFree:x,className:hr("editor-editor-interface",e,{"is-entity-save-view-open":!!j,"is-distraction-free":x&&!v}),labels:{...Tb,secondarySidebar:P},header:!v&&(0,c.jsx)(sb,{forceIsDirty:n,setEntitiesSavedStatesCallback:E,customSaveButton:a,forceDisableBlockTools:u,title:h}),editorNotices:(0,c.jsx)(ad,{}),secondarySidebar:!v&&"visual"===f&&(b&&(0,c.jsx)(ob,{})||y&&(0,c.jsx)(ab,{})),sidebar:!v&&!x&&(0,c.jsx)(Ua.Slot,{scope:"core"}),content:(0,c.jsxs)(c.Fragment,{children:[!x&&!v&&(0,c.jsx)(ad,{}),(0,c.jsx)(Wg.Slot,{children:([e])=>e||(0,c.jsxs)(c.Fragment,{children:[!v&&"text"===f&&(0,c.jsx)(ub,{autoFocus:i}),!v&&!k&&"visual"===f&&(0,c.jsx)(g.BlockToolbar,{hideDragHandle:!0}),(v||"visual"===f)&&(0,c.jsx)(Eb,{styles:t,contentRef:o,disableIframe:r,autoFocus:i,iframeProps:_}),s]})})]}),footer:!v&&!x&&k&&w&&"visual"===f&&(0,c.jsx)(g.BlockBreadcrumb,{rootLabelText:S}),actions:v?void 0:l||(0,c.jsx)(db,{closeEntitiesSavedStates:T,isEntitiesSavedStatesOpen:j,setEntitiesSavedStatesCallback:E,forceIsDirtyPublishPanel:n})})}const{OverridesPanel:Ib}=$(lo.privateApis);function Nb(){return(0,d.useSelect)((e=>"wp_block"===e(xc).getCurrentPostType()),[])?(0,c.jsx)(Ib,{}):null}function Rb(e){return"string"==typeof e.title?(0,Ln.decodeEntities)(e.title):e.title&&"rendered"in e.title?(0,Ln.decodeEntities)(e.title.rendered):e.title&&"raw"in e.title?(0,Ln.decodeEntities)(e.title.raw):""}const Db=({items:e,closeModal:t})=>{const[s]=e,n=Rb(s),{showOnFront:o,currentHomePage:r,isSaving:i}=(0,d.useSelect)((e=>{const{getEntityRecord:t,isSavingEntityRecord:s}=e(u.store),n=t("root","site"),o=t("postType","page",n?.page_on_front);return{showOnFront:n?.show_on_front,currentHomePage:o,isSaving:s("root","site")}})),{saveEntityRecord:a}=(0,d.useDispatch)(u.store),{createSuccessNotice:l,createErrorNotice:p}=(0,d.useDispatch)(_s.store);let m="";"posts"===o?m=(0,fs.__)("This will replace the current homepage which is set to display latest posts."):r&&(m=(0,fs.sprintf)((0,fs.__)('This will replace the current homepage: "%s"'),Rb(r)));const h=(0,fs.sprintf)((0,fs.__)('Set "%1$s" as the site homepage? %2$s'),n,m).trim(),g=(0,fs.__)("Set homepage");return(0,c.jsx)("form",{onSubmit:async function(e){e.preventDefault();try{await a("root","site",{page_on_front:s.id,show_on_front:"page"}),l((0,fs.__)("Homepage updated."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("An error occurred while setting the homepage.");p(t,{type:"snackbar"})}finally{t?.()}},children:(0,c.jsxs)(Fn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Fn.__experimentalText,{children:h}),(0,c.jsxs)(Fn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},disabled:i,accessibleWhenDisabled:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",disabled:i,accessibleWhenDisabled:!0,children:g})]})]})})},Ab=({items:e,closeModal:t})=>{const[s]=e,n=Rb(s),{currentPostsPage:o,isPageForPostsSet:r,isSaving:i}=(0,d.useSelect)((e=>{const{getEntityRecord:t,isSavingEntityRecord:s}=e(u.store),n=t("root","site");return{currentPostsPage:t("postType","page",n?.page_for_posts),isPageForPostsSet:0!==n?.page_for_posts,isSaving:s("root","site")}})),{saveEntityRecord:a}=(0,d.useDispatch)(u.store),{createSuccessNotice:l,createErrorNotice:p}=(0,d.useDispatch)(_s.store);const m=r&&o?(0,fs.sprintf)((0,fs.__)('This will replace the current posts page: "%s"'),Rb(o)):(0,fs.__)("This page will show the latest posts."),h=(0,fs.sprintf)((0,fs.__)('Set "%1$s" as the posts page? %2$s'),n,m),g=(0,fs.__)("Set posts page");return(0,c.jsx)("form",{onSubmit:async function(e){e.preventDefault();try{await a("root","site",{page_for_posts:s.id,show_on_front:"page"}),l((0,fs.__)("Posts page updated."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("An error occurred while setting the posts page.");p(t,{type:"snackbar"})}finally{t?.()}},children:(0,c.jsxs)(Fn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Fn.__experimentalText,{children:h}),(0,c.jsxs)(Fn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},disabled:i,accessibleWhenDisabled:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",disabled:i,accessibleWhenDisabled:!0,children:g})]})]})})};function Mb({postType:e,onActionPerformed:t,context:s}){const{defaultActions:n}=(0,d.useSelect)((t=>{const{getEntityActions:s}=$(t(xc));return{defaultActions:s("postType",e)}}),[e]),o=(0,d.useSelect)((t=>{if("page"!==e)return!1;const{getDefaultTemplateId:s,getEntityRecord:n,canUser:o}=t(u.store);if(!o("update",{kind:"root",name:"site"}))return!1;const r=s({slug:"front-page"});if(!r)return!0;const i=n("postType","wp_template",r);return!i||"front-page"!==i.slug}),[e]),r=(()=>{const{pageOnFront:e,pageForPosts:t}=(0,d.useSelect)((e=>{const{getEntityRecord:t,canUser:s}=e(u.store),n=s("read",{kind:"root",name:"site"})?t("root","site"):void 0;return{pageOnFront:n?.page_on_front,pageForPosts:n?.page_for_posts}}));return(0,p.useMemo)((()=>({id:"set-as-homepage",label:(0,fs.__)("Set as homepage"),isEligible:s=>"publish"===s.status&&"page"===s.type&&e!==s.id&&t!==s.id,modalFocusOnMount:"firstContentElement",RenderModal:Db})),[t,e])})(),i=(()=>{const{pageOnFront:e,pageForPosts:t}=(0,d.useSelect)((e=>{const{getEntityRecord:t,canUser:s}=e(u.store),n=s("read",{kind:"root",name:"site"})?t("root","site"):void 0;return{pageOnFront:n?.page_on_front,pageForPosts:n?.page_for_posts}}));return(0,p.useMemo)((()=>({id:"set-as-posts-page",label:(0,fs.__)("Set as posts page"),isEligible:s=>"publish"===s.status&&"page"===s.type&&e!==s.id&&t!==s.id,modalFocusOnMount:"firstContentElement",RenderModal:Ab})),[t,e])})(),{registerPostTypeSchema:a}=$((0,d.useDispatch)(xc));return(0,p.useEffect)((()=>{a(e)}),[a,e]),(0,p.useMemo)((()=>{let e=[...n];if(o&&e.push(r,i),e=e.sort(((e,t)=>"move-to-trash"===t.id?-1:0)),e=e.filter((e=>!e.context||e.context===s)),t)for(let s=0;s<e.length;++s){if(e[s].callback){const n=e[s].callback;e[s]={...e[s],callback:(o,r)=>{n(o,{...r,onActionPerformed:n=>{r?.onActionPerformed&&r.onActionPerformed(n),t(e[s].id,n)}})}}}if(e[s].RenderModal){const n=e[s].RenderModal;e[s]={...e[s],RenderModal:o=>(0,c.jsx)(n,{...o,onActionPerformed:n=>{o.onActionPerformed&&o.onActionPerformed(n),t(e[s].id,n)}})}}}return e}),[s,n,t,r,i,o])}const{Menu:Lb,kebabCase:Ob}=$(Fn.privateApis);function Fb({postType:e,postId:t,onActionPerformed:s}){const[n,o]=(0,p.useState)(null),{item:r,permissions:i}=(0,d.useSelect)((s=>{const{getEditedEntityRecord:n,getEntityRecordPermissions:o}=$(s(u.store));return{item:n("postType",e,t),permissions:o("postType",e,t)}}),[t,e]),a=(0,p.useMemo)((()=>({...r,permissions:i})),[r,i]),l=Mb({postType:e,onActionPerformed:s}),m=(0,p.useMemo)((()=>l.filter((e=>!e.isEligible||e.isEligible(a)))),[l,a]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(Lb,{placement:"bottom-end",children:[(0,c.jsx)(Lb.TriggerButton,{render:(0,c.jsx)(Fn.Button,{size:"small",icon:s_,label:(0,fs.__)("Actions"),disabled:!m.length,accessibleWhenDisabled:!0,className:"editor-all-actions-button"})}),(0,c.jsx)(Lb.Popover,{children:(0,c.jsx)(zb,{actions:m,items:[a],setActiveModalAction:o})})]}),!!n&&(0,c.jsx)(Ub,{action:n,items:[a],closeModal:()=>o(null)})]})}function Vb({action:e,onClick:t,items:s}){const n="string"==typeof e.label?e.label:e.label(s);return(0,c.jsx)(Lb.Item,{onClick:t,children:(0,c.jsx)(Lb.ItemLabel,{children:n})})}function Ub({action:e,items:t,closeModal:s}){const n="string"==typeof e.label?e.label:e.label(t);return(0,c.jsx)(Fn.Modal,{title:e.modalHeader||n,__experimentalHideHeader:!!e.hideModalHeader,onRequestClose:s??(()=>{}),focusOnMount:"firstContentElement",size:"medium",overlayClassName:`editor-action-modal editor-action-modal__$Ob(e.id)}`,children:(0,c.jsx)(e.RenderModal,{items:t,closeModal:s})})}function zb({actions:e,items:t,setActiveModalAction:s}){const n=(0,d.useRegistry)();return(0,c.jsx)(Lb.Group,{children:e.map((e=>(0,c.jsx)(Vb,{action:e,onClick:()=>{"RenderModal"in e?s(e):e.callback(t,{registry:n})},items:t},e.id)))})}const{Badge:Hb}=$(Fn.privateApis);function Gb({postType:e,postId:t,onActionPerformed:s}){const n=(0,p.useMemo)((()=>Array.isArray(t)?t:[t]),[t]),{postTitle:o,icon:r,labels:i}=(0,d.useSelect)((t=>{const{getEditedEntityRecord:s,getCurrentTheme:o,getPostType:r}=t(u.store),{getPostIcon:i}=$(t(xc));let a="";const l=s("postType",e,n[0]);if(1===n.length){const{default_template_types:t=[]}=o()??{},s=[B,I].includes(e)?Y({template:l,templateTypes:t}):{};a=s?.title||l?.title}return{postTitle:a,icon:i(e,{area:l?.area}),labels:r(e)?.labels}}),[n,e]),a=Uc(t);let l=(0,fs.__)("No title");return i?.name&&n.length>1?l=(0,fs.sprintf)((0,fs.__)("%1$d %2$s"),n.length,i?.name):o&&(l=(0,Vc.__unstableStripHTML)(o)),(0,c.jsxs)(Fn.__experimentalVStack,{spacing:1,className:"editor-post-card-panel",children:[(0,c.jsxs)(Fn.__experimentalHStack,{spacing:2,className:"editor-post-card-panel__header",align:"flex-start",children:[(0,c.jsx)(Fn.Icon,{className:"editor-post-card-panel__icon",icon:r}),(0,c.jsxs)(Fn.__experimentalText,{numberOfLines:2,truncate:!0,className:"editor-post-card-panel__title",as:"h2",children:[(0,c.jsx)("span",{className:"editor-post-card-panel__title-name",children:l}),a&&1===n.length&&(0,c.jsx)(Hb,{children:a})]}),1===n.length&&(0,c.jsx)(Fb,{postType:e,postId:n[0],onActionPerformed:s})]}),n.length>1&&(0,c.jsx)(Fn.__experimentalText,{className:"editor-post-card-panel__description",children:(0,fs.sprintf)((0,fs.__)("Changes will be applied to all selected %s."),i?.name.toLowerCase())})]})}function $b(){const{postContent:e}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s,getCurrentPostId:n}=e(xc),{canUser:o}=e(u.store),{getEntityRecord:r}=e(u.store),i=o("read",{kind:"root",name:"site"})?r("root","site"):void 0,a=s();return{postContent:!(+n()===i?.page_for_posts)&&![B,I].includes(a)&&t("content")}}),[]),t=(0,fs._x)("words","Word count type. Do not translate!"),s=(0,p.useMemo)((()=>e?(0,Rh.count)(e,t):0),[e,t]);if(!s)return null;const n=Math.round(s/189),o=(0,fs.sprintf)((0,fs._n)("%s word","%s words",s),s.toLocaleString()),r=n<=1?(0,fs.__)("1 minute"):(0,fs.sprintf)((0,fs._n)("%s minute","%s minutes",n),n.toLocaleString());return(0,c.jsx)("div",{className:"editor-post-content-information",children:(0,c.jsx)(Fn.__experimentalText,{children:(0,fs.sprintf)((0,fs.__)("%1$s, %2$s read time."),o,r)})})}var Wb=function(){const{postFormat:e}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(xc);return{postFormat:t("format")??"standard"}}),[]),t=Cp.find((t=>t.id===e)),[s,n]=(0,p.useState)(null),o=(0,p.useMemo)((()=>({anchor:s,placement:"left-start",offset:36,shift:!0})),[s]);return(0,c.jsx)(kp,{children:(0,c.jsx)(Nd,{label:(0,fs.__)("Format"),ref:n,children:(0,c.jsx)(Fn.Dropdown,{popoverProps:o,contentClassName:"editor-post-format__dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:s})=>(0,c.jsx)(Fn.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change format: %s"),t?.caption),onClick:s,children:t?.caption}),renderContent:({onClose:e})=>(0,c.jsxs)("div",{className:"editor-post-format__dialog-content",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Format"),onClose:e}),(0,c.jsx)(Pp,{})]})})})})};function Zb(){const e=(0,d.useSelect)((e=>e(xc).getEditedPostAttribute("modified")),[]),t=e&&(0,fs.sprintf)((0,fs.__)("Last edited %s."),(0,v.humanTimeDiff)(e));return t?(0,c.jsx)("div",{className:"editor-post-last-edited-panel",children:(0,c.jsx)(Fn.__experimentalText,{children:t})}):null}var Yb=function({className:e,children:t}){return(0,c.jsx)(Fn.__experimentalVStack,{className:hr("editor-post-panel__section",e),children:t})};const qb={};function Kb(){const{editEntityRecord:e}=(0,d.useDispatch)(u.store),{postsPageTitle:t,postsPageId:s,isTemplate:n,postSlug:o}=(0,d.useSelect)((e=>{const{getEntityRecord:t,getEditedEntityRecord:s,canUser:n}=e(u.store),o=n("read",{kind:"root",name:"site"})?t("root","site"):void 0,r=o?.page_for_posts?s("postType","page",o?.page_for_posts):qb,{getEditedPostAttribute:i,getCurrentPostType:a}=e(xc);return{postsPageId:r?.id,postsPageTitle:r?.title,isTemplate:a()===B,postSlug:i("slug")}}),[]),[r,i]=(0,p.useState)(null),a=(0,p.useMemo)((()=>({anchor:r,placement:"left-start",offset:36,shift:!0})),[r]);if(!n||!["home","index"].includes(o)||!s)return null;const l=t=>{e("postType","page",s,{title:t})},h=(0,Ln.decodeEntities)(t);return(0,c.jsx)(Nd,{label:(0,fs.__)("Blog title"),ref:i,children:(0,c.jsx)(Fn.Dropdown,{popoverProps:a,contentClassName:"editor-blog-title-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(Fn.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change blog title: %s"),h),onClick:t,children:h}),renderContent:({onClose:e})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Blog title"),onClose:e}),(0,c.jsx)(Fn.__experimentalInputControl,{placeholder:(0,fs.__)("No title"),size:"__unstable-large",value:t,onChange:(0,m.debounce)(l,300),label:(0,fs.__)("Blog title"),help:(0,fs.__)("Set the Posts Page title. Appears in search results, and when the page is shared on social media."),hideLabelFromVision:!0})]})})})}function Qb(){const{editEntityRecord:e}=(0,d.useDispatch)(u.store),{postsPerPage:t,isTemplate:s,postSlug:n}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s}=e(xc),{getEditedEntityRecord:n,canUser:o}=e(u.store),r=o("read",{kind:"root",name:"site"})?n("root","site"):void 0;return{isTemplate:s()===B,postSlug:t("slug"),postsPerPage:r?.posts_per_page||1}}),[]),[o,r]=(0,p.useState)(null),i=(0,p.useMemo)((()=>({anchor:o,placement:"left-start",offset:36,shift:!0})),[o]);if(!s||!["home","index"].includes(n))return null;const a=t=>{e("root","site",void 0,{posts_per_page:t})};return(0,c.jsx)(Nd,{label:(0,fs.__)("Posts per page"),ref:r,children:(0,c.jsx)(Fn.Dropdown,{popoverProps:i,contentClassName:"editor-posts-per-page-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:s})=>(0,c.jsx)(Fn.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.__)("Change posts per page"),onClick:s,children:t}),renderContent:({onClose:e})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Posts per page"),onClose:e}),(0,c.jsx)(Fn.__experimentalNumberControl,{placeholder:0,value:t,size:"__unstable-large",spinControls:"custom",step:"1",min:"1",onChange:a,label:(0,fs.__)("Posts per page"),help:(0,fs.__)("Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting."),hideLabelFromVision:!0})]})})})}const Xb=[{label:(0,fs._x)("Open",'Adjective: e.g. "Comments are open"'),value:"open",description:(0,fs.__)("Visitors can add new comments and replies.")},{label:(0,fs.__)("Closed"),value:"",description:[(0,fs.__)("Visitors cannot add new comments or replies."),(0,fs.__)("Existing comments remain visible.")].join(" ")}];function Jb(){const{editEntityRecord:e}=(0,d.useDispatch)(u.store),{allowCommentsOnNewPosts:t,isTemplate:s,postSlug:n}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s}=e(xc),{getEditedEntityRecord:n,canUser:o}=e(u.store),r=o("read",{kind:"root",name:"site"})?n("root","site"):void 0;return{isTemplate:s()===B,postSlug:t("slug"),allowCommentsOnNewPosts:r?.default_comment_status||""}}),[]),[o,r]=(0,p.useState)(null),i=(0,p.useMemo)((()=>({anchor:o,placement:"left-start",offset:36,shift:!0})),[o]);if(!s||!["home","index"].includes(n))return null;const a=t=>{e("root","site",void 0,{default_comment_status:t?"open":null})};return(0,c.jsx)(Nd,{label:(0,fs.__)("Discussion"),ref:r,children:(0,c.jsx)(Fn.Dropdown,{popoverProps:i,contentClassName:"editor-site-discussion-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:s})=>(0,c.jsx)(Fn.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.__)("Change discussion settings"),onClick:s,children:t?(0,fs.__)("Comments open"):(0,fs.__)("Comments closed")}),renderContent:({onClose:e})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Discussion"),onClose:e}),(0,c.jsxs)(Fn.__experimentalVStack,{spacing:3,children:[(0,c.jsx)(Fn.__experimentalText,{children:(0,fs.__)("Changes will apply to new posts only. Individual posts may override these settings.")}),(0,c.jsx)(Fn.RadioControl,{className:"editor-site-discussion__options",hideLabelFromVision:!0,label:(0,fs.__)("Comment status"),options:Xb,onChange:a,selected:t})]})]})})})}function ey({onActionPerformed:e}){const{isRemovedPostStatusPanel:t,postType:s,postId:n}=(0,d.useSelect)((e=>{const{isEditorPanelRemoved:t,getCurrentPostType:s,getCurrentPostId:n}=e(xc);return{isRemovedPostStatusPanel:t("post-status"),postType:s(),postId:n()}}),[]);return(0,c.jsx)(Yb,{className:"editor-post-summary",children:(0,c.jsx)(ku.Slot,{children:o=>(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)(Fn.__experimentalVStack,{spacing:4,children:[(0,c.jsx)(Gb,{postType:s,postId:n,onActionPerformed:e}),(0,c.jsx)(Sp,{withPanelBody:!1}),(0,c.jsx)(up,{}),(0,c.jsxs)(Fn.__experimentalVStack,{spacing:1,children:[(0,c.jsx)($b,{}),(0,c.jsx)(Zb,{})]}),!t&&(0,c.jsxs)(Fn.__experimentalVStack,{spacing:4,children:[(0,c.jsxs)(Fn.__experimentalVStack,{spacing:1,children:[(0,c.jsx)(th,{}),(0,c.jsx)(rh,{}),(0,c.jsx)(Eh,{}),(0,c.jsx)(Yu,{}),(0,c.jsx)(Fu,{}),(0,c.jsx)(tp,{}),(0,c.jsx)(Tp,{}),(0,c.jsx)($d,{}),(0,c.jsx)(ah,{}),(0,c.jsx)(Kb,{}),(0,c.jsx)(Qb,{}),(0,c.jsx)(Jb,{}),(0,c.jsx)(Wb,{}),o]}),(0,c.jsx)(Sh,{onActionPerformed:e})]})]})})})})}const{EXCLUDED_PATTERN_SOURCES:ty,PATTERN_TYPES:sy}=$(lo.privateApis);function ny(e,t){return e.innerBlocks=e.innerBlocks.map((e=>ny(e,t))),"core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=t),e}function oy(e,t){return e.filter(((e,s,n)=>((e,t,s)=>t===s.findIndex((t=>e.name===t.name)))(e,s,n)&&(e=>!ty.includes(e.source))(e)&&(e=>e.templateTypes?.includes(t.slug)||e.blockTypes?.includes("core/template-part/"+t.area))(e)))}function ry(e,t){return e.map((e=>({...e,keywords:e.keywords||[],type:sy.theme,blocks:(0,x.parse)(e.content,{__unstableSkipMigrationLogs:!0}).map((e=>ny(e,t)))})))}function iy({availableTemplates:e,onSelect:t}){return e&&0!==e?.length?(0,c.jsx)(g.__experimentalBlockPatternsList,{label:(0,fs.__)("Templates"),blockPatterns:e,onClickPattern:t,showTitlesAsTooltip:!0}):null}function ay(){const{area:e,name:t,slug:s,postType:n,postId:o}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(xc),{getEditedEntityRecord:n}=e(u.store),o=t(),r=s(),i=n("postType",o,r);return{area:i?.area,name:i?.name,slug:i?.slug,postType:o,postId:r}}),[]),{editEntityRecord:r}=(0,d.useDispatch)(u.store),i=function({area:e,name:t,slug:s}){const{blockPatterns:n,restBlockPatterns:o,currentThemeStylesheet:r}=(0,d.useSelect)((e=>{const{getEditorSettings:t}=e(xc),s=t();return{blockPatterns:s.__experimentalAdditionalBlockPatterns??s.__experimentalBlockPatterns,restBlockPatterns:e(u.store).getBlockPatterns(),currentThemeStylesheet:e(u.store).getCurrentTheme().stylesheet}}),[]);return(0,p.useMemo)((()=>ry(oy([...n||[],...o||[]],{area:e,name:t,slug:s}),r)),[e,t,s,n,o,r])}({area:e,name:t,slug:s});return i?.length?(0,c.jsx)(Fn.PanelBody,{title:(0,fs.__)("Design"),initialOpen:n===I,children:(0,c.jsx)(iy,{availableTemplates:i,onSelect:async e=>{await r("postType",n,o,{blocks:e.blocks,content:(0,x.serialize)(e.blocks)})}})}):null}function ly(){const{postType:e}=(0,d.useSelect)((e=>{const{getCurrentPostType:t}=e(xc);return{postType:t()}}),[]);return[I,B].includes(e)?(0,c.jsx)(ay,{}):null}const cy={document:"edit-post/document",block:"edit-post/block"},{Tabs:dy}=$(Fn.privateApis);var uy=(0,p.forwardRef)(((e,t)=>{const{documentLabel:s}=(0,d.useSelect)((e=>{const{getPostTypeLabel:t}=e(xc);return{documentLabel:t()||(0,fs._x)("Document","noun, panel")}}),[]);return(0,c.jsxs)(dy.TabList,{ref:t,children:[(0,c.jsx)(dy.Tab,{tabId:cy.document,"data-tab-id":cy.document,children:s}),(0,c.jsx)(dy.Tab,{tabId:cy.block,"data-tab-id":cy.block,children:(0,fs.__)("Block")})]})}));const{BlockQuickNavigation:py}=$(g.privateApis),my=["core/post-title","core/post-featured-image","core/post-content"];function hy(){const e=(0,p.useMemo)((()=>(0,h.applyFilters)("editor.postContentBlockTypes",my)),[]),{clientIds:t,postType:s,renderingMode:n}=(0,d.useSelect)((t=>{const{getCurrentPostType:s,getPostBlocksByName:n,getRenderingMode:o}=$(t(xc)),r=s();return{postType:r,clientIds:n(B===r?"core/template-part":e),renderingMode:o()}}),[e]),{enableComplementaryArea:o}=(0,d.useDispatch)(Ea);return"post-only"===n&&s!==B||0===t.length?null:(0,c.jsx)(Fn.PanelBody,{title:(0,fs.__)("Content"),children:(0,c.jsx)(py,{clientIds:t,onSelect:()=>{o("core","edit-post/document")}})})}const{BlockQuickNavigation:gy}=$(g.privateApis);function _y(){const e=(0,d.useSelect)((e=>{const{getBlockTypes:t}=e(x.store);return t()}),[]),t=(0,p.useMemo)((()=>e.filter((e=>"theme"===e.category)).map((({name:e})=>e))),[e]),s=(0,d.useSelect)((e=>{const{getBlocksByName:s}=e(g.store);return s(t)}),[t]);return 0===s.length?null:(0,c.jsx)(Fn.PanelBody,{title:(0,fs.__)("Content"),children:(0,c.jsx)(gy,{clientIds:s})})}function fy(){const e=(0,d.useSelect)((e=>{const{getCurrentPostType:t}=e(xc);return t()}),[]);return e!==I?null:(0,c.jsx)(_y,{})}var by=function(){const{hasBlockSelection:e}=(0,d.useSelect)((e=>({hasBlockSelection:!!e(g.store).getBlockSelectionStart()})),[]),{getActiveComplementaryArea:t}=(0,d.useSelect)(Ea),{enableComplementaryArea:s}=(0,d.useDispatch)(Ea),{get:n}=(0,d.useSelect)(C.store);(0,p.useEffect)((()=>{const o=t("core"),r=["edit-post/document","edit-post/block"].includes(o),i=n("core","distractionFree");r&&!i&&s("core",e?"edit-post/block":"edit-post/document")}),[e,t,s,n])};const{Tabs:yy}=$(Fn.privateApis),xy=p.Platform.select({web:!0,native:!1}),vy=({tabName:e,keyboardShortcut:t,onActionPerformed:s,extraPanels:n})=>{const o=(0,p.useRef)(null),r=(0,p.useContext)(yy.Context);return(0,p.useEffect)((()=>{const t=Array.from(o.current?.querySelectorAll('[role="tab"]')||[]),s=t.find((t=>t.getAttribute("data-tab-id")===e)),n=s?.ownerDocument.activeElement;t.some((e=>n&&n.id===e.id))&&s&&s.id!==n?.id&&s?.focus()}),[e]),(0,c.jsx)(Bu,{identifier:e,header:(0,c.jsx)(yy.Context.Provider,{value:r,children:(0,c.jsx)(uy,{ref:o})}),closeLabel:(0,fs.__)("Close Settings"),className:"editor-sidebar__panel",headerClassName:"editor-sidebar__panel-tabs",title:(0,fs._x)("Settings","panel button label"),toggleShortcut:t,icon:(0,fs.isRTL)()?qi:Ki,isActiveByDefault:xy,children:(0,c.jsxs)(yy.Context.Provider,{value:r,children:[(0,c.jsxs)(yy.TabPanel,{tabId:cy.document,focusable:!1,children:[(0,c.jsx)(ey,{onActionPerformed:s}),(0,c.jsx)(hu.Slot,{}),(0,c.jsx)(hy,{}),(0,c.jsx)(fy,{}),(0,c.jsx)(ly,{}),(0,c.jsx)(ph,{}),(0,c.jsx)(Nb,{}),n]}),(0,c.jsx)(yy.TabPanel,{tabId:cy.block,focusable:!1,children:(0,c.jsx)(g.BlockInspector,{})})]})})};var wy=({extraPanels:e,onActionPerformed:t})=>{by();const{tabName:s,keyboardShortcut:n,showSummary:o}=(0,d.useSelect)((e=>{const t=e(al.store).getShortcutRepresentation("core/editor/toggle-sidebar"),s=e(Ea).getActiveComplementaryArea("core");let n=s;return[cy.block,cy.document].includes(s)||(n=e(g.store).getBlockSelectionStart()?cy.block:cy.document),{tabName:n,keyboardShortcut:t,showSummary:![B,I,R].includes(e(xc).getCurrentPostType())}}),[]),{enableComplementaryArea:r}=(0,d.useDispatch)(Ea),i=(0,p.useCallback)((e=>{e&&r("core",e)}),[r]);return(0,c.jsx)(yy,{selectedTabId:s,onSelect:i,selectOnMove:!1,children:(0,c.jsx)(vy,{tabName:s,keyboardShortcut:n,showSummary:o,onActionPerformed:t,extraPanels:e})})};var Sy=function({postType:e,postId:t,templateId:s,settings:n,children:o,initialEdits:r,onActionPerformed:i,extraContent:a,extraSidebarPanels:l,...p}){const{post:m,template:h,hasLoadedPost:g,error:_}=(0,d.useSelect)((n=>{const{getEntityRecord:o,getResolutionError:r,hasFinishedResolution:i}=n(u.store),a=["postType",e,t];return{post:o(...a),template:s?o("postType",B,s):void 0,hasLoadedPost:i("getEntityRecord",a),error:r("getEntityRecord",a)?.message}}),[e,t,s]);return(0,c.jsxs)(c.Fragment,{children:[g&&!m&&(0,c.jsx)(Fn.Notice,{status:_?"error":"warning",isDismissible:!1,children:_||(0,fs.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")}),!!m&&(0,c.jsxs)(Dl,{post:m,__unstableTemplate:h,settings:n,initialEdits:r,useSubRegistry:!1,children:[(0,c.jsx)(Bb,{...p,children:a}),o,(0,c.jsx)(wy,{onActionPerformed:i,extraPanels:l})]})]})};const{PreferenceBaseOption:ky}=$(C.privateApis);function Cy(e){const t=(0,d.useSelect)((e=>e(xc).isPublishSidebarEnabled()),[]),{enablePublishSidebar:s,disablePublishSidebar:n}=(0,d.useDispatch)(xc);return(0,c.jsx)(ky,{isChecked:t,onChange:e=>e?s():n(),...e})}const{BlockManager:Py}=$(g.privateApis),jy=[];function Ey(){const{showBlockTypes:e,hideBlockTypes:t}=$((0,d.useDispatch)(xc)),{blockTypes:s,allowedBlockTypes:n,hiddenBlockTypes:o}=(0,d.useSelect)((e=>({blockTypes:e(x.store).getBlockTypes(),allowedBlockTypes:e(xc).getEditorSettings().allowedBlockTypes,hiddenBlockTypes:e(C.store).get("core","hiddenBlockTypes")??jy})),[]),r=(0,p.useMemo)((()=>!0===n?s:s.filter((({name:e})=>n?.includes(e)))),[n,s]).filter((e=>(0,x.hasBlockSupport)(e,"inserter",!0)&&(!e.parent||e.parent.includes("core/post-content")))),i=o.filter((e=>r.some((t=>t.name===e)))),a=r.filter((e=>!i.includes(e.name))),l=r.length-a.length;const u=s=>{if(a.length>s.length){const e=a.filter((e=>!s.find((({name:t})=>t===e.name))));t(e.map((({name:e})=>e)))}else if(a.length<s.length){const t=s.filter((e=>!a.find((({name:t})=>t===e.name))));e(t.map((({name:e})=>e)))}};return(0,c.jsxs)("div",{className:"editor-block-visibility",children:[!!l&&(0,c.jsxs)("div",{className:"editor-block-visibility__disabled-blocks-count",children:[(0,fs.sprintf)((0,fs._n)("%d block is hidden.","%d blocks are hidden.",l),l),(0,c.jsx)(Fn.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:function(){u(r)},children:(0,fs.__)("Reset")})]}),(0,c.jsx)(Py,{blockTypes:r,selectedBlockTypes:a,onChange:u,showSelectAll:!1})]})}const{PreferencesModal:Ty,PreferencesModalTabs:By,PreferencesModalSection:Iy,PreferenceToggleControl:Ny}=$(C.privateApis);function Ry({extraSections:e={}}){const t=(0,m.useViewportMatch)("medium"),s=(0,d.useSelect)((e=>{const{getEditorSettings:s}=e(xc),{get:n}=e(C.store),o=s().richEditingEnabled;return!n("core","distractionFree")&&t&&o}),[t]),{setIsListViewOpened:n,setIsInserterOpened:o}=(0,d.useDispatch)(xc),{set:r}=(0,d.useDispatch)(C.store),i=(0,p.useMemo)((()=>[{name:"general",tabLabel:(0,fs.__)("General"),content:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(Iy,{title:(0,fs.__)("Interface"),children:[(0,c.jsx)(Ny,{scope:"core",featureName:"showListViewByDefault",help:(0,fs.__)("Opens the List View panel by default."),label:(0,fs.__)("Always open List View")}),s&&(0,c.jsx)(Ny,{scope:"core",featureName:"showBlockBreadcrumbs",help:(0,fs.__)("Display the block hierarchy trail at the bottom of the editor."),label:(0,fs.__)("Show block breadcrumbs")}),(0,c.jsx)(Ny,{scope:"core",featureName:"allowRightClickOverrides",help:(0,fs.__)("Allows contextual List View menus via right-click, overriding browser defaults."),label:(0,fs.__)("Allow right-click contextual menus")}),(0,c.jsx)(Ny,{scope:"core",featureName:"enableChoosePatternModal",help:(0,fs.__)("Shows starter patterns when creating a new page."),label:(0,fs.__)("Show starter patterns")})]}),(0,c.jsxs)(Iy,{title:(0,fs.__)("Document settings"),description:(0,fs.__)("Select what settings are shown in the document panel."),children:[(0,c.jsx)(du.Slot,{}),(0,c.jsx)(ch,{taxonomyWrapper:(e,t)=>(0,c.jsx)(iu,{label:t.labels.menu_name,panelName:`taxonomy-panel-$t.slug}`})}),(0,c.jsx)(hp,{children:(0,c.jsx)(iu,{label:(0,fs.__)("Featured image"),panelName:"featured-image"})}),(0,c.jsx)(np,{children:(0,c.jsx)(iu,{label:(0,fs.__)("Excerpt"),panelName:"post-excerpt"})}),(0,c.jsx)(Td,{supportKeys:["comments","trackbacks"],children:(0,c.jsx)(iu,{label:(0,fs.__)("Discussion"),panelName:"discussion-panel"})}),(0,c.jsx)(Ed,{children:(0,c.jsx)(iu,{label:(0,fs.__)("Page attributes"),panelName:"page-attributes"})})]}),t&&(0,c.jsx)(Iy,{title:(0,fs.__)("Publishing"),children:(0,c.jsx)(Cy,{help:(0,fs.__)("Review settings, such as visibility and tags."),label:(0,fs.__)("Enable pre-publish checks")})}),e?.general]})},{name:"appearance",tabLabel:(0,fs.__)("Appearance"),content:(0,c.jsxs)(Iy,{title:(0,fs.__)("Appearance"),description:(0,fs.__)("Customize the editor interface to suit your needs."),children:[(0,c.jsx)(Ny,{scope:"core",featureName:"fixedToolbar",onToggle:()=>r("core","distractionFree",!1),help:(0,fs.__)("Access all block and document tools in a single place."),label:(0,fs.__)("Top toolbar")}),(0,c.jsx)(Ny,{scope:"core",featureName:"distractionFree",onToggle:()=>{r("core","fixedToolbar",!0),o(!1),n(!1)},help:(0,fs.__)("Reduce visual distractions by hiding the toolbar and other elements to focus on writing."),label:(0,fs.__)("Distraction free")}),(0,c.jsx)(Ny,{scope:"core",featureName:"focusMode",help:(0,fs.__)("Highlights the current block and fades other content."),label:(0,fs.__)("Spotlight mode")}),e?.appearance]})},{name:"accessibility",tabLabel:(0,fs.__)("Accessibility"),content:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Iy,{title:(0,fs.__)("Navigation"),description:(0,fs.__)("Optimize the editing experience for enhanced control."),children:(0,c.jsx)(Ny,{scope:"core",featureName:"keepCaretInsideBlock",help:(0,fs.__)("Keeps the text cursor within blocks while navigating with arrow keys, preventing it from moving to other blocks and enhancing accessibility for keyboard users."),label:(0,fs.__)("Contain text cursor inside block")})}),(0,c.jsx)(Iy,{title:(0,fs.__)("Interface"),children:(0,c.jsx)(Ny,{scope:"core",featureName:"showIconLabels",label:(0,fs.__)("Show button text labels"),help:(0,fs.__)("Show text instead of icons on buttons across the interface.")})})]})},{name:"blocks",tabLabel:(0,fs.__)("Blocks"),content:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Iy,{title:(0,fs.__)("Inserter"),children:(0,c.jsx)(Ny,{scope:"core",featureName:"mostUsedBlocks",help:(0,fs.__)("Adds a category with the most frequently used blocks in the inserter."),label:(0,fs.__)("Show most used blocks")})}),(0,c.jsx)(Iy,{title:(0,fs.__)("Manage block visibility"),description:(0,fs.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later."),children:(0,c.jsx)(Ey,{})})]})},window.__experimentalMediaProcessing&&{name:"media",tabLabel:(0,fs.__)("Media"),content:(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)(Iy,{title:(0,fs.__)("General"),description:(0,fs.__)("Customize options related to the media upload flow."),children:[(0,c.jsx)(Ny,{scope:"core/media",featureName:"optimizeOnUpload",help:(0,fs.__)("Compress media items before uploading to the server."),label:(0,fs.__)("Pre-upload compression")}),(0,c.jsx)(Ny,{scope:"core/media",featureName:"requireApproval",help:(0,fs.__)("Require approval step when optimizing existing media."),label:(0,fs.__)("Approval step")})]})})}].filter(Boolean)),[s,e,o,n,r,t]);return(0,c.jsx)(By,{sections:i})}var Dy=function({postType:e}){const{registerPostTypeSchema:t}=$((0,d.useDispatch)(xc));(0,p.useEffect)((()=>{t(e)}),[t,e]);const{fields:s}=(0,d.useSelect)((t=>{const{getEntityFields:s}=$(t(xc));return{fields:s("postType",e)}}),[e]);return s};const Ay="content";var My={name:"core/pattern-overrides",getValues({select:e,clientId:t,context:s,bindings:n}){const o=s["pattern/overrides"],{getBlockAttributes:r}=e(g.store),i=r(t),a={};for(const e of Object.keys(n)){const t=o?.[i?.metadata?.name]?.[e];void 0!==t?a[e]=""===t?void 0:t:a[e]=i[e]}return a},setValues({select:e,dispatch:t,clientId:s,bindings:n}){const{getBlockAttributes:o,getBlockParentsByBlockName:r,getBlocks:i}=e(g.store),a=o(s),l=a?.metadata?.name;if(!l)return;const[c]=r(s,"core/block",!0),d=Object.entries(n).reduce(((e,[t,{newValue:s}])=>(e[t]=s,e)),{});if(!c){const e=s=>{for(const n of s)n.attributes?.metadata?.name===l&&t(g.store).updateBlockAttributes(n.clientId,d),e(n.innerBlocks)};return void e(i())}const u=o(c)?.[Ay];t(g.store).updateBlockAttributes(c,{[Ay]:{...u,[l]:{...u?.[l],...Object.entries(d).reduce(((e,[t,s])=>(e[t]=void 0===s?"":s,e)),{})}}})},canUserEditValue:()=>!0};const Ly=["core/navigation-link","core/navigation-submenu"];function Oy(e,t,s){const{getEditedEntityRecord:n}=e(u.store),{getBlockAttributes:o,getBlockName:r}=e(g.store);let i,a;const l=r?.(s);let c,d;if(Ly.includes(l)){const e=o?.(s);c=e?.id,d=e?.type}else c=t?.postId,d=t?.postType;return d&&c&&(i=n("postType",d,c),a={date:{label:(0,fs.__)("Post Date"),value:i?.date,type:"string"},modified:{label:(0,fs.__)("Post Modified Date"),value:i?.modified,type:"string"},link:{label:(0,fs.__)("Post Link"),value:i?.link,type:"string"}}),Object.keys(a||{}).length?a:null}var Fy={name:"core/post-data",getValues({select:e,context:t,bindings:s,clientId:n}){const o=Oy(e,t,n),r={};for(const[e,t]of Object.entries(s)){const s=t.args.field,{value:n,label:i}=o?.[s]||{};r[e]=n??i??s}return r},setValues({dispatch:e,context:t,bindings:s,clientId:n,select:o}){const{getBlockName:r}=o(g.store),i=r?.(n);if(Ly.includes(i))return!1;const a={};Object.values(s).forEach((({args:e,newValue:t})=>{a[e.field]=t})),e(u.store).editEntityRecord("postType",t?.postType,t?.postId,a)},canUserEditValue({select:e,context:t,args:s}){const{getBlockName:n,getSelectedBlockClientId:o}=e(g.store),r=o(),i=n?.(r);if(Ly.includes(i))return!1;if(t?.query||t?.queryId)return!1;if(!t?.postType)return!1;const a=Oy(e,t,void 0)?.[s.field]?.value;if(void 0===a)return!1;return!!e(u.store).canUser("update",{kind:"postType",name:t?.postType,id:t?.postId})},getFieldsList({select:e,context:t}){const s=e(g.store).getSelectedBlockClientId();return Oy(e,t,s)},editorUI({select:e,context:t}){const s=e(g.store).getSelectedBlock();if("core/post-date"!==s?.name)return{};if(Ly.includes(s?.name))return{};return{mode:"dropdown",data:Object.entries(Oy(e,t)||{}).map((([e,t])=>({label:t.label,args:{field:e},type:t.type})))}}};function Vy(e,t){const{getEditedEntityRecord:s}=e(u.store),{getRegisteredPostMeta:n}=$(e(u.store));let o;t?.postType&&t?.postId&&(o=s("postType",t?.postType,t?.postId).meta);const r=n(t?.postType),i={};return Object.entries(r||{}).forEach((([e,t])=>{"footnotes"!==e&&"_"!==e.charAt(0)&&(i[e]={label:t.title||e,value:o?.[e]??(t.default||void 0),type:t.type})})),Object.keys(i||{}).length?i:null}var Uy={name:"core/post-meta",getValues({select:e,context:t,bindings:s}){const n=Vy(e,t),o={};for(const[e,t]of Object.entries(s)){const s=t.args.key,{value:r,label:i}=n?.[s]||{};o[e]=r??i??s}return o},setValues({dispatch:e,context:t,bindings:s}){const n={};Object.values(s).forEach((({args:e,newValue:t})=>{n[e.key]=t})),e(u.store).editEntityRecord("postType",t?.postType,t?.postId,{meta:n})},canUserEditValue({select:e,context:t,args:s}){if(t?.query||t?.queryId)return!1;if(!t?.postType)return!1;const n=Vy(e,t)?.[s.key]?.value;if(void 0===n)return!1;if(e(xc).getEditorSettings().enableCustomFields)return!1;return!!e(u.store).canUser("update",{kind:"postType",name:t?.postType,id:t?.postId})},getFieldsList:({select:e,context:t})=>Vy(e,t),editorUI:({select:e,context:t})=>({mode:"dropdown",data:Object.entries(Vy(e,t)||{}).map((([e,t])=>({label:t.label,args:{key:e},type:t.type})))})};const zy=["core/navigation-link","core/navigation-submenu"];function Hy(e,t){return{id:{label:(0,fs.__)("Term ID"),value:t,type:"string"},name:{label:(0,fs.__)("Name"),value:e?.name,type:"string"},slug:{label:(0,fs.__)("Slug"),value:e?.slug,type:"string"},link:{label:(0,fs.__)("Link"),value:e?.link,type:"string"},description:{label:(0,fs.__)("Description"),value:e?.description,type:"string"},parent:{label:(0,fs.__)("Parent ID"),value:e?.parent,type:"string"},count:{label:(0,fs.__)("Count"),value:`($e?.count??0})`,type:"string"}}}function Gy(e,t,s){const{getEntityRecord:n}=e(u.store),{getBlockAttributes:o,getBlockName:r}=e(g.store);let i,a;const l=r?.(s);let c,d;if(zy.includes(l)){const e=o?.(s);c=e?.id;const t=e?.type;d="tag"===t?"post_tag":t}else c=t?.termId,d=t?.taxonomy;return d&&c?(i=n("taxonomy",d,c),!i&&t?.termData&&(i=t.termData),i&&(a=Hy(i,c))):t?.termData&&(i=t.termData,a=Hy(i,i?.term_id)),a&&Object.keys(a).length?a:null}var $y={name:"core/term-data",usesContext:["taxonomy","termId","termData"],getValues({select:e,context:t,bindings:s,clientId:n}){const o=Gy(e,t,n),r={};for(const[e,t]of Object.entries(s)){const s=t.args.field,{value:n,label:i}=o?.[s]||{};r[e]=n??i??s}return r},setValues:({dispatch:e,context:t,bindings:s})=>!1,canUserEditValue({select:e,context:t,args:s}){const{getBlockName:n,getSelectedBlockClientId:o}=e(g.store),r=o(),i=n?.(r);if(zy.includes(i))return!1;if(t?.termQuery)return!1;if(!t?.taxonomy||!t?.termId)return!1;Gy(e,t,void 0)?.[s.field];return!1},getFieldsList:({select:e,context:t})=>Gy(e,t),editorUI({select:e,context:t}){const s=e(g.store).getSelectedBlock();if(zy.includes(s?.name))return{};return{mode:"dropdown",data:Object.entries(Gy(e,t)||{}).map((([e,t])=>({label:t.label,type:t.type,args:{field:e}})))}}};const{store:Wy,...Zy}=i,Yy={};function qy(e,t,s){const{registerEntityAction:n}=$((0,d.dispatch)(xc))}function Ky(e,t,s){const{unregisterEntityAction:n}=$((0,d.dispatch)(xc))}function Qy(e,t,s){const{registerEntityField:n}=$((0,d.dispatch)(xc))}function Xy(e,t,s){const{unregisterEntityField:n}=$((0,d.dispatch)(xc))}G(Yy,{CreateTemplatePartModal:no,patternTitleField:oi,templateTitleField:ei,BackButton:Qg,EntitiesSavedStatesExtensible:yd,Editor:Sy,EditorContentSlotFill:Wg,GlobalStylesProvider:function({children:e}){const t=Bi();return t.isReady?(0,c.jsx)(ji.Provider,{value:t,children:e}):null},mergeBaseAndUserConfigs:Ti,PluginPostExcerpt:ap,PostCardPanel:Gb,PreferencesModal:function({extraSections:e={}}){const t=(0,d.useSelect)((e=>e(Ea).isModalActive("editor/preferences")),[]),{closeModal:s}=(0,d.useDispatch)(Ea);return t?(0,c.jsx)(Ty,{closeModal:s,children:(0,c.jsx)(Ry,{extraSections:e})}):null},usePostActions:Mb,usePostFields:Dy,ToolsMoreMenuGroup:Ff,ViewMoreMenuGroup:zf,ResizableEditor:gb,registerCoreBlockBindingsSources:function(){(0,x.registerBlockBindingsSource)(My),(0,x.registerBlockBindingsSource)(Fy),(0,x.registerBlockBindingsSource)(Uy),(0,x.registerBlockBindingsSource)($y)},getTemplateInfo:Y,interfaceStore:Wy,...Zy})})(),(window.wp=window.wp||{}).editor=n})();
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated : Wed Oct 22 08:20:04 2025 | Cross-referenced by PHPXref |