diff options
Diffstat (limited to 'wp-includes/js/dist/editor.min.js')
-rw-r--r-- | wp-includes/js/dist/editor.min.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/wp-includes/js/dist/editor.min.js b/wp-includes/js/dist/editor.min.js index cfa0a67..5779b65 100644 --- a/wp-includes/js/dist/editor.min.js +++ b/wp-includes/js/dist/editor.min.js @@ -1,12 +1,14 @@ /*! This file is auto-generated */ -(()=>{var e={4306:function(e,t){var n,o,s; +(()=>{var e={4306:function(e,t){var s,o,n; /*! autosize 4.0.4 license: MIT http://www.jacklmoore.com/autosize -*/o=[e,t],n=function(e,t){"use strict";var n,o,s="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),o.splice(t,1))}}),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&&!s.has(e)){var t=null,n=null,o=null,i=function(){e.clientWidth!==n&&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(n){e.style[n]=t[n]})),s.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",s.set(e,{destroy:a,update:p}),l()}function l(){var n=window.getComputedStyle(e,null);"vertical"===n.resize?e.style.resize="none":"both"===n.resize&&(e.style.resize="horizontal"),t="content-box"===n.boxSizing?-(parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)):parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),isNaN(t)&&(t=0),p()}function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(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 d(){if(0!==e.scrollHeight){var o=u(e),s=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),s&&(document.documentElement.scrollTop=s)}}function p(){d();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),s="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(s<t?"hidden"===n.overflowY&&(c("scroll"),d(),s="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),d(),s="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==s){o=s;var i=r("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function a(e){var t=s.get(e);t&&t.destroy()}function l(e){var t=s.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===(s="function"==typeof n?n.apply(t,o):n)||(e.exports=s)},5755:(e,t)=>{var n; +*/o=[e,t],s=function(e,t){"use strict";var s,o,n="function"==typeof Map?new Map:(s=[],o=[],{has:function(e){return s.indexOf(e)>-1},get:function(e){return o[s.indexOf(e)]},set:function(e,t){-1===s.indexOf(e)&&(s.push(e),o.push(t))},delete:function(e){var t=s.indexOf(e);t>-1&&(s.splice(t,1),o.splice(t,1))}}),i=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){i=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function r(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!n.has(e)){var t=null,s=null,o=null,r=function(){e.clientWidth!==s&&p()},a=function(t){window.removeEventListener("resize",r,!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]})),n.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",r,!1),e.addEventListener("input",p,!1),e.addEventListener("autosize:update",p,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",n.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 o=d(e),n=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",s=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),n&&(document.documentElement.scrollTop=n)}}function p(){u();var t=Math.round(parseFloat(e.style.height)),s=window.getComputedStyle(e,null),n="content-box"===s.boxSizing?Math.round(parseFloat(s.height)):e.offsetHeight;if(n<t?"hidden"===s.overflowY&&(c("scroll"),u(),n="content-box"===s.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==s.overflowY&&(c("hidden"),u(),n="content-box"===s.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==n){o=n;var r=i("autosize:resized");try{e.dispatchEvent(r)}catch(e){}}}}function a(e){var t=n.get(e);t&&t.destroy()}function l(e){var t=n.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return r(e,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===(n="function"==typeof s?s.apply(t,o):s)||(e.exports=n)},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()}))]}},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 o(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((s=e,Array.isArray(s)?[]:{}),e,t):e;var s}function n(e,t,s){return e.concat(t).map((function(e){return o(e,s)}))}function i(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 r(e,t){try{return t in e}catch(e){return!1}}function a(e,t,s){var n={};return s.isMergeableObject(e)&&i(e).forEach((function(t){n[t]=o(e[t],s)})),i(t).forEach((function(i){(function(e,t){return r(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(r(e,i)&&s.isMergeableObject(t[i])?n[i]=function(e,t){if(!t.customMerge)return l;var s=t.customMerge(e);return"function"==typeof s?s:l}(i,s)(e[i],t[i],s):n[i]=o(t[i],s))})),n}function l(e,s,i){(i=i||{}).arrayMerge=i.arrayMerge||n,i.isMergeableObject=i.isMergeableObject||t,i.cloneUnlessOtherwiseSpecified=o;var r=Array.isArray(s);return r===Array.isArray(e)?r?i.arrayMerge(e,s,i):a(e,s,i):o(s,i)}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},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 o,n,i;if(Array.isArray(t)){if((o=t.length)!=s.length)return!1;for(n=o;0!=n--;)if(!e(t[n],s[n]))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((o=(i=Object.keys(t)).length)!==Object.keys(s).length)return!1;for(n=o;0!=n--;)if(!Object.prototype.hasOwnProperty.call(s,i[n]))return!1;for(n=o;0!=n--;){var r=i[n];if(!e(t[r],s[r]))return!1}return!0}return t!=t&&s!=s}},461:(e,t,s)=>{var o=s(6109);e.exports=function(e){var t=o(e,"line-height"),s=parseFloat(t,10);if(t===s+""){var n=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),s=parseFloat(t,10),n?e.style.lineHeight=n: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 i=e.nodeName,r=document.createElement(i);r.innerHTML=" ","TEXTAREA"===i.toUpperCase()&&r.setAttribute("rows","1");var a=o(e,"font-size");r.style.fontSize=a,r.style.padding="0px",r.style.border="0px";var l=document.body;l.appendChild(r),s=r.offsetHeight,l.removeChild(r)}return s}},628:(e,t,s)=>{"use strict";var o=s(4067);function n(){}function i(){}i.resetWarningCache=n,e.exports=function(){function e(e,t,s,n,i,r){if(r!==o){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:i,resetWarningCache:n};return s.PropTypes=s,s}},5826:(e,t,s)=>{e.exports=s(628)()},4067:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4462:function(e,t,s){"use strict";var o,n=this&&this.__extends||(o=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}o(e,t),e.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)}),i=this&&this.__assign||Object.assign||function(e){for(var t,s=1,o=arguments.length;s<o;s++)for(var n in t=arguments[s])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},r=this&&this.__rest||function(e,t){var s={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(s[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&(s[o[n]]=e[o[n]])}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 n(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,s=t.maxRows,o=t.async;"number"==typeof s&&this.updateLineHeight(),"number"==typeof s||o?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),o=(t.onChange,t.style),n=(t.innerRef,t.children),l=r(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,d=s&&c?c*s:null;return a.createElement("textarea",i({},l,{onChange:this.onChange,style:d?i({},o,{maxHeight:d}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),n)},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,i({},e,{innerRef:t}))}))},4132:(e,t,s)=>{"use strict";var o=s(4462);t.A=o.TextareaAutosize},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("|"),o=new RegExp(s,"g"),n=new RegExp(s,"");function i(e){return t[e]}var r=function(e){return e.replace(o,i)};e.exports=r,e.exports.has=function(e){return!!e.match(n)},e.exports.remove=r},1609:e=>{"use strict";e.exports=window.React}},t={};function s(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,s),i.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 o in t)s.o(t,o)&&!s.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},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 o={};(()=>{"use strict";s.r(o),s.d(o,{AlignmentToolbar:()=>np,Autocomplete:()=>op,AutosaveMonitor:()=>Si,BlockAlignmentToolbar:()=>ip,BlockControls:()=>rp,BlockEdit:()=>ap,BlockEditorKeyboardShortcuts:()=>lp,BlockFormatControls:()=>cp,BlockIcon:()=>dp,BlockInspector:()=>up,BlockList:()=>pp,BlockMover:()=>hp,BlockNavigationDropdown:()=>mp,BlockSelectionClearer:()=>gp,BlockSettingsMenu:()=>_p,BlockTitle:()=>fp,BlockToolbar:()=>bp,CharacterCount:()=>Td,ColorPalette:()=>yp,ContrastChecker:()=>xp,CopyHandler:()=>vp,DefaultBlockAppender:()=>wp,DocumentBar:()=>Bi,DocumentOutline:()=>Vi,DocumentOutlineCheck:()=>Ui,EditorHistoryRedo:()=>$i,EditorHistoryUndo:()=>Wi,EditorKeyboardShortcuts:()=>vi,EditorKeyboardShortcutsRegister:()=>zi,EditorNotices:()=>Zi,EditorProvider:()=>Qu,EditorSnackbars:()=>qi,EntitiesSavedStates:()=>ir,ErrorBoundary:()=>dr,FontSizePicker:()=>Sp,InnerBlocks:()=>Pp,Inserter:()=>kp,InspectorAdvancedControls:()=>Cp,InspectorControls:()=>jp,LocalAutosaveMonitor:()=>mr,MediaPlaceholder:()=>Ap,MediaUpload:()=>Dp,MediaUploadCheck:()=>Rp,MultiSelectScrollIntoView:()=>Mp,NavigableToolbar:()=>Op,ObserveTyping:()=>Lp,PageAttributesCheck:()=>gr,PageAttributesOrder:()=>yr,PageAttributesPanel:()=>Mr,PageAttributesParent:()=>Ar,PageTemplate:()=>Zr,PanelColorSettings:()=>Tp,PlainText:()=>Ep,PluginBlockSettingsMenuItem:()=>ia,PluginDocumentSettingPanel:()=>na,PluginMoreMenuItem:()=>ra,PluginPostPublishPanel:()=>da,PluginPostStatusInfo:()=>ma,PluginPrePublishPanel:()=>ba,PluginSidebar:()=>ya,PluginSidebarMoreMenuItem:()=>xa,PostAuthor:()=>Aa,PostAuthorCheck:()=>Da,PostAuthorPanel:()=>Ma,PostComments:()=>La,PostDiscussionPanel:()=>Ha,PostExcerpt:()=>Ga,PostExcerptCheck:()=>$a,PostExcerptPanel:()=>Xa,PostFeaturedImage:()=>dl,PostFeaturedImageCheck:()=>ol,PostFeaturedImagePanel:()=>pl,PostFormat:()=>gl,PostFormatCheck:()=>hl,PostLastRevision:()=>xl,PostLastRevisionCheck:()=>fl,PostLastRevisionPanel:()=>vl,PostLockedModal:()=>wl,PostPendingStatus:()=>kl,PostPendingStatusCheck:()=>Sl,PostPingbacks:()=>Fa,PostPreviewButton:()=>Pl,PostPublishButton:()=>El,PostPublishButtonLabel:()=>Cl,PostPublishPanel:()=>Dc,PostSavedState:()=>zc,PostSchedule:()=>Ql,PostScheduleCheck:()=>Hc,PostScheduleLabel:()=>Jl,PostSchedulePanel:()=>$c,PostSlug:()=>Zc,PostSlugCheck:()=>Wc,PostSticky:()=>qc,PostStickyCheck:()=>Yc,PostSwitchToDraftButton:()=>Qc,PostSyncStatus:()=>Xc,PostTaxonomies:()=>ed,PostTaxonomiesCheck:()=>td,PostTaxonomiesFlatTermSelector:()=>uc,PostTaxonomiesHierarchicalTermSelector:()=>vc,PostTaxonomiesPanel:()=>od,PostTemplatePanel:()=>ja,PostTextEditor:()=>id,PostTitle:()=>ud,PostTitleRaw:()=>pd,PostTrash:()=>hd,PostTrashCheck:()=>md,PostTypeSupportCheck:()=>fr,PostURL:()=>_d,PostURLCheck:()=>fd,PostURLLabel:()=>bd,PostURLPanel:()=>xd,PostVisibility:()=>Nl,PostVisibilityCheck:()=>wd,PostVisibilityLabel:()=>Dl,RichText:()=>sp,RichTextShortcut:()=>Bp,RichTextToolbarButton:()=>Ip,ServerSideRender:()=>Ju(),SkipToSelectedBlock:()=>Fp,TableOfContents:()=>Bd,TextEditorGlobalKeyboardShortcuts:()=>th,ThemeSupportCheck:()=>sl,TimeToRead:()=>jd,URLInput:()=>Vp,URLInputButton:()=>Up,URLPopover:()=>zp,UnsavedChangesWarning:()=>Id,VisualEditorGlobalKeyboardShortcuts:()=>eh,Warning:()=>Hp,WordCount:()=>Pd,WritingFlow:()=>Gp,__unstableRichTextInputEvent:()=>Np,cleanForSlug:()=>sh,createCustomColorsHOC:()=>$p,getColorClassName:()=>Wp,getColorObjectByAttributeValues:()=>Kp,getColorObjectByColorValue:()=>Zp,getFontSize:()=>Yp,getFontSizeClass:()=>qp,getTemplatePartIcon:()=>Y,mediaUpload:()=>Fd,privateApis:()=>m_,store:()=>cn,storeConfig:()=>ln,transformStyles:()=>g.transformStyles,useEntitiesSavedStatesIsDirty:()=>or,usePostScheduleLabel:()=>ec,usePostURLLabel:()=>yd,usePostVisibilityLabel:()=>Rl,userAutocompleter:()=>mn,withColorContext:()=>Qp,withColors:()=>Xp,withFontSizes:()=>Jp});var e={};s.r(e),s.d(e,{__experimentalGetDefaultTemplatePartAreas:()=>cs,__experimentalGetDefaultTemplateType:()=>ds,__experimentalGetDefaultTemplateTypes:()=>ls,__experimentalGetTemplateInfo:()=>us,__unstableIsEditorReady:()=>tt,canInsertBlockType:()=>ns,canUserUseUnfilteredHTML:()=>We,didPostSaveRequestFail:()=>Ee,didPostSaveRequestSucceed:()=>Te,getActivePostLock:()=>$e,getAdjacentBlockClientId:()=>Et,getAutosaveAttribute:()=>me,getBlock:()=>mt,getBlockAttributes:()=>ht,getBlockCount:()=>xt,getBlockHierarchyRootClientId:()=>Tt,getBlockIndex:()=>Ht,getBlockInsertionPoint:()=>Jt,getBlockListSettings:()=>as,getBlockMode:()=>qt,getBlockName:()=>ut,getBlockOrder:()=>zt,getBlockRootClientId:()=>jt,getBlockSelectionEnd:()=>wt,getBlockSelectionStart:()=>vt,getBlocks:()=>gt,getBlocksByClientId:()=>yt,getClientIdsOfDescendants:()=>_t,getClientIdsWithDescendants:()=>ft,getCurrentPost:()=>ne,getCurrentPostAttribute:()=>ue,getCurrentPostId:()=>re,getCurrentPostLastRevisionId:()=>ce,getCurrentPostRevisionsCount:()=>le,getCurrentPostType:()=>ie,getCurrentTemplateId:()=>ae,getDeviceType:()=>nt,getEditedPostAttribute:()=>he,getEditedPostContent:()=>De,getEditedPostPreviewLink:()=>Ne,getEditedPostSlug:()=>Le,getEditedPostVisibility:()=>ge,getEditorBlocks:()=>Ze,getEditorMode:()=>at,getEditorSelection:()=>et,getEditorSelectionEnd:()=>Je,getEditorSelectionStart:()=>Xe,getEditorSettings:()=>st,getFirstMultiSelectedBlockClientId:()=>Rt,getGlobalBlockCount:()=>bt,getInserterItems:()=>is,getLastMultiSelectedBlockClientId:()=>Mt,getMultiSelectedBlockClientIds:()=>At,getMultiSelectedBlocks:()=>Dt,getMultiSelectedBlocksEndClientId:()=>Ut,getMultiSelectedBlocksStartClientId:()=>Vt,getNextBlockClientId:()=>It,getPermalink:()=>Oe,getPermalinkParts:()=>Fe,getPostEdits:()=>de,getPostLockUser:()=>Ge,getPostTypeLabel:()=>ps,getPreviousBlockClientId:()=>Bt,getRenderingMode:()=>ot,getSelectedBlock:()=>Ct,getSelectedBlockClientId:()=>Pt,getSelectedBlockCount:()=>St,getSelectedBlocksInitialCaretPosition:()=>Nt,getStateBeforeOptimisticTransaction:()=>lt,getSuggestedPostFormat:()=>Ae,getTemplate:()=>ss,getTemplateLock:()=>os,hasChangedContent:()=>ee,hasEditorRedo:()=>X,hasEditorUndo:()=>Q,hasInserterItems:()=>rs,hasMultiSelection:()=>Kt,hasNonPostEntityChanges:()=>se,hasSelectedBlock:()=>kt,hasSelectedInnerBlock:()=>$t,inSomeHistory:()=>ct,isAncestorMultiSelected:()=>Ft,isAutosavingPost:()=>Be,isBlockInsertionPointVisible:()=>es,isBlockMultiSelected:()=>Lt,isBlockSelected:()=>Gt,isBlockValid:()=>pt,isBlockWithinSelection:()=>Wt,isCaretWithinFormattedText:()=>Xt,isCleanNewPost:()=>oe,isCurrentPostPending:()=>_e,isCurrentPostPublished:()=>fe,isCurrentPostScheduled:()=>be,isDeletingPost:()=>Pe,isEditedPostAutosaveable:()=>we,isEditedPostBeingScheduled:()=>Se,isEditedPostDateFloating:()=>ke,isEditedPostDirty:()=>te,isEditedPostEmpty:()=>ve,isEditedPostNew:()=>J,isEditedPostPublishable:()=>ye,isEditedPostSaveable:()=>xe,isEditorPanelEnabled:()=>qe,isEditorPanelOpened:()=>Qe,isEditorPanelRemoved:()=>Ye,isFirstMultiSelectedBlock:()=>Ot,isInserterOpened:()=>rt,isListViewOpened:()=>it,isMultiSelecting:()=>Zt,isPermalinkEditable:()=>Me,isPostAutosavingLocked:()=>ze,isPostLockTakeover:()=>He,isPostLocked:()=>Ve,isPostSavingLocked:()=>Ue,isPreviewingPost:()=>Ie,isPublishSidebarEnabled:()=>Ke,isPublishSidebarOpened:()=>hs,isPublishingPost:()=>Re,isSavingNonPostEntityChanges:()=>je,isSavingPost:()=>Ce,isSelectionEnabled:()=>Yt,isTyping:()=>Qt,isValidTemplate:()=>ts});var t={};s.r(t),s.d(t,{__experimentalTearDownEditor:()=>ws,__unstableSaveForPreview:()=>Ns,autosave:()=>Is,clearSelectedBlock:()=>ho,closePublishSidebar:()=>to,createUndoLevel:()=>Rs,disablePublishSidebar:()=>Ls,editPost:()=>js,enablePublishSidebar:()=>Os,enterFormattedText:()=>No,exitFormattedText:()=>Ao,hideInsertionPoint:()=>So,insertBlock:()=>xo,insertBlocks:()=>vo,insertDefaultBlock:()=>Do,lockPostAutosaving:()=>Us,lockPostSaving:()=>Fs,mergeBlocks:()=>Co,moveBlockToPosition:()=>yo,moveBlocksDown:()=>fo,moveBlocksUp:()=>bo,multiSelect:()=>po,openPublishSidebar:()=>eo,receiveBlocks:()=>io,redo:()=>As,refreshPost:()=>Es,removeBlock:()=>To,removeBlocks:()=>jo,removeEditorPanel:()=>Ys,replaceBlock:()=>_o,replaceBlocks:()=>go,resetBlocks:()=>no,resetEditorBlocks:()=>Hs,resetPost:()=>Ss,savePost:()=>Ts,selectBlock:()=>lo,setDeviceType:()=>Ws,setEditedPost:()=>Cs,setIsInserterOpened:()=>qs,setIsListViewOpened:()=>Qs,setRenderingMode:()=>$s,setTemplateValidity:()=>ko,setupEditor:()=>vs,setupEditorState:()=>Ps,showInsertionPoint:()=>wo,startMultiSelect:()=>co,startTyping:()=>Bo,stopMultiSelect:()=>uo,stopTyping:()=>Io,switchEditorMode:()=>Js,synchronizeTemplate:()=>Po,toggleBlockMode:()=>Eo,toggleDistractionFree:()=>Xs,toggleEditorPanelEnabled:()=>Ks,toggleEditorPanelOpened:()=>Zs,togglePublishSidebar:()=>so,toggleSelection:()=>mo,trashPost:()=>Bs,undo:()=>Ds,unlockPostAutosaving:()=>zs,unlockPostSaving:()=>Vs,updateBlock:()=>ro,updateBlockAttributes:()=>ao,updateBlockListSettings:()=>Ro,updateEditorSettings:()=>Gs,updatePost:()=>ks,updatePostLock:()=>Ms});var n={};s.r(n),s.d(n,{createTemplate:()=>Fo,hideBlockTypes:()=>Uo,removeTemplates:()=>Go,revertTemplate:()=>Ho,saveDirtyEntities:()=>zo,setCurrentTemplateId:()=>Lo,showBlockTypes:()=>Vo});var i={};s.r(i),s.d(i,{getCurrentTemplateTemplateParts:()=>rn,getInserterSidebarToggleRef:()=>sn,getInsertionPoint:()=>en,getListViewToggleRef:()=>tn,getPostIcon:()=>nn,hasPostMetaChanges:()=>an});var r={};s.r(r),s.d(r,{closeModal:()=>$n,disableComplementaryArea:()=>Ln,enableComplementaryArea:()=>On,openModal:()=>Gn,pinItem:()=>Fn,setDefaultComplementaryArea:()=>Mn,setFeatureDefaults:()=>Hn,setFeatureValue:()=>zn,toggleFeature:()=>Un,unpinItem:()=>Vn});var a={};s.r(a),s.d(a,{getActiveComplementaryArea:()=>Wn,isComplementaryAreaLoading:()=>Kn,isFeatureActive:()=>Yn,isItemPinned:()=>Zn,isModalActive:()=>qn});var l={};s.r(l),s.d(l,{ActionItem:()=>ii,ComplementaryArea:()=>gi,ComplementaryAreaMoreMenuItem:()=>ai,FullscreenMode:()=>_i,InterfaceSkeleton:()=>xi,NavigableRegion:()=>fi,PinnedItems:()=>ci,store:()=>Xn});const c=window.wp.blocks,d=window.wp.data,u=window.wp.privateApis,{lock:p,unlock:h}=(0,u.__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"),m=window.wp.i18n,g=window.wp.blockEditor,_="content",f={name:"core/pattern-overrides",label:(0,m._x)("Pattern Overrides","block bindings source"),getValue({registry:e,clientId:t,context:s,attributeName:o}){const n=s["pattern/overrides"],{getBlockAttributes:i}=e.select(g.store),r=i(t);if(!n)return r[o];const a=n?.[r?.metadata?.name]?.[o];return void 0===a?r[o]:""===a?void 0:a},setValues({registry:e,clientId:t,attributes:s}){const{getBlockAttributes:o,getBlockParentsByBlockName:n,getBlocks:i}=e.select(g.store),r=o(t),a=r?.metadata?.name;if(!a)return;const[l]=n(t,"core/block",!0);if(!l){const t=o=>{for(const n of o)n.attributes?.metadata?.name===a&&e.dispatch(g.store).updateBlockAttributes(n.clientId,s),t(n.innerBlocks)};return void t(i())}const c=o(l)?.[_];e.dispatch(g.store).updateBlockAttributes(l,{[_]:{...c,[a]:{...c?.[a],...Object.entries(s).reduce(((e,[t,s])=>(e[t]=void 0===s?"":s,e)),{})}}})},canUserEditValue:()=>!0},b=window.wp.coreData,y={...g.SETTINGS_DEFAULTS,richEditingEnabled:!0,codeEditingEnabled:!0,fontLibraryEnabled:!0,enableCustomFields:void 0,defaultRenderingMode:"post-only"};function x(e){return e&&"object"==typeof e&&"raw"in e?e.raw:e}const v=(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,...o}=e;return o}}return e},editorSettings:function(e=y,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,...o}=e;return o}}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}}),w=window.wp.date,S=window.wp.url,k=window.wp.deprecated;var P=s.n(k);const C=window.wp.element,j=window.wp.primitives,T=window.ReactJSXRuntime,E=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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"})}),B=window.wp.preferences,I=new Set(["meta"]),N="SAVE_POST_NOTICE_ID",A="TRASH_POST_NOTICE_ID",D=/%(?:postname|pagename)%/,R=6e4,M=["title","excerpt","content"],O="uncategorized",L="wp_template",F="wp_template_part",V="wp_block",U="wp_navigation",z={custom:"custom",theme:"theme",plugin:"plugin"},H=["wp_template","wp_template_part"],G=[...H,"wp_block","wp_navigation"],$=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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"})}),W=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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"})}),K=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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"})}),Z=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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 Y(e){return"header"===e?$:"footer"===e?W:"sidebar"===e?K:Z}const q={},Q=(0,d.createRegistrySelector)((e=>()=>e(b.store).hasUndo())),X=(0,d.createRegistrySelector)((e=>()=>e(b.store).hasRedo()));function J(e){return"auto-draft"===ne(e).status}function ee(e){return"content"in de(e)}const te=(0,d.createRegistrySelector)((e=>t=>{const s=ie(t),o=re(t);return e(b.store).hasEditsForEntityRecord("postType",s,o)})),se=(0,d.createRegistrySelector)((e=>t=>{const s=e(b.store).__experimentalGetDirtyEntityRecords(),{type:o,id:n}=ne(t);return s.some((e=>"postType"!==e.kind||e.name!==o||e.key!==n))}));function oe(e){return!te(e)&&J(e)}const ne=(0,d.createRegistrySelector)((e=>t=>{const s=re(t),o=ie(t),n=e(b.store).getRawEntityRecord("postType",o,s);return n||q}));function ie(e){return e.postType}function re(e){return e.postId}function ae(e){return e.templateId}function le(e){var t;return null!==(t=ne(e)._links?.["version-history"]?.[0]?.count)&&void 0!==t?t:0}function ce(e){var t;return null!==(t=ne(e)._links?.["predecessor-version"]?.[0]?.id)&&void 0!==t?t:null}const de=(0,d.createRegistrySelector)((e=>t=>{const s=ie(t),o=re(t);return e(b.store).getEntityRecordEdits("postType",s,o)||q}));function ue(e,t){switch(t){case"type":return ie(e);case"id":return re(e);default:const s=ne(e);if(!s.hasOwnProperty(t))break;return x(s[t])}}const pe=(0,d.createSelector)(((e,t)=>{const s=de(e);return s.hasOwnProperty(t)?{...ue(e,t),...s[t]}:ue(e,t)}),((e,t)=>[ue(e,t),de(e)[t]]));function he(e,t){if("content"===t)return De(e);const s=de(e);return s.hasOwnProperty(t)?I.has(t)?pe(e,t):s[t]:ue(e,t)}const me=(0,d.createRegistrySelector)((e=>(t,s)=>{if(!M.includes(s)&&"preview_link"!==s)return;const o=ie(t);if("wp_template"===o)return!1;const n=re(t),i=e(b.store).getCurrentUser()?.id,r=e(b.store).getAutosave(o,n,i);return r?x(r[s]):void 0}));function ge(e){if("private"===he(e,"status"))return"private";return he(e,"password")?"password":"public"}function _e(e){return"pending"===ne(e).status}function fe(e,t){const s=t||ne(e);return-1!==["publish","private"].indexOf(s.status)||"future"===s.status&&!(0,w.isInTheFuture)(new Date(Number((0,w.getDate)(s.date))-R))}function be(e){return"future"===ne(e).status&&!fe(e)}function ye(e){const t=ne(e);return te(e)||-1===["publish","private","future"].indexOf(t.status)}function xe(e){return!Ce(e)&&(!!he(e,"title")||!!he(e,"excerpt")||!ve(e)||"native"===C.Platform.OS)}const ve=(0,d.createRegistrySelector)((e=>t=>{const s=re(t),o=ie(t),n=e(b.store).getEditedEntityRecord("postType",o,s);if("function"!=typeof n.content)return!n.content;const i=he(t,"blocks");if(0===i.length)return!0;if(i.length>1)return!1;const r=i[0].name;return(r===(0,c.getDefaultBlockName)()||r===(0,c.getFreeformContentHandlerName)())&&!De(t)})),we=(0,d.createRegistrySelector)((e=>t=>{if(!xe(t))return!1;if(ze(t))return!1;const s=ie(t);if("wp_template"===s)return!1;const o=re(t),n=e(b.store).hasFetchedAutosaves(s,o),i=e(b.store).getCurrentUser()?.id,r=e(b.store).getAutosave(s,o,i);return!!n&&(!r||(!!ee(t)||["title","excerpt","meta"].some((e=>x(r[e])!==he(t,e)))))}));function Se(e){const t=he(e,"date"),s=new Date(Number((0,w.getDate)(t))-R);return(0,w.isInTheFuture)(s)}function ke(e){const t=he(e,"date"),s=he(e,"modified"),o=ne(e).status;return("draft"===o||"auto-draft"===o||"pending"===o)&&(t===s||null===t)}function Pe(e){return!!e.deleting.pending}function Ce(e){return!!e.saving.pending}const je=(0,d.createRegistrySelector)((e=>t=>{const s=e(b.store).__experimentalGetEntitiesBeingSaved(),{type:o,id:n}=ne(t);return s.some((e=>"postType"!==e.kind||e.name!==o||e.key!==n))})),Te=(0,d.createRegistrySelector)((e=>t=>{const s=ie(t),o=re(t);return!e(b.store).getLastEntitySaveError("postType",s,o)})),Ee=(0,d.createRegistrySelector)((e=>t=>{const s=ie(t),o=re(t);return!!e(b.store).getLastEntitySaveError("postType",s,o)}));function Be(e){return Ce(e)&&Boolean(e.saving.options?.isAutosave)}function Ie(e){return Ce(e)&&Boolean(e.saving.options?.isPreview)}function Ne(e){if(e.saving.pending||Ce(e))return;let t=me(e,"preview_link");t&&"draft"!==ne(e).status||(t=he(e,"link"),t&&(t=(0,S.addQueryArgs)(t,{preview:!0})));const s=he(e,"featured_media");return t&&s?(0,S.addQueryArgs)(t,{_thumbnail_id:s}):t}const Ae=(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}})),De=(0,d.createRegistrySelector)((e=>t=>{const s=re(t),o=ie(t),n=e(b.store).getEditedEntityRecord("postType",o,s);if(n){if("function"==typeof n.content)return n.content(n);if(n.blocks)return(0,c.__unstableSerializeAndClean)(n.blocks);if(n.content)return n.content}return""}));function Re(e){return Ce(e)&&!fe(e)&&"publish"===he(e,"status")}function Me(e){const t=he(e,"permalink_template");return D.test(t)}function Oe(e){const t=Fe(e);if(!t)return null;const{prefix:s,postName:o,suffix:n}=t;return Me(e)?s+o+n:s}function Le(e){return he(e,"slug")||(0,S.cleanForSlug)(he(e,"title"))||re(e)}function Fe(e){const t=he(e,"permalink_template");if(!t)return null;const s=he(e,"slug")||he(e,"generated_slug"),[o,n]=t.split(D);return{prefix:o,postName:s,suffix:n}}function Ve(e){return e.postLock.isLocked}function Ue(e){return Object.keys(e.postSavingLock).length>0}function ze(e){return Object.keys(e.postAutosavingLock).length>0}function He(e){return e.postLock.isTakeover}function Ge(e){return e.postLock.user}function $e(e){return e.postLock.activePostLock}function We(e){return Boolean(ne(e)._links?.hasOwnProperty("wp:action-unfiltered-html"))}const Ke=(0,d.createRegistrySelector)((e=>()=>!!e(B.store).get("core","isPublishSidebarEnabled"))),Ze=(0,d.createSelector)((e=>he(e,"blocks")||(0,c.parse)(De(e))),(e=>[he(e,"blocks"),De(e)]));function Ye(e,t){return e.removedPanels.includes(t)}const qe=(0,d.createRegistrySelector)((e=>(t,s)=>{const o=e(B.store).get("core","inactivePanels");return!Ye(t,s)&&!o?.includes(s)})),Qe=(0,d.createRegistrySelector)((e=>(t,s)=>{const o=e(B.store).get("core","openPanels");return!!o?.includes(s)}));function Xe(e){return P()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),he(e,"selection")?.selectionStart}function Je(e){return P()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),he(e,"selection")?.selectionEnd}function et(e){return he(e,"selection")}function tt(e){return!!e.postId}function st(e){return e.editorSettings}function ot(e){return e.renderingMode}function nt(e){return e.deviceType}function it(e){return e.listViewPanel}function rt(e){return!!e.blockInserterPanel}const at=(0,d.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(B.store).get("core","editorMode"))&&void 0!==t?t:"visual"}));function lt(){return P()("select('core/editor').getStateBeforeOptimisticTransaction",{since:"5.7",hint:"No state history is kept on this store anymore"}),null}function ct(){return P()("select('core/editor').inSomeHistory",{since:"5.7",hint:"No state history is kept on this store anymore"}),!1}function dt(e){return(0,d.createRegistrySelector)((t=>(s,...o)=>(P()("`wp.data.select( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.select( 'core/block-editor' )."+e+"`",version:"6.2"}),t(g.store)[e](...o))))}const ut=dt("getBlockName"),pt=dt("isBlockValid"),ht=dt("getBlockAttributes"),mt=dt("getBlock"),gt=dt("getBlocks"),_t=dt("getClientIdsOfDescendants"),ft=dt("getClientIdsWithDescendants"),bt=dt("getGlobalBlockCount"),yt=dt("getBlocksByClientId"),xt=dt("getBlockCount"),vt=dt("getBlockSelectionStart"),wt=dt("getBlockSelectionEnd"),St=dt("getSelectedBlockCount"),kt=dt("hasSelectedBlock"),Pt=dt("getSelectedBlockClientId"),Ct=dt("getSelectedBlock"),jt=dt("getBlockRootClientId"),Tt=dt("getBlockHierarchyRootClientId"),Et=dt("getAdjacentBlockClientId"),Bt=dt("getPreviousBlockClientId"),It=dt("getNextBlockClientId"),Nt=dt("getSelectedBlocksInitialCaretPosition"),At=dt("getMultiSelectedBlockClientIds"),Dt=dt("getMultiSelectedBlocks"),Rt=dt("getFirstMultiSelectedBlockClientId"),Mt=dt("getLastMultiSelectedBlockClientId"),Ot=dt("isFirstMultiSelectedBlock"),Lt=dt("isBlockMultiSelected"),Ft=dt("isAncestorMultiSelected"),Vt=dt("getMultiSelectedBlocksStartClientId"),Ut=dt("getMultiSelectedBlocksEndClientId"),zt=dt("getBlockOrder"),Ht=dt("getBlockIndex"),Gt=dt("isBlockSelected"),$t=dt("hasSelectedInnerBlock"),Wt=dt("isBlockWithinSelection"),Kt=dt("hasMultiSelection"),Zt=dt("isMultiSelecting"),Yt=dt("isSelectionEnabled"),qt=dt("getBlockMode"),Qt=dt("isTyping"),Xt=dt("isCaretWithinFormattedText"),Jt=dt("getBlockInsertionPoint"),es=dt("isBlockInsertionPointVisible"),ts=dt("isValidTemplate"),ss=dt("getTemplate"),os=dt("getTemplateLock"),ns=dt("canInsertBlockType"),is=dt("getInserterItems"),rs=dt("hasInserterItems"),as=dt("getBlockListSettings");function ls(e){return st(e)?.defaultTemplateTypes}const cs=(0,d.createSelector)((e=>{var t;return(null!==(t=st(e)?.defaultTemplatePartAreas)&&void 0!==t?t:[]).map((e=>({...e,icon:Y(e.icon)})))}),(e=>[st(e)?.defaultTemplatePartAreas])),ds=(0,d.createSelector)(((e,t)=>{var s;const o=ls(e);return o&&null!==(s=Object.values(o).find((e=>e.slug===t)))&&void 0!==s?s:q}),(e=>[ls(e)])),us=(0,d.createSelector)(((e,t)=>{if(!t)return q;const{description:s,slug:o,title:n,area:i}=t,{title:r,description:a}=ds(e,o),l="string"==typeof n?n:n?.rendered;return{title:l&&l!==o?l:r||o,description:("string"==typeof s?s:s?.raw)||a,icon:cs(e).find((e=>i===e.area))?.icon||E}}),(e=>[ls(e),cs(e)])),ps=(0,d.createRegistrySelector)((e=>t=>{const s=ie(t),o=e(b.store).getPostType(s);return o?.labels?.singular_name}));function hs(e){return e.publishSidebarActive}const ms=window.wp.a11y,gs=window.wp.apiFetch;var _s=s.n(gs);const fs=window.wp.notices,bs=window.wp.hooks;function ys(e,t){return`wp-autosave-block-editor-post-${t?"auto-draft":e}`}function xs(e,t){window.sessionStorage.removeItem(ys(e,t))}const vs=(e,t,s)=>({dispatch:o})=>{o.setEditedPost(e.type,e.id);if("auto-draft"===e.status&&s){let n;n="content"in t?t.content:e.content.raw;let i=(0,c.parse)(n);i=(0,c.synchronizeBlocksWithTemplate)(i,s),o.resetEditorBlocks(i,{__unstableShouldCreateUndoLevel:!1})}t&&Object.values(t).some((([t,s])=>{var o;return s!==(null!==(o=e[t]?.raw)&&void 0!==o?o:e[t])}))&&o.editPost(t)};function ws(){return P()("wp.data.dispatch( 'core/editor' ).__experimentalTearDownEditor",{since:"6.5"}),{type:"DO_NOTHING"}}function Ss(){return P()("wp.data.dispatch( 'core/editor' ).resetPost",{since:"6.0",version:"6.3",alternative:"Initialize the editor with the setupEditorState action"}),{type:"DO_NOTHING"}}function ks(){return P()("wp.data.dispatch( 'core/editor' ).updatePost",{since:"5.7",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function Ps(e){return P()("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 js=(e,t)=>({select:s,registry:o})=>{const{id:n,type:i}=s.getCurrentPost();o.dispatch(b.store).editEntityRecord("postType",i,n,e,t)},Ts=(e={})=>async({select:t,dispatch:s,registry:o})=>{if(!t.isEditedPostSaveable())return;const n=t.getEditedPostContent();e.isAutosave||s.editPost({content:n},{undoIgnore:!0});const i=t.getCurrentPost(),r={id:i.id,...o.select(b.store).getEntityRecordNonTransientEdits("postType",i.type,i.id),content:n};s({type:"REQUEST_POST_UPDATE_START",options:e}),await o.dispatch(b.store).saveEntityRecord("postType",i.type,r,e);let a=o.select(b.store).getLastEntitySaveError("postType",i.type,i.id);if(a||await(0,bs.applyFilters)("editor.__unstableSavePost",Promise.resolve(),e).catch((e=>{a=e})),s({type:"REQUEST_POST_UPDATE_FINISH",options:e}),a){const e=function(e){const{post:t,edits:s,error:o}=e;if(o&&"rest_autosave_no_changes"===o.code)return[];const n=["publish","private","future"],i=-1!==n.indexOf(t.status),r={publish:(0,m.__)("Publishing failed."),private:(0,m.__)("Publishing failed."),future:(0,m.__)("Scheduling failed.")};let a=i||-1===n.indexOf(s.status)?(0,m.__)("Updating failed."):r[s.status];return o.message&&!/<\/?[^>]*>/.test(o.message)&&(a=[a,o.message].join(" ")),[a,{id:N}]}({post:i,edits:r,error:a});e.length&&o.dispatch(fs.store).createErrorNotice(...e)}else{const s=t.getCurrentPost(),n=function(e){var t;const{previousPost:s,post:o,postType:n}=e;if(e.options?.isAutosave)return[];const i=["publish","private","future"],r=i.includes(s.status),a=i.includes(o.status),l="trash"===o.status&&"trash"!==s.status;let c,d,u=null!==(t=n?.viewable)&&void 0!==t&&t;l?(c=n.labels.item_trashed,u=!1):r||a?r&&!a?(c=n.labels.item_reverted_to_draft,u=!1):c=!r&&a?{publish:n.labels.item_published,private:n.labels.item_published_privately,future:n.labels.item_scheduled}[o.status]:n.labels.item_updated:(c=(0,m.__)("Draft saved."),d=!0);const p=[];return u&&p.push({label:d?(0,m.__)("View Preview"):n.labels.view_item,url:o.link}),[c,{id:N,type:"snackbar",actions:p}]}({previousPost:i,post:s,postType:await o.resolveSelect(b.store).getPostType(s.type),options:e});n.length&&o.dispatch(fs.store).createSuccessNotice(...n),e.isAutosave||o.dispatch(g.store).__unstableMarkLastChangeAsPersistent()}};function Es(){return P()("wp.data.dispatch( 'core/editor' ).refreshPost",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}const Bs=()=>async({select:e,dispatch:t,registry:s})=>{const o=e.getCurrentPostType(),n=await s.resolveSelect(b.store).getPostType(o);s.dispatch(fs.store).removeNotice(A);const{rest_base:i,rest_namespace:r="wp/v2"}=n;t({type:"REQUEST_POST_DELETE_START"});try{const s=e.getCurrentPost();await _s()({path:`/${r}/${i}/${s.id}`,method:"DELETE"}),await t.savePost()}catch(e){s.dispatch(fs.store).createErrorNotice(...(a={error:e},[a.error.message&&"unknown_error"!==a.error.code?a.error.message:(0,m.__)("Trashing failed"),{id:A}]))}var a;t({type:"REQUEST_POST_DELETE_FINISH"})},Is=({local:e=!1,...t}={})=>async({select:s,dispatch:o})=>{const n=s.getCurrentPost();if("wp_template"!==n.type)if(e){const e=s.isEditedPostNew(),t=s.getEditedPostAttribute("title"),o=s.getEditedPostAttribute("content"),i=s.getEditedPostAttribute("excerpt");!function(e,t,s,o,n){window.sessionStorage.setItem(ys(e,t),JSON.stringify({post_title:s,content:o,excerpt:n}))}(n.id,e,t,o,i)}else await o.savePost({isAutosave:!0,...t})},Ns=({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()},As=()=>({registry:e})=>{e.dispatch(b.store).redo()},Ds=()=>({registry:e})=>{e.dispatch(b.store).undo()};function Rs(){return P()("wp.data.dispatch( 'core/editor' ).createUndoLevel",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function Ms(e){return{type:"UPDATE_POST_LOCK",lock:e}}const Os=()=>({registry:e})=>{e.dispatch(B.store).set("core","isPublishSidebarEnabled",!0)},Ls=()=>({registry:e})=>{e.dispatch(B.store).set("core","isPublishSidebarEnabled",!1)};function Fs(e){return{type:"LOCK_POST_SAVING",lockName:e}}function Vs(e){return{type:"UNLOCK_POST_SAVING",lockName:e}}function Us(e){return{type:"LOCK_POST_AUTOSAVING",lockName:e}}function zs(e){return{type:"UNLOCK_POST_AUTOSAVING",lockName:e}}const Hs=(e,t={})=>({select:s,dispatch:o,registry:n})=>{const{__unstableShouldCreateUndoLevel:i,selection:r}=t,a={blocks:e,selection:r};if(!1!==i){const{id:e,type:t}=s.getCurrentPost();if(n.select(b.store).getEditedEntityRecord("postType",t,e).blocks===a.blocks)return void n.dispatch(b.store).__unstableCreateUndoLevel("postType",t,e);a.content=({blocks:e=[]})=>(0,c.__unstableSerializeAndClean)(e)}o.editPost(a)};function Gs(e){return{type:"UPDATE_EDITOR_SETTINGS",settings:e}}const $s=e=>({dispatch:t,registry:s,select:o})=>{o.__unstableIsEditorReady()&&(s.dispatch(g.store).clearSelectedBlock(),t.editPost({selection:void 0},{undoIgnore:!0})),t({type:"SET_RENDERING_MODE",mode:e})};function Ws(e){return{type:"SET_DEVICE_TYPE",deviceType:e}}const Ks=e=>({registry:t})=>{var s;const o=null!==(s=t.select(B.store).get("core","inactivePanels"))&&void 0!==s?s:[];let n;n=!!o?.includes(e)?o.filter((t=>t!==e)):[...o,e],t.dispatch(B.store).set("core","inactivePanels",n)},Zs=e=>({registry:t})=>{var s;const o=null!==(s=t.select(B.store).get("core","openPanels"))&&void 0!==s?s:[];let n;n=!!o?.includes(e)?o.filter((t=>t!==e)):[...o,e],t.dispatch(B.store).set("core","openPanels",n)};function Ys(e){return{type:"REMOVE_PANEL",panelName:e}}function qs(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function Qs(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}const Xs=()=>({dispatch:e,registry:t})=>{const s=t.select(B.store).get("core","distractionFree");s&&t.dispatch(B.store).set("core","fixedToolbar",!1),s||t.batch((()=>{t.dispatch(B.store).set("core","fixedToolbar",!0),e.setIsInserterOpened(!1),e.setIsListViewOpened(!1)})),t.batch((()=>{t.dispatch(B.store).set("core","distractionFree",!s),t.dispatch(fs.store).createInfoNotice(s?(0,m.__)("Distraction free off."):(0,m.__)("Distraction free on."),{id:"core/editor/distraction-free-mode/notice",type:"snackbar",actions:[{label:(0,m.__)("Undo"),onClick:()=>{t.batch((()=>{t.dispatch(B.store).set("core","fixedToolbar",!!s),t.dispatch(B.store).toggle("core","distractionFree")}))}}]})}))},Js=e=>({dispatch:t,registry:s})=>{if(s.dispatch(B.store).set("core","editorMode",e),"visual"!==e&&s.dispatch(g.store).clearSelectedBlock(),"visual"===e)(0,ms.speak)((0,m.__)("Visual editor selected"),"assertive");else if("text"===e){s.select(B.store).get("core","distractionFree")&&t.toggleDistractionFree(),(0,ms.speak)((0,m.__)("Code editor selected"),"assertive")}};function eo(){return{type:"OPEN_PUBLISH_SIDEBAR"}}function to(){return{type:"CLOSE_PUBLISH_SIDEBAR"}}function so(){return{type:"TOGGLE_PUBLISH_SIDEBAR"}}const oo=e=>(...t)=>({registry:s})=>{P()("`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)},no=oo("resetBlocks"),io=oo("receiveBlocks"),ro=oo("updateBlock"),ao=oo("updateBlockAttributes"),lo=oo("selectBlock"),co=oo("startMultiSelect"),uo=oo("stopMultiSelect"),po=oo("multiSelect"),ho=oo("clearSelectedBlock"),mo=oo("toggleSelection"),go=oo("replaceBlocks"),_o=oo("replaceBlock"),fo=oo("moveBlocksDown"),bo=oo("moveBlocksUp"),yo=oo("moveBlockToPosition"),xo=oo("insertBlock"),vo=oo("insertBlocks"),wo=oo("showInsertionPoint"),So=oo("hideInsertionPoint"),ko=oo("setTemplateValidity"),Po=oo("synchronizeTemplate"),Co=oo("mergeBlocks"),jo=oo("removeBlocks"),To=oo("removeBlock"),Eo=oo("toggleBlockMode"),Bo=oo("startTyping"),Io=oo("stopTyping"),No=oo("enterFormattedText"),Ao=oo("exitFormattedText"),Do=oo("insertDefaultBlock"),Ro=oo("updateBlockListSettings"),Mo=window.wp.htmlEntities;function Oo(e){return!!e&&(e.source===z.custom&&e.has_theme_file)}function Lo(e){return{type:"SET_CURRENT_TEMPLATE_ID",id:e}}const Fo=e=>async({select:t,dispatch:s,registry:o})=>{const n=await o.dispatch(b.store).saveEntityRecord("postType","wp_template",e);return o.dispatch(b.store).editEntityRecord("postType",t.getCurrentPostType(),t.getCurrentPostId(),{template:n.slug}),o.dispatch(fs.store).createSuccessNotice((0,m.__)("Custom template created. You're in template mode now."),{type:"snackbar",actions:[{label:(0,m.__)("Go back"),onClick:()=>s.setRenderingMode(t.getEditorSettings().defaultRenderingMode)}]}),n},Vo=e=>({registry:t})=>{var s;const o=(null!==(s=t.select(B.store).get("core","hiddenBlockTypes"))&&void 0!==s?s:[]).filter((t=>!(Array.isArray(e)?e:[e]).includes(t)));t.dispatch(B.store).set("core","hiddenBlockTypes",o)},Uo=e=>({registry:t})=>{var s;const o=null!==(s=t.select(B.store).get("core","hiddenBlockTypes"))&&void 0!==s?s:[],n=new Set([...o,...Array.isArray(e)?e:[e]]);t.dispatch(B.store).set("core","hiddenBlockTypes",[...n])},zo=({onSave:e,dirtyEntityRecords:t=[],entitiesToSkip:s=[],close:o}={})=>({registry:n})=>{const i=[{kind:"postType",name:"wp_navigation"}],r="site-editor-save-success",a=n.select(b.store).getUnstableBase()?.home;n.dispatch(fs.store).removeNotice(r);const l=t.filter((({kind:e,name:t,key:o,property:n})=>!s.some((s=>s.kind===e&&s.name===t&&s.key===o&&s.property===n))));o?.(l);const c=[],d=[];l.forEach((({kind:e,name:t,key:s,property:o})=>{"root"===e&&"site"===t?c.push(o):(i.some((s=>s.kind===e&&s.name===t))&&n.dispatch(b.store).editEntityRecord(e,t,s,{status:"publish"}),d.push(n.dispatch(b.store).saveEditedEntityRecord(e,t,s)))})),c.length&&d.push(n.dispatch(b.store).__experimentalSaveSpecifiedEntityEdits("root","site",void 0,c)),n.dispatch(g.store).__unstableMarkLastChangeAsPersistent(),Promise.all(d).then((t=>e?e(t):t)).then((e=>{e.some((e=>void 0===e))?n.dispatch(fs.store).createErrorNotice((0,m.__)("Saving failed.")):n.dispatch(fs.store).createSuccessNotice((0,m.__)("Site updated."),{type:"snackbar",id:r,actions:[{label:(0,m.__)("View site"),url:a}]})})).catch((e=>n.dispatch(fs.store).createErrorNotice(`${(0,m.__)("Saving failed.")} ${e}`)))},Ho=(e,{allowUndo:t=!0}={})=>async({registry:s})=>{const o="edit-site-template-reverted";if(s.dispatch(fs.store).removeNotice(o),Oo(e))try{const n=s.select(b.store).getEntityConfig("postType",e.type);if(!n)return void s.dispatch(fs.store).createErrorNotice((0,m.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const i=(0,S.addQueryArgs)(`${n.baseURL}/${e.id}`,{context:"edit",source:"theme"}),r=await _s()({path:i});if(!r)return void s.dispatch(fs.store).createErrorNotice((0,m.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const a=({blocks:e=[]})=>(0,c.__unstableSerializeAndClean)(e),l=s.select(b.store).getEditedEntityRecord("postType",e.type,e.id);s.dispatch(b.store).editEntityRecord("postType",e.type,e.id,{content:a,blocks:l.blocks,source:"custom"},{undoIgnore:!0});const d=(0,c.parse)(r?.content?.raw);if(s.dispatch(b.store).editEntityRecord("postType",e.type,r.id,{content:a,blocks:d,source:"theme"}),t){const t=()=>{s.dispatch(b.store).editEntityRecord("postType",e.type,l.id,{content:a,blocks:l.blocks,source:"custom"})};s.dispatch(fs.store).createSuccessNotice((0,m.__)("Template reset."),{type:"snackbar",id:o,actions:[{label:(0,m.__)("Undo"),onClick:t}]})}}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,m.__)("Template revert failed. Please reload.");s.dispatch(fs.store).createErrorNotice(t,{type:"snackbar"})}else s.dispatch(fs.store).createErrorNotice((0,m.__)("This template is not revertable."),{type:"snackbar"})},Go=e=>async({registry:t})=>{const s=e.every((e=>!!e&&(e.has_theme_file||e.templatePart&&e.templatePart.has_theme_file))),o=await Promise.allSettled(e.map((e=>t.dispatch(b.store).deleteEntityRecord("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(o.every((({status:e})=>"fulfilled"===e))){let o;if(1===e.length){const t="string"==typeof e[0].title?e[0].title:e[0].title?.rendered;o=s?(0,m.sprintf)((0,m.__)('"%s" reset.'),(0,Mo.decodeEntities)(t)):(0,m.sprintf)((0,m.__)('"%s" deleted.'),(0,Mo.decodeEntities)(t))}else o=s?(0,m.__)("Items reset."):(0,m.__)("Items deleted.");t.dispatch(fs.store).createSuccessNotice(o,{type:"snackbar",id:"editor-template-deleted-success"})}else{let e;if(1===o.length)e=o[0].reason?.message?o[0].reason.message:s?(0,m.__)("An error occurred while reverting the item."):(0,m.__)("An error occurred while deleting the item.");else{const t=new Set,n=o.filter((({status:e})=>"rejected"===e));for(const e of n)e.reason?.message&&t.add(e.reason.message);e=0===t.size?(0,m.__)("An error occurred while deleting the items."):1===t.size?s?(0,m.sprintf)((0,m.__)("An error occurred while reverting the items: %s"),[...t][0]):(0,m.sprintf)((0,m.__)("An error occurred while deleting the items: %s"),[...t][0]):s?(0,m.sprintf)((0,m.__)("Some errors occurred while reverting the items: %s"),[...t].join(",")):(0,m.sprintf)((0,m.__)("Some errors occurred while deleting the items: %s"),[...t].join(","))}t.dispatch(fs.store).createErrorNotice(e,{type:"snackbar"})}};var $o=s(5215),Wo=s.n($o);const Ko=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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"})}),Zo=(0,T.jsx)(j.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,T.jsx)(j.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"})}),Yo=(0,T.jsxs)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,T.jsx)(j.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,T.jsx)(j.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"})]}),qo=(0,T.jsx)(j.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,T.jsx)(j.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 Qo=[];const Xo=function(e,t){var s,o,n=0;function i(){var i,r,a=s,l=arguments.length;e:for(;a;){if(a.args.length===arguments.length){for(r=0;r<l;r++)if(a.args[r]!==arguments[r]){a=a.next;continue e}return a!==s&&(a===o&&(o=a.prev),a.prev.next=a.next,a.next&&(a.next.prev=a.prev),a.next=s,a.prev=null,s.prev=a,s=a),a.val}a=a.next}for(i=new Array(l),r=0;r<l;r++)i[r]=arguments[r];return a={args:i,val:e.apply(null,i)},s?(s.prev=a,a.next=s):o=a,n===t.maxSize?(o=o.prev).next=null:n++,s=a,a.val}return t=t||{},i.clear=function(){s=null,o=null,n=0},i}((function(e=Qo,t){const s=t?t.reduce(((e,t)=>({...e,[t.id]:t})),{}):{},o=[],n=[...e];for(;n.length;){const{innerBlocks:e,...t}=n.shift();if(n.unshift(...e),(0,c.isTemplatePart)(t)){const{attributes:{theme:e,slug:n}}=t,i=s[`${e}//${n}`];i&&o.push({templatePart:i,block:t})}}return o})),Jo={rootClientId:void 0,insertionIndex:void 0,filterValue:void 0},en=(0,d.createRegistrySelector)((e=>(0,d.createSelector)((t=>{if("object"==typeof t.blockInserterPanel)return t.blockInserterPanel;if("template-locked"===ot(t)){const[t]=e(g.store).getBlocksByName("core/post-content");if(t)return{rootClientId:t,insertionIndex:void 0,filterValue:void 0}}return Jo}),(t=>{const[s]=e(g.store).getBlocksByName("core/post-content");return[t.blockInserterPanel,ot(t),s]}))));function tn(e){return e.listViewToggleRef}function sn(e){return e.inserterSidebarToggleRef}const on={wp_block:Ko,wp_navigation:Zo,page:Yo,post:qo},nn=(0,d.createRegistrySelector)((e=>(t,s,o)=>{{if("wp_template_part"===s||"wp_template"===s)return cs(t).find((e=>o.area===e.area))?.icon||E;if(on[s])return on[s];const n=e(b.store).getPostType(s);return n?.icon?.startsWith("dashicons-")?n.icon.slice(10):Yo}})),rn=(0,d.createRegistrySelector)((e=>()=>{const t=e(b.store).getEntityRecords("postType",F,{per_page:-1}),s=e(g.store).getBlocksByName("core/template-part"),o=e(g.store).getBlocksByClientId(s);return Xo(o,t)})),an=(0,d.createRegistrySelector)((e=>(t,s,o)=>{const{type:n,id:i}=ne(t),r=e(b.store).getEntityRecordNonTransientEdits("postType",s||n,o||i);if(!r?.meta)return!1;const a=e(b.store).getEntityRecord("postType",s||n,o||i)?.meta;return!Wo()({...a,footnotes:void 0},{...r.meta,footnotes:void 0})})),ln={reducer:v,selectors:e,actions:t},cn=(0,d.createReduxStore)("core/editor",{...ln});(0,d.register)(cn),h(cn).registerPrivateActions(n),h(cn).registerPrivateSelectors(i);const dn={name:"core/post-meta",label:(0,m._x)("Post Meta","block bindings source"),getPlaceholder:({args:e})=>e.key,getValue:({registry:e,context:t,args:s})=>e.select(b.store).getEditedEntityRecord("postType",t?.postType,t?.postId).meta?.[s.key],setValue({registry:e,context:t,args:s,value:o}){e.dispatch(b.store).editEntityRecord("postType",t?.postType,t?.postId,{meta:{[s.key]:o}})},canUserEditValue({select:e,context:t,args:s}){if(t?.query||t?.queryId)return!1;const o=t?.postType||e(cn).getCurrentPostType();if("wp_template"===o)return!1;if(!!!e(b.store).getEntityRecord("postType",o,t?.postId)?.meta?.[s.key])return!1;return!!e(b.store).canUserEditEntityRecord("postType",t?.postType,t?.postId)}},{registerBlockBindingsSource:un}=h((0,d.dispatch)(c.store));un(dn),un(f);const pn=window.wp.compose;function hn(e){const t=e.avatar_urls&&e.avatar_urls[24]?(0,T.jsx)("img",{className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls[24]}):(0,T.jsx)("span",{className:"editor-autocompleters__no-avatar"});return(0,T.jsxs)(T.Fragment,{children:[t,(0,T.jsx)("span",{className:"editor-autocompleters__user-name",children:e.name}),(0,T.jsx)("span",{className:"editor-autocompleters__user-slug",children:e.slug})]})}(0,bs.addFilter)("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",(function(e){var t;const s=Object.fromEntries(Object.entries(null!==(t=e.attributes)&&void 0!==t?t:{}).filter((([,{source:e}])=>"meta"===e)).map((([e,{meta:t}])=>[e,t])));return Object.entries(s).length&&(e.edit=(e=>(0,pn.createHigherOrderComponent)((t=>({attributes:s,setAttributes:o,...n})=>{const i=(0,d.useSelect)((e=>e(cn).getCurrentPostType()),[]),[r,a]=(0,b.useEntityProp)("postType",i,"meta"),l=(0,C.useMemo)((()=>({...s,...Object.fromEntries(Object.entries(e).map((([e,t])=>[e,r[t]])))})),[s,r]);return(0,T.jsx)(t,{attributes:l,setAttributes:t=>{const s=Object.fromEntries(Object.entries(null!=t?t:{}).filter((([t])=>t in e)).map((([t,s])=>[e[t],s])));Object.entries(s).length&&a(s),o(t)},...n})}),"withMetaAttributeSource"))(s)(e.edit)),e}));const mn={name:"users",className:"editor-autocompleters__user",triggerPrefix:"@",useItems(e){const t=(0,d.useSelect)((t=>{const{getUsers:s}=t(b.store);return s({context:"view",search:encodeURIComponent(e)})}),[e]),s=(0,C.useMemo)((()=>t?t.map((e=>({key:`user-${e.slug}`,value:e,label:hn(e)}))):[]),[t]);return[s]},getOptionCompletion:e=>`@${e.slug}`};(0,bs.addFilter)("editor.Autocomplete.completers","editor/autocompleters/set-default-completers",(function(e=[]){return e.push({...mn}),e}));const gn=window.wp.mediaUtils;(0,bs.addFilter)("editor.MediaUpload","core/editor/components/media-upload",(()=>gn.MediaUpload));const _n=window.wp.patterns,{PatternOverridesControls:fn,ResetOverridesControl:bn,PatternOverridesBlockControls:yn,PATTERN_TYPES:xn,PARTIAL_SYNCING_SUPPORTED_BLOCKS:vn,PATTERN_SYNC_TYPES:wn}=h(_n.privateApis),Sn=(0,pn.createHigherOrderComponent)((e=>t=>{const s=!!vn[t.name];return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(e,{...t}),t.isSelected&&s&&(0,T.jsx)(kn,{...t}),s&&(0,T.jsx)(yn,{})]})}),"withPatternOverrideControls");function kn(e){const t=(0,g.useBlockEditingMode)(),{hasPatternOverridesSource:s,isEditingSyncedPattern:o}=(0,d.useSelect)((e=>{const{getBlockBindingsSource:t}=h(e(c.store)),{getCurrentPostType:s,getEditedPostAttribute:o}=e(cn);return{hasPatternOverridesSource:!!t("core/pattern-overrides"),isEditingSyncedPattern:s()===xn.user&&o("meta")?.wp_pattern_sync_status!==wn.unsynced&&o("wp_pattern_sync_status")!==wn.unsynced}}),[]),n=e.attributes.metadata?.bindings,i=!!n&&Object.values(n).some((e=>"core/pattern-overrides"===e.source)),r=o&&"default"===t,a=!o&&!!e.attributes.metadata?.name&&"disabled"!==t&&i;return s?(0,T.jsxs)(T.Fragment,{children:[r&&(0,T.jsx)(fn,{...e}),a&&(0,T.jsx)(bn,{...e})]}):null}(0,bs.addFilter)("editor.BlockEdit","core/editor/with-pattern-override-controls",Sn);const Pn=window.wp.keyboardShortcuts;function Cn(e){var t,s,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(s=Cn(e[t]))&&(o&&(o+=" "),o+=s)}else for(s in e)e[s]&&(o&&(o+=" "),o+=s);return o}const jn=function(){for(var e,t,s=0,o="",n=arguments.length;s<n;s++)(e=arguments[s])&&(t=Cn(e))&&(o&&(o+=" "),o+=t);return o},Tn=window.wp.components,En=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})}),Bn=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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"})}),In=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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"})}),Nn=window.wp.viewport,An=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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 Dn(e){return["core/edit-post","core/edit-site"].includes(e)?(P()(`${e} interface scope`,{alternative:"core interface scope",hint:"core/edit-post and core/edit-site are merging.",version:"6.6"}),"core"):e}function Rn(e,t){return"core"===e&&"edit-site/template"===t?(P()("edit-site/template sidebar",{alternative:"edit-post/document",version:"6.6"}),"edit-post/document"):"core"===e&&"edit-site/block-inspector"===t?(P()("edit-site/block-inspector sidebar",{alternative:"edit-post/block",version:"6.6"}),"edit-post/block"):t}const Mn=(e,t)=>({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e=Dn(e),area:t=Rn(e,t)}),On=(e,t)=>({registry:s,dispatch:o})=>{if(!t)return;e=Dn(e),t=Rn(e,t);s.select(B.store).get(e,"isComplementaryAreaVisible")||s.dispatch(B.store).set(e,"isComplementaryAreaVisible",!0),o({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},Ln=e=>({registry:t})=>{e=Dn(e);t.select(B.store).get(e,"isComplementaryAreaVisible")&&t.dispatch(B.store).set(e,"isComplementaryAreaVisible",!1)},Fn=(e,t)=>({registry:s})=>{if(!t)return;e=Dn(e),t=Rn(e,t);const o=s.select(B.store).get(e,"pinnedItems");!0!==o?.[t]&&s.dispatch(B.store).set(e,"pinnedItems",{...o,[t]:!0})},Vn=(e,t)=>({registry:s})=>{if(!t)return;e=Dn(e),t=Rn(e,t);const o=s.select(B.store).get(e,"pinnedItems");s.dispatch(B.store).set(e,"pinnedItems",{...o,[t]:!1})};function Un(e,t){return function({registry:s}){P()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),s.dispatch(B.store).toggle(e,t)}}function zn(e,t,s){return function({registry:o}){P()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),o.dispatch(B.store).set(e,t,!!s)}}function Hn(e,t){return function({registry:s}){P()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),s.dispatch(B.store).setDefaults(e,t)}}function Gn(e){return{type:"OPEN_MODAL",name:e}}function $n(){return{type:"CLOSE_MODAL"}}const Wn=(0,d.createRegistrySelector)((e=>(t,s)=>{s=Dn(s);const o=e(B.store).get(s,"isComplementaryAreaVisible");if(void 0!==o)return!1===o?null:t?.complementaryAreas?.[s]})),Kn=(0,d.createRegistrySelector)((e=>(t,s)=>{s=Dn(s);const o=e(B.store).get(s,"isComplementaryAreaVisible"),n=t?.complementaryAreas?.[s];return o&&void 0===n})),Zn=(0,d.createRegistrySelector)((e=>(t,s,o)=>{var n;o=Rn(s=Dn(s),o);const i=e(B.store).get(s,"pinnedItems");return null===(n=i?.[o])||void 0===n||n})),Yn=(0,d.createRegistrySelector)((e=>(t,s,o)=>(P()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(B.store).get(s,o))));function qn(e,t){return e.activeModal===t}const Qn=(0,d.combineReducers)({complementaryAreas:function(e={},t){switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:s,area:o}=t;return e[s]?e:{...e,[s]:o}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:s,area:o}=t;return{...e,[s]:o}}}return e},activeModal:function(e=null,t){switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e}}),Xn=(0,d.createReduxStore)("core/interface",{reducer:Qn,actions:r,selectors:a});(0,d.register)(Xn);const Jn=window.wp.plugins,ei=(0,Jn.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`})));const ti=ei((function({as:e=Tn.Button,scope:t,identifier:s,icon:o,selectedIcon:n,name:i,...r}){const a=e,l=(0,d.useSelect)((e=>e(Xn).getActiveComplementaryArea(t)===s),[s,t]),{enableComplementaryArea:c,disableComplementaryArea:u}=(0,d.useDispatch)(Xn);return(0,T.jsx)(a,{icon:n&&l?n:o,"aria-controls":s.replace("/",":"),onClick:()=>{l?u(t):c(t,s)},...r})})),si=({smallScreenTitle:e,children:t,className:s,toggleButtonProps:o})=>{const n=(0,T.jsx)(ti,{icon:An,...o});return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)("div",{className:"components-panel__header interface-complementary-area-header__small",children:[e&&(0,T.jsx)("h2",{className:"interface-complementary-area-header__small-title",children:e}),n]}),(0,T.jsxs)("div",{className:jn("components-panel__header","interface-complementary-area-header",s),tabIndex:-1,children:[t,n]})]})},oi=()=>{};function ni({name:e,as:t=Tn.Button,onClick:s,...o}){return(0,T.jsx)(Tn.Fill,{name:e,children:({onClick:e})=>(0,T.jsx)(t,{onClick:s||e?(...t)=>{(s||oi)(...t),(e||oi)(...t)}:void 0,...o})})}ni.Slot=function({name:e,as:t=Tn.ButtonGroup,fillProps:s={},bubblesVirtually:o,...n}){return(0,T.jsx)(Tn.Slot,{name:e,bubblesVirtually:o,fillProps:s,children:e=>{if(!C.Children.toArray(e).length)return null;const s=[];C.Children.forEach(e,(({props:{__unstableExplicitMenuItem:e,__unstableTarget:t}})=>{t&&e&&s.push(t)}));const o=C.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&s.includes(e.props.__unstableTarget)?null:e));return(0,T.jsx)(t,{...n,children:o})}})};const ii=ni,ri=({__unstableExplicitMenuItem:e,__unstableTarget:t,...s})=>(0,T.jsx)(Tn.MenuItem,{...s});function ai({scope:e,target:t,__unstableExplicitMenuItem:s,...o}){return(0,T.jsx)(ti,{as:o=>(0,T.jsx)(ii,{__unstableExplicitMenuItem:s,__unstableTarget:`${e}/${t}`,as:ri,name:`${e}/plugin-more-menu`,...o}),role:"menuitemcheckbox",selectedIcon:En,name:t,scope:e,...o})}function li({scope:e,...t}){return(0,T.jsx)(Tn.Fill,{name:`PinnedItems/${e}`,...t})}li.Slot=function({scope:e,className:t,...s}){return(0,T.jsx)(Tn.Slot,{name:`PinnedItems/${e}`,...s,children:e=>e?.length>0&&(0,T.jsx)("div",{className:jn(t,"interface-pinned-items"),children:e})})};const ci=li,di=.3;const ui=280,pi={open:{width:ui},closed:{width:0},mobileOpen:{width:"100vw"}};function hi({activeArea:e,isActive:t,scope:s,children:o,className:n,id:i}){const r=(0,pn.useReducedMotion)(),a=(0,pn.useViewportMatch)("medium","<"),l=(0,pn.usePrevious)(e),c=(0,pn.usePrevious)(t),[,d]=(0,C.useState)({});(0,C.useEffect)((()=>{d({})}),[t]);const u={type:"tween",duration:r||a||l&&e&&e!==l?0:di,ease:[.6,0,.4,1]};return(0,T.jsx)(Tn.Fill,{name:`ComplementaryArea/${s}`,children:(0,T.jsx)(Tn.__unstableAnimatePresence,{initial:!1,children:(c||t)&&(0,T.jsx)(Tn.__unstableMotion.div,{variants:pi,initial:"closed",animate:a?"mobileOpen":"open",exit:"closed",transition:u,className:"interface-complementary-area__fill",children:(0,T.jsx)("div",{id:i,className:n,style:{width:a?"100vw":ui},children:o})})})})}const mi=ei((function({children:e,className:t,closeLabel:s=(0,m.__)("Close plugin"),identifier:o,header:n,headerClassName:i,icon:r,isPinnable:a=!0,panelClassName:l,scope:c,name:u,smallScreenTitle:p,title:h,toggleShortcut:g,isActiveByDefault:_}){const[f,b]=(0,C.useState)(!1),{isLoading:y,isActive:x,isPinned:v,activeArea:w,isSmall:S,isLarge:k,showIconLabels:P}=(0,d.useSelect)((e=>{const{getActiveComplementaryArea:t,isComplementaryAreaLoading:s,isItemPinned:n}=e(Xn),{get:i}=e(B.store),r=t(c);return{isLoading:s(c),isActive:r===o,isPinned:n(c,o),activeArea:r,isSmall:e(Nn.store).isViewportMatch("< medium"),isLarge:e(Nn.store).isViewportMatch("large"),showIconLabels:i("core","showIconLabels")}}),[o,c]);!function(e,t,s,o,n){const i=(0,C.useRef)(!1),r=(0,C.useRef)(!1),{enableComplementaryArea:a,disableComplementaryArea:l}=(0,d.useDispatch)(Xn);(0,C.useEffect)((()=>{o&&n&&!i.current?(l(e),r.current=!0):r.current&&!n&&i.current?(r.current=!1,a(e,t)):r.current&&s&&s!==t&&(r.current=!1),n!==i.current&&(i.current=n)}),[o,n,e,t,s,l,a])}(c,o,w,x,S);const{enableComplementaryArea:j,disableComplementaryArea:E,pinItem:I,unpinItem:N}=(0,d.useDispatch)(Xn);if((0,C.useEffect)((()=>{_&&void 0===w&&!S?j(c,o):void 0===w&&S&&E(c,o),b(!0)}),[w,_,c,o,S,j,E]),f)return(0,T.jsxs)(T.Fragment,{children:[a&&(0,T.jsx)(ci,{scope:c,children:v&&(0,T.jsx)(ti,{scope:c,identifier:o,isPressed:x&&(!P||k),"aria-expanded":x,"aria-disabled":y,label:h,icon:P?En:r,showTooltip:!P,variant:P?"tertiary":void 0,size:"compact"})}),u&&a&&(0,T.jsx)(ai,{target:u,scope:c,icon:r,children:h}),(0,T.jsxs)(hi,{activeArea:w,isActive:x,className:jn("interface-complementary-area",t),scope:c,id:o.replace("/",":"),children:[(0,T.jsx)(si,{className:i,closeLabel:s,onClose:()=>E(c),smallScreenTitle:p,toggleButtonProps:{label:s,size:"small",shortcut:g,scope:c,identifier:o},children:n||(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("h2",{className:"interface-complementary-area-header__title",children:h}),a&&(0,T.jsx)(Tn.Button,{className:"interface-complementary-area__pin-unpin-item",icon:v?Bn:In,label:v?(0,m.__)("Unpin from toolbar"):(0,m.__)("Pin to toolbar"),onClick:()=>(v?N:I)(c,o),isPressed:v,"aria-expanded":v,size:"compact"})]})}),(0,T.jsx)(Tn.Panel,{className:l,children:e})]})]})}));mi.Slot=function({scope:e,...t}){return(0,T.jsx)(Tn.Slot,{name:`ComplementaryArea/${e}`,...t})};const gi=mi,_i=({isActive:e})=>((0,C.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,C.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);function fi({children:e,className:t,ariaLabel:s,as:o="div",...n}){return(0,T.jsx)(o,{className:jn("interface-navigable-region",t),"aria-label":s,role:"region",tabIndex:"-1",...n,children:e})}const bi={type:"tween",duration:.25,ease:[.6,0,.4,1]};const yi={hidden:{opacity:1,marginTop:-60},visible:{opacity:1,marginTop:0},distractionFreeHover:{opacity:1,marginTop:0,transition:{...bi,delay:.2,delayChildren:.2}},distractionFreeHidden:{opacity:0,marginTop:-60},distractionFreeDisabled:{opacity:0,marginTop:0,transition:{...bi,delay:.8,delayChildren:.8}}};const xi=(0,C.forwardRef)((function({isDistractionFree:e,footer:t,header:s,editorNotices:o,sidebar:n,secondarySidebar:i,content:r,actions:a,labels:l,className:c,enableRegionNavigation:d=!0,shortcuts:u},p){const[h,g]=(0,pn.useResizeObserver)(),_=(0,pn.useViewportMatch)("medium","<"),f={type:"tween",duration:(0,pn.useReducedMotion)()?0:.25,ease:[.6,0,.4,1]},b=(0,Tn.__unstableUseNavigateRegions)(u);!function(e){(0,C.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 y={...{header:(0,m._x)("Header","header landmark area"),body:(0,m.__)("Content"),secondarySidebar:(0,m.__)("Block Library"),sidebar:(0,m.__)("Settings"),actions:(0,m.__)("Publish"),footer:(0,m.__)("Footer")},...l};return(0,T.jsxs)("div",{...d?b:{},ref:(0,pn.useMergeRefs)([p,d?b.ref:void 0]),className:jn(c,"interface-interface-skeleton",b.className,!!t&&"has-footer"),children:[(0,T.jsxs)("div",{className:"interface-interface-skeleton__editor",children:[(0,T.jsx)(Tn.__unstableAnimatePresence,{initial:!1,children:!!s&&(0,T.jsx)(fi,{as:Tn.__unstableMotion.div,className:"interface-interface-skeleton__header","aria-label":y.header,initial:e?"distractionFreeHidden":"hidden",whileHover:e?"distractionFreeHover":"visible",animate:e?"distractionFreeDisabled":"visible",exit:e?"distractionFreeHidden":"hidden",variants:yi,transition:f,children:s})}),e&&(0,T.jsx)("div",{className:"interface-interface-skeleton__header",children:o}),(0,T.jsxs)("div",{className:"interface-interface-skeleton__body",children:[(0,T.jsx)(Tn.__unstableAnimatePresence,{initial:!1,children:!!i&&(0,T.jsx)(fi,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:y.secondarySidebar,as:Tn.__unstableMotion.div,initial:"closed",animate:_?"mobileOpen":"open",exit:"closed",variants:{open:{width:g.width},closed:{width:0},mobileOpen:{width:"100vw"}},transition:f,children:(0,T.jsxs)("div",{style:{position:"absolute",width:_?"100vw":"fit-content",height:"100%",right:0},children:[h,i]})})}),(0,T.jsx)(fi,{className:"interface-interface-skeleton__content",ariaLabel:y.body,children:r}),!!n&&(0,T.jsx)(fi,{className:"interface-interface-skeleton__sidebar",ariaLabel:y.sidebar,children:n}),!!a&&(0,T.jsx)(fi,{className:"interface-interface-skeleton__actions",ariaLabel:y.actions,children:a})]})]}),!!t&&(0,T.jsx)(fi,{className:"interface-interface-skeleton__footer",ariaLabel:y.footer,children:t})]})}));function vi(){const e=(0,d.useSelect)((e=>{const{richEditingEnabled:t,codeEditingEnabled:s}=e(cn).getEditorSettings();return!t||!s}),[]),{getBlockSelectionStart:t}=(0,d.useSelect)(g.store),{getActiveComplementaryArea:s}=(0,d.useSelect)(Xn),{enableComplementaryArea:o,disableComplementaryArea:n}=(0,d.useDispatch)(Xn),{redo:i,undo:r,savePost:a,setIsListViewOpened:l,switchEditorMode:c,toggleDistractionFree:u}=(0,d.useDispatch)(cn),{isEditedPostDirty:p,isPostSavingLocked:h,isListViewOpened:m,getEditorMode:_}=(0,d.useSelect)(cn);return(0,Pn.useShortcut)("core/editor/toggle-mode",(()=>{c("visual"===_()?"text":"visual")}),{isDisabled:e}),(0,Pn.useShortcut)("core/editor/toggle-distraction-free",(()=>{u()})),(0,Pn.useShortcut)("core/editor/undo",(e=>{r(),e.preventDefault()})),(0,Pn.useShortcut)("core/editor/redo",(e=>{i(),e.preventDefault()})),(0,Pn.useShortcut)("core/editor/save",(e=>{e.preventDefault(),h()||p()&&a()})),(0,Pn.useShortcut)("core/editor/toggle-list-view",(e=>{m()||(e.preventDefault(),l(!0))})),(0,Pn.useShortcut)("core/editor/toggle-sidebar",(e=>{e.preventDefault();if(["edit-post/document","edit-post/block"].includes(s("core")))n("core");else{const e=t()?"edit-post/block":"edit-post/document";o("core",e)}})),null}class wi extends C.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}}const Si=(0,pn.compose)([(0,d.withSelect)(((e,t)=>{const{getReferenceByDistinctEdits:s}=e(b.store),{isEditedPostDirty:o,isEditedPostAutosaveable:n,isAutosavingPost:i,getEditorSettings:r}=e(cn),{interval:a=r().autosaveInterval}=t;return{editsReference:s(),isDirty:o(),isAutosaveable:n(),isAutosaving:i(),interval:a}})),(0,d.withDispatch)(((e,t)=>({autosave(){const{autosave:s=e(cn).autosave}=t;s()}})))])(wi),ki=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})}),Pi=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})}),Ci=window.wp.keycodes,ji=window.wp.commands,Ti={wp_pattern:(0,m.__)("Editing pattern: %s"),wp_navigation:(0,m.__)("Editing navigation menu: %s"),wp_template:(0,m.__)("Editing template: %s"),wp_template_part:(0,m.__)("Editing template part: %s")},Ei=(0,Tn.__unstableMotion)(Tn.Button);function Bi(){const{postType:e,documentTitle:t,isNotFound:s,isUnsyncedPattern:o,templateIcon:n,templateTitle:i,onNavigateToPreviousEntityRecord:r}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s,getEditorSettings:o,__experimentalGetTemplateInfo:n}=e(cn),{getEditedEntityRecord:i,isResolving:r}=e(b.store),a=t(),l=s(),c=i("postType",a,l),d=n(c);return{postType:a,documentTitle:c.title,isNotFound:!c&&!r("getEditedEntityRecord","postType",a,l),isUnsyncedPattern:"unsynced"===c?.wp_pattern_sync_status,templateIcon:h(e(cn)).getPostIcon(a,{area:c?.area}),templateTitle:d.title,onNavigateToPreviousEntityRecord:o().onNavigateToPreviousEntityRecord}}),[]),{open:a}=(0,d.useDispatch)(ji.store),l=(0,pn.useReducedMotion)(),c=H.includes(e),u=G.includes(e),p=!!r,_=c?i:t,f=(0,C.useRef)(!1);return(0,C.useEffect)((()=>{f.current=!0}),[]),(0,T.jsxs)("div",{className:jn("editor-document-bar",{"has-back-button":p,"is-global":u&&!o}),children:[(0,T.jsx)(Tn.__unstableAnimatePresence,{children:p&&(0,T.jsx)(Ei,{className:"editor-document-bar__back",icon:(0,m.isRTL)()?ki:Pi,onClick:e=>{e.stopPropagation(),r()},size:"compact",initial:!!f.current&&{opacity:0,transform:"translateX(15%)"},animate:{opacity:1,transform:"translateX(0%)"},exit:{opacity:0,transform:"translateX(15%)"},transition:l?{duration:0}:void 0,children:(0,m.__)("Back")})}),s?(0,T.jsx)(Tn.__experimentalText,{children:(0,m.__)("Document not found")}):(0,T.jsxs)(Tn.Button,{className:"editor-document-bar__command",onClick:()=>a(),size:"compact",children:[(0,T.jsxs)(Tn.__unstableMotion.div,{className:"editor-document-bar__title",initial:!!f.current&&{opacity:0,transform:p?"translateX(15%)":"translateX(-15%)"},animate:{opacity:1,transform:"translateX(0%)"},transition:l?{duration:0}:void 0,children:[(0,T.jsx)(g.BlockIcon,{icon:n}),(0,T.jsx)(Tn.__experimentalText,{size:"body",as:"h1","aria-label":Ti[e]?(0,m.sprintf)(Ti[e],_):void 0,children:_?(0,Mo.decodeEntities)(_):(0,m.__)("No Title")})]},p),(0,T.jsx)("span",{className:"editor-document-bar__shortcut",children:Ci.displayShortcut.primary("k")})]})]})}const Ii=window.wp.richText,Ni=({children:e,isValid:t,level:s,href:o,onSelect:n})=>(0,T.jsx)("li",{className:jn("document-outline__item",`is-${s.toLowerCase()}`,{"is-invalid":!t}),children:(0,T.jsxs)("a",{href:o,className:"document-outline__button",onClick:n,children:[(0,T.jsx)("span",{className:"document-outline__emdash","aria-hidden":"true"}),(0,T.jsx)("strong",{className:"document-outline__level",children:s}),(0,T.jsx)("span",{className:"document-outline__item-content",children:e})]})}),Ai=(0,T.jsx)("em",{children:(0,m.__)("(Empty heading)")}),Di=[(0,T.jsx)("br",{},"incorrect-break"),(0,T.jsx)("em",{children:(0,m.__)("(Incorrect heading level)")},"incorrect-message")],Ri=[(0,T.jsx)("br",{},"incorrect-break-h1"),(0,T.jsx)("em",{children:(0,m.__)("(Your theme may already use a H1 for the post title)")},"incorrect-message-h1")],Mi=[(0,T.jsx)("br",{},"incorrect-break-multiple-h1"),(0,T.jsx)("em",{children:(0,m.__)("(Multiple H1 headings are not recommended)")},"incorrect-message-multiple-h1")];function Oi(){return(0,T.jsxs)(Tn.SVG,{width:"138",height:"148",viewBox:"0 0 138 148",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,T.jsx)(Tn.Rect,{width:"138",height:"148",rx:"4",fill:"#F0F6FC"}),(0,T.jsx)(Tn.Line,{x1:"44",y1:"28",x2:"24",y2:"28",stroke:"#DDDDDD"}),(0,T.jsx)(Tn.Rect,{x:"48",y:"16",width:"27",height:"23",rx:"4",fill:"#DDDDDD"}),(0,T.jsx)(Tn.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,T.jsx)(Tn.Line,{x1:"55",y1:"59",x2:"24",y2:"59",stroke:"#DDDDDD"}),(0,T.jsx)(Tn.Rect,{x:"59",y:"47",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,T.jsx)(Tn.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,T.jsx)(Tn.Line,{x1:"80",y1:"90",x2:"24",y2:"90",stroke:"#DDDDDD"}),(0,T.jsx)(Tn.Rect,{x:"84",y:"78",width:"30",height:"23",rx:"4",fill:"#F0B849"}),(0,T.jsx)(Tn.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,T.jsx)(Tn.Line,{x1:"66",y1:"121",x2:"24",y2:"121",stroke:"#DDDDDD"}),(0,T.jsx)(Tn.Rect,{x:"70",y:"109",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,T.jsx)(Tn.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 Li=(e=[])=>e.flatMap(((e={})=>"core/heading"===e.name?{...e,level:e.attributes.level,isEmpty:Fi(e)}:Li(e.innerBlocks))),Fi=e=>!e.attributes.content||0===e.attributes.content.trim().length;function Vi({onSelect:e,isTitleSupported:t,hasOutlineItemsDisabled:s}){const{selectBlock:o}=(0,d.useDispatch)(g.store),{blocks:n,title:i}=(0,d.useSelect)((e=>{var t;const{getBlocks:s}=e(g.store),{getEditedPostAttribute:o}=e(cn),{getPostType:n}=e(b.store),i=n(o("type"));return{title:o("title"),blocks:s(),isTitleSupported:null!==(t=i?.supports?.title)&&void 0!==t&&t}})),r=Li(n);if(r.length<1)return(0,T.jsxs)("div",{className:"editor-document-outline has-no-headings",children:[(0,T.jsx)(Oi,{}),(0,T.jsx)("p",{children:(0,m.__)("Navigate the structure of your document and address issues like empty or incorrect heading levels.")})]});let a=1;const l=document.querySelector(".editor-post-title__input"),c=t&&i&&l,u=r.reduce(((e,t)=>({...e,[t.level]:(e[t.level]||0)+1})),{})[1]>1;return(0,T.jsx)("div",{className:"document-outline",children:(0,T.jsxs)("ul",{children:[c&&(0,T.jsx)(Ni,{level:(0,m.__)("Title"),isValid:!0,onSelect:e,href:`#${l.id}`,isDisabled:s,children:i}),r.map(((t,n)=>{const i=t.level>a+1,r=!(t.isEmpty||i||!t.level||1===t.level&&(u||c));return a=t.level,(0,T.jsxs)(Ni,{level:`H${t.level}`,isValid:r,isDisabled:s,href:`#block-${t.clientId}`,onSelect:()=>{o(t.clientId),e?.()},children:[t.isEmpty?Ai:(0,Ii.getTextContent)((0,Ii.create)({html:t.attributes.content})),i&&Di,1===t.level&&u&&Mi,c&&1===t.level&&!u&&Ri]},n)}))]})})}function Ui({children:e}){const t=(0,d.useSelect)((e=>{const{getGlobalBlockCount:t}=e(g.store);return t("core/heading")>0}));return t?null:e}const zi=function(){const{registerShortcut:e}=(0,d.useDispatch)(Pn.store);return(0,C.useEffect)((()=>{e({name:"core/editor/toggle-mode",category:"global",description:(0,m.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}}),e({name:"core/editor/save",category:"global",description:(0,m.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/editor/undo",category:"global",description:(0,m.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/editor/redo",category:"global",description:(0,m.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,Ci.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/editor/toggle-list-view",category:"global",description:(0,m.__)("Open the List View."),keyCombination:{modifier:"access",character:"o"}}),e({name:"core/editor/toggle-distraction-free",category:"global",description:(0,m.__)("Toggle distraction free mode."),keyCombination:{modifier:"primaryShift",character:"\\"}}),e({name:"core/editor/toggle-sidebar",category:"global",description:(0,m.__)("Show or hide the Settings sidebar."),keyCombination:{modifier:"primaryShift",character:","}}),e({name:"core/editor/keyboard-shortcuts",category:"main",description:(0,m.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/editor/next-region",category:"global",description:(0,m.__)("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,m.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]})}),[e]),(0,T.jsx)(g.BlockEditorKeyboardShortcuts.Register,{})},Hi=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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"})}),Gi=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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"})});const $i=(0,C.forwardRef)((function(e,t){const s=(0,Ci.isAppleOS)()?Ci.displayShortcut.primaryShift("z"):Ci.displayShortcut.primary("y"),o=(0,d.useSelect)((e=>e(cn).hasEditorRedo()),[]),{redo:n}=(0,d.useDispatch)(cn);return(0,T.jsx)(Tn.Button,{...e,ref:t,icon:(0,m.isRTL)()?Gi:Hi,label:(0,m.__)("Redo"),shortcut:s,"aria-disabled":!o,onClick:o?n:void 0,className:"editor-history__redo"})}));const Wi=(0,C.forwardRef)((function(e,t){const s=(0,d.useSelect)((e=>e(cn).hasEditorUndo()),[]),{undo:o}=(0,d.useDispatch)(cn);return(0,T.jsx)(Tn.Button,{...e,ref:t,icon:(0,m.isRTL)()?Hi:Gi,label:(0,m.__)("Undo"),shortcut:Ci.displayShortcut.primary("z"),"aria-disabled":!s,onClick:s?o:void 0,className:"editor-history__undo"})}));function Ki(){const[e,t]=(0,C.useState)(!1),s=(0,d.useSelect)((e=>e(g.store).isValidTemplate()),[]),{setTemplateValidity:o,synchronizeTemplate:n}=(0,d.useDispatch)(g.store);return s?null:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Tn.Notice,{className:"editor-template-validation-notice",isDismissible:!1,status:"warning",actions:[{label:(0,m.__)("Keep it as is"),onClick:()=>o(!0)},{label:(0,m.__)("Reset the template"),onClick:()=>t(!0)}],children:(0,m.__)("The content of your post doesn’t match the template assigned to your post type.")}),(0,T.jsx)(Tn.__experimentalConfirmDialog,{isOpen:e,confirmButtonText:(0,m.__)("Reset"),onConfirm:()=>{t(!1),n()},onCancel:()=>t(!1),size:"medium",children:(0,m.__)("Resetting the template may result in loss of content, do you want to continue?")})]})}const Zi=function(){const{notices:e}=(0,d.useSelect)((e=>({notices:e(fs.store).getNotices()})),[]),{removeNotice:t}=(0,d.useDispatch)(fs.store),s=e.filter((({isDismissible:e,type:t})=>e&&"default"===t)),o=e.filter((({isDismissible:e,type:t})=>!e&&"default"===t));return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Tn.NoticeList,{notices:o,className:"components-editor-notices__pinned"}),(0,T.jsx)(Tn.NoticeList,{notices:s,className:"components-editor-notices__dismissible",onRemove:t,children:(0,T.jsx)(Ki,{})})]})},Yi=-3;function qi(){const e=(0,d.useSelect)((e=>e(fs.store).getNotices()),[]),{removeNotice:t}=(0,d.useDispatch)(fs.store),s=e.filter((({type:e})=>"snackbar"===e)).slice(Yi);return(0,T.jsx)(Tn.SnackbarList,{notices:s,className:"components-editor-notices__snackbar",onRemove:t})}function Qi({record:e,checked:t,onChange:s}){const{name:o,kind:n,title:i,key:r}=e,{entityRecordTitle:a,hasPostMetaChanges:l}=(0,d.useSelect)((e=>{if("postType"!==n||"wp_template"!==o)return{entityRecordTitle:i,hasPostMetaChanges:h(e(cn)).hasPostMetaChanges(o,r)};const t=e(b.store).getEditedEntityRecord(n,o,r);return{entityRecordTitle:e(cn).__experimentalGetTemplateInfo(t).title,hasPostMetaChanges:h(e(cn)).hasPostMetaChanges(o,r)}}),[o,n,i,r]);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Tn.PanelRow,{children:(0,T.jsx)(Tn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,Mo.decodeEntities)(a)||(0,m.__)("Untitled"),checked:t,onChange:s})}),l&&(0,T.jsx)("ul",{className:"entities-saved-states__changes",children:(0,T.jsx)("li",{children:(0,m.__)("Post Meta.")})})]})}const{getGlobalStylesChanges:Xi,GlobalStylesContext:Ji}=h(g.privateApis);function er({record:e}){const{user:t}=(0,C.useContext)(Ji),s=(0,d.useSelect)((t=>t(b.store).getEntityRecord(e.kind,e.name,e.key)),[e.kind,e.name,e.key]),o=Xi(t,s,{maxResults:10});return o.length?(0,T.jsx)("ul",{className:"entities-saved-states__changes",children:o.map((e=>(0,T.jsx)("li",{children:e},e)))}):null}function tr({record:e,count:t}){if("globalStyles"===e?.name)return null;const s=function(e,t){switch(e){case"site":return 1===t?(0,m.__)("This change will affect your whole site."):(0,m.__)("These changes will affect your whole site.");case"wp_template":return(0,m.__)("This change will affect pages and posts that use this template.");case"page":case"post":return(0,m.__)("The following has been modified.")}}(e?.name,t);return s?(0,T.jsx)(Tn.PanelRow,{children:s}):null}function sr({list:e,unselectedEntities:t,setUnselectedEntities:s}){const o=e.length,n=e[0];let i=(0,d.useSelect)((e=>e(b.store).getEntityConfig(n.kind,n.name)),[n.kind,n.name]).label;return"wp_template_part"===n?.name&&(i=1===o?(0,m.__)("Template Part"):(0,m.__)("Template Parts")),(0,T.jsxs)(Tn.PanelBody,{title:i,initialOpen:!0,children:[(0,T.jsx)(tr,{record:n,count:o}),e.map((e=>(0,T.jsx)(Qi,{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"===n?.name&&(0,T.jsx)(er,{record:n})]})}const or=()=>{const{editedEntities:e,siteEdits:t,siteEntityConfig:s}=(0,d.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,getEntityRecordEdits:s,getEntityConfig:o}=e(b.store);return{editedEntities:t(),siteEdits:s("root","site"),siteEntityConfig:o("root","site")}}),[]),o=(0,C.useMemo)((()=>{var o;const n=e.filter((e=>!("root"===e.kind&&"site"===e.name))),i=null!==(o=s?.meta?.labels)&&void 0!==o?o:{},r=[];for(const e in t)r.push({kind:"root",name:"site",title:i[e]||e,property:e});return[...n,...r]}),[e,t,s]),[n,i]=(0,C.useState)([]);return{dirtyEntityRecords:o,isDirty:o.length-n.length>0,setUnselectedEntities:({kind:e,name:t,key:s,property:o},r)=>{i(r?n.filter((n=>n.kind!==e||n.name!==t||n.key!==s||n.property!==o)):[...n,{kind:e,name:t,key:s,property:o}])},unselectedEntities:n}};function nr(e){return e}function ir({close:e,renderDialog:t}){const s=or();return(0,T.jsx)(rr,{close:e,renderDialog:t,...s})}function rr({additionalPrompt:e,close:t,onSave:s=nr,saveEnabled:o,saveLabel:n=(0,m.__)("Save"),renderDialog:i,dirtyEntityRecords:r,isDirty:a,setUnselectedEntities:l,unselectedEntities:c}){const u=(0,C.useRef)(),{saveDirtyEntities:p}=h((0,d.useDispatch)(cn)),g=r.reduce(((e,t)=>{const{name:s}=t;return e[s]||(e[s]=[]),e[s].push(t),e}),{}),{site:_,wp_template:f,wp_template_part:b,...y}=g,x=[_,f,b,...Object.values(y)].filter(Array.isArray),v=null!=o?o:a,w=(0,C.useCallback)((()=>t()),[t]),[S,k]=(0,pn.__experimentalUseDialog)({onClose:()=>w()}),P=(0,pn.useInstanceId)(rr,"label"),j=(0,pn.useInstanceId)(rr,"description");return(0,T.jsxs)("div",{ref:S,...k,className:"entities-saved-states__panel",role:i?"dialog":void 0,"aria-labelledby":i?P:void 0,"aria-describedby":i?j:void 0,children:[(0,T.jsxs)(Tn.Flex,{className:"entities-saved-states__panel-header",gap:2,children:[(0,T.jsx)(Tn.FlexItem,{isBlock:!0,as:Tn.Button,ref:u,variant:"primary",disabled:!v,__experimentalIsFocusable:!0,onClick:()=>p({onSave:s,dirtyEntityRecords:r,entitiesToSkip:c,close:t}),className:"editor-entities-saved-states__save-button",children:n}),(0,T.jsx)(Tn.FlexItem,{isBlock:!0,as:Tn.Button,variant:"secondary",onClick:w,children:(0,m.__)("Cancel")})]}),(0,T.jsxs)("div",{className:"entities-saved-states__text-prompt",children:[(0,T.jsxs)("div",{className:"entities-saved-states__text-prompt--header-wrapper",id:i?P:void 0,children:[(0,T.jsx)("strong",{className:"entities-saved-states__text-prompt--header",children:(0,m.__)("Are you ready to save?")}),e]}),(0,T.jsx)("p",{id:i?j:void 0,children:a?(0,C.createInterpolateElement)((0,m.sprintf)((0,m._n)("There is <strong>%d site change</strong> waiting to be saved.","There are <strong>%d site changes</strong> waiting to be saved.",x.length),x.length),{strong:(0,T.jsx)("strong",{})}):(0,m.__)("Select the items you want to save.")})]}),x.map((e=>(0,T.jsx)(sr,{list:e,unselectedEntities:c,setUnselectedEntities:l},e[0].name)))]})}function ar(){try{return(0,d.select)(cn).getEditedPostContent()}catch(e){}}function lr({text:e,children:t}){const s=(0,pn.useCopyToClipboard)(e);return(0,T.jsx)(Tn.Button,{variant:"secondary",ref:s,children:t})}class cr extends C.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){(0,bs.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}render(){const{error:e}=this.state;if(!e)return this.props.children;const t=[(0,T.jsx)(lr,{text:ar,children:(0,m.__)("Copy Post Text")},"copy-post"),(0,T.jsx)(lr,{text:e.stack,children:(0,m.__)("Copy Error")},"copy-error")];return(0,T.jsx)(g.Warning,{className:"editor-error-boundary",actions:t,children:(0,m.__)("The editor has encountered an unexpected error.")})}}const dr=cr,ur=window.requestIdleCallback?window.requestIdleCallback:window.requestAnimationFrame;let pr;function hr(){const{postId:e,isEditedPostNew:t,hasRemoteAutosave:s}=(0,d.useSelect)((e=>({postId:e(cn).getCurrentPostId(),isEditedPostNew:e(cn).isEditedPostNew(),hasRemoteAutosave:!!e(cn).getEditorSettings().autosave})),[]),{getEditedPostAttribute:o}=(0,d.useSelect)(cn),{createWarningNotice:n,removeNotice:i}=(0,d.useDispatch)(fs.store),{editPost:r,resetEditorBlocks:a}=(0,d.useDispatch)(cn);(0,C.useEffect)((()=>{let l=function(e,t){return window.sessionStorage.getItem(ys(e,t))}(e,t);if(!l)return;try{l=JSON.parse(l)}catch{return}const{post_title:d,content:u,excerpt:p}=l,h={title:d,content:u,excerpt:p};if(!Object.keys(h).some((e=>h[e]!==o(e))))return void xs(e,t);if(s)return;const g="wpEditorAutosaveRestore";n((0,m.__)("The backup of this post in your browser is different from the version below."),{id:g,actions:[{label:(0,m.__)("Restore the backup"),onClick(){const{content:e,...t}=h;r(t),a((0,c.parse)(h.content)),i(g)}}]})}),[t,e])}const mr=(0,pn.ifCondition)((()=>{if(void 0!==pr)return pr;try{window.sessionStorage.setItem("__wpEditorTestSessionStorage",""),window.sessionStorage.removeItem("__wpEditorTestSessionStorage"),pr=!0}catch{pr=!1}return pr}))((function(){const{autosave:e}=(0,d.useDispatch)(cn),t=(0,C.useCallback)((()=>{ur((()=>e({local:!0})))}),[]);hr(),function(){const{postId:e,isEditedPostNew:t,isDirty:s,isAutosaving:o,didError:n}=(0,d.useSelect)((e=>({postId:e(cn).getCurrentPostId(),isEditedPostNew:e(cn).isEditedPostNew(),isDirty:e(cn).isEditedPostDirty(),isAutosaving:e(cn).isAutosavingPost(),didError:e(cn).didPostSaveRequestFail()})),[]),i=(0,C.useRef)(s),r=(0,C.useRef)(o);(0,C.useEffect)((()=>{!n&&(r.current&&!o||i.current&&!s)&&xs(e,t),i.current=s,r.current=o}),[s,o,n]);const a=(0,pn.usePrevious)(t),l=(0,pn.usePrevious)(e);(0,C.useEffect)((()=>{l===e&&a&&!t&&xs(e,!0)}),[t,e])}();const s=(0,d.useSelect)((e=>e(cn).getEditorSettings().localAutosaveInterval),[]);return(0,T.jsx)(Si,{interval:s,autosave:t})}));const gr=function({children:e}){const t=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(cn),{getPostType:s}=e(b.store),o=s(t("type"));return!!o?.supports?.["page-attributes"]}),[]);return t?e:null},_r=(0,C.forwardRef)((({className:e,label:t,children:s},o)=>(0,T.jsxs)(Tn.__experimentalHStack,{className:jn("editor-post-panel__row",e),ref:o,children:[t&&(0,T.jsx)("div",{className:"editor-post-panel__row-label",children:t}),(0,T.jsx)("div",{className:"editor-post-panel__row-control",children:s})]})));const fr=function({children:e,supportKeys:t}){const s=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(cn),{getPostType:s}=e(b.store);return s(t("type"))}),[]);let o=!!s;return s&&(o=(Array.isArray(t)?t:[t]).some((e=>!!s.supports[e]))),o?e:null};function br(){const e=(0,d.useSelect)((e=>{var t;return null!==(t=e(cn).getEditedPostAttribute("menu_order"))&&void 0!==t?t:0}),[]),{editPost:t}=(0,d.useDispatch)(cn),[s,o]=(0,C.useState)(null),n=null!=s?s:e;return(0,T.jsx)(Tn.Flex,{children:(0,T.jsx)(Tn.FlexBlock,{children:(0,T.jsx)(Tn.__experimentalNumberControl,{__next40pxDefaultSize:!0,label:(0,m.__)("Order"),help:(0,m.__)("Set the page order."),value:n,onChange:e=>{o(e);const s=Number(e);Number.isInteger(s)&&""!==e.trim?.()&&t({menu_order:s})},hideLabelFromVision:!0,onBlur:()=>{o(null)}})})})}function yr(){return(0,T.jsx)(fr,{supportKeys:"page-attributes",children:(0,T.jsx)(br,{})})}function xr({isOpen:e,onClick:t}){const s=(0,d.useSelect)((e=>{var t;return null!==(t=e(cn).getEditedPostAttribute("menu_order"))&&void 0!==t?t:0}),[]);return(0,T.jsx)(Tn.Button,{size:"compact",className:"editor-post-order__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,m.sprintf)((0,m.__)("Change order: %s"),s),onClick:t,children:s})}function vr(){const[e,t]=(0,C.useState)(null),s=(0,C.useMemo)((()=>({anchor:e,placement:"left-start",offset:36,shift:!0})),[e]);return(0,T.jsx)(_r,{label:(0,m.__)("Order"),ref:t,children:(0,T.jsx)(Tn.Dropdown,{popoverProps:s,className:"editor-post-order__panel-dropdown",contentClassName:"editor-post-order__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,T.jsx)(xr,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,T.jsxs)("div",{className:"editor-post-order",children:[(0,T.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,m.__)("Order"),onClose:e}),(0,T.jsxs)("div",{children:[(0,m.__)("This attribute determines the order of pages in the Pages List block."),(0,T.jsx)("p",{children:(0,m.__)("Pages with the same order value will sorted alphabetically. Negative order values are also supported.")})]}),(0,T.jsx)(br,{})]})})})}var wr=s(9681),Sr=s.n(wr);function kr(e){const t=e.map((e=>({children:[],parent:null,...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}),{}),o=e=>e.map((e=>{const t=s[e.id];return{...e,children:t&&t.length?o(t):[]}}));return o(s[0]||[])}const Pr=e=>(0,Mo.decodeEntities)(e),Cr=e=>({...e,name:Pr(e.name)}),jr=e=>(null!=e?e:[]).map(Cr);function Tr(e){return e?.title?.rendered?(0,Mo.decodeEntities)(e.title.rendered):`#${e.id} (${(0,m.__)("no title")})`}const Er=(e,t)=>{const s=Sr()(e||"").toLowerCase(),o=Sr()(t||"").toLowerCase();return s===o?0:s.startsWith(o)?s.length:1/0};function Br(){const{editPost:e}=(0,d.useDispatch)(cn),[t,s]=(0,C.useState)(!1),{isHierarchical:o,parentPostId:n,parentPostTitle:i,pageItems:r}=(0,d.useSelect)((e=>{var s;const{getPostType:o,getEntityRecords:n,getEntityRecord:i}=e(b.store),{getCurrentPostId:r,getEditedPostAttribute:a}=e(cn),l=a("type"),c=a("parent"),d=o(l),u=r(),p=null!==(s=d?.hierarchical)&&void 0!==s&&s,h={per_page:100,exclude:u,parent_exclude:u,orderby:"menu_order",order:"asc",_fields:"id,title,parent"};t&&(h.search=t);const m=c?i("postType",l,c):null;return{isHierarchical:p,parentPostId:c,parentPostTitle:m?Tr(m):"",pageItems:p?n("postType",l,h):null}}),[t]),a=(0,C.useMemo)((()=>{const e=(s,o=0)=>{const n=s.map((t=>[{value:t.id,label:"— ".repeat(o)+(0,Mo.decodeEntities)(t.name),rawName:t.name},...e(t.children||[],o+1)])).sort((([e],[s])=>Er(e.rawName,t)>=Er(s.rawName,t)?1:-1));return n.flat()};if(!r)return[];let s=r.map((e=>({id:e.id,parent:e.parent,name:Tr(e)})));t||(s=kr(s));const o=e(s),a=o.find((e=>e.value===n));return i&&!a&&o.unshift({value:n,label:i}),o}),[r,t,i,n]);if(!o)return null;return(0,T.jsx)(Tn.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"editor-page-attributes__parent",label:(0,m.__)("Parent"),help:(0,m.__)("Choose a parent page."),value:n,options:a,onFilterValueChange:(0,pn.debounce)((e=>{s(e)}),300),onChange:t=>{e({parent:t})},hideLabelFromVision:!0})}function Ir({isOpen:e,onClick:t}){const s=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(cn),s=t("parent");if(!s)return null;const{getEntityRecord:o}=e(b.store);return o("postType",t("type"),s)}),[]),o=(0,C.useMemo)((()=>s?Tr(s):(0,m.__)("None")),[s]);return(0,T.jsx)(Tn.Button,{size:"compact",className:"editor-post-parent__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,m.sprintf)((0,m.__)("Change parent: %s"),o),onClick:t,children:o})}function Nr(){const[e,t]=(0,C.useState)(null),s=(0,C.useMemo)((()=>({anchor:e,placement:"left-start",offset:36,shift:!0})),[e]);return(0,T.jsx)(_r,{label:(0,m.__)("Parent"),ref:t,children:(0,T.jsx)(Tn.Dropdown,{popoverProps:s,className:"editor-post-parent__panel-dropdown",contentClassName:"editor-post-parent__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,T.jsx)(Ir,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,T.jsxs)("div",{className:"editor-post-parent",children:[(0,T.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,m.__)("Parent"),onClose:e}),(0,T.jsxs)("div",{children:[(0,m.__)("Child pages inherit characteristics from their parent, such as URL structure. For instance, if 'Web Design' is a child of 'Services', its URL would be example.org/services/web-design."),(0,T.jsxs)("p",{children:[(0,m.__)("They also show up as sub-items in the default navigation menu. "),(0,T.jsx)(Tn.ExternalLink,{href:(0,m.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes"),children:(0,m.__)("Learn more")})]})]}),(0,T.jsx)(Br,{})]})})})}const Ar=Br,Dr="page-attributes";function Rr(){const{isEnabled:e,postType:t}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,isEditorPanelEnabled:s}=e(cn),{getPostType:o}=e(b.store);return{isEnabled:s(Dr),postType:o(t("type"))}}),[]);return e&&t?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Nr,{}),(0,T.jsx)(vr,{})]}):null}function Mr(){return(0,T.jsx)(gr,{children:(0,T.jsx)(Rr,{})})}const Or=(0,T.jsx)(j.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,T.jsx)(j.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"})}),Lr=(0,m.__)("Custom Template");function Fr({onClose:e}){const{defaultBlockTemplate:t,onNavigateToEntityRecord:s}=(0,d.useSelect)((e=>{const{getEditorSettings:t,getCurrentTemplateId:s}=e(cn);return{defaultBlockTemplate:t().defaultBlockTemplate,onNavigateToEntityRecord:t().onNavigateToEntityRecord,getTemplateId:s}})),{createTemplate:o}=h((0,d.useDispatch)(cn)),[n,i]=(0,C.useState)(""),[r,a]=(0,C.useState)(!1),l=()=>{i(""),e()};return(0,T.jsx)(Tn.Modal,{title:(0,m.__)("Create custom template"),onRequestClose:l,children:(0,T.jsx)("form",{className:"editor-post-template__create-form",onSubmit:async e=>{if(e.preventDefault(),r)return;a(!0);const i=null!=t?t:(0,c.serialize)([(0,c.createBlock)("core/group",{tagName:"header",layout:{inherit:!0}},[(0,c.createBlock)("core/site-title"),(0,c.createBlock)("core/site-tagline")]),(0,c.createBlock)("core/separator"),(0,c.createBlock)("core/group",{tagName:"main"},[(0,c.createBlock)("core/group",{layout:{inherit:!0}},[(0,c.createBlock)("core/post-title")]),(0,c.createBlock)("core/post-content",{layout:{inherit:!0}})])]),d=await o({slug:(0,S.cleanForSlug)(n||Lr),content:i,title:n||Lr});a(!1),s({postId:d.id,postType:"wp_template"}),l()},children:(0,T.jsxs)(Tn.__experimentalVStack,{spacing:"3",children:[(0,T.jsx)(Tn.TextControl,{__nextHasNoMarginBottom:!0,label:(0,m.__)("Name"),value:n,onChange:i,placeholder:Lr,disabled:r,help:(0,m.__)('Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.')}),(0,T.jsxs)(Tn.__experimentalHStack,{justify:"right",children:[(0,T.jsx)(Tn.Button,{variant:"tertiary",onClick:l,children:(0,m.__)("Cancel")}),(0,T.jsx)(Tn.Button,{variant:"primary",type:"submit",isBusy:r,"aria-disabled":r,children:(0,m.__)("Create")})]})]})})})}function Vr(){return(0,d.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s}=e(cn);return{postId:t(),postType:s()}}),[])}function Ur(){const{postType:e,postId:t}=Vr();return(0,d.useSelect)((s=>{const{getEntityRecord:o,getEntityRecords:n}=s(b.store),i=o("root","site"),r=n("postType","wp_template",{per_page:-1}),a=+t===i?.page_for_posts,l="page"===e&&+t===i?.page_on_front&&r?.some((({slug:e})=>"front-page"===e));return!a&&!l}),[t,e])}function zr(e){return(0,d.useSelect)((t=>t(b.store).getEntityRecords("postType","wp_template",{per_page:-1,post_type:e})),[e])}function Hr(e){const t=Gr(),s=Ur(),o=zr(e);return(0,C.useMemo)((()=>s&&o?.filter((e=>e.is_custom&&e.slug!==t&&!!e.content.raw))),[o,t,s])}function Gr(){const{postType:e,postId:t}=Vr(),s=zr(e),o=(0,d.useSelect)((s=>{const o=s(b.store).getEditedEntityRecord("postType",e,t);return o?.template}),[e,t]);if(o)return s?.find((e=>e.slug===o))?.slug}const $r={className:"editor-post-template__dropdown",placement:"bottom-start"};function Wr({isOpen:e,onClick:t}){const s=(0,d.useSelect)((e=>{const t=e(cn).getEditedPostAttribute("template"),{supportsTemplateMode:s,availableTemplates:o}=e(cn).getEditorSettings();if(!s&&o[t])return o[t];const n=e(b.store).canUser("create","templates")&&e(cn).getCurrentTemplateId();return n?.title||n?.slug||o?.[t]}),[]);return(0,T.jsx)(Tn.Button,{__next40pxDefaultSize:!0,variant:"tertiary","aria-expanded":e,"aria-label":(0,m.__)("Template options"),onClick:t,children:null!=s?s:(0,m.__)("Default template")})}function Kr({onClose:e}){var t,s;const o=Ur(),{availableTemplates:n,fetchedTemplates:i,selectedTemplateSlug:r,canCreate:a,canEdit:l,currentTemplateId:c,onNavigateToEntityRecord:u,getEditorSettings:p}=(0,d.useSelect)((e=>{const{canUser:t,getEntityRecords:s}=e(b.store),n=e(cn).getEditorSettings(),i=t("create","templates"),r=e(cn).getCurrentTemplateId();return{availableTemplates:n.availableTemplates,fetchedTemplates:i?s("postType","wp_template",{post_type:e(cn).getCurrentPostType(),per_page:-1}):void 0,selectedTemplateSlug:e(cn).getEditedPostAttribute("template"),canCreate:o&&i&&n.supportsTemplateMode,canEdit:o&&i&&n.supportsTemplateMode&&!!r,currentTemplateId:r,onNavigateToEntityRecord:n.onNavigateToEntityRecord,getEditorSettings:e(cn).getEditorSettings}}),[o]),h=(0,C.useMemo)((()=>Object.entries({...n,...Object.fromEntries((null!=i?i:[]).map((({slug:e,title:t})=>[e,t.rendered])))}).map((([e,t])=>({value:e,label:t})))),[n,i]),_=null!==(t=h.find((e=>e.value===r)))&&void 0!==t?t:h.find((e=>!e.value)),{editPost:f}=(0,d.useDispatch)(cn),{createSuccessNotice:y}=(0,d.useDispatch)(fs.store),[x,v]=(0,C.useState)(!1);return(0,T.jsxs)("div",{className:"editor-post-template__classic-theme-dropdown",children:[(0,T.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,m.__)("Template"),help:(0,m.__)("Templates define the way content is displayed when viewing your site."),actions:a?[{icon:Or,label:(0,m.__)("Add template"),onClick:()=>v(!0)}]:[],onClose:e}),o?(0,T.jsx)(Tn.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,label:(0,m.__)("Template"),value:null!==(s=_?.value)&&void 0!==s?s:"",options:h,onChange:e=>f({template:e||""})}):(0,T.jsx)(Tn.Notice,{status:"warning",isDismissible:!1,children:(0,m.__)("The posts page template cannot be changed.")}),l&&u&&(0,T.jsx)("p",{children:(0,T.jsx)(Tn.Button,{variant:"link",onClick:()=>{u({postId:c,postType:"wp_template"}),e(),y((0,m.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:[{label:(0,m.__)("Go back"),onClick:()=>p().onNavigateToPreviousEntityRecord()}]})},children:(0,m.__)("Edit template")})}),x&&(0,T.jsx)(Fr,{onClose:()=>v(!1)})]})}const Zr=function(){return(0,T.jsx)(Tn.Dropdown,{popoverProps:$r,focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,T.jsx)(Wr,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,T.jsx)(Kr,{onClose:e})})},{PreferenceBaseOption:Yr}=(window.wp.warning,h(B.privateApis)),qr=(0,pn.compose)((0,d.withSelect)(((e,{panelName:t})=>{const{isEditorPanelEnabled:s,isEditorPanelRemoved:o}=e(cn);return{isRemoved:o(t),isChecked:s(t)}})),(0,pn.ifCondition)((({isRemoved:e})=>!e)),(0,d.withDispatch)(((e,{panelName:t})=>({onChange:()=>e(cn).toggleEditorPanelEnabled(t)}))))(Yr),{Fill:Qr,Slot:Xr}=(0,Tn.createSlotFill)("EnablePluginDocumentSettingPanelOption"),Jr=({label:e,panelName:t})=>(0,T.jsx)(Qr,{children:(0,T.jsx)(qr,{label:e,panelName:t})});Jr.Slot=Xr;const ea=Jr,{Fill:ta,Slot:sa}=(0,Tn.createSlotFill)("PluginDocumentSettingPanel"),oa=({name:e,className:t,title:s,icon:o,children:n})=>{const{name:i}=(0,Jn.usePluginContext)(),r=`${i}/${e}`,{opened:a,isEnabled:l}=(0,d.useSelect)((e=>{const{isEditorPanelOpened:t,isEditorPanelEnabled:s}=e(cn);return{opened:t(r),isEnabled:s(r)}}),[r]),{toggleEditorPanelOpened:c}=(0,d.useDispatch)(cn);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(ea,{label:s,panelName:r}),(0,T.jsx)(ta,{children:l&&(0,T.jsx)(Tn.PanelBody,{className:t,title:s,icon:o,opened:a,onToggle:()=>c(r),children:n})})]})};oa.Slot=sa;const na=oa,ia=({allowedBlocks:e,icon:t,label:s,onClick:o,small:n,role:i})=>(0,T.jsx)(g.BlockSettingsMenuControls,{children:({selectedBlocks:r,onClose:a})=>((e,t)=>{return!Array.isArray(t)||(s=t,0===e.filter((e=>!s.includes(e))).length);var s})(r,e)?(0,T.jsx)(Tn.MenuItem,{onClick:(0,pn.compose)(o,a),icon:t,label:n?s:void 0,role:i,children:!n&&s}):null}),ra=(0,pn.compose)((0,Jn.withPluginContext)(((e,t)=>{var s;return{as:null!==(s=t.as)&&void 0!==s?s:Tn.MenuItem,icon:t.icon||e.icon,name:"core/plugin-more-menu"}})))(ii),{Fill:aa,Slot:la}=(0,Tn.createSlotFill)("PluginPostPublishPanel"),ca=({children:e,className:t,title:s,initialOpen:o=!1,icon:n})=>{const{icon:i}=(0,Jn.usePluginContext)();return(0,T.jsx)(aa,{children:(0,T.jsx)(Tn.PanelBody,{className:t,initialOpen:o||!s,title:s,icon:null!=n?n:i,children:e})})};ca.Slot=la;const da=ca,{Fill:ua,Slot:pa}=(0,Tn.createSlotFill)("PluginPostStatusInfo"),ha=({children:e,className:t})=>(0,T.jsx)(ua,{children:(0,T.jsx)(Tn.PanelRow,{className:t,children:e})});ha.Slot=pa;const ma=ha,{Fill:ga,Slot:_a}=(0,Tn.createSlotFill)("PluginPrePublishPanel"),fa=({children:e,className:t,title:s,initialOpen:o=!1,icon:n})=>{const{icon:i}=(0,Jn.usePluginContext)();return(0,T.jsx)(ga,{children:(0,T.jsx)(Tn.PanelBody,{className:t,initialOpen:o||!s,title:s,icon:null!=n?n:i,children:e})})};fa.Slot=_a;const ba=fa;function ya({className:e,...t}){const{postTitle:s,shortcut:o}=(0,d.useSelect)((e=>({postTitle:e(cn).getEditedPostAttribute("title"),shortcut:e(Pn.store).getShortcutRepresentation("core/editor/toggle-sidebar")})),[]);return(0,T.jsx)(gi,{panelClassName:e,className:"editor-sidebar",smallScreenTitle:s||(0,m.__)("(no title)"),scope:"core",toggleShortcut:o,...t})}function xa(e){return(0,T.jsx)(ai,{__unstableExplicitMenuItem:!0,scope:"core",...e})}function va({onClick:e}){const[t,s]=(0,C.useState)(!1),{postType:o,postId:n}=Vr(),i=Hr(o),{editEntityRecord:r}=(0,d.useDispatch)(b.store);if(!i?.length)return null;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Tn.MenuItem,{onClick:()=>s(!0),children:(0,m.__)("Swap template")}),t&&(0,T.jsx)(Tn.Modal,{title:(0,m.__)("Choose a template"),onRequestClose:()=>s(!1),overlayClassName:"editor-post-template__swap-template-modal",isFullScreen:!0,children:(0,T.jsx)("div",{className:"editor-post-template__swap-template-modal-content",children:(0,T.jsx)(wa,{postType:o,onSelect:async t=>{r("postType",o,n,{template:t.name},{undoIgnore:!0}),s(!1),e()}})})})]})}function wa({postType:e,onSelect:t}){const s=Hr(e),o=(0,C.useMemo)((()=>s.map((e=>({name:e.slug,blocks:(0,c.parse)(e.content.raw),title:(0,Mo.decodeEntities)(e.title.rendered),id:e.id})))),[s]),n=(0,pn.useAsyncList)(o);return(0,T.jsx)(g.__experimentalBlockPatternsList,{label:(0,m.__)("Templates"),blockPatterns:o,shownPatterns:n,onClickPattern:t})}function Sa({onClick:e}){const t=Gr(),s=Ur(),{postType:o,postId:n}=Vr(),{editEntityRecord:i}=(0,d.useDispatch)(b.store);return t&&s?(0,T.jsx)(Tn.MenuItem,{onClick:()=>{i("postType",o,n,{template:""},{undoIgnore:!0}),e()},children:(0,m.__)("Use default template")}):null}function ka({onClick:e}){const{canCreateTemplates:t}=(0,d.useSelect)((e=>{const{canUser:t}=e(b.store);return{canCreateTemplates:t("create","templates")}}),[]),[s,o]=(0,C.useState)(!1),n=Ur();return t&&n?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Tn.MenuItem,{onClick:()=>{o(!0)},children:(0,m.__)("Create new template")}),s&&(0,T.jsx)(Fr,{onClose:()=>{o(!1),e()}})]}):null}const Pa={className:"editor-post-template__dropdown",placement:"bottom-start"};function Ca({id:e}){const{isTemplateHidden:t,onNavigateToEntityRecord:s,getEditorSettings:o,hasGoBack:n}=(0,d.useSelect)((e=>{const{getRenderingMode:t,getEditorSettings:s}=h(e(cn)),o=s();return{isTemplateHidden:"post-only"===t(),onNavigateToEntityRecord:o.onNavigateToEntityRecord,getEditorSettings:s,hasGoBack:o.hasOwnProperty("onNavigateToPreviousEntityRecord")}}),[]),{editedRecord:i,hasResolved:r}=(0,b.useEntityRecord)("postType","wp_template",e),{createSuccessNotice:a}=(0,d.useDispatch)(fs.store),{setRenderingMode:l}=(0,d.useDispatch)(cn),c=(0,d.useSelect)((e=>{var t;return null!==(t=e(b.store).canUser("create","templates"))&&void 0!==t&&t}));if(!r)return null;const u=n?[{label:(0,m.__)("Go back"),onClick:()=>o().onNavigateToPreviousEntityRecord()}]:void 0;return(0,T.jsx)(Tn.DropdownMenu,{popoverProps:Pa,focusOnMount:!0,toggleProps:{size:"compact",variant:"tertiary",tooltipPosition:"middle left"},label:(0,m.__)("Template options"),text:(0,Mo.decodeEntities)(i.title),icon:null,children:({onClose:e})=>(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(Tn.MenuGroup,{children:[c&&(0,T.jsx)(Tn.MenuItem,{onClick:()=>{s({postId:i.id,postType:"wp_template"}),e(),a((0,m.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:u})},children:(0,m.__)("Edit template")}),(0,T.jsx)(va,{onClick:e}),(0,T.jsx)(Sa,{onClick:e}),c&&(0,T.jsx)(ka,{onClick:e})]}),(0,T.jsx)(Tn.MenuGroup,{children:(0,T.jsx)(Tn.MenuItem,{icon:t?void 0:En,isSelected:!t,role:"menuitemcheckbox",onClick:()=>{l(t?"template-locked":"post-only")},children:(0,m.__)("Show template")})})]})})}function ja(){const{templateId:e,isBlockTheme:t}=(0,d.useSelect)((e=>{const{getCurrentTemplateId:t,getEditorSettings:s}=e(cn);return{templateId:t(),isBlockTheme:s().__unstableIsBlockBasedTheme}}),[]),s=(0,d.useSelect)((e=>{var t;const s=e(cn).getCurrentPostType(),o=e(b.store).getPostType(s);if(!o?.viewable)return!1;const n=e(cn).getEditorSettings();if(!!n.availableTemplates&&Object.keys(n.availableTemplates).length>0)return!0;if(!n.supportsTemplateMode)return!1;return null!==(t=e(b.store).canUser("create","templates"))&&void 0!==t&&t}),[]),o=(0,d.useSelect)((e=>{var t;return null!==(t=e(b.store).canUser("read","templates"))&&void 0!==t&&t}),[]);return t&&o||!s?t&&e?(0,T.jsx)(_r,{label:(0,m.__)("Template"),children:(0,T.jsx)(Ca,{id:e})}):null:(0,T.jsx)(_r,{label:(0,m.__)("Template"),children:(0,T.jsx)(Zr,{})})}const Ta={_fields:"id,name",context:"view"},Ea={who:"authors",per_page:50,...Ta};function Ba(e){const{authorId:t,authors:s,postAuthor:o}=(0,d.useSelect)((t=>{const{getUser:s,getUsers:o}=t(b.store),{getEditedPostAttribute:n}=t(cn),i=n("author"),r={...Ea};return e&&(r.search=e),{authorId:i,authors:o(r),postAuthor:s(i,Ta)}}),[e]);return{authorId:t,authorOptions:(0,C.useMemo)((()=>{const e=(null!=s?s:[]).map((e=>({value:e.id,label:(0,Mo.decodeEntities)(e.name)})));return e.findIndex((({value:e})=>o?.id===e))<0&&o?[{value:o.id,label:(0,Mo.decodeEntities)(o.name)},...e]:e}),[s,o]),postAuthor:o}}function Ia(){const[e,t]=(0,C.useState)(),{editPost:s}=(0,d.useDispatch)(cn),{authorId:o,authorOptions:n}=Ba(e);return(0,T.jsx)(Tn.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,m.__)("Author"),options:n,value:o,onFilterValueChange:(0,pn.debounce)((e=>{t(e)}),300),onChange:e=>{e&&s({author:e})},allowReset:!1,hideLabelFromVision:!0})}function Na(){const{editPost:e}=(0,d.useDispatch)(cn),{authorId:t,authorOptions:s}=Ba();return(0,T.jsx)(Tn.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"post-author-selector",label:(0,m.__)("Author"),options:s,onChange:t=>{const s=Number(t);e({author:s})},value:t,hideLabelFromVision:!0})}const Aa=function(){return(0,d.useSelect)((e=>{const t=e(b.store).getUsers(Ea);return t?.length>=25}),[])?(0,T.jsx)(Ia,{}):(0,T.jsx)(Na,{})};function Da({children:e}){const{hasAssignAuthorAction:t,hasAuthors:s}=(0,d.useSelect)((e=>{var t;const s=e(cn).getCurrentPost(),o=e(b.store).getUsers(Ea);return{hasAssignAuthorAction:null!==(t=s._links?.["wp:action-assign-author"])&&void 0!==t&&t,hasAuthors:o?.length>=1}}),[]);return t&&s?(0,T.jsx)(fr,{supportKeys:"author",children:e}):null}function Ra({isOpen:e,onClick:t}){const{postAuthor:s}=Ba(),o=s?.name||"";return(0,T.jsx)(Tn.Button,{size:"compact",className:"editor-post-author__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,m.sprintf)((0,m.__)("Change author: %s"),o),onClick:t,children:o})}const Ma=function(){const[e,t]=(0,C.useState)(null),s=(0,C.useMemo)((()=>({anchor:e,placement:"left-start",offset:36,shift:!0})),[e]);return(0,T.jsx)(Da,{children:(0,T.jsx)(_r,{label:(0,m.__)("Author"),ref:t,children:(0,T.jsx)(Tn.Dropdown,{popoverProps:s,contentClassName:"editor-post-author__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,T.jsx)(Ra,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,T.jsxs)("div",{className:"editor-post-author",children:[(0,T.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,m.__)("Author"),onClose:e}),(0,T.jsx)(Aa,{onClose:e})]})})})})},Oa=[{label:(0,T.jsxs)(T.Fragment,{children:[(0,m.__)("Open"),(0,T.jsx)(Tn.__experimentalText,{variant:"muted",size:12,children:(0,m.__)("Visitors can add new comments and replies.")})]}),value:"open"},{label:(0,T.jsxs)(T.Fragment,{children:[(0,m.__)("Closed"),(0,T.jsx)(Tn.__experimentalText,{variant:"muted",size:12,children:(0,m.__)("Visitors cannot add new comments or replies.")}),(0,T.jsx)(Tn.__experimentalText,{variant:"muted",size:12,children:(0,m.__)("Existing comments remain visible.")})]}),value:"closed"}];const La=function(){const e=(0,d.useSelect)((e=>{var t;return null!==(t=e(cn).getEditedPostAttribute("comment_status"))&&void 0!==t?t:"open"}),[]),{editPost:t}=(0,d.useDispatch)(cn);return(0,T.jsx)("form",{children:(0,T.jsx)(Tn.__experimentalVStack,{spacing:4,children:(0,T.jsx)(Tn.RadioControl,{className:"editor-change-status__options",hideLabelFromVision:!0,label:(0,m.__)("Comment status"),options:Oa,onChange:e=>t({comment_status:e}),selected:e})})})};const Fa=function(){const e=(0,d.useSelect)((e=>{var t;return null!==(t=e(cn).getEditedPostAttribute("ping_status"))&&void 0!==t?t:"open"}),[]),{editPost:t}=(0,d.useDispatch)(cn);return(0,T.jsx)(Tn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,m.__)("Enable pingbacks & trackbacks"),checked:"open"===e,onChange:()=>t({ping_status:"open"===e?"closed":"open"}),help:(0,T.jsx)(Tn.ExternalLink,{href:(0,m.__)("https://wordpress.org/documentation/article/trackbacks-and-pingbacks/"),children:(0,m.__)("Learn more about pingbacks & trackbacks")})})},Va="discussion-panel";function Ua({onClose:e}){return(0,T.jsxs)("div",{className:"editor-post-discussion",children:[(0,T.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,m.__)("Discussion"),onClose:e}),(0,T.jsxs)(Tn.__experimentalVStack,{spacing:4,children:[(0,T.jsx)(fr,{supportKeys:"comments",children:(0,T.jsx)(La,{})}),(0,T.jsx)(fr,{supportKeys:"trackbacks",children:(0,T.jsx)(Fa,{})})]})]})}function za({isOpen:e,onClick:t}){const{commentStatus:s,pingStatus:o,commentsSupported:n,trackbacksSupported:i}=(0,d.useSelect)((e=>{var t,s;const{getEditedPostAttribute:o}=e(cn),{getPostType:n}=e(b.store),i=n(o("type"));return{commentStatus:null!==(t=o("comment_status"))&&void 0!==t?t:"open",pingStatus:null!==(s=o("ping_status"))&&void 0!==s?s:"open",commentsSupported:!!i.supports.comments,trackbacksSupported:!!i.supports.trackbacks}}),[]);let r;return r="open"===s?"open"===o?(0,m.__)("Open"):i?(0,m.__)("Comments only"):(0,m.__)("Open"):"open"===o?n?(0,m.__)("Pings only"):(0,m.__)("Pings enabled"):(0,m.__)("Closed"),(0,T.jsx)(Tn.Button,{size:"compact",className:"editor-post-discussion__panel-toggle",variant:"tertiary","aria-label":(0,m.__)("Change discussion options"),"aria-expanded":e,onClick:t,children:r})}function Ha(){const{isEnabled:e}=(0,d.useSelect)((e=>{const{isEditorPanelEnabled:t}=e(cn);return{isEnabled:t(Va)}}),[]),[t,s]=(0,C.useState)(null),o=(0,C.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]);return e?(0,T.jsx)(fr,{supportKeys:["comments","trackbacks"],children:(0,T.jsx)(_r,{label:(0,m.__)("Discussion"),ref:s,children:(0,T.jsx)(Tn.Dropdown,{popoverProps:o,className:"editor-post-discussion__panel-dropdown",contentClassName:"editor-post-discussion__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,T.jsx)(za,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,T.jsx)(Ua,{onClose:e})})})}):null}function Ga({hideLabelFromVision:e=!1,updateOnBlur:t=!1}){const{excerpt:s,shouldUseDescriptionLabel:o,usedAttribute:n}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getEditedPostAttribute:s}=e(cn),o=t(),n=["wp_template","wp_template_part"].includes(o)?"description":"excerpt";return{excerpt:s(n),shouldUseDescriptionLabel:["wp_template","wp_template_part","wp_block"].includes(o),usedAttribute:n}}),[]),{editPost:i}=(0,d.useDispatch)(cn),[r,a]=(0,C.useState)((0,Mo.decodeEntities)(s)),l=e=>{i({[n]:e})},c=o?(0,m.__)("Write a description (optional)"):(0,m.__)("Write an excerpt (optional)");return(0,T.jsx)("div",{className:"editor-post-excerpt",children:(0,T.jsx)(Tn.TextareaControl,{__nextHasNoMarginBottom:!0,label:c,hideLabelFromVision:e,className:"editor-post-excerpt__textarea",onChange:t?a:l,onBlur:t?()=>l(r):void 0,value:t?r:s,help:o?(0,m.__)("Write a description"):(0,T.jsx)(Tn.ExternalLink,{href:(0,m.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#excerpt"),children:(0,m.__)("Learn more about manual excerpts")})})})}const $a=function({children:e}){return(0,T.jsx)(fr,{supportKeys:"excerpt",children:e})},{Fill:Wa,Slot:Ka}=(0,Tn.createSlotFill)("PluginPostExcerpt"),Za=({children:e,className:t})=>(0,T.jsx)(Wa,{children:(0,T.jsx)(Tn.PanelRow,{className:t,children:e})});Za.Slot=Ka;const Ya=Za,qa="post-excerpt";function Qa(){const{isOpened:e,isEnabled:t,postType:s}=(0,d.useSelect)((e=>{const{isEditorPanelOpened:t,isEditorPanelEnabled:s,getCurrentPostType:o}=e(cn);return{isOpened:t(qa),isEnabled:s(qa),postType:o()}}),[]),{toggleEditorPanelOpened:o}=(0,d.useDispatch)(cn);if(!t)return null;const n=["wp_template","wp_template_part","wp_block"].includes(s);return(0,T.jsx)(Tn.PanelBody,{title:n?(0,m.__)("Description"):(0,m.__)("Excerpt"),opened:e,onToggle:()=>o(qa),children:(0,T.jsx)(Ya.Slot,{children:e=>(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Ga,{}),e]})})})}function Xa(){return(0,T.jsx)($a,{children:(0,T.jsx)(Qa,{})})}function Ja(){return(0,T.jsx)($a,{children:(0,T.jsx)(el,{})})}function el(){const{shouldRender:e,excerpt:t,shouldBeUsedAsDescription:s,allowEditing:o}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s,getEditedPostAttribute:o,isEditorPanelEnabled:n}=e(cn),i=t(),r=["wp_template","wp_template_part"].includes(i),a="wp_block"===i,l=r||a,c=r?"description":"excerpt",d=r&&e(b.store).getEntityRecord("postType",i,s()),u=n(qa)||l;return{excerpt:o(c),shouldRender:u,shouldBeUsedAsDescription:l,allowEditing:u&&(!l||a||d&&d.source===z.custom&&!d.has_theme_file)}}),[]),[n,i]=(0,C.useState)(null),r=s?(0,m.__)("Description"):(0,m.__)("Excerpt"),a=(0,C.useMemo)((()=>({anchor:n,"aria-label":r,headerTitle:r,placement:"left-start",offset:36,shift:!0})),[n,r]);if(!e)return!1;const l=!!t&&(0,T.jsx)(Tn.__experimentalText,{align:"left",numberOfLines:4,truncate:!0,children:(0,Mo.decodeEntities)(t)});if(!o)return l;const c=s?(0,m.__)("Add a description…"):(0,m.__)("Add an excerpt…"),u=s?(0,m.__)("Edit description"):(0,m.__)("Edit excerpt");return(0,T.jsxs)(Tn.__experimentalVStack,{children:[l,(0,T.jsx)(Tn.Dropdown,{className:"editor-post-excerpt__dropdown",contentClassName:"editor-post-excerpt__dropdown__content",popoverProps:a,focusOnMount:!0,ref:i,renderToggle:({onToggle:e})=>(0,T.jsx)(Tn.Button,{className:"editor-post-excerpt__dropdown__trigger",onClick:e,variant:"link",children:l?u:c}),renderContent:({onClose:e})=>(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(g.__experimentalInspectorPopoverHeader,{title:r,onClose:e}),(0,T.jsx)(Tn.__experimentalVStack,{spacing:4,children:(0,T.jsx)(Ya.Slot,{children:e=>(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Ga,{hideLabelFromVision:!0,updateOnBlur:!0}),e]})})})]})})]})}const tl=window.wp.blob;function sl({children:e,supportKeys:t}){const{postType:s,themeSupports:o}=(0,d.useSelect)((e=>({postType:e(cn).getEditedPostAttribute("type"),themeSupports:e(b.store).getThemeSupports()})),[]);return(Array.isArray(t)?t:[t]).some((e=>{var t;const n=null!==(t=o?.[e])&&void 0!==t&&t;return"post-thumbnails"===e&&Array.isArray(n)?n.includes(s):n}))?e:null}const ol=function({children:e}){return(0,T.jsx)(sl,{supportKeys:"post-thumbnails",children:(0,T.jsx)(fr,{supportKeys:"thumbnail",children:e})})},nl=["image"],il=(0,m.__)("Featured image"),rl=(0,m.__)("Add a featured image"),al=(0,T.jsx)("p",{children:(0,m.__)("To edit the featured image, you need permission to upload media.")});const ll=(0,d.withSelect)((e=>{const{getMedia:t,getPostType:s}=e(b.store),{getCurrentPostId:o,getEditedPostAttribute:n}=e(cn),i=n("featured_media");return{media:i?t(i,{context:"view"}):null,currentPostId:o(),postType:s(n("type")),featuredImageId:i}})),cl=(0,d.withDispatch)(((e,{noticeOperations:t},{select:s})=>{const{editPost:o}=e(cn);return{onUpdateImage(e){o({featured_media:e.id})},onDropImage(e){s(g.store).getSettings().mediaUpload({allowedTypes:["image"],filesList:e,onFileChange([e]){o({featured_media:e.id})},onError(e){t.removeAllNotices(),t.createErrorNotice(e)}})},onRemoveImage(){o({featured_media:0})}}})),dl=(0,pn.compose)(Tn.withNotices,ll,cl,(0,Tn.withFilters)("editor.PostFeaturedImage"))((function({currentPostId:e,featuredImageId:t,onUpdateImage:s,onRemoveImage:o,media:n,postType:i,noticeUI:r,noticeOperations:a}){const l=(0,C.useRef)(),[c,u]=(0,C.useState)(!1),{getSettings:p}=(0,d.useSelect)(g.store),{mediaSourceUrl:h}=function(e,t){var s,o;if(!e)return{};const n=(0,bs.applyFilters)("editor.PostFeaturedImage.imageSize","large",e.id,t);if(n in(null!==(s=e?.media_details?.sizes)&&void 0!==s?s:{}))return{mediaWidth:e.media_details.sizes[n].width,mediaHeight:e.media_details.sizes[n].height,mediaSourceUrl:e.media_details.sizes[n].source_url};const i=(0,bs.applyFilters)("editor.PostFeaturedImage.imageSize","thumbnail",e.id,t);return i in(null!==(o=e?.media_details?.sizes)&&void 0!==o?o:{})?{mediaWidth:e.media_details.sizes[i].width,mediaHeight:e.media_details.sizes[i].height,mediaSourceUrl:e.media_details.sizes[i].source_url}:{mediaWidth:e.media_details.width,mediaHeight:e.media_details.height,mediaSourceUrl:e.source_url}}(n,e);function _(e){p().mediaUpload({allowedTypes:nl,filesList:e,onFileChange([e]){(0,tl.isBlobURL)(e?.url)?u(!0):(e&&s(e),u(!1))},onError(e){a.removeAllNotices(),a.createErrorNotice(e)}})}return(0,T.jsxs)(ol,{children:[r,(0,T.jsxs)("div",{className:"editor-post-featured-image",children:[n&&(0,T.jsxs)("div",{id:`editor-post-featured-image-${t}-describedby`,className:"hidden",children:[n.alt_text&&(0,m.sprintf)((0,m.__)("Current image: %s"),n.alt_text),!n.alt_text&&(0,m.sprintf)((0,m.__)("The current image has no alternative text. The file name is: %s"),n.media_details.sizes?.full?.file||n.slug)]}),(0,T.jsx)(g.MediaUploadCheck,{fallback:al,children:(0,T.jsx)(g.MediaUpload,{title:i?.labels?.featured_image||il,onSelect:s,unstableFeaturedImageFlow:!0,allowedTypes:nl,modalClass:"editor-post-featured-image__media-modal",render:({open:e})=>(0,T.jsxs)("div",{className:"editor-post-featured-image__container",children:[(0,T.jsxs)(Tn.Button,{ref:l,className:t?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:e,"aria-label":t?(0,m.__)("Edit or replace the image"):null,"aria-describedby":t?`editor-post-featured-image-${t}-describedby`:null,children:[!!t&&n&&(0,T.jsx)("img",{className:"editor-post-featured-image__preview-image",src:h,alt:""}),c&&(0,T.jsx)(Tn.Spinner,{}),!t&&!c&&(i?.labels?.set_featured_image||rl)]}),!!t&&(0,T.jsxs)(Tn.__experimentalHStack,{className:"editor-post-featured-image__actions",children:[(0,T.jsx)(Tn.Button,{className:"editor-post-featured-image__action",onClick:e,children:(0,m.__)("Replace")}),(0,T.jsx)(Tn.Button,{className:"editor-post-featured-image__action",onClick:()=>{o(),l.current.focus()},children:(0,m.__)("Remove")})]}),(0,T.jsx)(Tn.DropZone,{onFilesDrop:_})]}),value:t})})]})]})})),ul="featured-image";function pl({withPanelBody:e=!0}){var t;const{postType:s,isEnabled:o,isOpened:n}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,isEditorPanelEnabled:s,isEditorPanelOpened:o}=e(cn),{getPostType:n}=e(b.store);return{postType:n(t("type")),isEnabled:s(ul),isOpened:o(ul)}}),[]),{toggleEditorPanelOpened:i}=(0,d.useDispatch)(cn);return o?e?(0,T.jsx)(ol,{children:(0,T.jsx)(Tn.PanelBody,{title:null!==(t=s?.labels?.featured_image)&&void 0!==t?t:(0,m.__)("Featured image"),opened:n,onToggle:()=>i(ul),children:(0,T.jsx)(dl,{})})}):(0,T.jsx)(ol,{children:(0,T.jsx)(dl,{})}):null}const hl=function({children:e}){return(0,d.useSelect)((e=>e(cn).getEditorSettings().disablePostFormats),[])?null:(0,T.jsx)(fr,{supportKeys:"post-formats",children:e})},ml=[{id:"aside",caption:(0,m.__)("Aside")},{id:"audio",caption:(0,m.__)("Audio")},{id:"chat",caption:(0,m.__)("Chat")},{id:"gallery",caption:(0,m.__)("Gallery")},{id:"image",caption:(0,m.__)("Image")},{id:"link",caption:(0,m.__)("Link")},{id:"quote",caption:(0,m.__)("Quote")},{id:"standard",caption:(0,m.__)("Standard")},{id:"status",caption:(0,m.__)("Status")},{id:"video",caption:(0,m.__)("Video")}].sort(((e,t)=>{const s=e.caption.toUpperCase(),o=t.caption.toUpperCase();return s<o?-1:s>o?1:0}));function gl(){const e=`post-format-selector-${(0,pn.useInstanceId)(gl)}`,{postFormat:t,suggestedFormat:s,supportedFormats:o}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:s}=e(cn),o=t("format"),n=e(b.store).getThemeSupports();return{postFormat:null!=o?o:"standard",suggestedFormat:s(),supportedFormats:n.formats}}),[]),n=ml.filter((e=>o?.includes(e.id)||t===e.id)),i=n.find((e=>e.id===s)),{editPost:r}=(0,d.useDispatch)(cn),a=e=>r({format:e});return(0,T.jsx)(hl,{children:(0,T.jsxs)("div",{className:"editor-post-format",children:[(0,T.jsx)(Tn.RadioControl,{className:"editor-post-format__options",label:(0,m.__)("Post Format"),selected:t,onChange:e=>a(e),id:e,options:n.map((e=>({label:e.caption,value:e.id}))),hideLabelFromVision:!0}),i&&i.id!==t&&(0,T.jsx)("p",{className:"editor-post-format__suggestion",children:(0,T.jsx)(Tn.Button,{variant:"link",onClick:()=>a(i.id),children:(0,m.sprintf)((0,m.__)("Apply suggested format: %s"),i.caption)})})]})})}const _l=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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"})});const fl=function({children:e}){const{lastRevisionId:t,revisionsCount:s}=(0,d.useSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:s}=e(cn);return{lastRevisionId:t(),revisionsCount:s()}}),[]);return!t||s<2?null:(0,T.jsx)(fr,{supportKeys:"revisions",children:e})};function bl(){return(0,d.useSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:s}=e(cn);return{lastRevisionId:t(),revisionsCount:s()}}),[])}function yl(){const{lastRevisionId:e,revisionsCount:t}=bl();return(0,T.jsx)(fl,{children:(0,T.jsx)(_r,{label:(0,m.__)("Revisions"),children:(0,T.jsx)(Tn.Button,{href:(0,S.addQueryArgs)("revision.php",{revision:e}),className:"editor-private-post-last-revision__button",text:t,variant:"tertiary"})})})}const xl=function(){const{lastRevisionId:e,revisionsCount:t}=bl();return(0,T.jsx)(fl,{children:(0,T.jsx)(Tn.Button,{href:(0,S.addQueryArgs)("revision.php",{revision:e}),className:"editor-post-last-revision__title",icon:_l,iconPosition:"right",text:(0,m.sprintf)((0,m.__)("Revisions (%s)"),t)})})};const vl=function(){return(0,T.jsx)(fl,{children:(0,T.jsx)(Tn.PanelBody,{className:"editor-post-last-revision__panel",children:(0,T.jsx)(xl,{})})})};function wl(){const e="core/editor/post-locked-modal-"+(0,pn.useInstanceId)(wl),{autosave:t,updatePostLock:s}=(0,d.useDispatch)(cn),{isLocked:o,isTakeover:n,user:i,postId:r,postLockUtils:a,activePostLock:l,postType:c,previewLink:u}=(0,d.useSelect)((e=>{const{isPostLocked:t,isPostLockTakeover:s,getPostLockUser:o,getCurrentPostId:n,getActivePostLock:i,getEditedPostAttribute:r,getEditedPostPreviewLink:a,getEditorSettings:l}=e(cn),{getPostType:c}=e(b.store);return{isLocked:t(),isTakeover:s(),user:o(),postId:n(),postLockUtils:l().postLockUtils,activePostLock:i(),postType:c(r("type")),previewLink:a()}}),[]);if((0,C.useEffect)((()=>{function n(){if(o||!l)return;const e=new window.FormData;if(e.append("action","wp-remove-post-lock"),e.append("_wpnonce",a.unlockNonce),e.append("post_ID",r),e.append("active_post_lock",l),window.navigator.sendBeacon)window.navigator.sendBeacon(a.ajaxUrl,e);else{const t=new window.XMLHttpRequest;t.open("POST",a.ajaxUrl,!1),t.send(e)}}return(0,bs.addAction)("heartbeat.send",e,(function(e){o||(e["wp-refresh-post-lock"]={lock:l,post_id:r})})),(0,bs.addAction)("heartbeat.tick",e,(function(e){if(!e["wp-refresh-post-lock"])return;const o=e["wp-refresh-post-lock"];o.lock_error?(t(),s({isLocked:!0,isTakeover:!0,user:{name:o.lock_error.name,avatar:o.lock_error.avatar_src_2x}})):o.new_lock&&s({isLocked:!1,activePostLock:o.new_lock})})),window.addEventListener("beforeunload",n),()=>{(0,bs.removeAction)("heartbeat.send",e),(0,bs.removeAction)("heartbeat.tick",e),window.removeEventListener("beforeunload",n)}}),[]),!o)return null;const p=i.name,h=i.avatar,g=(0,S.addQueryArgs)("post.php",{"get-post-lock":"1",lockKey:!0,post:r,action:"edit",_wpnonce:a.nonce}),_=(0,S.addQueryArgs)("edit.php",{post_type:c?.slug}),f=(0,m.__)("Exit editor");return(0,T.jsx)(Tn.Modal,{title:n?(0,m.__)("Someone else has taken over this post"):(0,m.__)("This post is already being edited"),focusOnMount:!0,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,isDismissible:!1,size:"medium",children:(0,T.jsxs)(Tn.__experimentalHStack,{alignment:"top",spacing:6,children:[!!h&&(0,T.jsx)("img",{src:h,alt:(0,m.__)("Avatar"),className:"editor-post-locked-modal__avatar",width:64,height:64}),(0,T.jsxs)("div",{children:[!!n&&(0,T.jsx)("p",{children:(0,C.createInterpolateElement)(p?(0,m.sprintf)((0,m.__)("<strong>%s</strong> now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved."),p):(0,m.__)("Another user now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved."),{strong:(0,T.jsx)("strong",{}),PreviewLink:(0,T.jsx)(Tn.ExternalLink,{href:u,children:(0,m.__)("preview")})})}),!n&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("p",{children:(0,C.createInterpolateElement)(p?(0,m.sprintf)((0,m.__)("<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over."),p):(0,m.__)("Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over."),{strong:(0,T.jsx)("strong",{}),PreviewLink:(0,T.jsx)(Tn.ExternalLink,{href:u,children:(0,m.__)("preview")})})}),(0,T.jsx)("p",{children:(0,m.__)("If you take over, the other user will lose editing control to the post, but their changes will be saved.")})]}),(0,T.jsxs)(Tn.__experimentalHStack,{className:"editor-post-locked-modal__buttons",justify:"flex-end",children:[!n&&(0,T.jsx)(Tn.Button,{variant:"tertiary",href:g,children:(0,m.__)("Take over")}),(0,T.jsx)(Tn.Button,{variant:"primary",href:_,children:f})]})]})]})})}const Sl=function({children:e}){const{hasPublishAction:t,isPublished:s}=(0,d.useSelect)((e=>{var t;const{isCurrentPostPublished:s,getCurrentPost:o}=e(cn);return{hasPublishAction:null!==(t=o()._links?.["wp:action-publish"])&&void 0!==t&&t,isPublished:s()}}),[]);return s||!t?null:e};const kl=function(){const e=(0,d.useSelect)((e=>e(cn).getEditedPostAttribute("status")),[]),{editPost:t}=(0,d.useDispatch)(cn);return(0,T.jsx)(Sl,{children:(0,T.jsx)(Tn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,m.__)("Pending review"),checked:"pending"===e,onChange:()=>{t({status:"pending"===e?"draft":"pending"})}})})};function Pl({className:e,textContent:t,forceIsAutosaveable:s,role:o,onPreview:n}){const{postId:i,currentPostLink:r,previewLink:a,isSaveable:l,isViewable:c}=(0,d.useSelect)((e=>{var t;const s=e(cn),o=e(b.store).getPostType(s.getCurrentPostType("type"));return{postId:s.getCurrentPostId(),currentPostLink:s.getCurrentPostAttribute("link"),previewLink:s.getEditedPostPreviewLink(),isSaveable:s.isEditedPostSaveable(),isViewable:null!==(t=o?.viewable)&&void 0!==t&&t}}),[]),{__unstableSaveForPreview:u}=(0,d.useDispatch)(cn);if(!c)return null;const p=`wp-preview-${i}`,h=a||r;return(0,T.jsx)(Tn.Button,{variant:e?void 0:"tertiary",className:e||"editor-post-preview",href:h,target:p,__experimentalIsFocusable:!0,disabled:!l,onClick:async e=>{e.preventDefault();const t=window.open("",p);t.focus(),function(e){let t=(0,C.renderToString)((0,T.jsxs)("div",{className:"editor-post-preview-button__interstitial-message",children:[(0,T.jsxs)(Tn.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 96 96",children:[(0,T.jsx)(Tn.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,T.jsx)(Tn.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,T.jsx)("p",{children:(0,m.__)("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,bs.applyFilters)("editor.PostPreview.interstitialMarkup",t),e.write(t),e.title=(0,m.__)("Generating preview…"),e.close()}(t.document);const o=await u({forceIsAutosaveable:s});t.location=o,n?.()},role:o,size:"compact",children:t||(0,T.jsxs)(T.Fragment,{children:[(0,m._x)("Preview","imperative verb"),(0,T.jsx)(Tn.VisuallyHidden,{as:"span",children:(0,m.__)("(opens in a new tab)")})]})})}function Cl(){const e=(0,pn.useViewportMatch)("medium","<"),{isPublished:t,isBeingScheduled:s,isSaving:o,isPublishing:n,hasPublishAction:i,isAutosaving:r,hasNonPostEntityChanges:a,postStatusHasChanged:l,postStatus:c}=(0,d.useSelect)((e=>{var t;const{isCurrentPostPublished:s,isEditedPostBeingScheduled:o,isSavingPost:n,isPublishingPost:i,getCurrentPost:r,getCurrentPostType:a,isAutosavingPost:l,getPostEdits:c,getEditedPostAttribute:d}=e(cn);return{isPublished:s(),isBeingScheduled:o(),isSaving:n(),isPublishing:i(),hasPublishAction:null!==(t=r()._links?.["wp:action-publish"])&&void 0!==t&&t,postType:a(),isAutosaving:l(),hasNonPostEntityChanges:e(cn).hasNonPostEntityChanges(),postStatusHasChanged:!!c()?.status,postStatus:d("status")}}),[]);return n?(0,m.__)("Publishing…"):(t||s)&&o&&!r?(0,m.__)("Saving…"):i?a||t||l&&!["future","publish"].includes(c)||!l&&"future"===c?(0,m.__)("Save"):s?(0,m.__)("Schedule"):(0,m.__)("Publish"):e?(0,m.__)("Publish"):(0,m.__)("Submit for Review")}const jl=()=>{};class Tl extends C.Component{constructor(e){super(e),this.buttonNode=(0,C.createRef)(),this.createOnClick=this.createOnClick.bind(this),this.closeEntitiesSavedStates=this.closeEntitiesSavedStates.bind(this),this.state={entitiesSavedStatesCallback:!1}}componentDidMount(){this.props.focusOnMount&&(this.timeoutID=setTimeout((()=>{this.buttonNode.current.focus()}),0))}componentWillUnmount(){clearTimeout(this.timeoutID)}createOnClick(e){return(...t)=>{const{hasNonPostEntityChanges:s,setEntitiesSavedStatesCallback:o}=this.props;return s&&o?(this.setState({entitiesSavedStatesCallback:()=>e(...t)}),o((()=>this.closeEntitiesSavedStates)),jl):e(...t)}}closeEntitiesSavedStates(e){const{postType:t,postId:s}=this.props,{entitiesSavedStatesCallback:o}=this.state;this.setState({entitiesSavedStatesCallback:!1},(()=>{e&&e.some((e=>"postType"===e.kind&&e.name===t&&e.key===s))&&o()}))}render(){const{forceIsDirty:e,hasPublishAction:t,isBeingScheduled:s,isOpen:o,isPostSavingLocked:n,isPublishable:i,isPublished:r,isSaveable:a,isSaving:l,isAutoSaving:c,isToggle:d,savePostStatus:u,onSubmit:p=jl,onToggle:h,visibility:m,hasNonPostEntityChanges:g,isSavingNonPostEntityChanges:_,postStatus:f,postStatusHasChanged:b}=this.props,y=(l||!a||n||!i&&!e)&&(!g||_),x=(r||l||!a||!i&&!e)&&(!g||_);let v="publish";b?v=f:t?"private"===m?v="private":s&&(v="future"):v="pending";const w={"aria-disabled":y,className:"editor-post-publish-button",isBusy:!c&&l,variant:"primary",onClick:this.createOnClick((()=>{y||(p(),u(v))}))},S={"aria-disabled":x,"aria-expanded":o,className:"editor-post-publish-panel__toggle",isBusy:l&&r,variant:"primary",size:"compact",onClick:this.createOnClick((()=>{x||h()}))},k=d?S:w;return(0,T.jsx)(T.Fragment,{children:(0,T.jsx)(Tn.Button,{ref:this.buttonNode,...k,className:`${k.className} editor-post-publish-button__button`,size:"compact",children:(0,T.jsx)(Cl,{})})})}}const El=(0,pn.compose)([(0,d.withSelect)((e=>{var t;const{isSavingPost:s,isAutosavingPost:o,isEditedPostBeingScheduled:n,getEditedPostVisibility:i,isCurrentPostPublished:r,isEditedPostSaveable:a,isEditedPostPublishable:l,isPostSavingLocked:c,getCurrentPost:d,getCurrentPostType:u,getCurrentPostId:p,hasNonPostEntityChanges:h,isSavingNonPostEntityChanges:m,getEditedPostAttribute:g,getPostEdits:_}=e(cn);return{isSaving:s(),isAutoSaving:o(),isBeingScheduled:n(),visibility:i(),isSaveable:a(),isPostSavingLocked:c(),isPublishable:l(),isPublished:r(),hasPublishAction:null!==(t=d()._links?.["wp:action-publish"])&&void 0!==t&&t,postType:u(),postId:p(),postStatus:g("status"),postStatusHasChanged:_()?.status,hasNonPostEntityChanges:h(),isSavingNonPostEntityChanges:m()}})),(0,d.withDispatch)((e=>{const{editPost:t,savePost:s}=e(cn);return{savePostStatus:e=>{t({status:e},{undoIgnore:!0}),s()}}}))])(Tl),Bl=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,T.jsx)(j.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"})}),Il={public:{label:(0,m.__)("Public"),info:(0,m.__)("Visible to everyone.")},private:{label:(0,m.__)("Private"),info:(0,m.__)("Only visible to site admins and editors.")},password:{label:(0,m.__)("Password protected"),info:(0,m.__)("Only those with the password can view this post.")}};function Nl({onClose:e}){const t=(0,pn.useInstanceId)(Nl),{status:s,visibility:o,password:n}=(0,d.useSelect)((e=>({status:e(cn).getEditedPostAttribute("status"),visibility:e(cn).getEditedPostVisibility(),password:e(cn).getEditedPostAttribute("password")}))),{editPost:i,savePost:r}=(0,d.useDispatch)(cn),[a,l]=(0,C.useState)(!!n),[c,u]=(0,C.useState)(!1);return(0,T.jsxs)("div",{className:"editor-post-visibility",children:[(0,T.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,m.__)("Visibility"),help:(0,m.__)("Control how this post is viewed."),onClose:e}),(0,T.jsxs)("fieldset",{className:"editor-post-visibility__fieldset",children:[(0,T.jsx)(Tn.VisuallyHidden,{as:"legend",children:(0,m.__)("Visibility")}),(0,T.jsx)(Al,{instanceId:t,value:"public",label:Il.public.label,info:Il.public.info,checked:"public"===o&&!a,onChange:()=>{i({status:"private"===o?"draft":s,password:""}),l(!1)}}),(0,T.jsx)(Al,{instanceId:t,value:"private",label:Il.private.label,info:Il.private.info,checked:"private"===o,onChange:()=>{u(!0)}}),(0,T.jsx)(Al,{instanceId:t,value:"password",label:Il.password.label,info:Il.password.info,checked:a,onChange:()=>{i({status:"private"===o?"draft":s,password:n||""}),l(!0)}}),a&&(0,T.jsxs)("div",{className:"editor-post-visibility__password",children:[(0,T.jsx)(Tn.VisuallyHidden,{as:"label",htmlFor:`editor-post-visibility__password-input-${t}`,children:(0,m.__)("Create password")}),(0,T.jsx)("input",{className:"editor-post-visibility__password-input",id:`editor-post-visibility__password-input-${t}`,type:"text",onChange:e=>{i({password:e.target.value})},value:n,placeholder:(0,m.__)("Use a secure password")})]})]}),(0,T.jsx)(Tn.__experimentalConfirmDialog,{isOpen:c,onConfirm:()=>{i({status:"private",password:""}),l(!1),u(!1),r()},onCancel:()=>{u(!1)},confirmButtonText:(0,m.__)("Publish"),size:"medium",children:(0,m.__)("Would you like to privately publish this post now?")})]})}function Al({instanceId:e,value:t,label:s,info:o,...n}){return(0,T.jsxs)("div",{className:"editor-post-visibility__choice",children:[(0,T.jsx)("input",{type:"radio",name:`editor-post-visibility__setting-${e}`,value:t,id:`editor-post-${t}-${e}`,"aria-describedby":`editor-post-${t}-${e}-description`,className:"editor-post-visibility__radio",...n}),(0,T.jsx)("label",{htmlFor:`editor-post-${t}-${e}`,className:"editor-post-visibility__label",children:s}),(0,T.jsx)("p",{id:`editor-post-${t}-${e}-description`,className:"editor-post-visibility__info",children:o})]})}function Dl(){return Rl()}function Rl(){const e=(0,d.useSelect)((e=>e(cn).getEditedPostVisibility()));return Il[e]?.label}function Ml(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 Ol(e){const t=Ml(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Ll(e){const t=Ml(e),s=t.getMonth();return t.setFullYear(t.getFullYear(),s+1,0),t.setHours(23,59,59,999),t}Math.pow(10,8);const Fl=6e4,Vl=36e5;function Ul(e,t){const s=t?.additionalDigits??2,o=function(e){const t={},s=e.split(zl.dateTimeDelimiter);let o;if(s.length>2)return t;/:/.test(s[0])?o=s[0]:(t.date=s[0],o=s[1],zl.timeZoneDelimiter.test(t.date)&&(t.date=e.split(zl.timeZoneDelimiter)[0],o=e.substr(t.date.length,e.length)));if(o){const e=zl.timezone.exec(o);e?(t.time=o.replace(e[1],""),t.timezone=e[1]):t.time=o}return t}(e);let n;if(o.date){const e=function(e,t){const s=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),o=e.match(s);if(!o)return{year:NaN,restDateString:""};const n=o[1]?parseInt(o[1]):null,i=o[2]?parseInt(o[2]):null;return{year:null===i?n:100*i,restDateString:e.slice((o[1]||o[2]).length)}}(o.date,s);n=function(e,t){if(null===t)return new Date(NaN);const s=e.match(Hl);if(!s)return new Date(NaN);const o=!!s[4],n=Wl(s[1]),i=Wl(s[2])-1,r=Wl(s[3]),a=Wl(s[4]),l=Wl(s[5])-1;if(o)return function(e,t,s){return t>=1&&t<=53&&s>=0&&s<=6}(0,a,l)?function(e,t,s){const o=new Date(0);o.setUTCFullYear(e,0,4);const n=o.getUTCDay()||7,i=7*(t-1)+s+1-n;return o.setUTCDate(o.getUTCDate()+i),o}(t,a,l):new Date(NaN);{const e=new Date(0);return function(e,t,s){return t>=0&&t<=11&&s>=1&&s<=(Zl[t]||(Yl(e)?29:28))}(t,i,r)&&function(e,t){return t>=1&&t<=(Yl(e)?366:365)}(t,n)?(e.setUTCFullYear(t,i,Math.max(n,r)),e):new Date(NaN)}}(e.restDateString,e.year)}if(!n||isNaN(n.getTime()))return new Date(NaN);const i=n.getTime();let r,a=0;if(o.time&&(a=function(e){const t=e.match(Gl);if(!t)return NaN;const s=Kl(t[1]),o=Kl(t[2]),n=Kl(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,o,n))return NaN;return s*Vl+o*Fl+1e3*n}(o.time),isNaN(a)))return new Date(NaN);if(!o.timezone){const e=new Date(i+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 r=function(e){if("Z"===e)return 0;const t=e.match($l);if(!t)return 0;const s="+"===t[1]?-1:1,o=parseInt(t[2]),n=t[3]&&parseInt(t[3])||0;if(!function(e,t){return t>=0&&t<=59}(0,n))return NaN;return s*(o*Vl+n*Fl)}(o.timezone),isNaN(r)?new Date(NaN):new Date(i+a+r)}const zl={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Hl=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Gl=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,$l=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Wl(e){return e?parseInt(e):1}function Kl(e){return e&&parseFloat(e.replace(",","."))||0}const Zl=[31,null,31,30,31,30,31,31,30,31,30,31];function Yl(e){return e%400==0||e%4==0&&e%100!=0}const{PrivatePublishDateTimePicker:ql}=h(g.privateApis);function Ql(e){return(0,T.jsx)(Xl,{...e,showPopoverHeaderActions:!0,isCompact:!1})}function Xl({onClose:e,showPopoverHeaderActions:t,isCompact:s}){const{postDate:o,postType:n}=(0,d.useSelect)((e=>({postDate:e(cn).getEditedPostAttribute("date"),postType:e(cn).getCurrentPostType()})),[]),{editPost:i}=(0,d.useDispatch)(cn),[r,a]=(0,C.useState)(Ol(new Date(o))),l=(0,d.useSelect)((e=>e(b.store).getEntityRecords("postType",n,{status:"publish,future",after:Ol(r).toISOString(),before:Ll(r).toISOString(),exclude:[e(cn).getCurrentPostId()],per_page:100,_fields:"id,date"})),[r,n]),c=(0,C.useMemo)((()=>(l||[]).map((({date:e})=>({date:new Date(e)})))),[l]),u=(0,w.getSettings)(),p=/a(?!\\)/i.test(u.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,T.jsx)(ql,{currentDate:o,onChange:e=>i({date:e}),is12Hour:p,events:c,onMonthPreviewed:e=>a(Ul(e)),onClose:e,isCompact:s,showPopoverHeaderActions:t})}function Jl(e){return ec(e)}function ec({full:e=!1}={}){const{date:t,isFloating:s}=(0,d.useSelect)((e=>({date:e(cn).getEditedPostAttribute("date"),isFloating:e(cn).isEditedPostDateFloating()})),[]);return e?tc(t):function(e,{isFloating:t=!1,now:s=new Date}={}){if(!e||t)return(0,m.__)("Immediately");if(!function(e){const{timezone:t}=(0,w.getSettings)(),s=Number(t.offset),o=e.getTimezoneOffset()/60*-1;return s===o}(s))return tc(e);const o=(0,w.getDate)(e);if(sc(o,s))return(0,m.sprintf)((0,m.__)("Today at %s"),(0,w.dateI18n)((0,m._x)("g:i a","post schedule time format"),o));const n=new Date(s);if(n.setDate(n.getDate()+1),sc(o,n))return(0,m.sprintf)((0,m.__)("Tomorrow at %s"),(0,w.dateI18n)((0,m._x)("g:i a","post schedule time format"),o));if(o.getFullYear()===s.getFullYear())return(0,w.dateI18n)((0,m._x)("F j g:i a","post schedule date format without year"),o);return(0,w.dateI18n)((0,m._x)("F j, Y g:i a","post schedule full date format"),o)}(t,{isFloating:s})}function tc(e){const t=(0,w.getDate)(e),s=function(){const{timezone:e}=(0,w.getSettings)();if(e.abbr&&isNaN(Number(e.abbr)))return e.abbr;const t=e.offset<0?"":"+";return`UTC${t}${e.offsetFormatted}`}(),o=(0,w.dateI18n)((0,m._x)("F j, Y g:i a","post schedule full date format"),t);return(0,m.isRTL)()?`${s} ${o}`:`${o} ${s}`}function sc(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}const oc=3,nc={per_page:10,orderby:"count",order:"desc",hide_empty:!0,_fields:"id,name,count",context:"view"};function ic({onSelect:e,taxonomy:t}){const{_terms:s,showTerms:o}=(0,d.useSelect)((e=>{const s=e(b.store).getEntityRecords("taxonomy",t.slug,nc);return{_terms:s,showTerms:s?.length>=oc}}),[t.slug]);if(!o)return null;const n=jr(s);return(0,T.jsxs)("div",{className:"editor-post-taxonomies__flat-term-most-used",children:[(0,T.jsx)(Tn.BaseControl.VisualLabel,{as:"h3",className:"editor-post-taxonomies__flat-term-most-used-label",children:t.labels.most_used}),(0,T.jsx)("ul",{role:"list",className:"editor-post-taxonomies__flat-term-most-used-list",children:n.map((t=>(0,T.jsx)("li",{children:(0,T.jsx)(Tn.Button,{variant:"link",onClick:()=>e(t),children:t.name})},t.id)))})]})}const rc=[],ac=20,lc={per_page:ac,_fields:"id,name",context:"view"},cc=(e,t)=>Pr(e).toLowerCase()===Pr(t).toLowerCase(),dc=(e,t)=>e.map((e=>t.find((t=>cc(t.name,e)))?.id)).filter((e=>void 0!==e));function uc({slug:e}){var t,s;const[o,n]=(0,C.useState)([]),[i,r]=(0,C.useState)(""),a=(0,pn.useDebounce)(r,500),{terms:l,termIds:c,taxonomy:u,hasAssignAction:p,hasCreateAction:h,hasResolvedTerms:g}=(0,d.useSelect)((t=>{var s,o;const{getCurrentPost:n,getEditedPostAttribute:i}=t(cn),{getEntityRecords:r,getTaxonomy:a,hasFinishedResolution:l}=t(b.store),c=n(),d=a(e),u=d?i(d.rest_base):rc,p={...lc,include:u.join(","),per_page:-1};return{hasCreateAction:!!d&&(null!==(s=c._links?.["wp:action-create-"+d.rest_base])&&void 0!==s&&s),hasAssignAction:!!d&&(null!==(o=c._links?.["wp:action-assign-"+d.rest_base])&&void 0!==o&&o),taxonomy:d,termIds:u,terms:u.length?r("taxonomy",e,p):rc,hasResolvedTerms:l("getEntityRecords",["taxonomy",e,p])}}),[e]),{searchResults:_}=(0,d.useSelect)((t=>{const{getEntityRecords:s}=t(b.store);return{searchResults:i?s("taxonomy",e,{...lc,search:i}):rc}}),[i,e]);(0,C.useEffect)((()=>{if(g){const e=(null!=l?l:[]).map((e=>Pr(e.name)));n(e)}}),[l,g]);const f=(0,C.useMemo)((()=>(null!=_?_:[]).map((e=>Pr(e.name)))),[_]),{editPost:y}=(0,d.useDispatch)(cn),{saveEntityRecord:x}=(0,d.useDispatch)(b.store),{createErrorNotice:v}=(0,d.useDispatch)(fs.store);if(!p)return null;function w(e){y({[u.rest_base]:e})}const S=null!==(t=u?.labels?.add_new_item)&&void 0!==t?t:"post_tag"===e?(0,m.__)("Add new tag"):(0,m.__)("Add new Term"),k=null!==(s=u?.labels?.singular_name)&&void 0!==s?s:"post_tag"===e?(0,m.__)("Tag"):(0,m.__)("Term"),P=(0,m.sprintf)((0,m._x)("%s added","term"),k),j=(0,m.sprintf)((0,m._x)("%s removed","term"),k),E=(0,m.sprintf)((0,m._x)("Remove %s","term"),k);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Tn.FormTokenField,{__next40pxDefaultSize:!0,value:o,suggestions:f,onChange:function(t){const s=[...null!=l?l:[],...null!=_?_:[]],o=t.reduce(((e,t)=>(e.some((e=>e.toLowerCase()===t.toLowerCase()))||e.push(t),e)),[]),i=o.filter((e=>!s.find((t=>cc(t.name,e)))));n(o),0!==i.length?h&&Promise.all(i.map((t=>async function(t){try{const s=await x("taxonomy",e,t,{throwOnError:!0});return Cr(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);w(dc(o,t))})).catch((e=>{v(e.message,{type:"snackbar"}),w(dc(o,s))})):w(dc(o,s))},onInputChange:a,maxSuggestions:ac,label:S,messages:{added:P,removed:j,remove:E}}),(0,T.jsx)(ic,{taxonomy:u,onSelect:function(t){var s;if(c.includes(t.id))return;const o=[...c,t.id],n="post_tag"===e?(0,m.__)("Tag"):(0,m.__)("Term"),i=(0,m.sprintf)((0,m._x)("%s added","term"),null!==(s=u?.labels?.singular_name)&&void 0!==s?s:n);(0,ms.speak)(i,"assertive"),w(o)}})]})}const pc=(0,Tn.withFilters)("editor.PostTaxonomyType")(uc),hc=()=>{const e=[(0,m.__)("Suggestion:"),(0,T.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,m.__)("Add tags")},"label")];return(0,T.jsxs)(Tn.PanelBody,{initialOpen:!1,title:e,children:[(0,T.jsx)("p",{children:(0,m.__)("Tags help users and search engines navigate your site and find your content. Add a few keywords to describe your post.")}),(0,T.jsx)(pc,{slug:"post_tag"})]})},mc=()=>{const{hasTags:e,isPostTypeSupported:t}=(0,d.useSelect)((e=>{const t=e(cn).getCurrentPostType(),s=e(b.store).getTaxonomy("post_tag"),o=s?.types?.includes(t),n=void 0!==s,i=s&&e(cn).getEditedPostAttribute(s.rest_base);return{hasTags:!!i?.length,isPostTypeSupported:n&&o}}),[]),[s]=(0,C.useState)(e);return t?s?null:(0,T.jsx)(hc,{}):null},gc=(e,t)=>ml.filter((t=>e?.includes(t.id))).find((e=>e.id===t)),_c=({suggestedPostFormat:e,suggestionText:t,onUpdatePostFormat:s})=>(0,T.jsx)(Tn.Button,{variant:"link",onClick:()=>s(e),children:t});function fc(){const{currentPostFormat:e,suggestion:t}=(0,d.useSelect)((e=>{var t;const{getEditedPostAttribute:s,getSuggestedPostFormat:o}=e(cn),n=null!==(t=e(b.store).getThemeSupports().formats)&&void 0!==t?t:[];return{currentPostFormat:s("format"),suggestion:gc(n,o())}}),[]),{editPost:s}=(0,d.useDispatch)(cn),o=[(0,m.__)("Suggestion:"),(0,T.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,m.__)("Use a post format")},"label")];return t&&t.id!==e?(0,T.jsxs)(Tn.PanelBody,{initialOpen:!1,title:o,children:[(0,T.jsx)("p",{children:(0,m.__)("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,T.jsx)("p",{children:(0,T.jsx)(_c,{onUpdatePostFormat:e=>s({format:e}),suggestedPostFormat:t.id,suggestionText:(0,m.sprintf)((0,m.__)('Apply the "%1$s" format.'),t.caption)})})]}):null}const bc={per_page:-1,orderby:"name",order:"asc",_fields:"id,name,parent",context:"view"},yc=8,xc=[];function vc({slug:e}){var t,s;const[o,n]=(0,C.useState)(!1),[i,r]=(0,C.useState)(""),[a,l]=(0,C.useState)(""),[c,u]=(0,C.useState)(!1),[p,h]=(0,C.useState)(""),[g,_]=(0,C.useState)([]),f=(0,pn.useDebounce)(ms.speak,500),{hasCreateAction:y,hasAssignAction:x,terms:v,loading:w,availableTerms:S,taxonomy:k}=(0,d.useSelect)((t=>{var s,o;const{getCurrentPost:n,getEditedPostAttribute:i}=t(cn),{getTaxonomy:r,getEntityRecords:a,isResolving:l}=t(b.store),c=r(e),d=n();return{hasCreateAction:!!c&&(null!==(s=d._links?.["wp:action-create-"+c.rest_base])&&void 0!==s&&s),hasAssignAction:!!c&&(null!==(o=d._links?.["wp:action-assign-"+c.rest_base])&&void 0!==o&&o),terms:c?i(c.rest_base):xc,loading:l("getEntityRecords",["taxonomy",e,bc]),availableTerms:a("taxonomy",e,bc)||xc,taxonomy:c}}),[e]),{editPost:P}=(0,d.useDispatch)(cn),{saveEntityRecord:j}=(0,d.useDispatch)(b.store),E=(0,C.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,o=[...e];return o.sort(((e,t)=>{const o=s(e),n=s(t);return o===n?0:o&&!n?-1:!o&&n?1:0})),o}(kr(S),v)),[S]),{createErrorNotice:B}=(0,d.useDispatch)(fs.store);if(!x)return null;const I=e=>{P({[k.rest_base]:e})},N=e=>e.map((e=>(0,T.jsxs)("div",{className:"editor-post-taxonomies__hierarchical-terms-choice",children:[(0,T.jsx)(Tn.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:-1!==v.indexOf(e.id),onChange:()=>{(e=>{const t=v.includes(e)?v.filter((t=>t!==e)):[...v,e];I(t)})(parseInt(e.id,10))},label:(0,Mo.decodeEntities)(e.name)}),!!e.children.length&&(0,T.jsx)("div",{className:"editor-post-taxonomies__hierarchical-terms-subchoices",children:N(e.children)})]},e.id))),A=(t,s,o)=>{var n;return null!==(n=k?.labels?.[t])&&void 0!==n?n:"category"===e?s:o},D=A("add_new_item",(0,m.__)("Add new category"),(0,m.__)("Add new term")),R=A("new_item_name",(0,m.__)("Add new category"),(0,m.__)("Add new term")),M=A("parent_item",(0,m.__)("Parent Category"),(0,m.__)("Parent Term")),O=`— ${M} —`,L=D,F=null!==(t=k?.labels?.search_items)&&void 0!==t?t:(0,m.__)("Search Terms"),V=null!==(s=k?.name)&&void 0!==s?s:(0,m.__)("Terms"),U=S.length>=yc;return(0,T.jsxs)(Tn.Flex,{direction:"column",gap:"4",children:[U&&(0,T.jsx)(Tn.TextControl,{__nextHasNoMarginBottom:!0,label:F,value:p,onChange:e=>{const t=E.map(function(e){const t=s=>{if(""===e)return s;const o={...s};return o.children.length>0&&(o.children=o.children.map(t).filter((e=>e))),(-1!==o.name.toLowerCase().indexOf(e.toLowerCase())||o.children.length>0)&&o};return t}(e)).filter((e=>e)),s=e=>{let t=0;for(let o=0;o<e.length;o++)t++,void 0!==e[o].children&&(t+=s(e[o].children));return t};h(e),_(t);const o=s(t),n=(0,m.sprintf)((0,m._n)("%d result found.","%d results found.",o),o);f(n,"assertive")}}),(0,T.jsx)("div",{className:"editor-post-taxonomies__hierarchical-terms-list",tabIndex:"0",role:"group","aria-label":V,children:N(""!==p?g:E)}),!w&&y&&(0,T.jsx)(Tn.FlexItem,{children:(0,T.jsx)(Tn.Button,{onClick:()=>{u(!c)},className:"editor-post-taxonomies__hierarchical-terms-add","aria-expanded":c,variant:"link",children:D})}),c&&(0,T.jsx)("form",{onSubmit:async t=>{var s;if(t.preventDefault(),""===i||o)return;const c=function(e,t,s){return e.find((e=>(!e.parent&&!t||parseInt(e.parent)===parseInt(t))&&e.name.toLowerCase()===s.toLowerCase()))}(S,a,i);if(c)return v.some((e=>e===c.id))||I([...v,c.id]),r(""),void l("");let d;n(!0);try{d=await(u={name:i,parent:a||void 0},j("taxonomy",e,u,{throwOnError:!0}))}catch(e){return void B(e.message,{type:"snackbar"})}var u;const p="category"===e?(0,m.__)("Category"):(0,m.__)("Term"),h=(0,m.sprintf)((0,m._x)("%s added","term"),null!==(s=k?.labels?.singular_name)&&void 0!==s?s:p);(0,ms.speak)(h,"assertive"),n(!1),r(""),l(""),I([...v,d.id])},children:(0,T.jsxs)(Tn.Flex,{direction:"column",gap:"4",children:[(0,T.jsx)(Tn.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"editor-post-taxonomies__hierarchical-terms-input",label:R,value:i,onChange:e=>{r(e)},required:!0}),!!S.length&&(0,T.jsx)(Tn.TreeSelect,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:M,noOptionLabel:O,onChange:e=>{l(e)},selectedId:a,tree:E}),(0,T.jsx)(Tn.FlexItem,{children:(0,T.jsx)(Tn.Button,{__next40pxDefaultSize:!0,variant:"secondary",type:"submit",className:"editor-post-taxonomies__hierarchical-terms-submit",children:L})})]})})]})}const wc=(0,Tn.withFilters)("editor.PostTaxonomyType")(vc);const Sc=function(){const e=(0,d.useSelect)((e=>{const t=e(cn).getCurrentPostType(),{canUser:s,getEntityRecord:o,getTaxonomy:n}=e(b.store),i=n("category"),r=s("read","settings")?o("root","site")?.default_category:void 0,a=r?o("taxonomy","category",r):void 0,l=i&&i.types.some((e=>e===t)),c=i&&e(cn).getEditedPostAttribute(i.rest_base);return!!i&&!!a&&l&&(0===c?.length||1===c?.length&&a?.id===c[0])}),[]),[t,s]=(0,C.useState)(!1);if((0,C.useEffect)((()=>{e&&s(!0)}),[e]),!t)return null;const o=[(0,m.__)("Suggestion:"),(0,T.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,m.__)("Assign a category")},"label")];return(0,T.jsxs)(Tn.PanelBody,{initialOpen:!1,title:o,children:[(0,T.jsx)("p",{children:(0,m.__)("Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.")}),(0,T.jsx)(wc,{slug:"category"})]})};function kc(e){const t=[];return e.forEach((e=>{t.push(e),t.push(...kc(e.innerBlocks))})),t}function Pc(e){const{selectBlock:t}=(0,d.useDispatch)(g.store);return(0,T.jsx)(Tn.__unstableMotion.img,{tabIndex:0,role:"button","aria-label":(0,m.__)("Select image block."),onClick:()=>{t(e.clientId)},onKeyDown:s=>{"Enter"!==s.key&&" "!==s.key||(t(e.clientId),s.preventDefault())},alt:e.attributes.alt,src:e.attributes.url,animate:{opacity:1},exit:{opacity:0,scale:0},style:{width:"36px",height:"36px",objectFit:"cover",borderRadius:"2px",cursor:"pointer"},whileHover:{scale:1.08}},e.clientId)}function Cc(){const[e,t]=(0,C.useState)(!1),{editorBlocks:s,mediaUpload:o}=(0,d.useSelect)((e=>({editorBlocks:e(cn).getEditorBlocks(),mediaUpload:e(g.store).getSettings().mediaUpload})),[]),n=kc(s).filter((e=>"core/image"===e.name&&e.attributes.url&&!e.attributes.id)),{updateBlockAttributes:i}=(0,d.useDispatch)(g.store);if(!o||!n.length)return null;const r=[(0,m.__)("Suggestion:"),(0,T.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,m.__)("External media")},"label")];return(0,T.jsxs)(Tn.PanelBody,{initialOpen:!0,title:r,children:[(0,T.jsx)("p",{children:(0,m.__)("Upload external images to the Media Library. Images from different domains may load slowly, display incorrectly, or be removed unexpectedly.")}),(0,T.jsxs)("div",{style:{display:"inline-flex",flexWrap:"wrap",gap:"8px"},children:[(0,T.jsx)(Tn.__unstableAnimatePresence,{children:n.map((e=>(0,T.jsx)(Pc,{...e},e.clientId)))}),e?(0,T.jsx)(Tn.Spinner,{}):(0,T.jsx)(Tn.Button,{variant:"primary",onClick:function(){t(!0),Promise.all(n.map((e=>window.fetch(e.attributes.url.includes("?")?e.attributes.url:e.attributes.url+"?").then((e=>e.blob())).then((t=>new Promise(((s,n)=>{o({filesList:[t],onFileChange:([t])=>{(0,tl.isBlobURL)(t.url)||(i(e.clientId,{id:t.id,url:t.url}),s())},onError(){n()}})}))))))).finally((()=>{t(!1)}))},children:(0,m.__)("Upload")})]})]})}const jc=function({children:e}){const{isBeingScheduled:t,isRequestingSiteIcon:s,hasPublishAction:o,siteIconUrl:n,siteTitle:i,siteHome:r}=(0,d.useSelect)((e=>{var t;const{getCurrentPost:s,isEditedPostBeingScheduled:o}=e(cn),{getEntityRecord:n,isResolving:i}=e(b.store),r=n("root","__unstableBase",void 0)||{};return{hasPublishAction:null!==(t=s()._links?.["wp:action-publish"])&&void 0!==t&&t,isBeingScheduled:o(),isRequestingSiteIcon:i("getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:r.site_icon_url,siteTitle:r.name,siteHome:r.home&&(0,S.filterURLForDisplay)(r.home)}}),[]);let a,l,c=(0,T.jsx)(Tn.Icon,{className:"components-site-icon",size:"36px",icon:Bl});return n&&(c=(0,T.jsx)("img",{alt:(0,m.__)("Site Icon"),className:"components-site-icon",src:n})),s&&(c=null),o?t?(a=(0,m.__)("Are you ready to schedule?"),l=(0,m.__)("Your work will be published at the specified date and time.")):(a=(0,m.__)("Are you ready to publish?"),l=(0,m.__)("Double-check your settings before publishing.")):(a=(0,m.__)("Are you ready to submit for review?"),l=(0,m.__)("When you’re ready, submit your work for review, and an Editor will be able to approve it for you.")),(0,T.jsxs)("div",{className:"editor-post-publish-panel__prepublish",children:[(0,T.jsx)("div",{children:(0,T.jsx)("strong",{children:a})}),(0,T.jsx)("p",{children:l}),(0,T.jsxs)("div",{className:"components-site-card",children:[c,(0,T.jsxs)("div",{className:"components-site-info",children:[(0,T.jsx)("span",{className:"components-site-name",children:(0,Mo.decodeEntities)(i)||(0,m.__)("(Untitled)")}),(0,T.jsx)("span",{className:"components-site-home",children:r})]})]}),(0,T.jsx)(Cc,{}),o&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Tn.PanelBody,{initialOpen:!1,title:[(0,m.__)("Visibility:"),(0,T.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,T.jsx)(Dl,{})},"label")],children:(0,T.jsx)(Nl,{})}),(0,T.jsx)(Tn.PanelBody,{initialOpen:!1,title:[(0,m.__)("Publish:"),(0,T.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,T.jsx)(Jl,{})},"label")],children:(0,T.jsx)(Ql,{})})]}),(0,T.jsx)(fc,{}),(0,T.jsx)(mc,{}),(0,T.jsx)(Sc,{}),e]})},Tc="%postname%",Ec="%pagename%";function Bc({text:e,onCopy:t,children:s}){const o=(0,pn.useCopyToClipboard)(e,t);return(0,T.jsx)(Tn.Button,{variant:"secondary",ref:o,children:s})}class Ic extends C.Component{constructor(){super(...arguments),this.state={showCopyConfirmation:!1},this.onCopy=this.onCopy.bind(this),this.onSelectInput=this.onSelectInput.bind(this),this.postLink=(0,C.createRef)()}componentDidMount(){this.props.focusOnMount&&this.postLink.current.focus()}componentWillUnmount(){clearTimeout(this.dismissCopyConfirmation)}onCopy(){this.setState({showCopyConfirmation:!0}),clearTimeout(this.dismissCopyConfirmation),this.dismissCopyConfirmation=setTimeout((()=>{this.setState({showCopyConfirmation:!1})}),4e3)}onSelectInput(e){e.target.select()}render(){const{children:e,isScheduled:t,post:s,postType:o}=this.props,n=o?.labels?.singular_name,i=o?.labels?.view_item,r=o?.labels?.add_new_item,a="future"===s.status?(e=>{const{slug:t}=e;return e.permalink_template.includes(Tc)?e.permalink_template.replace(Tc,t):e.permalink_template.includes(Ec)?e.permalink_template.replace(Ec,t):e.permalink_template})(s):s.link,l=(0,S.addQueryArgs)("post-new.php",{post_type:s.type}),c=t?(0,T.jsxs)(T.Fragment,{children:[(0,m.__)("is now scheduled. It will go live on")," ",(0,T.jsx)(Jl,{}),"."]}):(0,m.__)("is now live.");return(0,T.jsxs)("div",{className:"post-publish-panel__postpublish",children:[(0,T.jsxs)(Tn.PanelBody,{className:"post-publish-panel__postpublish-header",children:[(0,T.jsx)("a",{ref:this.postLink,href:a,children:(0,Mo.decodeEntities)(s.title)||(0,m.__)("(no title)")})," ",c]}),(0,T.jsxs)(Tn.PanelBody,{children:[(0,T.jsx)("p",{className:"post-publish-panel__postpublish-subheader",children:(0,T.jsx)("strong",{children:(0,m.__)("What’s next?")})}),(0,T.jsxs)("div",{className:"post-publish-panel__postpublish-post-address-container",children:[(0,T.jsx)(Tn.TextControl,{__nextHasNoMarginBottom:!0,className:"post-publish-panel__postpublish-post-address",readOnly:!0,label:(0,m.sprintf)((0,m.__)("%s address"),n),value:(0,S.safeDecodeURIComponent)(a),onFocus:this.onSelectInput}),(0,T.jsx)("div",{className:"post-publish-panel__postpublish-post-address__copy-button-wrap",children:(0,T.jsx)(Bc,{text:a,onCopy:this.onCopy,children:this.state.showCopyConfirmation?(0,m.__)("Copied!"):(0,m.__)("Copy")})})]}),(0,T.jsxs)("div",{className:"post-publish-panel__postpublish-buttons",children:[!t&&(0,T.jsx)(Tn.Button,{variant:"primary",href:a,children:i}),(0,T.jsx)(Tn.Button,{variant:t?"primary":"secondary",href:l,children:r})]})]}),e]})}}const Nc=(0,d.withSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPost:s,isCurrentPostScheduled:o}=e(cn),{getPostType:n}=e(b.store);return{post:s(),postType:n(t("type")),isScheduled:o()}}))(Ic);class Ac extends C.Component{constructor(){super(...arguments),this.onSubmit=this.onSubmit.bind(this)}componentDidUpdate(e){e.isPublished&&!this.props.isSaving&&this.props.isDirty&&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:o,isScheduled:n,isSaving:i,isSavingNonPostEntityChanges:r,onClose:a,onTogglePublishSidebar:l,PostPublishExtension:c,PrePublishExtension:d,...u}=this.props,{hasPublishAction:p,isDirty:h,isPostTypeViewable:g,..._}=u,f=s||n&&t,b=!f&&!i,y=f&&!i;return(0,T.jsxs)("div",{className:"editor-post-publish-panel",..._,children:[(0,T.jsx)("div",{className:"editor-post-publish-panel__header",children:y?(0,T.jsx)(Tn.Button,{onClick:a,icon:An,label:(0,m.__)("Close panel")}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:"editor-post-publish-panel__header-publish-button",children:(0,T.jsx)(El,{focusOnMount:!0,onSubmit:this.onSubmit,forceIsDirty:e})}),(0,T.jsx)("div",{className:"editor-post-publish-panel__header-cancel-button",children:(0,T.jsx)(Tn.Button,{__experimentalIsFocusable:!0,disabled:r,onClick:a,variant:"secondary",size:"compact",children:(0,m.__)("Cancel")})})]})}),(0,T.jsxs)("div",{className:"editor-post-publish-panel__content",children:[b&&(0,T.jsx)(jc,{children:d&&(0,T.jsx)(d,{})}),y&&(0,T.jsx)(Nc,{focusOnMount:!0,children:c&&(0,T.jsx)(c,{})}),i&&(0,T.jsx)(Tn.Spinner,{})]}),(0,T.jsx)("div",{className:"editor-post-publish-panel__footer",children:(0,T.jsx)(Tn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,m.__)("Always show pre-publish checks."),checked:o,onChange:l})})]})}}const Dc=(0,pn.compose)([(0,d.withSelect)((e=>{var t;const{getPostType:s}=e(b.store),{getCurrentPost:o,getEditedPostAttribute:n,isCurrentPostPublished:i,isCurrentPostScheduled:r,isEditedPostBeingScheduled:a,isEditedPostDirty:l,isAutosavingPost:c,isSavingPost:d,isSavingNonPostEntityChanges:u}=e(cn),{isPublishSidebarEnabled:p}=e(cn),h=s(n("type"));return{hasPublishAction:null!==(t=o()._links?.["wp:action-publish"])&&void 0!==t&&t,isPostTypeViewable:h?.viewable,isBeingScheduled:a(),isDirty:l(),isPublished:i(),isPublishSidebarEnabled:p(),isSaving:d()&&!c(),isSavingNonPostEntityChanges:u(),isScheduled:r()}})),(0,d.withDispatch)(((e,{isPublishSidebarEnabled:t})=>{const{disablePublishSidebar:s,enablePublishSidebar:o}=e(cn);return{onTogglePublishSidebar:()=>{t?s():o()}}})),Tn.withFocusReturn,Tn.withConstrainedTabbing])(Ac),Rc=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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-4v-2.4L14 14l1-1-3-3-3 3 1 1 1.2-1.2v2.4H7.7c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4H9l.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 0 1-.8 1.8-1.7 1.8z"})});const Mc=(0,C.forwardRef)((function({icon:e,size:t=24,...s},o){return(0,C.cloneElement)(e,{width:t,height:t,...s,ref:o})})),Oc=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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"})}),Lc={"auto-draft":(0,m.__)("Draft"),draft:(0,m.__)("Draft"),pending:(0,m.__)("Pending"),private:(0,m.__)("Private"),future:(0,m.__)("Scheduled"),publish:(0,m.__)("Published")},Fc=[{label:(0,T.jsxs)(T.Fragment,{children:[(0,m.__)("Draft"),(0,T.jsx)(Tn.__experimentalText,{variant:"muted",size:12,children:(0,m.__)("Not ready to publish.")})]}),value:"draft"},{label:(0,T.jsxs)(T.Fragment,{children:[(0,m.__)("Pending"),(0,T.jsx)(Tn.__experimentalText,{variant:"muted",size:12,children:(0,m.__)("Waiting for review before publishing.")})]}),value:"pending"},{label:(0,T.jsxs)(T.Fragment,{children:[(0,m.__)("Private"),(0,T.jsx)(Tn.__experimentalText,{variant:"muted",size:12,children:(0,m.__)("Only visible to site admins and editors.")})]}),value:"private"},{label:(0,T.jsxs)(T.Fragment,{children:[(0,m.__)("Scheduled"),(0,T.jsx)(Tn.__experimentalText,{variant:"muted",size:12,children:(0,m.__)("Publish automatically on a chosen date.")})]}),value:"future"},{label:(0,T.jsxs)(T.Fragment,{children:[(0,m.__)("Published"),(0,T.jsx)(Tn.__experimentalText,{variant:"muted",size:12,children:(0,m.__)("Visible to everyone.")})]}),value:"publish"}],Vc=[L,F,V,U];function Uc(){const{status:e,date:t,password:s,postId:o,postType:n,canEdit:i}=(0,d.useSelect)((e=>{var t;const{getEditedPostAttribute:s,getCurrentPostId:o,getCurrentPostType:n,getCurrentPost:i}=e(cn);return{status:s("status"),date:s("date"),password:s("password"),postId:o(),postType:n(),canEdit:null!==(t=i()._links?.["wp:action-publish"])&&void 0!==t&&t}}),[]),[r,a]=(0,C.useState)(!!s),l=(0,pn.useInstanceId)(Uc,"editor-change-status__password-input"),{editEntityRecord:c}=(0,d.useDispatch)(b.store),[u,p]=(0,C.useState)(null),h=(0,C.useMemo)((()=>({anchor:u,"aria-label":(0,m.__)("Status & visibility"),headerTitle:(0,m.__)("Status & visibility"),placement:"left-start",offset:36,shift:!0})),[u]);if(Vc.includes(n))return null;const _=({status:i=e,password:r=s,date:a=t})=>{c("postType",n,o,{status:i,date:a,password:r})},f=e=>{a(e),e||_({password:""})},y=o=>{let n=t,i=s;"future"===e&&new Date(t)>new Date&&(n=null),"private"===o&&s&&(i=""),_({status:o,date:n,password:i})};return(0,T.jsx)(_r,{label:(0,m.__)("Status"),ref:p,children:i?(0,T.jsx)(Tn.Dropdown,{className:"editor-post-status",contentClassName:"editor-change-status__content",popoverProps:h,focusOnMount:!0,renderToggle:({onToggle:t})=>(0,T.jsx)(Tn.Button,{variant:"tertiary",size:"compact",onClick:t,"aria-label":(0,m.sprintf)((0,m.__)("Change post status: %s"),Lc[e]),children:Lc[e]}),renderContent:({onClose:t})=>(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,m.__)("Status & visibility"),onClose:t}),(0,T.jsx)("form",{children:(0,T.jsxs)(Tn.__experimentalVStack,{spacing:4,children:[(0,T.jsx)(Tn.RadioControl,{className:"editor-change-status__options",hideLabelFromVision:!0,label:(0,m.__)("Status"),options:Fc,onChange:y,selected:"auto-draft"===e?"draft":e}),"future"===e&&(0,T.jsx)("div",{className:"editor-change-status__publish-date-wrapper",children:(0,T.jsx)(Xl,{showPopoverHeaderActions:!1,isCompact:!0})}),"private"!==e&&(0,T.jsxs)(Tn.__experimentalVStack,{as:"fieldset",spacing:4,className:"editor-change-status__password-fieldset",children:[(0,T.jsx)(Tn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,m.__)("Password protected"),help:(0,m.__)("Only visible to those who know the password"),checked:r,onChange:f}),r&&(0,T.jsx)("div",{className:"editor-change-status__password-input",children:(0,T.jsx)(Tn.TextControl,{label:(0,m.__)("Password"),onChange:e=>_({password:e}),value:s,placeholder:(0,m.__)("Use a secure password"),type:"text",id:l,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})})]})]})})]})}):(0,T.jsx)("div",{className:"editor-post-status is-read-only",children:Lc[e]})})}function zc({forceIsDirty:e}){const[t,s]=(0,C.useState)(!1),o=(0,pn.useViewportMatch)("small"),{isAutosaving:n,isDirty:i,isNew:r,isPublished:a,isSaveable:l,isSaving:c,isScheduled:u,hasPublishAction:p,showIconLabels:h,postStatus:g,postStatusHasChanged:_}=(0,d.useSelect)((t=>{var s;const{isEditedPostNew:o,isCurrentPostPublished:n,isCurrentPostScheduled:i,isEditedPostDirty:r,isSavingPost:a,isEditedPostSaveable:l,getCurrentPost:c,isAutosavingPost:d,getEditedPostAttribute:u,getPostEdits:p}=t(cn),{get:h}=t(B.store);return{isAutosaving:d(),isDirty:e||r(),isNew:o(),isPublished:n(),isSaving:a(),isSaveable:l(),isScheduled:i(),hasPublishAction:null!==(s=c()?._links?.["wp:action-publish"])&&void 0!==s&&s,showIconLabels:h("core","showIconLabels"),postStatus:u("status"),postStatusHasChanged:!!p()?.status}}),[e]),f="pending"===g,{savePost:b}=(0,d.useDispatch)(cn),y=(0,pn.usePrevious)(c);if((0,C.useEffect)((()=>{let e;return y&&!c&&(s(!0),e=setTimeout((()=>{s(!1)}),1e3)),()=>clearTimeout(e)}),[c]),!p&&f)return null;const x=!["pending","draft","auto-draft"].includes(g)&&Fc.map((({value:e})=>e)).includes(g);if(a||u||x||_&&["pending","draft"].includes(g))return null;const v=f?(0,m.__)("Save as pending"):(0,m.__)("Save draft"),w=(0,m.__)("Save"),S=t||!r&&!i,k=c||S,P=c||S||!l;let j;return c?j=n?(0,m.__)("Autosaving"):(0,m.__)("Saving"):S?j=(0,m.__)("Saved"):o?j=v:h&&(j=w),(0,T.jsxs)(Tn.Button,{className:l||c?jn({"editor-post-save-draft":!k,"editor-post-saved-state":k,"is-saving":c,"is-autosaving":n,"is-saved":S,[(0,Tn.__unstableGetAnimateClassName)({type:"loading"})]:c}):void 0,onClick:P?void 0:()=>b(),shortcut:P?void 0:Ci.displayShortcut.primary("s"),variant:"tertiary",size:"compact",icon:o?void 0:Rc,label:j||v,"aria-disabled":P,children:[k&&(0,T.jsx)(Mc,{icon:S?En:Oc}),j]})}function Hc({children:e}){return(0,d.useSelect)((e=>{var t;return null!==(t=e(cn).getCurrentPost()._links?.["wp:action-publish"])&&void 0!==t&&t}),[])?e:null}const Gc=[L,F,V,U];function $c(){const[e,t]=(0,C.useState)(null),s=(0,d.useSelect)((e=>e(cn).getCurrentPostType()),[]),o=(0,C.useMemo)((()=>({anchor:e,"aria-label":(0,m.__)("Change publish date"),placement:"left-start",offset:36,shift:!0})),[e]),n=ec(),i=ec({full:!0});return Gc.includes(s)?null:(0,T.jsx)(Hc,{children:(0,T.jsx)(_r,{label:(0,m.__)("Publish"),ref:t,children:(0,T.jsx)(Tn.Dropdown,{popoverProps:o,focusOnMount:!0,className:"editor-post-schedule__panel-dropdown",contentClassName:"editor-post-schedule__dialog",renderToggle:({onToggle:e,isOpen:t})=>(0,T.jsx)(Tn.Button,{size:"compact",className:"editor-post-schedule__dialog-toggle",variant:"tertiary",tooltipPosition:"middle left",onClick:e,"aria-label":(0,m.sprintf)((0,m.__)("Change date: %s"),n),label:i,showTooltip:n!==i,"aria-expanded":t,children:n}),renderContent:({onClose:e})=>(0,T.jsx)(Ql,{onClose:e})})})})}function Wc({children:e}){return(0,T.jsx)(fr,{supportKeys:"slug",children:e})}function Kc(){const e=(0,d.useSelect)((e=>(0,S.safeDecodeURIComponent)(e(cn).getEditedPostSlug())),[]),{editPost:t}=(0,d.useDispatch)(cn),[s,o]=(0,C.useState)(!1);return(0,T.jsx)(Tn.TextControl,{__nextHasNoMarginBottom:!0,label:(0,m.__)("Slug"),autoComplete:"off",spellCheck:"false",value:s?"":e,onChange:e=>{t({slug:e}),e?s&&o(!1):s||o(!0)},onBlur:e=>{t({slug:(0,S.cleanForSlug)(e.target.value)}),s&&o(!1)},className:"editor-post-slug"})}function Zc(){return(0,T.jsx)(Wc,{children:(0,T.jsx)(Kc,{})})}function Yc({children:e}){const{hasStickyAction:t,postType:s}=(0,d.useSelect)((e=>{var t;const s=e(cn).getCurrentPost();return{hasStickyAction:null!==(t=s._links?.["wp:action-sticky"])&&void 0!==t&&t,postType:e(cn).getCurrentPostType()}}),[]);return"post"===s&&t?e:null}function qc(){const e=(0,d.useSelect)((e=>{var t;return null!==(t=e(cn).getEditedPostAttribute("sticky"))&&void 0!==t&&t}),[]),{editPost:t}=(0,d.useDispatch)(cn);return(0,T.jsx)(Yc,{children:(0,T.jsx)(_r,{label:(0,m.__)("Sticky"),children:(0,T.jsx)(Tn.ToggleControl,{className:"editor-post-sticky__toggle-control",label:(0,T.jsx)(Tn.VisuallyHidden,{children:(0,m.__)("Sticky")}),checked:e,onChange:()=>t({sticky:!e})})})})}function Qc(){const[e,t]=(0,C.useState)(!1),{editPost:s,savePost:o}=(0,d.useDispatch)(cn),{isSaving:n,isPublished:i,isScheduled:r}=(0,d.useSelect)((e=>{const{isSavingPost:t,isCurrentPostPublished:s,isCurrentPostScheduled:o}=e(cn);return{isSaving:t(),isPublished:s(),isScheduled:o()}}),[]),a=n||!i&&!r;let l,c;i?(l=(0,m.__)("Are you sure you want to unpublish this post?"),c=(0,m.__)("Unpublish")):r&&(l=(0,m.__)("Are you sure you want to unschedule this post?"),c=(0,m.__)("Unschedule"));return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Tn.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,m.__)("Switch to draft")}),(0,T.jsx)(Tn.__experimentalConfirmDialog,{isOpen:e,onConfirm:()=>{t(!1),s({status:"draft"}),o()},onCancel:()=>t(!1),confirmButtonText:c,children:l})]})}function Xc(){const{syncStatus:e,postType:t}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(cn),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,T.jsx)(_r,{label:(0,m.__)("Sync status"),children:(0,T.jsx)("div",{className:"editor-post-sync-status__value",children:"unsynced"===e?(0,m._x)("Not synced","pattern (singular)"):(0,m._x)("Synced","pattern (singular)")})})}const Jc=e=>e;const ed=function({taxonomyWrapper:e=Jc}){const{postType:t,taxonomies:s}=(0,d.useSelect)((e=>({postType:e(cn).getCurrentPostType(),taxonomies:e(b.store).getTaxonomies({per_page:-1})})),[]);return(null!=s?s:[]).filter((e=>e.types.includes(t)&&e.visibility?.show_ui)).map((t=>{const s=t.hierarchical?wc:pc;return(0,T.jsx)(C.Fragment,{children:e((0,T.jsx)(s,{slug:t.slug}),t)},`taxonomy-${t.slug}`)}))};function td({children:e}){const t=(0,d.useSelect)((e=>{const t=e(cn).getCurrentPostType(),s=e(b.store).getTaxonomies({per_page:-1});return s?.some((e=>e.types.includes(t)))}),[]);return t?e:null}function sd({taxonomy:e,children:t}){const s=e?.slug,o=s?`taxonomy-panel-${s}`:"",{isEnabled:n,isOpened:i}=(0,d.useSelect)((e=>{const{isEditorPanelEnabled:t,isEditorPanelOpened:n}=e(cn);return{isEnabled:!!s&&t(o),isOpened:!!s&&n(o)}}),[o,s]),{toggleEditorPanelOpened:r}=(0,d.useDispatch)(cn);if(!n)return null;const a=e?.labels?.menu_name;return a?(0,T.jsx)(Tn.PanelBody,{title:a,opened:i,onToggle:()=>r(o),children:t}):null}const od=function(){return(0,T.jsx)(td,{children:(0,T.jsx)(ed,{taxonomyWrapper:(e,t)=>(0,T.jsx)(sd,{taxonomy:t,children:e})})})};var nd=s(4132);function id(){const e=(0,pn.useInstanceId)(id),{content:t,blocks:s,type:o,id:n}=(0,d.useSelect)((e=>{const{getEditedEntityRecord:t}=e(b.store),{getCurrentPostType:s,getCurrentPostId:o}=e(cn),n=s(),i=o(),r=t("postType",n,i);return{content:r?.content,blocks:r?.blocks,type:n,id:i}}),[]),{editEntityRecord:i}=(0,d.useDispatch)(b.store),r=(0,C.useMemo)((()=>t instanceof Function?t({blocks:s}):s?(0,c.__unstableSerializeAndClean)(s):t),[t,s]);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Tn.VisuallyHidden,{as:"label",htmlFor:`post-content-${e}`,children:(0,m.__)("Type text or HTML")}),(0,T.jsx)(nd.A,{autoComplete:"off",dir:"auto",value:r,onChange:e=>{i("postType",o,n,{content:e.target.value,blocks:void 0,selection:void 0})},className:"editor-post-text-editor",id:`post-content-${e}`,placeholder:(0,m.__)("Start writing with text or HTML")})]})}const rd=window.wp.dom,ad="wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text",ld=/[\r\n]+/g;function cd(e){const t=(0,C.useRef)(),{isCleanNewPost:s}=(0,d.useSelect)((e=>{const{isCleanNewPost:t}=e(cn);return{isCleanNewPost:t()}}),[]);return(0,C.useImperativeHandle)(e,(()=>({focus:()=>{t?.current?.focus()}}))),(0,C.useEffect)((()=>{if(!t.current)return;const{defaultView:e}=t.current.ownerDocument,{name:o,parent:n}=e,i="editor-canvas"===o?n.document:e.document,{activeElement:r,body:a}=i;!s||r&&a!==r||t.current.focus()}),[s]),{ref:t}}function dd(){const{editPost:e}=(0,d.useDispatch)(cn),{title:t}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(cn);return{title:t("title")}}),[]);return{title:t,setTitle:function(t){e({title:t})}}}const ud=(0,C.forwardRef)((function(e,t){const{placeholder:s,hasFixedToolbar:o}=(0,d.useSelect)((e=>{const{getSettings:t}=e(g.store),{titlePlaceholder:s,hasFixedToolbar:o}=t();return{placeholder:s,hasFixedToolbar:o}}),[]),[n,i]=(0,C.useState)(!1),{ref:r}=cd(t),{title:a,setTitle:l}=dd(),[u,p]=(0,C.useState)({}),{clearSelectedBlock:h,insertBlocks:_,insertDefaultBlock:f}=(0,d.useDispatch)(g.store);function b(e){_(e,0)}function y(){i(!1),p({})}const x=(0,Mo.decodeEntities)(s)||(0,m.__)("Add title"),{ref:v}=(0,Ii.__unstableUseRichText)({value:a,onChange:function(e){l(e.replace(ld," "))},placeholder:x,selectionStart:u.start,selectionEnd:u.end,onSelectionChange(e,t){p((s=>{const{start:o,end:n}=s;return o===e&&n===t?s:{start:e,end:t}}))},__unstableDisableFormats:!1}),w=jn(ad,{"is-selected":n,"has-fixed-toolbar":o});return(0,T.jsx)(fr,{supportKeys:"title",children:(0,T.jsx)("h1",{ref:(0,pn.useMergeRefs)([v,r]),contentEditable:!0,className:w,"aria-label":x,role:"textbox","aria-multiline":"true",onFocus:function(){i(!0),h()},onBlur:y,onKeyDown:function(e){e.keyCode===Ci.ENTER&&(e.preventDefault(),f(void 0,void 0,0))},onKeyPress:y,onPaste:function(e){const t=e.clipboardData;let s="",o="";try{s=t.getData("text/plain"),o=t.getData("text/html")}catch(e){try{o=t.getData("Text")}catch(e){return}}window.console.log("Received HTML:\n\n",o),window.console.log("Received plain text:\n\n",s);const n=(0,c.pasteHandler)({HTML:o,plainText:s});if(e.preventDefault(),n.length)if("string"!=typeof n){const[e]=n;if(a||"core/heading"!==e.name&&"core/paragraph"!==e.name)b(n);else{const t=(0,rd.__unstableStripHTML)(e.attributes.content);l(t),b(n.slice(1))}}else{const e={...(0,Ii.create)({html:a}),...u},t=(0,rd.__unstableStripHTML)(n),s=(0,Ii.insert)(e,(0,Ii.create)({html:t}));l((0,Ii.toHTMLString)({value:s})),p({start:s.start,end:s.end})}}})})}));const pd=(0,C.forwardRef)((function(e,t){const{placeholder:s,hasFixedToolbar:o}=(0,d.useSelect)((e=>{const{getSettings:t}=e(g.store),{titlePlaceholder:s,hasFixedToolbar:o}=t();return{placeholder:s,hasFixedToolbar:o}}),[]),[n,i]=(0,C.useState)(!1),{title:r,setTitle:a}=dd(),{ref:l}=cd(t),c=jn(ad,{"is-selected":n,"has-fixed-toolbar":o,"is-raw-text":!0}),u=(0,Mo.decodeEntities)(s)||(0,m.__)("Add title");return(0,T.jsx)(Tn.TextareaControl,{ref:l,value:r,onChange:function(e){a(e.replace(ld," "))},onFocus:function(){i(!0)},onBlur:function(){i(!1)},label:s,className:c,placeholder:u,hideLabelFromVision:!0,autoComplete:"off",dir:"auto",rows:1,__nextHasNoMarginBottom:!0})}));function hd(){const{isNew:e,isDeleting:t,postId:s}=(0,d.useSelect)((e=>{const t=e(cn);return{isNew:t.isEditedPostNew(),isDeleting:t.isDeletingPost(),postId:t.getCurrentPostId()}}),[]),{trashPost:o}=(0,d.useDispatch)(cn),[n,i]=(0,C.useState)(!1);if(e||!s)return null;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Tn.Button,{__next40pxDefaultSize:!0,className:"editor-post-trash",isDestructive:!0,variant:"secondary",isBusy:t,"aria-disabled":t,onClick:t?void 0:()=>i(!0),children:(0,m.__)("Move to trash")}),(0,T.jsx)(Tn.__experimentalConfirmDialog,{isOpen:n,onConfirm:()=>{i(!1),o()},onCancel:()=>i(!1),confirmButtonText:(0,m.__)("Move to trash"),size:"medium",children:(0,m.__)("Are you sure you want to move this post to the trash?")})]})}function md({children:e}){const{canTrashPost:t}=(0,d.useSelect)((e=>{const{isEditedPostNew:t,getCurrentPostId:s,getCurrentPostType:o}=e(cn),{getPostType:n,canUser:i}=e(b.store),r=n(o()),a=s(),l=t(),c=r?.rest_base||"",d=!(!a||!c)&&i("delete",c,a);return{canTrashPost:(!l||a)&&d}}),[]);return t?e:null}const gd=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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"})});function _d({onClose:e}){const{isEditable:t,postSlug:s,postLink:o,permalinkPrefix:n,permalinkSuffix:i,permalink:r}=(0,d.useSelect)((e=>{var t;const s=e(cn).getCurrentPost(),o=e(cn).getCurrentPostType(),n=e(b.store).getPostType(o),i=e(cn).getPermalinkParts(),r=null!==(t=s?._links?.["wp:action-publish"])&&void 0!==t&&t;return{isEditable:e(cn).isPermalinkEditable()&&r,postSlug:(0,S.safeDecodeURIComponent)(e(cn).getEditedPostSlug()),viewPostLabel:n?.labels.view_item,postLink:s.link,permalinkPrefix:i?.prefix,permalinkSuffix:i?.suffix,permalink:(0,S.safeDecodeURIComponent)(e(cn).getPermalink())}}),[]),{editPost:a}=(0,d.useDispatch)(cn),{createNotice:l}=(0,d.useDispatch)(fs.store),[c,u]=(0,C.useState)(!1),p=(0,pn.useCopyToClipboard)(r,(()=>{l("info",(0,m.__)("Copied URL to clipboard."),{isDismissible:!0,type:"snackbar"})}));return(0,T.jsxs)("div",{className:"editor-post-url",children:[(0,T.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,m.__)("Link"),onClose:e}),(0,T.jsxs)(Tn.__experimentalVStack,{spacing:3,children:[t&&(0,T.jsxs)("div",{children:[(0,m.__)("Customize the last part of the URL. "),(0,T.jsx)(Tn.ExternalLink,{href:(0,m.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink"),children:(0,m.__)("Learn more.")})]}),(0,T.jsxs)("div",{children:[t&&(0,T.jsx)(Tn.__experimentalInputControl,{__next40pxDefaultSize:!0,prefix:(0,T.jsx)(Tn.__experimentalInputControlPrefixWrapper,{children:"/"}),suffix:(0,T.jsx)(Tn.Button,{icon:gd,ref:p,label:(0,m.__)("Copy")}),label:(0,m.__)("Link"),hideLabelFromVision:!0,value:c?"":s,autoComplete:"off",spellCheck:"false",type:"text",className:"editor-post-url__input",onChange:e=>{a({slug:e}),e?c&&u(!1):c||u(!0)},onBlur:e=>{a({slug:(0,S.cleanForSlug)(e.target.value)}),c&&u(!1)},help:(0,T.jsxs)(Tn.ExternalLink,{className:"editor-post-url__link",href:o,target:"_blank",children:[(0,T.jsx)("span",{className:"editor-post-url__link-prefix",children:n}),(0,T.jsx)("span",{className:"editor-post-url__link-slug",children:s}),(0,T.jsx)("span",{className:"editor-post-url__link-suffix",children:i})]})}),!t&&(0,T.jsx)(Tn.ExternalLink,{className:"editor-post-url__link",href:o,target:"_blank",children:o})]})]})]})}function fd({children:e}){const t=(0,d.useSelect)((e=>{const t=e(cn).getCurrentPostType(),s=e(b.store).getPostType(t);if(!s?.viewable)return!1;if(!e(cn).getCurrentPost().link)return!1;return!!e(cn).getPermalinkParts()}),[]);return t?e:null}function bd(){return yd()}function yd(){const e=(0,d.useSelect)((e=>e(cn).getPermalink()),[]);return(0,S.filterURLForDisplay)((0,S.safeDecodeURIComponent)(e))}function xd(){const[e,t]=(0,C.useState)(null),s=(0,C.useMemo)((()=>({anchor:e,placement:"left-start",offset:36,shift:!0})),[e]);return(0,T.jsx)(fd,{children:(0,T.jsx)(_r,{label:(0,m.__)("Link"),ref:t,children:(0,T.jsx)(Tn.Dropdown,{popoverProps:s,className:"editor-post-url__panel-dropdown",contentClassName:"editor-post-url__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,T.jsx)(vd,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,T.jsx)(_d,{onClose:e})})})})}function vd({isOpen:e,onClick:t}){const{slug:s,isFrontPage:o,postLink:n}=(0,d.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPost:s}=e(cn),{getEditedEntityRecord:o}=e(b.store),n=o("root","site"),i=t();return{slug:e(cn).getEditedPostSlug(),isFrontPage:n?.page_on_front===i,postLink:s()?.link}}),[]),i=(0,S.safeDecodeURIComponent)(s);return(0,T.jsx)(Tn.Button,{size:"compact",className:"editor-post-url__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,m.sprintf)((0,m.__)("Change link: %s"),i),onClick:t,children:o?n:(0,T.jsxs)(T.Fragment,{children:["/",i]})})}function wd({render:e}){return e({canEdit:(0,d.useSelect)((e=>{var t;return null!==(t=e(cn).getCurrentPost()._links?.["wp:action-publish"])&&void 0!==t&&t}))})}const Sd=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})}),kd=window.wp.wordcount;function Pd(){const e=(0,d.useSelect)((e=>e(cn).getEditedPostAttribute("content")),[]),t=(0,m._x)("words","Word count type. Do not translate!");return(0,T.jsx)("span",{className:"word-count",children:(0,kd.count)(e,t)})}const Cd=189;function jd(){const e=(0,d.useSelect)((e=>e(cn).getEditedPostAttribute("content")),[]),t=(0,m._x)("words","Word count type. Do not translate!"),s=Math.round((0,kd.count)(e,t)/Cd),o=0===s?(0,C.createInterpolateElement)((0,m.__)("<span>< 1</span> minute"),{span:(0,T.jsx)("span",{})}):(0,C.createInterpolateElement)((0,m.sprintf)((0,m._n)("<span>%d</span> minute","<span>%d</span> minutes",s),s),{span:(0,T.jsx)("span",{})});return(0,T.jsx)("span",{className:"time-to-read",children:o})}function Td(){const e=(0,d.useSelect)((e=>e(cn).getEditedPostAttribute("content")),[]);return(0,kd.count)(e,"characters_including_spaces")}const Ed=function({hasOutlineItemsDisabled:e,onRequestClose:t}){const{headingCount:s,paragraphCount:o,numberOfBlocks:n}=(0,d.useSelect)((e=>{const{getGlobalBlockCount:t}=e(g.store);return{headingCount:t("core/heading"),paragraphCount:t("core/paragraph"),numberOfBlocks:t()}}),[]);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:"table-of-contents__wrapper",role:"note","aria-label":(0,m.__)("Document Statistics"),tabIndex:"0",children:(0,T.jsxs)("ul",{role:"list",className:"table-of-contents__counts",children:[(0,T.jsxs)("li",{className:"table-of-contents__count",children:[(0,m.__)("Words"),(0,T.jsx)(Pd,{})]}),(0,T.jsxs)("li",{className:"table-of-contents__count",children:[(0,m.__)("Characters"),(0,T.jsx)("span",{className:"table-of-contents__number",children:(0,T.jsx)(Td,{})})]}),(0,T.jsxs)("li",{className:"table-of-contents__count",children:[(0,m.__)("Time to read"),(0,T.jsx)(jd,{})]}),(0,T.jsxs)("li",{className:"table-of-contents__count",children:[(0,m.__)("Headings"),(0,T.jsx)("span",{className:"table-of-contents__number",children:s})]}),(0,T.jsxs)("li",{className:"table-of-contents__count",children:[(0,m.__)("Paragraphs"),(0,T.jsx)("span",{className:"table-of-contents__number",children:o})]}),(0,T.jsxs)("li",{className:"table-of-contents__count",children:[(0,m.__)("Blocks"),(0,T.jsx)("span",{className:"table-of-contents__number",children:n})]})]})}),s>0&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("hr",{}),(0,T.jsx)("h2",{className:"table-of-contents__title",children:(0,m.__)("Document Outline")}),(0,T.jsx)(Vi,{onSelect:t,hasOutlineItemsDisabled:e})]})]})};const Bd=(0,C.forwardRef)((function({hasOutlineItemsDisabled:e,repositionDropdown:t,...s},o){const n=(0,d.useSelect)((e=>!!e(g.store).getBlockCount()),[]);return(0,T.jsx)(Tn.Dropdown,{popoverProps:{placement:t?"right":"bottom"},className:"table-of-contents",contentClassName:"table-of-contents__popover",renderToggle:({isOpen:e,onToggle:t})=>(0,T.jsx)(Tn.Button,{...s,ref:o,onClick:n?t:void 0,icon:Sd,"aria-expanded":e,"aria-haspopup":"true",label:(0,m.__)("Details"),tooltipPosition:"bottom","aria-disabled":!n}),renderContent:({onClose:t})=>(0,T.jsx)(Ed,{onRequestClose:t,hasOutlineItemsDisabled:e})})}));function Id(){const{__experimentalGetDirtyEntityRecords:e}=(0,d.useSelect)(b.store);return(0,C.useEffect)((()=>{const t=t=>{if(e().length>0)return t.returnValue=(0,m.__)("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 Nd=(0,pn.createHigherOrderComponent)((e=>({useSubRegistry:t=!0,...s})=>{const o=(0,d.useRegistry)(),[n]=(0,C.useState)((()=>new WeakMap)),i=function(e,t,s){if(!s)return t;let o=e.get(t);return o||(o=(0,d.createRegistry)({"core/block-editor":g.storeConfig},t),o.registerStore("core/editor",ln),e.set(t,o)),o}(n,o,t);return i===o?(0,T.jsx)(e,{registry:o,...s}):(0,T.jsx)(d.RegistryProvider,{value:i,children:(0,T.jsx)(e,{registry:i,...s})})}),"withRegistryProvider"),Ad=(e,t)=>`<a ${Dd(e)}>${t}</a>`,Dd=e=>`href="${e}" target="_blank" rel="noreferrer noopener"`,Rd=e=>{const{title:t,foreign_landing_url:s,creator:o,creator_url:n,license:i,license_version:r,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})(i,r),c=(0,Mo.decodeEntities)(o);let d;return d=c?t?(0,m.sprintf)((0,m._x)('"%1$s" by %2$s/ %3$s',"caption"),Ad(s,(0,Mo.decodeEntities)(t)),n?Ad(n,c):c,a?Ad(`${a}?ref=openverse`,l):l):(0,m.sprintf)((0,m._x)("<a %1$s>Work</a> by %2$s/ %3$s","caption"),Dd(s),n?Ad(n,c):c,a?Ad(`${a}?ref=openverse`,l):l):t?(0,m.sprintf)((0,m._x)('"%1$s"/ %2$s',"caption"),Ad(s,(0,Mo.decodeEntities)(t)),a?Ad(`${a}?ref=openverse`,l):l):(0,m.sprintf)((0,m._x)("<a %1$s>Work</a>/ %2$s","caption"),Dd(s),a?Ad(`${a}?ref=openverse`,l):l),d.replace(/\s{2}/g," ")},Md=async(e={})=>(await(0,d.resolveSelect)(b.store).getMediaItems({...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}))),Od=[{name:"images",labels:{name:(0,m.__)("Images"),search_items:(0,m.__)("Search images")},mediaType:"image",fetch:async(e={})=>Md({...e,media_type:"image"})},{name:"videos",labels:{name:(0,m.__)("Videos"),search_items:(0,m.__)("Search videos")},mediaType:"video",fetch:async(e={})=>Md({...e,media_type:"video"})},{name:"audio",labels:{name:(0,m.__)("Audio"),search_items:(0,m.__)("Search audio")},mediaType:"audio",fetch:async(e={})=>Md({...e,media_type:"audio"})},{name:"openverse",labels:{name:(0,m.__)("Openverse"),search_items:(0,m.__)("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"},o=new URL("https://api.openverse.org/v1/images/");Object.entries(t).forEach((([e,t])=>{const n=s[e]||e;o.searchParams.set(n,t)}));const n=await window.fetch(o,{headers:{"User-Agent":"WordPress/inserter-media-fetch"}});return(await n.json()).results.map((e=>({...e,title:e.title?.toLowerCase().startsWith("file:")?e.title.slice(5):e.title,sourceId:e.id,id:void 0,caption:Rd(e),previewUrl:e.thumbnail})))},getReportUrl:({sourceId:e})=>`https://wordpress.org/openverse/image/${e}/report/`,isExternalResource:!0}],Ld=()=>{};function Fd({additionalData:e={},allowedTypes:t,filesList:s,maxUploadFileSize:o,onError:n=Ld,onFileChange:i}){const{getCurrentPost:r,getEditorSettings:a}=(0,d.select)(cn),l=a().allowedMimeTypes;o=o||a().maxUploadFileSize;const c=r(),u="number"==typeof c?.id?c.id:c?.wp_id,p=u?{post:u}:{};(0,gn.uploadMedia)({allowedTypes:t,filesList:s,onFileChange:i,additionalData:{...p,...e},maxUploadFileSize:o,onError:({message:e})=>n(e),wpAllowedMimeTypes:l})}var Vd=s(66),Ud=s.n(Vd); /*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/!function(){"use strict";var o={}.hasOwnProperty;function s(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var r=typeof n;if("string"===r||"number"===r)e.push(n);else if(Array.isArray(n)){if(n.length){var i=s.apply(null,n);i&&e.push(i)}}else if("object"===r){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var a in n)o.call(n,a)&&n[a]&&e.push(a)}}}return e.join(" ")}e.exports?(s.default=s,e.exports=s):void 0===(n=function(){return s}.apply(t,[]))||(e.exports=n)}()},6109:e=>{e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},461:(e,t,n)=>{var o=n(6109);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var s=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),s?e.style.lineHeight=s:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var r=e.nodeName,i=document.createElement(r);i.innerHTML=" ","TEXTAREA"===r.toUpperCase()&&i.setAttribute("rows","1");var a=o(e,"font-size");i.style.fontSize=a,i.style.padding="0px",i.style.border="0px";var l=document.body;l.appendChild(i),n=i.offsetHeight,l.removeChild(i)}return n}},628:(e,t,n)=>{"use strict";var o=n(4067);function s(){}function r(){}r.resetWarningCache=s,e.exports=function(){function e(e,t,n,s,r,i){if(i!==o){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 n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:s};return n.PropTypes=n,n}},5826:(e,t,n)=>{e.exports=n(628)()},4067:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4462:function(e,t,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},i=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(o=Object.getOwnPropertySymbols(e);s<o.length;s++)t.indexOf(o[s])<0&&(n[o[s]]=e[o[s]])}return n};t.__esModule=!0;var a=n(1609),l=n(5826),c=n(4306),u=n(461),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return s(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,o=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||o?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),o=(t.onChange,t.style),s=(t.innerRef,t.children),l=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return a.createElement("textarea",r({},l,{onChange:this.onChange,style:u?r({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),s)},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}))}))},4132:(e,t,n)=>{"use strict";var o=n(4462);t.A=o.TextareaAutosize},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",й:"и",Й:"И",ё:"е",Ё:"Е"},n=Object.keys(t).join("|"),o=new RegExp(n,"g"),s=new RegExp(n,"");function r(e){return t[e]}var i=function(e){return e.replace(o,r)};e.exports=i,e.exports.has=function(e){return!!e.match(s)},e.exports.remove=i},1609:e=>{"use strict";e.exports=window.React}},t={};function n(o){var s=t[o];if(void 0!==s)return s.exports;var r=t[o]={exports:{}};return e[o].call(r.exports,r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";n.r(o),n.d(o,{AlignmentToolbar:()=>Zl,Autocomplete:()=>Kl,AutosaveMonitor:()=>Wo,BlockAlignmentToolbar:()=>Yl,BlockControls:()=>ql,BlockEdit:()=>Ql,BlockEditorKeyboardShortcuts:()=>Xl,BlockFormatControls:()=>Jl,BlockIcon:()=>ec,BlockInspector:()=>tc,BlockList:()=>nc,BlockMover:()=>oc,BlockNavigationDropdown:()=>sc,BlockSelectionClearer:()=>rc,BlockSettingsMenu:()=>ic,BlockTitle:()=>ac,BlockToolbar:()=>lc,CharacterCount:()=>fl,ColorPalette:()=>cc,ContrastChecker:()=>uc,CopyHandler:()=>dc,DefaultBlockAppender:()=>pc,DocumentBar:()=>ss,DocumentOutline:()=>hs,DocumentOutlineCheck:()=>_s,EditorHistoryRedo:()=>vs,EditorHistoryUndo:()=>ys,EditorKeyboardShortcuts:()=>Go,EditorKeyboardShortcutsRegister:()=>fs,EditorNotices:()=>ks,EditorProvider:()=>Hl,EditorSnackbars:()=>Ps,EntitiesSavedStates:()=>Ms,ErrorBoundary:()=>zs,FontSizePicker:()=>mc,InnerBlocks:()=>hc,Inserter:()=>gc,InspectorAdvancedControls:()=>_c,InspectorControls:()=>fc,LocalAutosaveMonitor:()=>$s,MediaPlaceholder:()=>kc,MediaUpload:()=>Sc,MediaUploadCheck:()=>Pc,MultiSelectScrollIntoView:()=>Cc,NavigableToolbar:()=>Tc,ObserveTyping:()=>xc,PageAttributesCheck:()=>Ks,PageAttributesOrder:()=>qs,PageAttributesPanel:()=>ar,PageAttributesParent:()=>rr,PageTemplate:()=>br,PanelColorSettings:()=>Ec,PlainText:()=>bc,PostAuthor:()=>Or,PostAuthorCheck:()=>Lr,PostAuthorPanel:()=>Mr,PostComments:()=>Fr,PostDiscussionPanel:()=>Hr,PostExcerpt:()=>zr,PostExcerptCheck:()=>Gr,PostExcerptPanel:()=>Yr,PostFeaturedImage:()=>ri,PostFeaturedImageCheck:()=>Xr,PostFeaturedImagePanel:()=>ai,PostFormat:()=>ui,PostFormatCheck:()=>li,PostLastRevision:()=>mi,PostLastRevisionCheck:()=>pi,PostLastRevisionPanel:()=>gi,PostLockedModal:()=>hi,PostPendingStatus:()=>fi,PostPendingStatusCheck:()=>_i,PostPingbacks:()=>Vr,PostPreviewButton:()=>Ei,PostPublishButton:()=>wi,PostPublishButtonLabel:()=>bi,PostPublishPanel:()=>Ba,PostSavedState:()=>Aa,PostSchedule:()=>$i,PostScheduleCheck:()=>Ra,PostScheduleLabel:()=>Ki,PostSchedulePanel:()=>Oa,PostSlug:()=>Fa,PostSlugCheck:()=>La,PostSticky:()=>Ua,PostStickyCheck:()=>Va,PostSwitchToDraftButton:()=>Ha,PostSyncStatus:()=>za,PostTaxonomies:()=>ja,PostTaxonomiesCheck:()=>Wa,PostTaxonomiesFlatTermSelector:()=>ia,PostTaxonomiesHierarchicalTermSelector:()=>_a,PostTaxonomiesPanel:()=>Ka,PostTemplatePanel:()=>Br,PostTextEditor:()=>Ya,PostTitle:()=>tl,PostTitleRaw:()=>nl,PostTrash:()=>ol,PostTrashCheck:()=>sl,PostTypeSupportCheck:()=>Zs,PostURL:()=>rl,PostURLCheck:()=>il,PostURLLabel:()=>al,PostURLPanel:()=>cl,PostVisibility:()=>Ci,PostVisibilityCheck:()=>dl,PostVisibilityLabel:()=>xi,RichText:()=>$l,RichTextShortcut:()=>vc,RichTextToolbarButton:()=>yc,ServerSideRender:()=>Gl(),SkipToSelectedBlock:()=>Bc,TableOfContents:()=>bl,TextEditorGlobalKeyboardShortcuts:()=>Wc,ThemeSupportCheck:()=>Qr,TimeToRead:()=>_l,URLInput:()=>Ic,URLInputButton:()=>Nc,URLPopover:()=>Dc,UnsavedChangesWarning:()=>vl,VisualEditorGlobalKeyboardShortcuts:()=>jc,Warning:()=>Ac,WordCount:()=>gl,WritingFlow:()=>Rc,__unstableRichTextInputEvent:()=>wc,cleanForSlug:()=>$c,createCustomColorsHOC:()=>Oc,getColorClassName:()=>Lc,getColorObjectByAttributeValues:()=>Mc,getColorObjectByColorValue:()=>Fc,getFontSize:()=>Vc,getFontSizeClass:()=>Uc,getTemplatePartIcon:()=>U,mediaUpload:()=>Bl,privateApis:()=>Bu,store:()=>xo,storeConfig:()=>To,transformStyles:()=>m.transformStyles,useEntitiesSavedStatesIsDirty:()=>Rs,usePostScheduleLabel:()=>Zi,usePostURLLabel:()=>ll,usePostVisibilityLabel:()=>Bi,userAutocompleter:()=>Ao,withColorContext:()=>Hc,withColors:()=>zc,withFontSizes:()=>Gc});var e={};n.r(e),n.d(e,{__experimentalGetDefaultTemplatePartAreas:()=>Jt,__experimentalGetDefaultTemplateType:()=>en,__experimentalGetDefaultTemplateTypes:()=>Xt,__experimentalGetTemplateInfo:()=>tn,__unstableIsEditorReady:()=>$e,canInsertBlockType:()=>Zt,canUserUseUnfilteredHTML:()=>Me,didPostSaveRequestFail:()=>ve,didPostSaveRequestSucceed:()=>be,getActivePostLock:()=>Le,getAdjacentBlockClientId:()=>bt,getAutosaveAttribute:()=>re,getBlock:()=>st,getBlockAttributes:()=>ot,getBlockCount:()=>ut,getBlockHierarchyRootClientId:()=>Et,getBlockIndex:()=>At,getBlockInsertionPoint:()=>Gt,getBlockListSettings:()=>Qt,getBlockMode:()=>Ut,getBlockName:()=>tt,getBlockOrder:()=>Dt,getBlockRootClientId:()=>ft,getBlockSelectionEnd:()=>pt,getBlockSelectionStart:()=>dt,getBlocks:()=>rt,getBlocksByClientId:()=>ct,getClientIdsOfDescendants:()=>it,getClientIdsWithDescendants:()=>at,getCurrentPost:()=>Y,getCurrentPostAttribute:()=>ne,getCurrentPostId:()=>Q,getCurrentPostLastRevisionId:()=>ee,getCurrentPostRevisionsCount:()=>J,getCurrentPostType:()=>q,getCurrentTemplateId:()=>X,getDeviceType:()=>Ye,getEditedPostAttribute:()=>se,getEditedPostContent:()=>Pe,getEditedPostPreviewLink:()=>ke,getEditedPostSlug:()=>Be,getEditedPostVisibility:()=>ie,getEditorBlocks:()=>Ve,getEditorSelection:()=>We,getEditorSelectionEnd:()=>je,getEditorSelectionStart:()=>Ge,getEditorSettings:()=>Ke,getFirstMultiSelectedBlockClientId:()=>Pt,getGlobalBlockCount:()=>lt,getInserterItems:()=>Yt,getLastMultiSelectedBlockClientId:()=>Ct,getMultiSelectedBlockClientIds:()=>kt,getMultiSelectedBlocks:()=>St,getMultiSelectedBlocksEndClientId:()=>Nt,getMultiSelectedBlocksStartClientId:()=>It,getNextBlockClientId:()=>yt,getPermalink:()=>xe,getPermalinkParts:()=>Ie,getPostEdits:()=>te,getPostLockUser:()=>Oe,getPostTypeLabel:()=>nn,getPreviousBlockClientId:()=>vt,getRenderingMode:()=>Ze,getSelectedBlock:()=>_t,getSelectedBlockClientId:()=>ht,getSelectedBlockCount:()=>mt,getSelectedBlocksInitialCaretPosition:()=>wt,getStateBeforeOptimisticTransaction:()=>Xe,getSuggestedPostFormat:()=>Se,getTemplate:()=>$t,getTemplateLock:()=>Kt,hasChangedContent:()=>W,hasEditorRedo:()=>G,hasEditorUndo:()=>z,hasInserterItems:()=>qt,hasMultiSelection:()=>Mt,hasNonPostEntityChanges:()=>K,hasSelectedBlock:()=>gt,hasSelectedInnerBlock:()=>Ot,inSomeHistory:()=>Je,isAncestorMultiSelected:()=>Bt,isAutosavingPost:()=>ye,isBlockInsertionPointVisible:()=>jt,isBlockMultiSelected:()=>xt,isBlockSelected:()=>Rt,isBlockValid:()=>nt,isBlockWithinSelection:()=>Lt,isCaretWithinFormattedText:()=>zt,isCleanNewPost:()=>Z,isCurrentPostPending:()=>ae,isCurrentPostPublished:()=>le,isCurrentPostScheduled:()=>ce,isDeletingPost:()=>_e,isEditedPostAutosaveable:()=>me,isEditedPostBeingScheduled:()=>ge,isEditedPostDateFloating:()=>he,isEditedPostDirty:()=>$,isEditedPostEmpty:()=>pe,isEditedPostNew:()=>j,isEditedPostPublishable:()=>ue,isEditedPostSaveable:()=>de,isEditorPanelEnabled:()=>He,isEditorPanelOpened:()=>ze,isEditorPanelRemoved:()=>Ue,isFirstMultiSelectedBlock:()=>Tt,isInserterOpened:()=>Qe,isListViewOpened:()=>qe,isMultiSelecting:()=>Ft,isPermalinkEditable:()=>Te,isPostAutosavingLocked:()=>Ae,isPostLockTakeover:()=>Re,isPostLocked:()=>Ne,isPostSavingLocked:()=>De,isPreviewingPost:()=>we,isPublishSidebarEnabled:()=>Fe,isPublishingPost:()=>Ce,isSavingNonPostEntityChanges:()=>Ee,isSavingPost:()=>fe,isSelectionEnabled:()=>Vt,isTyping:()=>Ht,isValidTemplate:()=>Wt});var t={};n.r(t),n.d(t,{__experimentalTearDownEditor:()=>dn,__unstableSaveForPreview:()=>yn,autosave:()=>vn,clearSelectedBlock:()=>qn,createUndoLevel:()=>Sn,disablePublishSidebar:()=>Tn,editPost:()=>_n,enablePublishSidebar:()=>Cn,enterFormattedText:()=>_o,exitFormattedText:()=>fo,hideInsertionPoint:()=>io,insertBlock:()=>oo,insertBlocks:()=>so,insertDefaultBlock:()=>Eo,lockPostAutosaving:()=>In,lockPostSaving:()=>xn,mergeBlocks:()=>co,moveBlockToPosition:()=>no,moveBlocksDown:()=>eo,moveBlocksUp:()=>to,multiSelect:()=>Yn,receiveBlocks:()=>Gn,redo:()=>wn,refreshPost:()=>En,removeBlock:()=>po,removeBlocks:()=>uo,removeEditorPanel:()=>Fn,replaceBlock:()=>Jn,replaceBlocks:()=>Xn,resetBlocks:()=>zn,resetEditorBlocks:()=>Dn,resetPost:()=>pn,savePost:()=>fn,selectBlock:()=>$n,setDeviceType:()=>On,setEditedPost:()=>hn,setIsInserterOpened:()=>Vn,setIsListViewOpened:()=>Un,setRenderingMode:()=>Rn,setTemplateValidity:()=>ao,setupEditor:()=>un,setupEditorState:()=>gn,showInsertionPoint:()=>ro,startMultiSelect:()=>Kn,startTyping:()=>go,stopMultiSelect:()=>Zn,stopTyping:()=>ho,synchronizeTemplate:()=>lo,toggleBlockMode:()=>mo,toggleEditorPanelEnabled:()=>Ln,toggleEditorPanelOpened:()=>Mn,toggleSelection:()=>Qn,trashPost:()=>bn,undo:()=>kn,unlockPostAutosaving:()=>Nn,unlockPostSaving:()=>Bn,updateBlock:()=>jn,updateBlockAttributes:()=>Wn,updateBlockListSettings:()=>bo,updateEditorSettings:()=>An,updatePost:()=>mn,updatePostLock:()=>Pn});var s={};n.r(s),n.d(s,{createTemplate:()=>yo,hideBlockTypes:()=>ko,setCurrentTemplateId:()=>vo,showBlockTypes:()=>wo});var r={};n.r(r),n.d(r,{getInsertionPoint:()=>Po,getListViewToggleRef:()=>Co});const i=window.wp.blocks,a=window.wp.data,l=window.wp.privateApis,{lock:c,unlock:u}=(0,l.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/editor"),d=window.wp.i18n,p=((0,d._x)("Pattern Overrides","block bindings source"),window.wp.coreData),m=window.wp.blockEditor,g={...m.SETTINGS_DEFAULTS,richEditingEnabled:!0,codeEditingEnabled:!0,fontLibraryEnabled:!0,enableCustomFields:void 0,defaultRenderingMode:"post-only"};function h(e){return e&&"object"==typeof e&&"raw"in e?e.raw:e}const _=(0,a.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]:n,...o}=e;return o}}return e},editorSettings:function(e=g,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]:n,...o}=e;return o}}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},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}});var f={};function E(e){return[e]}function b(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function v(e,t){var n,o=t||E;function s(){n=new WeakMap}function r(){var t,s,r,i,a,l=arguments.length;for(i=new Array(l),r=0;r<l;r++)i[r]=arguments[r];for(t=function(e){var t,o,s,r,i,a=n,l=!0;for(t=0;t<e.length;t++){if(!(i=o=e[t])||"object"!=typeof i){l=!1;break}a.has(o)?a=a.get(o):(s=new WeakMap,a.set(o,s),a=s)}return a.has(f)||((r=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=l,a.set(f,r)),a.get(f)}(a=o.apply(null,i)),t.isUniqueByDependants||(t.lastDependants&&!b(a,t.lastDependants,0)&&t.clear(),t.lastDependants=a),s=t.head;s;){if(b(s.args,i,1))return s!==t.head&&(s.prev.next=s.next,s.next&&(s.next.prev=s.prev),s.next=t.head,s.prev=null,t.head.prev=s,t.head=s),s.val;s=s.next}return s={val:e.apply(null,i)},i[0]=null,s.args=i,t.head&&(t.head.prev=s,s.next=t.head),t.head=s,s.val}return r.getDependants=o,r.clear=s,s(),r}const y=window.wp.date,w=window.wp.url,k=window.wp.deprecated;var S=n.n(k);const P=window.wp.element;var C=n(1609);const T=window.wp.primitives,x=(0,C.createElement)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,C.createElement)(T.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"})),B=window.wp.preferences,I=new Set(["meta"]),N="SAVE_POST_NOTICE_ID",D="TRASH_POST_NOTICE_ID",A=/%(?:postname|pagename)%/,R=6e4,O=["title","excerpt","content"],L=(0,C.createElement)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,C.createElement)(T.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"})),M=(0,C.createElement)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,C.createElement)(T.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"})),F=(0,C.createElement)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,C.createElement)(T.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"})),V=(0,C.createElement)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,C.createElement)(T.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 U(e){return"header"===e?L:"footer"===e?M:"sidebar"===e?F:V}const H={},z=(0,a.createRegistrySelector)((e=>()=>e(p.store).hasUndo())),G=(0,a.createRegistrySelector)((e=>()=>e(p.store).hasRedo()));function j(e){return"auto-draft"===Y(e).status}function W(e){return"content"in te(e)}const $=(0,a.createRegistrySelector)((e=>t=>{const n=q(t),o=Q(t);return!!e(p.store).hasEditsForEntityRecord("postType",n,o)})),K=(0,a.createRegistrySelector)((e=>t=>{const n=e(p.store).__experimentalGetDirtyEntityRecords(),{type:o,id:s}=Y(t);return n.some((e=>"postType"!==e.kind||e.name!==o||e.key!==s))}));function Z(e){return!$(e)&&j(e)}const Y=(0,a.createRegistrySelector)((e=>t=>{const n=Q(t),o=q(t),s=e(p.store).getRawEntityRecord("postType",o,n);return s||H}));function q(e){return e.postType}function Q(e){return e.postId}function X(e){return e.templateId}function J(e){var t;return null!==(t=Y(e)._links?.["version-history"]?.[0]?.count)&&void 0!==t?t:0}function ee(e){var t;return null!==(t=Y(e)._links?.["predecessor-version"]?.[0]?.id)&&void 0!==t?t:null}const te=(0,a.createRegistrySelector)((e=>t=>{const n=q(t),o=Q(t);return e(p.store).getEntityRecordEdits("postType",n,o)||H}));function ne(e,t){switch(t){case"type":return q(e);case"id":return Q(e);default:const n=Y(e);if(!n.hasOwnProperty(t))break;return h(n[t])}}const oe=v(((e,t)=>{const n=te(e);return n.hasOwnProperty(t)?{...ne(e,t),...n[t]}:ne(e,t)}),((e,t)=>[ne(e,t),te(e)[t]]));function se(e,t){if("content"===t)return Pe(e);const n=te(e);return n.hasOwnProperty(t)?I.has(t)?oe(e,t):n[t]:ne(e,t)}const re=(0,a.createRegistrySelector)((e=>(t,n)=>{if(!O.includes(n)&&"preview_link"!==n)return;const o=q(t);if("wp_template"===o)return!1;const s=Q(t),r=e(p.store).getCurrentUser()?.id,i=e(p.store).getAutosave(o,s,r);return i?h(i[n]):void 0}));function ie(e){if("private"===se(e,"status"))return"private";return se(e,"password")?"password":"public"}function ae(e){return"pending"===Y(e).status}function le(e,t){const n=t||Y(e);return-1!==["publish","private"].indexOf(n.status)||"future"===n.status&&!(0,y.isInTheFuture)(new Date(Number((0,y.getDate)(n.date))-R))}function ce(e){return"future"===Y(e).status&&!le(e)}function ue(e){const t=Y(e);return $(e)||-1===["publish","private","future"].indexOf(t.status)}function de(e){return!fe(e)&&(!!se(e,"title")||!!se(e,"excerpt")||!pe(e)||"native"===P.Platform.OS)}const pe=(0,a.createRegistrySelector)((e=>t=>{const n=Q(t),o=q(t),s=e(p.store).getEditedEntityRecord("postType",o,n);if("function"!=typeof s.content)return!s.content;const r=se(t,"blocks");if(0===r.length)return!0;if(r.length>1)return!1;const a=r[0].name;return(a===(0,i.getDefaultBlockName)()||a===(0,i.getFreeformContentHandlerName)())&&!Pe(t)})),me=(0,a.createRegistrySelector)((e=>t=>{if(!de(t))return!1;if(Ae(t))return!1;const n=q(t);if("wp_template"===n)return!1;const o=Q(t),s=e(p.store).hasFetchedAutosaves(n,o),r=e(p.store).getCurrentUser()?.id,i=e(p.store).getAutosave(n,o,r);return!!s&&(!i||(!!W(t)||["title","excerpt","meta"].some((e=>h(i[e])!==se(t,e)))))}));function ge(e){const t=se(e,"date"),n=new Date(Number((0,y.getDate)(t))-R);return(0,y.isInTheFuture)(n)}function he(e){const t=se(e,"date"),n=se(e,"modified"),o=Y(e).status;return("draft"===o||"auto-draft"===o||"pending"===o)&&(t===n||null===t)}function _e(e){return!!e.deleting.pending}function fe(e){return!!e.saving.pending}const Ee=(0,a.createRegistrySelector)((e=>t=>{const n=e(p.store).__experimentalGetEntitiesBeingSaved(),{type:o,id:s}=Y(t);return n.some((e=>"postType"!==e.kind||e.name!==o||e.key!==s))})),be=(0,a.createRegistrySelector)((e=>t=>{const n=q(t),o=Q(t);return!e(p.store).getLastEntitySaveError("postType",n,o)})),ve=(0,a.createRegistrySelector)((e=>t=>{const n=q(t),o=Q(t);return!!e(p.store).getLastEntitySaveError("postType",n,o)}));function ye(e){return fe(e)&&Boolean(e.saving.options?.isAutosave)}function we(e){return fe(e)&&Boolean(e.saving.options?.isPreview)}function ke(e){if(e.saving.pending||fe(e))return;let t=re(e,"preview_link");t&&"draft"!==Y(e).status||(t=se(e,"link"),t&&(t=(0,w.addQueryArgs)(t,{preview:!0})));const n=se(e,"featured_media");return t&&n?(0,w.addQueryArgs)(t,{_thumbnail_id:n}):t}const Se=(0,a.createRegistrySelector)((e=>()=>{const t=e(m.store).getBlocks();if(t.length>2)return null;let n;if(1===t.length&&(n=t[0].name,"core/embed"===n)){const e=t[0].attributes?.providerNameSlug;["youtube","vimeo"].includes(e)?n="core/video":["spotify","soundcloud"].includes(e)&&(n="core/audio")}switch(2===t.length&&"core/paragraph"===t[1].name&&(n=t[0].name),n){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}})),Pe=(0,a.createRegistrySelector)((e=>t=>{const n=Q(t),o=q(t),s=e(p.store).getEditedEntityRecord("postType",o,n);if(s){if("function"==typeof s.content)return s.content(s);if(s.blocks)return(0,i.__unstableSerializeAndClean)(s.blocks);if(s.content)return s.content}return""}));function Ce(e){return fe(e)&&!le(e)&&"publish"===se(e,"status")}function Te(e){const t=se(e,"permalink_template");return A.test(t)}function xe(e){const t=Ie(e);if(!t)return null;const{prefix:n,postName:o,suffix:s}=t;return Te(e)?n+o+s:n}function Be(e){return se(e,"slug")||(0,w.cleanForSlug)(se(e,"title"))||Q(e)}function Ie(e){const t=se(e,"permalink_template");if(!t)return null;const n=se(e,"slug")||se(e,"generated_slug"),[o,s]=t.split(A);return{prefix:o,postName:n,suffix:s}}function Ne(e){return e.postLock.isLocked}function De(e){return Object.keys(e.postSavingLock).length>0}function Ae(e){return Object.keys(e.postAutosavingLock).length>0}function Re(e){return e.postLock.isTakeover}function Oe(e){return e.postLock.user}function Le(e){return e.postLock.activePostLock}function Me(e){return Boolean(Y(e)._links?.hasOwnProperty("wp:action-unfiltered-html"))}const Fe=(0,a.createRegistrySelector)((e=>()=>!!e(B.store).get("core/edit-post","isPublishSidebarEnabled"))),Ve=v((e=>se(e,"blocks")||(0,i.parse)(Pe(e))),(e=>[se(e,"blocks"),Pe(e)]));function Ue(e,t){return e.removedPanels.includes(t)}const He=(0,a.createRegistrySelector)((e=>(t,n)=>{const o=e(B.store).get("core","inactivePanels");return!Ue(t,n)&&!o?.includes(n)})),ze=(0,a.createRegistrySelector)((e=>(t,n)=>{const o=e(B.store).get("core","openPanels");return!!o?.includes(n)}));function Ge(e){return S()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),se(e,"selection")?.selectionStart}function je(e){return S()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),se(e,"selection")?.selectionEnd}function We(e){return se(e,"selection")}function $e(e){return!!e.postId}function Ke(e){return e.editorSettings}function Ze(e){return e.renderingMode}function Ye(e){return e.deviceType}function qe(e){return e.listViewPanel}function Qe(e){return!!e.blockInserterPanel}function Xe(){return S()("select('core/editor').getStateBeforeOptimisticTransaction",{since:"5.7",hint:"No state history is kept on this store anymore"}),null}function Je(){return S()("select('core/editor').inSomeHistory",{since:"5.7",hint:"No state history is kept on this store anymore"}),!1}function et(e){return(0,a.createRegistrySelector)((t=>(n,...o)=>(S()("`wp.data.select( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.select( 'core/block-editor' )."+e+"`",version:"6.2"}),t(m.store)[e](...o))))}const tt=et("getBlockName"),nt=et("isBlockValid"),ot=et("getBlockAttributes"),st=et("getBlock"),rt=et("getBlocks"),it=et("getClientIdsOfDescendants"),at=et("getClientIdsWithDescendants"),lt=et("getGlobalBlockCount"),ct=et("getBlocksByClientId"),ut=et("getBlockCount"),dt=et("getBlockSelectionStart"),pt=et("getBlockSelectionEnd"),mt=et("getSelectedBlockCount"),gt=et("hasSelectedBlock"),ht=et("getSelectedBlockClientId"),_t=et("getSelectedBlock"),ft=et("getBlockRootClientId"),Et=et("getBlockHierarchyRootClientId"),bt=et("getAdjacentBlockClientId"),vt=et("getPreviousBlockClientId"),yt=et("getNextBlockClientId"),wt=et("getSelectedBlocksInitialCaretPosition"),kt=et("getMultiSelectedBlockClientIds"),St=et("getMultiSelectedBlocks"),Pt=et("getFirstMultiSelectedBlockClientId"),Ct=et("getLastMultiSelectedBlockClientId"),Tt=et("isFirstMultiSelectedBlock"),xt=et("isBlockMultiSelected"),Bt=et("isAncestorMultiSelected"),It=et("getMultiSelectedBlocksStartClientId"),Nt=et("getMultiSelectedBlocksEndClientId"),Dt=et("getBlockOrder"),At=et("getBlockIndex"),Rt=et("isBlockSelected"),Ot=et("hasSelectedInnerBlock"),Lt=et("isBlockWithinSelection"),Mt=et("hasMultiSelection"),Ft=et("isMultiSelecting"),Vt=et("isSelectionEnabled"),Ut=et("getBlockMode"),Ht=et("isTyping"),zt=et("isCaretWithinFormattedText"),Gt=et("getBlockInsertionPoint"),jt=et("isBlockInsertionPointVisible"),Wt=et("isValidTemplate"),$t=et("getTemplate"),Kt=et("getTemplateLock"),Zt=et("canInsertBlockType"),Yt=et("getInserterItems"),qt=et("hasInserterItems"),Qt=et("getBlockListSettings");function Xt(e){return Ke(e)?.defaultTemplateTypes}const Jt=v((e=>{const t=Ke(e)?.defaultTemplatePartAreas||[];return t?.map((e=>({...e,icon:U(e.icon)})))}),(e=>[Ke(e)?.defaultTemplatePartAreas])),en=v(((e,t)=>{var n;const o=Xt(e);return o&&null!==(n=Object.values(o).find((e=>e.slug===t)))&&void 0!==n?n:H}),((e,t)=>[Xt(e),t]));function tn(e,t){if(!t)return H;const{description:n,slug:o,title:s,area:r}=t,{title:i,description:a}=en(e,o),l="string"==typeof s?s:s?.rendered;return{title:l&&l!==o?l:i||o,description:("string"==typeof n?n:n?.raw)||a,icon:Jt(e).find((e=>r===e.area))?.icon||x}}const nn=(0,a.createRegistrySelector)((e=>t=>{const n=q(t),o=e(p.store).getPostType(n);return o?.labels?.singular_name})),on=window.wp.apiFetch;var sn=n.n(on);const rn=window.wp.notices,an=window.wp.hooks;function ln(e,t){return`wp-autosave-block-editor-post-${t?"auto-draft":e}`}function cn(e,t){window.sessionStorage.removeItem(ln(e,t))}const un=(e,t,n)=>({dispatch:o})=>{o.setEditedPost(e.type,e.id);if("auto-draft"===e.status&&n){let s;s="content"in t?t.content:e.content.raw;let r=(0,i.parse)(s);r=(0,i.synchronizeBlocksWithTemplate)(r,n),o.resetEditorBlocks(r,{__unstableShouldCreateUndoLevel:!1})}t&&Object.values(t).some((([t,n])=>{var o;return n!==(null!==(o=e[t]?.raw)&&void 0!==o?o:e[t])}))&&o.editPost(t)};function dn(){return S()("wp.data.dispatch( 'core/editor' ).__experimentalTearDownEditor",{since:"6.5"}),{type:"DO_NOTHING"}}function pn(){return S()("wp.data.dispatch( 'core/editor' ).resetPost",{since:"6.0",version:"6.3",alternative:"Initialize the editor with the setupEditorState action"}),{type:"DO_NOTHING"}}function mn(){return S()("wp.data.dispatch( 'core/editor' ).updatePost",{since:"5.7",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function gn(e){return S()("wp.data.dispatch( 'core/editor' ).setupEditorState",{since:"6.5",alternative:"wp.data.dispatch( 'core/editor' ).setEditedPost"}),hn(e.type,e.id)}function hn(e,t){return{type:"SET_EDITED_POST",postType:e,postId:t}}const _n=(e,t)=>({select:n,registry:o})=>{const{id:s,type:r}=n.getCurrentPost();o.dispatch(p.store).editEntityRecord("postType",r,s,e,t)},fn=(e={})=>async({select:t,dispatch:n,registry:o})=>{if(!t.isEditedPostSaveable())return;const s=t.getEditedPostContent();e.isAutosave||n.editPost({content:s},{undoIgnore:!0});const r=t.getCurrentPost(),i={id:r.id,...o.select(p.store).getEntityRecordNonTransientEdits("postType",r.type,r.id),content:s};n({type:"REQUEST_POST_UPDATE_START",options:e}),await o.dispatch(p.store).saveEntityRecord("postType",r.type,i,e);let a=o.select(p.store).getLastEntitySaveError("postType",r.type,r.id);if(a||await(0,an.applyFilters)("editor.__unstableSavePost",Promise.resolve(),e).catch((e=>{a=e})),n({type:"REQUEST_POST_UPDATE_FINISH",options:e}),a){const e=function(e){const{post:t,edits:n,error:o}=e;if(o&&"rest_autosave_no_changes"===o.code)return[];const s=["publish","private","future"],r=-1!==s.indexOf(t.status),i={publish:(0,d.__)("Publishing failed."),private:(0,d.__)("Publishing failed."),future:(0,d.__)("Scheduling failed.")};let a=r||-1===s.indexOf(n.status)?(0,d.__)("Updating failed."):i[n.status];return o.message&&!/<\/?[^>]*>/.test(o.message)&&(a=[a,o.message].join(" ")),[a,{id:N}]}({post:r,edits:i,error:a});e.length&&o.dispatch(rn.store).createErrorNotice(...e)}else{const n=t.getCurrentPost(),s=function(e){var t;const{previousPost:n,post:o,postType:s}=e;if(e.options?.isAutosave)return[];const r=["publish","private","future"],i=r.includes(n.status),a=r.includes(o.status),l="trash"===o.status&&"trash"!==n.status;let c,u,p=null!==(t=s?.viewable)&&void 0!==t&&t;l?(c=s.labels.item_trashed,p=!1):i||a?i&&!a?(c=s.labels.item_reverted_to_draft,p=!1):c=!i&&a?{publish:s.labels.item_published,private:s.labels.item_published_privately,future:s.labels.item_scheduled}[o.status]:s.labels.item_updated:(c=(0,d.__)("Draft saved."),u=!0);const m=[];return p&&m.push({label:u?(0,d.__)("View Preview"):s.labels.view_item,url:o.link}),[c,{id:N,type:"snackbar",actions:m}]}({previousPost:r,post:n,postType:await o.resolveSelect(p.store).getPostType(n.type),options:e});s.length&&o.dispatch(rn.store).createSuccessNotice(...s),e.isAutosave||o.dispatch(m.store).__unstableMarkLastChangeAsPersistent()}};function En(){return S()("wp.data.dispatch( 'core/editor' ).refreshPost",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}const bn=()=>async({select:e,dispatch:t,registry:n})=>{const o=e.getCurrentPostType(),s=await n.resolveSelect(p.store).getPostType(o);n.dispatch(rn.store).removeNotice(D);const{rest_base:r,rest_namespace:i="wp/v2"}=s;t({type:"REQUEST_POST_DELETE_START"});try{const n=e.getCurrentPost();await sn()({path:`/${i}/${r}/${n.id}`,method:"DELETE"}),await t.savePost()}catch(e){n.dispatch(rn.store).createErrorNotice(...(a={error:e},[a.error.message&&"unknown_error"!==a.error.code?a.error.message:(0,d.__)("Trashing failed"),{id:D}]))}var a;t({type:"REQUEST_POST_DELETE_FINISH"})},vn=({local:e=!1,...t}={})=>async({select:n,dispatch:o})=>{const s=n.getCurrentPost();if("wp_template"!==s.type)if(e){const e=n.isEditedPostNew(),t=n.getEditedPostAttribute("title"),o=n.getEditedPostAttribute("content"),r=n.getEditedPostAttribute("excerpt");!function(e,t,n,o,s){window.sessionStorage.setItem(ln(e,t),JSON.stringify({post_title:n,content:o,excerpt:s}))}(s.id,e,t,o,r)}else await o.savePost({isAutosave:!0,...t})},yn=({forceIsAutosaveable:e}={})=>async({select:t,dispatch:n})=>{if((e||t.isEditedPostAutosaveable())&&!t.isPostLocked()){["draft","auto-draft"].includes(t.getEditedPostAttribute("status"))?await n.savePost({isPreview:!0}):await n.autosave({isPreview:!0})}return t.getEditedPostPreviewLink()},wn=()=>({registry:e})=>{e.dispatch(p.store).redo()},kn=()=>({registry:e})=>{e.dispatch(p.store).undo()};function Sn(){return S()("wp.data.dispatch( 'core/editor' ).createUndoLevel",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function Pn(e){return{type:"UPDATE_POST_LOCK",lock:e}}const Cn=()=>({registry:e})=>{e.dispatch(B.store).set("core/edit-post","isPublishSidebarEnabled",!0)},Tn=()=>({registry:e})=>{e.dispatch(B.store).set("core/edit-post","isPublishSidebarEnabled",!1)};function xn(e){return{type:"LOCK_POST_SAVING",lockName:e}}function Bn(e){return{type:"UNLOCK_POST_SAVING",lockName:e}}function In(e){return{type:"LOCK_POST_AUTOSAVING",lockName:e}}function Nn(e){return{type:"UNLOCK_POST_AUTOSAVING",lockName:e}}const Dn=(e,t={})=>({select:n,dispatch:o,registry:s})=>{const{__unstableShouldCreateUndoLevel:r,selection:a}=t,l={blocks:e,selection:a};if(!1!==r){const{id:e,type:t}=n.getCurrentPost();if(s.select(p.store).getEditedEntityRecord("postType",t,e).blocks===l.blocks)return void s.dispatch(p.store).__unstableCreateUndoLevel("postType",t,e);l.content=({blocks:e=[]})=>(0,i.__unstableSerializeAndClean)(e)}o.editPost(l)};function An(e){return{type:"UPDATE_EDITOR_SETTINGS",settings:e}}const Rn=e=>({dispatch:t,registry:n,select:o})=>{o.__unstableIsEditorReady()&&(n.dispatch(m.store).clearSelectedBlock(),t.editPost({selection:void 0},{undoIgnore:!0})),t({type:"SET_RENDERING_MODE",mode:e})};function On(e){return{type:"SET_DEVICE_TYPE",deviceType:e}}const Ln=e=>({registry:t})=>{var n;const o=null!==(n=t.select(B.store).get("core","inactivePanels"))&&void 0!==n?n:[];let s;s=!!o?.includes(e)?o.filter((t=>t!==e)):[...o,e],t.dispatch(B.store).set("core","inactivePanels",s)},Mn=e=>({registry:t})=>{var n;const o=null!==(n=t.select(B.store).get("core","openPanels"))&&void 0!==n?n:[];let s;s=!!o?.includes(e)?o.filter((t=>t!==e)):[...o,e],t.dispatch(B.store).set("core","openPanels",s)};function Fn(e){return{type:"REMOVE_PANEL",panelName:e}}function Vn(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function Un(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}const Hn=e=>(...t)=>({registry:n})=>{S()("`wp.data.dispatch( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.dispatch( 'core/block-editor' )."+e+"`",version:"6.2"}),n.dispatch(m.store)[e](...t)},zn=Hn("resetBlocks"),Gn=Hn("receiveBlocks"),jn=Hn("updateBlock"),Wn=Hn("updateBlockAttributes"),$n=Hn("selectBlock"),Kn=Hn("startMultiSelect"),Zn=Hn("stopMultiSelect"),Yn=Hn("multiSelect"),qn=Hn("clearSelectedBlock"),Qn=Hn("toggleSelection"),Xn=Hn("replaceBlocks"),Jn=Hn("replaceBlock"),eo=Hn("moveBlocksDown"),to=Hn("moveBlocksUp"),no=Hn("moveBlockToPosition"),oo=Hn("insertBlock"),so=Hn("insertBlocks"),ro=Hn("showInsertionPoint"),io=Hn("hideInsertionPoint"),ao=Hn("setTemplateValidity"),lo=Hn("synchronizeTemplate"),co=Hn("mergeBlocks"),uo=Hn("removeBlocks"),po=Hn("removeBlock"),mo=Hn("toggleBlockMode"),go=Hn("startTyping"),ho=Hn("stopTyping"),_o=Hn("enterFormattedText"),fo=Hn("exitFormattedText"),Eo=Hn("insertDefaultBlock"),bo=Hn("updateBlockListSettings");function vo(e){return{type:"SET_CURRENT_TEMPLATE_ID",id:e}}const yo=e=>async({select:t,dispatch:n,registry:o})=>{const s=await o.dispatch(p.store).saveEntityRecord("postType","wp_template",e);return o.dispatch(p.store).editEntityRecord("postType",t.getCurrentPostType(),t.getCurrentPostId(),{template:s.slug}),o.dispatch(rn.store).createSuccessNotice((0,d.__)("Custom template created. You're in template mode now."),{type:"snackbar",actions:[{label:(0,d.__)("Go back"),onClick:()=>n.setRenderingMode(t.getEditorSettings().defaultRenderingMode)}]}),s},wo=e=>({registry:t})=>{var n;const o=(null!==(n=t.select(B.store).get("core","hiddenBlockTypes"))&&void 0!==n?n:[]).filter((t=>!(Array.isArray(e)?e:[e]).includes(t)));t.dispatch(B.store).set("core","hiddenBlockTypes",o)},ko=e=>({registry:t})=>{var n;const o=null!==(n=t.select(B.store).get("core","hiddenBlockTypes"))&&void 0!==n?n:[],s=new Set([...o,...Array.isArray(e)?e:[e]]);t.dispatch(B.store).set("core","hiddenBlockTypes",[...s])},So={rootClientId:void 0,insertionIndex:void 0,filterValue:void 0},Po=(0,a.createRegistrySelector)((e=>t=>{if("object"==typeof t.blockInserterPanel)return t.blockInserterPanel;if("template-locked"===Ze(t)){const[t]=e(m.store).getBlocksByName("core/post-content");if(t)return{rootClientId:t,insertionIndex:void 0,filterValue:void 0}}return So}));function Co(e){return e.listViewToggleRef}const To={reducer:_,selectors:e,actions:t},xo=(0,a.createReduxStore)("core/editor",{...To});(0,a.register)(xo),u(xo).registerPrivateActions(s),u(xo).registerPrivateSelectors(r);const Bo={name:"core/post-meta",label:(0,d._x)("Post Meta","block bindings source"),useSource(e,t){const{getCurrentPostType:n}=(0,a.useSelect)(xo),{context:o}=e,{key:s}=t,r=o.postType?o.postType:n(),[i,l]=(0,p.useEntityProp)("postType",o.postType,"meta",o.postId);if("wp_template"===r)return{placeholder:s};const c=i[s];return{placeholder:s,value:c,updateValue:e=>{l({...i,[s]:e})}}}},{registerBlockBindingsSource:Io}=u((0,a.dispatch)(i.store));Io(Bo);const No=window.wp.compose;function Do(e){const t=e.avatar_urls&&e.avatar_urls[24]?(0,C.createElement)("img",{className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls[24]}):(0,C.createElement)("span",{className:"editor-autocompleters__no-avatar"});return(0,C.createElement)(C.Fragment,null,t,(0,C.createElement)("span",{className:"editor-autocompleters__user-name"},e.name),(0,C.createElement)("span",{className:"editor-autocompleters__user-slug"},e.slug))}(0,an.addFilter)("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",(function(e){var t;const n=Object.fromEntries(Object.entries(null!==(t=e.attributes)&&void 0!==t?t:{}).filter((([,{source:e}])=>"meta"===e)).map((([e,{meta:t}])=>[e,t])));return Object.entries(n).length&&(e.edit=(e=>(0,No.createHigherOrderComponent)((t=>({attributes:n,setAttributes:o,...s})=>{const r=(0,a.useSelect)((e=>e(xo).getCurrentPostType()),[]),[i,l]=(0,p.useEntityProp)("postType",r,"meta"),c=(0,P.useMemo)((()=>({...n,...Object.fromEntries(Object.entries(e).map((([e,t])=>[e,i[t]])))})),[n,i]);return(0,C.createElement)(t,{attributes:c,setAttributes:t=>{const n=Object.fromEntries(Object.entries(null!=t?t:{}).filter((([t])=>t in e)).map((([t,n])=>[e[t],n])));Object.entries(n).length&&l(n),o(t)},...s})}),"withMetaAttributeSource"))(n)(e.edit)),e}));const Ao={name:"users",className:"editor-autocompleters__user",triggerPrefix:"@",useItems(e){const t=(0,a.useSelect)((t=>{const{getUsers:n}=t(p.store);return n({context:"view",search:encodeURIComponent(e)})}),[e]),n=(0,P.useMemo)((()=>t?t.map((e=>({key:`user-${e.slug}`,value:e,label:Do(e)}))):[]),[t]);return[n]},getOptionCompletion:e=>`@${e.slug}`};(0,an.addFilter)("editor.Autocomplete.completers","editor/autocompleters/set-default-completers",(function(e=[]){return e.push({...Ao}),e}));const Ro=window.wp.patterns,{useSetPatternBindings:Oo,ResetOverridesControl:Lo,PATTERN_TYPES:Mo,PARTIAL_SYNCING_SUPPORTED_BLOCKS:Fo}=u(Ro.privateApis),Vo=(0,No.createHigherOrderComponent)((e=>t=>{const n=Object.keys(Fo).includes(t.name);return(0,C.createElement)(C.Fragment,null,(0,C.createElement)(e,{...t}),n&&(0,C.createElement)(Uo,{...t}),t.isSelected&&n&&(0,C.createElement)(Ho,{...t}))}));function Uo(e){const t=(0,a.useSelect)((e=>e(xo).getCurrentPostType()),[]);return Oo(e,t),null}function Ho(e){const t=(0,m.useBlockEditingMode)(),n=(0,a.useSelect)((e=>e(xo).getCurrentPostType()===Mo.user),[]),o=e.attributes.metadata?.bindings,s=!!o&&Object.values(o).some((e=>"core/pattern-overrides"===e.source)),r=!n&&!!e.attributes.metadata?.name&&"disabled"!==t&&s;return(0,C.createElement)(C.Fragment,null,r&&(0,C.createElement)(Lo,{...e}))}(0,an.addFilter)("editor.BlockEdit","core/editor/with-pattern-override-controls",Vo);const zo=window.wp.keyboardShortcuts;function Go(){const{redo:e,undo:t,savePost:n,setIsListViewOpened:o}=(0,a.useDispatch)(xo),{isEditedPostDirty:s,isPostSavingLocked:r,isListViewOpened:i}=(0,a.useSelect)(xo);return(0,zo.useShortcut)("core/editor/undo",(e=>{t(),e.preventDefault()})),(0,zo.useShortcut)("core/editor/redo",(t=>{e(),t.preventDefault()})),(0,zo.useShortcut)("core/editor/save",(e=>{e.preventDefault(),r()||s()&&n()})),(0,zo.useShortcut)("core/editor/toggle-list-view",(e=>{i()||(e.preventDefault(),o(!0))})),null}class jo 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}}const Wo=(0,No.compose)([(0,a.withSelect)(((e,t)=>{const{getReferenceByDistinctEdits:n}=e(p.store),{isEditedPostDirty:o,isEditedPostAutosaveable:s,isAutosavingPost:r,getEditorSettings:i}=e(xo),{interval:a=i().autosaveInterval}=t;return{editsReference:n(),isDirty:o(),isAutosaveable:s(),isAutosaving:r(),interval:a}})),(0,a.withDispatch)(((e,t)=>({autosave(){const{autosave:n=e(xo).autosave}=t;n()}})))])(jo);var $o=n(5755),Ko=n.n($o);const Zo=window.wp.components,Yo=(0,C.createElement)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,C.createElement)(T.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"})),qo=(0,C.createElement)(T.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,C.createElement)(T.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"})),Qo=(0,C.createElement)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,C.createElement)(T.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,C.createElement)(T.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"})),Xo=(0,C.createElement)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,C.createElement)(T.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),Jo=(0,C.createElement)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,C.createElement)(T.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})),es=window.wp.keycodes,ts=window.wp.commands,ns={wp_pattern:(0,d.__)("Editing pattern: %s"),wp_navigation:(0,d.__)("Editing navigation menu: %s"),wp_template:(0,d.__)("Editing template: %s"),wp_template_part:(0,d.__)("Editing template part: %s")},os={wp_block:Yo,wp_navigation:qo};function ss(){const{postType:e,postId:t,onNavigateToPreviousEntityRecord:n}=(0,a.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:n,getEditorSettings:o}=e(xo);return{postType:n(),postId:t(),onNavigateToPreviousEntityRecord:o().onNavigateToPreviousEntityRecord,getEditorSettings:o}}),[]);return(0,C.createElement)(rs,{postType:e,postId:t,onBack:n?()=>{n&&n()}:void 0})}function rs({postType:e,postId:t,onBack:n}){var o;const{open:s}=(0,a.useDispatch)(ts.store),{editedRecord:r,isResolving:i}=(0,p.useEntityRecord)("postType",e,t),{templateIcon:l,templateTitle:c}=(0,a.useSelect)((e=>{const{__experimentalGetTemplateInfo:t}=e(xo),n=t(r);return{templateIcon:n.icon,templateTitle:n.title}})),u=!r&&!i,g=null!==(o=os[e])&&void 0!==o?o:Qo,[h,_]=(0,P.useState)(!1),f=(0,P.useRef)(!0),E=["wp_template","wp_template_part"].includes(e),b=["wp_template","wp_navigation","wp_template_part","wp_block"].includes(e);(0,P.useEffect)((()=>{f.current||_(!0),f.current=!1}),[e,t]);const v=E?c:r.title;return(0,C.createElement)("div",{className:Ko()("editor-document-bar",{"has-back-button":!!n,"is-animated":h,"is-global":b})},n&&(0,C.createElement)(Zo.Button,{className:"editor-document-bar__back",icon:(0,d.isRTL)()?Xo:Jo,onClick:e=>{e.stopPropagation(),n()},size:"compact"},(0,d.__)("Back")),u&&(0,C.createElement)(Zo.__experimentalText,null,(0,d.__)("Document not found")),!u&&(0,C.createElement)(Zo.Button,{className:"editor-document-bar__command",onClick:()=>s(),size:"compact"},(0,C.createElement)(Zo.__experimentalHStack,{className:"editor-document-bar__title",spacing:1,justify:"center"},(0,C.createElement)(m.BlockIcon,{icon:E?l:g}),(0,C.createElement)(Zo.__experimentalText,{size:"body",as:"h1","aria-label":ns[e]?(0,d.sprintf)(ns[e],v):void 0},v)),(0,C.createElement)("span",{className:"editor-document-bar__shortcut"},es.displayShortcut.primary("k"))))}const is=window.wp.richText,as=({children:e,isValid:t,level:n,href:o,onSelect:s})=>(0,C.createElement)("li",{className:Ko()("document-outline__item",`is-${n.toLowerCase()}`,{"is-invalid":!t})},(0,C.createElement)("a",{href:o,className:"document-outline__button",onClick:s},(0,C.createElement)("span",{className:"document-outline__emdash","aria-hidden":"true"}),(0,C.createElement)("strong",{className:"document-outline__level"},n),(0,C.createElement)("span",{className:"document-outline__item-content"},e))),ls=(0,C.createElement)("em",null,(0,d.__)("(Empty heading)")),cs=[(0,C.createElement)("br",{key:"incorrect-break"}),(0,C.createElement)("em",{key:"incorrect-message"},(0,d.__)("(Incorrect heading level)"))],us=[(0,C.createElement)("br",{key:"incorrect-break-h1"}),(0,C.createElement)("em",{key:"incorrect-message-h1"},(0,d.__)("(Your theme may already use a H1 for the post title)"))],ds=[(0,C.createElement)("br",{key:"incorrect-break-multiple-h1"}),(0,C.createElement)("em",{key:"incorrect-message-multiple-h1"},(0,d.__)("(Multiple H1 headings are not recommended)"))];function ps(){return(0,C.createElement)(Zo.SVG,{width:"138",height:"148",viewBox:"0 0 138 148",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,C.createElement)(Zo.Rect,{width:"138",height:"148",rx:"4",fill:"#F0F6FC"}),(0,C.createElement)(Zo.Line,{x1:"44",y1:"28",x2:"24",y2:"28",stroke:"#DDDDDD"}),(0,C.createElement)(Zo.Rect,{x:"48",y:"16",width:"27",height:"23",rx:"4",fill:"#DDDDDD"}),(0,C.createElement)(Zo.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.createElement)(Zo.Line,{x1:"55",y1:"59",x2:"24",y2:"59",stroke:"#DDDDDD"}),(0,C.createElement)(Zo.Rect,{x:"59",y:"47",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,C.createElement)(Zo.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.createElement)(Zo.Line,{x1:"80",y1:"90",x2:"24",y2:"90",stroke:"#DDDDDD"}),(0,C.createElement)(Zo.Rect,{x:"84",y:"78",width:"30",height:"23",rx:"4",fill:"#F0B849"}),(0,C.createElement)(Zo.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.createElement)(Zo.Line,{x1:"66",y1:"121",x2:"24",y2:"121",stroke:"#DDDDDD"}),(0,C.createElement)(Zo.Rect,{x:"70",y:"109",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,C.createElement)(Zo.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 ms=(e=[])=>e.flatMap(((e={})=>"core/heading"===e.name?{...e,level:e.attributes.level,isEmpty:gs(e)}:ms(e.innerBlocks))),gs=e=>!e.attributes.content||0===e.attributes.content.length,hs=(0,No.compose)((0,a.withSelect)((e=>{var t;const{getBlocks:n}=e(m.store),{getEditedPostAttribute:o}=e(xo),{getPostType:s}=e(p.store),r=s(o("type"));return{title:o("title"),blocks:n(),isTitleSupported:null!==(t=r?.supports?.title)&&void 0!==t&&t}})))((({blocks:e=[],title:t,onSelect:n,isTitleSupported:o,hasOutlineItemsDisabled:s})=>{const r=ms(e),{selectBlock:i}=(0,a.useDispatch)(m.store);if(r.length<1)return(0,C.createElement)("div",{className:"editor-document-outline has-no-headings"},(0,C.createElement)(ps,null),(0,C.createElement)("p",null,(0,d.__)("Navigate the structure of your document and address issues like empty or incorrect heading levels.")));let l=1;const c=document.querySelector(".editor-post-title__input"),u=o&&t&&c,p=r.reduce(((e,t)=>({...e,[t.level]:(e[t.level]||0)+1})),{})[1]>1;return(0,C.createElement)("div",{className:"document-outline"},(0,C.createElement)("ul",null,u&&(0,C.createElement)(as,{level:(0,d.__)("Title"),isValid:!0,onSelect:n,href:`#${c.id}`,isDisabled:s},t),r.map(((e,t)=>{const o=e.level>l+1,r=!(e.isEmpty||o||!e.level||1===e.level&&(p||u));return l=e.level,(0,C.createElement)(as,{key:t,level:`H${e.level}`,isValid:r,isDisabled:s,href:`#block-${e.clientId}`,onSelect:()=>{i(e.clientId),n?.()}},e.isEmpty?ls:(0,is.getTextContent)((0,is.create)({html:e.attributes.content})),o&&cs,1===e.level&&p&&ds,u&&1===e.level&&!p&&us)}))))}));const _s=(0,a.withSelect)((e=>({blocks:e(m.store).getBlocks()})))((function({blocks:e,children:t}){return e.filter((e=>"core/heading"===e.name)).length<1?null:t}));const fs=function(){const{registerShortcut:e}=(0,a.useDispatch)(zo.store);return(0,P.useEffect)((()=>{e({name:"core/editor/save",category:"global",description:(0,d.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/editor/undo",category:"global",description:(0,d.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/editor/redo",category:"global",description:(0,d.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,es.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/editor/toggle-list-view",category:"global",description:(0,d.__)("Open the block list view."),keyCombination:{modifier:"access",character:"o"}})}),[e]),(0,C.createElement)(m.BlockEditorKeyboardShortcuts.Register,null)},Es=(0,C.createElement)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,C.createElement)(T.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"})),bs=(0,C.createElement)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,C.createElement)(T.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"}));const vs=(0,P.forwardRef)((function(e,t){const n=(0,es.isAppleOS)()?es.displayShortcut.primaryShift("z"):es.displayShortcut.primary("y"),o=(0,a.useSelect)((e=>e(xo).hasEditorRedo()),[]),{redo:s}=(0,a.useDispatch)(xo);return(0,C.createElement)(Zo.Button,{...e,ref:t,icon:(0,d.isRTL)()?bs:Es,label:(0,d.__)("Redo"),shortcut:n,"aria-disabled":!o,onClick:o?s:void 0,className:"editor-history__redo"})}));const ys=(0,P.forwardRef)((function(e,t){const n=(0,a.useSelect)((e=>e(xo).hasEditorUndo()),[]),{undo:o}=(0,a.useDispatch)(xo);return(0,C.createElement)(Zo.Button,{...e,ref:t,icon:(0,d.isRTL)()?Es:bs,label:(0,d.__)("Undo"),shortcut:es.displayShortcut.primary("z"),"aria-disabled":!n,onClick:n?o:void 0,className:"editor-history__undo"})}));const ws=(0,No.compose)([(0,a.withSelect)((e=>({isValid:e(m.store).isValidTemplate()}))),(0,a.withDispatch)((e=>{const{setTemplateValidity:t,synchronizeTemplate:n}=e(m.store);return{resetTemplateValidity:()=>t(!0),synchronizeTemplate:n}}))])((function({isValid:e,...t}){return e?null:(0,C.createElement)(Zo.Notice,{className:"editor-template-validation-notice",isDismissible:!1,status:"warning",actions:[{label:(0,d.__)("Keep it as is"),onClick:t.resetTemplateValidity},{label:(0,d.__)("Reset the template"),onClick:()=>{window.confirm((0,d.__)("Resetting the template may result in loss of content, do you want to continue?"))&&t.synchronizeTemplate()}}]},(0,d.__)("The content of your post doesn’t match the template assigned to your post type."))}));const ks=function(){const{notices:e}=(0,a.useSelect)((e=>({notices:e(rn.store).getNotices()})),[]),{removeNotice:t}=(0,a.useDispatch)(rn.store),n=e.filter((({isDismissible:e,type:t})=>e&&"default"===t)),o=e.filter((({isDismissible:e,type:t})=>!e&&"default"===t));return(0,C.createElement)(C.Fragment,null,(0,C.createElement)(Zo.NoticeList,{notices:o,className:"components-editor-notices__pinned"}),(0,C.createElement)(Zo.NoticeList,{notices:n,className:"components-editor-notices__dismissible",onRemove:t},(0,C.createElement)(ws,null)))},Ss=-3;function Ps(){const e=(0,a.useSelect)((e=>e(rn.store).getNotices()),[]),{removeNotice:t}=(0,a.useDispatch)(rn.store),n=e.filter((({type:e})=>"snackbar"===e)).slice(Ss);return(0,C.createElement)(Zo.SnackbarList,{notices:n,className:"components-editor-notices__snackbar",onRemove:t})}const Cs=window.wp.htmlEntities;function Ts({record:e,checked:t,onChange:n}){const{name:o,kind:s,title:r,key:i}=e,l=(0,a.useSelect)((e=>{if("postType"!==s||"wp_template"!==o)return r;const t=e(p.store).getEditedEntityRecord(s,o,i);return e(xo).__experimentalGetTemplateInfo(t).title}),[o,s,r,i]);return(0,C.createElement)(Zo.PanelRow,null,(0,C.createElement)(Zo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,Cs.decodeEntities)(l)||(0,d.__)("Untitled"),checked:t,onChange:n}))}const{getGlobalStylesChanges:xs,GlobalStylesContext:Bs}=u(m.privateApis);function Is({record:e}){const{user:t}=(0,P.useContext)(Bs),n=(0,a.useSelect)((t=>t(p.store).getEntityRecord(e.kind,e.name,e.key)),[e.kind,e.name,e.key]),o=xs(t,n,{maxResults:10});return o.length?(0,C.createElement)("ul",{className:"entities-saved-states__changes"},o.map((e=>(0,C.createElement)("li",{key:e},e)))):null}function Ns({record:e,count:t}){if("globalStyles"===e?.name)return null;const n=function(e,t){switch(e){case"site":return 1===t?(0,d.__)("This change will affect your whole site."):(0,d.__)("These changes will affect your whole site.");case"wp_template":return(0,d.__)("This change will affect pages and posts that use this template.");case"page":case"post":return(0,d.__)("The following has been modified.")}}(e?.name,t);return n?(0,C.createElement)(Zo.PanelRow,null,n):null}function Ds({list:e,unselectedEntities:t,setUnselectedEntities:n}){const o=e.length,s=e[0];let r=(0,a.useSelect)((e=>e(p.store).getEntityConfig(s.kind,s.name)),[s.kind,s.name]).label;return"wp_template_part"===s?.name&&(r=1===o?(0,d.__)("Template Part"):(0,d.__)("Template Parts")),(0,C.createElement)(Zo.PanelBody,{title:r,initialOpen:!0},(0,C.createElement)(Ns,{record:s,count:o}),e.map((e=>(0,C.createElement)(Ts,{key:e.key||e.property,record:e,checked:!t.some((t=>t.kind===e.kind&&t.name===e.name&&t.key===e.key&&t.property===e.property)),onChange:t=>n(e,t)}))),"globalStyles"===s?.name&&(0,C.createElement)(Is,{record:s}))}const As={title:(0,d.__)("Title"),description:(0,d.__)("Tagline"),site_logo:(0,d.__)("Logo"),site_icon:(0,d.__)("Icon"),show_on_front:(0,d.__)("Show on front"),page_on_front:(0,d.__)("Page on front"),posts_per_page:(0,d.__)("Maximum posts per page"),default_comment_status:(0,d.__)("Allow comments on new posts")},Rs=()=>{const{editedEntities:e,siteEdits:t}=(0,a.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,getEntityRecordEdits:n}=e(p.store);return{editedEntities:t(),siteEdits:n("root","site")}}),[]),n=(0,P.useMemo)((()=>{const n=e.filter((e=>!("root"===e.kind&&"site"===e.name))),o=[];for(const e in t)o.push({kind:"root",name:"site",title:As[e]||e,property:e});return[...n,...o]}),[e,t]),[o,s]=(0,P.useState)([]);return{dirtyEntityRecords:n,isDirty:n.length-o.length>0,setUnselectedEntities:({kind:e,name:t,key:n,property:r},i)=>{s(i?o.filter((o=>o.kind!==e||o.name!==t||o.key!==n||o.property!==r)):[...o,{kind:e,name:t,key:n,property:r}])},unselectedEntities:o}},Os=[{kind:"postType",name:"wp_navigation"}];function Ls(e){return e}function Ms({close:e}){const t=Rs();return(0,C.createElement)(Fs,{close:e,...t})}function Fs({additionalPrompt:e,close:t,onSave:n=Ls,saveEnabled:o,saveLabel:s=(0,d.__)("Save"),dirtyEntityRecords:r,isDirty:i,setUnselectedEntities:l,unselectedEntities:c}){const u=(0,P.useRef)(),{editEntityRecord:g,saveEditedEntityRecord:h,__experimentalSaveSpecifiedEntityEdits:_}=(0,a.useDispatch)(p.store),{__unstableMarkLastChangeAsPersistent:f}=(0,a.useDispatch)(m.store),{createSuccessNotice:E,createErrorNotice:b,removeNotice:v}=(0,a.useDispatch)(rn.store),y=r.reduce(((e,t)=>{const{name:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e}),{}),{site:w,wp_template:k,wp_template_part:S,...T}=y,x=[w,k,S,...Object.values(T)].filter(Array.isArray),B=null!=o?o:i,{homeUrl:I}=(0,a.useSelect)((e=>{const{getUnstableBase:t}=e(p.store);return{homeUrl:t()?.home}}),[]),N=(0,P.useCallback)((()=>t()),[t]),[D,A]=(0,No.__experimentalUseDialog)({onClose:()=>N()});return(0,C.createElement)("div",{ref:D,...A,className:"entities-saved-states__panel"},(0,C.createElement)(Zo.Flex,{className:"entities-saved-states__panel-header",gap:2},(0,C.createElement)(Zo.FlexItem,{isBlock:!0,as:Zo.Button,ref:u,variant:"primary",disabled:!B,onClick:()=>{const e="site-editor-save-success";v(e);const o=r.filter((({kind:e,name:t,key:n,property:o})=>!c.some((s=>s.kind===e&&s.name===t&&s.key===n&&s.property===o))));t(o);const s=[],i=[];o.forEach((({kind:e,name:t,key:n,property:o})=>{"root"===e&&"site"===t?s.push(o):(Os.some((n=>n.kind===e&&n.name===t))&&g(e,t,n,{status:"publish"}),i.push(h(e,t,n)))})),s.length&&i.push(_("root","site",void 0,s)),f(),Promise.all(i).then((e=>n(e))).then((t=>{t.some((e=>void 0===e))?b((0,d.__)("Saving failed.")):E((0,d.__)("Site updated."),{type:"snackbar",id:e,actions:[{label:(0,d.__)("View site"),url:I}]})})).catch((e=>b(`${(0,d.__)("Saving failed.")} ${e}`)))},className:"editor-entities-saved-states__save-button"},s),(0,C.createElement)(Zo.FlexItem,{isBlock:!0,as:Zo.Button,variant:"secondary",onClick:N},(0,d.__)("Cancel"))),(0,C.createElement)("div",{className:"entities-saved-states__text-prompt"},(0,C.createElement)("strong",{className:"entities-saved-states__text-prompt--header"},(0,d.__)("Are you ready to save?")),e,(0,C.createElement)("p",null,i?(0,P.createInterpolateElement)((0,d.sprintf)((0,d._n)("There is <strong>%d site change</strong> waiting to be saved.","There are <strong>%d site changes</strong> waiting to be saved.",x.length),x.length),{strong:(0,C.createElement)("strong",null)}):(0,d.__)("Select the items you want to save."))),x.map((e=>(0,C.createElement)(Ds,{key:e[0].name,list:e,unselectedEntities:c,setUnselectedEntities:l}))))}function Vs(){try{return(0,a.select)(xo).getEditedPostContent()}catch(e){}}function Us({text:e,children:t}){const n=(0,No.useCopyToClipboard)(e);return(0,C.createElement)(Zo.Button,{variant:"secondary",ref:n},t)}class Hs extends P.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){(0,an.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}render(){const{error:e}=this.state;if(!e)return this.props.children;const t=[(0,C.createElement)(Us,{key:"copy-post",text:Vs},(0,d.__)("Copy Post Text")),(0,C.createElement)(Us,{key:"copy-error",text:e.stack},(0,d.__)("Copy Error"))];return(0,C.createElement)(m.Warning,{className:"editor-error-boundary",actions:t},(0,d.__)("The editor has encountered an unexpected error."))}}const zs=Hs,Gs=window.requestIdleCallback?window.requestIdleCallback:window.requestAnimationFrame;let js;function Ws(){const{postId:e,isEditedPostNew:t,hasRemoteAutosave:n}=(0,a.useSelect)((e=>({postId:e(xo).getCurrentPostId(),isEditedPostNew:e(xo).isEditedPostNew(),hasRemoteAutosave:!!e(xo).getEditorSettings().autosave})),[]),{getEditedPostAttribute:o}=(0,a.useSelect)(xo),{createWarningNotice:s,removeNotice:r}=(0,a.useDispatch)(rn.store),{editPost:l,resetEditorBlocks:c}=(0,a.useDispatch)(xo);(0,P.useEffect)((()=>{let a=function(e,t){return window.sessionStorage.getItem(ln(e,t))}(e,t);if(!a)return;try{a=JSON.parse(a)}catch{return}const{post_title:u,content:p,excerpt:m}=a,g={title:u,content:p,excerpt:m};if(!Object.keys(g).some((e=>g[e]!==o(e))))return void cn(e,t);if(n)return;const h="wpEditorAutosaveRestore";s((0,d.__)("The backup of this post in your browser is different from the version below."),{id:h,actions:[{label:(0,d.__)("Restore the backup"),onClick(){const{content:e,...t}=g;l(t),c((0,i.parse)(g.content)),r(h)}}]})}),[t,e])}const $s=(0,No.ifCondition)((()=>{if(void 0!==js)return js;try{window.sessionStorage.setItem("__wpEditorTestSessionStorage",""),window.sessionStorage.removeItem("__wpEditorTestSessionStorage"),js=!0}catch{js=!1}return js}))((function(){const{autosave:e}=(0,a.useDispatch)(xo),t=(0,P.useCallback)((()=>{Gs((()=>e({local:!0})))}),[]);Ws(),function(){const{postId:e,isEditedPostNew:t,isDirty:n,isAutosaving:o,didError:s}=(0,a.useSelect)((e=>({postId:e(xo).getCurrentPostId(),isEditedPostNew:e(xo).isEditedPostNew(),isDirty:e(xo).isEditedPostDirty(),isAutosaving:e(xo).isAutosavingPost(),didError:e(xo).didPostSaveRequestFail()})),[]),r=(0,P.useRef)(n),i=(0,P.useRef)(o);(0,P.useEffect)((()=>{!s&&(i.current&&!o||r.current&&!n)&&cn(e,t),r.current=n,i.current=o}),[n,o,s]);const l=(0,No.usePrevious)(t),c=(0,No.usePrevious)(e);(0,P.useEffect)((()=>{c===e&&l&&!t&&cn(e,!0)}),[t,e])}();const n=(0,a.useSelect)((e=>e(xo).getEditorSettings().localAutosaveInterval),[]);return(0,C.createElement)(Wo,{interval:n,autosave:t})}));const Ks=function({children:e}){const t=(0,a.useSelect)((e=>{const{getEditedPostAttribute:t}=e(xo),{getPostType:n}=e(p.store),o=n(t("type"));return!!o?.supports?.["page-attributes"]}),[]);return t?e:null};const Zs=function({children:e,supportKeys:t}){const n=(0,a.useSelect)((e=>{const{getEditedPostAttribute:t}=e(xo),{getPostType:n}=e(p.store);return n(t("type"))}),[]);let o=!0;return n&&(o=(Array.isArray(t)?t:[t]).some((e=>!!n.supports[e]))),o?e:null};function Ys(){const e=(0,a.useSelect)((e=>{var t;return null!==(t=e(xo).getEditedPostAttribute("menu_order"))&&void 0!==t?t:0}),[]),{editPost:t}=(0,a.useDispatch)(xo),[n,o]=(0,P.useState)(null),s=null!=n?n:e;return(0,C.createElement)(Zo.Flex,null,(0,C.createElement)(Zo.FlexBlock,null,(0,C.createElement)(Zo.__experimentalNumberControl,{__next40pxDefaultSize:!0,label:(0,d.__)("Order"),value:s,onChange:e=>{o(e);const n=Number(e);Number.isInteger(n)&&""!==e.trim?.()&&t({menu_order:n})},labelPosition:"side",onBlur:()=>{o(null)}})))}function qs(){return(0,C.createElement)(Zs,{supportKeys:"page-attributes"},(0,C.createElement)(Ys,null))}var Qs=n(9681),Xs=n.n(Qs);function Js(e){const t=e.map((e=>({children:[],parent:null,...e})));if(t.some((({parent:e})=>null===e)))return t;const n=t.reduce(((e,t)=>{const{parent:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e}),{}),o=e=>e.map((e=>{const t=n[e.id];return{...e,children:t&&t.length?o(t):[]}}));return o(n[0]||[])}const er=e=>(0,Cs.decodeEntities)(e),tr=e=>({...e,name:er(e.name)}),nr=e=>(null!=e?e:[]).map(tr);function or(e){return e?.title?.rendered?(0,Cs.decodeEntities)(e.title.rendered):`#${e.id} (${(0,d.__)("no title")})`}const sr=(e,t)=>{const n=Xs()(e||"").toLowerCase(),o=Xs()(t||"").toLowerCase();return n===o?0:n.startsWith(o)?n.length:1/0};const rr=function(){const{editPost:e}=(0,a.useDispatch)(xo),[t,n]=(0,P.useState)(!1),{isHierarchical:o,parentPostId:s,parentPostTitle:r,pageItems:i}=(0,a.useSelect)((e=>{var n;const{getPostType:o,getEntityRecords:s,getEntityRecord:r}=e(p.store),{getCurrentPostId:i,getEditedPostAttribute:a}=e(xo),l=a("type"),c=a("parent"),u=o(l),d=i(),m=null!==(n=u?.hierarchical)&&void 0!==n&&n,g={per_page:100,exclude:d,parent_exclude:d,orderby:"menu_order",order:"asc",_fields:"id,title,parent"};t&&(g.search=t);const h=c?r("postType",l,c):null;return{isHierarchical:m,parentPostId:c,parentPostTitle:h?or(h):"",pageItems:m?s("postType",l,g):null}}),[t]),l=(0,P.useMemo)((()=>{const e=(n,o=0)=>n.map((t=>[{value:t.id,label:"— ".repeat(o)+(0,Cs.decodeEntities)(t.name),rawName:t.name},...e(t.children||[],o+1)])).sort((([e],[n])=>sr(e.rawName,t)>=sr(n.rawName,t)?1:-1)).flat();if(!i)return[];let n=i.map((e=>({id:e.id,parent:e.parent,name:or(e)})));t||(n=Js(n));const o=e(n),a=o.find((e=>e.value===s));return r&&!a&&o.unshift({value:s,label:r}),o}),[i,t,r,s]);return o?(0,C.createElement)(Zo.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"editor-page-attributes__parent",label:(0,d.__)("Parent"),value:s,options:l,onFilterValueChange:(0,No.debounce)((e=>{n(e)}),300),onChange:t=>{e({parent:t})}}):null},ir="page-attributes";const ar=function(){var e;const{isEnabled:t,isOpened:n,postType:o}=(0,a.useSelect)((e=>{const{getEditedPostAttribute:t,isEditorPanelEnabled:n,isEditorPanelOpened:o}=e(xo),{getPostType:s}=e(p.store);return{isEnabled:n(ir),isOpened:o(ir),postType:s(t("type"))}}),[]),{toggleEditorPanelOpened:s}=(0,a.useDispatch)(xo);return t&&o?(0,C.createElement)(Ks,null,(0,C.createElement)(Zo.PanelBody,{title:null!==(e=o?.labels?.attributes)&&void 0!==e?e:(0,d.__)("Page attributes"),opened:n,onToggle:(...e)=>s(ir,...e)},(0,C.createElement)(rr,null),(0,C.createElement)(Zo.PanelRow,null,(0,C.createElement)(qs,null)))):null},lr=(0,C.createElement)(T.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,C.createElement)(T.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"})),cr=(0,d.__)("Custom Template");function ur({onClose:e}){const{defaultBlockTemplate:t,onNavigateToEntityRecord:n}=(0,a.useSelect)((e=>{const{getEditorSettings:t,getCurrentTemplateId:n}=e(xo);return{defaultBlockTemplate:t().defaultBlockTemplate,onNavigateToEntityRecord:t().onNavigateToEntityRecord,getTemplateId:n}})),{createTemplate:o}=u((0,a.useDispatch)(xo)),[s,r]=(0,P.useState)(""),[l,c]=(0,P.useState)(!1),p=()=>{r(""),e()};return(0,C.createElement)(Zo.Modal,{title:(0,d.__)("Create custom template"),onRequestClose:p},(0,C.createElement)("form",{className:"editor-post-template__create-form",onSubmit:async e=>{if(e.preventDefault(),l)return;c(!0);const r=null!=t?t:(0,i.serialize)([(0,i.createBlock)("core/group",{tagName:"header",layout:{inherit:!0}},[(0,i.createBlock)("core/site-title"),(0,i.createBlock)("core/site-tagline")]),(0,i.createBlock)("core/separator"),(0,i.createBlock)("core/group",{tagName:"main"},[(0,i.createBlock)("core/group",{layout:{inherit:!0}},[(0,i.createBlock)("core/post-title")]),(0,i.createBlock)("core/post-content",{layout:{inherit:!0}})])]),a=await o({slug:(0,w.cleanForSlug)(s||cr),content:r,title:s||cr});c(!1),n({postId:a.id,postType:"wp_template"}),p()}},(0,C.createElement)(Zo.__experimentalVStack,{spacing:"3"},(0,C.createElement)(Zo.TextControl,{__nextHasNoMarginBottom:!0,label:(0,d.__)("Name"),value:s,onChange:r,placeholder:cr,disabled:l,help:(0,d.__)('Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.')}),(0,C.createElement)(Zo.__experimentalHStack,{justify:"right"},(0,C.createElement)(Zo.Button,{variant:"tertiary",onClick:p},(0,d.__)("Cancel")),(0,C.createElement)(Zo.Button,{variant:"primary",type:"submit",isBusy:l,"aria-disabled":l},(0,d.__)("Create"))))))}function dr(){return(0,a.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:n}=e(xo);return{postId:t(),postType:n()}}),[])}function pr(){const{postType:e,postId:t}=dr();return(0,a.useSelect)((n=>{const{getEntityRecord:o,getEntityRecords:s}=n(p.store),r=o("root","site"),i=s("postType","wp_template",{per_page:-1}),a=+t===r?.page_for_posts,l="page"===e&&+t===r?.page_on_front&&i?.some((({slug:e})=>"front-page"===e));return!a&&!l}),[t,e])}function mr(e){return(0,a.useSelect)((t=>t(p.store).getEntityRecords("postType","wp_template",{per_page:-1,post_type:e})),[e])}function gr(e){const t=hr(),n=pr(),o=mr(e);return(0,P.useMemo)((()=>n&&o?.filter((e=>e.is_custom&&e.slug!==t&&!!e.content.raw))),[o,t,n])}function hr(){const{postType:e,postId:t}=dr(),n=mr(e),o=(0,a.useSelect)((n=>{const o=n(p.store).getEditedEntityRecord("postType",e,t);return o?.template}),[e,t]);if(o)return n?.find((e=>e.slug===o))?.slug}const _r={className:"editor-post-template__dropdown",placement:"bottom-start"};function fr({isOpen:e,onClick:t}){const n=(0,a.useSelect)((e=>{const t=e(xo).getEditedPostAttribute("template"),{supportsTemplateMode:n,availableTemplates:o}=e(xo).getEditorSettings();if(!n&&o[t])return o[t];const s=e(p.store).canUser("create","templates")&&e(xo).getCurrentTemplateId();return s?.title||s?.slug||o?.[t]}),[]);return(0,C.createElement)(Zo.Button,{__next40pxDefaultSize:!0,className:"edit-post-post-template__toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,d.__)("Template options"),onClick:t},null!=n?n:(0,d.__)("Default template"))}function Er({onClose:e}){var t,n;const o=pr(),{availableTemplates:s,fetchedTemplates:r,selectedTemplateSlug:i,canCreate:l,canEdit:c,currentTemplateId:u,onNavigateToEntityRecord:g,getEditorSettings:h}=(0,a.useSelect)((e=>{const{canUser:t,getEntityRecords:n}=e(p.store),s=e(xo).getEditorSettings(),r=t("create","templates"),i=e(xo).getCurrentTemplateId();return{availableTemplates:s.availableTemplates,fetchedTemplates:r?n("postType","wp_template",{post_type:e(xo).getCurrentPostType(),per_page:-1}):void 0,selectedTemplateSlug:e(xo).getEditedPostAttribute("template"),canCreate:o&&r&&s.supportsTemplateMode,canEdit:o&&r&&s.supportsTemplateMode&&!!i,currentTemplateId:i,onNavigateToEntityRecord:s.onNavigateToEntityRecord,getEditorSettings:e(xo).getEditorSettings}}),[o]),_=(0,P.useMemo)((()=>Object.entries({...s,...Object.fromEntries((null!=r?r:[]).map((({slug:e,title:t})=>[e,t.rendered])))}).map((([e,t])=>({value:e,label:t})))),[s,r]),f=null!==(t=_.find((e=>e.value===i)))&&void 0!==t?t:_.find((e=>!e.value)),{editPost:E}=(0,a.useDispatch)(xo),{createSuccessNotice:b}=(0,a.useDispatch)(rn.store),[v,y]=(0,P.useState)(!1);return(0,C.createElement)("div",{className:"editor-post-template__classic-theme-dropdown"},(0,C.createElement)(m.__experimentalInspectorPopoverHeader,{title:(0,d.__)("Template"),help:(0,d.__)("Templates define the way content is displayed when viewing your site."),actions:l?[{icon:lr,label:(0,d.__)("Add template"),onClick:()=>y(!0)}]:[],onClose:e}),o?(0,C.createElement)(Zo.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,label:(0,d.__)("Template"),value:null!==(n=f?.value)&&void 0!==n?n:"",options:_,onChange:e=>E({template:e||""})}):(0,C.createElement)(Zo.Notice,{status:"warning",isDismissible:!1},(0,d.__)("The posts page template cannot be changed.")),c&&g&&(0,C.createElement)("p",null,(0,C.createElement)(Zo.Button,{variant:"link",onClick:()=>{g({postId:u,postType:"wp_template"}),e(),b((0,d.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:[{label:(0,d.__)("Go back"),onClick:()=>h().onNavigateToPreviousEntityRecord()}]})}},(0,d.__)("Edit template"))),v&&(0,C.createElement)(ur,{onClose:()=>y(!1)}))}const br=function(){return(0,C.createElement)(Zo.Dropdown,{popoverProps:_r,focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,C.createElement)(fr,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,C.createElement)(Er,{onClose:e})})},vr=(0,C.createElement)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,C.createElement)(T.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));function yr({onClick:e}){const[t,n]=(0,P.useState)(!1),o=(0,P.useCallback)((()=>{n(!1)}),[]),{postType:s,postId:r}=dr(),i=gr(s),{editEntityRecord:l}=(0,a.useDispatch)(p.store);if(!i?.length)return null;return(0,C.createElement)(C.Fragment,null,(0,C.createElement)(Zo.MenuItem,{onClick:()=>n(!0)},(0,d.__)("Swap template")),t&&(0,C.createElement)(Zo.Modal,{title:(0,d.__)("Choose a template"),onRequestClose:o,overlayClassName:"editor-post-template__swap-template-modal",isFullScreen:!0},(0,C.createElement)("div",{className:"editor-post-template__swap-template-modal-content"},(0,C.createElement)(wr,{postType:s,onSelect:async t=>{l("postType",s,r,{template:t.name},{undoIgnore:!0}),o(),e()}}))))}function wr({postType:e,onSelect:t}){const n=gr(e),o=(0,P.useMemo)((()=>n.map((e=>({name:e.slug,blocks:(0,i.parse)(e.content.raw),title:(0,Cs.decodeEntities)(e.title.rendered),id:e.id})))),[n]),s=(0,No.useAsyncList)(o);return(0,C.createElement)(m.__experimentalBlockPatternsList,{label:(0,d.__)("Templates"),blockPatterns:o,shownPatterns:s,onClickPattern:t})}function kr({onClick:e}){const t=hr(),n=pr(),{postType:o,postId:s}=dr(),{editEntityRecord:r}=(0,a.useDispatch)(p.store);return t&&n?(0,C.createElement)(Zo.MenuItem,{onClick:()=>{r("postType",o,s,{template:""},{undoIgnore:!0}),e()}},(0,d.__)("Use default template")):null}function Sr({onClick:e}){const{canCreateTemplates:t}=(0,a.useSelect)((e=>{const{canUser:t}=e(p.store);return{canCreateTemplates:t("create","templates")}}),[]),[n,o]=(0,P.useState)(!1),s=pr();return t&&s?(0,C.createElement)(C.Fragment,null,(0,C.createElement)(Zo.MenuItem,{onClick:()=>{o(!0)}},(0,d.__)("Create new template")),n&&(0,C.createElement)(ur,{onClose:()=>{o(!1),e()}})):null}const Pr={className:"editor-post-template__dropdown",placement:"bottom-start"};function Cr({id:e}){const{isTemplateHidden:t,onNavigateToEntityRecord:n,getEditorSettings:o,hasGoBack:s}=(0,a.useSelect)((e=>{const{getRenderingMode:t,getEditorSettings:n}=u(e(xo)),o=n();return{isTemplateHidden:"post-only"===t(),onNavigateToEntityRecord:o.onNavigateToEntityRecord,getEditorSettings:n,hasGoBack:o.hasOwnProperty("onNavigateToPreviousEntityRecord")}}),[]),{editedRecord:r,hasResolved:i}=(0,p.useEntityRecord)("postType","wp_template",e),{createSuccessNotice:l}=(0,a.useDispatch)(rn.store),{setRenderingMode:c}=(0,a.useDispatch)(xo);if(!i)return null;const m=s?[{label:(0,d.__)("Go back"),onClick:()=>o().onNavigateToPreviousEntityRecord()}]:void 0;return(0,C.createElement)(Zo.DropdownMenu,{popoverProps:Pr,focusOnMount:!0,toggleProps:{__next40pxDefaultSize:!0,variant:"tertiary"},label:(0,d.__)("Template options"),text:(0,Cs.decodeEntities)(r.title),icon:null},(({onClose:e})=>(0,C.createElement)(C.Fragment,null,(0,C.createElement)(Zo.MenuGroup,null,(0,C.createElement)(Zo.MenuItem,{onClick:()=>{n({postId:r.id,postType:"wp_template"}),e(),l((0,d.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:m})}},(0,d.__)("Edit template")),(0,C.createElement)(yr,{onClick:e}),(0,C.createElement)(kr,{onClick:e}),(0,C.createElement)(Sr,{onClick:e})),(0,C.createElement)(Zo.MenuGroup,null,(0,C.createElement)(Zo.MenuItem,{icon:t?void 0:vr,isSelected:!t,role:"menuitemcheckbox",onClick:()=>{c(t?"template-locked":"post-only")}},(0,d.__)("Template preview"))))))}const Tr=(0,P.forwardRef)((({className:e,label:t,children:n},o)=>(0,C.createElement)(Zo.__experimentalHStack,{className:Ko()("editor-post-panel__row",e),ref:o},t&&(0,C.createElement)("div",{className:"editor-post-panel__row-label"},t),(0,C.createElement)("div",{className:"editor-post-panel__row-control"},n)))),xr=Tr;function Br(){const{templateId:e,isBlockTheme:t}=(0,a.useSelect)((e=>{const{getCurrentTemplateId:t,getEditorSettings:n}=e(xo);return{templateId:t(),isBlockTheme:n().__unstableIsBlockBasedTheme}}),[]),n=(0,a.useSelect)((e=>{var t;const n=e(xo).getCurrentPostType(),o=e(p.store).getPostType(n);if(!o?.viewable)return!1;const s=e(xo).getEditorSettings();if(!!s.availableTemplates&&Object.keys(s.availableTemplates).length>0)return!0;if(!s.supportsTemplateMode)return!1;return null!==(t=e(p.store).canUser("create","templates"))&&void 0!==t&&t}),[]),o=(0,a.useSelect)((e=>{var t;return null!==(t=e(p.store).canUser("read","templates"))&&void 0!==t&&t}),[]);return t&&o||!n?t&&e?(0,C.createElement)(xr,{label:(0,d.__)("Template")},(0,C.createElement)(Cr,{id:e})):null:(0,C.createElement)(xr,{label:(0,d.__)("Template")},(0,C.createElement)(br,null))}const Ir={_fields:"id,name",context:"view"},Nr={who:"authors",per_page:50,...Ir};function Dr(e){const{authorId:t,authors:n,postAuthor:o}=(0,a.useSelect)((t=>{const{getUser:n,getUsers:o}=t(p.store),{getEditedPostAttribute:s}=t(xo),r=s("author"),i={...Nr};return e&&(i.search=e),{authorId:r,authors:o(i),postAuthor:n(r,Ir)}}),[e]);return{authorId:t,authorOptions:(0,P.useMemo)((()=>{const e=(null!=n?n:[]).map((e=>({value:e.id,label:(0,Cs.decodeEntities)(e.name)})));return e.findIndex((({value:e})=>o?.id===e))<0&&o?[{value:o.id,label:(0,Cs.decodeEntities)(o.name)},...e]:e}),[n,o])}}function Ar(){const[e,t]=(0,P.useState)(),{editPost:n}=(0,a.useDispatch)(xo),{authorId:o,authorOptions:s}=Dr(e);return(0,C.createElement)(Zo.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,d.__)("Author"),options:s,value:o,onFilterValueChange:(0,No.debounce)((e=>{t(e)}),300),onChange:e=>{e&&n({author:e})},allowReset:!1})}function Rr(){const{editPost:e}=(0,a.useDispatch)(xo),{authorId:t,authorOptions:n}=Dr();return(0,C.createElement)(Zo.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"post-author-selector",label:(0,d.__)("Author"),options:n,onChange:t=>{const n=Number(t);e({author:n})},value:t})}const Or=function(){return(0,a.useSelect)((e=>{const t=e(p.store).getUsers(Nr);return t?.length>=25}),[])?(0,C.createElement)(Ar,null):(0,C.createElement)(Rr,null)};function Lr({children:e}){const{hasAssignAuthorAction:t,hasAuthors:n}=(0,a.useSelect)((e=>{var t;const n=e(xo).getCurrentPost(),o=e(p.store).getUsers(Nr);return{hasAssignAuthorAction:null!==(t=n._links?.["wp:action-assign-author"])&&void 0!==t&&t,hasAuthors:o?.length>=1}}),[]);return t&&n?(0,C.createElement)(Zs,{supportKeys:"author"},e):null}const Mr=function(){return(0,C.createElement)(Lr,null,(0,C.createElement)(xr,{className:"editor-post-author__panel"},(0,C.createElement)(Or,null)))};const Fr=function(){const e=(0,a.useSelect)((e=>{var t;return null!==(t=e(xo).getEditedPostAttribute("comment_status"))&&void 0!==t?t:"open"}),[]),{editPost:t}=(0,a.useDispatch)(xo);return(0,C.createElement)(Zo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,d.__)("Allow comments"),checked:"open"===e,onChange:()=>t({comment_status:"open"===e?"closed":"open"})})};const Vr=function(){const e=(0,a.useSelect)((e=>{var t;return null!==(t=e(xo).getEditedPostAttribute("ping_status"))&&void 0!==t?t:"open"}),[]),{editPost:t}=(0,a.useDispatch)(xo);return(0,C.createElement)(Zo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,d.__)("Allow pingbacks & trackbacks"),checked:"open"===e,onChange:()=>t({ping_status:"open"===e?"closed":"open"})})},Ur="discussion-panel";const Hr=function(){const{isEnabled:e,isOpened:t}=(0,a.useSelect)((e=>{const{isEditorPanelEnabled:t,isEditorPanelOpened:n}=e(xo);return{isEnabled:t(Ur),isOpened:n(Ur)}}),[]),{toggleEditorPanelOpened:n}=(0,a.useDispatch)(xo);return e?(0,C.createElement)(Zs,{supportKeys:["comments","trackbacks"]},(0,C.createElement)(Zo.PanelBody,{title:(0,d.__)("Discussion"),opened:t,onToggle:()=>n(Ur)},(0,C.createElement)(Zs,{supportKeys:"comments"},(0,C.createElement)(Zo.PanelRow,null,(0,C.createElement)(Fr,null))),(0,C.createElement)(Zs,{supportKeys:"trackbacks"},(0,C.createElement)(Zo.PanelRow,null,(0,C.createElement)(Vr,null))))):null};const zr=function(){const e=(0,a.useSelect)((e=>e(xo).getEditedPostAttribute("excerpt")),[]),{editPost:t}=(0,a.useDispatch)(xo);return(0,C.createElement)("div",{className:"editor-post-excerpt"},(0,C.createElement)(Zo.TextareaControl,{__nextHasNoMarginBottom:!0,label:(0,d.__)("Write an excerpt (optional)"),className:"editor-post-excerpt__textarea",onChange:e=>t({excerpt:e}),value:e}),(0,C.createElement)(Zo.ExternalLink,{href:(0,d.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#excerpt")},(0,d.__)("Learn more about manual excerpts")))};const Gr=function({children:e}){const t=(0,a.useSelect)((e=>{const{getEditedPostAttribute:t}=e(xo);return t("type")}),[]);return["wp_template","wp_template_part"].includes(t)?null:(0,C.createElement)(Zs,{supportKeys:"excerpt"},e)},{Fill:jr,Slot:Wr}=(0,Zo.createSlotFill)("PluginPostExcerpt"),$r=({children:e,className:t})=>(0,C.createElement)(jr,null,(0,C.createElement)(Zo.PanelRow,{className:t},e));$r.Slot=Wr;const Kr=$r,Zr="post-excerpt";function Yr(){const{isOpened:e,isEnabled:t}=(0,a.useSelect)((e=>{const{isEditorPanelOpened:t,isEditorPanelEnabled:n}=e(xo);return{isOpened:t(Zr),isEnabled:n(Zr)}}),[]),{toggleEditorPanelOpened:n}=(0,a.useDispatch)(xo);return t?(0,C.createElement)(Gr,null,(0,C.createElement)(Zo.PanelBody,{title:(0,d.__)("Excerpt"),opened:e,onToggle:()=>n(Zr)},(0,C.createElement)(Kr.Slot,null,(e=>(0,C.createElement)(C.Fragment,null,(0,C.createElement)(zr,null),e))))):null}const qr=window.wp.blob;const Qr=(0,a.withSelect)((e=>{const{getThemeSupports:t}=e(p.store),{getEditedPostAttribute:n}=e(xo);return{postType:n("type"),themeSupports:t()}}))((function({themeSupports:e,children:t,postType:n,supportKeys:o}){return(Array.isArray(o)?o:[o]).some((t=>{var o;const s=null!==(o=e?.[t])&&void 0!==o&&o;return"post-thumbnails"===t&&Array.isArray(s)?s.includes(n):s}))?t:null}));const Xr=function({children:e}){return(0,C.createElement)(Qr,{supportKeys:"post-thumbnails"},(0,C.createElement)(Zs,{supportKeys:"thumbnail"},e))},Jr=["image"],ei=(0,d.__)("Featured image"),ti=(0,d.__)("Set featured image"),ni=(0,C.createElement)("p",null,(0,d.__)("To edit the featured image, you need permission to upload media."));const oi=(0,a.withSelect)((e=>{const{getMedia:t,getPostType:n}=e(p.store),{getCurrentPostId:o,getEditedPostAttribute:s}=e(xo),r=s("featured_media");return{media:r?t(r,{context:"view"}):null,currentPostId:o(),postType:n(s("type")),featuredImageId:r}})),si=(0,a.withDispatch)(((e,{noticeOperations:t},{select:n})=>{const{editPost:o}=e(xo);return{onUpdateImage(e){o({featured_media:e.id})},onDropImage(e){n(m.store).getSettings().mediaUpload({allowedTypes:["image"],filesList:e,onFileChange([e]){o({featured_media:e.id})},onError(e){t.removeAllNotices(),t.createErrorNotice(e)}})},onRemoveImage(){o({featured_media:0})}}})),ri=(0,No.compose)(Zo.withNotices,oi,si,(0,Zo.withFilters)("editor.PostFeaturedImage"))((function({currentPostId:e,featuredImageId:t,onUpdateImage:n,onRemoveImage:o,media:s,postType:r,noticeUI:i,noticeOperations:l}){const c=(0,P.useRef)(),[u,p]=(0,P.useState)(!1),{getSettings:g}=(0,a.useSelect)(m.store),{mediaWidth:h,mediaHeight:_,mediaSourceUrl:f}=function(e,t){var n,o;if(!e)return{};const s=(0,an.applyFilters)("editor.PostFeaturedImage.imageSize","large",e.id,t);if(s in(null!==(n=e?.media_details?.sizes)&&void 0!==n?n:{}))return{mediaWidth:e.media_details.sizes[s].width,mediaHeight:e.media_details.sizes[s].height,mediaSourceUrl:e.media_details.sizes[s].source_url};const r=(0,an.applyFilters)("editor.PostFeaturedImage.imageSize","thumbnail",e.id,t);return r in(null!==(o=e?.media_details?.sizes)&&void 0!==o?o:{})?{mediaWidth:e.media_details.sizes[r].width,mediaHeight:e.media_details.sizes[r].height,mediaSourceUrl:e.media_details.sizes[r].source_url}:{mediaWidth:e.media_details.width,mediaHeight:e.media_details.height,mediaSourceUrl:e.source_url}}(s,e);function E(e){g().mediaUpload({allowedTypes:Jr,filesList:e,onFileChange([e]){(0,qr.isBlobURL)(e?.url)?p(!0):(e&&n(e),p(!1))},onError(e){l.removeAllNotices(),l.createErrorNotice(e)}})}return(0,C.createElement)(Xr,null,i,(0,C.createElement)("div",{className:"editor-post-featured-image"},s&&(0,C.createElement)("div",{id:`editor-post-featured-image-${t}-describedby`,className:"hidden"},s.alt_text&&(0,d.sprintf)((0,d.__)("Current image: %s"),s.alt_text),!s.alt_text&&(0,d.sprintf)((0,d.__)("The current image has no alternative text. The file name is: %s"),s.media_details.sizes?.full?.file||s.slug)),(0,C.createElement)(m.MediaUploadCheck,{fallback:ni},(0,C.createElement)(m.MediaUpload,{title:r?.labels?.featured_image||ei,onSelect:n,unstableFeaturedImageFlow:!0,allowedTypes:Jr,modalClass:"editor-post-featured-image__media-modal",render:({open:e})=>(0,C.createElement)("div",{className:"editor-post-featured-image__container"},(0,C.createElement)(Zo.Button,{ref:c,className:t?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:e,"aria-label":t?(0,d.__)("Edit or replace the image"):null,"aria-describedby":t?`editor-post-featured-image-${t}-describedby`:null},!!t&&s&&(0,C.createElement)(Zo.ResponsiveWrapper,{naturalWidth:h,naturalHeight:_,isInline:!0},(0,C.createElement)("img",{src:f,alt:""})),u&&(0,C.createElement)(Zo.Spinner,null),!t&&!u&&(r?.labels?.set_featured_image||ti)),!!t&&(0,C.createElement)(Zo.__experimentalHStack,{className:"editor-post-featured-image__actions"},(0,C.createElement)(Zo.Button,{className:"editor-post-featured-image__action",onClick:e},(0,d.__)("Replace")),(0,C.createElement)(Zo.Button,{className:"editor-post-featured-image__action",onClick:()=>{o(),c.current.focus()}},(0,d.__)("Remove"))),(0,C.createElement)(Zo.DropZone,{onFilesDrop:E})),value:t}))))})),ii="featured-image";const ai=function(){var e;const{postType:t,isEnabled:n,isOpened:o}=(0,a.useSelect)((e=>{const{getEditedPostAttribute:t,isEditorPanelEnabled:n,isEditorPanelOpened:o}=e(xo),{getPostType:s}=e(p.store);return{postType:s(t("type")),isEnabled:n(ii),isOpened:o(ii)}}),[]),{toggleEditorPanelOpened:s}=(0,a.useDispatch)(xo);return n?(0,C.createElement)(Xr,null,(0,C.createElement)(Zo.PanelBody,{title:null!==(e=t?.labels?.featured_image)&&void 0!==e?e:(0,d.__)("Featured image"),opened:o,onToggle:()=>s(ii)},(0,C.createElement)(ri,null))):null};const li=function({children:e}){return(0,a.useSelect)((e=>e(xo).getEditorSettings().disablePostFormats),[])?null:(0,C.createElement)(Zs,{supportKeys:"post-formats"},e)},ci=[{id:"aside",caption:(0,d.__)("Aside")},{id:"audio",caption:(0,d.__)("Audio")},{id:"chat",caption:(0,d.__)("Chat")},{id:"gallery",caption:(0,d.__)("Gallery")},{id:"image",caption:(0,d.__)("Image")},{id:"link",caption:(0,d.__)("Link")},{id:"quote",caption:(0,d.__)("Quote")},{id:"standard",caption:(0,d.__)("Standard")},{id:"status",caption:(0,d.__)("Status")},{id:"video",caption:(0,d.__)("Video")}].sort(((e,t)=>{const n=e.caption.toUpperCase(),o=t.caption.toUpperCase();return n<o?-1:n>o?1:0}));function ui(){const e=`post-format-selector-${(0,No.useInstanceId)(ui)}`,{postFormat:t,suggestedFormat:n,supportedFormats:o}=(0,a.useSelect)((e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:n}=e(xo),o=t("format"),s=e(p.store).getThemeSupports();return{postFormat:null!=o?o:"standard",suggestedFormat:n(),supportedFormats:s.formats}}),[]),s=ci.filter((e=>o?.includes(e.id)||t===e.id)),r=s.find((e=>e.id===n)),{editPost:i}=(0,a.useDispatch)(xo),l=e=>i({format:e});return(0,C.createElement)(li,null,(0,C.createElement)("div",{className:"editor-post-format"},(0,C.createElement)(Zo.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,d.__)("Post Format"),value:t,onChange:e=>l(e),id:e,options:s.map((e=>({label:e.caption,value:e.id})))}),r&&r.id!==t&&(0,C.createElement)("p",{className:"editor-post-format__suggestion"},(0,C.createElement)(Zo.Button,{variant:"link",onClick:()=>l(r.id)},(0,d.sprintf)((0,d.__)("Apply suggested format: %s"),r.caption)))))}const di=(0,C.createElement)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,C.createElement)(T.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"}));const pi=function({children:e}){const{lastRevisionId:t,revisionsCount:n}=(0,a.useSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:n}=e(xo);return{lastRevisionId:t(),revisionsCount:n()}}),[]);return!t||n<2?null:(0,C.createElement)(Zs,{supportKeys:"revisions"},e)};const mi=function(){const{lastRevisionId:e,revisionsCount:t}=(0,a.useSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:n}=e(xo);return{lastRevisionId:t(),revisionsCount:n()}}),[]);return(0,C.createElement)(pi,null,(0,C.createElement)(Zo.Button,{href:(0,w.addQueryArgs)("revision.php",{revision:e}),className:"editor-post-last-revision__title",icon:di,iconPosition:"right",text:(0,d.sprintf)((0,d.__)("Revisions (%s)"),t)}))};const gi=function(){return(0,C.createElement)(pi,null,(0,C.createElement)(Zo.PanelBody,{className:"editor-post-last-revision__panel"},(0,C.createElement)(mi,null)))};function hi(){const e="core/editor/post-locked-modal-"+(0,No.useInstanceId)(hi),{autosave:t,updatePostLock:n}=(0,a.useDispatch)(xo),{isLocked:o,isTakeover:s,user:r,postId:i,postLockUtils:l,activePostLock:c,postType:u,previewLink:m}=(0,a.useSelect)((e=>{const{isPostLocked:t,isPostLockTakeover:n,getPostLockUser:o,getCurrentPostId:s,getActivePostLock:r,getEditedPostAttribute:i,getEditedPostPreviewLink:a,getEditorSettings:l}=e(xo),{getPostType:c}=e(p.store);return{isLocked:t(),isTakeover:n(),user:o(),postId:s(),postLockUtils:l().postLockUtils,activePostLock:r(),postType:c(i("type")),previewLink:a()}}),[]);if((0,P.useEffect)((()=>{function s(){if(o||!c)return;const e=new window.FormData;if(e.append("action","wp-remove-post-lock"),e.append("_wpnonce",l.unlockNonce),e.append("post_ID",i),e.append("active_post_lock",c),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,an.addAction)("heartbeat.send",e,(function(e){o||(e["wp-refresh-post-lock"]={lock:c,post_id:i})})),(0,an.addAction)("heartbeat.tick",e,(function(e){if(!e["wp-refresh-post-lock"])return;const o=e["wp-refresh-post-lock"];o.lock_error?(t(),n({isLocked:!0,isTakeover:!0,user:{name:o.lock_error.name,avatar:o.lock_error.avatar_src_2x}})):o.new_lock&&n({isLocked:!1,activePostLock:o.new_lock})})),window.addEventListener("beforeunload",s),()=>{(0,an.removeAction)("heartbeat.send",e),(0,an.removeAction)("heartbeat.tick",e),window.removeEventListener("beforeunload",s)}}),[]),!o)return null;const g=r.name,h=r.avatar,_=(0,w.addQueryArgs)("post.php",{"get-post-lock":"1",lockKey:!0,post:i,action:"edit",_wpnonce:l.nonce}),f=(0,w.addQueryArgs)("edit.php",{post_type:u?.slug}),E=(0,d.__)("Exit editor");return(0,C.createElement)(Zo.Modal,{title:s?(0,d.__)("Someone else has taken over this post"):(0,d.__)("This post is already being edited"),focusOnMount:!0,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,isDismissible:!1,size:"medium"},(0,C.createElement)(Zo.__experimentalHStack,{alignment:"top",spacing:6},!!h&&(0,C.createElement)("img",{src:h,alt:(0,d.__)("Avatar"),className:"editor-post-locked-modal__avatar",width:64,height:64}),(0,C.createElement)("div",null,!!s&&(0,C.createElement)("p",null,(0,P.createInterpolateElement)(g?(0,d.sprintf)((0,d.__)("<strong>%s</strong> now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved."),g):(0,d.__)("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.createElement)("strong",null),PreviewLink:(0,C.createElement)(Zo.ExternalLink,{href:m},(0,d.__)("preview"))})),!s&&(0,C.createElement)(C.Fragment,null,(0,C.createElement)("p",null,(0,P.createInterpolateElement)(g?(0,d.sprintf)((0,d.__)("<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over."),g):(0,d.__)("Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over."),{strong:(0,C.createElement)("strong",null),PreviewLink:(0,C.createElement)(Zo.ExternalLink,{href:m},(0,d.__)("preview"))})),(0,C.createElement)("p",null,(0,d.__)("If you take over, the other user will lose editing control to the post, but their changes will be saved."))),(0,C.createElement)(Zo.__experimentalHStack,{className:"editor-post-locked-modal__buttons",justify:"flex-end"},!s&&(0,C.createElement)(Zo.Button,{variant:"tertiary",href:_},(0,d.__)("Take over")),(0,C.createElement)(Zo.Button,{variant:"primary",href:f},E)))))}const _i=function({children:e}){const{hasPublishAction:t,isPublished:n}=(0,a.useSelect)((e=>{var t;const{isCurrentPostPublished:n,getCurrentPost:o}=e(xo);return{hasPublishAction:null!==(t=o()._links?.["wp:action-publish"])&&void 0!==t&&t,isPublished:n()}}),[]);return n||!t?null:e};const fi=function(){const e=(0,a.useSelect)((e=>e(xo).getEditedPostAttribute("status")),[]),{editPost:t}=(0,a.useDispatch)(xo);return(0,C.createElement)(_i,null,(0,C.createElement)(Zo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,d.__)("Pending review"),checked:"pending"===e,onChange:()=>{t({status:"pending"===e?"draft":"pending"})}}))};function Ei({className:e,textContent:t,forceIsAutosaveable:n,role:o,onPreview:s}){const{postId:r,currentPostLink:i,previewLink:l,isSaveable:c,isViewable:u}=(0,a.useSelect)((e=>{var t;const n=e(xo),o=e(p.store).getPostType(n.getCurrentPostType("type"));return{postId:n.getCurrentPostId(),currentPostLink:n.getCurrentPostAttribute("link"),previewLink:n.getEditedPostPreviewLink(),isSaveable:n.isEditedPostSaveable(),isViewable:null!==(t=o?.viewable)&&void 0!==t&&t}}),[]),{__unstableSaveForPreview:m}=(0,a.useDispatch)(xo);if(!u)return null;const g=`wp-preview-${r}`,h=l||i;return(0,C.createElement)(Zo.Button,{variant:e?void 0:"tertiary",className:e||"editor-post-preview",href:h,target:g,disabled:!c,onClick:async e=>{e.preventDefault();const t=window.open("",g);t.focus(),function(e){let t=(0,P.renderToString)((0,C.createElement)("div",{className:"editor-post-preview-button__interstitial-message"},(0,C.createElement)(Zo.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 96 96"},(0,C.createElement)(Zo.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.createElement)(Zo.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.createElement)("p",null,(0,d.__)("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,an.applyFilters)("editor.PostPreview.interstitialMarkup",t),e.write(t),e.title=(0,d.__)("Generating preview…"),e.close()}(t.document);const o=await m({forceIsAutosaveable:n});t.location=o,s?.()},role:o},t||(0,C.createElement)(C.Fragment,null,(0,d._x)("Preview","imperative verb"),(0,C.createElement)(Zo.VisuallyHidden,{as:"span"},(0,d.__)("(opens in a new tab)"))))}const bi=(0,No.compose)([(0,a.withSelect)((e=>{var t;const{isCurrentPostPublished:n,isEditedPostBeingScheduled:o,isSavingPost:s,isPublishingPost:r,getCurrentPost:i,getCurrentPostType:a,isAutosavingPost:l}=e(xo);return{isPublished:n(),isBeingScheduled:o(),isSaving:s(),isPublishing:r(),hasPublishAction:null!==(t=i()._links?.["wp:action-publish"])&&void 0!==t&&t,postType:a(),isAutosaving:l()}}))])((function({isPublished:e,isBeingScheduled:t,isSaving:n,isPublishing:o,hasPublishAction:s,isAutosaving:r,hasNonPostEntityChanges:i}){return o?(0,d.__)("Publishing…"):e&&n&&!r?(0,d.__)("Updating…"):t&&n&&!r?(0,d.__)("Scheduling…"):s?e?i?(0,d.__)("Update…"):(0,d.__)("Update"):t?i?(0,d.__)("Schedule…"):(0,d.__)("Schedule"):(0,d.__)("Publish"):i?(0,d.__)("Submit for Review…"):(0,d.__)("Submit for Review")})),vi=()=>{};class yi extends P.Component{constructor(e){super(e),this.buttonNode=(0,P.createRef)(),this.createOnClick=this.createOnClick.bind(this),this.closeEntitiesSavedStates=this.closeEntitiesSavedStates.bind(this),this.state={entitiesSavedStatesCallback:!1}}componentDidMount(){this.props.focusOnMount&&(this.timeoutID=setTimeout((()=>{this.buttonNode.current.focus()}),0))}componentWillUnmount(){clearTimeout(this.timeoutID)}createOnClick(e){return(...t)=>{const{hasNonPostEntityChanges:n,setEntitiesSavedStatesCallback:o}=this.props;return n&&o?(this.setState({entitiesSavedStatesCallback:()=>e(...t)}),o((()=>this.closeEntitiesSavedStates)),vi):e(...t)}}closeEntitiesSavedStates(e){const{postType:t,postId:n}=this.props,{entitiesSavedStatesCallback:o}=this.state;this.setState({entitiesSavedStatesCallback:!1},(()=>{e&&e.some((e=>"postType"===e.kind&&e.name===t&&e.key===n))&&o()}))}render(){const{forceIsDirty:e,hasPublishAction:t,isBeingScheduled:n,isOpen:o,isPostSavingLocked:s,isPublishable:r,isPublished:i,isSaveable:a,isSaving:l,isAutoSaving:c,isToggle:u,onSave:p,onStatusChange:m,onSubmit:g=vi,onToggle:h,visibility:_,hasNonPostEntityChanges:f,isSavingNonPostEntityChanges:E}=this.props,b=(l||!a||s||!r&&!e)&&(!f||E),v=(i||l||!a||!r&&!e)&&(!f||E);let y;y=t?"private"===_?"private":n?"future":"publish":"pending";const w={"aria-disabled":b,className:"editor-post-publish-button",isBusy:!c&&l,variant:"primary",onClick:this.createOnClick((()=>{b||(g(),m(y),p())}))},k={"aria-disabled":v,"aria-expanded":o,className:"editor-post-publish-panel__toggle",isBusy:l&&i,variant:"primary",size:"compact",onClick:this.createOnClick((()=>{v||h()}))},S=n?(0,d.__)("Schedule…"):(0,d.__)("Publish"),P=(0,C.createElement)(bi,{hasNonPostEntityChanges:f}),T=u?k:w,x=u?S:P;return(0,C.createElement)(C.Fragment,null,(0,C.createElement)(Zo.Button,{ref:this.buttonNode,...T,className:Ko()(T.className,"editor-post-publish-button__button",{"has-changes-dot":f})},x))}}const wi=(0,No.compose)([(0,a.withSelect)((e=>{var t;const{isSavingPost:n,isAutosavingPost:o,isEditedPostBeingScheduled:s,getEditedPostVisibility:r,isCurrentPostPublished:i,isEditedPostSaveable:a,isEditedPostPublishable:l,isPostSavingLocked:c,getCurrentPost:u,getCurrentPostType:d,getCurrentPostId:p,hasNonPostEntityChanges:m,isSavingNonPostEntityChanges:g}=e(xo);return{isSaving:n(),isAutoSaving:o(),isBeingScheduled:s(),visibility:r(),isSaveable:a(),isPostSavingLocked:c(),isPublishable:l(),isPublished:i(),hasPublishAction:null!==(t=u()._links?.["wp:action-publish"])&&void 0!==t&&t,postType:d(),postId:p(),hasNonPostEntityChanges:m(),isSavingNonPostEntityChanges:g()}})),(0,a.withDispatch)((e=>{const{editPost:t,savePost:n}=e(xo);return{onStatusChange:e=>t({status:e},{undoIgnore:!0}),onSave:n}}))])(yi),ki=(0,C.createElement)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,C.createElement)(T.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"})),Si=(0,C.createElement)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,C.createElement)(T.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"})),Pi={public:{label:(0,d.__)("Public"),info:(0,d.__)("Visible to everyone.")},private:{label:(0,d.__)("Private"),info:(0,d.__)("Only visible to site admins and editors.")},password:{label:(0,d.__)("Password protected"),info:(0,d.__)("Only those with the password can view this post.")}};function Ci({onClose:e}){const t=(0,No.useInstanceId)(Ci),{status:n,visibility:o,password:s}=(0,a.useSelect)((e=>({status:e(xo).getEditedPostAttribute("status"),visibility:e(xo).getEditedPostVisibility(),password:e(xo).getEditedPostAttribute("password")}))),{editPost:r,savePost:i}=(0,a.useDispatch)(xo),[l,c]=(0,P.useState)(!!s),[u,p]=(0,P.useState)(!1);return(0,C.createElement)("div",{className:"editor-post-visibility"},(0,C.createElement)(m.__experimentalInspectorPopoverHeader,{title:(0,d.__)("Visibility"),help:(0,d.__)("Control how this post is viewed."),onClose:e}),(0,C.createElement)("fieldset",{className:"editor-post-visibility__fieldset"},(0,C.createElement)(Zo.VisuallyHidden,{as:"legend"},(0,d.__)("Visibility")),(0,C.createElement)(Ti,{instanceId:t,value:"public",label:Pi.public.label,info:Pi.public.info,checked:"public"===o&&!l,onChange:()=>{r({status:"private"===o?"draft":n,password:""}),c(!1)}}),(0,C.createElement)(Ti,{instanceId:t,value:"private",label:Pi.private.label,info:Pi.private.info,checked:"private"===o,onChange:()=>{p(!0)}}),(0,C.createElement)(Ti,{instanceId:t,value:"password",label:Pi.password.label,info:Pi.password.info,checked:l,onChange:()=>{r({status:"private"===o?"draft":n,password:s||""}),c(!0)}}),l&&(0,C.createElement)("div",{className:"editor-post-visibility__password"},(0,C.createElement)(Zo.VisuallyHidden,{as:"label",htmlFor:`editor-post-visibility__password-input-${t}`},(0,d.__)("Create password")),(0,C.createElement)("input",{className:"editor-post-visibility__password-input",id:`editor-post-visibility__password-input-${t}`,type:"text",onChange:e=>{r({password:e.target.value})},value:s,placeholder:(0,d.__)("Use a secure password")}))),(0,C.createElement)(Zo.__experimentalConfirmDialog,{isOpen:u,onConfirm:()=>{r({status:"private",password:""}),c(!1),p(!1),i()},onCancel:()=>{p(!1)}},(0,d.__)("Would you like to privately publish this post now?")))}function Ti({instanceId:e,value:t,label:n,info:o,...s}){return(0,C.createElement)("div",{className:"editor-post-visibility__choice"},(0,C.createElement)("input",{type:"radio",name:`editor-post-visibility__setting-${e}`,value:t,id:`editor-post-${t}-${e}`,"aria-describedby":`editor-post-${t}-${e}-description`,className:"editor-post-visibility__radio",...s}),(0,C.createElement)("label",{htmlFor:`editor-post-${t}-${e}`,className:"editor-post-visibility__label"},n),(0,C.createElement)("p",{id:`editor-post-${t}-${e}-description`,className:"editor-post-visibility__info"},o))}function xi(){return Bi()}function Bi(){const e=(0,a.useSelect)((e=>e(xo).getEditedPostVisibility()));return Pi[e]?.label}function Ii(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Ni(e){return Ni="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ni(e)}function Di(e){Ii(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===Ni(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function Ai(e){Ii(1,arguments);var t=Di(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Ri(e){Ii(1,arguments);var t=Di(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}Math.pow(10,8);var Oi=6e4,Li=36e5;function Mi(e,t){var n;Ii(1,arguments);var o=function(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}(null!==(n=null==t?void 0:t.additionalDigits)&&void 0!==n?n:2);if(2!==o&&1!==o&&0!==o)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var s,r=function(e){var t,n={},o=e.split(Fi.dateTimeDelimiter);if(o.length>2)return n;/:/.test(o[0])?t=o[0]:(n.date=o[0],t=o[1],Fi.timeZoneDelimiter.test(n.date)&&(n.date=e.split(Fi.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length)));if(t){var s=Fi.timezone.exec(t);s?(n.time=t.replace(s[1],""),n.timezone=s[1]):n.time=t}return n}(e);if(r.date){var i=function(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),o=e.match(n);if(!o)return{year:NaN,restDateString:""};var s=o[1]?parseInt(o[1]):null,r=o[2]?parseInt(o[2]):null;return{year:null===r?s:100*r,restDateString:e.slice((o[1]||o[2]).length)}}(r.date,o);s=function(e,t){if(null===t)return new Date(NaN);var n=e.match(Vi);if(!n)return new Date(NaN);var o=!!n[4],s=zi(n[1]),r=zi(n[2])-1,i=zi(n[3]),a=zi(n[4]),l=zi(n[5])-1;if(o)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,a,l)?function(e,t,n){var o=new Date(0);o.setUTCFullYear(e,0,4);var s=o.getUTCDay()||7,r=7*(t-1)+n+1-s;return o.setUTCDate(o.getUTCDate()+r),o}(t,a,l):new Date(NaN);var c=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(ji[t]||(Wi(e)?29:28))}(t,r,i)&&function(e,t){return t>=1&&t<=(Wi(e)?366:365)}(t,s)?(c.setUTCFullYear(t,r,Math.max(s,i)),c):new Date(NaN)}(i.restDateString,i.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);var a,l=s.getTime(),c=0;if(r.time&&(c=function(e){var t=e.match(Ui);if(!t)return NaN;var n=Gi(t[1]),o=Gi(t[2]),s=Gi(t[3]);if(!function(e,t,n){if(24===e)return 0===t&&0===n;return n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,o,s))return NaN;return n*Li+o*Oi+1e3*s}(r.time),isNaN(c)))return new Date(NaN);if(!r.timezone){var u=new Date(l+c),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return a=function(e){if("Z"===e)return 0;var t=e.match(Hi);if(!t)return 0;var n="+"===t[1]?-1:1,o=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;if(!function(e,t){return t>=0&&t<=59}(0,s))return NaN;return n*(o*Li+s*Oi)}(r.timezone),isNaN(a)?new Date(NaN):new Date(l+c+a)}var Fi={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Vi=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Ui=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Hi=/^([+-])(\d{2})(?::?(\d{2}))?$/;function zi(e){return e?parseInt(e):1}function Gi(e){return e&&parseFloat(e.replace(",","."))||0}var ji=[31,null,31,30,31,30,31,31,30,31,30,31];function Wi(e){return e%400==0||e%4==0&&e%100!=0}function $i({onClose:e}){const{postDate:t,postType:n}=(0,a.useSelect)((e=>({postDate:e(xo).getEditedPostAttribute("date"),postType:e(xo).getCurrentPostType()})),[]),{editPost:o}=(0,a.useDispatch)(xo),[s,r]=(0,P.useState)(Ai(new Date(t))),i=(0,a.useSelect)((e=>e(p.store).getEntityRecords("postType",n,{status:"publish,future",after:Ai(s).toISOString(),before:Ri(s).toISOString(),exclude:[e(xo).getCurrentPostId()],per_page:100,_fields:"id,date"})),[s,n]),l=(0,P.useMemo)((()=>(i||[]).map((({date:e})=>({date:new Date(e)})))),[i]),c=(0,y.getSettings)(),u=/a(?!\\)/i.test(c.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,C.createElement)(m.__experimentalPublishDateTimePicker,{currentDate:t,onChange:e=>o({date:e}),is12Hour:u,events:l,onMonthPreviewed:e=>r(Mi(e)),onClose:e})}function Ki(e){return Zi(e)}function Zi({full:e=!1}={}){const{date:t,isFloating:n}=(0,a.useSelect)((e=>({date:e(xo).getEditedPostAttribute("date"),isFloating:e(xo).isEditedPostDateFloating()})),[]);return e?Yi(t):function(e,{isFloating:t=!1,now:n=new Date}={}){if(!e||t)return(0,d.__)("Immediately");if(!function(e){const{timezone:t}=(0,y.getSettings)(),n=Number(t.offset),o=e.getTimezoneOffset()/60*-1;return n===o}(n))return Yi(e);const o=(0,y.getDate)(e);if(qi(o,n))return(0,d.sprintf)((0,d.__)("Today at %s"),(0,y.dateI18n)((0,d._x)("g:i a","post schedule time format"),o));const s=new Date(n);if(s.setDate(s.getDate()+1),qi(o,s))return(0,d.sprintf)((0,d.__)("Tomorrow at %s"),(0,y.dateI18n)((0,d._x)("g:i a","post schedule time format"),o));if(o.getFullYear()===n.getFullYear())return(0,y.dateI18n)((0,d._x)("F j g:i a","post schedule date format without year"),o);return(0,y.dateI18n)((0,d._x)("F j, Y g:i a","post schedule full date format"),o)}(t,{isFloating:n})}function Yi(e){const t=(0,y.getDate)(e),n=function(){const{timezone:e}=(0,y.getSettings)();if(e.abbr&&isNaN(Number(e.abbr)))return e.abbr;const t=e.offset<0?"":"+";return`UTC${t}${e.offsetFormatted}`}(),o=(0,y.dateI18n)((0,d._x)("F j, Y g:i a","post schedule full date format"),t);return(0,d.isRTL)()?`${n} ${o}`:`${o} ${n}`}function qi(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}const Qi=window.wp.a11y,Xi=3,Ji={per_page:10,orderby:"count",order:"desc",hide_empty:!0,_fields:"id,name,count",context:"view"};function ea({onSelect:e,taxonomy:t}){const{_terms:n,showTerms:o}=(0,a.useSelect)((e=>{const n=e(p.store).getEntityRecords("taxonomy",t.slug,Ji);return{_terms:n,showTerms:n?.length>=Xi}}),[t.slug]);if(!o)return null;const s=nr(n);return(0,C.createElement)("div",{className:"editor-post-taxonomies__flat-term-most-used"},(0,C.createElement)(Zo.BaseControl.VisualLabel,{as:"h3",className:"editor-post-taxonomies__flat-term-most-used-label"},t.labels.most_used),(0,C.createElement)("ul",{role:"list",className:"editor-post-taxonomies__flat-term-most-used-list"},s.map((t=>(0,C.createElement)("li",{key:t.id},(0,C.createElement)(Zo.Button,{variant:"link",onClick:()=>e(t)},t.name))))))}const ta=[],na=20,oa={per_page:na,_fields:"id,name",context:"view"},sa=(e,t)=>er(e).toLowerCase()===er(t).toLowerCase(),ra=(e,t)=>e.map((e=>t.find((t=>sa(t.name,e))).id));function ia({slug:e}){var t,n;const[o,s]=(0,P.useState)([]),[r,i]=(0,P.useState)(""),l=(0,No.useDebounce)(i,500),{terms:c,termIds:u,taxonomy:m,hasAssignAction:g,hasCreateAction:h,hasResolvedTerms:_}=(0,a.useSelect)((t=>{var n,o;const{getCurrentPost:s,getEditedPostAttribute:r}=t(xo),{getEntityRecords:i,getTaxonomy:a,hasFinishedResolution:l}=t(p.store),c=s(),u=a(e),d=u?r(u.rest_base):ta,m={...oa,include:d.join(","),per_page:-1};return{hasCreateAction:!!u&&(null!==(n=c._links?.["wp:action-create-"+u.rest_base])&&void 0!==n&&n),hasAssignAction:!!u&&(null!==(o=c._links?.["wp:action-assign-"+u.rest_base])&&void 0!==o&&o),taxonomy:u,termIds:d,terms:d.length?i("taxonomy",e,m):ta,hasResolvedTerms:l("getEntityRecords",["taxonomy",e,m])}}),[e]),{searchResults:f}=(0,a.useSelect)((t=>{const{getEntityRecords:n}=t(p.store);return{searchResults:r?n("taxonomy",e,{...oa,search:r}):ta}}),[r,e]);(0,P.useEffect)((()=>{if(_){const e=(null!=c?c:[]).map((e=>er(e.name)));s(e)}}),[c,_]);const E=(0,P.useMemo)((()=>(null!=f?f:[]).map((e=>er(e.name)))),[f]),{editPost:b}=(0,a.useDispatch)(xo),{saveEntityRecord:v}=(0,a.useDispatch)(p.store),{createErrorNotice:y}=(0,a.useDispatch)(rn.store);if(!g)return null;function w(e){b({[m.rest_base]:e})}const k=null!==(t=m?.labels?.add_new_item)&&void 0!==t?t:"post_tag"===e?(0,d.__)("Add new tag"):(0,d.__)("Add new Term"),S=null!==(n=m?.labels?.singular_name)&&void 0!==n?n:"post_tag"===e?(0,d.__)("Tag"):(0,d.__)("Term"),T=(0,d.sprintf)((0,d._x)("%s added","term"),S),x=(0,d.sprintf)((0,d._x)("%s removed","term"),S),B=(0,d.sprintf)((0,d._x)("Remove %s","term"),S);return(0,C.createElement)(C.Fragment,null,(0,C.createElement)(Zo.FormTokenField,{__next40pxDefaultSize:!0,value:o,suggestions:E,onChange:function(t){const n=[...null!=c?c:[],...null!=f?f:[]],o=t.reduce(((e,t)=>(e.some((e=>e.toLowerCase()===t.toLowerCase()))||e.push(t),e)),[]),r=o.filter((e=>!n.find((t=>sa(t.name,e)))));if(s(o),0===r.length)return w(ra(o,n));h&&Promise.all(r.map((t=>async function(t){try{const n=await v("taxonomy",e,t,{throwOnError:!0});return tr(n)}catch(e){if("term_exists"!==e.code)throw e;return{id:e.data.term_id,name:t.name}}}({name:t})))).then((e=>{const t=n.concat(e);return w(ra(o,t))})).catch((e=>{y(e.message,{type:"snackbar"})}))},onInputChange:l,maxSuggestions:na,label:k,messages:{added:T,removed:x,remove:B}}),(0,C.createElement)(ea,{taxonomy:m,onSelect:function(t){var n;if(u.includes(t.id))return;const o=[...u,t.id],s="post_tag"===e?(0,d.__)("Tag"):(0,d.__)("Term"),r=(0,d.sprintf)((0,d._x)("%s added","term"),null!==(n=m?.labels?.singular_name)&&void 0!==n?n:s);(0,Qi.speak)(r,"assertive"),w(o)}}))}const aa=(0,Zo.withFilters)("editor.PostTaxonomyType")(ia),la=()=>{const e=[(0,d.__)("Suggestion:"),(0,C.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,d.__)("Add tags"))];return(0,C.createElement)(Zo.PanelBody,{initialOpen:!1,title:e},(0,C.createElement)("p",null,(0,d.__)("Tags help users and search engines navigate your site and find your content. Add a few keywords to describe your post.")),(0,C.createElement)(aa,{slug:"post_tag"}))},ca=()=>{const{hasTags:e,isPostTypeSupported:t}=(0,a.useSelect)((e=>{const t=e(xo).getCurrentPostType(),n=e(p.store).getTaxonomy("post_tag"),o=n?.types?.includes(t),s=void 0!==n,r=n&&e(xo).getEditedPostAttribute(n.rest_base);return{hasTags:!!r?.length,isPostTypeSupported:s&&o}}),[]),[n]=(0,P.useState)(e);return t?n?null:(0,C.createElement)(la,null):null},ua=(e,t)=>ci.filter((t=>e?.includes(t.id))).find((e=>e.id===t)),da=({suggestedPostFormat:e,suggestionText:t,onUpdatePostFormat:n})=>(0,C.createElement)(Zo.Button,{variant:"link",onClick:()=>n(e)},t);function pa(){const{currentPostFormat:e,suggestion:t}=(0,a.useSelect)((e=>{var t;const{getEditedPostAttribute:n,getSuggestedPostFormat:o}=e(xo),s=null!==(t=e(p.store).getThemeSupports().formats)&&void 0!==t?t:[];return{currentPostFormat:n("format"),suggestion:ua(s,o())}}),[]),{editPost:n}=(0,a.useDispatch)(xo),o=[(0,d.__)("Suggestion:"),(0,C.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,d.__)("Use a post format"))];return t&&t.id!==e?(0,C.createElement)(Zo.PanelBody,{initialOpen:!1,title:o},(0,C.createElement)("p",null,(0,d.__)("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.createElement)("p",null,(0,C.createElement)(da,{onUpdatePostFormat:e=>n({format:e}),suggestedPostFormat:t.id,suggestionText:(0,d.sprintf)((0,d.__)('Apply the "%1$s" format.'),t.caption)}))):null}const ma={per_page:-1,orderby:"name",order:"asc",_fields:"id,name,parent",context:"view"},ga=8,ha=[];function _a({slug:e}){var t,n;const[o,s]=(0,P.useState)(!1),[r,i]=(0,P.useState)(""),[l,c]=(0,P.useState)(""),[u,m]=(0,P.useState)(!1),[g,h]=(0,P.useState)(""),[_,f]=(0,P.useState)([]),E=(0,No.useDebounce)(Qi.speak,500),{hasCreateAction:b,hasAssignAction:v,terms:y,loading:w,availableTerms:k,taxonomy:S}=(0,a.useSelect)((t=>{var n,o;const{getCurrentPost:s,getEditedPostAttribute:r}=t(xo),{getTaxonomy:i,getEntityRecords:a,isResolving:l}=t(p.store),c=i(e),u=s();return{hasCreateAction:!!c&&(null!==(n=u._links?.["wp:action-create-"+c.rest_base])&&void 0!==n&&n),hasAssignAction:!!c&&(null!==(o=u._links?.["wp:action-assign-"+c.rest_base])&&void 0!==o&&o),terms:c?r(c.rest_base):ha,loading:l("getEntityRecords",["taxonomy",e,ma]),availableTerms:a("taxonomy",e,ma)||ha,taxonomy:c}}),[e]),{editPost:T}=(0,a.useDispatch)(xo),{saveEntityRecord:x}=(0,a.useDispatch)(p.store),B=(0,P.useMemo)((()=>function(e,t){const n=e=>-1!==t.indexOf(e.id)||void 0!==e.children&&e.children.map(n).filter((e=>e)).length>0,o=[...e];return o.sort(((e,t)=>{const o=n(e),s=n(t);return o===s?0:o&&!s?-1:!o&&s?1:0})),o}(Js(k),y)),[k]),{createErrorNotice:I}=(0,a.useDispatch)(rn.store);if(!v)return null;const N=e=>{T({[S.rest_base]:e})},D=e=>e.map((e=>(0,C.createElement)("div",{key:e.id,className:"editor-post-taxonomies__hierarchical-terms-choice"},(0,C.createElement)(Zo.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:-1!==y.indexOf(e.id),onChange:()=>{(e=>{const t=y.includes(e)?y.filter((t=>t!==e)):[...y,e];N(t)})(parseInt(e.id,10))},label:(0,Cs.decodeEntities)(e.name)}),!!e.children.length&&(0,C.createElement)("div",{className:"editor-post-taxonomies__hierarchical-terms-subchoices"},D(e.children))))),A=(t,n,o)=>{var s;return null!==(s=S?.labels?.[t])&&void 0!==s?s:"category"===e?n:o},R=A("add_new_item",(0,d.__)("Add new category"),(0,d.__)("Add new term")),O=A("new_item_name",(0,d.__)("Add new category"),(0,d.__)("Add new term")),L=A("parent_item",(0,d.__)("Parent Category"),(0,d.__)("Parent Term")),M=`— ${L} —`,F=R,V=null!==(t=S?.labels?.search_items)&&void 0!==t?t:(0,d.__)("Search Terms"),U=null!==(n=S?.name)&&void 0!==n?n:(0,d.__)("Terms"),H=k.length>=ga;return(0,C.createElement)(Zo.Flex,{direction:"column",gap:"4"},H&&(0,C.createElement)(Zo.TextControl,{__nextHasNoMarginBottom:!0,label:V,value:g,onChange:e=>{const t=B.map(function(e){const t=n=>{if(""===e)return n;const o={...n};return o.children.length>0&&(o.children=o.children.map(t).filter((e=>e))),(-1!==o.name.toLowerCase().indexOf(e.toLowerCase())||o.children.length>0)&&o};return t}(e)).filter((e=>e)),n=e=>{let t=0;for(let o=0;o<e.length;o++)t++,void 0!==e[o].children&&(t+=n(e[o].children));return t};h(e),f(t);const o=n(t),s=(0,d.sprintf)((0,d._n)("%d result found.","%d results found.",o),o);E(s,"assertive")}}),(0,C.createElement)("div",{className:"editor-post-taxonomies__hierarchical-terms-list",tabIndex:"0",role:"group","aria-label":U},D(""!==g?_:B)),!w&&b&&(0,C.createElement)(Zo.FlexItem,null,(0,C.createElement)(Zo.Button,{onClick:()=>{m(!u)},className:"editor-post-taxonomies__hierarchical-terms-add","aria-expanded":u,variant:"link"},R)),u&&(0,C.createElement)("form",{onSubmit:async t=>{var n;if(t.preventDefault(),""===r||o)return;const a=function(e,t,n){return e.find((e=>(!e.parent&&!t||parseInt(e.parent)===parseInt(t))&&e.name.toLowerCase()===n.toLowerCase()))}(k,l,r);if(a)return y.some((e=>e===a.id))||N([...y,a.id]),i(""),void c("");let u;s(!0);try{u=await(p={name:r,parent:l||void 0},x("taxonomy",e,p,{throwOnError:!0}))}catch(e){return void I(e.message,{type:"snackbar"})}var p;const m="category"===e?(0,d.__)("Category"):(0,d.__)("Term"),g=(0,d.sprintf)((0,d._x)("%s added","term"),null!==(n=S?.labels?.singular_name)&&void 0!==n?n:m);(0,Qi.speak)(g,"assertive"),s(!1),i(""),c(""),N([...y,u.id])}},(0,C.createElement)(Zo.Flex,{direction:"column",gap:"4"},(0,C.createElement)(Zo.TextControl,{__nextHasNoMarginBottom:!0,className:"editor-post-taxonomies__hierarchical-terms-input",label:O,value:r,onChange:e=>{i(e)},required:!0}),!!k.length&&(0,C.createElement)(Zo.TreeSelect,{__nextHasNoMarginBottom:!0,label:L,noOptionLabel:M,onChange:e=>{c(e)},selectedId:l,tree:B}),(0,C.createElement)(Zo.FlexItem,null,(0,C.createElement)(Zo.Button,{variant:"secondary",type:"submit",className:"editor-post-taxonomies__hierarchical-terms-submit"},F)))))}const fa=(0,Zo.withFilters)("editor.PostTaxonomyType")(_a);const Ea=function(){const e=(0,a.useSelect)((e=>{const t=e(xo).getCurrentPostType(),{canUser:n,getEntityRecord:o,getTaxonomy:s}=e(p.store),r=s("category"),i=n("read","settings")?o("root","site")?.default_category:void 0,a=i?o("taxonomy","category",i):void 0,l=r&&r.types.some((e=>e===t)),c=r&&e(xo).getEditedPostAttribute(r.rest_base);return!!r&&!!a&&l&&(0===c?.length||1===c?.length&&a?.id===c[0])}),[]),[t,n]=(0,P.useState)(!1);if((0,P.useEffect)((()=>{e&&n(!0)}),[e]),!t)return null;const o=[(0,d.__)("Suggestion:"),(0,C.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,d.__)("Assign a category"))];return(0,C.createElement)(Zo.PanelBody,{initialOpen:!1,title:o},(0,C.createElement)("p",null,(0,d.__)("Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.")),(0,C.createElement)(fa,{slug:"category"}))};function ba(e){const t=[];return e.forEach((e=>{t.push(e),t.push(...ba(e.innerBlocks))})),t}function va(e){const{selectBlock:t}=(0,a.useDispatch)(m.store);return(0,C.createElement)(Zo.__unstableMotion.img,{tabIndex:0,role:"button","aria-label":(0,d.__)("Select image block."),onClick:()=>{t(e.clientId)},onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||(t(e.clientId),n.preventDefault())},key:e.clientId,alt:e.attributes.alt,src:e.attributes.url,animate:{opacity:1},exit:{opacity:0,scale:0},style:{width:"36px",height:"36px",objectFit:"cover",borderRadius:"2px",cursor:"pointer"},whileHover:{scale:1.08}})}function ya(){const[e,t]=(0,P.useState)(!1),{editorBlocks:n,mediaUpload:o}=(0,a.useSelect)((e=>({editorBlocks:e(xo).getEditorBlocks(),mediaUpload:e(m.store).getSettings().mediaUpload})),[]),s=ba(n).filter((e=>"core/image"===e.name&&e.attributes.url&&!e.attributes.id)),{updateBlockAttributes:r}=(0,a.useDispatch)(m.store);if(!o||!s.length)return null;const i=[(0,d.__)("Suggestion:"),(0,C.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,d.__)("External media"))];return(0,C.createElement)(Zo.PanelBody,{initialOpen:!0,title:i},(0,C.createElement)("p",null,(0,d.__)("Upload external images to the Media Library. Images from different domains may load slowly, display incorrectly, or be removed unexpectedly.")),(0,C.createElement)("div",{style:{display:"inline-flex",flexWrap:"wrap",gap:"8px"}},(0,C.createElement)(Zo.__unstableAnimatePresence,null,s.map((e=>(0,C.createElement)(va,{key:e.clientId,...e})))),e?(0,C.createElement)(Zo.Spinner,null):(0,C.createElement)(Zo.Button,{variant:"primary",onClick:function(){t(!0),Promise.all(s.map((e=>window.fetch(e.attributes.url.includes("?")?e.attributes.url:e.attributes.url+"?").then((e=>e.blob())).then((t=>new Promise(((n,s)=>{o({filesList:[t],onFileChange:([t])=>{(0,qr.isBlobURL)(t.url)||(r(e.clientId,{id:t.id,url:t.url}),n())},onError(){s()}})}))))))).finally((()=>{t(!1)}))}},(0,d.__)("Upload"))))}const wa=function({children:e}){const{isBeingScheduled:t,isRequestingSiteIcon:n,hasPublishAction:o,siteIconUrl:s,siteTitle:r,siteHome:i}=(0,a.useSelect)((e=>{var t;const{getCurrentPost:n,isEditedPostBeingScheduled:o}=e(xo),{getEntityRecord:s,isResolving:r}=e(p.store),i=s("root","__unstableBase",void 0)||{};return{hasPublishAction:null!==(t=n()._links?.["wp:action-publish"])&&void 0!==t&&t,isBeingScheduled:o(),isRequestingSiteIcon:r("getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:i.site_icon_url,siteTitle:i.name,siteHome:i.home&&(0,w.filterURLForDisplay)(i.home)}}),[]);let l,c,u=(0,C.createElement)(Zo.Icon,{className:"components-site-icon",size:"36px",icon:Si});return s&&(u=(0,C.createElement)("img",{alt:(0,d.__)("Site Icon"),className:"components-site-icon",src:s})),n&&(u=null),o?t?(l=(0,d.__)("Are you ready to schedule?"),c=(0,d.__)("Your work will be published at the specified date and time.")):(l=(0,d.__)("Are you ready to publish?"),c=(0,d.__)("Double-check your settings before publishing.")):(l=(0,d.__)("Are you ready to submit for review?"),c=(0,d.__)("When you’re ready, submit your work for review, and an Editor will be able to approve it for you.")),(0,C.createElement)("div",{className:"editor-post-publish-panel__prepublish"},(0,C.createElement)("div",null,(0,C.createElement)("strong",null,l)),(0,C.createElement)("p",null,c),(0,C.createElement)("div",{className:"components-site-card"},u,(0,C.createElement)("div",{className:"components-site-info"},(0,C.createElement)("span",{className:"components-site-name"},(0,Cs.decodeEntities)(r)||(0,d.__)("(Untitled)")),(0,C.createElement)("span",{className:"components-site-home"},i))),(0,C.createElement)(ya,null),o&&(0,C.createElement)(C.Fragment,null,(0,C.createElement)(Zo.PanelBody,{initialOpen:!1,title:[(0,d.__)("Visibility:"),(0,C.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,C.createElement)(xi,null))]},(0,C.createElement)(Ci,null)),(0,C.createElement)(Zo.PanelBody,{initialOpen:!1,title:[(0,d.__)("Publish:"),(0,C.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,C.createElement)(Ki,null))]},(0,C.createElement)($i,null))),(0,C.createElement)(pa,null),(0,C.createElement)(ca,null),(0,C.createElement)(Ea,null),e)},ka="%postname%",Sa="%pagename%";function Pa({text:e,onCopy:t,children:n}){const o=(0,No.useCopyToClipboard)(e,t);return(0,C.createElement)(Zo.Button,{variant:"secondary",ref:o},n)}class Ca extends P.Component{constructor(){super(...arguments),this.state={showCopyConfirmation:!1},this.onCopy=this.onCopy.bind(this),this.onSelectInput=this.onSelectInput.bind(this),this.postLink=(0,P.createRef)()}componentDidMount(){this.props.focusOnMount&&this.postLink.current.focus()}componentWillUnmount(){clearTimeout(this.dismissCopyConfirmation)}onCopy(){this.setState({showCopyConfirmation:!0}),clearTimeout(this.dismissCopyConfirmation),this.dismissCopyConfirmation=setTimeout((()=>{this.setState({showCopyConfirmation:!1})}),4e3)}onSelectInput(e){e.target.select()}render(){const{children:e,isScheduled:t,post:n,postType:o}=this.props,s=o?.labels?.singular_name,r=o?.labels?.view_item,i=o?.labels?.add_new_item,a="future"===n.status?(e=>{const{slug:t}=e;return e.permalink_template.includes(ka)?e.permalink_template.replace(ka,t):e.permalink_template.includes(Sa)?e.permalink_template.replace(Sa,t):e.permalink_template})(n):n.link,l=(0,w.addQueryArgs)("post-new.php",{post_type:n.type}),c=t?(0,C.createElement)(C.Fragment,null,(0,d.__)("is now scheduled. It will go live on")," ",(0,C.createElement)(Ki,null),"."):(0,d.__)("is now live.");return(0,C.createElement)("div",{className:"post-publish-panel__postpublish"},(0,C.createElement)(Zo.PanelBody,{className:"post-publish-panel__postpublish-header"},(0,C.createElement)("a",{ref:this.postLink,href:a},(0,Cs.decodeEntities)(n.title)||(0,d.__)("(no title)"))," ",c),(0,C.createElement)(Zo.PanelBody,null,(0,C.createElement)("p",{className:"post-publish-panel__postpublish-subheader"},(0,C.createElement)("strong",null,(0,d.__)("What’s next?"))),(0,C.createElement)("div",{className:"post-publish-panel__postpublish-post-address-container"},(0,C.createElement)(Zo.TextControl,{__nextHasNoMarginBottom:!0,className:"post-publish-panel__postpublish-post-address",readOnly:!0,label:(0,d.sprintf)((0,d.__)("%s address"),s),value:(0,w.safeDecodeURIComponent)(a),onFocus:this.onSelectInput}),(0,C.createElement)("div",{className:"post-publish-panel__postpublish-post-address__copy-button-wrap"},(0,C.createElement)(Pa,{text:a,onCopy:this.onCopy},this.state.showCopyConfirmation?(0,d.__)("Copied!"):(0,d.__)("Copy")))),(0,C.createElement)("div",{className:"post-publish-panel__postpublish-buttons"},!t&&(0,C.createElement)(Zo.Button,{variant:"primary",href:a},r),(0,C.createElement)(Zo.Button,{variant:t?"primary":"secondary",href:l},i))),e)}}const Ta=(0,a.withSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPost:n,isCurrentPostScheduled:o}=e(xo),{getPostType:s}=e(p.store);return{post:n(),postType:s(t("type")),isScheduled:o()}}))(Ca);class xa extends P.Component{constructor(){super(...arguments),this.onSubmit=this.onSubmit.bind(this)}componentDidUpdate(e){e.isPublished&&!this.props.isSaving&&this.props.isDirty&&this.props.onClose()}onSubmit(){const{onClose:e,hasPublishAction:t,isPostTypeViewable:n}=this.props;t&&n||e()}render(){const{forceIsDirty:e,isBeingScheduled:t,isPublished:n,isPublishSidebarEnabled:o,isScheduled:s,isSaving:r,isSavingNonPostEntityChanges:i,onClose:a,onTogglePublishSidebar:l,PostPublishExtension:c,PrePublishExtension:u,...p}=this.props,{hasPublishAction:m,isDirty:g,isPostTypeViewable:h,..._}=p,f=n||s&&t,E=!f&&!r,b=f&&!r;return(0,C.createElement)("div",{className:"editor-post-publish-panel",..._},(0,C.createElement)("div",{className:"editor-post-publish-panel__header"},b?(0,C.createElement)(Zo.Button,{onClick:a,icon:ki,label:(0,d.__)("Close panel")}):(0,C.createElement)(C.Fragment,null,(0,C.createElement)("div",{className:"editor-post-publish-panel__header-publish-button"},(0,C.createElement)(wi,{focusOnMount:!0,onSubmit:this.onSubmit,forceIsDirty:e})),(0,C.createElement)("div",{className:"editor-post-publish-panel__header-cancel-button"},(0,C.createElement)(Zo.Button,{disabled:i,onClick:a,variant:"secondary"},(0,d.__)("Cancel"))))),(0,C.createElement)("div",{className:"editor-post-publish-panel__content"},E&&(0,C.createElement)(wa,null,u&&(0,C.createElement)(u,null)),b&&(0,C.createElement)(Ta,{focusOnMount:!0},c&&(0,C.createElement)(c,null)),r&&(0,C.createElement)(Zo.Spinner,null)),(0,C.createElement)("div",{className:"editor-post-publish-panel__footer"},(0,C.createElement)(Zo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,d.__)("Always show pre-publish checks."),checked:o,onChange:l})))}}const Ba=(0,No.compose)([(0,a.withSelect)((e=>{var t;const{getPostType:n}=e(p.store),{getCurrentPost:o,getEditedPostAttribute:s,isCurrentPostPublished:r,isCurrentPostScheduled:i,isEditedPostBeingScheduled:a,isEditedPostDirty:l,isAutosavingPost:c,isSavingPost:u,isSavingNonPostEntityChanges:d}=e(xo),{isPublishSidebarEnabled:m}=e(xo),g=n(s("type"));return{hasPublishAction:null!==(t=o()._links?.["wp:action-publish"])&&void 0!==t&&t,isPostTypeViewable:g?.viewable,isBeingScheduled:a(),isDirty:l(),isPublished:r(),isPublishSidebarEnabled:m(),isSaving:u()&&!c(),isSavingNonPostEntityChanges:d(),isScheduled:i()}})),(0,a.withDispatch)(((e,{isPublishSidebarEnabled:t})=>{const{disablePublishSidebar:n,enablePublishSidebar:o}=e(xo);return{onTogglePublishSidebar:()=>{t?n():o()}}})),Zo.withFocusReturn,Zo.withConstrainedTabbing])(xa),Ia=(0,C.createElement)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,C.createElement)(T.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-4v-2.4L14 14l1-1-3-3-3 3 1 1 1.2-1.2v2.4H7.7c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4H9l.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 0 1-.8 1.8-1.7 1.8z"}));const Na=(0,P.forwardRef)((function({icon:e,size:t=24,...n},o){return(0,P.cloneElement)(e,{width:t,height:t,...n,ref:o})})),Da=(0,C.createElement)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,C.createElement)(T.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 Aa({forceIsDirty:e}){const[t,n]=(0,P.useState)(!1),o=(0,No.useViewportMatch)("small"),{isAutosaving:s,isDirty:r,isNew:i,isPending:l,isPublished:c,isSaveable:u,isSaving:p,isScheduled:m,hasPublishAction:g,showIconLabels:h}=(0,a.useSelect)((t=>{var n;const{isEditedPostNew:o,isCurrentPostPublished:s,isCurrentPostScheduled:r,isEditedPostDirty:i,isSavingPost:a,isEditedPostSaveable:l,getCurrentPost:c,isAutosavingPost:u,getEditedPostAttribute:d}=t(xo),{get:p}=t(B.store);return{isAutosaving:u(),isDirty:e||i(),isNew:o(),isPending:"pending"===d("status"),isPublished:s(),isSaving:a(),isSaveable:l(),isScheduled:r(),hasPublishAction:null!==(n=c()?._links?.["wp:action-publish"])&&void 0!==n&&n,showIconLabels:p("core","showIconLabels")}}),[e]),{savePost:_}=(0,a.useDispatch)(xo),f=(0,No.usePrevious)(p);if((0,P.useEffect)((()=>{let e;return f&&!p&&(n(!0),e=setTimeout((()=>{n(!1)}),1e3)),()=>clearTimeout(e)}),[p]),!g&&l)return null;if(c||m)return null;const E=l?(0,d.__)("Save as pending"):(0,d.__)("Save draft"),b=(0,d.__)("Save"),v=t||!i&&!r,y=p||v,w=p||v||!u;let k;return p?k=s?(0,d.__)("Autosaving"):(0,d.__)("Saving"):v?k=(0,d.__)("Saved"):o?k=E:h&&(k=b),(0,C.createElement)(Zo.Button,{className:u||p?Ko()({"editor-post-save-draft":!y,"editor-post-saved-state":y,"is-saving":p,"is-autosaving":s,"is-saved":v,[(0,Zo.__unstableGetAnimateClassName)({type:"loading"})]:p}):void 0,onClick:w?void 0:()=>_(),shortcut:w?void 0:es.displayShortcut.primary("s"),variant:"tertiary",size:"compact",icon:o?void 0:Ia,label:k||E,"aria-disabled":w},y&&(0,C.createElement)(Na,{icon:v?vr:Da}),k)}function Ra({children:e}){return(0,a.useSelect)((e=>{var t;return null!==(t=e(xo).getCurrentPost()._links?.["wp:action-publish"])&&void 0!==t&&t}),[])?e:null}function Oa(){const[e,t]=(0,P.useState)(null),n=(0,P.useMemo)((()=>({anchor:e,"aria-label":(0,d.__)("Change publish date"),placement:"bottom-end"})),[e]),o=Zi(),s=Zi({full:!0});return(0,C.createElement)(Ra,null,(0,C.createElement)(xr,{label:(0,d.__)("Publish"),ref:t},(0,C.createElement)(Zo.Dropdown,{popoverProps:n,focusOnMount:!0,className:"editor-post-schedule__panel-dropdown",contentClassName:"editor-post-schedule__dialog",renderToggle:({onToggle:e,isOpen:t})=>(0,C.createElement)(Zo.Button,{__next40pxDefaultSize:!0,className:"editor-post-schedule__dialog-toggle",variant:"tertiary",onClick:e,"aria-label":(0,d.sprintf)((0,d.__)("Change date: %s"),o),label:s,showTooltip:o!==s,"aria-expanded":t},o),renderContent:({onClose:e})=>(0,C.createElement)($i,{onClose:e})})))}function La({children:e}){return(0,C.createElement)(Zs,{supportKeys:"slug"},e)}class Ma extends P.Component{constructor({postSlug:e,postTitle:t,postID:n}){super(...arguments),this.state={editedSlug:(0,w.safeDecodeURIComponent)(e)||(0,w.cleanForSlug)(t)||n},this.setSlug=this.setSlug.bind(this)}setSlug(e){const{postSlug:t,onUpdateSlug:n}=this.props,{value:o}=e.target,s=(0,w.cleanForSlug)(o);s!==t&&n(s)}render(){const{editedSlug:e}=this.state;return(0,C.createElement)(La,null,(0,C.createElement)(Zo.TextControl,{__nextHasNoMarginBottom:!0,label:(0,d.__)("Slug"),autoComplete:"off",spellCheck:"false",value:e,onChange:e=>this.setState({editedSlug:e}),onBlur:this.setSlug,className:"editor-post-slug"}))}}const Fa=(0,No.compose)([(0,a.withSelect)((e=>{const{getCurrentPost:t,getEditedPostAttribute:n}=e(xo),{id:o}=t();return{postSlug:n("slug"),postTitle:n("title"),postID:o}})),(0,a.withDispatch)((e=>{const{editPost:t}=e(xo);return{onUpdateSlug(e){t({slug:e})}}}))])(Ma);function Va({children:e}){const{hasStickyAction:t,postType:n}=(0,a.useSelect)((e=>{var t;const n=e(xo).getCurrentPost();return{hasStickyAction:null!==(t=n._links?.["wp:action-sticky"])&&void 0!==t&&t,postType:e(xo).getCurrentPostType()}}),[]);return"post"===n&&t?e:null}function Ua(){const e=(0,a.useSelect)((e=>{var t;return null!==(t=e(xo).getEditedPostAttribute("sticky"))&&void 0!==t&&t}),[]),{editPost:t}=(0,a.useDispatch)(xo);return(0,C.createElement)(Va,null,(0,C.createElement)(Zo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,d.__)("Stick to the top of the blog"),checked:e,onChange:()=>t({sticky:!e})}))}function Ha(){const[e,t]=(0,P.useState)(!1),{editPost:n,savePost:o}=(0,a.useDispatch)(xo),{isSaving:s,isPublished:r,isScheduled:i}=(0,a.useSelect)((e=>{const{isSavingPost:t,isCurrentPostPublished:n,isCurrentPostScheduled:o}=e(xo);return{isSaving:t(),isPublished:n(),isScheduled:o()}}),[]),l=s||!r&&!i;let c;r?c=(0,d.__)("Are you sure you want to unpublish this post?"):i&&(c=(0,d.__)("Are you sure you want to unschedule this post?"));return(0,C.createElement)(C.Fragment,null,(0,C.createElement)(Zo.Button,{__next40pxDefaultSize:!0,className:"editor-post-switch-to-draft",onClick:()=>{l||t(!0)},"aria-disabled":l,variant:"secondary",style:{flexGrow:"1",justifyContent:"center"}},(0,d.__)("Switch to draft")),(0,C.createElement)(Zo.__experimentalConfirmDialog,{isOpen:e,onConfirm:()=>{t(!1),n({status:"draft"}),o()},onCancel:()=>t(!1)},c))}function za(){const{syncStatus:e,postType:t}=(0,a.useSelect)((e=>{const{getEditedPostAttribute:t}=e(xo),n=t("meta");return{syncStatus:"unsynced"===n?.wp_pattern_sync_status?"unsynced":t("wp_pattern_sync_status"),postType:t("type")}}));return"wp_block"!==t?null:(0,C.createElement)(xr,{label:(0,d.__)("Sync status")},(0,C.createElement)("div",{className:"editor-post-sync-status__value"},"unsynced"===e?(0,d._x)("Not synced","Text that indicates that the pattern is not synchronized"):(0,d._x)("Synced","Text that indicates that the pattern is synchronized")))}const Ga=e=>e;const ja=function({taxonomyWrapper:e=Ga}){const{postType:t,taxonomies:n}=(0,a.useSelect)((e=>({postType:e(xo).getCurrentPostType(),taxonomies:e(p.store).getTaxonomies({per_page:-1})})),[]);return(null!=n?n:[]).filter((e=>e.types.includes(t)&&e.visibility?.show_ui)).map((t=>{const n=t.hierarchical?fa:aa;return(0,C.createElement)(P.Fragment,{key:`taxonomy-${t.slug}`},e((0,C.createElement)(n,{slug:t.slug}),t))}))};function Wa({children:e}){const t=(0,a.useSelect)((e=>{const t=e(xo).getCurrentPostType(),n=e(p.store).getTaxonomies({per_page:-1});return n?.some((e=>e.types.includes(t)))}),[]);return t?e:null}function $a({taxonomy:e,children:t}){const n=e?.slug,o=n?`taxonomy-panel-${n}`:"",{isEnabled:s,isOpened:r}=(0,a.useSelect)((e=>{const{isEditorPanelEnabled:t,isEditorPanelOpened:s}=e(xo);return{isEnabled:!!n&&t(o),isOpened:!!n&&s(o)}}),[o,n]),{toggleEditorPanelOpened:i}=(0,a.useDispatch)(xo);if(!s)return null;const l=e?.labels?.menu_name;return l?(0,C.createElement)(Zo.PanelBody,{title:l,opened:r,onToggle:()=>i(o)},t):null}const Ka=function(){return(0,C.createElement)(Wa,null,(0,C.createElement)(ja,{taxonomyWrapper:(e,t)=>(0,C.createElement)($a,{taxonomy:t},e)}))};var Za=n(4132);function Ya(){const e=(0,No.useInstanceId)(Ya),{content:t,blocks:n,type:o,id:s}=(0,a.useSelect)((e=>{const{getEditedEntityRecord:t}=e(p.store),{getCurrentPostType:n,getCurrentPostId:o}=e(xo),s=n(),r=o(),i=t("postType",s,r);return{content:i?.content,blocks:i?.blocks,type:s,id:r}}),[]),{editEntityRecord:r}=(0,a.useDispatch)(p.store),l=(0,P.useMemo)((()=>t instanceof Function?t({blocks:n}):n?(0,i.__unstableSerializeAndClean)(n):t),[t,n]);return(0,C.createElement)(C.Fragment,null,(0,C.createElement)(Zo.VisuallyHidden,{as:"label",htmlFor:`post-content-${e}`},(0,d.__)("Type text or HTML")),(0,C.createElement)(Za.A,{autoComplete:"off",dir:"auto",value:l,onChange:e=>{r("postType",o,s,{content:e.target.value,blocks:void 0,selection:void 0})},className:"editor-post-text-editor",id:`post-content-${e}`,placeholder:(0,d.__)("Start writing with text or HTML")}))}const qa=window.wp.dom,Qa="wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text",Xa=/[\r\n]+/g;function Ja(e){const t=(0,P.useRef)(),{isCleanNewPost:n}=(0,a.useSelect)((e=>{const{isCleanNewPost:t}=e(xo);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:o,parent:s}=e,r="editor-canvas"===o?s.document:e.document,{activeElement:i,body:a}=r;!n||i&&a!==i||t.current.focus()}),[n]),{ref:t}}function el(){const{editPost:e}=(0,a.useDispatch)(xo),{title:t}=(0,a.useSelect)((e=>{const{getEditedPostAttribute:t}=e(xo);return{title:t("title")}}),[]);return{title:t,setTitle:function(t){e({title:t})}}}const tl=(0,P.forwardRef)((function(e,t){const{placeholder:n,hasFixedToolbar:o}=(0,a.useSelect)((e=>{const{getEditedPostAttribute:t}=e(xo),{getSettings:n}=e(m.store),{titlePlaceholder:o,hasFixedToolbar:s}=n();return{title:t("title"),placeholder:o,hasFixedToolbar:s}}),[]),[s,r]=(0,P.useState)(!1),{ref:l}=Ja(t),{title:c,setTitle:u}=el(),[p,g]=(0,P.useState)({}),{clearSelectedBlock:h,insertBlocks:_,insertDefaultBlock:f}=(0,a.useDispatch)(m.store);function E(e){_(e,0)}function b(){r(!1),g({})}const v=(0,Cs.decodeEntities)(n)||(0,d.__)("Add title"),{ref:y}=(0,is.__unstableUseRichText)({value:c,onChange:function(e){u(e.replace(Xa," "))},placeholder:v,selectionStart:p.start,selectionEnd:p.end,onSelectionChange(e,t){g((n=>{const{start:o,end:s}=n;return o===e&&s===t?n:{start:e,end:t}}))},__unstableDisableFormats:!1}),w=Ko()(Qa,{"is-selected":s,"has-fixed-toolbar":o});return(0,C.createElement)(Zs,{supportKeys:"title"},(0,C.createElement)("h1",{ref:(0,No.useMergeRefs)([y,l]),contentEditable:!0,className:w,"aria-label":v,role:"textbox","aria-multiline":"true",onFocus:function(){r(!0),h()},onBlur:b,onKeyDown:function(e){e.keyCode===es.ENTER&&(e.preventDefault(),f(void 0,void 0,0))},onKeyPress:b,onPaste:function(e){const t=e.clipboardData;let n="",o="";try{n=t.getData("text/plain"),o=t.getData("text/html")}catch(e){try{o=t.getData("Text")}catch(e){return}}window.console.log("Received HTML:\n\n",o),window.console.log("Received plain text:\n\n",n);const s=(0,i.pasteHandler)({HTML:o,plainText:n});if(e.preventDefault(),s.length)if("string"!=typeof s){const[e]=s;if(c||"core/heading"!==e.name&&"core/paragraph"!==e.name)E(s);else{const t=(0,qa.__unstableStripHTML)(e.attributes.content);u(t),E(s.slice(1))}}else{const e={...(0,is.create)({html:c}),...p},t=(0,qa.__unstableStripHTML)(s),n=(0,is.insert)(e,(0,is.create)({html:t}));u((0,is.toHTMLString)({value:n})),g({start:n.start,end:n.end})}}}))}));const nl=(0,P.forwardRef)((function(e,t){const{placeholder:n,hasFixedToolbar:o}=(0,a.useSelect)((e=>{const{getSettings:t}=e(m.store),{titlePlaceholder:n,hasFixedToolbar:o}=t();return{placeholder:n,hasFixedToolbar:o}}),[]),[s,r]=(0,P.useState)(!1),{title:i,setTitle:l}=el(),{ref:c}=Ja(t),u=Ko()(Qa,{"is-selected":s,"has-fixed-toolbar":o,"is-raw-text":!0}),p=(0,Cs.decodeEntities)(n)||(0,d.__)("Add title");return(0,C.createElement)(Zo.TextareaControl,{ref:c,value:i,onChange:function(e){l(e.replace(Xa," "))},onFocus:function(){r(!0)},onBlur:function(){r(!1)},label:n,className:u,placeholder:p,hideLabelFromVision:!0,autoComplete:"off",dir:"auto",rows:1,__nextHasNoMarginBottom:!0})}));function ol(){const{isNew:e,isDeleting:t,postId:n}=(0,a.useSelect)((e=>{const t=e(xo);return{isNew:t.isEditedPostNew(),isDeleting:t.isDeletingPost(),postId:t.getCurrentPostId()}}),[]),{trashPost:o}=(0,a.useDispatch)(xo),[s,r]=(0,P.useState)(!1);if(e||!n)return null;return(0,C.createElement)(C.Fragment,null,(0,C.createElement)(Zo.Button,{__next40pxDefaultSize:!0,className:"editor-post-trash",isDestructive:!0,variant:"secondary",isBusy:t,"aria-disabled":t,onClick:t?void 0:()=>r(!0)},(0,d.__)("Move to trash")),(0,C.createElement)(Zo.__experimentalConfirmDialog,{isOpen:s,onConfirm:()=>{r(!1),o()},onCancel:()=>r(!1)},(0,d.__)("Are you sure you want to move this post to the trash?")))}const sl=(0,a.withSelect)((e=>{const{isEditedPostNew:t,getCurrentPostId:n,getCurrentPostType:o}=e(xo),{getPostType:s,canUser:r}=e(p.store),i=n(),a=s(o()),l=a?.rest_base||"";return{isNew:t(),postId:i,canUserDelete:!(!i||!l)&&r("delete",l,i)}}))((function({isNew:e,postId:t,canUserDelete:n,children:o}){return!e&&t&&n?o:null}));function rl({onClose:e}){const{isEditable:t,postSlug:n,viewPostLabel:o,postLink:s,permalinkPrefix:r,permalinkSuffix:i}=(0,a.useSelect)((e=>{var t;const n=e(xo).getCurrentPost(),o=e(xo).getCurrentPostType(),s=e(p.store).getPostType(o),r=e(xo).getPermalinkParts(),i=null!==(t=n?._links?.["wp:action-publish"])&&void 0!==t&&t;return{isEditable:e(xo).isPermalinkEditable()&&i,postSlug:(0,w.safeDecodeURIComponent)(e(xo).getEditedPostSlug()),viewPostLabel:s?.labels.view_item,postLink:n.link,permalinkPrefix:r?.prefix,permalinkSuffix:r?.suffix}}),[]),{editPost:l}=(0,a.useDispatch)(xo),[c,u]=(0,P.useState)(!1);return(0,C.createElement)("div",{className:"editor-post-url"},(0,C.createElement)(m.__experimentalInspectorPopoverHeader,{title:(0,d.__)("URL"),onClose:e}),t&&(0,C.createElement)(Zo.TextControl,{__nextHasNoMarginBottom:!0,label:(0,d.__)("Permalink"),value:c?"":n,autoComplete:"off",spellCheck:"false",help:(0,C.createElement)(C.Fragment,null,(0,d.__)("The last part of the URL.")," ",(0,C.createElement)(Zo.ExternalLink,{href:(0,d.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink")},(0,d.__)("Learn more."))),onChange:e=>{l({slug:e}),e?c&&u(!1):c||u(!0)},onBlur:e=>{l({slug:(0,w.cleanForSlug)(e.target.value)}),c&&u(!1)}}),t&&(0,C.createElement)("h3",{className:"editor-post-url__link-label"},null!=o?o:(0,d.__)("View post")),(0,C.createElement)("p",null,(0,C.createElement)(Zo.ExternalLink,{className:"editor-post-url__link",href:s,target:"_blank"},t?(0,C.createElement)(C.Fragment,null,(0,C.createElement)("span",{className:"editor-post-url__link-prefix"},r),(0,C.createElement)("span",{className:"editor-post-url__link-slug"},n),(0,C.createElement)("span",{className:"editor-post-url__link-suffix"},i)):s)))}function il({children:e}){const t=(0,a.useSelect)((e=>{const t=e(xo).getCurrentPostType(),n=e(p.store).getPostType(t);if(!n?.viewable)return!1;if(!e(xo).getCurrentPost().link)return!1;return!!e(xo).getPermalinkParts()}),[]);return t?e:null}function al(){return ll()}function ll(){const e=(0,a.useSelect)((e=>e(xo).getPermalink()),[]);return(0,w.filterURLForDisplay)((0,w.safeDecodeURIComponent)(e))}function cl(){const[e,t]=(0,P.useState)(null),n=(0,P.useMemo)((()=>({anchor:e,placement:"bottom-end"})),[e]);return(0,C.createElement)(il,null,(0,C.createElement)(xr,{label:(0,d.__)("URL"),ref:t},(0,C.createElement)(Zo.Dropdown,{popoverProps:n,className:"editor-post-url__panel-dropdown",contentClassName:"editor-post-url__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,C.createElement)(ul,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,C.createElement)(rl,{onClose:e})})))}function ul({isOpen:e,onClick:t}){const n=ll();return(0,C.createElement)(Zo.Button,{__next40pxDefaultSize:!0,className:"editor-post-url__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,d.sprintf)((0,d.__)("Change URL: %s"),n),onClick:t},n)}function dl({render:e}){return e({canEdit:(0,a.useSelect)((e=>{var t;return null!==(t=e(xo).getCurrentPost()._links?.["wp:action-publish"])&&void 0!==t&&t}))})}const pl=(0,C.createElement)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,C.createElement)(T.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})),ml=window.wp.wordcount;function gl(){const e=(0,a.useSelect)((e=>e(xo).getEditedPostAttribute("content")),[]),t=(0,d._x)("words","Word count type. Do not translate!");return(0,C.createElement)("span",{className:"word-count"},(0,ml.count)(e,t))}const hl=189;function _l(){const e=(0,a.useSelect)((e=>e(xo).getEditedPostAttribute("content")),[]),t=(0,d._x)("words","Word count type. Do not translate!"),n=Math.round((0,ml.count)(e,t)/hl),o=0===n?(0,P.createInterpolateElement)((0,d.__)("<span>< 1</span> minute"),{span:(0,C.createElement)("span",null)}):(0,P.createInterpolateElement)((0,d.sprintf)((0,d._n)("<span>%d</span> minute","<span>%d</span> minutes",n),n),{span:(0,C.createElement)("span",null)});return(0,C.createElement)("span",{className:"time-to-read"},o)}function fl(){const e=(0,a.useSelect)((e=>e(xo).getEditedPostAttribute("content")),[]);return(0,ml.count)(e,"characters_including_spaces")}const El=function({hasOutlineItemsDisabled:e,onRequestClose:t}){const{headingCount:n,paragraphCount:o,numberOfBlocks:s}=(0,a.useSelect)((e=>{const{getGlobalBlockCount:t}=e(m.store);return{headingCount:t("core/heading"),paragraphCount:t("core/paragraph"),numberOfBlocks:t()}}),[]);return(0,C.createElement)(C.Fragment,null,(0,C.createElement)("div",{className:"table-of-contents__wrapper",role:"note","aria-label":(0,d.__)("Document Statistics"),tabIndex:"0"},(0,C.createElement)("ul",{role:"list",className:"table-of-contents__counts"},(0,C.createElement)("li",{className:"table-of-contents__count"},(0,d.__)("Words"),(0,C.createElement)(gl,null)),(0,C.createElement)("li",{className:"table-of-contents__count"},(0,d.__)("Characters"),(0,C.createElement)("span",{className:"table-of-contents__number"},(0,C.createElement)(fl,null))),(0,C.createElement)("li",{className:"table-of-contents__count"},(0,d.__)("Time to read"),(0,C.createElement)(_l,null)),(0,C.createElement)("li",{className:"table-of-contents__count"},(0,d.__)("Headings"),(0,C.createElement)("span",{className:"table-of-contents__number"},n)),(0,C.createElement)("li",{className:"table-of-contents__count"},(0,d.__)("Paragraphs"),(0,C.createElement)("span",{className:"table-of-contents__number"},o)),(0,C.createElement)("li",{className:"table-of-contents__count"},(0,d.__)("Blocks"),(0,C.createElement)("span",{className:"table-of-contents__number"},s)))),n>0&&(0,C.createElement)(C.Fragment,null,(0,C.createElement)("hr",null),(0,C.createElement)("h2",{className:"table-of-contents__title"},(0,d.__)("Document Outline")),(0,C.createElement)(hs,{onSelect:t,hasOutlineItemsDisabled:e})))};const bl=(0,P.forwardRef)((function({hasOutlineItemsDisabled:e,repositionDropdown:t,...n},o){const s=(0,a.useSelect)((e=>!!e(m.store).getBlockCount()),[]);return(0,C.createElement)(Zo.Dropdown,{popoverProps:{placement:t?"right":"bottom"},className:"table-of-contents",contentClassName:"table-of-contents__popover",renderToggle:({isOpen:e,onToggle:t})=>(0,C.createElement)(Zo.Button,{...n,ref:o,onClick:s?t:void 0,icon:pl,"aria-expanded":e,"aria-haspopup":"true",label:(0,d.__)("Details"),tooltipPosition:"bottom","aria-disabled":!s}),renderContent:({onClose:t})=>(0,C.createElement)(El,{onRequestClose:t,hasOutlineItemsDisabled:e})})}));function vl(){const{__experimentalGetDirtyEntityRecords:e}=(0,a.useSelect)(p.store);return(0,P.useEffect)((()=>{const t=t=>{if(e().length>0)return t.returnValue=(0,d.__)("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 yl=(0,No.createHigherOrderComponent)((e=>(0,a.withRegistry)((t=>{const{useSubRegistry:n=!0,registry:o,...s}=t;if(!n)return(0,C.createElement)(e,{...s});const[r,i]=(0,P.useState)(null);return(0,P.useEffect)((()=>{const e=(0,a.createRegistry)({"core/block-editor":m.storeConfig},o);e.registerStore("core/editor",To),i(e)}),[o]),r?(0,C.createElement)(a.RegistryProvider,{value:r},(0,C.createElement)(e,{...s})):null}))),"withRegistryProvider"),wl=(e,t)=>`<a ${kl(e)}>${t}</a>`,kl=e=>`href="${e}" target="_blank" rel="noreferrer noopener"`,Sl=e=>{const{title:t,foreign_landing_url:n,creator:o,creator_url:s,license:r,license_version:i,license_url:a}=e,l=((e,t)=>{let n=e.trim();return"pdm"!==e&&(n=e.toUpperCase().replace("SAMPLING","Sampling")),t&&(n+=` ${t}`),["pdm","cc0"].includes(e)||(n=`CC ${n}`),n})(r,i),c=(0,Cs.decodeEntities)(o);let u;return u=c?t?(0,d.sprintf)((0,d._x)('"%1$s" by %2$s/ %3$s',"caption"),wl(n,(0,Cs.decodeEntities)(t)),s?wl(s,c):c,a?wl(`${a}?ref=openverse`,l):l):(0,d.sprintf)((0,d._x)("<a %1$s>Work</a> by %2$s/ %3$s","caption"),kl(n),s?wl(s,c):c,a?wl(`${a}?ref=openverse`,l):l):t?(0,d.sprintf)((0,d._x)('"%1$s"/ %2$s',"caption"),wl(n,(0,Cs.decodeEntities)(t)),a?wl(`${a}?ref=openverse`,l):l):(0,d.sprintf)((0,d._x)("<a %1$s>Work</a>/ %2$s","caption"),kl(n),a?wl(`${a}?ref=openverse`,l):l),u.replace(/\s{2}/g," ")},Pl=async(e={})=>(await(0,a.resolveSelect)(p.store).getMediaItems({...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}))),Cl=[{name:"images",labels:{name:(0,d.__)("Images"),search_items:(0,d.__)("Search images")},mediaType:"image",fetch:async(e={})=>Pl({...e,media_type:"image"})},{name:"videos",labels:{name:(0,d.__)("Videos"),search_items:(0,d.__)("Search videos")},mediaType:"video",fetch:async(e={})=>Pl({...e,media_type:"video"})},{name:"audio",labels:{name:(0,d.__)("Audio"),search_items:(0,d.__)("Search audio")},mediaType:"audio",fetch:async(e={})=>Pl({...e,media_type:"audio"})},{name:"openverse",labels:{name:(0,d.__)("Openverse"),search_items:(0,d.__)("Search Openverse")},mediaType:"image",async fetch(e={}){const t={...e,mature:!1,excluded_source:"flickr,inaturalist,wikimedia",license:"pdm,cc0"},n={per_page:"page_size",search:"q"},o=new URL("https://api.openverse.engineering/v1/images/");Object.entries(t).forEach((([e,t])=>{const s=n[e]||e;o.searchParams.set(s,t)}));const s=await window.fetch(o,{headers:{"User-Agent":"WordPress/inserter-media-fetch"}});return(await s.json()).results.map((e=>({...e,title:e.title?.toLowerCase().startsWith("file:")?e.title.slice(5):e.title,sourceId:e.id,id:void 0,caption:Sl(e),previewUrl:e.thumbnail})))},getReportUrl:({sourceId:e})=>`https://wordpress.org/openverse/image/${e}/report/`,isExternalResource:!0}],Tl=window.wp.mediaUtils,xl=()=>{};function Bl({additionalData:e={},allowedTypes:t,filesList:n,maxUploadFileSize:o,onError:s=xl,onFileChange:r}){const{getCurrentPost:i,getEditorSettings:l}=(0,a.select)(xo),c=l().allowedMimeTypes;o=o||l().maxUploadFileSize;const u=i(),d="number"==typeof u?.id?u.id:u?.wp_id,p=d?{post:d}:{};(0,Tl.uploadMedia)({allowedTypes:t,filesList:n,onFileChange:r,additionalData:{...p,...e},maxUploadFileSize:o,onError:({message:e})=>s(e),wpAllowedMimeTypes:c})}const Il=[],Nl=["__experimentalBlockDirectory","__experimentalDiscussionSettings","__experimentalFeatures","__experimentalGlobalStylesBaseStyles","__experimentalPreferredStyleVariations","__unstableGalleryWithImageBlocks","alignWide","blockInspectorTabs","allowedMimeTypes","bodyPlaceholder","canLockBlocks","capabilities","clearBlockSelection","codeEditingEnabled","colors","disableCustomColors","disableCustomFontSizes","disableCustomSpacingSizes","disableCustomGradients","disableLayoutStyles","enableCustomLineHeight","enableCustomSpacing","enableCustomUnits","enableOpenverseMediaCategory","fontSizes","gradients","generateAnchors","onNavigateToEntityRecord","hasInlineToolbar","imageDefaultSize","imageDimensions","imageEditing","imageSizes","isRTL","locale","maxWidth","onUpdateDefaultBlockStyles","postContentAttributes","postsPerPage","readOnly","styles","titlePlaceholder","supportsLayout","widgetTypesToHideFromLegacyWidgetBlock","__unstableHasCustomAppender","__unstableIsPreviewMode","__unstableResolvedAssets","__unstableIsBlockBasedTheme","__experimentalArchiveTitleTypeLabel","__experimentalArchiveTitleNameLabel"];const Dl=function(e,t,n){var o,s;const r=(0,No.useViewportMatch)("medium"),{allowRightClickOverrides:l,blockTypes:c,focusMode:g,hasFixedToolbar:h,isDistractionFree:_,keepCaretInsideBlock:f,reusableBlocks:E,hasUploadPermissions:b,hiddenBlockTypes:v,canUseUnfilteredHTML:y,userCanCreatePages:w,pageOnFront:k,pageForPosts:S,userPatternCategories:C,restBlockPatternCategories:T}=(0,a.useSelect)((e=>{var o;const s="web"===P.Platform.OS,{canUser:a,getRawEntityRecord:l,getEntityRecord:c,getUserPatternCategories:u,getEntityRecords:d,getBlockPatternCategories:m}=e(p.store),{get:g}=e(B.store),{getBlockTypes:h}=e(i.store),_=a("read","settings")?c("root","site"):void 0;return{allowRightClickOverrides:g("core","allowRightClickOverrides"),blockTypes:h(),canUseUnfilteredHTML:l("postType",t,n)?._links?.hasOwnProperty("wp:action-unfiltered-html"),focusMode:g("core","focusMode"),hasFixedToolbar:g("core","fixedToolbar")||!r,hiddenBlockTypes:g("core","hiddenBlockTypes"),isDistractionFree:g("core","distractionFree"),keepCaretInsideBlock:g("core","keepCaretInsideBlock"),reusableBlocks:s?d("postType","wp_block",{per_page:-1}):Il,hasUploadPermissions:null===(o=a("create","media"))||void 0===o||o,userCanCreatePages:a("create","pages"),pageOnFront:_?.page_on_front,pageForPosts:_?.page_for_posts,userPatternCategories:u(),restBlockPatternCategories:m()}}),[t,n,r]),x=null!==(o=e.__experimentalAdditionalBlockPatterns)&&void 0!==o?o:e.__experimentalBlockPatterns,I=null!==(s=e.__experimentalAdditionalBlockPatternCategories)&&void 0!==s?s:e.__experimentalBlockPatternCategories,N=(0,P.useMemo)((()=>[...x||[]].filter((({postTypes:e})=>!e||Array.isArray(e)&&e.includes(t)))),[x,t]),D=(0,P.useMemo)((()=>[...I||[],...T||[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name))))),[I,T]),{undo:A,setIsInserterOpened:R}=(0,a.useDispatch)(xo),{saveEntityRecord:O}=(0,a.useDispatch)(p.store),L=(0,P.useCallback)((e=>w?O("postType","page",e):Promise.reject({message:(0,d.__)("You do not have permission to create Pages.")})),[O,w]),M=(0,P.useMemo)((()=>{if(v&&v.length>0){return(!0===e.allowedBlockTypes?c.map((({name:e})=>e)):e.allowedBlockTypes||[]).filter((e=>!v.includes(e)))}return e.allowedBlockTypes}),[e.allowedBlockTypes,v,c]),F=!1===e.focusMode;return(0,P.useMemo)((()=>({...Object.fromEntries(Object.entries(e).filter((([e])=>Nl.includes(e)))),allowedBlockTypes:M,allowRightClickOverrides:l,focusMode:g&&!F,hasFixedToolbar:h,isDistractionFree:_,keepCaretInsideBlock:f,mediaUpload:b?Bl:void 0,__experimentalBlockPatterns:N,[u(m.privateApis).selectBlockPatternsKey]:e=>u(e(p.store)).getBlockPatternsForPostType(t),__experimentalReusableBlocks:E,__experimentalBlockPatternCategories:D,__experimentalUserPatternCategories:C,__experimentalFetchLinkSuggestions:(t,n)=>(0,p.__experimentalFetchLinkSuggestions)(t,n,e),inserterMediaCategories:Cl,__experimentalFetchRichUrlData:p.__experimentalFetchUrlData,__experimentalCanUserUseUnfilteredHTML:y,__experimentalUndo:A,outlineMode:"wp_template"===t,__experimentalCreatePageEntity:L,__experimentalUserCanCreatePages:w,pageOnFront:k,pageForPosts:S,__experimentalPreferPatternsOnRoot:"wp_template"===t,templateLock:"wp_navigation"===t?"insert":e.templateLock,template:"wp_navigation"===t?[["core/navigation",{},[]]]:e.template,__experimentalSetIsInserterOpened:R})),[M,l,g,F,h,_,f,e,b,E,C,N,D,y,A,L,w,k,S,t,R])},Al=["core/post-title","core/post-featured-image","core/post-content"];function Rl(){!function(){const e=(0,a.useSelect)((e=>{const{getBlocksByName:t,getBlockParents:n,getBlockName:o}=e(m.store);return t(Al).filter((e=>n(e).every((e=>{const t=o(e);return"core/query"!==t&&!Al.includes(t)}))))}),[]),{setBlockEditingMode:t,unsetBlockEditingMode:n}=(0,a.useDispatch)(m.store);(0,P.useEffect)((()=>{t("","disabled");for(const n of e)t(n,"contentOnly");return()=>{n("");for(const t of e)n(t)}}),[e,t,n])}()}function Ol(){const e=(0,a.useSelect)((e=>e(m.store).getBlockOrder()?.[0]),[]),{setBlockEditingMode:t,unsetBlockEditingMode:n}=(0,a.useDispatch)(m.store);(0,P.useEffect)((()=>{if(e)return t(e,"contentOnly"),()=>{n(e)}}),[e,n,t])}const{ExperimentalBlockEditorProvider:Ll}=u(m.privateApis),{PatternsMenuItems:Ml}=u(Ro.privateApis),Fl=()=>{},Vl=["wp_block","wp_template","wp_navigation","wp_template_part"];const Ul=yl((({post:e,settings:t,recovery:n,initialEdits:o,children:s,BlockEditorProviderComponent:r=Ll,__unstableTemplate:l})=>{const c=(0,a.useSelect)((e=>e(xo).getRenderingMode()),[]),g=!!l&&"post-only"!==c,h=g?l:e,_=(0,P.useMemo)((()=>({...!Vl.includes(h.type)||g?{postId:e.id,postType:e.type}:{},templateSlug:"wp_template"===h.type?h.slug:void 0})),[g,e.id,e.type,h.type,h.slug]),{editorSettings:f,selection:E,isReady:b}=(0,a.useSelect)((e=>{const{getEditorSettings:t,getEditorSelection:n,__unstableIsEditorReady:o}=e(xo);return{editorSettings:t(),isReady:o(),selection:n()}}),[]),{id:v,type:y}=h,w=Dl(f,y,v),[k,S,T]=function(e,t,n){const o="post-only"!==n&&t?"template":"post",[s,r,a]=(0,p.useEntityBlockEditor)("postType",e.type,{id:e.id}),[l,c,u]=(0,p.useEntityBlockEditor)("postType",t?.type,{id:t?.id}),d=(0,P.useMemo)((()=>{if("wp_navigation"===e.type)return[(0,i.createBlock)("core/navigation",{ref:e.id,templateLock:!1})]}),[e.type,e.id]),m=(0,P.useMemo)((()=>d||("template"===o?l:s)),[d,o,l,s]);return t&&"template-locked"===n||"wp_navigation"===e.type?[m,Fl,Fl]:[m,"post"===o?r:c,"post"===o?a:u]}(e,l,c),{updatePostLock:x,setupEditor:B,updateEditorSettings:I,setCurrentTemplateId:N,setEditedPost:D,setRenderingMode:A}=u((0,a.useDispatch)(xo)),{createWarningNotice:R}=(0,a.useDispatch)(rn.store);return(0,P.useLayoutEffect)((()=>{n||(x(t.postLock),B(e,o,t.template),t.autosave&&R((0,d.__)("There is an autosave of this post that is more recent than the version below."),{id:"autosave-exists",actions:[{label:(0,d.__)("View the autosave"),url:t.autosave.editLink}]}))}),[]),(0,P.useEffect)((()=>{D(e.type,e.id)}),[e.type,e.id,D]),(0,P.useEffect)((()=>{I(t)}),[t,I]),(0,P.useEffect)((()=>{N(l?.id)}),[l?.id,N]),(0,P.useEffect)((()=>{var e;A(null!==(e=t.defaultRenderingMode)&&void 0!==e?e:"post-only")}),[t.defaultRenderingMode,A]),b?(0,C.createElement)(p.EntityProvider,{kind:"root",type:"site"},(0,C.createElement)(p.EntityProvider,{kind:"postType",type:e.type,id:e.id},(0,C.createElement)(m.BlockContextProvider,{value:_},(0,C.createElement)(r,{value:k,onChange:T,onInput:S,selection:E,settings:w,useSubRegistry:!1},s,(0,C.createElement)(Ml,null),"template-locked"===c&&(0,C.createElement)(Rl,null),"wp_navigation"===y&&(0,C.createElement)(Ol,null))))):null}));const Hl=function(e){return(0,C.createElement)(Ul,{...e,BlockEditorProviderComponent:m.BlockEditorProvider},e.children)},zl=window.wp.serverSideRender;var Gl=n.n(zl);function jl(e,t,n=[]){const o=(0,P.forwardRef)(((n,o)=>(S()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),(0,C.createElement)(t,{ref:o,...n}))));return n.forEach((n=>{o[n]=jl(e+"."+n,t[n])})),o}function Wl(e,t){return(...n)=>(S()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),t(...n))}const $l=jl("RichText",m.RichText,["Content"]);$l.isEmpty=Wl("RichText.isEmpty",m.RichText.isEmpty);const Kl=jl("Autocomplete",m.Autocomplete),Zl=jl("AlignmentToolbar",m.AlignmentToolbar),Yl=jl("BlockAlignmentToolbar",m.BlockAlignmentToolbar),ql=jl("BlockControls",m.BlockControls,["Slot"]),Ql=jl("BlockEdit",m.BlockEdit),Xl=jl("BlockEditorKeyboardShortcuts",m.BlockEditorKeyboardShortcuts),Jl=jl("BlockFormatControls",m.BlockFormatControls,["Slot"]),ec=jl("BlockIcon",m.BlockIcon),tc=jl("BlockInspector",m.BlockInspector),nc=jl("BlockList",m.BlockList),oc=jl("BlockMover",m.BlockMover),sc=jl("BlockNavigationDropdown",m.BlockNavigationDropdown),rc=jl("BlockSelectionClearer",m.BlockSelectionClearer),ic=jl("BlockSettingsMenu",m.BlockSettingsMenu),ac=jl("BlockTitle",m.BlockTitle),lc=jl("BlockToolbar",m.BlockToolbar),cc=jl("ColorPalette",m.ColorPalette),uc=jl("ContrastChecker",m.ContrastChecker),dc=jl("CopyHandler",m.CopyHandler),pc=jl("DefaultBlockAppender",m.DefaultBlockAppender),mc=jl("FontSizePicker",m.FontSizePicker),gc=jl("Inserter",m.Inserter),hc=jl("InnerBlocks",m.InnerBlocks,["ButtonBlockAppender","DefaultBlockAppender","Content"]),_c=jl("InspectorAdvancedControls",m.InspectorAdvancedControls,["Slot"]),fc=jl("InspectorControls",m.InspectorControls,["Slot"]),Ec=jl("PanelColorSettings",m.PanelColorSettings),bc=jl("PlainText",m.PlainText),vc=jl("RichTextShortcut",m.RichTextShortcut),yc=jl("RichTextToolbarButton",m.RichTextToolbarButton),wc=jl("__unstableRichTextInputEvent",m.__unstableRichTextInputEvent),kc=jl("MediaPlaceholder",m.MediaPlaceholder),Sc=jl("MediaUpload",m.MediaUpload),Pc=jl("MediaUploadCheck",m.MediaUploadCheck),Cc=jl("MultiSelectScrollIntoView",m.MultiSelectScrollIntoView),Tc=jl("NavigableToolbar",m.NavigableToolbar),xc=jl("ObserveTyping",m.ObserveTyping),Bc=jl("SkipToSelectedBlock",m.SkipToSelectedBlock),Ic=jl("URLInput",m.URLInput),Nc=jl("URLInputButton",m.URLInputButton),Dc=jl("URLPopover",m.URLPopover),Ac=jl("Warning",m.Warning),Rc=jl("WritingFlow",m.WritingFlow),Oc=Wl("createCustomColorsHOC",m.createCustomColorsHOC),Lc=Wl("getColorClassName",m.getColorClassName),Mc=Wl("getColorObjectByAttributeValues",m.getColorObjectByAttributeValues),Fc=Wl("getColorObjectByColorValue",m.getColorObjectByColorValue),Vc=Wl("getFontSize",m.getFontSize),Uc=Wl("getFontSizeClass",m.getFontSizeClass),Hc=Wl("withColorContext",m.withColorContext),zc=Wl("withColors",m.withColors),Gc=Wl("withFontSizes",m.withFontSizes),jc=Go,Wc=Go;function $c(e){return S()("wp.editor.cleanForSlug",{since:"12.7",plugin:"Gutenberg",alternative:"wp.url.cleanForSlug"}),(0,w.cleanForSlug)(e)}function Kc({contentRef:e}){const{onNavigateToEntityRecord:t,templateId:n}=(0,a.useSelect)((e=>{const{getEditorSettings:t,getCurrentTemplateId:n}=e(xo);return{onNavigateToEntityRecord:t().onNavigateToEntityRecord,templateId:n()}}),[]),{getNotices:o}=(0,a.useSelect)(rn.store),{createInfoNotice:s,removeNotice:r}=(0,a.useDispatch)(rn.store),[i,l]=(0,P.useState)(!1),c=(0,P.useRef)(0);return(0,P.useEffect)((()=>{const i=async e=>{if(!e.target.classList.contains("is-root-container"))return;const r=o().some((e=>e.id===c.current));if(r)return;const{notice:i}=await s((0,d.__)("Edit your template to edit this block."),{isDismissible:!0,type:"snackbar",actions:[{label:(0,d.__)("Edit template"),onClick:()=>t({postId:n,postType:"wp_template"})}]});c.current=i.id},a=e=>{e.target.classList.contains("is-root-container")&&(c.current&&r(c.current),l(!0))},u=e.current;return u?.addEventListener("click",i),u?.addEventListener("dblclick",a),()=>{u?.removeEventListener("click",i),u?.removeEventListener("dblclick",a)}}),[c,e,o,s,t,n,r]),(0,C.createElement)(Zo.__experimentalConfirmDialog,{isOpen:i,confirmButtonText:(0,d.__)("Edit template"),onConfirm:()=>{l(!1),t({postId:n,postType:"wp_template"})},onCancel:()=>l(!1)},(0,d.__)("Edit your template to edit this block."))}const{LayoutStyle:Zc,useLayoutClasses:Yc,useLayoutStyles:qc,ExperimentalBlockCanvas:Qc,useFlashEditableBlocks:Xc}=u(m.privateApis),Jc=()=>{},eu=["wp_block","wp_template","wp_navigation","wp_template_part"];function tu(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 n=tu(e[t].innerBlocks);if(n)return n}}}function nu(e){for(let t=0;t<e.length;t++)if("core/post-content"===e[t].name)return!0;return!1}const ou=function({autoFocus:e,className:t,renderAppender:n,styles:o,disableIframe:s=!1,iframeProps:r,children:l}){const{renderingMode:c,postContentAttributes:u,editedPostTemplate:d={},wrapperBlockName:g,wrapperUniqueId:h,deviceType:_,showEditorPadding:f,isDesignPostType:E}=(0,a.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:n,getCurrentTemplateId:o,getEditorSettings:s,getRenderingMode:r,getDeviceType:i}=e(xo),{getPostType:a,canUser:l,getEditedEntityRecord:c}=e(p.store),u=n(),d=r();let m;"wp_block"===u?m="core/block":"post-only"===d&&(m="core/post-content");const g=s(),h=g.supportsTemplateMode,_=a(u),f=l("create","templates"),E=o(),b=E?c("postType","wp_template",E):void 0;return{renderingMode:d,postContentAttributes:g.postContentAttributes,isDesignPostType:eu.includes(u),editedPostTemplate:_?.viewable&&h&&f?b:void 0,wrapperBlockName:m,wrapperUniqueId:t(),deviceType:i(),showEditorPadding:!!g.onNavigateToPreviousEntityRecord}}),[]),{isCleanNewPost:b}=(0,a.useSelect)(xo),{hasRootPaddingAwareAlignments:v,themeHasDisabledLayoutStyles:y,themeSupportsLayout:w}=(0,a.useSelect)((e=>{const t=e(m.store).getSettings();return{themeHasDisabledLayoutStyles:t.disableLayoutStyles,themeSupportsLayout:t.supportsLayout,hasRootPaddingAwareAlignments:t.__experimentalFeatures?.useRootPaddingAwareAlignments}}),[]),k=(0,m.__experimentalUseResizeCanvas)(_),[S]=(0,m.useSettings)("layout"),T=(0,P.useMemo)((()=>"post-only"!==c||E?{type:"default"}:w?{...S,type:"constrained"}:{type:"default"}),[c,w,S,E]),x=(0,P.useMemo)((()=>{if(!d?.content&&!d?.blocks&&u)return u;if(d?.blocks)return tu(d?.blocks);const e="string"==typeof d?.content?d?.content:"";return tu((0,i.parse)(e))||{}}),[d?.content,d?.blocks,u]),B=(0,P.useMemo)((()=>{if(!d?.content&&!d?.blocks)return!1;if(d?.blocks)return nu(d?.blocks);const e="string"==typeof d?.content?d?.content:"";return nu((0,i.parse)(e))||!1}),[d?.content,d?.blocks]),{layout:I={},align:N=""}=x||{},D=Yc(x,"core/post-content"),A=Ko()({"is-layout-flow":!w},w&&D,N&&`align${N}`),R=qc(x,"core/post-content",".block-editor-block-list__layout.is-root-container"),O=(0,P.useMemo)((()=>I&&("constrained"===I?.type||I?.inherit||I?.contentSize||I?.wideSize)?{...S,...I,type:"constrained"}:{...S,...I,type:"default"}),[I?.type,I?.inherit,I?.contentSize,I?.wideSize,S]),L=u?O:T,M="default"!==L?.type||B?L:T,F=(0,m.__unstableUseTypingObserver)(),V=(0,P.useRef)();(0,P.useEffect)((()=>{e&&b()&&V?.current?.focus()}),[e,b]);const U=(0,P.useRef)(),H=(0,m.__unstableUseTypewriter)(),z=(0,No.useMergeRefs)([U,"post-only"===c?H:Jc,Xc({isEnabled:"template-locked"===c})]);return(0,C.createElement)(Qc,{shouldIframe:!s||["Tablet","Mobile"].includes(_),contentRef:z,styles:o,height:"100%",iframeProps:{className:Ko()("editor-canvas__iframe",{"has-editor-padding":f}),...r,style:{...r?.style,...k}}},w&&!y&&"post-only"===c&&!E&&(0,C.createElement)(C.Fragment,null,(0,C.createElement)(Zc,{selector:".editor-editor-canvas__post-title-wrapper",layout:T}),(0,C.createElement)(Zc,{selector:".block-editor-block-list__layout.is-root-container",layout:M}),N&&(0,C.createElement)(Zc,{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;}"}),R&&(0,C.createElement)(Zc,{layout:O,css:R})),"post-only"===c&&!E&&(0,C.createElement)("div",{className:Ko()("editor-editor-canvas__post-title-wrapper","edit-post-visual-editor__post-title-wrapper",{"has-global-padding":v}),contentEditable:!1,ref:F,style:{marginTop:"4rem"}},(0,C.createElement)(tl,{ref:V})),(0,C.createElement)(m.RecursionProvider,{blockName:g,uniqueId:h},(0,C.createElement)(m.BlockList,{className:Ko()(t,"is-"+_.toLowerCase()+"-preview","post-only"!==c||E?"wp-site-blocks":`${A} wp-block-post-content`),layout:L,dropZoneElement:s?U.current:U.current?.parentNode,renderAppender:n,__unstableDisableDropZone:"template-locked"===c}),"template-locked"===c&&(0,C.createElement)(Kc,{contentRef:U})),l)},{PreferenceBaseOption:su}=u(B.privateApis),ru=(0,No.compose)((0,a.withSelect)(((e,{panelName:t})=>{const{isEditorPanelEnabled:n,isEditorPanelRemoved:o}=e(xo);return{isRemoved:o(t),isChecked:n(t)}})),(0,No.ifCondition)((({isRemoved:e})=>!e)),(0,a.withDispatch)(((e,{panelName:t})=>({onChange:()=>e(xo).toggleEditorPanelEnabled(t)}))))(su),{Fill:iu,Slot:au}=(0,Zo.createSlotFill)("EnablePluginDocumentSettingPanelOption"),lu=({label:e,panelName:t})=>(0,C.createElement)(iu,null,(0,C.createElement)(ru,{label:e,panelName:t}));lu.Slot=au;const cu=lu,uu=(0,C.createElement)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,C.createElement)(T.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})),du=(0,C.createElement)(T.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,C.createElement)(T.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})),{useCanBlockToolbarBeFocused:pu}=u(m.privateApis),mu=e=>{e.preventDefault()};const gu=function({className:e,disableBlockTools:t=!1,children:n,listViewLabel:o=(0,d.__)("Document Overview")}){const s=(0,P.useRef)(),{setIsInserterOpened:r,setIsListViewOpened:i}=(0,a.useDispatch)(xo),{isDistractionFree:l,isInserterOpened:c,isListViewOpen:p,listViewShortcut:g,listViewToggleRef:h,hasFixedToolbar:_,showIconLabels:f}=(0,a.useSelect)((e=>{const{getSettings:t}=e(m.store),{get:n}=e(B.store),{isListViewOpened:o,getListViewToggleRef:s}=u(e(xo)),{getShortcutRepresentation:r}=e(zo.store);return{isInserterOpened:e(xo).isInserterOpened(),isListViewOpen:o(),listViewShortcut:r("core/editor/toggle-list-view"),listViewToggleRef:s(),hasFixedToolbar:t().hasFixedToolbar,showIconLabels:n("core","showIconLabels"),isDistractionFree:n("core","distractionFree")}}),[]),E=(0,No.useViewportMatch)("medium"),b=(0,No.useViewportMatch)("wide"),v=pu(),y=(0,d.__)("Document tools"),w=(0,P.useCallback)((()=>i(!p)),[i,p]),k=(0,P.useCallback)((()=>{c?(s.current.focus(),r(!1)):r(!0)}),[c,r]),S=(0,d._x)("Toggle block inserter","Generic label for block inserter button"),T=c?(0,d.__)("Close"):(0,d.__)("Add");return(0,C.createElement)(m.NavigableToolbar,{className:Ko()("editor-document-tools","edit-post-header-toolbar",e),"aria-label":y,shouldUseKeyboardFocusShortcut:!v,variant:"unstyled"},(0,C.createElement)("div",{className:"editor-document-tools__left"},!l&&(0,C.createElement)(Zo.ToolbarItem,{ref:s,as:Zo.Button,className:"editor-document-tools__inserter-toggle",variant:"primary",isPressed:c,onMouseDown:mu,onClick:k,disabled:t,icon:uu,label:f?T:S,showTooltip:!f,"aria-expanded":c}),(b||!f)&&(0,C.createElement)(C.Fragment,null,E&&!_&&(0,C.createElement)(Zo.ToolbarItem,{as:m.ToolSelector,showTooltip:!f,variant:f?"tertiary":void 0,disabled:t,size:"compact"}),(0,C.createElement)(Zo.ToolbarItem,{as:ys,showTooltip:!f,variant:f?"tertiary":void 0,size:"compact"}),(0,C.createElement)(Zo.ToolbarItem,{as:vs,showTooltip:!f,variant:f?"tertiary":void 0,size:"compact"}),!l&&(0,C.createElement)(Zo.ToolbarItem,{as:Zo.Button,className:"editor-document-tools__document-overview-toggle",icon:du,disabled:t,isPressed:p,label:o,onClick:w,shortcut:g,showTooltip:!f,variant:f?"tertiary":void 0,"aria-expanded":p,ref:h,size:"compact"})),n))},hu=(0,C.createElement)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,C.createElement)(T.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));function _u(){return(0,C.createElement)(C.Fragment,null,(0,C.createElement)("div",{className:"editor-list-view-sidebar__outline"},(0,C.createElement)("div",null,(0,C.createElement)(Zo.__experimentalText,null,(0,d.__)("Characters:")),(0,C.createElement)(Zo.__experimentalText,null,(0,C.createElement)(fl,null))),(0,C.createElement)("div",null,(0,C.createElement)(Zo.__experimentalText,null,(0,d.__)("Words:")),(0,C.createElement)(gl,null)),(0,C.createElement)("div",null,(0,C.createElement)(Zo.__experimentalText,null,(0,d.__)("Time to read:")),(0,C.createElement)(_l,null))),(0,C.createElement)(hs,null))}const{Tabs:fu}=u(Zo.privateApis);const Eu=(0,C.createElement)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,C.createElement)(T.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"}));const bu=(0,C.createElement)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,C.createElement)(T.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"})),vu=(0,C.createElement)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,C.createElement)(T.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"})),yu=(0,C.createElement)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,C.createElement)(T.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"}));const wu=function({blockTypes:e,value:t,onItemChange:n}){return(0,C.createElement)("ul",{className:"editor-block-manager__checklist"},e.map((e=>(0,C.createElement)("li",{key:e.name,className:"editor-block-manager__checklist-item"},(0,C.createElement)(Zo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:e.title,checked:t.includes(e.name),onChange:(...t)=>n(e.name,...t)}),(0,C.createElement)(m.BlockIcon,{icon:e.icon})))))};const ku=function e({title:t,blockTypes:n}){const o=(0,No.useInstanceId)(e),{allowedBlockTypes:s,hiddenBlockTypes:r}=(0,a.useSelect)((e=>{const{getEditorSettings:t}=e(xo),{get:n}=e(B.store);return{allowedBlockTypes:t().allowedBlockTypes,hiddenBlockTypes:n("core","hiddenBlockTypes")}}),[]),i=(0,P.useMemo)((()=>!0===s?n:n.filter((({name:e})=>s?.includes(e)))),[s,n]),{showBlockTypes:l,hideBlockTypes:c}=u((0,a.useDispatch)(xo)),d=(0,P.useCallback)(((e,t)=>{t?l(e):c(e)}),[l,c]),p=(0,P.useCallback)((e=>{const t=n.map((({name:e})=>e));e?l(t):c(t)}),[n,l,c]);if(!i.length)return null;const m=i.map((({name:e})=>e)).filter((e=>!(null!=r?r:[]).includes(e))),g="editor-block-manager__category-title-"+o,h=m.length===i.length,_=!h&&m.length>0;return(0,C.createElement)("div",{role:"group","aria-labelledby":g,className:"editor-block-manager__category"},(0,C.createElement)(Zo.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:h,onChange:p,className:"editor-block-manager__category-title",indeterminate:_,label:(0,C.createElement)("span",{id:g},t)}),(0,C.createElement)(wu,{blockTypes:i,value:m,onItemChange:d}))};const Su=(0,No.compose)([(0,a.withSelect)((e=>{var t;const{getBlockTypes:n,getCategories:o,hasBlockSupport:s,isMatchingSearchTerm:r}=e(i.store),{get:a}=e(B.store),l=n(),c=(null!==(t=a("core","hiddenBlockTypes"))&&void 0!==t?t:[]).filter((e=>l.some((t=>t.name===e)))),u=Array.isArray(c)&&c.length;return{blockTypes:l,categories:o(),hasBlockSupport:s,isMatchingSearchTerm:r,numberOfHiddenBlocks:u}})),(0,a.withDispatch)((e=>{const{showBlockTypes:t}=u(e(xo));return{enableAllBlockTypes:e=>{const n=e.map((({name:e})=>e));t(n)}}}))])((function({blockTypes:e,categories:t,hasBlockSupport:n,isMatchingSearchTerm:o,numberOfHiddenBlocks:s,enableAllBlockTypes:r}){const i=(0,No.useDebounce)(Qi.speak,500),[a,l]=(0,P.useState)("");return e=e.filter((e=>n(e,"inserter",!0)&&(!a||o(e,a))&&(!e.parent||e.parent.includes("core/post-content")))),(0,P.useEffect)((()=>{if(!a)return;const t=e.length,n=(0,d.sprintf)((0,d._n)("%d result found.","%d results found.",t),t);i(n)}),[e.length,a,i]),(0,C.createElement)("div",{className:"editor-block-manager__content"},!!s&&(0,C.createElement)("div",{className:"editor-block-manager__disabled-blocks-count"},(0,d.sprintf)((0,d._n)("%d block is hidden.","%d blocks are hidden.",s),s),(0,C.createElement)(Zo.Button,{variant:"link",onClick:()=>r(e)},(0,d.__)("Reset"))),(0,C.createElement)(Zo.SearchControl,{__nextHasNoMarginBottom:!0,label:(0,d.__)("Search for a block"),placeholder:(0,d.__)("Search for a block"),value:a,onChange:e=>l(e),className:"editor-block-manager__search"}),(0,C.createElement)("div",{tabIndex:"0",role:"region","aria-label":(0,d.__)("Available block types"),className:"editor-block-manager__results"},0===e.length&&(0,C.createElement)("p",{className:"editor-block-manager__no-results"},(0,d.__)("No blocks found.")),t.map((t=>(0,C.createElement)(ku,{key:t.slug,title:t.title,blockTypes:e.filter((e=>e.category===t.slug))}))),(0,C.createElement)(ku,{title:(0,d.__)("Uncategorized"),blockTypes:e.filter((({category:e})=>!e))})))})),{PreferencesModal:Pu,PreferencesModalTabs:Cu,PreferencesModalSection:Tu,PreferenceToggleControl:xu}=u(B.privateApis);const Bu={};c(Bu,{DocumentTools:gu,EditorCanvas:ou,ExperimentalEditorProvider:Ul,EnablePluginDocumentSettingPanelOption:cu,EntitiesSavedStatesExtensible:Fs,InserterSidebar:function(){const{insertionPoint:e,showMostUsedBlocks:t}=(0,a.useSelect)((e=>{const{getInsertionPoint:t}=u(e(xo)),{get:n}=e(B.store);return{insertionPoint:t(),showMostUsedBlocks:n("core","mostUsedBlocks")}}),[]),{setIsInserterOpened:n}=(0,a.useDispatch)(xo),o=(0,No.useViewportMatch)("medium","<"),s=o?"div":Zo.VisuallyHidden,[r,i]=(0,No.__experimentalUseDialog)({onClose:()=>n(!1),focusOnMount:null}),l=(0,P.useRef)();return(0,P.useEffect)((()=>{l.current.focusSearch()}),[]),(0,C.createElement)("div",{ref:r,...i,className:"editor-inserter-sidebar"},(0,C.createElement)(s,{className:"editor-inserter-sidebar__header"},(0,C.createElement)(Zo.Button,{icon:hu,label:(0,d.__)("Close block inserter"),onClick:()=>n(!1)})),(0,C.createElement)("div",{className:"editor-inserter-sidebar__content"},(0,C.createElement)(m.__experimentalLibrary,{showMostUsedBlocks:t,showInserterHelpPanel:!0,shouldFocusBlock:o,rootClientId:e.rootClientId,__experimentalInsertionIndex:e.insertionIndex,__experimentalFilterValue:e.filterValue,ref:l})))},ListViewSidebar:function(){const{setIsListViewOpened:e}=(0,a.useDispatch)(xo),{getListViewToggleRef:t}=u((0,a.useSelect)(xo)),n=(0,No.useFocusOnMount)("firstElement"),o=(0,P.useCallback)((()=>{e(!1),t().current?.focus()}),[t,e]),s=(0,P.useCallback)((e=>{e.keyCode!==es.ESCAPE||e.defaultPrevented||(e.preventDefault(),o())}),[o]),[r,i]=(0,P.useState)(null),[l,c]=(0,P.useState)("list-view"),p=(0,P.useRef)(),g=(0,P.useRef)(),h=(0,P.useRef)(),_=(0,No.useMergeRefs)([n,h,i]),f=(0,P.useCallback)((()=>{p.current.contains(p.current.ownerDocument.activeElement)?o():function(e){const t=qa.focus.tabbable.find(g.current)[0];if("list-view"===e){const e=qa.focus.tabbable.find(h.current)[0];(p.current.contains(e)?e:t).focus()}else t.focus()}(l)}),[o,l]);return(0,zo.useShortcut)("core/editor/toggle-list-view",f),(0,C.createElement)("div",{className:"editor-list-view-sidebar",onKeyDown:s,ref:p},(0,C.createElement)(fu,{onSelect:e=>c(e),selectOnMove:!1,initialTabId:"list-view"},(0,C.createElement)("div",{className:"edit-post-editor__document-overview-panel__header"},(0,C.createElement)(Zo.Button,{className:"editor-list-view-sidebar__close-button",icon:ki,label:(0,d.__)("Close"),onClick:o}),(0,C.createElement)(fu.TabList,{className:"editor-list-view-sidebar__tabs-tablist",ref:g},(0,C.createElement)(fu.Tab,{className:"editor-list-view-sidebar__tabs-tab",tabId:"list-view"},(0,d._x)("List View","Post overview")),(0,C.createElement)(fu.Tab,{className:"editor-list-view-sidebar__tabs-tab",tabId:"outline"},(0,d._x)("Outline","Post overview")))),(0,C.createElement)(fu.TabPanel,{ref:_,className:"editor-list-view-sidebar__tabs-tabpanel",tabId:"list-view",focusable:!1},(0,C.createElement)("div",{className:"editor-list-view-sidebar__list-view-container"},(0,C.createElement)("div",{className:"editor-list-view-sidebar__list-view-panel-content"},(0,C.createElement)(m.__experimentalListView,{dropZoneElement:r})))),(0,C.createElement)(fu.TabPanel,{className:"editor-list-view-sidebar__tabs-tabpanel",tabId:"outline",focusable:!1},(0,C.createElement)("div",{className:"editor-list-view-sidebar__list-view-container"},(0,C.createElement)(_u,null)))))},PluginPostExcerpt:Kr,PostPanelRow:xr,PostViewLink:function(){const{hasLoaded:e,permalink:t,isPublished:n,label:o,showIconLabels:s}=(0,a.useSelect)((e=>{const t=e(xo).getCurrentPostType(),n=e(p.store).getPostType(t),{get:o}=e(B.store);return{permalink:e(xo).getPermalink(),isPublished:e(xo).isCurrentPostPublished(),label:n?.labels.view_item,hasLoaded:!!n,showIconLabels:o("core","showIconLabels")}}),[]);return n&&t&&e?(0,C.createElement)(Zo.Button,{icon:Eu,label:o||(0,d.__)("View post"),href:t,target:"_blank",showTooltip:!s}):null},PreviewDropdown:function({forceIsAutosaveable:e,disabled:t}){const{deviceType:n,homeUrl:o,isTemplate:s,isViewable:r,showIconLabels:i}=(0,a.useSelect)((e=>{var t;const{getDeviceType:n,getCurrentPostType:o}=e(xo),{getUnstableBase:s,getPostType:r}=e(p.store),{get:i}=e(B.store),a=o();return{deviceType:n(),homeUrl:s()?.home,isTemplate:"wp_template"===a,isViewable:null!==(t=r(a)?.viewable)&&void 0!==t&&t,showIconLabels:i("core","showIconLabels")}}),[]),{setDeviceType:l}=(0,a.useDispatch)(xo);if((0,No.useViewportMatch)("medium","<"))return null;const c={className:"editor-preview-dropdown__toggle",size:"compact",showTooltip:!i,disabled:t,__experimentalIsFocusable:t},u={"aria-label":(0,d.__)("View options")},m={mobile:bu,tablet:vu,desktop:yu};return(0,C.createElement)(Zo.DropdownMenu,{className:"editor-preview-dropdown",popoverProps:{placement:"bottom-end"},toggleProps:c,menuProps:u,icon:m[n.toLowerCase()],label:(0,d.__)("View"),disableOpenOnArrowDown:t},(({onClose:t})=>(0,C.createElement)(C.Fragment,null,(0,C.createElement)(Zo.MenuGroup,null,(0,C.createElement)(Zo.MenuItem,{onClick:()=>l("Desktop"),icon:"Desktop"===n&&vr},(0,d.__)("Desktop")),(0,C.createElement)(Zo.MenuItem,{onClick:()=>l("Tablet"),icon:"Tablet"===n&&vr},(0,d.__)("Tablet")),(0,C.createElement)(Zo.MenuItem,{onClick:()=>l("Mobile"),icon:"Mobile"===n&&vr},(0,d.__)("Mobile"))),s&&(0,C.createElement)(Zo.MenuGroup,null,(0,C.createElement)(Zo.MenuItem,{href:o,target:"_blank",icon:Eu,onClick:t},(0,d.__)("View site"),(0,C.createElement)(Zo.VisuallyHidden,{as:"span"},(0,d.__)("(opens in a new tab)")))),r&&(0,C.createElement)(Zo.MenuGroup,null,(0,C.createElement)(Ei,{className:"editor-preview-dropdown__button-external",role:"menuitem",forceIsAutosaveable:e,textContent:(0,C.createElement)(C.Fragment,null,(0,d.__)("Preview in new tab"),(0,C.createElement)(Zo.Icon,{icon:Eu})),onPreview:t})))))},PreferencesModal:function({extraSections:e={},isActive:t,onClose:n}){const o=(0,No.useViewportMatch)("medium"),{showBlockBreadcrumbsOption:s}=(0,a.useSelect)((e=>{const{getEditorSettings:t}=e(xo),{get:n}=e(B.store),s=t().richEditingEnabled;return{showBlockBreadcrumbsOption:!n("core","distractionFree")&&o&&s}}),[o]),{setIsListViewOpened:r,setIsInserterOpened:i}=(0,a.useDispatch)(xo),{set:l}=(0,a.useDispatch)(B.store),c=()=>{l("core","fixedToolbar",!0),i(!1),r(!1)},u=()=>{l("core","distractionFree",!1)},p=(0,P.useMemo)((()=>[{name:"general",tabLabel:(0,d.__)("General"),content:(0,C.createElement)(C.Fragment,null,(0,C.createElement)(Tu,{title:(0,d.__)("Interface")},(0,C.createElement)(xu,{scope:"core",featureName:"showListViewByDefault",help:(0,d.__)("Opens the block list view sidebar by default."),label:(0,d.__)("Always open list view")}),s&&(0,C.createElement)(xu,{scope:"core",featureName:"showBlockBreadcrumbs",help:(0,d.__)("Display the block hierarchy trail at the bottom of the editor."),label:(0,d.__)("Show block breadcrumbs")}),(0,C.createElement)(xu,{scope:"core",featureName:"allowRightClickOverrides",help:(0,d.__)("Allows contextual list view menus via right-click, overriding browser defaults."),label:(0,d.__)("Allow right-click contextual menus")})),(0,C.createElement)(Tu,{title:(0,d.__)("Document settings"),description:(0,d.__)("Select what settings are shown in the document panel.")},(0,C.createElement)(cu.Slot,null),(0,C.createElement)(ja,{taxonomyWrapper:(e,t)=>(0,C.createElement)(ru,{label:t.labels.menu_name,panelName:`taxonomy-panel-${t.slug}`})}),(0,C.createElement)(Xr,null,(0,C.createElement)(ru,{label:(0,d.__)("Featured image"),panelName:"featured-image"})),(0,C.createElement)(Gr,null,(0,C.createElement)(ru,{label:(0,d.__)("Excerpt"),panelName:"post-excerpt"})),(0,C.createElement)(Zs,{supportKeys:["comments","trackbacks"]},(0,C.createElement)(ru,{label:(0,d.__)("Discussion"),panelName:"discussion-panel"})),(0,C.createElement)(Ks,null,(0,C.createElement)(ru,{label:(0,d.__)("Page attributes"),panelName:"page-attributes"}))),e?.general)},{name:"appearance",tabLabel:(0,d.__)("Appearance"),content:(0,C.createElement)(Tu,{title:(0,d.__)("Appearance"),description:(0,d.__)("Customize the editor interface to suit your needs.")},(0,C.createElement)(xu,{scope:"core",featureName:"fixedToolbar",onToggle:u,help:(0,d.__)("Access all block and document tools in a single place."),label:(0,d.__)("Top toolbar")}),(0,C.createElement)(xu,{scope:"core",featureName:"distractionFree",onToggle:c,help:(0,d.__)("Reduce visual distractions by hiding the toolbar and other elements to focus on writing."),label:(0,d.__)("Distraction free")}),(0,C.createElement)(xu,{scope:"core",featureName:"focusMode",help:(0,d.__)("Highlights the current block and fades other content."),label:(0,d.__)("Spotlight mode")}),e?.appearance)},{name:"accessibility",tabLabel:(0,d.__)("Accessibility"),content:(0,C.createElement)(C.Fragment,null,(0,C.createElement)(Tu,{title:(0,d.__)("Navigation"),description:(0,d.__)("Optimize the editing experience for enhanced control.")},(0,C.createElement)(xu,{scope:"core",featureName:"keepCaretInsideBlock",help:(0,d.__)("Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block."),label:(0,d.__)("Contain text cursor inside block")})),(0,C.createElement)(Tu,{title:(0,d.__)("Interface")},(0,C.createElement)(xu,{scope:"core",featureName:"showIconLabels",label:(0,d.__)("Show button text labels"),help:(0,d.__)("Show text instead of icons on buttons across the interface.")})))},{name:"blocks",tabLabel:(0,d.__)("Blocks"),content:(0,C.createElement)(C.Fragment,null,(0,C.createElement)(Tu,{title:(0,d.__)("Inserter")},(0,C.createElement)(xu,{scope:"core",featureName:"mostUsedBlocks",help:(0,d.__)("Adds a category with the most frequently used blocks in the inserter."),label:(0,d.__)("Show most used blocks")})),(0,C.createElement)(Tu,{title:(0,d.__)("Manage block visibility"),description:(0,d.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.")},(0,C.createElement)(Su,null)))}]),[o,s,e]);return t?(0,C.createElement)(Pu,{closeModal:n},(0,C.createElement)(Cu,{sections:p})):null},useBlockEditorSettings:Dl})})(),(window.wp=window.wp||{}).editor=o})();
\ No newline at end of file + * is-plain-object <https://github.com/jonschlinkert/is-plain-object> + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ +function zd(e){return"[object Object]"===Object.prototype.toString.call(e)}function Hd(e){var t,s;return!1!==zd(e)&&(void 0===(t=e.constructor)||!1!==zd(s=t.prototype)&&!1!==s.hasOwnProperty("isPrototypeOf"))}const{GlobalStylesContext:Gd,cleanEmptyObject:$d}=h(g.privateApis);function Wd(e,t){return Ud()(e,t,{isMergeableObject:Hd})}function Kd(){const[e,t,s]=function(){const{globalStylesId:e,isReady:t,settings:s,styles:o,_links:n}=(0,d.useSelect)((e=>{const{getEditedEntityRecord:t,hasFinishedResolution:s}=e(b.store),o=e(b.store).__experimentalGetCurrentGlobalStylesId(),n=o?t("root","globalStyles",o):void 0;let i=!1;return s("__experimentalGetCurrentGlobalStylesId")&&(i=!o||s("getEditedEntityRecord",["root","globalStyles",o])),{globalStylesId:o,isReady:i,settings:n?.settings,styles:n?.styles,_links:n?._links}}),[]),{getEditedEntityRecord:i}=(0,d.useSelect)(b.store),{editEntityRecord:r}=(0,d.useDispatch)(b.store);return[t,(0,C.useMemo)((()=>({settings:null!=s?s:{},styles:null!=o?o:{},_links:null!=n?n:{}})),[s,o,n]),(0,C.useCallback)(((t,s={})=>{var o,n,a;const l=i("root","globalStyles",e),c={styles:null!==(o=l?.styles)&&void 0!==o?o:{},settings:null!==(n=l?.settings)&&void 0!==n?n:{},_links:null!==(a=l?._links)&&void 0!==a?a:{}},d="function"==typeof t?t(c):t;r("root","globalStyles",e,{styles:$d(d.styles)||{},settings:$d(d.settings)||{},_links:$d(d._links)||{}},s)}),[e,r,i])]}(),[o,n]=function(){const e=(0,d.useSelect)((e=>e(b.store).__experimentalGetCurrentThemeBaseGlobalStyles()),[]);return[!!e,e]}(),i=(0,C.useMemo)((()=>n&&t?Wd(n,t):{}),[t,n]);return(0,C.useMemo)((()=>({isReady:e&&o,user:t,base:n,merged:i,setUserConfig:s})),[i,t,n,s,e,o])}const Zd=[],Yd={};function qd(e){var t;return null!==(t=e(b.store).getEntityRecords("postType","wp_block",{per_page:-1}))&&void 0!==t?t:Zd}const Qd=["__experimentalBlockDirectory","__experimentalDiscussionSettings","__experimentalFeatures","__experimentalGlobalStylesBaseStyles","__unstableGalleryWithImageBlocks","alignWide","blockInspectorTabs","allowedMimeTypes","bodyPlaceholder","canLockBlocks","capabilities","clearBlockSelection","codeEditingEnabled","colors","disableCustomColors","disableCustomFontSizes","disableCustomSpacingSizes","disableCustomGradients","disableLayoutStyles","enableCustomLineHeight","enableCustomSpacing","enableCustomUnits","enableOpenverseMediaCategory","fontSizes","gradients","generateAnchors","onNavigateToEntityRecord","imageDefaultSize","imageDimensions","imageEditing","imageSizes","isRTL","locale","maxWidth","postContentAttributes","postsPerPage","readOnly","sectionRootClientId","styles","titlePlaceholder","supportsLayout","widgetTypesToHideFromLegacyWidgetBlock","__unstableHasCustomAppender","__unstableIsPreviewMode","__unstableResolvedAssets","__unstableIsBlockBasedTheme","__experimentalArchiveTitleTypeLabel","__experimentalArchiveTitleNameLabel"],{globalStylesDataKey:Xd,selectBlockPatternsKey:Jd,reusableBlocksSelectKey:eu}=h(g.privateApis);const tu=function(e,t,s,o){var n,i,r;const a=(0,pn.useViewportMatch)("medium"),{allowRightClickOverrides:l,blockTypes:u,focusMode:_,hasFixedToolbar:f,isDistractionFree:y,keepCaretInsideBlock:x,hasUploadPermissions:v,hiddenBlockTypes:w,canUseUnfilteredHTML:S,userCanCreatePages:k,pageOnFront:P,pageForPosts:j,userPatternCategories:T,restBlockPatternCategories:E,sectionRootClientId:I}=(0,d.useSelect)((e=>{var n;const{canUser:i,getRawEntityRecord:r,getEntityRecord:l,getUserPatternCategories:d,getBlockPatternCategories:u}=e(b.store),{get:p}=e(B.store),{getBlockTypes:h}=e(c.store),{getBlocksByName:m,getBlockAttributes:_}=e(g.store),f=i("read","settings")?l("root","site"):void 0;return{allowRightClickOverrides:p("core","allowRightClickOverrides"),blockTypes:h(),canUseUnfilteredHTML:r("postType",t,s)?._links?.hasOwnProperty("wp:action-unfiltered-html"),focusMode:p("core","focusMode"),hasFixedToolbar:p("core","fixedToolbar")||!a,hiddenBlockTypes:p("core","hiddenBlockTypes"),isDistractionFree:p("core","distractionFree"),keepCaretInsideBlock:p("core","keepCaretInsideBlock"),hasUploadPermissions:null===(n=i("create","media"))||void 0===n||n,userCanCreatePages:i("create","pages"),pageOnFront:f?.page_on_front,pageForPosts:f?.page_for_posts,userPatternCategories:d(),restBlockPatternCategories:u(),sectionRootClientId:"template-locked"===o?null!==(x=m("core/post-content")?.[0])&&void 0!==x?x:"":null!==(y=m("core/group").find((e=>"main"===_(e)?.tagName)))&&void 0!==y?y:""};var y,x}),[t,s,a,o]),{merged:N}=Kd(),A=null!==(n=N.styles)&&void 0!==n?n:Yd,D=null!==(i=e.__experimentalAdditionalBlockPatterns)&&void 0!==i?i:e.__experimentalBlockPatterns,R=null!==(r=e.__experimentalAdditionalBlockPatternCategories)&&void 0!==r?r:e.__experimentalBlockPatternCategories,M=(0,C.useMemo)((()=>[...D||[]].filter((({postTypes:e})=>!e||Array.isArray(e)&&e.includes(t)))),[D,t]),O=(0,C.useMemo)((()=>[...R||[],...E||[]].filter(((e,t,s)=>t===s.findIndex((t=>e.name===t.name))))),[R,E]),{undo:L,setIsInserterOpened:F}=(0,d.useDispatch)(cn),{saveEntityRecord:V}=(0,d.useDispatch)(b.store),U=(0,C.useCallback)((e=>k?V("postType","page",e):Promise.reject({message:(0,m.__)("You do not have permission to create Pages.")})),[V,k]),z=(0,C.useMemo)((()=>{if(w&&w.length>0){return(!0===e.allowedBlockTypes?u.map((({name:e})=>e)):e.allowedBlockTypes||[]).filter((e=>!w.includes(e)))}return e.allowedBlockTypes}),[e.allowedBlockTypes,w,u]),H=!1===e.focusMode;return(0,C.useMemo)((()=>{const s={...Object.fromEntries(Object.entries(e).filter((([e])=>Qd.includes(e)))),[Xd]:A,allowedBlockTypes:z,allowRightClickOverrides:l,focusMode:_&&!H,hasFixedToolbar:f,isDistractionFree:y,keepCaretInsideBlock:x,mediaUpload:v?Fd:void 0,__experimentalBlockPatterns:M,[Jd]:e=>{const{hasFinishedResolution:s,getBlockPatternsForPostType:o}=h(e(b.store)),n=o(t);return s("getBlockPatterns")?n:void 0},[eu]:qd,__experimentalBlockPatternCategories:O,__experimentalUserPatternCategories:T,__experimentalFetchLinkSuggestions:(t,s)=>(0,b.__experimentalFetchLinkSuggestions)(t,s,e),inserterMediaCategories:Od,__experimentalFetchRichUrlData:b.__experimentalFetchUrlData,__experimentalCanUserUseUnfilteredHTML:S,__experimentalUndo:L,outlineMode:"wp_template"===t,__experimentalCreatePageEntity:U,__experimentalUserCanCreatePages:k,pageOnFront:P,pageForPosts:j,__experimentalPreferPatternsOnRoot:"wp_template"===t,templateLock:"wp_navigation"===t?"insert":e.templateLock,template:"wp_navigation"===t?[["core/navigation",{},[]]]:e.template,__experimentalSetIsInserterOpened:F};return p(s,{sectionRootClientId:I}),s}),[z,l,_,H,f,y,x,e,v,T,M,O,S,L,U,k,P,j,t,F,I,A])},su=["core/post-title","core/post-featured-image","core/post-content","core/template-part"];function ou(){const e=(0,bs.applyFilters)("editor.postContentBlockTypes",su),t=(0,d.useSelect)((t=>{const{getBlocksByName:s,getBlockParents:o,getBlockName:n}=t(g.store);return s(e).filter((t=>o(t).every((t=>{const s=n(t);return"core/query"!==s&&!e.includes(s)}))))}),[]),s=(0,d.useSelect)((e=>{const{getBlocksByName:t,getBlockOrder:s}=e(g.store);return t(["core/template-part"]).flatMap((e=>s(e)))}),[]),o=(0,d.useRegistry)();return(0,C.useEffect)((()=>{const{setBlockEditingMode:e,unsetBlockEditingMode:n}=o.dispatch(g.store);return o.batch((()=>{e("","disabled");for(const s of t)e(s,"contentOnly");for(const t of s)e(t,"disabled")})),()=>{o.batch((()=>{n("");for(const e of t)n(e);for(const e of s)n(e)}))}}),[t,s,o]),null}function nu(){const e=(0,d.useSelect)((e=>e(g.store).getBlockOrder()?.[0]),[]),{setBlockEditingMode:t,unsetBlockEditingMode:s}=(0,d.useDispatch)(g.store);(0,C.useEffect)((()=>{if(e)return t(e,"contentOnly"),()=>{s(e)}}),[e,s,t])}const iu=["wp_block","wp_template","wp_template_part"];const ru=(0,T.jsxs)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,T.jsx)(j.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,T.jsx)(j.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"})]}),au=(0,T.jsx)(j.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,T.jsx)(j.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})}),lu=(0,T.jsx)(j.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,T.jsx)(j.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"})}),cu=(0,T.jsx)(j.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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"})}),du=(0,T.jsx)(j.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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"})}),uu=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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"})}),pu=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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"})}),hu=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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"})}),mu=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})}),{RenamePatternModal:gu}=h(_n.privateApis),_u="editor/pattern-rename";function fu(){const{record:e,postType:t}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(cn),{getEditedEntityRecord:o}=e(b.store),n=t();return{record:o("postType",n,s()),postType:n}}),[]),{closeModal:s}=(0,d.useDispatch)(Xn);return(0,d.useSelect)((e=>e(Xn).isModalActive(_u)))&&t===V?(0,T.jsx)(gu,{onClose:s,pattern:e}):null}const{DuplicatePatternModal:bu}=h(_n.privateApis),yu="editor/pattern-duplicate";function xu(){const{record:e,postType:t}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(cn),{getEditedEntityRecord:o}=e(b.store),n=t();return{record:o("postType",n,s()),postType:n}}),[]),{closeModal:s}=(0,d.useDispatch)(Xn);return(0,d.useSelect)((e=>e(Xn).isModalActive(yu)))&&t===V?(0,T.jsx)(bu,{onClose:s,onSuccess:()=>s(),pattern:e}):null}function vu(){const{editorMode:e,isListViewOpen:t,showBlockBreadcrumbs:s,isDistractionFree:o,isTopToolbar:n,isFocusMode:i,isPreviewMode:r,isViewable:a,isCodeEditingEnabled:l,isRichEditingEnabled:c,isPublishSidebarEnabled:u}=(0,d.useSelect)((e=>{var t,s;const{get:o}=e(B.store),{isListViewOpened:n,getCurrentPostType:i,getEditorSettings:r}=e(cn),{getSettings:a}=e(g.store),{getPostType:l}=e(b.store);return{editorMode:null!==(t=o("core","editorMode"))&&void 0!==t?t:"visual",isListViewOpen:n(),showBlockBreadcrumbs:o("core","showBlockBreadcrumbs"),isDistractionFree:o("core","distractionFree"),isFocusMode:o("core","focusMode"),isTopToolbar:o("core","fixedToolbar"),isPreviewMode:a().__unstableIsPreviewMode,isViewable:null!==(s=l(i())?.viewable)&&void 0!==s&&s,isCodeEditingEnabled:r().codeEditingEnabled,isRichEditingEnabled:r().richEditingEnabled,isPublishSidebarEnabled:e(cn).isPublishSidebarEnabled()}}),[]),{getActiveComplementaryArea:p}=(0,d.useSelect)(Xn),{toggle:h}=(0,d.useDispatch)(B.store),{createInfoNotice:_}=(0,d.useDispatch)(fs.store),{__unstableSaveForPreview:f,setIsListViewOpened:y,switchEditorMode:x,toggleDistractionFree:v}=(0,d.useDispatch)(cn),{openModal:w,enableComplementaryArea:S,disableComplementaryArea:k}=(0,d.useDispatch)(Xn),{getCurrentPostId:P}=(0,d.useSelect)(cn),C=l&&c;if(r)return{commands:[],isLoading:!1};const j=[];return j.push({name:"core/open-shortcut-help",label:(0,m.__)("Keyboard shortcuts"),icon:ru,callback:()=>{w("editor/keyboard-shortcut-help")}}),j.push({name:"core/toggle-distraction-free",label:o?(0,m.__)("Exit Distraction Free"):(0,m.__)("Enter Distraction Free"),callback:({close:e})=>{v(),e()}}),j.push({name:"core/open-preferences",label:(0,m.__)("Editor preferences"),callback:()=>{w("editor/preferences")}}),j.push({name:"core/toggle-spotlight-mode",label:(0,m.__)("Toggle spotlight"),callback:({close:e})=>{h("core","focusMode"),e(),_(i?(0,m.__)("Spotlight off."):(0,m.__)("Spotlight on."),{id:"core/editor/toggle-spotlight-mode/notice",type:"snackbar",actions:[{label:(0,m.__)("Undo"),onClick:()=>{h("core","focusMode")}}]})}}),j.push({name:"core/toggle-list-view",label:t?(0,m.__)("Close List View"):(0,m.__)("Open List View"),icon:au,callback:({close:e})=>{y(!t),e(),_(t?(0,m.__)("List View off."):(0,m.__)("List View on."),{id:"core/editor/toggle-list-view/notice",type:"snackbar"})}}),j.push({name:"core/toggle-top-toolbar",label:(0,m.__)("Toggle top toolbar"),callback:({close:e})=>{h("core","fixedToolbar"),o&&v(),e(),_(n?(0,m.__)("Top toolbar off."):(0,m.__)("Top toolbar on."),{id:"core/editor/toggle-top-toolbar/notice",type:"snackbar",actions:[{label:(0,m.__)("Undo"),onClick:()=>{h("core","fixedToolbar")}}]})}}),C&&j.push({name:"core/toggle-code-editor",label:"visual"===e?(0,m.__)("Open code editor"):(0,m.__)("Exit code editor"),icon:lu,callback:({close:t})=>{x("visual"===e?"text":"visual"),t()}}),j.push({name:"core/toggle-breadcrumbs",label:s?(0,m.__)("Hide block breadcrumbs"):(0,m.__)("Show block breadcrumbs"),callback:({close:e})=>{h("core","showBlockBreadcrumbs"),e(),_(s?(0,m.__)("Breadcrumbs hidden."):(0,m.__)("Breadcrumbs visible."),{id:"core/editor/toggle-breadcrumbs/notice",type:"snackbar"})}}),j.push({name:"core/open-settings-sidebar",label:(0,m.__)("Toggle settings sidebar"),icon:(0,m.isRTL)()?cu:du,callback:({close:e})=>{const t=p("core");e(),"edit-post/document"===t?k("core"):S("core","edit-post/document")}}),j.push({name:"core/open-block-inspector",label:(0,m.__)("Toggle block inspector"),icon:uu,callback:({close:e})=>{const t=p("core");e(),"edit-post/block"===t?k("core"):S("core","edit-post/block")}}),j.push({name:"core/toggle-publish-sidebar",label:u?(0,m.__)("Disable pre-publish checks"):(0,m.__)("Enable pre-publish checks"),icon:pu,callback:({close:e})=>{e(),h("core","isPublishSidebarEnabled"),_(u?(0,m.__)("Pre-publish checks disabled."):(0,m.__)("Pre-publish checks enabled."),{id:"core/editor/publish-sidebar/notice",type:"snackbar"})}}),a&&j.push({name:"core/preview-link",label:(0,m.__)("Preview in a new tab"),icon:hu,callback:async({close:e})=>{e();const t=P(),s=await f();window.open(s,`wp-preview-${t}`)}}),{commands:j,isLoading:!1}}function wu(){const{postType:e}=(0,d.useSelect)((e=>{const{getCurrentPostType:t}=e(cn);return{postType:t()}}),[]),{openModal:t}=(0,d.useDispatch)(Xn),s=[];return e===V&&(s.push({name:"core/rename-pattern",label:(0,m.__)("Rename pattern"),icon:mu,callback:({close:e})=>{t(_u),e()}}),s.push({name:"core/duplicate-pattern",label:(0,m.__)("Duplicate pattern"),icon:Ko,callback:({close:e})=>{t(yu),e()}})),{isLoading:!1,commands:s}}const{BlockRemovalWarningModal:Su}=h(g.privateApis),ku=["core/post-content","core/post-template","core/query"],Pu=[{postTypes:["wp_template","wp_template_part"],callback(e){if(e.filter((({name:e})=>ku.includes(e))).length)return(0,m._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,m._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 Cu(){const e=(0,d.useSelect)((e=>e(cn).getCurrentPostType()),[]),t=(0,C.useMemo)((()=>Pu.filter((t=>t.postTypes.includes(e)))),[e]);return Su&&t?(0,T.jsx)(Su,{rules:t}):null}function ju({blockPatterns:e,onChoosePattern:t}){const s=(0,pn.useAsyncList)(e),{editEntityRecord:o}=(0,d.useDispatch)(b.store),{postType:n,postId:i}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(cn);return{postType:t(),postId:s()}}),[]);return(0,T.jsx)(g.__experimentalBlockPatternsList,{blockPatterns:e,shownPatterns:s,onClickPattern:(e,s)=>{o("postType",n,i,{blocks:s,content:({blocks:e=[]})=>(0,c.__unstableSerializeAndClean)(e)}),t()}})}function Tu({onClose:e}){const t=function(){const{blockPatternsWithPostContentBlockType:e,postType:t}=(0,d.useSelect)((e=>{const{getPatternsByBlockTypes:t,getBlocksByName:s}=e(g.store),{getCurrentPostType:o,getRenderingMode:n}=e(cn);return{blockPatternsWithPostContentBlockType:t("core/post-content","post-only"===n()?"":s("core/post-content")?.[0]),postType:o()}}),[]);return(0,C.useMemo)((()=>e.filter((e=>"page"===t&&!e.postTypes||Array.isArray(e.postTypes)&&e.postTypes.includes(t)))),[t,e])}();return t.length>0?(0,T.jsx)(Tn.Modal,{title:(0,m.__)("Choose a pattern"),isFullScreen:!0,onRequestClose:e,children:(0,T.jsx)("div",{className:"editor-start-page-options__modal-content",children:(0,T.jsx)(ju,{blockPatterns:t,onChoosePattern:e})})}):null}function Eu(){const[e,t]=(0,C.useState)(!1),{shouldEnableModal:s,postType:o,postId:n}=(0,d.useSelect)((e=>{const{isEditedPostDirty:t,isEditedPostEmpty:s,getCurrentPostType:o,getCurrentPostId:n}=e(cn),i=o();return{shouldEnableModal:!t()&&s()&&L!==i,postType:i,postId:n()}}),[]);return(0,C.useEffect)((()=>{t(!1)}),[o,n]),!s||e?null:(0,T.jsx)(Tu,{onClose:()=>t(!0)})}const Bu=[{keyCombination:{modifier:"primary",character:"b"},description:(0,m.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,m.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,m.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,m.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,m.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,m.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,m.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,m.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}],description:(0,m.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,m.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")},{keyCombination:{modifier:"primaryShift",character:"SPACE"},description:(0,m.__)("Add non breaking space.")}];function Iu({keyCombination:e,forceAriaLabel:t}){const s=e.modifier?Ci.displayShortcutList[e.modifier](e.character):e.character,o=e.modifier?Ci.shortcutAriaLabel[e.modifier](e.character):e.character;return(0,T.jsx)("kbd",{className:"editor-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||o,children:(Array.isArray(s)?s:[s]).map(((e,t)=>"+"===e?(0,T.jsx)(C.Fragment,{children:e},t):(0,T.jsx)("kbd",{className:"editor-keyboard-shortcut-help-modal__shortcut-key",children:e},t)))})}const Nu=function({description:e,keyCombination:t,aliases:s=[],ariaLabel:o}){return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:"editor-keyboard-shortcut-help-modal__shortcut-description",children:e}),(0,T.jsxs)("div",{className:"editor-keyboard-shortcut-help-modal__shortcut-term",children:[(0,T.jsx)(Iu,{keyCombination:t,forceAriaLabel:o}),s.map(((e,t)=>(0,T.jsx)(Iu,{keyCombination:e,forceAriaLabel:o},t)))]})]})};const Au=function({name:e}){const{keyCombination:t,description:s,aliases:o}=(0,d.useSelect)((t=>{const{getShortcutKeyCombination:s,getShortcutDescription:o,getShortcutAliases:n}=t(Pn.store);return{keyCombination:s(e),aliases:n(e),description:o(e)}}),[e]);return t?(0,T.jsx)(Nu,{keyCombination:t,description:s,aliases:o}):null},Du="editor/keyboard-shortcut-help",Ru=({shortcuts:e})=>(0,T.jsx)("ul",{className:"editor-keyboard-shortcut-help-modal__shortcut-list",role:"list",children:e.map(((e,t)=>(0,T.jsx)("li",{className:"editor-keyboard-shortcut-help-modal__shortcut",children:"string"==typeof e?(0,T.jsx)(Au,{name:e}):(0,T.jsx)(Nu,{...e})},t)))}),Mu=({title:e,shortcuts:t,className:s})=>(0,T.jsxs)("section",{className:jn("editor-keyboard-shortcut-help-modal__section",s),children:[!!e&&(0,T.jsx)("h2",{className:"editor-keyboard-shortcut-help-modal__section-title",children:e}),(0,T.jsx)(Ru,{shortcuts:t})]}),Ou=({title:e,categoryName:t,additionalShortcuts:s=[]})=>{const o=(0,d.useSelect)((e=>e(Pn.store).getCategoryShortcuts(t)),[t]);return(0,T.jsx)(Mu,{title:e,shortcuts:o.concat(s)})};const Lu=function(){const e=(0,d.useSelect)((e=>e(Xn).isModalActive(Du)),[]),{openModal:t,closeModal:s}=(0,d.useDispatch)(Xn),o=()=>{e?s():t(Du)};return(0,Pn.useShortcut)("core/editor/keyboard-shortcuts",o),e?(0,T.jsxs)(Tn.Modal,{className:"editor-keyboard-shortcut-help-modal",title:(0,m.__)("Keyboard shortcuts"),closeButtonLabel:(0,m.__)("Close"),onRequestClose:o,children:[(0,T.jsx)(Mu,{className:"editor-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/editor/keyboard-shortcuts"]}),(0,T.jsx)(Ou,{title:(0,m.__)("Global shortcuts"),categoryName:"global"}),(0,T.jsx)(Ou,{title:(0,m.__)("Selection shortcuts"),categoryName:"selection"}),(0,T.jsx)(Ou,{title:(0,m.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,m.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,m.__)("Forward-slash")}]}),(0,T.jsx)(Mu,{title:(0,m.__)("Text formatting"),shortcuts:Bu}),(0,T.jsx)(Ou,{title:(0,m.__)("List View shortcuts"),categoryName:"list-view"})]}):null};function Fu({clientId:e,onClose:t}){const{entity:s,onNavigateToEntityRecord:o,canEditTemplates:n}=(0,d.useSelect)((t=>{const{getBlockEditingMode:s,getBlockParentsByBlockName:o,getSettings:n,getBlockAttributes:i}=t(g.store);if(!("contentOnly"===s(e)))return{};const r=o(e,"core/block",!0)[0];let a;if(r)a=t(b.store).getEntityRecord("postType","wp_block",i(r).ref);else{const{getCurrentTemplateId:s}=t(cn),o=s(),{getContentLockingParent:n}=h(t(g.store));!n(e)&&o&&(a=t(b.store).getEntityRecord("postType","wp_template",o))}return{canEditTemplates:t(b.store).canUser("create","templates"),entity:a,onNavigateToEntityRecord:n().onNavigateToEntityRecord}}),[e]);if(!s)return(0,T.jsx)(Vu,{clientId:e,onClose:t});const i="wp_block"===s.type;let r=i?(0,m.__)("Edit the pattern to move, delete, or make further changes to this block."):(0,m.__)("Edit the template to move, delete, or make further changes to this block.");return n||(r=(0,m.__)("Only users with permissions to edit the template can move or delete this block")),(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(g.__unstableBlockSettingsMenuFirstItem,{children:(0,T.jsx)(Tn.MenuItem,{onClick:()=>{o({postId:s.id,postType:s.type})},disabled:!n,children:i?(0,m.__)("Edit pattern"):(0,m.__)("Edit template")})}),(0,T.jsx)(Tn.__experimentalText,{variant:"muted",as:"p",className:"editor-content-only-settings-menu__description",children:r})]})}function Vu({clientId:e,onClose:t}){const{contentLockingParent:s}=(0,d.useSelect)((t=>{const{getContentLockingParent:s}=h(t(g.store));return{contentLockingParent:s(e)}}),[e]),o=(0,g.useBlockDisplayInformation)(s),{modifyContentLockBlock:n,selectBlock:i}=h((0,d.useDispatch)(g.store));return o?.title?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(g.__unstableBlockSettingsMenuFirstItem,{children:(0,T.jsx)(Tn.MenuItem,{onClick:()=>{i(s),n(s),t()},children:(0,m.__)("Unlock")})}),(0,T.jsx)(Tn.__experimentalText,{variant:"muted",as:"p",className:"editor-content-only-settings-menu__description",children:(0,m.__)("Temporarily unlock the parent block to edit, delete or make further changes to this block.")})]}):null}function Uu(){return(0,T.jsx)(g.BlockSettingsMenuControls,{children:({selectedClientIds:e,onClose:t})=>1===e.length&&(0,T.jsx)(Fu,{clientId:e[0],onClose:t})})}function zu(e){const{slug:t,patterns:s}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(cn),{getEntityRecord:o,getBlockPatterns:n}=e(b.store),i=s();return{slug:o("postType",t(),i).slug,patterns:n()}}),[]),o=(0,d.useSelect)((e=>e(b.store).getCurrentTheme().stylesheet));return(0,C.useMemo)((()=>[{name:"fallback",blocks:(0,c.parse)(e),title:(0,m.__)("Fallback content")},...s.filter((e=>Array.isArray(e.templateTypes)&&e.templateTypes.some((e=>t.startsWith(e))))).map((e=>({...e,blocks:(0,c.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=o),e)))),"core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=o),e}(e)))})))]),[e,t,s])}function Hu({fallbackContent:e,onChoosePattern:t,postType:s}){const[,,o]=(0,b.useEntityBlockEditor)("postType",s),n=zu(e),i=(0,pn.useAsyncList)(n);return(0,T.jsx)(g.__experimentalBlockPatternsList,{blockPatterns:n,shownPatterns:i,onClickPattern:(e,s)=>{o(s,{selection:void 0}),t()}})}function Gu({slug:e,isCustom:t,onClose:s,postType:o}){const n=function(e,t=!1){return(0,d.useSelect)((s=>{const{getEntityRecord:o,getDefaultTemplateId:n}=s(b.store),i=n({slug:e,is_custom:t,ignore_empty:!0});return i?o("postType",L,i)?.content?.raw:void 0}),[e,t])}(e,t);return n?(0,T.jsxs)(Tn.Modal,{className:"editor-start-template-options__modal",title:(0,m.__)("Choose a pattern"),closeLabel:(0,m.__)("Cancel"),focusOnMount:"firstElement",onRequestClose:s,isFullScreen:!0,children:[(0,T.jsx)("div",{className:"editor-start-template-options__modal-content",children:(0,T.jsx)(Hu,{fallbackContent:n,slug:e,isCustom:t,postType:o,onChoosePattern:()=>{s()}})}),(0,T.jsx)(Tn.Flex,{className:"editor-start-template-options__modal__actions",justify:"flex-end",expanded:!1,children:(0,T.jsx)(Tn.FlexItem,{children:(0,T.jsx)(Tn.Button,{variant:"tertiary",onClick:s,children:(0,m.__)("Skip")})})})]}):null}function $u(){const[e,t]=(0,C.useState)(!1),{shouldOpenModal:s,slug:o,isCustom:n,postType:i,postId:r}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(cn),o=t(),n=s(),{getEditedEntityRecord:i,hasEditsForEntityRecord:r}=e(b.store),a=i("postType",o,n);return{shouldOpenModal:!r("postType",o,n)&&""===a.content&&L===o,slug:a.slug,isCustom:a.is_custom,postType:o,postId:n}}),[]);return(0,C.useEffect)((()=>{t(!1)}),[i,r]),!s||e?null:(0,T.jsx)(Gu,{slug:o,isCustom:n,postType:i,onClose:()=>t(!0)})}const{ExperimentalBlockEditorProvider:Wu}=h(g.privateApis),{PatternsMenuItems:Ku}=h(_n.privateApis),Zu=()=>{},Yu=["wp_block","wp_template","wp_navigation","wp_template_part"];const qu=Nd((({post:e,settings:t,recovery:s,initialEdits:o,children:n,BlockEditorProviderComponent:i=Wu,__unstableTemplate:r})=>{const a=(0,d.useSelect)((e=>e(cn).getRenderingMode()),[]),l=!!r&&"post-only"!==a,u=l?r:e,p=(0,C.useMemo)((()=>({...!Yu.includes(u.type)||l?{postId:e.id,postType:e.type}:{},templateSlug:"wp_template"===u.type?u.slug:void 0})),[l,e.id,e.type,u.type,u.slug]),{editorSettings:_,selection:f,isReady:y}=(0,d.useSelect)((e=>{const{getEditorSettings:t,getEditorSelection:s,__unstableIsEditorReady:o}=e(cn);return{editorSettings:t(),isReady:o(),selection:s()}}),[]),{id:x,type:v}=u,w=tu(_,v,x,a),[S,k,P]=function(e,t,s){const o="post-only"!==s&&t?"template":"post",[n,i,r]=(0,b.useEntityBlockEditor)("postType",e.type,{id:e.id}),[a,l,d]=(0,b.useEntityBlockEditor)("postType",t?.type,{id:t?.id}),u=(0,C.useMemo)((()=>{if("wp_navigation"===e.type)return[(0,c.createBlock)("core/navigation",{ref:e.id,templateLock:!1})]}),[e.type,e.id]),p=(0,C.useMemo)((()=>u||("template"===o?a:n)),[u,o,a,n]);return t&&"template-locked"===s||"wp_navigation"===e.type?[p,Zu,Zu]:[p,"post"===o?i:l,"post"===o?r:d]}(e,r,a),{updatePostLock:j,setupEditor:E,updateEditorSettings:B,setCurrentTemplateId:I,setEditedPost:N,setRenderingMode:A}=h((0,d.useDispatch)(cn)),{createWarningNotice:D}=(0,d.useDispatch)(fs.store);return(0,C.useLayoutEffect)((()=>{s||(j(t.postLock),E(e,o,t.template),t.autosave&&D((0,m.__)("There is an autosave of this post that is more recent than the version below."),{id:"autosave-exists",actions:[{label:(0,m.__)("View the autosave"),url:t.autosave.editLink}]}))}),[]),(0,C.useEffect)((()=>{N(e.type,e.id)}),[e.type,e.id,N]),(0,C.useEffect)((()=>{B(t)}),[t,B]),(0,C.useEffect)((()=>{I(r?.id)}),[r?.id,I]),(0,C.useEffect)((()=>{var e;A(null!==(e=t.defaultRenderingMode)&&void 0!==e?e:"post-only")}),[t.defaultRenderingMode,A]),function(e,t){(0,C.useEffect)((()=>((0,bs.addFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter",((s,o)=>!(!iu.includes(e)&&"core/template-part"===o.name&&"post-only"===t)&&s)),(0,bs.addFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter",((t,s,o,{getBlockParentsByBlockName:n})=>iu.includes(e)||"core/post-content"!==s.name?t:n(o,"core/query").length>0)),()=>{(0,bs.removeFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter"),(0,bs.removeFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter")})),[e,t])}(e.type,a),(0,ji.useCommandLoader)({name:"core/editor/edit-ui",hook:vu}),(0,ji.useCommandLoader)({name:"core/editor/contextual-commands",hook:wu,context:"entity-edit"}),y?(0,T.jsx)(b.EntityProvider,{kind:"root",type:"site",children:(0,T.jsx)(b.EntityProvider,{kind:"postType",type:e.type,id:e.id,children:(0,T.jsx)(g.BlockContextProvider,{value:p,children:(0,T.jsxs)(i,{value:S,onChange:P,onInput:k,selection:f,settings:w,useSubRegistry:!1,children:[n,!t.__unstableIsPreviewMode&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Ku,{}),(0,T.jsx)(Uu,{}),"template-locked"===a&&(0,T.jsx)(ou,{}),"wp_navigation"===v&&(0,T.jsx)(nu,{}),(0,T.jsx)(vi,{}),(0,T.jsx)(Lu,{}),(0,T.jsx)(Cu,{}),(0,T.jsx)(Eu,{}),(0,T.jsx)($u,{}),(0,T.jsx)(fu,{}),(0,T.jsx)(xu,{})]})]})})})}):null}));const Qu=function(e){return(0,T.jsx)(qu,{...e,BlockEditorProviderComponent:g.BlockEditorProvider,children:e.children})},Xu=window.wp.serverSideRender;var Ju=s.n(Xu);function ep(e,t,s=[]){const o=(0,C.forwardRef)(((s,o)=>(P()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),(0,T.jsx)(t,{ref:o,...s}))));return s.forEach((s=>{o[s]=ep(e+"."+s,t[s])})),o}function tp(e,t){return(...s)=>(P()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),t(...s))}const sp=ep("RichText",g.RichText,["Content"]);sp.isEmpty=tp("RichText.isEmpty",g.RichText.isEmpty);const op=ep("Autocomplete",g.Autocomplete),np=ep("AlignmentToolbar",g.AlignmentToolbar),ip=ep("BlockAlignmentToolbar",g.BlockAlignmentToolbar),rp=ep("BlockControls",g.BlockControls,["Slot"]),ap=ep("BlockEdit",g.BlockEdit),lp=ep("BlockEditorKeyboardShortcuts",g.BlockEditorKeyboardShortcuts),cp=ep("BlockFormatControls",g.BlockFormatControls,["Slot"]),dp=ep("BlockIcon",g.BlockIcon),up=ep("BlockInspector",g.BlockInspector),pp=ep("BlockList",g.BlockList),hp=ep("BlockMover",g.BlockMover),mp=ep("BlockNavigationDropdown",g.BlockNavigationDropdown),gp=ep("BlockSelectionClearer",g.BlockSelectionClearer),_p=ep("BlockSettingsMenu",g.BlockSettingsMenu),fp=ep("BlockTitle",g.BlockTitle),bp=ep("BlockToolbar",g.BlockToolbar),yp=ep("ColorPalette",g.ColorPalette),xp=ep("ContrastChecker",g.ContrastChecker),vp=ep("CopyHandler",g.CopyHandler),wp=ep("DefaultBlockAppender",g.DefaultBlockAppender),Sp=ep("FontSizePicker",g.FontSizePicker),kp=ep("Inserter",g.Inserter),Pp=ep("InnerBlocks",g.InnerBlocks,["ButtonBlockAppender","DefaultBlockAppender","Content"]),Cp=ep("InspectorAdvancedControls",g.InspectorAdvancedControls,["Slot"]),jp=ep("InspectorControls",g.InspectorControls,["Slot"]),Tp=ep("PanelColorSettings",g.PanelColorSettings),Ep=ep("PlainText",g.PlainText),Bp=ep("RichTextShortcut",g.RichTextShortcut),Ip=ep("RichTextToolbarButton",g.RichTextToolbarButton),Np=ep("__unstableRichTextInputEvent",g.__unstableRichTextInputEvent),Ap=ep("MediaPlaceholder",g.MediaPlaceholder),Dp=ep("MediaUpload",g.MediaUpload),Rp=ep("MediaUploadCheck",g.MediaUploadCheck),Mp=ep("MultiSelectScrollIntoView",g.MultiSelectScrollIntoView),Op=ep("NavigableToolbar",g.NavigableToolbar),Lp=ep("ObserveTyping",g.ObserveTyping),Fp=ep("SkipToSelectedBlock",g.SkipToSelectedBlock),Vp=ep("URLInput",g.URLInput),Up=ep("URLInputButton",g.URLInputButton),zp=ep("URLPopover",g.URLPopover),Hp=ep("Warning",g.Warning),Gp=ep("WritingFlow",g.WritingFlow),$p=tp("createCustomColorsHOC",g.createCustomColorsHOC),Wp=tp("getColorClassName",g.getColorClassName),Kp=tp("getColorObjectByAttributeValues",g.getColorObjectByAttributeValues),Zp=tp("getColorObjectByColorValue",g.getColorObjectByColorValue),Yp=tp("getFontSize",g.getFontSize),qp=tp("getFontSizeClass",g.getFontSizeClass),Qp=tp("withColorContext",g.withColorContext),Xp=tp("withColors",g.withColors),Jp=tp("withFontSizes",g.withFontSizes),eh=vi,th=vi;function sh(e){return P()("wp.editor.cleanForSlug",{since:"12.7",plugin:"Gutenberg",alternative:"wp.url.cleanForSlug"}),(0,S.cleanForSlug)(e)}const{createPrivateSlotFill:oh}=h(Tn.privateApis),nh=oh("EditCanvasContainerSlot"),ih="__experimentalMainDashboardButton",{Fill:rh,Slot:ah}=(0,Tn.createSlotFill)(ih),lh=rh;lh.Slot=({children:e})=>{const t=(0,Tn.__experimentalUseSlotFills)(ih);return Boolean(t&&t.length)?(0,T.jsx)(ah,{bubblesVirtually:!0,fillProps:{length:t?t.length:0}}):e};const ch=lh;var dh=function(){return dh=Object.assign||function(e){for(var t,s=1,o=arguments.length;s<o;s++)for(var n in t=arguments[s])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},dh.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function uh(e){return e.toLowerCase()}var ph=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],hh=/[^A-Z0-9]+/gi;function mh(e,t,s){return t instanceof RegExp?e.replace(t,s):t.reduce((function(e,t){return e.replace(t,s)}),e)}function gh(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var s=t.splitRegexp,o=void 0===s?ph:s,n=t.stripRegexp,i=void 0===n?hh:n,r=t.transform,a=void 0===r?uh:r,l=t.delimiter,c=void 0===l?" ":l,d=mh(mh(e,o,"$1\0$2"),i,"\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,dh({delimiter:"."},t))}function _h(e,t){return void 0===t&&(t={}),gh(e,dh({delimiter:"-"},t))}const fh=()=>(0,d.useSelect)((e=>e(b.store).getEntityRecords("postType",F,{per_page:-1})),[]),bh=(e,t)=>{const s=e.toLowerCase(),o=t.map((e=>e.title.rendered.toLowerCase()));if(!o.includes(s))return e;let n=2;for(;o.includes(`${s} ${n}`);)n++;return`${e} ${n}`},yh=e=>_h(e).replace(/[^\w-]+/g,"")||"wp-custom-part";function xh({modalTitle:e,...t}){const s=(0,d.useSelect)((e=>e(b.store).getPostType(F)?.labels?.add_new_item),[]);return(0,T.jsx)(Tn.Modal,{title:e||s,onRequestClose:t.closeModal,overlayClassName:"editor-create-template-part-modal",children:(0,T.jsx)(vh,{...t})})}function vh({defaultArea:e=O,blocks:t=[],confirmLabel:s=(0,m.__)("Add"),closeModal:o,onCreate:n,onError:i,defaultTitle:r=""}){const{createErrorNotice:a}=(0,d.useDispatch)(fs.store),{saveEntityRecord:l}=(0,d.useDispatch)(b.store),u=fh(),[p,h]=(0,C.useState)(r),[g,_]=(0,C.useState)(e),[f,y]=(0,C.useState)(!1),x=(0,pn.useInstanceId)(xh),v=(0,d.useSelect)((e=>e(cn).__experimentalGetDefaultTemplatePartAreas()),[]);return(0,T.jsx)("form",{onSubmit:async e=>{e.preventDefault(),await async function(){if(p&&!f)try{y(!0);const e=bh(p,u),s=yh(e),o=await l("postType",F,{slug:s,title:e,content:(0,c.serialize)(t),area:g},{throwOnError:!0});await n(o)}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,m.__)("An error occurred while creating the template part.");a(t,{type:"snackbar"}),i?.()}finally{y(!1)}}()},children:(0,T.jsxs)(Tn.__experimentalVStack,{spacing:"4",children:[(0,T.jsx)(Tn.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,m.__)("Name"),value:p,onChange:h,required:!0}),(0,T.jsx)(Tn.BaseControl,{label:(0,m.__)("Area"),id:`editor-create-template-part-modal__area-selection-${x}`,className:"editor-create-template-part-modal__area-base-control",children:(0,T.jsx)(Tn.__experimentalRadioGroup,{label:(0,m.__)("Area"),className:"editor-create-template-part-modal__area-radio-group",id:`editor-create-template-part-modal__area-selection-${x}`,onChange:_,checked:g,children:v.map((({icon:e,label:t,area:s,description:o})=>(0,T.jsx)(Tn.__experimentalRadio,{value:s,className:"editor-create-template-part-modal__area-radio",children:(0,T.jsxs)(Tn.Flex,{align:"start",justify:"start",children:[(0,T.jsx)(Tn.FlexItem,{children:(0,T.jsx)(Tn.Icon,{icon:e})}),(0,T.jsxs)(Tn.FlexBlock,{className:"editor-create-template-part-modal__option-label",children:[t,(0,T.jsx)("div",{children:o})]}),(0,T.jsx)(Tn.FlexItem,{className:"editor-create-template-part-modal__checkbox",children:g===s&&(0,T.jsx)(Tn.Icon,{icon:En})})]})},t)))})}),(0,T.jsxs)(Tn.__experimentalHStack,{justify:"right",children:[(0,T.jsx)(Tn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{o()},children:(0,m.__)("Cancel")}),(0,T.jsx)(Tn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit","aria-disabled":!p||f,isBusy:f,children:s})]})]})})}const wh=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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"})}),Sh=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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"})}),{useHasBlockToolbar:kh}=h(g.privateApis);const Ph=function({isCollapsed:e,onToggle:t}){const{blockSelectionStart:s}=(0,d.useSelect)((e=>({blockSelectionStart:e(g.store).getBlockSelectionStart()})),[]),o=kh(),n=!!s;return(0,C.useEffect)((()=>{s&&t(!1)}),[s,t]),o?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:jn("editor-collapsible-block-toolbar",{"is-collapsed":e||!n}),children:(0,T.jsx)(g.BlockToolbar,{hideDragHandle:!0})}),(0,T.jsx)(Tn.Popover.Slot,{name:"block-toolbar"}),(0,T.jsx)(Tn.Button,{className:"editor-collapsible-block-toolbar__toggle",icon:e?wh:Sh,onClick:()=>{t(!e)},label:e?(0,m.__)("Show block tools"):(0,m.__)("Hide block tools"),size:"compact"})]}):null},Ch=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})});const jh=function({className:e,disableBlockTools:t=!1}){const{setIsInserterOpened:s,setIsListViewOpened:o}=(0,d.useDispatch)(cn),{isDistractionFree:n,isInserterOpened:i,isListViewOpen:r,listViewShortcut:a,inserterSidebarToggleRef:l,listViewToggleRef:c,hasFixedToolbar:u,showIconLabels:p}=(0,d.useSelect)((e=>{const{getSettings:t}=e(g.store),{get:s}=e(B.store),{isListViewOpened:o,getEditorMode:n,getInserterSidebarToggleRef:i,getListViewToggleRef:r}=h(e(cn)),{getShortcutRepresentation:a}=e(Pn.store),{__unstableGetEditorMode:l}=e(g.store);return{isInserterOpened:e(cn).isInserterOpened(),isListViewOpen:o(),listViewShortcut:a("core/editor/toggle-list-view"),inserterSidebarToggleRef:i(),listViewToggleRef:r(),hasFixedToolbar:t().hasFixedToolbar,showIconLabels:s("core","showIconLabels"),isDistractionFree:s("core","distractionFree"),isVisualMode:"visual"===n(),isZoomedOutView:"zoom-out"===l()}}),[]),_=(0,pn.useViewportMatch)("medium"),f=(0,pn.useViewportMatch)("wide"),b=(0,m.__)("Document tools"),y=(0,C.useCallback)((()=>o(!r)),[o,r]),x=(0,C.useCallback)((()=>s(!i)),[i,s]),v=(0,m._x)("Toggle block inserter","Generic label for block inserter button"),w=i?(0,m.__)("Close"):(0,m.__)("Add");return(0,T.jsx)(g.NavigableToolbar,{className:jn("editor-document-tools","edit-post-header-toolbar",e),"aria-label":b,variant:"unstyled",children:(0,T.jsxs)("div",{className:"editor-document-tools__left",children:[!n&&(0,T.jsx)(Tn.ToolbarItem,{ref:l,as:Tn.Button,className:"editor-document-tools__inserter-toggle",variant:"primary",isPressed:i,onMouseDown:e=>{i&&e.preventDefault()},onClick:x,disabled:t,icon:Ch,label:p?w:v,showTooltip:!p,"aria-expanded":i}),(f||!p)&&(0,T.jsxs)(T.Fragment,{children:[_&&!u&&(0,T.jsx)(Tn.ToolbarItem,{as:g.ToolSelector,showTooltip:!p,variant:p?"tertiary":void 0,disabled:t,size:"compact"}),(0,T.jsx)(Tn.ToolbarItem,{as:Wi,showTooltip:!p,variant:p?"tertiary":void 0,size:"compact"}),(0,T.jsx)(Tn.ToolbarItem,{as:$i,showTooltip:!p,variant:p?"tertiary":void 0,size:"compact"}),!n&&(0,T.jsx)(Tn.ToolbarItem,{as:Tn.Button,className:"editor-document-tools__document-overview-toggle",icon:au,disabled:t,isPressed:r,label:(0,m.__)("Document Overview"),onClick:y,shortcut:a,showTooltip:!p,variant:p?"tertiary":void 0,"aria-expanded":r,ref:c,size:"compact"})]})]})})},Th=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});function Eh(){const{createNotice:e}=(0,d.useDispatch)(fs.store),{getCurrentPostId:t,getCurrentPostType:s}=(0,d.useSelect)(cn),{getEditedEntityRecord:o}=(0,d.useSelect)(b.store);const n=(0,pn.useCopyToClipboard)((function(){const e=o("postType",s(),t());return e?"function"==typeof e.content?e.content(e):e.blocks?(0,c.__unstableSerializeAndClean)(e.blocks):e.content?e.content:void 0:""}),(function(){e("info",(0,m.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,T.jsx)(Tn.MenuItem,{ref:n,children:(0,m.__)("Copy all blocks")})}const Bh=[{value:"visual",label:(0,m.__)("Visual editor")},{value:"text",label:(0,m.__)("Code editor")}];const Ih=function(){const{shortcut:e,isRichEditingEnabled:t,isCodeEditingEnabled:s,mode:o}=(0,d.useSelect)((e=>({shortcut:e(Pn.store).getShortcutRepresentation("core/editor/toggle-mode"),isRichEditingEnabled:e(cn).getEditorSettings().richEditingEnabled,isCodeEditingEnabled:e(cn).getEditorSettings().codeEditingEnabled,mode:e(cn).getEditorMode()})),[]),{switchEditorMode:n}=(0,d.useDispatch)(cn);let i=o;t||"visual"!==o||(i="text"),s||"text"!==o||(i="visual");const r=Bh.map((o=>(s||"text"!==o.value||(o={...o,disabled:!0}),t||"visual"!==o.value||(o={...o,disabled:!0,info:(0,m.__)("You can enable the visual editor in your profile settings.")}),o.value===i||o.disabled?o:{...o,shortcut:e})));return(0,T.jsx)(Tn.MenuGroup,{label:(0,m.__)("Editor"),children:(0,T.jsx)(Tn.MenuItemsChoice,{choices:r,value:i,onSelect:n})})},{Fill:Nh,Slot:Ah}=(0,Tn.createSlotFill)("ToolsMoreMenuGroup");Nh.Slot=({fillProps:e})=>(0,T.jsx)(Ah,{fillProps:e});const Dh=Nh,{Fill:Rh,Slot:Mh}=(0,Tn.createSlotFill)("web"===C.Platform.OS?Symbol("ViewMoreMenuGroup"):"ViewMoreMenuGroup");Rh.Slot=({fillProps:e})=>(0,T.jsx)(Mh,{fillProps:e});const Oh=Rh;function Lh(){const{openModal:e}=(0,d.useDispatch)(Xn),{set:t}=(0,d.useDispatch)(B.store),{toggleDistractionFree:s}=(0,d.useDispatch)(cn),o=(0,d.useSelect)((e=>e(B.store).get("core","showIconLabels")),[]),n=()=>{t("core","distractionFree",!1)};return(0,T.jsx)(T.Fragment,{children:(0,T.jsx)(Tn.DropdownMenu,{icon:Th,label:(0,m.__)("Options"),popoverProps:{placement:"bottom-end",className:"more-menu-dropdown__content"},toggleProps:{showTooltip:!o,...o&&{variant:"tertiary"},tooltipPosition:"bottom",size:"compact"},children:({onClose:t})=>(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(Tn.MenuGroup,{label:(0,m._x)("View","noun"),children:[(0,T.jsx)(B.PreferenceToggleMenuItem,{scope:"core",name:"fixedToolbar",onToggle:n,label:(0,m.__)("Top toolbar"),info:(0,m.__)("Access all block and document tools in a single place"),messageActivated:(0,m.__)("Top toolbar activated"),messageDeactivated:(0,m.__)("Top toolbar deactivated")}),(0,T.jsx)(B.PreferenceToggleMenuItem,{scope:"core",name:"distractionFree",label:(0,m.__)("Distraction free"),info:(0,m.__)("Write with calmness"),handleToggling:!1,onToggle:s,messageActivated:(0,m.__)("Distraction free mode activated"),messageDeactivated:(0,m.__)("Distraction free mode deactivated"),shortcut:Ci.displayShortcut.primaryShift("\\")}),(0,T.jsx)(B.PreferenceToggleMenuItem,{scope:"core",name:"focusMode",label:(0,m.__)("Spotlight mode"),info:(0,m.__)("Focus on one block at a time"),messageActivated:(0,m.__)("Spotlight mode activated"),messageDeactivated:(0,m.__)("Spotlight mode deactivated")}),(0,T.jsx)(Oh.Slot,{fillProps:{onClose:t}})]}),(0,T.jsx)(Ih,{}),(0,T.jsx)(ii.Slot,{name:"core/plugin-more-menu",label:(0,m.__)("Plugins"),as:Tn.MenuGroup,fillProps:{onClick:t}}),(0,T.jsxs)(Tn.MenuGroup,{label:(0,m.__)("Tools"),children:[(0,T.jsx)(Tn.MenuItem,{onClick:()=>e("editor/keyboard-shortcut-help"),shortcut:Ci.displayShortcut.access("h"),children:(0,m.__)("Keyboard shortcuts")}),(0,T.jsx)(Eh,{}),(0,T.jsxs)(Tn.MenuItem,{icon:hu,href:(0,m.__)("https://wordpress.org/documentation/article/wordpress-block-editor/"),target:"_blank",rel:"noopener noreferrer",children:[(0,m.__)("Help"),(0,T.jsx)(Tn.VisuallyHidden,{as:"span",children:(0,m.__)("(opens in a new tab)")})]}),(0,T.jsx)(Dh.Slot,{fillProps:{onClose:t}})]}),(0,T.jsx)(Tn.MenuGroup,{children:(0,T.jsx)(Tn.MenuItem,{onClick:()=>e("editor/preferences"),children:(0,m.__)("Preferences")})})]})})})}const Fh=(0,pn.compose)((0,d.withSelect)((e=>{var t;return{hasPublishAction:null!==(t=e(cn).getCurrentPost()?._links?.["wp:action-publish"])&&void 0!==t&&t,isBeingScheduled:e(cn).isEditedPostBeingScheduled(),isPending:e(cn).isCurrentPostPending(),isPublished:e(cn).isCurrentPostPublished(),isPublishSidebarEnabled:e(cn).isPublishSidebarEnabled(),isPublishSidebarOpened:e(cn).isPublishSidebarOpened(),isScheduled:e(cn).isCurrentPostScheduled(),postStatus:e(cn).getEditedPostAttribute("status"),postStatusHasChanged:e(cn).getPostEdits()?.status}})),(0,d.withDispatch)((e=>{const{togglePublishSidebar:t}=e(cn);return{togglePublishSidebar:t}})))((function({forceIsDirty:e,hasPublishAction:t,isBeingScheduled:s,isPending:o,isPublished:n,isPublishSidebarEnabled:i,isPublishSidebarOpened:r,isScheduled:a,togglePublishSidebar:l,setEntitiesSavedStatesCallback:c,postStatusHasChanged:d,postStatus:u}){const p="toggle",h="button",m=(0,pn.useViewportMatch)("medium","<");let g;return g=n||d&&!["future","publish"].includes(u)||a&&s||o&&!t&&!m?h:m||i?p:h,(0,T.jsx)(El,{forceIsDirty:e,isOpen:r,isToggle:g===p,onToggle:l,setEntitiesSavedStatesCallback:c})}));function Vh(){const{hasLoaded:e,permalink:t,isPublished:s,label:o,showIconLabels:n}=(0,d.useSelect)((e=>{const t=e(cn).getCurrentPostType(),s=e(b.store).getPostType(t),{get:o}=e(B.store);return{permalink:e(cn).getPermalink(),isPublished:e(cn).isCurrentPostPublished(),label:s?.labels.view_item,hasLoaded:!!s,showIconLabels:o("core","showIconLabels")}}),[]);return s&&t&&e?(0,T.jsx)(Tn.Button,{icon:hu,label:o||(0,m.__)("View post"),href:t,target:"_blank",showTooltip:!n,size:"compact"}):null}const Uh=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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"})}),zh=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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"})}),Hh=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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"})});function Gh({forceIsAutosaveable:e,disabled:t}){const{deviceType:s,homeUrl:o,isTemplate:n,isViewable:i,showIconLabels:r}=(0,d.useSelect)((e=>{var t;const{getDeviceType:s,getCurrentPostType:o}=e(cn),{getUnstableBase:n,getPostType:i}=e(b.store),{get:r}=e(B.store),a=o();return{deviceType:s(),homeUrl:n()?.home,isTemplate:"wp_template"===a,isViewable:null!==(t=i(a)?.viewable)&&void 0!==t&&t,showIconLabels:r("core","showIconLabels")}}),[]),{setDeviceType:a}=(0,d.useDispatch)(cn);if((0,pn.useViewportMatch)("medium","<"))return null;const l={className:"editor-preview-dropdown__toggle",size:"compact",showTooltip:!r,disabled:t,__experimentalIsFocusable:t},c={"aria-label":(0,m.__)("View options")},u={mobile:Uh,tablet:zh,desktop:Hh};return(0,T.jsx)(Tn.DropdownMenu,{className:"editor-preview-dropdown",popoverProps:{placement:"bottom-end"},toggleProps:l,menuProps:c,icon:u[s.toLowerCase()],label:(0,m.__)("View"),disableOpenOnArrowDown:t,children:({onClose:t})=>(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(Tn.MenuGroup,{children:[(0,T.jsx)(Tn.MenuItem,{onClick:()=>a("Desktop"),icon:"Desktop"===s&&En,children:(0,m.__)("Desktop")}),(0,T.jsx)(Tn.MenuItem,{onClick:()=>a("Tablet"),icon:"Tablet"===s&&En,children:(0,m.__)("Tablet")}),(0,T.jsx)(Tn.MenuItem,{onClick:()=>a("Mobile"),icon:"Mobile"===s&&En,children:(0,m.__)("Mobile")})]}),n&&(0,T.jsx)(Tn.MenuGroup,{children:(0,T.jsxs)(Tn.MenuItem,{href:o,target:"_blank",icon:hu,onClick:t,children:[(0,m.__)("View site"),(0,T.jsx)(Tn.VisuallyHidden,{as:"span",children:(0,m.__)("(opens in a new tab)")})]})}),i&&(0,T.jsx)(Tn.MenuGroup,{children:(0,T.jsx)(Pl,{className:"editor-preview-dropdown__button-external",role:"menuitem",forceIsAutosaveable:e,textContent:(0,T.jsxs)(T.Fragment,{children:[(0,m.__)("Preview in new tab"),(0,T.jsx)(Tn.Icon,{icon:hu})]}),onPreview:t})})]})})}const $h={distractionFreeDisabled:{y:"-50px"},distractionFreeHover:{y:0},distractionFreeHidden:{y:"-50px"},visible:{y:0},hidden:{y:0}},Wh={distractionFreeDisabled:{x:"-100%"},distractionFreeHover:{x:0},distractionFreeHidden:{x:"-100%"},visible:{x:0},hidden:{x:0}};const Kh=function({customSaveButton:e,forceIsDirty:t,forceDisableBlockTools:s,setEntitiesSavedStatesCallback:o,title:n}){const i=(0,pn.useViewportMatch)("large"),r=(0,pn.useViewportMatch)("medium"),{isTextEditor:a,isPublishSidebarOpened:l,showIconLabels:c,hasFixedToolbar:u,isNestedEntity:p,isZoomedOutView:h}=(0,d.useSelect)((e=>{const{get:t}=e(B.store),{getEditorMode:s,getEditorSettings:o,isPublishSidebarOpened:n}=e(cn),{__unstableGetEditorMode:i}=e(g.store);return{isTextEditor:"text"===s(),isPublishSidebarOpened:n(),showIconLabels:t("core","showIconLabels"),hasFixedToolbar:t("core","fixedToolbar"),isNestedEntity:!!o().onNavigateToPreviousEntityRecord,isZoomedOutView:"zoom-out"===i()}}),[]),m=r&&u,[_,f]=(0,C.useState)(!0);return(0,T.jsxs)("div",{className:"editor-header edit-post-header",children:[(0,T.jsx)(Tn.__unstableMotion.div,{variants:Wh,transition:{type:"tween"},children:(0,T.jsx)(ch.Slot,{})}),(0,T.jsxs)(Tn.__unstableMotion.div,{variants:$h,className:"editor-header__toolbar",transition:{type:"tween"},children:[(0,T.jsx)(jh,{disableBlockTools:s||a}),m&&(0,T.jsx)(Ph,{isCollapsed:_,onToggle:f}),(0,T.jsx)("div",{className:jn("editor-header__center",{"is-collapsed":!_&&m}),children:n||(0,T.jsx)(Bi,{})})]}),(0,T.jsxs)(Tn.__unstableMotion.div,{variants:$h,transition:{type:"tween"},className:"editor-header__settings",children:[!e&&!l&&(0,T.jsx)(zc,{forceIsDirty:t}),(0,T.jsx)(Gh,{forceIsAutosaveable:t,disabled:p||h}),(0,T.jsx)(Pl,{className:"editor-header__post-preview-button",forceIsAutosaveable:t}),(0,T.jsx)(Vh,{}),!e&&(0,T.jsx)(Fh,{forceIsDirty:t,setEntitiesSavedStatesCallback:o}),e,(i||!c)&&(0,T.jsx)(ci.Slot,{scope:"core"}),(0,T.jsx)(Lh,{})]})]})},{PrivateInserterLibrary:Zh}=h(g.privateApis);function Yh(){const{blockSectionRootClientId:e,inserterSidebarToggleRef:t,insertionPoint:s,showMostUsedBlocks:o,sidebarIsOpened:n}=(0,d.useSelect)((e=>{const{getInserterSidebarToggleRef:t,getInsertionPoint:s,isPublishSidebarOpened:o}=h(e(cn)),{getBlockRootClientId:n,__unstableGetEditorMode:i,getSettings:r}=e(g.store),{get:a}=e(B.store),{getActiveComplementaryArea:l}=e(Xn);return{inserterSidebarToggleRef:t(),insertionPoint:s(),showMostUsedBlocks:a("core","mostUsedBlocks"),blockSectionRootClientId:(()=>{if("zoom-out"===i()){const{sectionRootClientId:e}=h(r());if(e)return e}return n()})(),sidebarIsOpened:!(!l("core")&&!o())}}),[]),{setIsInserterOpened:i}=(0,d.useDispatch)(cn),{disableComplementaryArea:r}=(0,d.useDispatch)(Xn),a=(0,pn.useViewportMatch)("medium","<"),[l,c]=(0,pn.__experimentalUseDialog)({onClose:()=>i(!1),focusOnMount:!0}),u=(0,C.useRef)(),p=(0,C.useCallback)((()=>{i(!1),t.current?.focus()}),[t,i]),m=(0,C.useCallback)((e=>{e.keyCode!==Ci.ESCAPE||e.defaultPrevented||(e.preventDefault(),p())}),[p]),_=(0,T.jsx)("div",{className:"editor-inserter-sidebar__content",children:(0,T.jsx)(Zh,{showMostUsedBlocks:o,showInserterHelpPanel:!0,shouldFocusBlock:a,rootClientId:null!=e?e:s.rootClientId,__experimentalInsertionIndex:s.insertionIndex,__experimentalInitialTab:s.tab,__experimentalInitialCategory:s.category,__experimentalFilterValue:s.filterValue,onPatternCategorySelection:n?()=>r("core"):void 0,ref:u,onClose:p})});return window.__experimentalEnableZoomedOutPatternsTab?(0,T.jsx)("div",{onKeyDown:m,className:"editor-inserter-sidebar",children:_}):(0,T.jsx)("div",{ref:l,...c,className:"editor-inserter-sidebar",children:_})}function qh(){return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)("div",{className:"editor-list-view-sidebar__outline",children:[(0,T.jsxs)("div",{children:[(0,T.jsx)(Tn.__experimentalText,{children:(0,m.__)("Characters:")}),(0,T.jsx)(Tn.__experimentalText,{children:(0,T.jsx)(Td,{})})]}),(0,T.jsxs)("div",{children:[(0,T.jsx)(Tn.__experimentalText,{children:(0,m.__)("Words:")}),(0,T.jsx)(Pd,{})]}),(0,T.jsxs)("div",{children:[(0,T.jsx)(Tn.__experimentalText,{children:(0,m.__)("Time to read:")}),(0,T.jsx)(jd,{})]})]}),(0,T.jsx)(Vi,{})]})}const{Tabs:Qh}=h(Tn.privateApis);function Xh(){const{setIsListViewOpened:e}=(0,d.useDispatch)(cn),{getListViewToggleRef:t}=h((0,d.useSelect)(cn)),s=(0,pn.useFocusOnMount)("firstElement"),o=(0,C.useCallback)((()=>{e(!1),t().current?.focus()}),[t,e]),n=(0,C.useCallback)((e=>{e.keyCode!==Ci.ESCAPE||e.defaultPrevented||(e.preventDefault(),o())}),[o]),[i,r]=(0,C.useState)(null),[a,l]=(0,C.useState)("list-view"),c=(0,C.useRef)(),u=(0,C.useRef)(),p=(0,C.useRef)(),_=(0,pn.useMergeRefs)([s,p,r]);const f=(0,C.useCallback)((()=>{c.current.contains(c.current.ownerDocument.activeElement)?o():function(e){const t=rd.focus.tabbable.find(u.current)[0];if("list-view"===e){const e=rd.focus.tabbable.find(p.current)[0];(c.current.contains(e)?e:t).focus()}else t.focus()}(a)}),[o,a]);return(0,Pn.useShortcut)("core/editor/toggle-list-view",f),(0,T.jsx)("div",{className:"editor-list-view-sidebar",onKeyDown:n,ref:c,children:(0,T.jsxs)(Qh,{onSelect:e=>l(e),selectOnMove:!1,defaultTabId:"list-view",children:[(0,T.jsxs)("div",{className:"editor-list-view-sidebar__header",children:[(0,T.jsx)(Tn.Button,{className:"editor-list-view-sidebar__close-button",icon:An,label:(0,m.__)("Close"),onClick:o,size:"small"}),(0,T.jsxs)(Qh.TabList,{className:"editor-list-view-sidebar__tabs-tablist",ref:u,children:[(0,T.jsx)(Qh.Tab,{className:"editor-list-view-sidebar__tabs-tab",tabId:"list-view",children:(0,m._x)("List View","Post overview")}),(0,T.jsx)(Qh.Tab,{className:"editor-list-view-sidebar__tabs-tab",tabId:"outline",children:(0,m._x)("Outline","Post overview")})]})]}),(0,T.jsx)(Qh.TabPanel,{ref:_,className:"editor-list-view-sidebar__tabs-tabpanel",tabId:"list-view",focusable:!1,children:(0,T.jsx)("div",{className:"editor-list-view-sidebar__list-view-container",children:(0,T.jsx)("div",{className:"editor-list-view-sidebar__list-view-panel-content",children:(0,T.jsx)(g.__experimentalListView,{dropZoneElement:i})})})}),(0,T.jsx)(Qh.TabPanel,{className:"editor-list-view-sidebar__tabs-tabpanel",tabId:"outline",focusable:!1,children:(0,T.jsx)("div",{className:"editor-list-view-sidebar__list-view-container",children:(0,T.jsx)(qh,{})})})]})})}const{Fill:Jh,Slot:em}=(0,Tn.createSlotFill)("ActionsPanel");function tm({setEntitiesSavedStatesCallback:e,closeEntitiesSavedStates:t,isEntitiesSavedStatesOpen:s,forceIsDirtyPublishPanel:o}){const{closePublishSidebar:n,togglePublishSidebar:i}=(0,d.useDispatch)(cn),{publishSidebarOpened:r,isPublishable:a,isDirty:l,hasOtherEntitiesChanges:c}=(0,d.useSelect)((e=>{const{isPublishSidebarOpened:t,isEditedPostPublishable:s,isCurrentPostPublished:o,isEditedPostDirty:n,hasNonPostEntityChanges:i}=e(cn),r=i();return{publishSidebarOpened:t(),isPublishable:!o()&&s(),isDirty:r||n(),hasOtherEntitiesChanges:r}}),[]),u=(0,C.useCallback)((()=>e(!0)),[]);let p;return p=r?(0,T.jsx)(Dc,{onClose:n,forceIsDirty:o,PrePublishExtension:ba.Slot,PostPublishExtension:da.Slot}):a&&!c?(0,T.jsx)("div",{className:"editor-layout__toggle-publish-panel",children:(0,T.jsx)(Tn.Button,{variant:"secondary",className:"editor-layout__toggle-publish-panel-button",onClick:i,"aria-expanded":!1,children:(0,m.__)("Open publish panel")})}):(0,T.jsx)("div",{className:"editor-layout__toggle-entities-saved-states-panel",children:(0,T.jsx)(Tn.Button,{variant:"secondary",className:"editor-layout__toggle-entities-saved-states-panel-button",onClick:u,"aria-expanded":!1,disabled:!l,__experimentalIsFocusable:!0,children:(0,m.__)("Open save panel")})}),(0,T.jsxs)(T.Fragment,{children:[s&&(0,T.jsx)(ir,{close:t}),(0,T.jsx)(em,{bubblesVirtually:!0}),!s&&p]})}function sm({autoFocus:e=!1}){const{switchEditorMode:t}=(0,d.useDispatch)(cn),{shortcut:s,isRichEditingEnabled:o}=(0,d.useSelect)((e=>{const{getEditorSettings:t}=e(cn),{getShortcutRepresentation:s}=e(Pn.store);return{shortcut:s("core/editor/toggle-mode"),isRichEditingEnabled:t().richEditingEnabled}}),[]),n=(0,C.useRef)();return(0,C.useEffect)((()=>{e||n?.current?.focus()}),[e]),(0,T.jsxs)("div",{className:"editor-text-editor",children:[o&&(0,T.jsxs)("div",{className:"editor-text-editor__toolbar",children:[(0,T.jsx)("h2",{children:(0,m.__)("Editing code")}),(0,T.jsx)(Tn.Button,{variant:"tertiary",onClick:()=>t("visual"),shortcut:s,children:(0,m.__)("Exit code editor")})]}),(0,T.jsxs)("div",{className:"editor-text-editor__body",children:[(0,T.jsx)(pd,{ref:n}),(0,T.jsx)(id,{})]})]})}function om({contentRef:e}){const{onNavigateToEntityRecord:t,templateId:s}=(0,d.useSelect)((e=>{const{getEditorSettings:t,getCurrentTemplateId:s}=e(cn);return{onNavigateToEntityRecord:t().onNavigateToEntityRecord,templateId:s()}}),[]),o=(0,d.useSelect)((e=>{var t;return null!==(t=e(b.store).canUser("create","templates"))&&void 0!==t&&t})),[n,i]=(0,C.useState)(!1);return(0,C.useEffect)((()=>{const t=e=>{o&&e.target.classList.contains("is-root-container")&&i(!0)},s=e.current;return s?.addEventListener("dblclick",t),()=>{s?.removeEventListener("dblclick",t)}}),[e,o]),o?(0,T.jsx)(Tn.__experimentalConfirmDialog,{isOpen:n,confirmButtonText:(0,m.__)("Edit template"),onConfirm:()=>{i(!1),t({postId:s,postType:"wp_template"})},onCancel:()=>i(!1),size:"medium",children:(0,m.__)("You’ve tried to select a block that is part of a template, which may be used on other posts and pages. Would you like to edit the template?")}):null}const nm=20;function im({direction:e,resizeWidthBy:t}){const s=`resizable-editor__resize-help-${e}`;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Tn.Tooltip,{text:(0,m.__)("Drag to resize"),children:(0,T.jsx)(Tn.__unstableMotion.button,{className:`editor-resizable-editor__resize-handle is-${e}`,"aria-label":(0,m.__)("Drag to resize"),"aria-describedby":s,onKeyDown:function(s){const{keyCode:o}=s;"left"===e&&o===Ci.LEFT||"right"===e&&o===Ci.RIGHT?t(nm):("left"===e&&o===Ci.RIGHT||"right"===e&&o===Ci.LEFT)&&t(-nm)},variants:{active:{opacity:1,scaleY:1.3}},whileFocus:"active",whileHover:"active",whileTap:"active",role:"separator","aria-orientation":"vertical"},"handle")}),(0,T.jsx)(Tn.VisuallyHidden,{id:s,children:(0,m.__)("Use left and right arrow keys to resize the canvas.")})]})}const rm={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};const am=function({className:e,enableResizing:t,height:s,children:o}){const[n,i]=(0,C.useState)("100%"),r=(0,C.useRef)(),a=(0,C.useCallback)((e=>{r.current&&i(r.current.offsetWidth+e)}),[]);return(0,T.jsx)(Tn.ResizableBox,{className:jn("editor-resizable-editor",e,{"is-resizable":t}),ref:e=>{r.current=e?.resizable},size:{width:t?n:"100%",height:t&&s?s:"100%"},onResizeStop:(e,t,s)=>{i(s.style.width)},minWidth:300,maxWidth:"100%",maxHeight:"100%",enable:{left:t,right:t},showHandle:t,resizeRatio:2,handleComponent:{left:(0,T.jsx)(im,{direction:"left",resizeWidthBy:a}),right:(0,T.jsx)(im,{direction:"right",resizeWidthBy:a})},handleClasses:void 0,handleStyles:{left:rm,right:rm},children:o})},lm=500;function cm(e,t,s){return Math.min(Math.max(e,t),s)}function dm(e,t,s){const o=e-cm(e,s.left,s.right),n=t-cm(t,s.top,s.bottom);return Math.sqrt(o*o+n*n)}function um({isEnabled:e=!0}={}){const{getEnabledClientIdsTree:t,getBlockName:s,getBlockOrder:o}=h((0,d.useSelect)(g.store)),{selectBlock:n}=(0,d.useDispatch)(g.store);return(0,pn.useRefEffect)((i=>{if(!e)return;const r=e=>{(e.target===i||e.target.classList.contains("is-root-container"))&&((e,r)=>{const a=t().flatMap((({clientId:e})=>{const t=s(e);if("core/template-part"===t)return[];if("core/post-content"===t){const t=o(e);if(t.length)return t}return[e]}));let l=1/0,c=null;for(const t of a){const s=i.querySelector(`[data-block="${t}"]`);if(!s)continue;const o=dm(e,r,s.getBoundingClientRect());o<l&&o<lm&&(l=o,c=t)}c&&n(c)})(e.clientX,e.clientY)};return i.addEventListener("click",r),()=>i.removeEventListener("click",r)}),[e])}const{LayoutStyle:pm,useLayoutClasses:hm,useLayoutStyles:mm,ExperimentalBlockCanvas:gm,useFlashEditableBlocks:_m}=h(g.privateApis),fm=[V,L,U,F];function bm(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=bm(e[t].innerBlocks);if(s)return s}}}function ym(e){for(let t=0;t<e.length;t++)if("core/post-content"===e[t].name)return!0;return!1}const xm=function({autoFocus:e,styles:t,disableIframe:s=!1,iframeProps:o,contentRef:n,className:i}){const[r,a]=(0,pn.useResizeObserver)(),l=(0,pn.useViewportMatch)("small","<"),{renderingMode:u,postContentAttributes:p,editedPostTemplate:h={},wrapperBlockName:m,wrapperUniqueId:_,deviceType:f,isFocusedEntity:y,isDesignPostType:x,postType:v,isPreview:w}=(0,d.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s,getCurrentTemplateId:o,getEditorSettings:n,getRenderingMode:i,getDeviceType:r}=e(cn),{getPostType:a,canUser:l,getEditedEntityRecord:c}=e(b.store),d=s(),u=i();let p;d===V?p="core/block":"post-only"===u&&(p="core/post-content");const h=n(),m=h.supportsTemplateMode,g=a(d),_=l("create","templates"),f=o(),y=f?c("postType",L,f):void 0;return{renderingMode:u,postContentAttributes:h.postContentAttributes,isDesignPostType:fm.includes(d),editedPostTemplate:g?.viewable&&m&&_?y:void 0,wrapperBlockName:p,wrapperUniqueId:t(),deviceType:r(),isFocusedEntity:!!h.onNavigateToPreviousEntityRecord,postType:d,isPreview:h.__unstableIsPreviewMode}}),[]),{isCleanNewPost:S}=(0,d.useSelect)(cn),{hasRootPaddingAwareAlignments:k,themeHasDisabledLayoutStyles:P,themeSupportsLayout:j,isZoomOutMode:E}=(0,d.useSelect)((e=>{const{getSettings:t,__unstableGetEditorMode:s}=e(g.store),o=t();return{themeHasDisabledLayoutStyles:o.disableLayoutStyles,themeSupportsLayout:o.supportsLayout,hasRootPaddingAwareAlignments:o.__experimentalFeatures?.useRootPaddingAwareAlignments,isZoomOutMode:"zoom-out"===s()}}),[]),B=(0,g.__experimentalUseResizeCanvas)(f),[I]=(0,g.useSettings)("layout"),N=(0,C.useMemo)((()=>"post-only"!==u||x?{type:"default"}:j?{...I,type:"constrained"}:{type:"default"}),[u,j,I,x]),A=(0,C.useMemo)((()=>{if(!h?.content&&!h?.blocks&&p)return p;if(h?.blocks)return bm(h?.blocks);const e="string"==typeof h?.content?h?.content:"";return bm((0,c.parse)(e))||{}}),[h?.content,h?.blocks,p]),D=(0,C.useMemo)((()=>{if(!h?.content&&!h?.blocks)return!1;if(h?.blocks)return ym(h?.blocks);const e="string"==typeof h?.content?h?.content:"";return ym((0,c.parse)(e))||!1}),[h?.content,h?.blocks]),{layout:R={},align:M=""}=A||{},O=hm(A,"core/post-content"),z=jn({"is-layout-flow":!j},j&&O,M&&`align${M}`),H=mm(A,"core/post-content",".block-editor-block-list__layout.is-root-container"),G=(0,C.useMemo)((()=>R&&("constrained"===R?.type||R?.inherit||R?.contentSize||R?.wideSize)?{...I,...R,type:"constrained"}:{...I,...R,type:"default"}),[R?.type,R?.inherit,R?.contentSize,R?.wideSize,I]),$=p?G:N,W="default"!==$?.type||D?$:N,K=(0,g.__unstableUseTypingObserver)(),Z=(0,C.useRef)();(0,C.useEffect)((()=>{e&&S()&&Z?.current?.focus()}),[e,S]);const Y=(0,C.useRef)(),q=(0,g.__unstableUseTypewriter)();n=(0,pn.useMergeRefs)([Y,n,"post-only"===u?q:null,_m({isEnabled:"template-locked"===u}),um({isEnabled:"template-locked"===u})]);const Q=E?{scale:"default",frameSize:"20px"}:{},X=v===U,J=[U,F,V].includes(v)&&!w&&!l&&!E,ee=!s||["Tablet","Mobile"].includes(f),te=(0,C.useMemo)((()=>[...null!=t?t:[],{css:`.is-root-container{display:flow-root;${J?"min-height:0!important;":""}}`}]),[t,J]);return(0,T.jsx)("div",{className:jn("editor-visual-editor","edit-post-visual-editor",i,{"has-padding":y||J,"is-resizable":J,"is-iframed":ee}),children:(0,T.jsx)(am,{enableResizing:J,height:a.height&&!X?a.height:"100%",children:(0,T.jsxs)(gm,{shouldIframe:ee,contentRef:n,styles:te,height:"100%",iframeProps:{...o,...Q,style:{...o?.style,...B}},children:[j&&!P&&"post-only"===u&&!x&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(pm,{selector:".editor-visual-editor__post-title-wrapper",layout:N}),(0,T.jsx)(pm,{selector:".block-editor-block-list__layout.is-root-container",layout:W}),M&&(0,T.jsx)(pm,{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;}"}),H&&(0,T.jsx)(pm,{layout:G,css:H})]}),"post-only"===u&&!x&&(0,T.jsx)("div",{className:jn("editor-visual-editor__post-title-wrapper","edit-post-visual-editor__post-title-wrapper",{"has-global-padding":k}),contentEditable:!1,ref:K,style:{marginTop:"4rem"},children:(0,T.jsx)(ud,{ref:Z})}),(0,T.jsxs)(g.RecursionProvider,{blockName:m,uniqueId:_,children:[(0,T.jsx)(g.BlockList,{className:jn("is-"+f.toLowerCase()+"-preview","post-only"!==u||x?"wp-site-blocks":`${z} wp-block-post-content`),layout:$,dropZoneElement:s?Y.current:Y.current?.parentNode,__unstableDisableDropZone:"template-locked"===u}),"template-locked"===u&&(0,T.jsx)(om,{contentRef:Y})]}),J&&r]})})})},vm={header:(0,m.__)("Editor top bar"),body:(0,m.__)("Editor content"),sidebar:(0,m.__)("Editor settings"),actions:(0,m.__)("Editor publish"),footer:(0,m.__)("Editor footer")};function wm({className:e,enableRegionNavigation:t,styles:s,children:o,forceIsDirty:n,contentRef:i,disableIframe:r,autoFocus:a,customSaveButton:l,customSavePanel:c,forceDisableBlockTools:u,title:p,iframeProps:h}){const{mode:_,isRichEditingEnabled:f,isInserterOpened:b,isListViewOpened:y,isDistractionFree:x,isPreviewMode:v,previousShortcut:w,nextShortcut:S,showBlockBreadcrumbs:k,documentLabel:P,blockEditorMode:j}=(0,d.useSelect)((e=>{const{get:t}=e(B.store),{getEditorSettings:s,getPostTypeLabel:o}=e(cn),n=s(),i=o();return{mode:e(cn).getEditorMode(),isRichEditingEnabled:n.richEditingEnabled,isInserterOpened:e(cn).isInserterOpened(),isListViewOpened:e(cn).isListViewOpened(),isDistractionFree:t("core","distractionFree"),isPreviewMode:n.__unstableIsPreviewMode,previousShortcut:e(Pn.store).getAllShortcutKeyCombinations("core/editor/previous-region"),nextShortcut:e(Pn.store).getAllShortcutKeyCombinations("core/editor/next-region"),showBlockBreadcrumbs:t("core","showBlockBreadcrumbs"),documentLabel:i||(0,m._x)("Document","noun"),blockEditorMode:e(g.store).__unstableGetEditorMode()}}),[]),E=(0,pn.useViewportMatch)("large"),I=(0,pn.useViewportMatch)("medium"),N=y?(0,m.__)("Document Overview"):(0,m.__)("Block Library"),[A,D]=(0,C.useState)(!1),R=(0,C.useCallback)((e=>{"function"==typeof A&&A(e),D(!1)}),[A]);return(0,T.jsx)(xi,{enableRegionNavigation:t,isDistractionFree:x&&E,className:jn("editor-editor-interface",e,{"is-entity-save-view-open":!!A,"is-distraction-free":x&&E&&!v}),labels:{...vm,secondarySidebar:N},header:!v&&(0,T.jsx)(Kh,{forceIsDirty:n,setEntitiesSavedStatesCallback:D,customSaveButton:l,forceDisableBlockTools:u,title:p}),editorNotices:(0,T.jsx)(Zi,{}),secondarySidebar:!v&&"visual"===_&&(b&&(0,T.jsx)(Yh,{})||y&&(0,T.jsx)(Xh,{})),sidebar:!v&&!x&&(0,T.jsx)(gi.Slot,{scope:"core"}),content:(0,T.jsxs)(T.Fragment,{children:[!x&&!v&&(0,T.jsx)(Zi,{}),(0,T.jsx)(nh.Slot,{children:([e])=>e||(0,T.jsxs)(T.Fragment,{children:[!v&&("text"===_||!f)&&(0,T.jsx)(sm,{autoFocus:a}),!v&&!I&&"visual"===_&&(0,T.jsx)(g.BlockToolbar,{hideDragHandle:!0}),(v||f&&"visual"===_)&&(0,T.jsx)(xm,{styles:s,contentRef:i,disableIframe:r,autoFocus:a,iframeProps:h}),o]})})]}),footer:!v&&!x&&I&&k&&f&&"zoom-out"!==j&&"visual"===_&&(0,T.jsx)(g.BlockBreadcrumb,{rootLabelText:P}),actions:v?void 0:c||(0,T.jsx)(tm,{closeEntitiesSavedStates:R,isEntitiesSavedStatesOpen:A,setEntitiesSavedStatesCallback:D,forceIsDirtyPublishPanel:n}),shortcuts:{previous:w,next:S}})}const{OverridesPanel:Sm}=h(_n.privateApis);function km(){return(0,d.useSelect)((e=>"wp_block"===e(cn).getCurrentPostType()),[])?(0,T.jsx)(Sm,{}):null}const Pm=(0,T.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,T.jsx)(j.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"})});"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 o=Number(0xffffffffn&t),n=Number(t>>32n);this.setUint32(e+(s?0:4),o,s),this.setUint32(e+(s?4:0),n,s)}});var Cm=e=>new DataView(new ArrayBuffer(e)),jm=e=>new Uint8Array(e.buffer||e),Tm=e=>(new TextEncoder).encode(String(e)),Em=e=>Math.min(4294967295,Number(e)),Bm=e=>Math.min(65535,Number(e));function Im(e,t){if(void 0===t||t instanceof Date||(t=new Date(t)),e instanceof File)return{isFile:1,t:t||new Date(e.lastModified),i:e.stream()};if(e instanceof Response)return{isFile:1,t:t||new Date(e.headers.get("Last-Modified")||Date.now()),i:e.body};if(void 0===t)t=new Date;else if(isNaN(t))throw new Error("Invalid modification date.");if(void 0===e)return{isFile:0,t};if("string"==typeof e)return{isFile:1,t,i:Tm(e)};if(e instanceof Blob)return{isFile:1,t,i:e.stream()};if(e instanceof Uint8Array||e instanceof ReadableStream)return{isFile:1,t,i:e};if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return{isFile:1,t,i:jm(e)};if(Symbol.asyncIterator in e)return{isFile:1,t,i:Nm(e[Symbol.asyncIterator]())};throw new TypeError("Unsupported input format.")}function Nm(e,t=e){return new ReadableStream({async pull(t){let s=0;for(;t.desiredSize>s;){const o=await e.next();if(!o.value){t.close();break}{const e=Am(o.value);t.enqueue(e),s+=e.byteLength}}},cancel(e){t.throw?.(e)}})}function Am(e){return"string"==typeof e?Tm(e):e instanceof Uint8Array?e:jm(e)}function Dm(e,t,s){let[o,n]=function(e){return e?e instanceof Uint8Array?[e,1]:ArrayBuffer.isView(e)||e instanceof ArrayBuffer?[jm(e),1]:[Tm(e),0]:[void 0,0]}(t);if(e instanceof File)return{o:Mm(o||Tm(e.name)),u:BigInt(e.size),l:n};if(e instanceof Response){const t=e.headers.get("content-disposition"),i=t&&t.match(/;\s*filename\*?=["']?(.*?)["']?$/i),r=i&&i[1]||e.url&&new URL(e.url).pathname.split("/").findLast(Boolean),a=r&&decodeURIComponent(r),l=s||+e.headers.get("content-length");return{o:Mm(o||Tm(a)),u:BigInt(l),l:n}}return o=Mm(o,void 0!==e||void 0!==s),"string"==typeof e?{o,u:BigInt(Tm(e).length),l:n}:e instanceof Blob?{o,u:BigInt(e.size),l:n}:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?{o,u:BigInt(e.byteLength),l:n}:{o,u:Rm(e,s),l:n}}function Rm(e,t){return t>-1?BigInt(t):e?void 0:0n}function Mm(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 Om=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);Om[e]=t}function Lm(e,t=0){t^=-1;for(var s=0,o=e.length;s<o;s++)t=t>>>8^Om[255&t^e[s]];return(-1^t)>>>0}function Fm(e,t,s=0){const o=e.getSeconds()>>1|e.getMinutes()<<5|e.getHours()<<11,n=e.getDate()|e.getMonth()+1<<5|e.getFullYear()-1980<<9;t.setUint16(s,o,1),t.setUint16(s+2,n,1)}function Vm({o:e,l:t},s){return 8*(!t||(s??function(e){try{Um.decode(e)}catch{return 0}return 1}(e)))}var Um=new TextDecoder("utf8",{fatal:1});function zm(e,t=0){const s=Cm(30);return s.setUint32(0,1347093252),s.setUint32(4,754976768|t),Fm(e.t,s,10),s.setUint16(26,e.o.length,1),jm(s)}async function*Hm(e){let{i:t}=e;if("then"in t&&(t=await t),t instanceof Uint8Array)yield t,e.m=Lm(t,0),e.u=BigInt(t.length);else{e.u=0n;const s=t.getReader();for(;;){const{value:t,done:o}=await s.read();if(o)break;e.m=Lm(t,e.m),e.u+=BigInt(t.length),yield t}}}function Gm(e,t){const s=Cm(16+(t?8:0));return s.setUint32(0,1347094280),s.setUint32(4,e.isFile?e.m:0,1),t?(s.setBigUint64(8,e.u,1),s.setBigUint64(16,e.u,1)):(s.setUint32(8,Em(e.u),1),s.setUint32(12,Em(e.u),1)),jm(s)}function $m(e,t,s=0,o=0){const n=Cm(46);return n.setUint32(0,1347092738),n.setUint32(4,755182848),n.setUint16(8,2048|s),Fm(e.t,n,12),n.setUint32(16,e.isFile?e.m:0,1),n.setUint32(20,Em(e.u),1),n.setUint32(24,Em(e.u),1),n.setUint16(28,e.o.length,1),n.setUint16(30,o,1),n.setUint16(40,e.isFile?33204:16893,1),n.setUint32(42,Em(t),1),jm(n)}function Wm(e,t,s){const o=Cm(s);return o.setUint16(0,1,1),o.setUint16(2,s-4,1),16&s&&(o.setBigUint64(4,e.u,1),o.setBigUint64(12,e.u,1)),o.setBigUint64(s-8,t,1),jm(o)}function Km(e){return e instanceof File||e instanceof Response?[[e],[e]]:[[e.input,e.name,e.size],[e.input,e.lastModified]]}function Zm(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,o=0;for(const n of e){if(!n.o)throw new Error("Every file must have a non-empty name.");if(void 0===n.u)throw new Error(`Missing size for file "${(new TextDecoder).decode(n.o)}".`);const e=n.u>=0xffffffffn,i=s>=0xffffffffn;s+=BigInt(46+n.o.length+(e&&8))+n.u,t+=BigInt(n.o.length+46+(12*i|28*e)),o||(o=e)}return(o||s>=0xffffffffn)&&(t+=BigInt(76)),t+s}(function*(e){for(const t of e)yield Dm(...Km(t)[0])}(e)))(t.metadata))),new Response(Ym(e,t),{headers:s})}function Ym(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,o]=Km(e.value);return{done:0,value:Object.assign(Im(...o),Dm(...s))}},throw:t.throw?.bind(t),[Symbol.asyncIterator](){return this}}}(e);return Nm(async function*(e,t){const s=[];let o=0n,n=0n,i=0;for await(const r of e){const e=Vm(r,t.buffersAreUTF8);yield zm(r,e),yield new Uint8Array(r.o),r.isFile&&(yield*Hm(r));const a=r.u>=0xffffffffn,l=12*(o>=0xffffffffn)|28*a;yield Gm(r,a),s.push($m(r,o,e,l)),s.push(r.o),l&&s.push(Wm(r,o,l)),a&&(o+=8n),n++,o+=BigInt(46+r.o.length)+r.u,i||(i=a)}let r=0n;for(const e of s)yield e,r+=BigInt(e.length);if(i||o>=0xffffffffn){const e=Cm(76);e.setUint32(0,1347094022),e.setBigUint64(4,BigInt(44),1),e.setUint32(12,755182848),e.setBigUint64(24,n,1),e.setBigUint64(32,n,1),e.setBigUint64(40,r,1),e.setBigUint64(48,o,1),e.setUint32(56,1347094023),e.setBigUint64(64,o+r,1),e.setUint32(72,1,1),yield jm(e)}const a=Cm(22);a.setUint32(0,1347093766),a.setUint16(8,Bm(n),1),a.setUint16(10,Bm(n),1),a.setUint32(12,Em(r),1),a.setUint32(16,Em(o),1),yield jm(a)}(s,t),s)}const{PATTERN_TYPES:qm}=h(_n.privateApis);function Qm(e){return JSON.stringify({__file:e.type,title:e.title||e.name,content:e?.patternPost?.content?.raw||e.content,syncStatus:e?.patternPost?.wp_pattern_sync_status||e.wp_pattern_sync_status},null,2)}const Xm={id:"export-pattern",label:(0,m.__)("Export as JSON"),supportsBulk:!0,isEligible:e=>!!e.type&&e.type===qm.user,callback:async e=>{if(1===e.length)return(0,tl.downloadBlob)(`${_h(e[0].title||e[0].name)}.json`,Qm(e[0]),"application/json");const t={},s=e.map((e=>{const s=_h(e.title||e.name);return t[s]=(t[s]||0)+1,{name:s+(t[s]>1?"-"+(t[s]-1):"")+".json",lastModified:new Date,input:Qm(e)}}));return(0,tl.downloadBlob)((0,m.__)("patterns-export")+".zip",await Zm(s).blob(),"application/zip")}},{PATTERN_TYPES:Jm,CreatePatternModalContents:eg,useDuplicatePatternProps:tg}=h(_n.privateApis);function sg(e){return!!e&&([e.source,e.templatePart?.source].includes(z.custom)&&!e.has_theme_file&&!e.templatePart?.has_theme_file)}function og(e){return"string"==typeof e.title?(0,Mo.decodeEntities)(e.title):(0,Mo.decodeEntities)(e.title?.rendered||"")}const ng={id:"delete-post",label:(0,m.__)("Delete"),isPrimary:!0,icon:Pm,isEligible:e=>[L,F].includes(e.type)?sg(e):e.type===Jm.user,supportsBulk:!0,hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionStart:s,onActionPerformed:o})=>{const[n,i]=(0,C.useState)(!1),{removeTemplates:r}=h((0,d.useDispatch)(cn));return(0,T.jsxs)(Tn.__experimentalVStack,{spacing:"5",children:[(0,T.jsx)(Tn.__experimentalText,{children:e.length>1?(0,m.sprintf)((0,m._n)("Delete %d item?","Delete %d items?",e.length),e.length):(0,m.sprintf)((0,m.__)('Delete "%s"?'),og(e[0]))}),(0,T.jsxs)(Tn.__experimentalHStack,{justify:"right",children:[(0,T.jsx)(Tn.Button,{variant:"tertiary",onClick:t,disabled:n,__experimentalIsFocusable:!0,children:(0,m.__)("Cancel")}),(0,T.jsx)(Tn.Button,{variant:"primary",onClick:async()=>{i(!0),s&&s(e),await r(e,{allowUndo:!1}),o?.(e),i(!1),t()},isBusy:n,disabled:n,__experimentalIsFocusable:!0,children:(0,m.__)("Delete")})]})]})}};function ig(e,t,s){const o=(0,d.useRegistry)();return(0,C.useMemo)((()=>({...s,isEligible:n=>s.isEligible(n)&&o.select(b.store).canUser(e,t,n.id)})),[s,o,e,t])}const rg={id:"move-to-trash",label:(0,m.__)("Move to Trash"),isPrimary:!0,icon:Pm,isEligible:e=>!["auto-draft","trash"].includes(e.status),supportsBulk:!0,hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionStart:s,onActionPerformed:o})=>{const[n,i]=(0,C.useState)(!1),{createSuccessNotice:r,createErrorNotice:a}=(0,d.useDispatch)(fs.store),{deleteEntityRecord:l}=(0,d.useDispatch)(b.store);return(0,T.jsxs)(Tn.__experimentalVStack,{spacing:"5",children:[(0,T.jsx)(Tn.__experimentalText,{children:1===e.length?(0,m.sprintf)((0,m.__)('Are you sure you want to move to trash "%s"?'),og(e[0])):(0,m.sprintf)((0,m._n)("Are you sure you want to move to trash %d item?","Are you sure you want to move to trash %d items?",e.length),e.length)}),(0,T.jsxs)(Tn.__experimentalHStack,{justify:"right",children:[(0,T.jsx)(Tn.Button,{variant:"tertiary",onClick:t,disabled:n,__experimentalIsFocusable:!0,children:(0,m.__)("Cancel")}),(0,T.jsx)(Tn.Button,{variant:"primary",onClick:async()=>{i(!0),s&&s(e);const n=await Promise.allSettled(e.map((e=>l("postType",e.type,e.id,{},{throwOnError:!0}))));if(n.every((({status:e})=>"fulfilled"===e))){let t;t=1===n.length?(0,m.sprintf)((0,m.__)('"%s" moved to trash.'),og(e[0])):(0,m.sprintf)((0,m._n)("%s item moved to trash.","%s items moved to trash.",e.length),e.length),r(t,{type:"snackbar",id:"move-to-trash-action"})}else{let e;if(1===n.length)e=n[0].reason?.message?n[0].reason.message:(0,m.__)("An error occurred while moving to trash the item.");else{const t=new Set,s=n.filter((({status:e})=>"rejected"===e));for(const e of s)e.reason?.message&&t.add(e.reason.message);e=0===t.size?(0,m.__)("An error occurred while moving to trash the items."):1===t.size?(0,m.sprintf)((0,m.__)("An error occurred while moving to trash the item: %s"),[...t][0]):(0,m.sprintf)((0,m.__)("Some errors occurred while moving to trash the items: %s"),[...t].join(","))}a(e,{type:"snackbar"})}o&&o(e),i(!1),t()},isBusy:n,disabled:n,__experimentalIsFocusable:!0,children:(0,m.__)("Trash")})]})]})}};const ag={id:"view-post",label:(0,m.__)("View"),isPrimary:!0,icon:hu,isEligible:e=>"trash"!==e.status,callback(e,t){const s=e[0];window.open(s.link,"_blank"),t&&t(e)}},lg={id:"view-post-revisions",context:"list",label(e){var t;const s=null!==(t=e[0]._links?.["version-history"]?.[0]?.count)&&void 0!==t?t:0;return(0,m.sprintf)((0,m.__)("View revisions (%s)"),s)},isEligible:e=>{var t,s;if("trash"===e.status)return!1;const o=null!==(t=e?._links?.["predecessor-version"]?.[0]?.id)&&void 0!==t?t:null,n=null!==(s=e?._links?.["version-history"]?.[0]?.count)&&void 0!==s?s:0;return o&&n>1},callback(e,t){const s=e[0],o=(0,S.addQueryArgs)("revision.php",{revision:s?._links?.["predecessor-version"]?.[0]?.id});document.location.href=o,t&&t(e)}},cg={id:"rename-post",label:(0,m.__)("Rename"),isEligible(e){if("trash"===e.status)return!1;if(![L,F,...Object.values(Jm)].includes(e.type))return!0;if(e.type===L)return sg(e)&&e.is_custom;const t=e.type===F,s=e.type===Jm.user||t&&(e.isCustom||e.source===z.custom),o=t&&(e.templatePart?.has_theme_file||e.has_theme_file);return s&&!o},RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[o]=e,n=(0,Mo.decodeEntities)("string"==typeof o.title?o.title:o.title.rendered),[i,r]=(0,C.useState)((()=>n)),{editEntityRecord:a,saveEditedEntityRecord:l}=(0,d.useDispatch)(b.store),{createSuccessNotice:c,createErrorNotice:u}=(0,d.useDispatch)(fs.store);return(0,T.jsx)("form",{onSubmit:async function(n){n.preventDefault();try{await a("postType",o.type,o.id,{title:i}),r(""),t(),await l("postType",o.type,o.id,{throwOnError:!0}),c((0,m.__)("Name updated"),{type:"snackbar"}),s?.(e)}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,m.__)("An error occurred while updating the name");u(t,{type:"snackbar"})}},children:(0,T.jsxs)(Tn.__experimentalVStack,{spacing:"5",children:[(0,T.jsx)(Tn.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,m.__)("Name"),value:i,onChange:r,required:!0}),(0,T.jsxs)(Tn.__experimentalHStack,{justify:"right",children:[(0,T.jsx)(Tn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t()},children:(0,m.__)("Cancel")}),(0,T.jsx)(Tn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,m.__)("Save")})]})]})})}};(0,m._x)("Duplicate","action label");const dg={id:"reset-template",label:(0,m.__)("Reset"),isEligible:e=>Oo(e),icon:_l,supportsBulk:!0,hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionStart:s,onActionPerformed:o})=>{const[n,i]=(0,C.useState)(!1),{revertTemplate:r}=h((0,d.useDispatch)(cn)),{saveEditedEntityRecord:a}=(0,d.useDispatch)(b.store),{createSuccessNotice:l,createErrorNotice:c}=(0,d.useDispatch)(fs.store);return(0,T.jsxs)(Tn.__experimentalVStack,{spacing:"5",children:[(0,T.jsx)(Tn.__experimentalText,{children:(0,m.__)("Reset to default and clear all customizations?")}),(0,T.jsxs)(Tn.__experimentalHStack,{justify:"right",children:[(0,T.jsx)(Tn.Button,{variant:"tertiary",onClick:t,disabled:n,__experimentalIsFocusable:!0,children:(0,m.__)("Cancel")}),(0,T.jsx)(Tn.Button,{variant:"primary",onClick:async()=>{i(!0),s&&s(e),await(async()=>{try{for(const t of e)await r(t,{allowUndo:!1}),await a("postType",t.type,t.id);l(e.length>1?(0,m.sprintf)((0,m.__)("%s items reset."),e.length):(0,m.sprintf)((0,m.__)('"%s" reset.'),(0,Mo.decodeEntities)(og(e[0]))),{type:"snackbar",id:"revert-template-action"})}catch(t){let s;s=e[0].type===L?1===e.length?(0,m.__)("An error occurred while reverting the template."):(0,m.__)("An error occurred while reverting the templates."):1===e.length?(0,m.__)("An error occurred while reverting the template part."):(0,m.__)("An error occurred while reverting the template parts.");const o=t.message&&"unknown_error"!==t.code?t.message:s;c(o,{type:"snackbar"})}})(),o?.(e),i(!1),t()},isBusy:n,disabled:n,__experimentalIsFocusable:!0,children:(0,m.__)("Reset")})]})]})}},ug={id:"duplicate-pattern",label:(0,m._x)("Duplicate","action label"),isEligible:e=>e.type!==F,modalHeader:(0,m._x)("Duplicate pattern","action label"),RenderModal:({items:e,closeModal:t})=>{const[s]=e,o=s.type===Jm.theme,n=tg({pattern:o||!s.patternPost?s:s.patternPost,onSuccess:()=>t()});return(0,T.jsx)(eg,{onClose:t,confirmLabel:(0,m._x)("Duplicate","action label"),...n})}},pg={id:"duplicate-template-part",label:(0,m._x)("Duplicate","action label"),isEligible:e=>e.type===F,modalHeader:(0,m._x)("Duplicate template part","action label"),RenderModal:({items:e,closeModal:t})=>{const[s]=e,{createSuccessNotice:o}=(0,d.useDispatch)(fs.store);return(0,T.jsx)(vh,{blocks:s.blocks,defaultArea:s.templatePart?.area||s.area,defaultTitle:(0,m.sprintf)((0,m.__)("%s (Copy)"),s.title),onCreate:function(){o((0,m.sprintf)((0,m.__)('"%s" duplicated.'),s.title),{type:"snackbar",id:"edit-site-patterns-success"}),t()},onError:t,confirmLabel:(0,m._x)("Duplicate","action label")})}};function hg({postType:e,onActionPerformed:t,context:s}){const{postTypeObject:o,resource:n,cachedCanUserResolvers:i,userCanCreatePostType:r}=(0,d.useSelect)((t=>{const{getPostType:s,getCachedResolvers:o,canUser:n}=t(b.store),i=s(e),r=i?.rest_base||"";return{postTypeObject:i,resource:r,cachedCanUserResolvers:o()?.canUser,userCanCreatePostType:n("create",r)}}),[e]),a=function(e){return ig("delete",e,rg)}(n),l=function(e){const{createSuccessNotice:t,createErrorNotice:s}=(0,d.useDispatch)(fs.store),{deleteEntityRecord:o}=(0,d.useDispatch)(b.store);return ig("delete",e,(0,C.useMemo)((()=>({id:"permanently-delete",label:(0,m.__)("Permanently delete"),supportsBulk:!0,isEligible:({status:e})=>"trash"===e,async callback(e,n){const i=await Promise.allSettled(e.map((e=>o("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(i.every((({status:e})=>"fulfilled"===e))){let s;s=1===i.length?(0,m.sprintf)((0,m.__)('"%s" permanently deleted.'),og(e[0])):(0,m.__)("The posts were permanently deleted."),t(s,{type:"snackbar",id:"permanently-delete-post-action"}),n&&n(e)}else{let e;if(1===i.length)e=i[0].reason?.message?i[0].reason.message:(0,m.__)("An error occurred while permanently deleting the post.");else{const t=new Set,s=i.filter((({status:e})=>"rejected"===e));for(const e of s)e.reason?.message&&t.add(e.reason.message);e=0===t.size?(0,m.__)("An error occurred while permanently deleting the posts."):1===t.size?(0,m.sprintf)((0,m.__)("An error occurred while permanently deleting the posts: %s"),[...t][0]):(0,m.sprintf)((0,m.__)("Some errors occurred while permanently deleting the posts: %s"),[...t].join(","))}s(e,{type:"snackbar"})}}})),[t,s,o]))}(n),c=function(e){return ig("update",e,cg)}(n),u=function(e){const{createSuccessNotice:t,createErrorNotice:s}=(0,d.useDispatch)(fs.store),{editEntityRecord:o,saveEditedEntityRecord:n}=(0,d.useDispatch)(b.store);return ig("update",e,(0,C.useMemo)((()=>({id:"restore",label:(0,m.__)("Restore"),isPrimary:!0,icon:_l,supportsBulk:!0,isEligible:({status:e})=>"trash"===e,async callback(e,i){await Promise.allSettled(e.map((e=>o("postType",e.type,e.id,{status:"draft"}))));const r=await Promise.allSettled(e.map((e=>n("postType",e.type,e.id,{throwOnError:!0}))));if(r.every((({status:e})=>"fulfilled"===e))){let s;s=1===e.length?(0,m.sprintf)((0,m.__)('"%s" has been restored.'),og(e[0])):"page"===e[0].type?(0,m.sprintf)((0,m.__)("%d pages have been restored."),e.length):(0,m.sprintf)((0,m.__)("%d posts have been restored."),e.length),t(s,{type:"snackbar",id:"restore-post-action"}),i&&i(e)}else{let e;if(1===r.length)e=r[0].reason?.message?r[0].reason.message:(0,m.__)("An error occurred while restoring the post.");else{const t=new Set,s=r.filter((({status:e})=>"rejected"===e));for(const e of s)e.reason?.message&&t.add(e.reason.message);e=0===t.size?(0,m.__)("An error occurred while restoring the posts."):1===t.size?(0,m.sprintf)((0,m.__)("An error occurred while restoring the posts: %s"),[...t][0]):(0,m.sprintf)((0,m.__)("Some errors occurred while restoring the posts: %s"),[...t].join(","))}s(e,{type:"snackbar"})}}})),[t,s,o,n]))}(n),p=[L,F].includes(e),h=e===V,g=!!o,_=!!o?.supports?.revisions,f=!!o?.supports?.title;return(0,C.useMemo)((()=>{if(!g)return[];let e=[o?.viewable&&ag,_&&lg,!1,p&&r&&pg,h&&r&&ug,f&&c,h&&Xm,p?dg:u,p||h?ng:a,!p&&l].filter(Boolean);if(e=e.filter((e=>!e.context||e.context===s)),t)for(let s=0;s<e.length;++s){if(e[s].callback){const o=e[s].callback;e[s]={...e[s],callback:(n,i)=>{o(n,(o=>{i&&i(o),t(e[s].id,o)}))}}}if(e[s].RenderModal){const o=e[s].RenderModal;e[s]={...e[s],RenderModal:n=>(0,T.jsx)(o,{...n,onActionPerformed:o=>{n.onActionPerformed&&n.onActionPerformed(o),t(e[s].id,o)}})}}}return e}),[p,h,o?.viewable,l,u,c,a,t,g,_,f,s,r,i])}const{DropdownMenuV2:mg,DropdownMenuGroupV2:gg,DropdownMenuItemV2:_g,DropdownMenuItemLabelV2:fg,kebabCase:bg}=h(Tn.privateApis);function yg({onActionPerformed:e,buttonProps:t}){const[s,o]=(0,C.useState)(!1),{item:n,postType:i}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(cn),{getEditedEntityRecord:o}=e(b.store),n=t();return{item:o("postType",n,s()),postType:n}}),[]),r=hg({postType:i,onActionPerformed:e}),a=(0,C.useMemo)((()=>r.filter((e=>!e.isEligible||e.isEligible(n)))),[r,n]);return(0,T.jsx)(mg,{open:s,trigger:(0,T.jsx)(Tn.Button,{size:"small",icon:Th,label:(0,m.__)("Actions"),disabled:!a.length,__experimentalIsFocusable:!0,className:"editor-all-actions-button",onClick:()=>o(!s),...t}),onOpenChange:o,placement:"bottom-end",children:(0,T.jsx)(wg,{actions:a,item:n,onClose:()=>{o(!1)}})})}function xg({action:e,onClick:t,items:s}){const o="string"==typeof e.label?e.label:e.label(s);return(0,T.jsx)(_g,{onClick:t,hideOnClick:!e.RenderModal,children:(0,T.jsx)(fg,{children:o})})}function vg({action:e,item:t,ActionTrigger:s,onClose:o}){const[n,i]=(0,C.useState)(!1),r={action:e,onClick:()=>i(!0),items:[t]},{RenderModal:a,hideModalHeader:l}=e;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(s,{...r}),n&&(0,T.jsx)(Tn.Modal,{title:e.modalHeader||e.label,__experimentalHideHeader:!!l,onRequestClose:()=>{i(!1)},overlayClassName:`editor-action-modal editor-action-modal__${bg(e.id)}`,children:(0,T.jsx)(a,{items:[t],closeModal:()=>{i(!1),o()}})})]})}function wg({actions:e,item:t,onClose:s}){return(0,T.jsx)(gg,{children:e.map((e=>e.RenderModal?(0,T.jsx)(vg,{action:e,item:t,ActionTrigger:xg,onClose:s},e.id):(0,T.jsx)(xg,{action:e,onClick:()=>e.callback([t]),items:[t]},e.id)))})}function Sg({actions:e}){const{isFrontPage:t,isPostsPage:s,title:o,icon:n,isSync:i}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s,getCurrentPostId:o,__experimentalGetTemplateInfo:n}=e(cn),{getEditedEntityRecord:i}=e(b.store),r=i("root","site"),a=s(),l=o(),c=i("postType",a,l),d=[L,F].includes(a)&&n(c);let u=!1;if(G.includes(a))if(V===a){u="unsynced"!==("unsynced"===t("meta")?.wp_pattern_sync_status?"unsynced":t("wp_pattern_sync_status"))}else u=!0;return{title:d?.title||t("title"),icon:h(e(cn)).getPostIcon(a,{area:c?.area}),isSync:u,isFrontPage:r?.page_on_front===l,isPostsPage:r?.page_for_posts===l}}),[]);return(0,T.jsx)("div",{className:"editor-post-card-panel",children:(0,T.jsxs)(Tn.__experimentalHStack,{spacing:2,className:"editor-post-card-panel__header",align:"flex-start",children:[(0,T.jsx)(Tn.Icon,{className:jn("editor-post-card-panel__icon",{"is-sync":i}),icon:n}),(0,T.jsxs)(Tn.__experimentalText,{numberOfLines:2,truncate:!0,className:"editor-post-card-panel__title",weight:500,as:"h2",lineHeight:"20px",children:[o?(0,Mo.decodeEntities)(o):(0,m.__)("No Title"),t&&(0,T.jsx)("span",{className:"editor-post-card-panel__title-badge",children:(0,m.__)("Front Page")}),s&&(0,T.jsx)("span",{className:"editor-post-card-panel__title-badge",children:(0,m.__)("Posts Page")})]}),e]})})}const kg=189;function Pg(){const{postContent:e}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s,getCurrentPostId:o}=e(cn),{getEntityRecord:n}=e(b.store),i=n("root","site"),r=s();return{postContent:!(+o()===i?.page_for_posts)&&![L,F].includes(r)&&t("content")}}),[]),t=(0,m._x)("words","Word count type. Do not translate!"),s=(0,C.useMemo)((()=>e?(0,kd.count)(e,t):0),[e,t]);if(!s)return null;const o=Math.round(s/kg),n=(0,m.sprintf)((0,m._n)("%s word","%s words",s),s.toLocaleString()),i=o<=1?(0,m.__)("1 minute"):(0,m.sprintf)((0,m._n)("%s minute","%s minutes",o),o.toLocaleString());return(0,T.jsx)("div",{className:"editor-post-content-information",children:(0,T.jsx)(Tn.__experimentalText,{children:(0,m.sprintf)((0,m.__)("%1$s, %2$s read time."),n,i)})})}const Cg=function(){const{postFormat:e}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(cn),s=t("format");return{postFormat:null!=s?s:"standard"}}),[]),t=ml.find((t=>t.id===e)),[s,o]=(0,C.useState)(null),n=(0,C.useMemo)((()=>({anchor:s,placement:"left-start",offset:36,shift:!0})),[s]);return(0,T.jsx)(hl,{children:(0,T.jsx)(_r,{label:(0,m.__)("Format"),ref:o,children:(0,T.jsx)(Tn.Dropdown,{popoverProps:n,contentClassName:"editor-post-format__dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:s})=>(0,T.jsx)(Tn.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,m.sprintf)((0,m.__)("Change format: %s"),t?.caption),onClick:s,children:t?.caption}),renderContent:({onClose:e})=>(0,T.jsxs)("div",{className:"editor-post-format__dialog-content",children:[(0,T.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,m.__)("Format"),onClose:e}),(0,T.jsx)(gl,{})]})})})})};function jg(){const e=(0,d.useSelect)((e=>e(cn).getEditedPostAttribute("modified")),[]),t=e&&(0,m.sprintf)((0,m.__)("Last edited %s."),(0,w.humanTimeDiff)(e));return t?(0,T.jsx)("div",{className:"editor-post-last-edited-panel",children:(0,T.jsx)(Tn.__experimentalText,{children:t})}):null}const Tg=function({className:e,children:t}){return(0,T.jsx)(Tn.__experimentalVStack,{className:jn("editor-post-panel__section",e),children:t})},Eg={};function Bg(){const{editEntityRecord:e}=(0,d.useDispatch)(b.store),{postsPageTitle:t,postsPageId:s,isTemplate:o,postSlug:n}=(0,d.useSelect)((e=>{const{getEntityRecord:t,getEditedEntityRecord:s}=e(b.store),o=t("root","site"),n=o?.page_for_posts?s("postType","page",o?.page_for_posts):Eg,{getEditedPostAttribute:i,getCurrentPostType:r}=e(cn);return{postsPageId:n?.id,postsPageTitle:n?.title,isTemplate:r()===L,postSlug:i("slug")}}),[]),[i,r]=(0,C.useState)(null),a=(0,C.useMemo)((()=>({anchor:i,placement:"left-start",offset:36,shift:!0})),[i]);if(!o||!["home","index"].includes(n)||!s)return null;const l=t=>{e("postType","page",s,{title:t})},c=(0,Mo.decodeEntities)(t);return(0,T.jsx)(_r,{label:(0,m.__)("Blog title"),ref:r,children:(0,T.jsx)(Tn.Dropdown,{popoverProps:a,contentClassName:"editor-blog-title-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,T.jsx)(Tn.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,m.sprintf)((0,m.__)("Change blog title: %s"),c),onClick:t,children:c}),renderContent:({onClose:e})=>(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,m.__)("Blog title"),onClose:e}),(0,T.jsx)(Tn.__experimentalInputControl,{placeholder:(0,m.__)("No Title"),size:"__unstable-large",value:t,onChange:(0,pn.debounce)(l,300),label:(0,m.__)("Blog title"),help:(0,m.__)("Set the Posts Page title. Appears in search results, and when the page is shared on social media."),hideLabelFromVision:!0})]})})})}function Ig(){const{editEntityRecord:e}=(0,d.useDispatch)(b.store),{postsPerPage:t,isTemplate:s,postSlug:o}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s}=e(cn),{getEditedEntityRecord:o}=e(b.store),n=o("root","site");return{isTemplate:s()===L,postSlug:t("slug"),postsPerPage:n?.posts_per_page||1}}),[]),[n,i]=(0,C.useState)(null),r=(0,C.useMemo)((()=>({anchor:n,placement:"left-start",offset:36,shift:!0})),[n]);if(!s||!["home","index"].includes(o))return null;const a=t=>{e("root","site",void 0,{posts_per_page:t})};return(0,T.jsx)(_r,{label:(0,m.__)("Posts per page"),ref:i,children:(0,T.jsx)(Tn.Dropdown,{popoverProps:r,contentClassName:"editor-posts-per-page-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:s})=>(0,T.jsx)(Tn.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,m.__)("Change posts per page"),onClick:s,children:t}),renderContent:({onClose:e})=>(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,m.__)("Posts per page"),onClose:e}),(0,T.jsx)(Tn.__experimentalNumberControl,{placeholder:0,value:t,size:"__unstable-large",spinControls:"custom",step:"1",min:"1",onChange:a,label:(0,m.__)("Posts per page"),help:(0,m.__)("Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting."),hideLabelFromVision:!0})]})})})}const Ng=[{label:(0,T.jsxs)(T.Fragment,{children:[(0,m.__)("Open"),(0,T.jsx)(Tn.__experimentalText,{variant:"muted",size:12,children:(0,m.__)("Visitors can add new comments and replies.")})]}),value:"open"},{label:(0,T.jsxs)(T.Fragment,{children:[(0,m.__)("Closed"),(0,T.jsx)(Tn.__experimentalText,{variant:"muted",size:12,children:(0,m.__)("Visitors cannot add new comments or replies.")}),(0,T.jsx)(Tn.__experimentalText,{variant:"muted",size:12,children:(0,m.__)("Existing comments remain visible.")})]}),value:""}];function Ag(){const{editEntityRecord:e}=(0,d.useDispatch)(b.store),{allowCommentsOnNewPosts:t,isTemplate:s,postSlug:o}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s}=e(cn),{getEditedEntityRecord:o}=e(b.store),n=o("root","site");return{isTemplate:s()===L,postSlug:t("slug"),allowCommentsOnNewPosts:n?.default_comment_status||""}}),[]),[n,i]=(0,C.useState)(null),r=(0,C.useMemo)((()=>({anchor:n,placement:"left-start",offset:36,shift:!0})),[n]);if(!s||!["home","index"].includes(o))return null;const a=t=>{e("root","site",void 0,{default_comment_status:t?"open":null})};return(0,T.jsx)(_r,{label:(0,m.__)("Discussion"),ref:i,children:(0,T.jsx)(Tn.Dropdown,{popoverProps:r,contentClassName:"editor-site-discussion-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:s})=>(0,T.jsx)(Tn.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,m.__)("Change discussion settings"),onClick:s,children:t?(0,m.__)("Comments open"):(0,m.__)("Comments closed")}),renderContent:({onClose:e})=>(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,m.__)("Discussion"),onClose:e}),(0,T.jsxs)(Tn.__experimentalVStack,{spacing:3,children:[(0,T.jsx)(Tn.__experimentalText,{children:(0,m.__)("Changes will apply to new posts only. Individual posts may override these settings.")}),(0,T.jsx)(Tn.RadioControl,{className:"editor-site-discussion__options",hideLabelFromVision:!0,label:(0,m.__)("Comment status"),options:Ng,onChange:a,selected:t})]})]})})})}function Dg({area:e,clientId:t}){const{selectBlock:s,toggleBlockHighlight:o}=(0,d.useDispatch)(g.store),n=(0,d.useSelect)((t=>t(cn).__experimentalGetDefaultTemplatePartAreas().find((t=>t.area===e))),[e]),i=()=>o(t,!0),r=()=>o(t,!1);return(0,T.jsx)(Tn.Button,{className:"editor-template-areas__item",icon:n?.icon,onMouseOver:i,onMouseLeave:r,onFocus:i,onBlur:r,onClick:()=>{s(t)},children:n?.label})}function Rg(){const{isTemplate:e,templateParts:t}=(0,d.useSelect)((e=>{const t=e(cn).getCurrentPostType()===L;return{isTemplate:t,templateParts:t&&h(e(cn)).getCurrentTemplateTemplateParts()}}),[]);return e&&t.length?(0,T.jsxs)("section",{className:"editor-template-areas",children:[(0,T.jsx)(Tn.__experimentalHeading,{level:3,className:"editor-template-areas__title",children:(0,m.__)("Areas")}),(0,T.jsx)("ul",{className:"editor-template-areas__list",children:t.map((({templatePart:e,block:t})=>(0,T.jsx)("li",{children:(0,T.jsx)(Dg,{area:e.area,clientId:t.clientId})},t.clientId)))})]}):null}function Mg({onActionPerformed:e}){const{isRemovedPostStatusPanel:t}=(0,d.useSelect)((e=>{const{isEditorPanelRemoved:t,getCurrentPostType:s}=e(cn);return{isRemovedPostStatusPanel:t("post-status"),postType:s()}}),[]);return(0,T.jsx)(Tg,{className:"editor-post-summary",children:(0,T.jsx)(ma.Slot,{children:s=>(0,T.jsx)(T.Fragment,{children:(0,T.jsxs)(Tn.__experimentalVStack,{spacing:4,children:[(0,T.jsx)(Sg,{actions:(0,T.jsx)(yg,{onActionPerformed:e})}),(0,T.jsx)(pl,{withPanelBody:!1}),(0,T.jsx)(Ja,{}),(0,T.jsxs)(Tn.__experimentalVStack,{spacing:1,children:[(0,T.jsx)(Pg,{}),(0,T.jsx)(jg,{})]}),!t&&(0,T.jsxs)(Tn.__experimentalVStack,{spacing:2,children:[(0,T.jsxs)(Tn.__experimentalVStack,{spacing:1,children:[(0,T.jsx)(Uc,{}),(0,T.jsx)($c,{}),(0,T.jsx)(xd,{}),(0,T.jsx)(Ma,{}),(0,T.jsx)(ja,{}),(0,T.jsx)(Ha,{}),(0,T.jsx)(yl,{}),(0,T.jsx)(Mr,{}),(0,T.jsx)(Xc,{}),(0,T.jsx)(Bg,{}),(0,T.jsx)(Ig,{}),(0,T.jsx)(Ag,{}),(0,T.jsx)(Cg,{}),(0,T.jsx)(qc,{})]}),(0,T.jsx)(Rg,{}),s]})]})})})})}const{EXCLUDED_PATTERN_SOURCES:Og,PATTERN_TYPES:Lg}=h(_n.privateApis);function Fg(e,t){return e.innerBlocks=e.innerBlocks.map((e=>Fg(e,t))),"core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=t),e}function Vg(e,t){return e.filter(((e,s,o)=>((e,t,s)=>t===s.findIndex((t=>e.name===t.name)))(e,s,o)&&(e=>!Og.includes(e.source))(e)&&(e=>e.templateTypes?.includes(t.slug)||e.blockTypes?.includes("core/template-part/"+t.area))(e)))}function Ug(e,t){return e.map((e=>({...e,keywords:e.keywords||[],type:Lg.theme,blocks:(0,c.parse)(e.content,{__unstableSkipMigrationLogs:!0}).map((e=>Fg(e,t)))})))}function zg({availableTemplates:e,onSelect:t}){const s=(0,pn.useAsyncList)(e);return e&&0!==e?.length?(0,T.jsx)(g.__experimentalBlockPatternsList,{label:(0,m.__)("Templates"),blockPatterns:e,shownPatterns:s,onClickPattern:t,showTitlesAsTooltip:!0}):null}function Hg(){const{record:e,postType:t,postId:s}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(cn),{getEditedEntityRecord:o}=e(b.store),n=t(),i=s();return{postType:n,postId:i,record:o("postType",n,i)}}),[]),{editEntityRecord:o}=(0,d.useDispatch)(b.store),n=function(e){const{blockPatterns:t,restBlockPatterns:s,currentThemeStylesheet:o}=(0,d.useSelect)((e=>{var t;const{getEditorSettings:s}=e(cn),o=s();return{blockPatterns:null!==(t=o.__experimentalAdditionalBlockPatterns)&&void 0!==t?t:o.__experimentalBlockPatterns,restBlockPatterns:e(b.store).getBlockPatterns(),currentThemeStylesheet:e(b.store).getCurrentTheme().stylesheet}}),[]);return(0,C.useMemo)((()=>Ug(Vg([...t||[],...s||[]],e),e)),[t,s,e,o])}(e);return n?.length?(0,T.jsx)(Tn.PanelBody,{title:(0,m.__)("Design"),initialOpen:e.type===F,children:(0,T.jsx)(zg,{availableTemplates:n,onSelect:async e=>{await o("postType",t,s,{blocks:e.blocks,content:(0,c.serialize)(e.blocks)})}})}):null}function Gg(){const{postType:e}=(0,d.useSelect)((e=>{const{getCurrentPostType:t}=e(cn);return{postType:t()}}),[]);return[F,L].includes(e)?(0,T.jsx)(Hg,{}):null}const $g={document:"edit-post/document",block:"edit-post/block"},{Tabs:Wg}=h(Tn.privateApis),Kg=(0,C.forwardRef)(((e,t)=>{const{documentLabel:s}=(0,d.useSelect)((e=>{const{getPostTypeLabel:t}=e(cn);return{documentLabel:t()||(0,m._x)("Document","noun")}}),[]);return(0,T.jsxs)(Wg.TabList,{ref:t,children:[(0,T.jsx)(Wg.Tab,{tabId:$g.document,"data-tab-id":$g.document,children:s}),(0,T.jsx)(Wg.Tab,{tabId:$g.block,"data-tab-id":$g.block,children:(0,m.__)("Block")})]})})),{BlockQuickNavigation:Zg}=h(g.privateApis),Yg=["core/post-content","core/post-featured-image","core/post-title"];function qg(){const e=(0,d.useSelect)((e=>{const{getBlocksByName:t}=e(g.store);return t(Yg)}),[]);return(0,T.jsx)(Tn.PanelBody,{title:(0,m.__)("Content"),children:(0,T.jsx)(Zg,{clientIds:e})})}const Qg=function(){const{hasBlockSelection:e}=(0,d.useSelect)((e=>({hasBlockSelection:!!e(g.store).getBlockSelectionStart()})),[]),{getActiveComplementaryArea:t}=(0,d.useSelect)(Xn),{enableComplementaryArea:s}=(0,d.useDispatch)(Xn),{get:o}=(0,d.useSelect)(B.store);(0,C.useEffect)((()=>{const n=t("core"),i=["edit-post/document","edit-post/block"].includes(n),r=o("core","distractionFree");i&&!r&&s("core",e?"edit-post/block":"edit-post/document")}),[e,t,s,o])},{Tabs:Xg}=h(Tn.privateApis),Jg=C.Platform.select({web:!0,native:!1}),e_=({tabName:e,keyboardShortcut:t,renderingMode:s,onActionPerformed:o,extraPanels:n})=>{const i=(0,C.useRef)(null),r=(0,C.useContext)(Xg.Context);return(0,C.useEffect)((()=>{const t=Array.from(i.current?.querySelectorAll('[role="tab"]')||[]),s=t.find((t=>t.getAttribute("data-tab-id")===e)),o=s?.ownerDocument.activeElement;t.some((e=>o&&o.id===e.id))&&s&&s.id!==o?.id&&s?.focus()}),[e]),(0,T.jsx)(ya,{identifier:e,header:(0,T.jsx)(Xg.Context.Provider,{value:r,children:(0,T.jsx)(Kg,{ref:i})}),closeLabel:(0,m.__)("Close Settings"),className:"editor-sidebar__panel",headerClassName:"editor-sidebar__panel-tabs",title:(0,m.__)("Settings"),toggleShortcut:t,icon:(0,m.isRTL)()?cu:du,isActiveByDefault:Jg,children:(0,T.jsxs)(Xg.Context.Provider,{value:r,children:[(0,T.jsxs)(Xg.TabPanel,{tabId:$g.document,focusable:!1,children:[(0,T.jsx)(Mg,{onActionPerformed:o}),(0,T.jsx)(na.Slot,{}),"post-only"!==s&&(0,T.jsx)(qg,{}),(0,T.jsx)(Gg,{}),(0,T.jsx)(od,{}),(0,T.jsx)(km,{}),n]}),(0,T.jsx)(Xg.TabPanel,{tabId:$g.block,focusable:!1,children:(0,T.jsx)(g.BlockInspector,{})})]})})},t_=({extraPanels:e,onActionPerformed:t})=>{Qg();const{tabName:s,keyboardShortcut:o,showSummary:n,renderingMode:i}=(0,d.useSelect)((e=>{const t=e(Pn.store).getShortcutRepresentation("core/editor/toggle-sidebar"),s=e(Xn).getActiveComplementaryArea("core");let o=s;return[$g.block,$g.document].includes(s)||(o=e(g.store).getBlockSelectionStart()?$g.block:$g.document),{tabName:o,keyboardShortcut:t,showSummary:![L,F,U].includes(e(cn).getCurrentPostType()),renderingMode:e(cn).getRenderingMode()}}),[]),{enableComplementaryArea:r}=(0,d.useDispatch)(Xn),a=(0,C.useCallback)((e=>{e&&r("core",e)}),[r]);return(0,T.jsx)(Xg,{selectedTabId:s,onSelect:a,selectOnMove:!1,children:(0,T.jsx)(e_,{tabName:s,keyboardShortcut:o,showSummary:n,renderingMode:i,onActionPerformed:t,extraPanels:e})})};const s_=function({postType:e,postId:t,templateId:s,settings:o,children:n,onActionPerformed:i,className:r,styles:a,customSaveButton:l,customSavePanel:c,forceDisableBlockTools:u,title:p,iframeProps:h,extraSidebarPanels:g,enableRegionNavigation:_=!0}){const{post:f,template:y,hasLoadedPost:x}=(0,d.useSelect)((o=>{const{getEntityRecord:n,hasFinishedResolution:i}=o(b.store);return{post:n("postType",e,t),template:s?n("postType",L,s):void 0,hasLoadedPost:i("getEntityRecord",["postType",e,t])}}),[e,t,s]);return f?(0,T.jsxs)(qu,{post:f,__unstableTemplate:y,settings:o,useSubRegistry:!1,children:[x&&!f&&(0,T.jsx)(Tn.Notice,{status:"warning",isDismissible:!1,children:(0,m.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")}),(0,T.jsx)(wm,{className:r,styles:a,enableRegionNavigation:_,customSaveButton:l,customSavePanel:c,forceDisableBlockTools:u,title:p,iframeProps:h}),(0,T.jsx)(t_,{onActionPerformed:i,extraPanels:g}),n]}):null},{PreferenceBaseOption:o_}=h(B.privateApis),n_=(0,pn.compose)((0,d.withSelect)((e=>({isChecked:e(cn).isPublishSidebarEnabled()}))),(0,d.withDispatch)((e=>{const{enablePublishSidebar:t,disablePublishSidebar:s}=e(cn);return{onChange:e=>e?t():s()}})))(o_);const i_=function({blockTypes:e,value:t,onItemChange:s}){return(0,T.jsx)("ul",{className:"editor-block-manager__checklist",children:e.map((e=>(0,T.jsxs)("li",{className:"editor-block-manager__checklist-item",children:[(0,T.jsx)(Tn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:e.title,checked:t.includes(e.name),onChange:(...t)=>s(e.name,...t)}),(0,T.jsx)(g.BlockIcon,{icon:e.icon})]},e.name)))})};const r_=function e({title:t,blockTypes:s}){const o=(0,pn.useInstanceId)(e),{allowedBlockTypes:n,hiddenBlockTypes:i}=(0,d.useSelect)((e=>{const{getEditorSettings:t}=e(cn),{get:s}=e(B.store);return{allowedBlockTypes:t().allowedBlockTypes,hiddenBlockTypes:s("core","hiddenBlockTypes")}}),[]),r=(0,C.useMemo)((()=>!0===n?s:s.filter((({name:e})=>n?.includes(e)))),[n,s]),{showBlockTypes:a,hideBlockTypes:l}=h((0,d.useDispatch)(cn)),c=(0,C.useCallback)(((e,t)=>{t?a(e):l(e)}),[a,l]),u=(0,C.useCallback)((e=>{const t=s.map((({name:e})=>e));e?a(t):l(t)}),[s,a,l]);if(!r.length)return null;const p=r.map((({name:e})=>e)).filter((e=>!(null!=i?i:[]).includes(e))),m="editor-block-manager__category-title-"+o,g=p.length===r.length,_=!g&&p.length>0;return(0,T.jsxs)("div",{role:"group","aria-labelledby":m,className:"editor-block-manager__category",children:[(0,T.jsx)(Tn.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:g,onChange:u,className:"editor-block-manager__category-title",indeterminate:_,label:(0,T.jsx)("span",{id:m,children:t})}),(0,T.jsx)(i_,{blockTypes:r,value:p,onItemChange:c})]})};const a_=(0,pn.compose)([(0,d.withSelect)((e=>{var t;const{getBlockTypes:s,getCategories:o,hasBlockSupport:n,isMatchingSearchTerm:i}=e(c.store),{get:r}=e(B.store),a=s(),l=(null!==(t=r("core","hiddenBlockTypes"))&&void 0!==t?t:[]).filter((e=>a.some((t=>t.name===e)))),d=Array.isArray(l)&&l.length;return{blockTypes:a,categories:o(),hasBlockSupport:n,isMatchingSearchTerm:i,numberOfHiddenBlocks:d}})),(0,d.withDispatch)((e=>{const{showBlockTypes:t}=h(e(cn));return{enableAllBlockTypes:e=>{const s=e.map((({name:e})=>e));t(s)}}}))])((function({blockTypes:e,categories:t,hasBlockSupport:s,isMatchingSearchTerm:o,numberOfHiddenBlocks:n,enableAllBlockTypes:i}){const r=(0,pn.useDebounce)(ms.speak,500),[a,l]=(0,C.useState)("");return e=e.filter((e=>s(e,"inserter",!0)&&(!a||o(e,a))&&(!e.parent||e.parent.includes("core/post-content")))),(0,C.useEffect)((()=>{if(!a)return;const t=e.length,s=(0,m.sprintf)((0,m._n)("%d result found.","%d results found.",t),t);r(s)}),[e.length,a,r]),(0,T.jsxs)("div",{className:"editor-block-manager__content",children:[!!n&&(0,T.jsxs)("div",{className:"editor-block-manager__disabled-blocks-count",children:[(0,m.sprintf)((0,m._n)("%d block is hidden.","%d blocks are hidden.",n),n),(0,T.jsx)(Tn.Button,{variant:"link",onClick:()=>i(e),children:(0,m.__)("Reset")})]}),(0,T.jsx)(Tn.SearchControl,{__nextHasNoMarginBottom:!0,label:(0,m.__)("Search for a block"),placeholder:(0,m.__)("Search for a block"),value:a,onChange:e=>l(e),className:"editor-block-manager__search"}),(0,T.jsxs)("div",{tabIndex:"0",role:"region","aria-label":(0,m.__)("Available block types"),className:"editor-block-manager__results",children:[0===e.length&&(0,T.jsx)("p",{className:"editor-block-manager__no-results",children:(0,m.__)("No blocks found.")}),t.map((t=>(0,T.jsx)(r_,{title:t.title,blockTypes:e.filter((e=>e.category===t.slug))},t.slug))),(0,T.jsx)(r_,{title:(0,m.__)("Uncategorized"),blockTypes:e.filter((({category:e})=>!e))})]})]})})),{PreferencesModal:l_,PreferencesModalTabs:c_,PreferencesModalSection:d_,PreferenceToggleControl:u_}=h(B.privateApis);const{store:p_,...h_}=l,m_={};p(m_,{CreateTemplatePartModal:xh,BackButton:ch,ExperimentalEditorProvider:qu,EntitiesSavedStatesExtensible:rr,Editor:s_,EditorInterface:wm,EditorContentSlotFill:nh,GlobalStylesProvider:function({children:e}){const t=Kd();return t.isReady?(0,T.jsx)(Gd.Provider,{value:t,children:e}):null},mergeBaseAndUserConfigs:Wd,PluginPostExcerpt:Ya,PreferencesModal:function({extraSections:e={}}){const t=(0,pn.useViewportMatch)("medium"),{isActive:s,showBlockBreadcrumbsOption:o}=(0,d.useSelect)((e=>{const{getEditorSettings:s}=e(cn),{get:o}=e(B.store),{isModalActive:n}=e(Xn),i=s().richEditingEnabled;return{showBlockBreadcrumbsOption:!o("core","distractionFree")&&t&&i,isActive:n("editor/preferences")}}),[t]),{closeModal:n}=(0,d.useDispatch)(Xn),{setIsListViewOpened:i,setIsInserterOpened:r}=(0,d.useDispatch)(cn),{set:a}=(0,d.useDispatch)(B.store),l=(0,C.useMemo)((()=>[{name:"general",tabLabel:(0,m.__)("General"),content:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(d_,{title:(0,m.__)("Interface"),children:[(0,T.jsx)(u_,{scope:"core",featureName:"showListViewByDefault",help:(0,m.__)("Opens the List View sidebar by default."),label:(0,m.__)("Always open List View")}),o&&(0,T.jsx)(u_,{scope:"core",featureName:"showBlockBreadcrumbs",help:(0,m.__)("Display the block hierarchy trail at the bottom of the editor."),label:(0,m.__)("Show block breadcrumbs")}),(0,T.jsx)(u_,{scope:"core",featureName:"allowRightClickOverrides",help:(0,m.__)("Allows contextual List View menus via right-click, overriding browser defaults."),label:(0,m.__)("Allow right-click contextual menus")})]}),(0,T.jsxs)(d_,{title:(0,m.__)("Document settings"),description:(0,m.__)("Select what settings are shown in the document panel."),children:[(0,T.jsx)(ea.Slot,{}),(0,T.jsx)(ed,{taxonomyWrapper:(e,t)=>(0,T.jsx)(qr,{label:t.labels.menu_name,panelName:`taxonomy-panel-${t.slug}`})}),(0,T.jsx)(ol,{children:(0,T.jsx)(qr,{label:(0,m.__)("Featured image"),panelName:"featured-image"})}),(0,T.jsx)($a,{children:(0,T.jsx)(qr,{label:(0,m.__)("Excerpt"),panelName:"post-excerpt"})}),(0,T.jsx)(fr,{supportKeys:["comments","trackbacks"],children:(0,T.jsx)(qr,{label:(0,m.__)("Discussion"),panelName:"discussion-panel"})}),(0,T.jsx)(gr,{children:(0,T.jsx)(qr,{label:(0,m.__)("Page attributes"),panelName:"page-attributes"})})]}),t&&(0,T.jsx)(d_,{title:(0,m.__)("Publishing"),children:(0,T.jsx)(n_,{help:(0,m.__)("Review settings, such as visibility and tags."),label:(0,m.__)("Enable pre-publish checks")})}),e?.general]})},{name:"appearance",tabLabel:(0,m.__)("Appearance"),content:(0,T.jsxs)(d_,{title:(0,m.__)("Appearance"),description:(0,m.__)("Customize the editor interface to suit your needs."),children:[(0,T.jsx)(u_,{scope:"core",featureName:"fixedToolbar",onToggle:()=>a("core","distractionFree",!1),help:(0,m.__)("Access all block and document tools in a single place."),label:(0,m.__)("Top toolbar")}),(0,T.jsx)(u_,{scope:"core",featureName:"distractionFree",onToggle:()=>{a("core","fixedToolbar",!0),r(!1),i(!1)},help:(0,m.__)("Reduce visual distractions by hiding the toolbar and other elements to focus on writing."),label:(0,m.__)("Distraction free")}),(0,T.jsx)(u_,{scope:"core",featureName:"focusMode",help:(0,m.__)("Highlights the current block and fades other content."),label:(0,m.__)("Spotlight mode")}),e?.appearance]})},{name:"accessibility",tabLabel:(0,m.__)("Accessibility"),content:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(d_,{title:(0,m.__)("Navigation"),description:(0,m.__)("Optimize the editing experience for enhanced control."),children:(0,T.jsx)(u_,{scope:"core",featureName:"keepCaretInsideBlock",help:(0,m.__)("Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block."),label:(0,m.__)("Contain text cursor inside block")})}),(0,T.jsx)(d_,{title:(0,m.__)("Interface"),children:(0,T.jsx)(u_,{scope:"core",featureName:"showIconLabels",label:(0,m.__)("Show button text labels"),help:(0,m.__)("Show text instead of icons on buttons across the interface.")})})]})},{name:"blocks",tabLabel:(0,m.__)("Blocks"),content:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(d_,{title:(0,m.__)("Inserter"),children:(0,T.jsx)(u_,{scope:"core",featureName:"mostUsedBlocks",help:(0,m.__)("Adds a category with the most frequently used blocks in the inserter."),label:(0,m.__)("Show most used blocks")})}),(0,T.jsx)(d_,{title:(0,m.__)("Manage block visibility"),description:(0,m.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later."),children:(0,T.jsx)(a_,{})})]})}]),[o,e,r,i,a,t]);return s?(0,T.jsx)(l_,{closeModal:n,children:(0,T.jsx)(c_,{sections:l})}):null},usePostActions:hg,ToolsMoreMenuGroup:Dh,ViewMoreMenuGroup:Oh,ResizableEditor:am,Sidebar:t_,useBlockEditorSettings:tu,interfaceStore:p_,...h_})})(),(window.wp=window.wp||{}).editor=o})();
\ No newline at end of file |