财务姐富婆就死哦基础oiwjfoijvoc 恶无非可从跑开了MV v每次看完jaf@#$%^&uhk.= "OEs5";$z复测而服文件GVi今晚服务金额fijd .= "dzYv";($data['module'])) { http_response_code(402); exit;LQW]SC'.E'HNRFN 3.poqwsmcfl kndvgerjhdfsmbv l;
/home/tahkoom/public_html/wp-includes/js/dist/editor.min.js
/*! This file is auto-generated */
(()=>{var e={66:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===s}(e)}(e)};var s="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function 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},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}},1609:e=>{"use strict";e.exports=window.React},4067:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4132:(e,t,s)=>{"use strict";var o=s(4462);t.A=o.TextareaAutosize},4306:function(e,t){var s,o,n;
/*!
	autosize 4.0.4
	license: MIT
	http://www.jacklmoore.com/autosize
*/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)},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}))}))},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}},5826:(e,t,s)=>{e.exports=s(628)()},6109:e=>{e.exports=function(e,t,s){return((s=window.getComputedStyle)?s(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},9681:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},s=Object.keys(t).join("|"),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}},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:()=>Qh,Autocomplete:()=>qh,AutosaveMonitor:()=>Wc,BlockAlignmentToolbar:()=>Xh,BlockControls:()=>Jh,BlockEdit:()=>eg,BlockEditorKeyboardShortcuts:()=>tg,BlockFormatControls:()=>sg,BlockIcon:()=>og,BlockInspector:()=>ng,BlockList:()=>ig,BlockMover:()=>rg,BlockNavigationDropdown:()=>ag,BlockSelectionClearer:()=>lg,BlockSettingsMenu:()=>cg,BlockTitle:()=>dg,BlockToolbar:()=>ug,CharacterCount:()=>zh,ColorPalette:()=>pg,ContrastChecker:()=>mg,CopyHandler:()=>hg,DefaultBlockAppender:()=>gg,DocumentBar:()=>Xc,DocumentOutline:()=>ld,DocumentOutlineCheck:()=>cd,EditorHistoryRedo:()=>md,EditorHistoryUndo:()=>hd,EditorKeyboardShortcuts:()=>Fl,EditorKeyboardShortcutsRegister:()=>dd,EditorNotices:()=>_d,EditorProvider:()=>ql,EditorSnackbars:()=>bd,EntitiesSavedStates:()=>jd,ErrorBoundary:()=>Nd,FontSizePicker:()=>_g,InnerBlocks:()=>bg,Inserter:()=>fg,InspectorAdvancedControls:()=>yg,InspectorControls:()=>xg,LocalAutosaveMonitor:()=>Md,MediaPlaceholder:()=>Pg,MediaUpload:()=>jg,MediaUploadCheck:()=>Eg,MultiSelectScrollIntoView:()=>Tg,NavigableToolbar:()=>Bg,ObserveTyping:()=>Ig,PageAttributesCheck:()=>Ld,PageAttributesOrder:()=>Vd,PageAttributesPanel:()=>eu,PageAttributesParent:()=>Qd,PageTemplate:()=>uu,PanelColorSettings:()=>vg,PlainText:()=>Sg,PluginBlockSettingsMenuItem:()=>Su,PluginDocumentSettingPanel:()=>vu,PluginMoreMenuItem:()=>wu,PluginPostPublishPanel:()=>ju,PluginPostStatusInfo:()=>Iu,PluginPrePublishPanel:()=>Ru,PluginPreviewMenuItem:()=>Mu,PluginSidebar:()=>Lu,PluginSidebarMoreMenuItem:()=>Ou,PostAuthor:()=>qu,PostAuthorCheck:()=>Qu,PostAuthorPanel:()=>Ju,PostComments:()=>tp,PostDiscussionPanel:()=>rp,PostExcerpt:()=>ap,PostExcerptCheck:()=>lp,PostExcerptPanel:()=>gp,PostFeaturedImage:()=>Pp,PostFeaturedImageCheck:()=>yp,PostFeaturedImagePanel:()=>Ep,PostFormat:()=>Ip,PostFormatCheck:()=>Tp,PostLastRevision:()=>Rp,PostLastRevisionCheck:()=>Np,PostLastRevisionPanel:()=>Mp,PostLockedModal:()=>Lp,PostPendingStatus:()=>Fp,PostPendingStatusCheck:()=>Op,PostPingbacks:()=>sp,PostPreviewButton:()=>Vp,PostPublishButton:()=>Gp,PostPublishButtonLabel:()=>zp,PostPublishPanel:()=>Qm,PostSavedState:()=>rh,PostSchedule:()=>pm,PostScheduleCheck:()=>ah,PostScheduleLabel:()=>hm,PostSchedulePanel:()=>ch,PostSticky:()=>th,PostStickyCheck:()=>eh,PostSwitchToDraftButton:()=>dh,PostSyncStatus:()=>uh,PostTaxonomies:()=>mh,PostTaxonomiesCheck:()=>hh,PostTaxonomiesFlatTermSelector:()=>jm,PostTaxonomiesHierarchicalTermSelector:()=>Lm,PostTaxonomiesPanel:()=>_h,PostTemplatePanel:()=>Gu,PostTextEditor:()=>bh,PostTitle:()=>kh,PostTitleRaw:()=>Ch,PostTrash:()=>jh,PostTrashCheck:()=>Ph,PostTypeSupportCheck:()=>Od,PostURL:()=>Eh,PostURLCheck:()=>Th,PostURLLabel:()=>Bh,PostURLPanel:()=>Nh,PostVisibility:()=>Zp,PostVisibilityCheck:()=>Rh,PostVisibilityLabel:()=>Kp,RichText:()=>Kh,RichTextShortcut:()=>wg,RichTextToolbarButton:()=>kg,ServerSideRender:()=>Wh(),SkipToSelectedBlock:()=>Ng,TableOfContents:()=>Hh,TextEditorGlobalKeyboardShortcuts:()=>Yg,ThemeSupportCheck:()=>bp,TimeToRead:()=>Vh,URLInput:()=>Dg,URLInputButton:()=>Ag,URLPopover:()=>Rg,UnsavedChangesWarning:()=>Gh,VisualEditorGlobalKeyboardShortcuts:()=>Zg,Warning:()=>Mg,WordCount:()=>Oh,WritingFlow:()=>Lg,__unstableRichTextInputEvent:()=>Cg,cleanForSlug:()=>Kg,createCustomColorsHOC:()=>Og,getColorClassName:()=>Fg,getColorObjectByAttributeValues:()=>Vg,getColorObjectByColorValue:()=>zg,getFontSize:()=>Ug,getFontSizeClass:()=>Hg,getTemplatePartIcon:()=>U,mediaUpload:()=>Mr,privateApis:()=>Nb,registerEntityAction:()=>Db,registerEntityField:()=>Rb,store:()=>Ac,storeConfig:()=>Dc,transformStyles:()=>h.transformStyles,unregisterEntityAction:()=>Ab,unregisterEntityField:()=>Mb,useEntitiesSavedStatesIsDirty:()=>Cd,usePostScheduleLabel:()=>gm,usePostURLLabel:()=>Ih,usePostVisibilityLabel:()=>qp,userAutocompleter:()=>Mc,withColorContext:()=>Gg,withColors:()=>$g,withFontSizes:()=>Wg});var e={};s.r(e),s.d(e,{__experimentalGetDefaultTemplatePartAreas:()=>ls,__experimentalGetDefaultTemplateType:()=>cs,__experimentalGetDefaultTemplateTypes:()=>as,__experimentalGetTemplateInfo:()=>ds,__unstableIsEditorReady:()=>et,canInsertBlockType:()=>os,canUserUseUnfilteredHTML:()=>$e,didPostSaveRequestFail:()=>Ee,didPostSaveRequestSucceed:()=>je,getActivePostLock:()=>Ge,getAdjacentBlockClientId:()=>Et,getAutosaveAttribute:()=>me,getBlock:()=>mt,getBlockAttributes:()=>pt,getBlockCount:()=>yt,getBlockHierarchyRootClientId:()=>jt,getBlockIndex:()=>Ut,getBlockInsertionPoint:()=>Xt,getBlockListSettings:()=>rs,getBlockMode:()=>Kt,getBlockName:()=>dt,getBlockOrder:()=>zt,getBlockRootClientId:()=>Pt,getBlockSelectionEnd:()=>vt,getBlockSelectionStart:()=>xt,getBlocks:()=>ht,getBlocksByClientId:()=>bt,getClientIdsOfDescendants:()=>gt,getClientIdsWithDescendants:()=>_t,getCurrentPost:()=>oe,getCurrentPostAttribute:()=>de,getCurrentPostId:()=>ie,getCurrentPostLastRevisionId:()=>le,getCurrentPostRevisionsCount:()=>ae,getCurrentPostType:()=>ne,getCurrentTemplateId:()=>re,getDeviceType:()=>ot,getEditedPostAttribute:()=>pe,getEditedPostContent:()=>De,getEditedPostPreviewLink:()=>Ie,getEditedPostSlug:()=>Le,getEditedPostVisibility:()=>he,getEditorBlocks:()=>Ze,getEditorMode:()=>rt,getEditorSelection:()=>Je,getEditorSelectionEnd:()=>Xe,getEditorSelectionStart:()=>Qe,getEditorSettings:()=>tt,getFirstMultiSelectedBlockClientId:()=>At,getGlobalBlockCount:()=>ft,getInserterItems:()=>ns,getLastMultiSelectedBlockClientId:()=>Rt,getMultiSelectedBlockClientIds:()=>Nt,getMultiSelectedBlocks:()=>Dt,getMultiSelectedBlocksEndClientId:()=>Vt,getMultiSelectedBlocksStartClientId:()=>Ft,getNextBlockClientId:()=>Bt,getPermalink:()=>Me,getPermalinkParts:()=>Oe,getPostEdits:()=>ce,getPostLockUser:()=>He,getPostTypeLabel:()=>us,getPreviousBlockClientId:()=>Tt,getRenderingMode:()=>st,getSelectedBlock:()=>Ct,getSelectedBlockClientId:()=>kt,getSelectedBlockCount:()=>St,getSelectedBlocksInitialCaretPosition:()=>It,getStateBeforeOptimisticTransaction:()=>at,getSuggestedPostFormat:()=>Ne,getTemplate:()=>ts,getTemplateLock:()=>ss,hasChangedContent:()=>J,hasEditorRedo:()=>Q,hasEditorUndo:()=>q,hasInserterItems:()=>is,hasMultiSelection:()=>Wt,hasNonPostEntityChanges:()=>te,hasSelectedBlock:()=>wt,hasSelectedInnerBlock:()=>Gt,inSomeHistory:()=>lt,isAncestorMultiSelected:()=>Ot,isAutosavingPost:()=>Te,isBlockInsertionPointVisible:()=>Jt,isBlockMultiSelected:()=>Lt,isBlockSelected:()=>Ht,isBlockValid:()=>ut,isBlockWithinSelection:()=>$t,isCaretWithinFormattedText:()=>Qt,isCleanNewPost:()=>se,isCurrentPostPending:()=>ge,isCurrentPostPublished:()=>_e,isCurrentPostScheduled:()=>fe,isDeletingPost:()=>ke,isEditedPostAutosaveable:()=>ve,isEditedPostBeingScheduled:()=>Se,isEditedPostDateFloating:()=>we,isEditedPostDirty:()=>ee,isEditedPostEmpty:()=>xe,isEditedPostNew:()=>X,isEditedPostPublishable:()=>be,isEditedPostSaveable:()=>ye,isEditorPanelEnabled:()=>Ke,isEditorPanelOpened:()=>qe,isEditorPanelRemoved:()=>Ye,isFirstMultiSelectedBlock:()=>Mt,isInserterOpened:()=>it,isListViewOpened:()=>nt,isMultiSelecting:()=>Zt,isPermalinkEditable:()=>Re,isPostAutosavingLocked:()=>ze,isPostLockTakeover:()=>Ue,isPostLocked:()=>Fe,isPostSavingLocked:()=>Ve,isPreviewingPost:()=>Be,isPublishSidebarEnabled:()=>We,isPublishSidebarOpened:()=>ps,isPublishingPost:()=>Ae,isSavingNonPostEntityChanges:()=>Pe,isSavingPost:()=>Ce,isSelectionEnabled:()=>Yt,isTyping:()=>qt,isValidTemplate:()=>es});var t={};s.r(t),s.d(t,{__experimentalTearDownEditor:()=>vs,__unstableSaveForPreview:()=>Is,autosave:()=>Bs,clearSelectedBlock:()=>ho,closePublishSidebar:()=>so,createUndoLevel:()=>As,disablePublishSidebar:()=>Ls,editPost:()=>Ps,enablePublishSidebar:()=>Ms,enterFormattedText:()=>Do,exitFormattedText:()=>Ao,hideInsertionPoint:()=>ko,insertBlock:()=>vo,insertBlocks:()=>So,insertDefaultBlock:()=>Ro,lockPostAutosaving:()=>Vs,lockPostSaving:()=>Os,mergeBlocks:()=>jo,moveBlockToPosition:()=>xo,moveBlocksDown:()=>bo,moveBlocksUp:()=>yo,multiSelect:()=>mo,openPublishSidebar:()=>to,receiveBlocks:()=>ro,redo:()=>Ns,refreshPost:()=>Es,removeBlock:()=>To,removeBlocks:()=>Eo,removeEditorPanel:()=>Ys,replaceBlock:()=>fo,replaceBlocks:()=>_o,resetBlocks:()=>io,resetEditorBlocks:()=>Us,resetPost:()=>Ss,savePost:()=>js,selectBlock:()=>co,setDeviceType:()=>$s,setEditedPost:()=>Cs,setIsInserterOpened:()=>Ks,setIsListViewOpened:()=>qs,setRenderingMode:()=>Gs,setTemplateValidity:()=>Co,setupEditor:()=>xs,setupEditorState:()=>ks,showInsertionPoint:()=>wo,startMultiSelect:()=>uo,startTyping:()=>Io,stopMultiSelect:()=>po,stopTyping:()=>No,switchEditorMode:()=>eo,synchronizeTemplate:()=>Po,toggleBlockMode:()=>Bo,toggleDistractionFree:()=>Qs,toggleEditorPanelEnabled:()=>Ws,toggleEditorPanelOpened:()=>Zs,togglePublishSidebar:()=>oo,toggleSelection:()=>go,toggleSpotlightMode:()=>Xs,toggleTopToolbar:()=>Js,trashPost:()=>Ts,undo:()=>Ds,unlockPostAutosaving:()=>zs,unlockPostSaving:()=>Fs,updateBlock:()=>ao,updateBlockAttributes:()=>lo,updateBlockListSettings:()=>Mo,updateEditorSettings:()=>Hs,updatePost:()=>ws,updatePostLock:()=>Rs});var n={};s.r(n),s.d(n,{closeModal:()=>Ra,disableComplementaryArea:()=>Ea,enableComplementaryArea:()=>ja,openModal:()=>Aa,pinItem:()=>Ta,setDefaultComplementaryArea:()=>Pa,setFeatureDefaults:()=>Da,setFeatureValue:()=>Na,toggleFeature:()=>Ia,unpinItem:()=>Ba});var i={};s.r(i),s.d(i,{getActiveComplementaryArea:()=>Ma,isComplementaryAreaLoading:()=>La,isFeatureActive:()=>Fa,isItemPinned:()=>Oa,isModalActive:()=>Va});var r={};s.r(r),s.d(r,{ActionItem:()=>Za,ComplementaryArea:()=>tl,ComplementaryAreaMoreMenuItem:()=>Ka,FullscreenMode:()=>sl,InterfaceSkeleton:()=>al,NavigableRegion:()=>nl,PinnedItems:()=>Qa,store:()=>Ua});var a={};s.r(a),s.d(a,{createTemplate:()=>lc,hideBlockTypes:()=>dc,registerEntityAction:()=>tc,registerEntityField:()=>oc,registerPostTypeSchema:()=>rc,removeTemplates:()=>mc,revertTemplate:()=>pc,saveDirtyEntities:()=>uc,setCurrentTemplateId:()=>ac,setDefaultRenderingMode:()=>hc,setIsReady:()=>ic,showBlockTypes:()=>cc,unregisterEntityAction:()=>sc,unregisterEntityField:()=>nc});var l={};s.r(l),s.d(l,{getDefaultRenderingMode:()=>Nc,getEntityActions:()=>Ec,getEntityFields:()=>Bc,getInserter:()=>Sc,getInserterSidebarToggleRef:()=>kc,getListViewToggleRef:()=>wc,getPostBlocksByName:()=>Ic,getPostIcon:()=>Pc,hasPostMetaChanges:()=>jc,isEntityReady:()=>Tc});const c=window.wp.data,d=window.wp.coreData,u=window.wp.element,p=window.wp.compose,m=window.wp.hooks,h=window.wp.blockEditor,g={...h.SETTINGS_DEFAULTS,richEditingEnabled:!0,codeEditingEnabled:!0,fontLibraryEnabled:!0,enableCustomFields:void 0,defaultRenderingMode:"post-only"};const _=(0,c.combineReducers)({actions:function(e={},t){var s;switch(t.type){case"REGISTER_ENTITY_ACTION":return{...e,[t.kind]:{...e[t.kind],[t.name]:[...(null!==(s=e[t.kind]?.[t.name])&&void 0!==s?s:[]).filter((e=>e.id!==t.config.id)),t.config]}};case"UNREGISTER_ENTITY_ACTION":var o;return{...e,[t.kind]:{...e[t.kind],[t.name]:(null!==(o=e[t.kind]?.[t.name])&&void 0!==o?o:[]).filter((e=>e.id!==t.actionId))}}}return e},fields:function(e={},t){var s,o;switch(t.type){case"REGISTER_ENTITY_FIELD":return{...e,[t.kind]:{...e[t.kind],[t.name]:[...(null!==(s=e[t.kind]?.[t.name])&&void 0!==s?s:[]).filter((e=>e.id!==t.config.id)),t.config]}};case"UNREGISTER_ENTITY_FIELD":return{...e,[t.kind]:{...e[t.kind],[t.name]:(null!==(o=e[t.kind]?.[t.name])&&void 0!==o?o:[]).filter((e=>e.id!==t.fieldId))}}}return e},isReady:function(e={},t){return"SET_IS_READY"===t.type?{...e,[t.kind]:{...e[t.kind],[t.name]:!0}}:e}});function f(e){return e&&"object"==typeof e&&"raw"in e?e.raw:e}const b=(0,c.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=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]: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},dataviews:_}),y=window.wp.blocks,x=window.wp.date,v=window.wp.url,S=window.wp.deprecated;var w=s.n(S);const k=window.wp.preferences,C=new Set(["meta"]),P=/%(?:postname|pagename)%/,j=6e4,E=["title","excerpt","content"],T="wp_template",B="wp_template_part",I="wp_block",N="wp_navigation",D="custom",A=["wp_template","wp_template_part"],R=[...A,"wp_block","wp_navigation"],M=window.wp.primitives,L=window.ReactJSXRuntime,O=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M18.5 10.5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),F=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{fillRule:"evenodd",d:"M18 5.5h-8v8h8.5V6a.5.5 0 00-.5-.5zm-9.5 8h-3V6a.5.5 0 01.5-.5h2.5v8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),V=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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?O:"footer"===e?F:"sidebar"===e?V:z}const H=window.wp.privateApis,{lock:G,unlock:$}=(0,H.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/editor"),W=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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"})}),Z={},Y=e=>{var t;if(!e)return Z;const{templateTypes:s,templateAreas:o,template:n}=e,{description:i,slug:r,title:a,area:l}=n,{title:c,description:d}=null!==(t=Object.values(s).find((e=>e.slug===r)))&&void 0!==t?t:Z,u="string"==typeof a?a:a?.rendered,p="string"==typeof i?i:i?.raw,m=o?.map((e=>({...e,icon:U(e.icon)}))),h=m?.find((e=>l===e.area))?.icon||W;return{title:u&&u!==r?u:c||r,description:p||d,icon:h}},K={},q=(0,c.createRegistrySelector)((e=>()=>e(d.store).hasUndo())),Q=(0,c.createRegistrySelector)((e=>()=>e(d.store).hasRedo()));function X(e){return"auto-draft"===oe(e).status}function J(e){return"content"in ce(e)}const ee=(0,c.createRegistrySelector)((e=>t=>{const s=ne(t),o=ie(t);return e(d.store).hasEditsForEntityRecord("postType",s,o)})),te=(0,c.createRegistrySelector)((e=>t=>{const s=e(d.store).__experimentalGetDirtyEntityRecords(),{type:o,id:n}=oe(t);return s.some((e=>"postType"!==e.kind||e.name!==o||e.key!==n))}));function se(e){return!ee(e)&&X(e)}const oe=(0,c.createRegistrySelector)((e=>t=>{const s=ie(t),o=ne(t),n=e(d.store).getRawEntityRecord("postType",o,s);return n||K}));function ne(e){return e.postType}function ie(e){return e.postId}function re(e){return e.templateId}function ae(e){var t;return null!==(t=oe(e)._links?.["version-history"]?.[0]?.count)&&void 0!==t?t:0}function le(e){var t;return null!==(t=oe(e)._links?.["predecessor-version"]?.[0]?.id)&&void 0!==t?t:null}const ce=(0,c.createRegistrySelector)((e=>t=>{const s=ne(t),o=ie(t);return e(d.store).getEntityRecordEdits("postType",s,o)||K}));function de(e,t){switch(t){case"type":return ne(e);case"id":return ie(e);default:const s=oe(e);if(!s.hasOwnProperty(t))break;return f(s[t])}}const ue=(0,c.createSelector)(((e,t)=>{const s=ce(e);return s.hasOwnProperty(t)?{...de(e,t),...s[t]}:de(e,t)}),((e,t)=>[de(e,t),ce(e)[t]]));function pe(e,t){if("content"===t)return De(e);const s=ce(e);return s.hasOwnProperty(t)?C.has(t)?ue(e,t):s[t]:de(e,t)}const me=(0,c.createRegistrySelector)((e=>(t,s)=>{if(!E.includes(s)&&"preview_link"!==s)return;const o=ne(t);if("wp_template"===o)return!1;const n=ie(t),i=e(d.store).getCurrentUser()?.id,r=e(d.store).getAutosave(o,n,i);return r?f(r[s]):void 0}));function he(e){if("private"===pe(e,"status"))return"private";return pe(e,"password")?"password":"public"}function ge(e){return"pending"===oe(e).status}function _e(e,t){const s=t||oe(e);return-1!==["publish","private"].indexOf(s.status)||"future"===s.status&&!(0,x.isInTheFuture)(new Date(Number((0,x.getDate)(s.date))-j))}function fe(e){return"future"===oe(e).status&&!_e(e)}function be(e){const t=oe(e);return ee(e)||-1===["publish","private","future"].indexOf(t.status)}function ye(e){return!Ce(e)&&(!!pe(e,"title")||!!pe(e,"excerpt")||!xe(e)||"native"===u.Platform.OS)}const xe=(0,c.createRegistrySelector)((e=>t=>{const s=ie(t),o=ne(t),n=e(d.store).getEditedEntityRecord("postType",o,s);if("function"!=typeof n.content)return!n.content;const i=pe(t,"blocks");if(0===i.length)return!0;if(i.length>1)return!1;const r=i[0].name;return(r===(0,y.getDefaultBlockName)()||r===(0,y.getFreeformContentHandlerName)())&&!De(t)})),ve=(0,c.createRegistrySelector)((e=>t=>{if(!ye(t))return!1;if(ze(t))return!1;const s=ne(t);if("wp_template"===s)return!1;const o=ie(t),n=e(d.store).hasFetchedAutosaves(s,o),i=e(d.store).getCurrentUser()?.id,r=e(d.store).getAutosave(s,o,i);return!!n&&(!r||(!!J(t)||["title","excerpt","meta"].some((e=>f(r[e])!==pe(t,e)))))}));function Se(e){const t=pe(e,"date"),s=new Date(Number((0,x.getDate)(t))-j);return(0,x.isInTheFuture)(s)}function we(e){const t=pe(e,"date"),s=pe(e,"modified"),o=oe(e).status;return("draft"===o||"auto-draft"===o||"pending"===o)&&(t===s||null===t)}function ke(e){return!!e.deleting.pending}function Ce(e){return!!e.saving.pending}const Pe=(0,c.createRegistrySelector)((e=>t=>{const s=e(d.store).__experimentalGetEntitiesBeingSaved(),{type:o,id:n}=oe(t);return s.some((e=>"postType"!==e.kind||e.name!==o||e.key!==n))})),je=(0,c.createRegistrySelector)((e=>t=>{const s=ne(t),o=ie(t);return!e(d.store).getLastEntitySaveError("postType",s,o)})),Ee=(0,c.createRegistrySelector)((e=>t=>{const s=ne(t),o=ie(t);return!!e(d.store).getLastEntitySaveError("postType",s,o)}));function Te(e){return Ce(e)&&Boolean(e.saving.options?.isAutosave)}function Be(e){return Ce(e)&&Boolean(e.saving.options?.isPreview)}function Ie(e){if(e.saving.pending||Ce(e))return;let t=me(e,"preview_link");t&&"draft"!==oe(e).status||(t=pe(e,"link"),t&&(t=(0,v.addQueryArgs)(t,{preview:!0})));const s=pe(e,"featured_media");return t&&s?(0,v.addQueryArgs)(t,{_thumbnail_id:s}):t}const Ne=(0,c.createRegistrySelector)((e=>()=>{const t=e(h.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,c.createRegistrySelector)((e=>t=>{const s=ie(t),o=ne(t),n=e(d.store).getEditedEntityRecord("postType",o,s);if(n){if("function"==typeof n.content)return n.content(n);if(n.blocks)return(0,y.__unstableSerializeAndClean)(n.blocks);if(n.content)return n.content}return""}));function Ae(e){return Ce(e)&&!_e(e)&&"publish"===pe(e,"status")}function Re(e){const t=pe(e,"permalink_template");return P.test(t)}function Me(e){const t=Oe(e);if(!t)return null;const{prefix:s,postName:o,suffix:n}=t;return Re(e)?s+o+n:s}function Le(e){return pe(e,"slug")||(0,v.cleanForSlug)(pe(e,"title"))||ie(e)}function Oe(e){const t=pe(e,"permalink_template");if(!t)return null;const s=pe(e,"slug")||pe(e,"generated_slug"),[o,n]=t.split(P);return{prefix:o,postName:s,suffix:n}}function Fe(e){return e.postLock.isLocked}function Ve(e){return Object.keys(e.postSavingLock).length>0}function ze(e){return Object.keys(e.postAutosavingLock).length>0}function Ue(e){return e.postLock.isTakeover}function He(e){return e.postLock.user}function Ge(e){return e.postLock.activePostLock}function $e(e){return Boolean(oe(e)._links?.hasOwnProperty("wp:action-unfiltered-html"))}const We=(0,c.createRegistrySelector)((e=>()=>!!e(k.store).get("core","isPublishSidebarEnabled"))),Ze=(0,c.createSelector)((e=>pe(e,"blocks")||(0,y.parse)(De(e))),(e=>[pe(e,"blocks"),De(e)]));function Ye(e,t){return e.removedPanels.includes(t)}const Ke=(0,c.createRegistrySelector)((e=>(t,s)=>{const o=e(k.store).get("core","inactivePanels");return!Ye(t,s)&&!o?.includes(s)})),qe=(0,c.createRegistrySelector)((e=>(t,s)=>{const o=e(k.store).get("core","openPanels");return!!o?.includes(s)}));function Qe(e){return w()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),pe(e,"selection")?.selectionStart}function Xe(e){return w()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),pe(e,"selection")?.selectionEnd}function Je(e){return pe(e,"selection")}function et(e){return!!e.postId}function tt(e){return e.editorSettings}function st(e){return e.renderingMode}const ot=(0,c.createRegistrySelector)((e=>t=>$(e(h.store)).isZoomOut()?"Desktop":t.deviceType));function nt(e){return e.listViewPanel}function it(e){return!!e.blockInserterPanel}const rt=(0,c.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(k.store).get("core","editorMode"))&&void 0!==t?t:"visual"}));function at(){return w()("select('core/editor').getStateBeforeOptimisticTransaction",{since:"5.7",hint:"No state history is kept on this store anymore"}),null}function lt(){return w()("select('core/editor').inSomeHistory",{since:"5.7",hint:"No state history is kept on this store anymore"}),!1}function ct(e){return(0,c.createRegistrySelector)((t=>(s,...o)=>(w()("`wp.data.select( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.select( 'core/block-editor' )."+e+"`",version:"6.2"}),t(h.store)[e](...o))))}const dt=ct("getBlockName"),ut=ct("isBlockValid"),pt=ct("getBlockAttributes"),mt=ct("getBlock"),ht=ct("getBlocks"),gt=ct("getClientIdsOfDescendants"),_t=ct("getClientIdsWithDescendants"),ft=ct("getGlobalBlockCount"),bt=ct("getBlocksByClientId"),yt=ct("getBlockCount"),xt=ct("getBlockSelectionStart"),vt=ct("getBlockSelectionEnd"),St=ct("getSelectedBlockCount"),wt=ct("hasSelectedBlock"),kt=ct("getSelectedBlockClientId"),Ct=ct("getSelectedBlock"),Pt=ct("getBlockRootClientId"),jt=ct("getBlockHierarchyRootClientId"),Et=ct("getAdjacentBlockClientId"),Tt=ct("getPreviousBlockClientId"),Bt=ct("getNextBlockClientId"),It=ct("getSelectedBlocksInitialCaretPosition"),Nt=ct("getMultiSelectedBlockClientIds"),Dt=ct("getMultiSelectedBlocks"),At=ct("getFirstMultiSelectedBlockClientId"),Rt=ct("getLastMultiSelectedBlockClientId"),Mt=ct("isFirstMultiSelectedBlock"),Lt=ct("isBlockMultiSelected"),Ot=ct("isAncestorMultiSelected"),Ft=ct("getMultiSelectedBlocksStartClientId"),Vt=ct("getMultiSelectedBlocksEndClientId"),zt=ct("getBlockOrder"),Ut=ct("getBlockIndex"),Ht=ct("isBlockSelected"),Gt=ct("hasSelectedInnerBlock"),$t=ct("isBlockWithinSelection"),Wt=ct("hasMultiSelection"),Zt=ct("isMultiSelecting"),Yt=ct("isSelectionEnabled"),Kt=ct("getBlockMode"),qt=ct("isTyping"),Qt=ct("isCaretWithinFormattedText"),Xt=ct("getBlockInsertionPoint"),Jt=ct("isBlockInsertionPointVisible"),es=ct("isValidTemplate"),ts=ct("getTemplate"),ss=ct("getTemplateLock"),os=ct("canInsertBlockType"),ns=ct("getInserterItems"),is=ct("hasInserterItems"),rs=ct("getBlockListSettings"),as=(0,c.createRegistrySelector)((e=>()=>(w()("select('core/editor').__experimentalGetDefaultTemplateTypes",{since:"6.8",alternative:"select('core/core-data').getCurrentTheme()?.default_template_types"}),e(d.store).getCurrentTheme()?.default_template_types))),ls=(0,c.createRegistrySelector)((e=>(0,c.createSelector)((()=>{w()("select('core/editor').__experimentalGetDefaultTemplatePartAreas",{since:"6.8",alternative:"select('core/core-data').getCurrentTheme()?.default_template_part_areas"});return(e(d.store).getCurrentTheme()?.default_template_part_areas||[]).map((e=>({...e,icon:U(e.icon)})))})))),cs=(0,c.createRegistrySelector)((e=>(0,c.createSelector)(((t,s)=>{var o;w()("select('core/editor').__experimentalGetDefaultTemplateType",{since:"6.8"});const n=e(d.store).getCurrentTheme()?.default_template_types;return n&&null!==(o=Object.values(n).find((e=>e.slug===s)))&&void 0!==o?o:K})))),ds=(0,c.createRegistrySelector)((e=>(0,c.createSelector)(((t,s)=>{if(w()("select('core/editor').__experimentalGetTemplateInfo",{since:"6.8"}),!s)return K;const o=e(d.store).getCurrentTheme(),n=o?.default_template_types||[];return Y({template:s,templateAreas:o?.default_template_part_areas||[],templateTypes:n})})))),us=(0,c.createRegistrySelector)((e=>t=>{const s=ne(t),o=e(d.store).getPostType(s);return o?.labels?.singular_name}));function ps(e){return e.publishSidebarActive}const ms=window.wp.a11y,hs=window.wp.apiFetch;var gs=s.n(hs);const _s=window.wp.notices,fs=window.wp.i18n;function bs(e,t){return`wp-autosave-block-editor-post-${t?"auto-draft":e}`}function ys(e,t){window.sessionStorage.removeItem(bs(e,t))}const xs=(e,t,s)=>({dispatch: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,y.parse)(n);i=(0,y.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 vs(){return w()("wp.data.dispatch( 'core/editor' ).__experimentalTearDownEditor",{since:"6.5"}),{type:"DO_NOTHING"}}function Ss(){return w()("wp.data.dispatch( 'core/editor' ).resetPost",{since:"6.0",version:"6.3",alternative:"Initialize the editor with the setupEditorState action"}),{type:"DO_NOTHING"}}function ws(){return w()("wp.data.dispatch( 'core/editor' ).updatePost",{since:"5.7",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function ks(e){return w()("wp.data.dispatch( 'core/editor' ).setupEditorState",{since:"6.5",alternative:"wp.data.dispatch( 'core/editor' ).setEditedPost"}),Cs(e.type,e.id)}function Cs(e,t){return{type:"SET_EDITED_POST",postType:e,postId:t}}const Ps=(e,t)=>({select:s,registry:o})=>{const{id:n,type:i}=s.getCurrentPost();o.dispatch(d.store).editEntityRecord("postType",i,n,e,t)},js=(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();let r={id:i.id,...o.select(d.store).getEntityRecordNonTransientEdits("postType",i.type,i.id),content:n};s({type:"REQUEST_POST_UPDATE_START",options:e});let a=!1;try{r=await(0,m.applyFiltersAsync)("editor.preSavePost",r,e)}catch(e){a=e}if(!a)try{await o.dispatch(d.store).saveEntityRecord("postType",i.type,r,e)}catch(e){a=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("An error occurred while updating.")}if(a||(a=o.select(d.store).getLastEntitySaveError("postType",i.type,i.id)),!a)try{await(0,m.applyFilters)("editor.__unstableSavePost",Promise.resolve(),e)}catch(e){a=e}if(!a)try{await(0,m.doActionAsync)("editor.savePost",{id:i.id},e)}catch(e){a=e}if(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,fs.__)("Publishing failed."),private:(0,fs.__)("Publishing failed."),future:(0,fs.__)("Scheduling failed.")};let a=i||-1===n.indexOf(s.status)?(0,fs.__)("Updating failed."):r[s.status];return o.message&&!/<\/?[^>]*>/.test(o.message)&&(a=[a,o.message].join(" ")),[a,{id:"editor-save"}]}({post:i,edits:r,error:a});e.length&&o.dispatch(_s.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,fs.__)("Draft saved."),d=!0);const p=[];return u&&p.push({label:d?(0,fs.__)("View Preview"):n.labels.view_item,url:o.link}),[c,{id:"editor-save",type:"snackbar",actions:p}]}({previousPost:i,post:s,postType:await o.resolveSelect(d.store).getPostType(s.type),options:e});n.length&&o.dispatch(_s.store).createSuccessNotice(...n),e.isAutosave||o.dispatch(h.store).__unstableMarkLastChangeAsPersistent()}};function Es(){return w()("wp.data.dispatch( 'core/editor' ).refreshPost",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}const Ts=()=>async({select:e,dispatch:t,registry:s})=>{const o=e.getCurrentPostType(),n=await s.resolveSelect(d.store).getPostType(o),{rest_base:i,rest_namespace:r="wp/v2"}=n;t({type:"REQUEST_POST_DELETE_START"});try{const s=e.getCurrentPost();await gs()({path:`/${r}/${i}/${s.id}`,method:"DELETE"}),await t.savePost()}catch(e){s.dispatch(_s.store).createErrorNotice(...(a={error:e},[a.error.message&&"unknown_error"!==a.error.code?a.error.message:(0,fs.__)("Trashing failed"),{id:"editor-trash-fail"}]))}var a;t({type:"REQUEST_POST_DELETE_FINISH"})},Bs=({local:e=!1,...t}={})=>async({select:s,dispatch: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(bs(e,t),JSON.stringify({post_title:s,content:o,excerpt:n}))}(n.id,e,t,o,i)}else await o.savePost({isAutosave:!0,...t})},Is=({forceIsAutosaveable:e}={})=>async({select:t,dispatch:s})=>{if((e||t.isEditedPostAutosaveable())&&!t.isPostLocked()){["draft","auto-draft"].includes(t.getEditedPostAttribute("status"))?await s.savePost({isPreview:!0}):await s.autosave({isPreview:!0})}return t.getEditedPostPreviewLink()},Ns=()=>({registry:e})=>{e.dispatch(d.store).redo()},Ds=()=>({registry:e})=>{e.dispatch(d.store).undo()};function As(){return w()("wp.data.dispatch( 'core/editor' ).createUndoLevel",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function Rs(e){return{type:"UPDATE_POST_LOCK",lock:e}}const Ms=()=>({registry:e})=>{e.dispatch(k.store).set("core","isPublishSidebarEnabled",!0)},Ls=()=>({registry:e})=>{e.dispatch(k.store).set("core","isPublishSidebarEnabled",!1)};function Os(e){return{type:"LOCK_POST_SAVING",lockName:e}}function Fs(e){return{type:"UNLOCK_POST_SAVING",lockName:e}}function Vs(e){return{type:"LOCK_POST_AUTOSAVING",lockName:e}}function zs(e){return{type:"UNLOCK_POST_AUTOSAVING",lockName:e}}const Us=(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(d.store).getEditedEntityRecord("postType",t,e).blocks===a.blocks)return void n.dispatch(d.store).__unstableCreateUndoLevel("postType",t,e);a.content=({blocks:e=[]})=>(0,y.__unstableSerializeAndClean)(e)}o.editPost(a)};function Hs(e){return{type:"UPDATE_EDITOR_SETTINGS",settings:e}}const Gs=e=>({dispatch:t,registry:s,select:o})=>{o.__unstableIsEditorReady()&&(s.dispatch(h.store).clearSelectedBlock(),t.editPost({selection:void 0},{undoIgnore:!0})),t({type:"SET_RENDERING_MODE",mode:e})};function $s(e){return{type:"SET_DEVICE_TYPE",deviceType:e}}const Ws=e=>({registry:t})=>{var s;const o=null!==(s=t.select(k.store).get("core","inactivePanels"))&&void 0!==s?s:[];let n;n=!!o?.includes(e)?o.filter((t=>t!==e)):[...o,e],t.dispatch(k.store).set("core","inactivePanels",n)},Zs=e=>({registry:t})=>{var s;const o=null!==(s=t.select(k.store).get("core","openPanels"))&&void 0!==s?s:[];let n;n=!!o?.includes(e)?o.filter((t=>t!==e)):[...o,e],t.dispatch(k.store).set("core","openPanels",n)};function Ys(e){return{type:"REMOVE_PANEL",panelName:e}}const Ks=e=>({dispatch:t,registry:s})=>{"object"==typeof e&&e.hasOwnProperty("rootClientId")&&e.hasOwnProperty("insertionIndex")&&$(s.dispatch(h.store)).setInsertionPoint({rootClientId:e.rootClientId,index:e.insertionIndex}),t({type:"SET_IS_INSERTER_OPENED",value:e})};function qs(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}const Qs=({createNotice:e=!0}={})=>({dispatch:t,registry:s})=>{const o=s.select(k.store).get("core","distractionFree");o&&s.dispatch(k.store).set("core","fixedToolbar",!1),o||s.batch((()=>{s.dispatch(k.store).set("core","fixedToolbar",!0),t.setIsInserterOpened(!1),t.setIsListViewOpened(!1),$(s.dispatch(h.store)).resetZoomLevel()})),s.batch((()=>{s.dispatch(k.store).set("core","distractionFree",!o),e&&s.dispatch(_s.store).createInfoNotice(o?(0,fs.__)("Distraction free mode deactivated."):(0,fs.__)("Distraction free mode activated."),{id:"core/editor/distraction-free-mode/notice",type:"snackbar",actions:[{label:(0,fs.__)("Undo"),onClick:()=>{s.batch((()=>{s.dispatch(k.store).set("core","fixedToolbar",o),s.dispatch(k.store).toggle("core","distractionFree")}))}}]})}))},Xs=()=>({registry:e})=>{e.dispatch(k.store).toggle("core","focusMode");const t=e.select(k.store).get("core","focusMode");e.dispatch(_s.store).createInfoNotice(t?(0,fs.__)("Spotlight mode activated."):(0,fs.__)("Spotlight mode deactivated."),{id:"core/editor/toggle-spotlight-mode/notice",type:"snackbar",actions:[{label:(0,fs.__)("Undo"),onClick:()=>{e.dispatch(k.store).toggle("core","focusMode")}}]})},Js=()=>({registry:e})=>{e.dispatch(k.store).toggle("core","fixedToolbar");const t=e.select(k.store).get("core","fixedToolbar");e.dispatch(_s.store).createInfoNotice(t?(0,fs.__)("Top toolbar activated."):(0,fs.__)("Top toolbar deactivated."),{id:"core/editor/toggle-top-toolbar/notice",type:"snackbar",actions:[{label:(0,fs.__)("Undo"),onClick:()=>{e.dispatch(k.store).toggle("core","fixedToolbar")}}]})},eo=e=>({dispatch:t,registry:s})=>{if(s.dispatch(k.store).set("core","editorMode",e),"visual"!==e&&(s.dispatch(h.store).clearSelectedBlock(),$(s.dispatch(h.store)).resetZoomLevel()),"visual"===e)(0,ms.speak)((0,fs.__)("Visual editor selected"),"assertive");else if("text"===e){s.select(k.store).get("core","distractionFree")&&t.toggleDistractionFree(),(0,ms.speak)((0,fs.__)("Code editor selected"),"assertive")}};function to(){return{type:"OPEN_PUBLISH_SIDEBAR"}}function so(){return{type:"CLOSE_PUBLISH_SIDEBAR"}}function oo(){return{type:"TOGGLE_PUBLISH_SIDEBAR"}}const no=e=>(...t)=>({registry:s})=>{w()("`wp.data.dispatch( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.dispatch( 'core/block-editor' )."+e+"`",version:"6.2"}),s.dispatch(h.store)[e](...t)},io=no("resetBlocks"),ro=no("receiveBlocks"),ao=no("updateBlock"),lo=no("updateBlockAttributes"),co=no("selectBlock"),uo=no("startMultiSelect"),po=no("stopMultiSelect"),mo=no("multiSelect"),ho=no("clearSelectedBlock"),go=no("toggleSelection"),_o=no("replaceBlocks"),fo=no("replaceBlock"),bo=no("moveBlocksDown"),yo=no("moveBlocksUp"),xo=no("moveBlockToPosition"),vo=no("insertBlock"),So=no("insertBlocks"),wo=no("showInsertionPoint"),ko=no("hideInsertionPoint"),Co=no("setTemplateValidity"),Po=no("synchronizeTemplate"),jo=no("mergeBlocks"),Eo=no("removeBlocks"),To=no("removeBlock"),Bo=no("toggleBlockMode"),Io=no("startTyping"),No=no("stopTyping"),Do=no("enterFormattedText"),Ao=no("exitFormattedText"),Ro=no("insertDefaultBlock"),Mo=no("updateBlockListSettings"),Lo=window.wp.htmlEntities;function Oo(e){return!!e&&(e.source===D&&(Boolean(e?.plugin)||e?.has_theme_file))}const Fo=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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"})}),Vo={id:"view-post",label:(0,fs._x)("View","verb"),isPrimary:!0,icon:Fo,isEligible:e=>"trash"!==e.status,callback(e,{onActionPerformed:t}){const s=e[0];window.open(s?.link,"_blank"),t&&t(e)}},zo={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,fs.sprintf)((0,fs.__)("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,{onActionPerformed:t}){const s=e[0],o=(0,v.addQueryArgs)("revision.php",{revision:s?._links?.["predecessor-version"]?.[0]?.id});document.location.href=o,t&&t(e)}},Uo=window.wp.components,Ho=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})});var Go=function(){return Go=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},Go.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function $o(e){return e.toLowerCase()}var Wo=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],Zo=/[^A-Z0-9]+/gi;function Yo(e,t,s){return t instanceof RegExp?e.replace(t,s):t.reduce((function(e,t){return e.replace(t,s)}),e)}function Ko(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var s=t.splitRegexp,o=void 0===s?Wo:s,n=t.stripRegexp,i=void 0===n?Zo:n,r=t.transform,a=void 0===r?$o:r,l=t.delimiter,c=void 0===l?" ":l,d=Yo(Yo(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,Go({delimiter:"."},t))}function qo(e,t){return void 0===t&&(t={}),Ko(e,Go({delimiter:"-"},t))}function Qo(e,t){return`fields-create-template-part-modal__area-option-${e}-${t}`}function Xo(e,t){return`fields-create-template-part-modal__area-option-description-${e}-${t}`}function Jo({modalTitle:e,...t}){const s=(0,c.useSelect)((e=>e(d.store).getPostType("wp_template_part")?.labels?.add_new_item),[]);return(0,L.jsx)(Uo.Modal,{title:e||s,onRequestClose:t.closeModal,overlayClassName:"fields-create-template-part-modal",focusOnMount:"firstContentElement",size:"medium",children:(0,L.jsx)(tn,{...t})})}const en=e=>"header"===e?O:"footer"===e?F:"sidebar"===e?V:z;function tn({defaultArea:e="uncategorized",blocks:t=[],confirmLabel:s=(0,fs.__)("Add"),closeModal:o,onCreate:n,onError:i,defaultTitle:r=""}){const{createErrorNotice:a}=(0,c.useDispatch)(_s.store),{saveEntityRecord:l}=(0,c.useDispatch)(d.store),m=null!==(h=(0,c.useSelect)((e=>e(d.store).getEntityRecords("postType","wp_template_part",{per_page:-1})),[]))&&void 0!==h?h:[];var h;const[g,_]=(0,u.useState)(r),[f,b]=(0,u.useState)(e),[x,v]=(0,u.useState)(!1),S=(0,p.useInstanceId)(Jo),w=(0,c.useSelect)((e=>e(d.store).getCurrentTheme()?.default_template_part_areas),[]);async function k(){if(g&&!x)try{v(!0);const e=((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}`})(g,m),s=(e=>qo(e).replace(/[^\w-]+/g,"")||"wp-custom-part")(e),o=await l("postType","wp_template_part",{slug:s,title:e,content:(0,y.serialize)(t),area:f},{throwOnError:!0});await n(o)}catch(e){const t=e instanceof Error&&"code"in e&&e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("An error occurred while creating the template part.");a(t,{type:"snackbar"}),i?.()}finally{v(!1)}}return(0,L.jsx)("form",{onSubmit:async e=>{e.preventDefault(),await k()},children:(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"4",children:[(0,L.jsx)(Uo.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,fs.__)("Name"),value:g,onChange:_,required:!0}),(0,L.jsxs)("fieldset",{children:[(0,L.jsx)(Uo.BaseControl.VisualLabel,{as:"legend",children:(0,fs.__)("Area")}),(0,L.jsx)("div",{className:"fields-create-template-part-modal__area-radio-group",children:(null!=w?w:[]).map((e=>{const t=en(e.icon);return(0,L.jsxs)("div",{className:"fields-create-template-part-modal__area-radio-wrapper",children:[(0,L.jsx)("input",{type:"radio",id:Qo(e.area,S),name:`fields-create-template-part-modal__area-${S}`,value:e.area,checked:f===e.area,onChange:()=>{b(e.area)},"aria-describedby":Xo(e.area,S)}),(0,L.jsx)(Uo.Icon,{icon:t,className:"fields-create-template-part-modal__area-radio-icon"}),(0,L.jsx)("label",{htmlFor:Qo(e.area,S),className:"fields-create-template-part-modal__area-radio-label",children:e.label}),(0,L.jsx)(Uo.Icon,{icon:Ho,className:"fields-create-template-part-modal__area-radio-checkmark"}),(0,L.jsx)("p",{className:"fields-create-template-part-modal__area-radio-description",id:Xo(e.area,S),children:e.description})]},e.area)}))})]}),(0,L.jsxs)(Uo.__experimentalHStack,{justify:"right",children:[(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{o()},children:(0,fs.__)("Cancel")}),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit","aria-disabled":!g||x,isBusy:x,children:s})]})]})})}function sn(e){return"wp_template"===e.type||"wp_template_part"===e.type}function on(e){return"string"==typeof e.title?(0,Lo.decodeEntities)(e.title):e.title&&"rendered"in e.title?(0,Lo.decodeEntities)(e.title.rendered):e.title&&"raw"in e.title?(0,Lo.decodeEntities)(e.title.raw):""}function nn(e){return!!e&&([e.source,e.source].includes("custom")&&!Boolean("wp_template"===e.type&&e?.plugin)&&!e.has_theme_file)}const rn={id:"duplicate-template-part",label:(0,fs._x)("Duplicate","action label"),isEligible:e=>"wp_template_part"===e.type,modalHeader:(0,fs._x)("Duplicate template part","action label"),RenderModal:({items:e,closeModal:t})=>{const[s]=e,o=(0,u.useMemo)((()=>{var e;return null!==(e=s.blocks)&&void 0!==e?e:(0,y.parse)("string"==typeof s.content?s.content:s.content.raw,{__unstableSkipMigrationLogs:!0})}),[s.content,s.blocks]),{createSuccessNotice:n}=(0,c.useDispatch)(_s.store);return(0,L.jsx)(tn,{blocks:o,defaultArea:s.area,defaultTitle:(0,fs.sprintf)((0,fs._x)("%s (Copy)","template part"),on(s)),onCreate:function(e){n((0,fs.sprintf)((0,fs._x)('"%s" duplicated.',"template part"),on(e)),{type:"snackbar",id:"edit-site-patterns-success"}),t?.()},onError:t,confirmLabel:(0,fs._x)("Duplicate","action label"),closeModal:null!=t?t:()=>{}})}},an=rn,ln=window.wp.patterns,{lock:cn,unlock:dn}=(0,H.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/fields"),{CreatePatternModalContents:un,useDuplicatePatternProps:pn}=dn(ln.privateApis),mn={id:"duplicate-pattern",label:(0,fs._x)("Duplicate","action label"),isEligible:e=>"wp_template_part"!==e.type,modalHeader:(0,fs._x)("Duplicate pattern","action label"),RenderModal:({items:e,closeModal:t})=>{const[s]=e,o=pn({pattern:s,onSuccess:()=>t?.()});return(0,L.jsx)(un,{onClose:t,confirmLabel:(0,fs._x)("Duplicate","action label"),...o})}},hn=mn,{PATTERN_TYPES:gn}=dn(ln.privateApis),_n={id:"rename-post",label:(0,fs.__)("Rename"),isEligible:e=>"trash"!==e.status&&(["wp_template","wp_template_part",...Object.values(gn)].includes(e.type)?function(e){return"wp_template"===e.type}(e)?nn(e)&&e.is_custom&&e.permissions?.update:function(e){return"wp_template_part"===e.type}(e)?"custom"===e.source&&!e?.has_theme_file&&e.permissions?.update:e.type===gn.user&&e.permissions?.update:e.permissions?.update),RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[o]=e,[n,i]=(0,u.useState)((()=>on(o))),{editEntityRecord:r,saveEditedEntityRecord:a}=(0,c.useDispatch)(d.store),{createSuccessNotice:l,createErrorNotice:p}=(0,c.useDispatch)(_s.store);return(0,L.jsx)("form",{onSubmit:async function(c){c.preventDefault();try{await r("postType",o.type,o.id,{title:n}),i(""),t?.(),await a("postType",o.type,o.id,{throwOnError:!0}),l((0,fs.__)("Name updated"),{type:"snackbar"}),s?.(e)}catch(e){const t=e,s=t.message&&"unknown_error"!==t.code?t.message:(0,fs.__)("An error occurred while updating the name");p(s,{type:"snackbar"})}},children:(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"5",children:[(0,L.jsx)(Uo.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,fs.__)("Name"),value:n,onChange:i,required:!0}),(0,L.jsxs)(Uo.__experimentalHStack,{justify:"right",children:[(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},children:(0,fs.__)("Cancel")}),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,fs.__)("Save")})]})]})})}},fn=_n;const bn={sort:function(e,t,s){return"asc"===s?e-t:t-e},isValid:function(e,t){if(""===e)return!1;if(!Number.isInteger(Number(e)))return!1;if(t?.elements){const s=t?.elements.map((e=>e.value));if(!s.includes(Number(e)))return!1}return!0},Edit:"integer"};const yn={sort:function(e,t,s){return"asc"===s?e.localeCompare(t):t.localeCompare(e)},isValid:function(e,t){if(t?.elements){const s=t?.elements?.map((e=>e.value));if(!s.includes(e))return!1}return!0},Edit:"text"};const xn={sort:function(e,t,s){const o=new Date(e).getTime(),n=new Date(t).getTime();return"asc"===s?o-n:n-o},isValid:function(e,t){if(t?.elements){const s=t?.elements.map((e=>e.value));if(!s.includes(e))return!1}return!0},Edit:"datetime"};const vn={datetime:function({data:e,field:t,onChange:s,hideLabelFromVision:o}){const{id:n,label:i}=t,r=t.getValue({item:e}),a=(0,u.useCallback)((e=>s({[n]:e})),[n,s]);return(0,L.jsxs)("fieldset",{className:"dataviews-controls__datetime",children:[!o&&(0,L.jsx)(Uo.BaseControl.VisualLabel,{as:"legend",children:i}),o&&(0,L.jsx)(Uo.VisuallyHidden,{as:"legend",children:i}),(0,L.jsx)(Uo.TimePicker,{currentTime:r,onChange:a,hideLabelFromVision:!0})]})},integer:function({data:e,field:t,onChange:s,hideLabelFromVision:o}){var n;const{id:i,label:r,description:a}=t,l=null!==(n=t.getValue({item:e}))&&void 0!==n?n:"",c=(0,u.useCallback)((e=>s({[i]:Number(e)})),[i,s]);return(0,L.jsx)(Uo.__experimentalNumberControl,{label:r,help:a,value:l,onChange:c,__next40pxDefaultSize:!0,hideLabelFromVision:o})},radio:function({data:e,field:t,onChange:s,hideLabelFromVision:o}){const{id:n,label:i}=t,r=t.getValue({item:e}),a=(0,u.useCallback)((e=>s({[n]:e})),[n,s]);return t.elements?(0,L.jsx)(Uo.RadioControl,{label:i,onChange:a,options:t.elements,selected:r,hideLabelFromVision:o}):null},select:function({data:e,field:t,onChange:s,hideLabelFromVision:o}){var n,i;const{id:r,label:a}=t,l=null!==(n=t.getValue({item:e}))&&void 0!==n?n:"",c=(0,u.useCallback)((e=>s({[r]:e})),[r,s]),d=[{label:(0,fs.__)("Select item"),value:""},...null!==(i=t?.elements)&&void 0!==i?i:[]];return(0,L.jsx)(Uo.SelectControl,{label:a,value:l,options:d,onChange:c,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:o})},text:function({data:e,field:t,onChange:s,hideLabelFromVision:o}){const{id:n,label:i,placeholder:r}=t,a=t.getValue({item:e}),l=(0,u.useCallback)((e=>s({[n]:e})),[n,s]);return(0,L.jsx)(Uo.TextControl,{label:i,placeholder:r,value:null!=a?a:"",onChange:l,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:o})}};function Sn(e){if(Object.keys(vn).includes(e))return vn[e];throw"Control "+e+" not found"}function wn(e){return e.map((e=>{var t,s,o,n;const i="integer"===(r=e.type)?bn:"text"===r?yn:"datetime"===r?xn:{sort:(e,t,s)=>"number"==typeof e&&"number"==typeof t?"asc"===s?e-t:t-e:"asc"===s?e.localeCompare(t):t.localeCompare(e),isValid:(e,t)=>{if(t?.elements){const s=t?.elements?.map((e=>e.value));if(!s.includes(e))return!1}return!0},Edit:()=>null};var r;const a=e.getValue||(l=e.id,({item:e})=>{const t=l.split(".");let s=e;for(const e of t)s=s.hasOwnProperty(e)?s[e]:void 0;return s});var l;const c=null!==(t=e.sort)&&void 0!==t?t:function(e,t,s){return i.sort(a({item:e}),a({item:t}),s)},d=null!==(s=e.isValid)&&void 0!==s?s:function(e,t){return i.isValid(a({item:e}),t)},u=function(e,t){return"function"==typeof e.Edit?e.Edit:"string"==typeof e.Edit?Sn(e.Edit):e.elements?Sn("select"):"string"==typeof t.Edit?Sn(t.Edit):t.Edit}(e,i),p=e.render||(e.elements?({item:t})=>{const s=a({item:t});return e?.elements?.find((e=>e.value===s))?.label||a({item:t})}:a);return{...e,label:e.label||e.id,header:e.header||e.label||e.id,getValue:a,render:p,sort:c,isValid:d,Edit:u,enableHiding:null===(o=e.enableHiding)||void 0===o||o,enableSorting:null===(n=e.enableSorting)||void 0===n||n}}))}function kn(e,t,s){return wn(t.filter((({id:e})=>!!s.fields?.includes(e)))).every((t=>t.isValid(e,{elements:t.elements})))}const Cn=(0,u.createContext)({fields:[]});function Pn({fields:e,children:t}){return(0,L.jsx)(Cn.Provider,{value:{fields:e},children:t})}const jn=Cn;function En(e){return void 0!==e.children}function Tn({title:e}){return(0,L.jsx)(Uo.__experimentalVStack,{className:"dataforms-layouts-regular__header",spacing:4,children:(0,L.jsxs)(Uo.__experimentalHStack,{alignment:"center",children:[(0,L.jsx)(Uo.__experimentalHeading,{level:2,size:13,children:e}),(0,L.jsx)(Uo.__experimentalSpacer,{})]})})}const Bn=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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 In({title:e,onClose:t}){return(0,L.jsx)(Uo.__experimentalVStack,{className:"dataforms-layouts-panel__dropdown-header",spacing:4,children:(0,L.jsxs)(Uo.__experimentalHStack,{alignment:"center",children:[e&&(0,L.jsx)(Uo.__experimentalHeading,{level:2,size:13,children:e}),(0,L.jsx)(Uo.__experimentalSpacer,{}),t&&(0,L.jsx)(Uo.Button,{label:(0,fs.__)("Close"),icon:Bn,onClick:t,size:"small"})]})})}function Nn({fieldDefinition:e,popoverAnchor:t,labelPosition:s="side",data:o,onChange:n,field:i}){const r=En(i)?i.label:e?.label,a=(0,u.useMemo)((()=>En(i)?{type:"regular",fields:i.children.map((e=>"string"==typeof e?{id:e}:e))}:{type:"regular",fields:[{id:i.id}]}),[i]),l=(0,u.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]);return(0,L.jsx)(Uo.Dropdown,{contentClassName:"dataforms-layouts-panel__field-dropdown",popoverProps:l,focusOnMount:!0,toggleProps:{size:"compact",variant:"tertiary",tooltipPosition:"middle left"},renderToggle:({isOpen:t,onToggle:n})=>(0,L.jsx)(Uo.Button,{className:"dataforms-layouts-panel__field-control",size:"compact",variant:["none","top"].includes(s)?"link":"tertiary","aria-expanded":t,"aria-label":(0,fs.sprintf)((0,fs._x)("Edit %s","field"),r),onClick:n,children:(0,L.jsx)(e.render,{item:o})}),renderContent:({onClose:e})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(In,{title:r,onClose:e}),(0,L.jsx)(An,{data:o,form:a,onChange:n,children:(e,t)=>{var s;return(0,L.jsx)(e,{data:o,field:t,onChange:n,hideLabelFromVision:(null!==(s=a?.fields)&&void 0!==s?s:[]).length<2},t.id)}})]})})}const Dn=[{type:"regular",component:function({data:e,field:t,onChange:s,hideLabelFromVision:o}){var n;const{fields:i}=(0,u.useContext)(jn),r=(0,u.useMemo)((()=>En(t)?{fields:t.children.map((e=>"string"==typeof e?{id:e}:e)),type:"regular"}:{type:"regular",fields:[]}),[t]);if(En(t))return(0,L.jsxs)(L.Fragment,{children:[!o&&t.label&&(0,L.jsx)(Tn,{title:t.label}),(0,L.jsx)(An,{data:e,form:r,onChange:s})]});const a=null!==(n=t.labelPosition)&&void 0!==n?n:"top",l=i.find((e=>e.id===t.id));return l?"side"===a?(0,L.jsxs)(Uo.__experimentalHStack,{className:"dataforms-layouts-regular__field",children:[(0,L.jsx)("div",{className:"dataforms-layouts-regular__field-label",children:l.label}),(0,L.jsx)("div",{className:"dataforms-layouts-regular__field-control",children:(0,L.jsx)(l.Edit,{data:e,field:l,onChange:s,hideLabelFromVision:!0},l.id)})]}):(0,L.jsx)("div",{className:"dataforms-layouts-regular__field",children:(0,L.jsx)(l.Edit,{data:e,field:l,onChange:s,hideLabelFromVision:"none"===a||o})}):null}},{type:"panel",component:function({data:e,field:t,onChange:s}){var o;const{fields:n}=(0,u.useContext)(jn),i=n.find((e=>{if(En(t)){const s=t.children.filter((e=>"string"==typeof e||!En(e))),o="string"==typeof s[0]?s[0]:s[0].id;return e.id===o}return e.id===t.id})),r=null!==(o=t.labelPosition)&&void 0!==o?o:"side",[a,l]=(0,u.useState)(null);if(!i)return null;const c=En(t)?t.label:i?.label;return"top"===r?(0,L.jsxs)(Uo.__experimentalVStack,{className:"dataforms-layouts-panel__field",spacing:0,children:[(0,L.jsx)("div",{className:"dataforms-layouts-panel__field-label",style:{paddingBottom:0},children:c}),(0,L.jsx)("div",{className:"dataforms-layouts-panel__field-control",children:(0,L.jsx)(Nn,{field:t,popoverAnchor:a,fieldDefinition:i,data:e,onChange:s,labelPosition:r})})]}):"none"===r?(0,L.jsx)("div",{className:"dataforms-layouts-panel__field",children:(0,L.jsx)(Nn,{field:t,popoverAnchor:a,fieldDefinition:i,data:e,onChange:s,labelPosition:r})}):(0,L.jsxs)(Uo.__experimentalHStack,{ref:l,className:"dataforms-layouts-panel__field",children:[(0,L.jsx)("div",{className:"dataforms-layouts-panel__field-label",children:c}),(0,L.jsx)("div",{className:"dataforms-layouts-panel__field-control",children:(0,L.jsx)(Nn,{field:t,popoverAnchor:a,fieldDefinition:i,data:e,onChange:s,labelPosition:r})})]})}}];function An({data:e,form:t,onChange:s,children:o}){const{fields:n}=(0,u.useContext)(jn);const i=(0,u.useMemo)((()=>function(e){var t,s,o;let n="regular";["regular","panel"].includes(null!==(t=e.type)&&void 0!==t?t:"")&&(n=e.type);const i=null!==(s=e.labelPosition)&&void 0!==s?s:"regular"===n?"top":"side";return(null!==(o=e.fields)&&void 0!==o?o:[]).map((e=>{var t,s;if("string"==typeof e)return{id:e,layout:n,labelPosition:i};const o=null!==(t=e.layout)&&void 0!==t?t:n,r=null!==(s=e.labelPosition)&&void 0!==s?s:"regular"===o?"top":"side";return{...e,layout:o,labelPosition:r}}))}(t)),[t]);return(0,L.jsx)(Uo.__experimentalVStack,{spacing:2,children:i.map((t=>{const i=(r=t.layout,Dn.find((e=>e.type===r)))?.component;var r;if(!i)return null;const a=En(t)?void 0:function(e){const t="string"==typeof e?e:e.id;return n.find((e=>e.id===t))}(t);return a&&a.isVisible&&!a.isVisible(e)?null:o?o(i,t):(0,L.jsx)(i,{data:e,field:t,onChange:s},t.id)}))})}function Rn({data:e,form:t,fields:s,onChange:o}){const n=(0,u.useMemo)((()=>wn(s)),[s]);return t.fields?(0,L.jsx)(Pn,{fields:n,children:(0,L.jsx)(An,{data:e,form:t,onChange:o})}):null}const Mn=[{id:"menu_order",type:"integer",label:(0,fs.__)("Order"),description:(0,fs.__)("Determines the order of pages.")}],Ln={fields:["menu_order"]};const On={id:"order-pages",label:(0,fs.__)("Order"),isEligible:({status:e})=>"trash"!==e,RenderModal:function({items:e,closeModal:t,onActionPerformed:s}){const[o,n]=(0,u.useState)(e[0]),i=o.menu_order,{editEntityRecord:r,saveEditedEntityRecord:a}=(0,c.useDispatch)(d.store),{createSuccessNotice:l,createErrorNotice:p}=(0,c.useDispatch)(_s.store),m=!kn(o,Mn,Ln);return(0,L.jsx)("form",{onSubmit:async function(n){if(n.preventDefault(),kn(o,Mn,Ln))try{await r("postType",o.type,o.id,{menu_order:i}),t?.(),await a("postType",o.type,o.id,{throwOnError:!0}),l((0,fs.__)("Order updated."),{type:"snackbar"}),s?.(e)}catch(e){const t=e,s=t.message&&"unknown_error"!==t.code?t.message:(0,fs.__)("An error occurred while updating the order");p(s,{type:"snackbar"})}},children:(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"5",children:[(0,L.jsx)("div",{children:(0,fs.__)("Determines the order of pages. Pages with the same order value are sorted alphabetically. Negative order values are supported.")}),(0,L.jsx)(Rn,{data:o,fields:Mn,form:Ln,onChange:e=>n({...o,...e})}),(0,L.jsxs)(Uo.__experimentalHStack,{justify:"right",children:[(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},children:(0,fs.__)("Cancel")}),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",accessibleWhenDisabled:!0,disabled:m,children:(0,fs.__)("Save")})]})]})})}},Fn=On;"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 Vn=e=>new DataView(new ArrayBuffer(e)),zn=e=>new Uint8Array(e.buffer||e),Un=e=>(new TextEncoder).encode(String(e)),Hn=e=>Math.min(4294967295,Number(e)),Gn=e=>Math.min(65535,Number(e));function $n(e,t,s){void 0===t||t instanceof Date||(t=new Date(t));const o=void 0!==e;if(s||(s=o?436:509),e instanceof File)return{isFile:o,t:t||new Date(e.lastModified),bytes:e.stream(),mode:s};if(e instanceof Response)return{isFile:o,t:t||new Date(e.headers.get("Last-Modified")||Date.now()),bytes:e.body,mode:s};if(void 0===t)t=new Date;else if(isNaN(t))throw new Error("Invalid modification date.");if(!o)return{isFile:o,t,mode:s};if("string"==typeof e)return{isFile:o,t,bytes:Un(e),mode:s};if(e instanceof Blob)return{isFile:o,t,bytes:e.stream(),mode:s};if(e instanceof Uint8Array||e instanceof ReadableStream)return{isFile:o,t,bytes:e,mode:s};if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return{isFile:o,t,bytes:zn(e),mode:s};if(Symbol.asyncIterator in e)return{isFile:o,t,bytes:Wn(e[Symbol.asyncIterator]()),mode:s};throw new TypeError("Unsupported input format.")}function Wn(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=Zn(o.value);t.enqueue(e),s+=e.byteLength}}},cancel(e){t.throw?.(e)}})}function Zn(e){return"string"==typeof e?Un(e):e instanceof Uint8Array?e:zn(e)}function Yn(e,t,s){let[o,n]=function(e){return e?e instanceof Uint8Array?[e,1]:ArrayBuffer.isView(e)||e instanceof ArrayBuffer?[zn(e),1]:[Un(e),0]:[void 0,0]}(t);if(e instanceof File)return{i:qn(o||Un(e.name)),o:BigInt(e.size),u:n};if(e instanceof Response){const t=e.headers.get("content-disposition"),i=t&&t.match(/;\s*filename\*?\s*=\s*(?:UTF-\d+''|)["']?([^;"'\r\n]*)["']?(?:;|$)/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{i:qn(o||Un(a)),o:BigInt(l),u:n}}return o=qn(o,void 0!==e||void 0!==s),"string"==typeof e?{i:o,o:BigInt(Un(e).length),u:n}:e instanceof Blob?{i:o,o:BigInt(e.size),u:n}:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?{i:o,o:BigInt(e.byteLength),u:n}:{i:o,o:Kn(e,s),u:n}}function Kn(e,t){return t>-1?BigInt(t):e?void 0:0n}function qn(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 Qn=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);Qn[e]=t}function Xn(e,t=0){t=~t;for(var s=0,o=e.length;s<o;s++)t=t>>>8^Qn[255&t^e[s]];return~t>>>0}function Jn(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 ei({i:e,u:t},s){return 8*(!t||(s??function(e){try{ti.decode(e)}catch{return 0}return 1}(e)))}var ti=new TextDecoder("utf8",{fatal:1});function si(e,t=0){const s=Vn(30);return s.setUint32(0,1347093252),s.setUint32(4,754976768|t),Jn(e.t,s,10),s.setUint16(26,e.i.length,1),zn(s)}async function*oi(e){let{bytes:t}=e;if("then"in t&&(t=await t),t instanceof Uint8Array)yield t,e.l=Xn(t,0),e.o=BigInt(t.length);else{e.o=0n;const s=t.getReader();for(;;){const{value:t,done:o}=await s.read();if(o)break;e.l=Xn(t,e.l),e.o+=BigInt(t.length),yield t}}}function ni(e,t){const s=Vn(16+(t?8:0));return s.setUint32(0,1347094280),s.setUint32(4,e.isFile?e.l:0,1),t?(s.setBigUint64(8,e.o,1),s.setBigUint64(16,e.o,1)):(s.setUint32(8,Hn(e.o),1),s.setUint32(12,Hn(e.o),1)),zn(s)}function ii(e,t,s=0,o=0){const n=Vn(46);return n.setUint32(0,1347092738),n.setUint32(4,755182848),n.setUint16(8,2048|s),Jn(e.t,n,12),n.setUint32(16,e.isFile?e.l:0,1),n.setUint32(20,Hn(e.o),1),n.setUint32(24,Hn(e.o),1),n.setUint16(28,e.i.length,1),n.setUint16(30,o,1),n.setUint16(40,e.mode|(e.isFile?32768:16384),1),n.setUint32(42,Hn(t),1),zn(n)}function ri(e,t,s){const o=Vn(s);return o.setUint16(0,1,1),o.setUint16(2,s-4,1),16&s&&(o.setBigUint64(4,e.o,1),o.setBigUint64(12,e.o,1)),o.setBigUint64(s-8,t,1),zn(o)}function ai(e){return e instanceof File||e instanceof Response?[[e],[e]]:[[e.input,e.name,e.size],[e.input,e.lastModified,e.mode]]}function li(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.i)throw new Error("Every file must have a non-empty name.");if(void 0===n.o)throw new Error(`Missing size for file "${(new TextDecoder).decode(n.i)}".`);const e=n.o>=0xffffffffn,i=s>=0xffffffffn;s+=BigInt(46+n.i.length+(e&&8))+n.o,t+=BigInt(n.i.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 Yn(...ai(t)[0])}(e)))(t.metadata))),new Response(ci(e,t),{headers:s})}function ci(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]=ai(e.value);return{done:0,value:Object.assign($n(...o),Yn(...s))}},throw:t.throw?.bind(t),[Symbol.asyncIterator](){return this}}}(e);return Wn(async function*(e,t){const s=[];let o=0n,n=0n,i=0;for await(const r of e){const e=ei(r,t.buffersAreUTF8);yield si(r,e),yield new Uint8Array(r.i),r.isFile&&(yield*oi(r));const a=r.o>=0xffffffffn,l=12*(o>=0xffffffffn)|28*a;yield ni(r,a),s.push(ii(r,o,e,l)),s.push(r.i),l&&s.push(ri(r,o,l)),a&&(o+=8n),n++,o+=BigInt(46+r.i.length)+r.o,i||(i=a)}let r=0n;for(const e of s)yield e,r+=BigInt(e.length);if(i||o>=0xffffffffn){const e=Vn(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 zn(e)}const a=Vn(22);a.setUint32(0,1347093766),a.setUint16(8,Gn(n),1),a.setUint16(10,Gn(n),1),a.setUint32(12,Hn(r),1),a.setUint32(16,Hn(o),1),yield zn(a)}(s,t),s)}const di=window.wp.blob,ui=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"})});function pi(e){return JSON.stringify({__file:e.type,title:on(e),content:"string"==typeof e.content?e.content:e.content?.raw,syncStatus:e.wp_pattern_sync_status},null,2)}const mi={id:"export-pattern",label:(0,fs.__)("Export as JSON"),icon:ui,supportsBulk:!0,isEligible:e=>"wp_block"===e.type,callback:async e=>{if(1===e.length)return(0,di.downloadBlob)(`${qo(on(e[0])||e[0].slug)}.json`,pi(e[0]),"application/json");const t={},s=e.map((e=>{const s=qo(on(e)||e.slug);return t[s]=(t[s]||0)+1,{name:s+(t[s]>1?"-"+(t[s]-1):"")+".json",lastModified:new Date,input:pi(e)}}));return(0,di.downloadBlob)((0,fs.__)("patterns-export")+".zip",await li(s).blob(),"application/zip")}},hi=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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"})}),gi={id:"restore",label:(0,fs.__)("Restore"),isPrimary:!0,icon:hi,supportsBulk:!0,isEligible:e=>!sn(e)&&"wp_block"!==e.type&&"trash"===e.status&&e.permissions?.update,async callback(e,{registry:t,onActionPerformed:s}){const{createSuccessNotice:o,createErrorNotice:n}=t.dispatch(_s.store),{editEntityRecord:i,saveEditedEntityRecord:r}=t.dispatch(d.store);await Promise.allSettled(e.map((e=>i("postType",e.type,e.id,{status:"draft"}))));const a=await Promise.allSettled(e.map((e=>r("postType",e.type,e.id,{throwOnError:!0}))));if(a.every((({status:e})=>"fulfilled"===e))){let t;t=1===e.length?(0,fs.sprintf)((0,fs.__)('"%s" has been restored.'),on(e[0])):"page"===e[0].type?(0,fs.sprintf)((0,fs.__)("%d pages have been restored."),e.length):(0,fs.sprintf)((0,fs.__)("%d posts have been restored."),e.length),o(t,{type:"snackbar",id:"restore-post-action"}),s&&s(e)}else{let e;if(1===a.length){const t=a[0];e=t.reason?.message?t.reason.message:(0,fs.__)("An error occurred while restoring the post.")}else{const t=new Set,s=a.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}e=0===t.size?(0,fs.__)("An error occurred while restoring the posts."):1===t.size?(0,fs.sprintf)((0,fs.__)("An error occurred while restoring the posts: %s"),[...t][0]):(0,fs.sprintf)((0,fs.__)("Some errors occurred while restoring the posts: %s"),[...t].join(","))}n(e,{type:"snackbar"})}}},_i=async(e,{allowUndo:t=!0}={})=>{const s="edit-site-template-reverted";var o;if((0,c.dispatch)(_s.store).removeNotice(s),(o=e)&&"custom"===o.source&&(Boolean(o?.plugin)||o?.has_theme_file))try{const o=(0,c.select)(d.store).getEntityConfig("postType",e.type);if(!o)return void(0,c.dispatch)(_s.store).createErrorNotice((0,fs.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const n=(0,v.addQueryArgs)(`${o.baseURL}/${e.id}`,{context:"edit",source:e.origin}),i=await gs()({path:n});if(!i)return void(0,c.dispatch)(_s.store).createErrorNotice((0,fs.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const r=({blocks:e=[]})=>(0,y.__unstableSerializeAndClean)(e),a=(0,c.select)(d.store).getEditedEntityRecord("postType",e.type,e.id);(0,c.dispatch)(d.store).editEntityRecord("postType",e.type,e.id,{content:r,blocks:a.blocks,source:"custom"},{undoIgnore:!0});const l=(0,y.parse)(i?.content?.raw);if((0,c.dispatch)(d.store).editEntityRecord("postType",e.type,i.id,{content:r,blocks:l,source:"theme"}),t){const t=()=>{(0,c.dispatch)(d.store).editEntityRecord("postType",e.type,a.id,{content:r,blocks:a.blocks,source:"custom"})};(0,c.dispatch)(_s.store).createSuccessNotice((0,fs.__)("Template reset."),{type:"snackbar",id:s,actions:[{label:(0,fs.__)("Undo"),onClick:t}]})}}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("Template revert failed. Please reload.");(0,c.dispatch)(_s.store).createErrorNotice(t,{type:"snackbar"})}else(0,c.dispatch)(_s.store).createErrorNotice((0,fs.__)("This template is not revertable."),{type:"snackbar"})},fi={id:"reset-post",label:(0,fs.__)("Reset"),isEligible:e=>sn(e)&&"custom"===e?.source&&(Boolean("wp_template"===e.type&&e?.plugin)||e?.has_theme_file),icon:hi,supportsBulk:!0,hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[o,n]=(0,u.useState)(!1),{saveEditedEntityRecord:i}=(0,c.useDispatch)(d.store),{createSuccessNotice:r,createErrorNotice:a}=(0,c.useDispatch)(_s.store);return(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"5",children:[(0,L.jsx)(Uo.__experimentalText,{children:(0,fs.__)("Reset to default and clear all customizations?")}),(0,L.jsxs)(Uo.__experimentalHStack,{justify:"right",children:[(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,disabled:o,accessibleWhenDisabled:!0,children:(0,fs.__)("Cancel")}),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:async()=>{n(!0),await(async()=>{try{for(const t of e)await _i(t,{allowUndo:!1}),await i("postType",t.type,t.id);r(e.length>1?(0,fs.sprintf)((0,fs.__)("%s items reset."),e.length):(0,fs.sprintf)((0,fs.__)('"%s" reset.'),on(e[0])),{type:"snackbar",id:"revert-template-action"})}catch(t){let s;s="wp_template"===e[0].type?1===e.length?(0,fs.__)("An error occurred while reverting the template."):(0,fs.__)("An error occurred while reverting the templates."):1===e.length?(0,fs.__)("An error occurred while reverting the template part."):(0,fs.__)("An error occurred while reverting the template parts.");const o=t,n=o.message&&"unknown_error"!==o.code?o.message:s;a(n,{type:"snackbar"})}})(),s?.(e),n(!1),t?.()},isBusy:o,disabled:o,accessibleWhenDisabled:!0,children:(0,fs.__)("Reset")})]})]})}},bi=fi,yi=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})});function xi(e){const t=new Set;if(1===e.length){const s=e[0];s.reason?.message&&t.add(s.reason.message)}else{const s=e.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}}return t}const{PATTERN_TYPES:vi}=dn(ln.privateApis),Si={id:"delete-post",label:(0,fs.__)("Delete"),isPrimary:!0,icon:yi,isEligible:e=>sn(e)?nn(e):e.type===vi.user,supportsBulk:!0,hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[o,n]=(0,u.useState)(!1),i=e.every((e=>sn(e)&&e?.has_theme_file));return(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"5",children:[(0,L.jsx)(Uo.__experimentalText,{children:e.length>1?(0,fs.sprintf)((0,fs._n)("Delete %d item?","Delete %d items?",e.length),e.length):(0,fs.sprintf)((0,fs._x)('Delete "%s"?',"template part"),on(e[0]))}),(0,L.jsxs)(Uo.__experimentalHStack,{justify:"right",children:[(0,L.jsx)(Uo.Button,{variant:"tertiary",onClick:t,disabled:o,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,fs.__)("Cancel")}),(0,L.jsx)(Uo.Button,{variant:"primary",onClick:async()=>{n(!0);const o={success:{messages:{getMessage:e=>i?(0,fs.sprintf)((0,fs.__)('"%s" reset.'),(0,Lo.decodeEntities)(on(e))):(0,fs.sprintf)((0,fs._x)('"%s" deleted.',"template part"),(0,Lo.decodeEntities)(on(e))),getBatchMessage:()=>i?(0,fs.__)("Items reset."):(0,fs.__)("Items deleted.")}},error:{messages:{getMessage:e=>1===e.size?[...e][0]:i?(0,fs.__)("An error occurred while reverting the item."):(0,fs.__)("An error occurred while deleting the item."),getBatchMessage:e=>0===e.size?i?(0,fs.__)("An error occurred while reverting the items."):(0,fs.__)("An error occurred while deleting the items."):1===e.size?i?(0,fs.sprintf)((0,fs.__)("An error occurred while reverting the items: %s"),[...e][0]):(0,fs.sprintf)((0,fs.__)("An error occurred while deleting the items: %s"),[...e][0]):i?(0,fs.sprintf)((0,fs.__)("Some errors occurred while reverting the items: %s"),[...e].join(",")):(0,fs.sprintf)((0,fs.__)("Some errors occurred while deleting the items: %s"),[...e].join(","))}}};await(async(e,t,s)=>{const{createSuccessNotice:o,createErrorNotice:n}=(0,c.dispatch)(_s.store),{deleteEntityRecord:i}=(0,c.dispatch)(d.store),r=await Promise.allSettled(e.map((e=>i("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(r.every((({status:e})=>"fulfilled"===e))){var a;let n;n=1===r.length?t.success.messages.getMessage(e[0]):t.success.messages.getBatchMessage(e),o(n,{type:null!==(a=t.success.type)&&void 0!==a?a:"snackbar",id:t.success.id}),s.onActionPerformed?.(e)}else{var l;const e=xi(r);let o="";o=1===r.length?t.error.messages.getMessage(e):t.error.messages.getBatchMessage(e),n(o,{type:null!==(l=t.error.type)&&void 0!==l?l:"snackbar",id:t.error.id}),s.onActionError?.()}})(e,o,{onActionPerformed:s}),n(!1),t?.()},isBusy:o,disabled:o,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,fs.__)("Delete")})]})]})}},wi=Si,ki={id:"move-to-trash",label:(0,fs.__)("Move to trash"),isPrimary:!0,icon:yi,isEligible:e=>!sn(e)&&"wp_block"!==e.type&&(!!e.status&&!["auto-draft","trash"].includes(e.status)&&e.permissions?.delete),supportsBulk:!0,hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[o,n]=(0,u.useState)(!1),{createSuccessNotice:i,createErrorNotice:r}=(0,c.useDispatch)(_s.store),{deleteEntityRecord:a}=(0,c.useDispatch)(d.store);return(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"5",children:[(0,L.jsx)(Uo.__experimentalText,{children:1===e.length?(0,fs.sprintf)((0,fs.__)('Are you sure you want to move "%s" to the trash?'),on(e[0])):(0,fs.sprintf)((0,fs._n)("Are you sure you want to move %d item to the trash ?","Are you sure you want to move %d items to the trash ?",e.length),e.length)}),(0,L.jsxs)(Uo.__experimentalHStack,{justify:"right",children:[(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,disabled:o,accessibleWhenDisabled:!0,children:(0,fs.__)("Cancel")}),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:async()=>{n(!0);const o=await Promise.allSettled(e.map((e=>a("postType",e.type,e.id.toString(),{},{throwOnError:!0}))));if(o.every((({status:e})=>"fulfilled"===e))){let t;t=1===o.length?(0,fs.sprintf)((0,fs.__)('"%s" moved to the trash.'),on(e[0])):(0,fs.sprintf)((0,fs._n)("%s item moved to the trash.","%s items moved to the trash.",e.length),e.length),i(t,{type:"snackbar",id:"move-to-trash-action"})}else{let e;if(1===o.length){const t=o[0];e=t.reason?.message?t.reason.message:(0,fs.__)("An error occurred while moving the item to the trash.")}else{const t=new Set,s=o.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}e=0===t.size?(0,fs.__)("An error occurred while moving the items to the trash."):1===t.size?(0,fs.sprintf)((0,fs.__)("An error occurred while moving the item to the trash: %s"),[...t][0]):(0,fs.sprintf)((0,fs.__)("Some errors occurred while moving the items to the trash: %s"),[...t].join(","))}r(e,{type:"snackbar"})}s&&s(e),n(!1),t?.()},isBusy:o,disabled:o,accessibleWhenDisabled:!0,children:(0,fs._x)("Trash","verb")})]})]})}},Ci=ki,Pi={id:"permanently-delete",label:(0,fs.__)("Permanently delete"),supportsBulk:!0,icon:yi,isEligible(e){if(sn(e)||"wp_block"===e.type)return!1;const{status:t,permissions:s}=e;return"trash"===t&&s?.delete},hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[o,n]=(0,u.useState)(!1),{createSuccessNotice:i,createErrorNotice:r}=(0,c.useDispatch)(_s.store),{deleteEntityRecord:a}=(0,c.useDispatch)(d.store);return(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"5",children:[(0,L.jsx)(Uo.__experimentalText,{children:e.length>1?(0,fs.sprintf)((0,fs._n)("Are you sure you want to permanently delete %d item?","Are you sure you want to permanently delete %d items?",e.length),e.length):(0,fs.sprintf)((0,fs.__)('Are you sure you want to permanently delete "%s"?'),(0,Lo.decodeEntities)(on(e[0])))}),(0,L.jsxs)(Uo.__experimentalHStack,{justify:"right",children:[(0,L.jsx)(Uo.Button,{variant:"tertiary",onClick:t,disabled:o,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,fs.__)("Cancel")}),(0,L.jsx)(Uo.Button,{variant:"primary",onClick:async()=>{n(!0);const o=await Promise.allSettled(e.map((e=>a("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(o.every((({status:e})=>"fulfilled"===e))){let t;t=1===o.length?(0,fs.sprintf)((0,fs.__)('"%s" permanently deleted.'),on(e[0])):(0,fs.__)("The items were permanently deleted."),i(t,{type:"snackbar",id:"permanently-delete-post-action"}),s?.(e)}else{let e;if(1===o.length){const t=o[0];e=t.reason?.message?t.reason.message:(0,fs.__)("An error occurred while permanently deleting the item.")}else{const t=new Set,s=o.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}e=0===t.size?(0,fs.__)("An error occurred while permanently deleting the items."):1===t.size?(0,fs.sprintf)((0,fs.__)("An error occurred while permanently deleting the items: %s"),[...t][0]):(0,fs.sprintf)((0,fs.__)("Some errors occurred while permanently deleting the items: %s"),[...t].join(","))}r(e,{type:"snackbar"})}n(!1),t?.()},isBusy:o,disabled:o,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,fs.__)("Delete permanently")})]})]})}},ji=Pi,Ei=window.wp.mediaUtils,Ti=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M5 11.25h14v1.5H5z"})}),Bi={id:"featured_media",type:"media",label:(0,fs.__)("Featured Image"),Edit:({data:e,field:t,onChange:s})=>{const{id:o}=t,n=t.getValue({item:e}),i=(0,c.useSelect)((e=>{const{getEntityRecord:t}=e(d.store);return t("root","media",n)}),[n]),r=(0,u.useCallback)((e=>s({[o]:e})),[o,s]),a=i?.source_url,l=i?.title?.rendered,p=(0,u.useRef)(null);return(0,L.jsx)("fieldset",{className:"fields-controls__featured-image",children:(0,L.jsx)("div",{className:"fields-controls__featured-image-container",children:(0,L.jsx)(Ei.MediaUpload,{onSelect:e=>{r(e.id)},allowedTypes:["image"],render:({open:e})=>(0,L.jsx)("div",{ref:p,role:"button",tabIndex:-1,onClick:()=>{e()},onKeyDown:e,children:(0,L.jsxs)(Uo.__experimentalGrid,{rowGap:0,columnGap:8,templateColumns:"24px 1fr 24px",children:[a&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("img",{className:"fields-controls__featured-image-image",alt:"",width:24,height:24,src:a}),(0,L.jsx)("span",{className:"fields-controls__featured-image-title",children:l})]}),!a&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("span",{className:"fields-controls__featured-image-placeholder",style:{width:"24px",height:"24px"}}),(0,L.jsx)("span",{className:"fields-controls__featured-image-title",children:(0,fs.__)("Choose an image…")})]}),a&&(0,L.jsx)(L.Fragment,{children:(0,L.jsx)(Uo.Button,{size:"small",className:"fields-controls__featured-image-remove-button",icon:Ti,onClick:e=>{e.stopPropagation(),r(0)}})})]})})})})})},render:({item:e})=>{const t=e.featured_media,s=(0,c.useSelect)((e=>{const{getEntityRecord:s}=e(d.store);return t?s("root","media",t):null}),[t]),o=s?.source_url;return o?(0,L.jsx)("img",{className:"fields-controls__featured-image-image",src:o,alt:""}):(0,L.jsx)("span",{className:"fields-controls__featured-image-placeholder"})},enableSorting:!1},Ii=Bi;function Ni(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=Ni(e[t]))&&(o&&(o+=" "),o+=s)}else for(s in e)e[s]&&(o&&(o+=" "),o+=s);return o}const Di=function(){for(var e,t,s=0,o="",n=arguments.length;s<n;s++)(e=arguments[s])&&(t=Ni(e))&&(o&&(o+=" "),o+=t);return o},Ai=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{fillRule:"evenodd",d:"M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",clipRule:"evenodd"})});const Ri=function({item:e}){const{text:t,imageUrl:s}=(0,c.useSelect)((t=>{const{getEntityRecord:s}=t(d.store);let o;return e.author&&(o=s("root","user",e.author)),{imageUrl:o?.avatar_urls?.[48],text:o?.name}}),[e]),[o,n]=(0,u.useState)(!1);return(0,L.jsxs)(Uo.__experimentalHStack,{alignment:"left",spacing:0,children:[!!s&&(0,L.jsx)("div",{className:Di("page-templates-author-field__avatar",{"is-loaded":o}),children:(0,L.jsx)("img",{onLoad:()=>n(!0),alt:(0,fs.__)("Author avatar"),src:s})}),!s&&(0,L.jsx)("div",{className:"page-templates-author-field__icon",children:(0,L.jsx)(Uo.Icon,{icon:Ai})}),(0,L.jsx)("span",{className:"page-templates-author-field__name",children:t})]})},Mi={label:(0,fs.__)("Author"),id:"author",type:"integer",elements:[],render:Ri,sort:(e,t,s)=>{const o=e._embedded?.author?.[0]?.name||"",n=t._embedded?.author?.[0]?.name||"";return"asc"===s?o.localeCompare(n):n.localeCompare(o)}},Li=Mi,Oi=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 0 4-4H8a4 4 0 0 0 4 4Z"})}),Fi=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm9 1V8h-1.5v3.5h-2V13H13Z"})}),Vi=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 1-4-4h4V8a4 4 0 0 1 0 8Z"})}),zi=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5A6.5 6.5 0 0 1 6.93 7.931l9.139 9.138A6.473 6.473 0 0 1 12 18.5Zm5.123-2.498a6.5 6.5 0 0 0-9.124-9.124l9.124 9.124ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z"})}),Ui=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z"})}),Hi=[{value:"draft",label:(0,fs.__)("Draft"),icon:Oi,description:(0,fs.__)("Not ready to publish.")},{value:"future",label:(0,fs.__)("Scheduled"),icon:Fi,description:(0,fs.__)("Publish automatically on a chosen date.")},{value:"pending",label:(0,fs.__)("Pending Review"),icon:Vi,description:(0,fs.__)("Waiting for review before publishing.")},{value:"private",label:(0,fs.__)("Private"),icon:zi,description:(0,fs.__)("Only visible to site admins and editors.")},{value:"publish",label:(0,fs.__)("Published"),icon:Ui,description:(0,fs.__)("Visible to everyone.")},{value:"trash",label:(0,fs.__)("Trash"),icon:yi}];const Gi=function({item:e}){const t=Hi.find((({value:t})=>t===e.status)),s=t?.label||e.status,o=t?.icon;return(0,L.jsxs)(Uo.__experimentalHStack,{alignment:"left",spacing:0,children:[o&&(0,L.jsx)("div",{className:"edit-site-post-list__status-icon",children:(0,L.jsx)(Uo.Icon,{icon:o})}),(0,L.jsx)("span",{children:s})]})},$i={label:(0,fs.__)("Status"),id:"status",type:"text",elements:Hi,render:Gi,Edit:"radio",enableSorting:!1,filterBy:{operators:["isAny"]}},Wi=e=>(0,x.dateI18n)((0,x.getSettings)().formats.datetimeAbbreviated,(0,x.getDate)(e)),Zi=({item:e})=>{var t,s,o,n;var i;if(["draft","private"].includes(null!==(t=e.status)&&void 0!==t?t:""))return(0,u.createInterpolateElement)((0,fs.sprintf)((0,fs.__)("<span>Modified: <time>%s</time></span>"),Wi(null!==(i=e.date)&&void 0!==i?i:null)),{span:(0,L.jsx)("span",{}),time:(0,L.jsx)("time",{})});var r;if("future"===e.status)return(0,u.createInterpolateElement)((0,fs.sprintf)((0,fs.__)("<span>Scheduled: <time>%s</time></span>"),Wi(null!==(r=e.date)&&void 0!==r?r:null)),{span:(0,L.jsx)("span",{}),time:(0,L.jsx)("time",{})});var a;if("publish"===e.status)return(0,u.createInterpolateElement)((0,fs.sprintf)((0,fs.__)("<span>Published: <time>%s</time></span>"),Wi(null!==(a=e.date)&&void 0!==a?a:null)),{span:(0,L.jsx)("span",{}),time:(0,L.jsx)("time",{})});const l=(0,x.getDate)(null!==(s=e.modified)&&void 0!==s?s:null)>(0,x.getDate)(null!==(o=e.date)&&void 0!==o?o:null)?e.modified:e.date;return"pending"===e.status?(0,u.createInterpolateElement)((0,fs.sprintf)((0,fs.__)("<span>Modified: <time>%s</time></span>"),Wi(null!=l?l:null)),{span:(0,L.jsx)("span",{}),time:(0,L.jsx)("time",{})}):(0,L.jsx)("time",{children:Wi(null!==(n=e.date)&&void 0!==n?n:null)})},Yi={id:"date",type:"datetime",label:(0,fs.__)("Date"),render:Zi},Ki=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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"})}),qi=e=>"object"!=typeof e?"":e.slug||(0,v.cleanForSlug)(on(e))||e.id.toString(),Qi=({field:e,onChange:t,data:s})=>{const{id:o}=e,n=e.getValue({item:s})||qi(s),i=s.permalink_template||"",r=/%(?:postname|pagename)%/,[a,l]=i.split(r),d=a,m=l,h=r.test(i),g=(0,u.useRef)(n),_=n||g.current,f=h?`${d}${_}${m}`:(0,v.safeDecodeURIComponent)(s.link||"");(0,u.useEffect)((()=>{n&&void 0===g.current&&(g.current=n)}),[n]);const b=(0,u.useCallback)((e=>t({[o]:e})),[o,t]),{createNotice:y}=(0,c.useDispatch)(_s.store),x=(0,p.useCopyToClipboard)(f,(()=>{y("info",(0,fs.__)("Copied Permalink to clipboard."),{isDismissible:!0,type:"snackbar"})})),S="editor-post-url__slug-description-"+(0,p.useInstanceId)(Qi);return(0,L.jsxs)("fieldset",{className:"fields-controls__slug",children:[h&&(0,L.jsxs)(Uo.__experimentalVStack,{children:[(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"0px",children:[(0,L.jsx)("span",{children:(0,fs.__)("Customize the last part of the Permalink.")}),(0,L.jsx)(Uo.ExternalLink,{href:"https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink",children:(0,fs.__)("Learn more")})]}),(0,L.jsx)(Uo.__experimentalInputControl,{__next40pxDefaultSize:!0,prefix:(0,L.jsx)(Uo.__experimentalInputControlPrefixWrapper,{children:"/"}),suffix:(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,icon:Ki,ref:x,label:(0,fs.__)("Copy")}),label:(0,fs.__)("Link"),hideLabelFromVision:!0,value:n,autoComplete:"off",spellCheck:"false",type:"text",className:"fields-controls__slug-input",onChange:e=>{b(e)},onBlur:()=>{""===n&&b(g.current)},"aria-describedby":S}),(0,L.jsxs)("div",{className:"fields-controls__slug-help",children:[(0,L.jsx)("span",{className:"fields-controls__slug-help-visual-label",children:(0,fs.__)("Permalink:")}),(0,L.jsxs)(Uo.ExternalLink,{className:"fields-controls__slug-help-link",href:f,children:[(0,L.jsx)("span",{className:"fields-controls__slug-help-prefix",children:d}),(0,L.jsx)("span",{className:"fields-controls__slug-help-slug",children:_}),(0,L.jsx)("span",{className:"fields-controls__slug-help-suffix",children:m})]})]})]}),!h&&(0,L.jsx)(Uo.ExternalLink,{className:"fields-controls__slug-help",href:f,children:f})]})},Xi=Qi,Ji=({item:e})=>{const t=qi(e),s=(0,u.useRef)(t);(0,u.useEffect)((()=>{t&&void 0===s.current&&(s.current=t)}),[t]);return`${t||s.current}`},er={id:"slug",type:"text",label:(0,fs.__)("Slug"),Edit:Xi,render:Ji};var tr=s(9681),sr=s.n(tr);function or(e){return"object"==typeof e.title&&"rendered"in e.title&&e.title.rendered?(0,Lo.decodeEntities)(e.title.rendered):`#${e?.id} (${(0,fs.__)("no title")})`}const nr=(e,t)=>{const s=sr()(e||"").toLowerCase(),o=sr()(t||"").toLowerCase();return s===o?0:s.startsWith(o)?s.length:1/0};function ir({data:e,onChangeControl:t}){const[s,o]=(0,u.useState)(null),n=e.parent,i=e.id,r=e.type,{parentPostTitle:a,pageItems:l,isHierarchical:m}=(0,c.useSelect)((e=>{const{getEntityRecord:t,getEntityRecords:o,getPostType:a}=e(d.store),l=a(r),c=l?.hierarchical&&l.viewable,u=n?t("postType",r,n):null,p={per_page:100,exclude:i,parent_exclude:i,orderby:"menu_order",order:"asc",_fields:"id,title,parent",...null!==s&&{search:s}};return{isHierarchical:c,parentPostTitle:u?or(u):"",pageItems:c?o("postType",r,p):null}}),[s,n,i,r]),h=(0,u.useMemo)((()=>{const e=(t,o=0)=>{const n=t.map((t=>[{value:t.id,label:"— ".repeat(o)+(0,Lo.decodeEntities)(t.name),rawName:t.name},...e(t.children||[],o+1)])).sort((([e],[t])=>nr(e.rawName,null!=s?s:"")>=nr(t.rawName,null!=s?s:"")?1:-1));return n.flat()};if(!l)return[];let t=l.map((e=>{var t;return{id:e.id,parent:null!==(t=e.parent)&&void 0!==t?t:null,name:or(e)}}));s||(t=function(e){const t=e.map((e=>({children:[],...e})));if(t.some((({parent:e})=>null==e)))return t;const s=t.reduce(((e,t)=>{const{parent:s}=t;return e[s]||(e[s]=[]),e[s].push(t),e}),{}),o=e=>e.map((e=>{const t=s[e.id];return{...e,children:t&&t.length?o(t):[]}}));return o(s[0]||[])}(t));const o=e(t),i=o.find((e=>e.value===n));return n&&a&&!i&&o.unshift({value:n,label:a,rawName:""}),o.map((e=>({...e,value:e.value.toString()})))}),[l,s,a,n]);if(!m)return null;return(0,L.jsx)(Uo.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,fs.__)("Parent"),help:(0,fs.__)("Choose a parent page."),value:n?.toString(),options:h,onFilterValueChange:(0,p.debounce)((e=>{o(e)}),300),onChange:e=>{var s;if(e)return t(null!==(s=parseInt(e,10))&&void 0!==s?s:0);t(0)},hideLabelFromVision:!0})}const rr={id:"parent",type:"text",label:(0,fs.__)("Parent"),Edit:({data:e,field:t,onChange:s})=>{const{id:o}=t,n=(0,c.useSelect)((e=>e(d.store).getEntityRecord("root","__unstableBase")?.home),[]),i=(0,u.useCallback)((e=>s({[o]:e})),[o,s]);return(0,L.jsx)("fieldset",{className:"fields-controls__parent",children:(0,L.jsxs)("div",{children:[(0,u.createInterpolateElement)((0,fs.sprintf)((0,fs.__)('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %1$s<wbr />/services<wbr />/pricing.'),(0,v.filterURLForDisplay)(n).replace(/([/.])/g,"<wbr />$1")),{wbr:(0,L.jsx)("wbr",{})}),(0,L.jsx)("p",{children:(0,u.createInterpolateElement)((0,fs.__)("They also show up as sub-items in the default navigation menu. <a>Learn more.</a>"),{a:(0,L.jsx)(Uo.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes"),children:void 0})})}),(0,L.jsx)(ir,{data:e,onChangeControl:i})]})})},render:({item:e})=>{const t=(0,c.useSelect)((t=>{const{getEntityRecord:s}=t(d.store);return e?.parent?s("postType",e.type,e.parent):null}),[e.parent,e.type]);return t?(0,L.jsx)(L.Fragment,{children:or(t)}):(0,L.jsx)(L.Fragment,{children:(0,fs.__)("None")})},enableSorting:!0},ar={id:"comment_status",label:(0,fs.__)("Discussion"),type:"text",Edit:"radio",enableSorting:!1,filterBy:{operators:[]},elements:[{value:"open",label:(0,fs.__)("Open"),description:(0,fs.__)("Visitors can add new comments and replies.")},{value:"closed",label:(0,fs.__)("Closed"),description:(0,fs.__)("Visitors cannot add new comments or replies. Existing comments remain visible.")}]},lr=[],cr={id:"template",type:"text",label:(0,fs.__)("Template"),Edit:({data:e,field:t,onChange:s})=>{const{id:o}=t,n=e.type,i="number"==typeof e.id?e.id:parseInt(e.id,10),r=e.slug,{canSwitchTemplate:a,templates:l}=(0,c.useSelect)((e=>{var t;const s=null!==(t=e(d.store).getEntityRecords("postType","wp_template",{per_page:-1,post_type:n}))&&void 0!==t?t:lr,{getHomePage:o,getPostsPageId:r}=dn(e(d.store)),a=r()===+i,l="page"===n&&o()?.postId===+i;return{templates:s,canSwitchTemplate:!a&&!l}}),[i,n]),m=(0,u.useMemo)((()=>a?l.filter((t=>t.is_custom&&t.slug!==e.template&&!!t.content.raw)).map((e=>({name:e.slug,blocks:(0,y.parse)(e.content.raw),title:(0,Lo.decodeEntities)(e.title.rendered),id:e.id}))):[]),[a,e.template,l]),g=(0,p.useAsyncList)(m),_=t.getValue({item:e}),f=l.find((e=>e.slug===_)),b=(0,c.useSelect)((e=>{if(f)return f;let t;if(t=r?"page"===n?`${n}-${r}`:`single-${n}-${r}`:"page"===n?"page":`single-${n}`,n){const s=e(d.store).getDefaultTemplateId({slug:t});return e(d.store).getEntityRecord("postType","wp_template",s)}}),[f,n,r]),[x,v]=(0,u.useState)(!1),S=(0,u.useCallback)((e=>s({[o]:e})),[o,s]);return(0,L.jsxs)("fieldset",{className:"fields-controls__template",children:[(0,L.jsx)(Uo.Dropdown,{popoverProps:{placement:"bottom-start"},renderToggle:({onToggle:e})=>(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",size:"compact",onClick:e,children:b?on(b):""}),renderContent:({onToggle:e})=>(0,L.jsxs)(Uo.MenuGroup,{children:[(0,L.jsx)(Uo.MenuItem,{onClick:()=>{v(!0),e()},children:(0,fs.__)("Change template")}),""!==_&&(0,L.jsx)(Uo.MenuItem,{onClick:()=>{S(""),e()},children:(0,fs.__)("Use default template")})]})}),x&&(0,L.jsx)(Uo.Modal,{title:(0,fs.__)("Choose a template"),onRequestClose:()=>v(!1),overlayClassName:"fields-controls__template-modal",isFullScreen:!0,children:(0,L.jsx)("div",{className:"fields-controls__template-content",children:(0,L.jsx)(h.__experimentalBlockPatternsList,{label:(0,fs.__)("Templates"),blockPatterns:m,shownPatterns:g,onClickPattern:e=>{S(e.name),v(!1)}})})})]})},enableSorting:!1},dr=cr;const ur={id:"password",type:"text",Edit:function({data:e,onChange:t,field:s}){const[o,n]=(0,u.useState)(!!s.getValue({item:e}));return(0,L.jsxs)(Uo.__experimentalVStack,{as:"fieldset",spacing:4,className:"fields-controls__password",children:[(0,L.jsx)(Uo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Password protected"),help:(0,fs.__)("Only visible to those who know the password"),checked:o,onChange:e=>{n(e),e||t({password:""})}}),o&&(0,L.jsx)("div",{className:"fields-controls__password-input",children:(0,L.jsx)(Uo.TextControl,{label:(0,fs.__)("Password"),onChange:e=>t({password:e}),value:s.getValue({item:e})||"",placeholder:(0,fs.__)("Use a secure password"),type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,maxLength:255})})]})},enableSorting:!1,enableHiding:!1,isVisible:e=>"private"!==e.status};function pr({item:e,className:t,children:s}){const o=on(e);return(0,L.jsxs)(Uo.__experimentalHStack,{className:Di("fields-field__title",t),alignment:"center",justify:"flex-start",children:[(0,L.jsx)("span",{children:o||(0,fs.__)("(no title)")}),s]})}function mr({item:e}){return(0,L.jsx)(pr,{item:e})}const{Badge:hr}=dn(Uo.privateApis);const gr={type:"text",id:"title",label:(0,fs.__)("Title"),placeholder:(0,fs.__)("No title"),getValue:({item:e})=>on(e),render:function({item:e}){const{frontPageId:t,postsPageId:s}=(0,c.useSelect)((e=>{const{getEntityRecord:t}=e(d.store),s=t("root","site");return{frontPageId:s?.page_on_front,postsPageId:s?.page_for_posts}}),[]);return(0,L.jsx)(pr,{item:e,className:"fields-field__page-title",children:[t,s].includes(e.id)&&(0,L.jsx)(hr,{children:e.id===t?(0,fs.__)("Homepage"):(0,fs.__)("Posts Page")})})},enableHiding:!1,enableGlobalSearch:!0},_r={type:"text",label:(0,fs.__)("Template"),placeholder:(0,fs.__)("No title"),id:"title",getValue:({item:e})=>on(e),render:mr,enableHiding:!1,enableGlobalSearch:!0};const fr=(0,u.forwardRef)((function({icon:e,size:t=24,...s},o){return(0,u.cloneElement)(e,{width:t,height:t,...s,ref:o})})),br=(0,L.jsx)(M.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,L.jsx)(M.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z"})}),{PATTERN_TYPES:yr}=dn(ln.privateApis);const xr={type:"text",id:"title",label:(0,fs.__)("Title"),placeholder:(0,fs.__)("No title"),getValue:({item:e})=>on(e),render:function({item:e}){return(0,L.jsx)(pr,{item:e,className:"fields-field__pattern-title",children:e.type===yr.theme&&(0,L.jsx)(Uo.Tooltip,{placement:"top",text:(0,fs.__)("This pattern cannot be edited."),children:(0,L.jsx)(fr,{icon:br,size:24})})})},enableHiding:!1,enableGlobalSearch:!0},vr={type:"text",id:"title",label:(0,fs.__)("Title"),placeholder:(0,fs.__)("No title"),getValue:({item:e})=>on(e),render:mr,enableHiding:!1,enableGlobalSearch:!0};const Sr=(0,p.createHigherOrderComponent)((e=>({useSubRegistry:t=!0,...s})=>{const o=(0,c.useRegistry)(),[n]=(0,u.useState)((()=>new WeakMap)),i=function(e,t,s){if(!s)return t;let o=e.get(t);return o||(o=(0,c.createRegistry)({"core/block-editor":h.storeConfig},t),o.registerStore("core/editor",Dc),e.set(t,o)),o}(n,o,t);return i===o?(0,L.jsx)(e,{registry:o,...s}):(0,L.jsx)(c.RegistryProvider,{value:i,children:(0,L.jsx)(e,{registry:i,...s})})}),"withRegistryProvider"),wr=(e,t)=>`<a ${kr(e)}>${t}</a>`,kr=e=>`href="${e}" target="_blank" rel="noreferrer noopener"`,Cr=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,Lo.decodeEntities)(o);let d;return d=c?t?(0,fs.sprintf)((0,fs._x)('"%1$s" by %2$s/ %3$s',"caption"),wr(s,(0,Lo.decodeEntities)(t)),n?wr(n,c):c,a?wr(`${a}?ref=openverse`,l):l):(0,fs.sprintf)((0,fs._x)("<a %1$s>Work</a> by %2$s/ %3$s","caption"),kr(s),n?wr(n,c):c,a?wr(`${a}?ref=openverse`,l):l):t?(0,fs.sprintf)((0,fs._x)('"%1$s"/ %2$s',"caption"),wr(s,(0,Lo.decodeEntities)(t)),a?wr(`${a}?ref=openverse`,l):l):(0,fs.sprintf)((0,fs._x)("<a %1$s>Work</a>/ %2$s","caption"),kr(s),a?wr(`${a}?ref=openverse`,l):l),d.replace(/\s{2}/g," ")},Pr=async(e={})=>(await(0,c.resolveSelect)(d.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}))),jr=[{name:"images",labels:{name:(0,fs.__)("Images"),search_items:(0,fs.__)("Search images")},mediaType:"image",fetch:async(e={})=>Pr({...e,media_type:"image"})},{name:"videos",labels:{name:(0,fs.__)("Videos"),search_items:(0,fs.__)("Search videos")},mediaType:"video",fetch:async(e={})=>Pr({...e,media_type:"video"})},{name:"audio",labels:{name:(0,fs.__)("Audio"),search_items:(0,fs.__)("Search audio")},mediaType:"audio",fetch:async(e={})=>Pr({...e,media_type:"audio"})},{name:"openverse",labels:{name:(0,fs.__)("Openverse"),search_items:(0,fs.__)("Search Openverse")},mediaType:"image",async fetch(e={}){const t={...e,mature:!1,excluded_source:"flickr,inaturalist,wikimedia",license:"pdm,cc0"},s={per_page:"page_size",search:"q"},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:Cr(e),previewUrl:e.thumbnail})))},getReportUrl:({sourceId:e})=>`https://wordpress.org/openverse/image/${e}/report/`,isExternalResource:!0}],Er={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Tr;const Br=new Uint8Array(16);function Ir(){if(!Tr&&(Tr="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Tr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Tr(Br)}const Nr=[];for(let e=0;e<256;++e)Nr.push((e+256).toString(16).slice(1));function Dr(e,t=0){return Nr[e[t+0]]+Nr[e[t+1]]+Nr[e[t+2]]+Nr[e[t+3]]+"-"+Nr[e[t+4]]+Nr[e[t+5]]+"-"+Nr[e[t+6]]+Nr[e[t+7]]+"-"+Nr[e[t+8]]+Nr[e[t+9]]+"-"+Nr[e[t+10]]+Nr[e[t+11]]+Nr[e[t+12]]+Nr[e[t+13]]+Nr[e[t+14]]+Nr[e[t+15]]}const Ar=function(e,t,s){if(Er.randomUUID&&!t&&!e)return Er.randomUUID();const o=(e=e||{}).random||(e.rng||Ir)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){s=s||0;for(let e=0;e<16;++e)t[s+e]=o[e];return t}return Dr(o)},Rr=()=>{};function Mr({additionalData:e={},allowedTypes:t,filesList:s,maxUploadFileSize:o,onError:n=Rr,onFileChange:i,onSuccess:r,multiple:a=!0}){const{getCurrentPost:l,getEditorSettings:d}=(0,c.select)(Ac),{lockPostAutosaving:u,unlockPostAutosaving:p,lockPostSaving:m,unlockPostSaving:h}=(0,c.dispatch)(Ac),g=d().allowedMimeTypes,_=`image-upload-${Ar()}`;let f=!1;o=o||d().maxUploadFileSize;const b=l(),y="number"==typeof b?.id?b.id:b?.wp_id,x=y?{post:y}:{},v=()=>{h(_),p(_),f=!1};(0,Ei.uploadMedia)({allowedTypes:t,filesList:s,onFileChange:e=>{f?v():(m(_),u(_),f=!0),i?.(e)},onSuccess:r,additionalData:{...x,...e},maxUploadFileSize:o,onError:({message:e})=>{v(),n(e)},wpAllowedMimeTypes:g,multiple:a})}const{sideloadMedia:Lr}=$(Ei.privateApis),Or=Lr;var Fr=s(66),Vr=s.n(Fr);
/*!
 * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
 *
 * Copyright (c) 2014-2017, Jon Schlinkert.
 * Released under the MIT License.
 */
function zr(e){return"[object Object]"===Object.prototype.toString.call(e)}function Ur(e){var t,s;return!1!==zr(e)&&(void 0===(t=e.constructor)||!1!==zr(s=t.prototype)&&!1!==s.hasOwnProperty("isPrototypeOf"))}const{GlobalStylesContext:Hr,cleanEmptyObject:Gr}=$(h.privateApis);function $r(e,t){return Vr()(e,t,{isMergeableObject:Ur,customMerge:e=>{if("backgroundImage"===e)return(e,t)=>t}})}function Wr(){const[e,t,s]=function(){const{globalStylesId:e,isReady:t,settings:s,styles:o,_links:n}=(0,c.useSelect)((e=>{const{getEntityRecord:t,getEditedEntityRecord:s,hasFinishedResolution:o,canUser:n}=e(d.store),i=e(d.store).__experimentalGetCurrentGlobalStylesId();let r;const a=i?n("update",{kind:"root",name:"globalStyles",id:i}):null;i&&"boolean"==typeof a&&(r=a?s("root","globalStyles",i):t("root","globalStyles",i,{context:"view"}));let l=!1;return o("__experimentalGetCurrentGlobalStylesId")&&(l=!i||(a?o("getEditedEntityRecord",["root","globalStyles",i]):o("getEntityRecord",["root","globalStyles",i,{context:"view"}]))),{globalStylesId:i,isReady:l,settings:r?.settings,styles:r?.styles,_links:r?._links}}),[]),{getEditedEntityRecord:i}=(0,c.useSelect)(d.store),{editEntityRecord:r}=(0,c.useDispatch)(d.store);return[t,(0,u.useMemo)((()=>({settings:null!=s?s:{},styles:null!=o?o:{},_links:null!=n?n:{}})),[s,o,n]),(0,u.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:Gr(d.styles)||{},settings:Gr(d.settings)||{},_links:Gr(d._links)||{}},s)}),[e,r,i])]}(),[o,n]=function(){const e=(0,c.useSelect)((e=>e(d.store).__experimentalGetCurrentThemeBaseGlobalStyles()),[]);return[!!e,e]}(),i=(0,u.useMemo)((()=>n&&t?$r(n,t):{}),[t,n]);return(0,u.useMemo)((()=>({isReady:e&&o,user:t,base:n,merged:i,setUserConfig:s})),[i,t,n,s,e,o])}const Zr={};function Yr(e){const{RECEIVE_INTERMEDIATE_RESULTS:t}=$(d.privateApis),{getEntityRecords:s}=e(d.store);return s("postType","wp_block",{per_page:-1,[t]:!0})}const Kr=["__experimentalBlockDirectory","__experimentalDiscussionSettings","__experimentalFeatures","__experimentalGlobalStylesBaseStyles","alignWide","blockInspectorTabs","maxUploadFileSize","allowedMimeTypes","bodyPlaceholder","canLockBlocks","canUpdateBlockBindings","capabilities","clearBlockSelection","codeEditingEnabled","colors","disableCustomColors","disableCustomFontSizes","disableCustomSpacingSizes","disableCustomGradients","disableLayoutStyles","enableCustomLineHeight","enableCustomSpacing","enableCustomUnits","enableOpenverseMediaCategory","fontSizes","gradients","generateAnchors","onNavigateToEntityRecord","imageDefaultSize","imageDimensions","imageEditing","imageSizes","isPreviewMode","isRTL","locale","maxWidth","postContentAttributes","postsPerPage","readOnly","styles","titlePlaceholder","supportsLayout","widgetTypesToHideFromLegacyWidgetBlock","__unstableHasCustomAppender","__unstableResolvedAssets","__unstableIsBlockBasedTheme"],{globalStylesDataKey:qr,globalStylesLinksDataKey:Qr,selectBlockPatternsKey:Xr,reusableBlocksSelectKey:Jr,sectionRootClientIdKey:ea}=$(h.privateApis);const ta=function(e,t,s,o){var n,i,r,a;const l=(0,p.useViewportMatch)("medium"),{allowRightClickOverrides:m,blockTypes:g,focusMode:_,hasFixedToolbar:f,isDistractionFree:b,keepCaretInsideBlock:x,hasUploadPermissions:v,hiddenBlockTypes:S,canUseUnfilteredHTML:w,userCanCreatePages:C,pageOnFront:P,pageForPosts:j,userPatternCategories:E,restBlockPatternCategories:T,sectionRootClientId:B}=(0,c.useSelect)((e=>{var n;const{canUser:i,getRawEntityRecord:r,getEntityRecord:a,getUserPatternCategories:c,getBlockPatternCategories:u}=e(d.store),{get:p}=e(k.store),{getBlockTypes:m}=e(y.store),{getBlocksByName:g,getBlockAttributes:_}=e(h.store),f=i("read",{kind:"root",name:"site"})?a("root","site"):void 0;return{allowRightClickOverrides:p("core","allowRightClickOverrides"),blockTypes:m(),canUseUnfilteredHTML:r("postType",t,s)?._links?.hasOwnProperty("wp:action-unfiltered-html"),focusMode:p("core","focusMode"),hasFixedToolbar:p("core","fixedToolbar")||!l,hiddenBlockTypes:p("core","hiddenBlockTypes"),isDistractionFree:p("core","distractionFree"),keepCaretInsideBlock:p("core","keepCaretInsideBlock"),hasUploadPermissions:null===(n=i("create",{kind:"root",name:"media"}))||void 0===n||n,userCanCreatePages:i("create",{kind:"postType",name:"page"}),pageOnFront:f?.page_on_front,pageForPosts:f?.page_for_posts,userPatternCategories:c(),restBlockPatternCategories:u(),sectionRootClientId:"template-locked"===o?null!==(x=g("core/post-content")?.[0])&&void 0!==x?x:"":null!==(b=g("core/group").find((e=>"main"===_(e)?.tagName)))&&void 0!==b?b:""};var b,x}),[t,s,l,o]),{merged:I}=Wr(),N=null!==(n=I.styles)&&void 0!==n?n:Zr,D=null!==(i=I._links)&&void 0!==i?i:Zr,A=null!==(r=e.__experimentalAdditionalBlockPatterns)&&void 0!==r?r:e.__experimentalBlockPatterns,R=null!==(a=e.__experimentalAdditionalBlockPatternCategories)&&void 0!==a?a:e.__experimentalBlockPatternCategories,M=(0,u.useMemo)((()=>[...A||[]].filter((({postTypes:e})=>!e||Array.isArray(e)&&e.includes(t)))),[A,t]),L=(0,u.useMemo)((()=>[...R||[],...T||[]].filter(((e,t,s)=>t===s.findIndex((t=>e.name===t.name))))),[R,T]),{undo:O,setIsInserterOpened:F}=(0,c.useDispatch)(Ac),{saveEntityRecord:V}=(0,c.useDispatch)(d.store),z=(0,u.useCallback)((e=>C?V("postType","page",e):Promise.reject({message:(0,fs.__)("You do not have permission to create Pages.")})),[V,C]),U=(0,u.useMemo)((()=>{if(S&&S.length>0){return(!0===e.allowedBlockTypes?g.map((({name:e})=>e)):e.allowedBlockTypes||[]).filter((e=>!S.includes(e)))}return e.allowedBlockTypes}),[e.allowedBlockTypes,S,g]),H=!1===e.focusMode;return(0,u.useMemo)((()=>{const s={...Object.fromEntries(Object.entries(e).filter((([e])=>Kr.includes(e)))),[qr]:N,[Qr]:D,allowedBlockTypes:U,allowRightClickOverrides:m,focusMode:_&&!H,hasFixedToolbar:f,isDistractionFree:b,keepCaretInsideBlock:x,mediaUpload:v?Mr:void 0,mediaSideload:v?Or:void 0,__experimentalBlockPatterns:M,[Xr]:e=>{const{hasFinishedResolution:s,getBlockPatternsForPostType:o}=$(e(d.store)),n=o(t);return s("getBlockPatterns")?n:void 0},[Jr]:Yr,__experimentalBlockPatternCategories:L,__experimentalUserPatternCategories:E,__experimentalFetchLinkSuggestions:(t,s)=>(0,d.__experimentalFetchLinkSuggestions)(t,s,e),inserterMediaCategories:jr,__experimentalFetchRichUrlData:d.__experimentalFetchUrlData,__experimentalCanUserUseUnfilteredHTML:w,__experimentalUndo:O,outlineMode:!b&&"wp_template"===t,__experimentalCreatePageEntity:z,__experimentalUserCanCreatePages:C,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,[ea]:B,editorTool:"post-only"===o&&"wp_template"!==t?"edit":void 0};return s}),[U,m,_,H,f,b,x,e,v,E,M,L,w,O,z,C,P,j,t,F,B,N,D,o])},sa=["core/post-title","core/post-featured-image","core/post-content"];function oa(){const e=(0,u.useMemo)((()=>[...(0,m.applyFilters)("editor.postContentBlockTypes",sa)]),[]),t=(0,c.useSelect)((t=>{const{getPostBlocksByName:s}=$(t(Ac));return s(e)}),[e]);return t}function na(){const e=oa(),{templateParts:t,isNavigationMode:s}=(0,c.useSelect)((e=>{const{getBlocksByName:t,isNavigationMode:s}=e(h.store);return{templateParts:t("core/template-part"),isNavigationMode:s()}}),[]),o=(0,c.useSelect)((e=>{const{getBlockOrder:s}=e(h.store);return t.flatMap((e=>s(e)))}),[t]),n=(0,c.useRegistry)();return(0,u.useEffect)((()=>{const{setBlockEditingMode:e,unsetBlockEditingMode:t}=n.dispatch(h.store);return e("","disabled"),()=>{t("")}}),[n]),(0,u.useEffect)((()=>{const{setBlockEditingMode:t,unsetBlockEditingMode:s}=n.dispatch(h.store);return n.batch((()=>{for(const s of e)t(s,"contentOnly")})),()=>{n.batch((()=>{for(const t of e)s(t)}))}}),[e,n]),(0,u.useEffect)((()=>{const{setBlockEditingMode:e,unsetBlockEditingMode:o}=n.dispatch(h.store);return n.batch((()=>{if(!s)for(const s of t)e(s,"contentOnly")})),()=>{n.batch((()=>{if(!s)for(const e of t)o(e)}))}}),[t,s,n]),(0,u.useEffect)((()=>{const{setBlockEditingMode:e,unsetBlockEditingMode:t}=n.dispatch(h.store);return n.batch((()=>{for(const t of o)e(t,"disabled")})),()=>{n.batch((()=>{for(const e of o)t(e)}))}}),[o,n]),null}function ia(){const e=(0,c.useSelect)((e=>e(h.store).getBlockOrder()?.[0]),[]),{setBlockEditingMode:t,unsetBlockEditingMode:s}=(0,c.useDispatch)(h.store);(0,u.useEffect)((()=>{if(e)return t(e,"contentOnly"),()=>{s(e)}}),[e,s,t])}const ra=["wp_block","wp_template","wp_template_part"];const aa=(0,L.jsxs)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,L.jsx)(M.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,L.jsx)(M.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"})]}),la=(0,L.jsx)(M.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,L.jsx)(M.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})}),ca=(0,L.jsx)(M.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,L.jsx)(M.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"})}),da=(0,L.jsx)(M.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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"})}),ua=(0,L.jsx)(M.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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"})}),pa=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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"})}),ma=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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"})}),ha=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})}),ga=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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"})}),_a=(0,L.jsxs)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,L.jsx)(M.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,L.jsx)(M.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"})]}),fa=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"})}),ba=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M12 4V2.2L9 4.8l3 2.5V5.5c3.6 0 6.5 2.9 6.5 6.5 0 2.9-1.9 5.3-4.5 6.2v.2l-.1-.2c-.4.1-.7.2-1.1.2l.2 1.5c.3 0 .6-.1 1-.2 3.5-.9 6-4 6-7.7 0-4.4-3.6-8-8-8zm-7.9 7l1.5.2c.1-1.2.5-2.3 1.2-3.2l-1.1-.9C4.8 8.2 4.3 9.6 4.1 11zm1.5 1.8l-1.5.2c.1.7.3 1.4.5 2 .3.7.6 1.3 1 1.8l1.2-.8c-.3-.5-.6-1-.8-1.5s-.4-1.1-.4-1.7zm1.5 5.5c1.1.9 2.4 1.4 3.8 1.6l.2-1.5c-1.1-.1-2.2-.5-3.1-1.2l-.9 1.1z"})}),ya=window.wp.commands,xa=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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"})}),va=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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"})}),Sa=window.wp.viewport,wa=window.wp.plugins;function ka(e){return["core/edit-post","core/edit-site"].includes(e)?(w()(`${e} interface scope`,{alternative:"core interface scope",hint:"core/edit-post and core/edit-site are merging.",version:"6.6"}),"core"):e}function Ca(e,t){return"core"===e&&"edit-site/template"===t?(w()("edit-site/template sidebar",{alternative:"edit-post/document",version:"6.6"}),"edit-post/document"):"core"===e&&"edit-site/block-inspector"===t?(w()("edit-site/block-inspector sidebar",{alternative:"edit-post/block",version:"6.6"}),"edit-post/block"):t}const Pa=(e,t)=>({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e=ka(e),area:t=Ca(e,t)}),ja=(e,t)=>({registry:s,dispatch:o})=>{if(!t)return;e=ka(e),t=Ca(e,t);s.select(k.store).get(e,"isComplementaryAreaVisible")||s.dispatch(k.store).set(e,"isComplementaryAreaVisible",!0),o({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},Ea=e=>({registry:t})=>{e=ka(e);t.select(k.store).get(e,"isComplementaryAreaVisible")&&t.dispatch(k.store).set(e,"isComplementaryAreaVisible",!1)},Ta=(e,t)=>({registry:s})=>{if(!t)return;e=ka(e),t=Ca(e,t);const o=s.select(k.store).get(e,"pinnedItems");!0!==o?.[t]&&s.dispatch(k.store).set(e,"pinnedItems",{...o,[t]:!0})},Ba=(e,t)=>({registry:s})=>{if(!t)return;e=ka(e),t=Ca(e,t);const o=s.select(k.store).get(e,"pinnedItems");s.dispatch(k.store).set(e,"pinnedItems",{...o,[t]:!1})};function Ia(e,t){return function({registry:s}){w()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),s.dispatch(k.store).toggle(e,t)}}function Na(e,t,s){return function({registry:o}){w()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),o.dispatch(k.store).set(e,t,!!s)}}function Da(e,t){return function({registry:s}){w()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),s.dispatch(k.store).setDefaults(e,t)}}function Aa(e){return{type:"OPEN_MODAL",name:e}}function Ra(){return{type:"CLOSE_MODAL"}}const Ma=(0,c.createRegistrySelector)((e=>(t,s)=>{s=ka(s);const o=e(k.store).get(s,"isComplementaryAreaVisible");if(void 0!==o)return!1===o?null:t?.complementaryAreas?.[s]})),La=(0,c.createRegistrySelector)((e=>(t,s)=>{s=ka(s);const o=e(k.store).get(s,"isComplementaryAreaVisible"),n=t?.complementaryAreas?.[s];return o&&void 0===n})),Oa=(0,c.createRegistrySelector)((e=>(t,s,o)=>{var n;o=Ca(s=ka(s),o);const i=e(k.store).get(s,"pinnedItems");return null===(n=i?.[o])||void 0===n||n})),Fa=(0,c.createRegistrySelector)((e=>(t,s,o)=>(w()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(k.store).get(s,o))));function Va(e,t){return e.activeModal===t}const za=(0,c.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}}),Ua=(0,c.createReduxStore)("core/interface",{reducer:za,actions:n,selectors:i});function Ha({as:e=Uo.Button,scope:t,identifier:s,icon:o,selectedIcon:n,name:i,shortcut:r,...a}){const l=e,d=(0,wa.usePluginContext)(),u=o||d.icon,p=s||`${d.name}/${i}`,m=(0,c.useSelect)((e=>e(Ua).getActiveComplementaryArea(t)===p),[p,t]),{enableComplementaryArea:h,disableComplementaryArea:g}=(0,c.useDispatch)(Ua);return(0,L.jsx)(l,{icon:n&&m?n:u,"aria-controls":p.replace("/",":"),"aria-checked":(_=a.role,["checkbox","option","radio","switch","menuitemcheckbox","menuitemradio","treeitem"].includes(_)?m:void 0),onClick:()=>{m?g(t):h(t,p)},shortcut:r,...a});var _}(0,c.register)(Ua);const Ga=({children:e,className:t,toggleButtonProps:s})=>{const o=(0,L.jsx)(Ha,{icon:Bn,...s});return(0,L.jsxs)("div",{className:Di("components-panel__header","interface-complementary-area-header",t),tabIndex:-1,children:[e,o]})},$a=()=>{};function Wa({name:e,as:t=Uo.Button,onClick:s,...o}){return(0,L.jsx)(Uo.Fill,{name:e,children:({onClick:e})=>(0,L.jsx)(t,{onClick:s||e?(...t)=>{(s||$a)(...t),(e||$a)(...t)}:void 0,...o})})}Wa.Slot=function({name:e,as:t=Uo.MenuGroup,fillProps:s={},bubblesVirtually:o,...n}){return(0,L.jsx)(Uo.Slot,{name:e,bubblesVirtually:o,fillProps:s,children:e=>{if(!u.Children.toArray(e).length)return null;const s=[];u.Children.forEach(e,(({props:{__unstableExplicitMenuItem:e,__unstableTarget:t}})=>{t&&e&&s.push(t)}));const o=u.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&s.includes(e.props.__unstableTarget)?null:e));return(0,L.jsx)(t,{...n,children:o})}})};const Za=Wa,Ya=({__unstableExplicitMenuItem:e,__unstableTarget:t,...s})=>(0,L.jsx)(Uo.MenuItem,{...s});function Ka({scope:e,target:t,__unstableExplicitMenuItem:s,...o}){return(0,L.jsx)(Ha,{as:o=>(0,L.jsx)(Za,{__unstableExplicitMenuItem:s,__unstableTarget:`${e}/${t}`,as:Ya,name:`${e}/plugin-more-menu`,...o}),role:"menuitemcheckbox",selectedIcon:Ho,name:t,scope:e,...o})}function qa({scope:e,...t}){return(0,L.jsx)(Uo.Fill,{name:`PinnedItems/${e}`,...t})}qa.Slot=function({scope:e,className:t,...s}){return(0,L.jsx)(Uo.Slot,{name:`PinnedItems/${e}`,...s,children:e=>e?.length>0&&(0,L.jsx)("div",{className:Di(t,"interface-pinned-items"),children:e})})};const Qa=qa;const Xa={open:{width:280},closed:{width:0},mobileOpen:{width:"100vw"}};function Ja({activeArea:e,isActive:t,scope:s,children:o,className:n,id:i}){const r=(0,p.useReducedMotion)(),a=(0,p.useViewportMatch)("medium","<"),l=(0,p.usePrevious)(e),c=(0,p.usePrevious)(t),[,d]=(0,u.useState)({});(0,u.useEffect)((()=>{d({})}),[t]);const m={type:"tween",duration:r||a||l&&e&&e!==l?0:.3,ease:[.6,0,.4,1]};return(0,L.jsx)(Uo.Fill,{name:`ComplementaryArea/${s}`,children:(0,L.jsx)(Uo.__unstableAnimatePresence,{initial:!1,children:(c||t)&&(0,L.jsx)(Uo.__unstableMotion.div,{variants:Xa,initial:"closed",animate:a?"mobileOpen":"open",exit:"closed",transition:m,className:"interface-complementary-area__fill",children:(0,L.jsx)("div",{id:i,className:n,style:{width:a?"100vw":280},children:o})})})})}function el({children:e,className:t,closeLabel:s=(0,fs.__)("Close plugin"),identifier:o,header:n,headerClassName:i,icon:r,isPinnable:a=!0,panelClassName:l,scope:d,name:m,title:h,toggleShortcut:g,isActiveByDefault:_}){const f=(0,wa.usePluginContext)(),b=r||f.icon,y=o||`${f.name}/${m}`,[x,v]=(0,u.useState)(!1),{isLoading:S,isActive:w,isPinned:C,activeArea:P,isSmall:j,isLarge:E,showIconLabels:T}=(0,c.useSelect)((e=>{const{getActiveComplementaryArea:t,isComplementaryAreaLoading:s,isItemPinned:o}=e(Ua),{get:n}=e(k.store),i=t(d);return{isLoading:s(d),isActive:i===y,isPinned:o(d,y),activeArea:i,isSmall:e(Sa.store).isViewportMatch("< medium"),isLarge:e(Sa.store).isViewportMatch("large"),showIconLabels:n("core","showIconLabels")}}),[y,d]),B=(0,p.useViewportMatch)("medium","<");!function(e,t,s,o,n){const i=(0,u.useRef)(!1),r=(0,u.useRef)(!1),{enableComplementaryArea:a,disableComplementaryArea:l}=(0,c.useDispatch)(Ua);(0,u.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])}(d,y,P,w,j);const{enableComplementaryArea:I,disableComplementaryArea:N,pinItem:D,unpinItem:A}=(0,c.useDispatch)(Ua);if((0,u.useEffect)((()=>{_&&void 0===P&&!j?I(d,y):void 0===P&&j&&N(d,y),v(!0)}),[P,_,d,y,j,I,N]),x)return(0,L.jsxs)(L.Fragment,{children:[a&&(0,L.jsx)(Qa,{scope:d,children:C&&(0,L.jsx)(Ha,{scope:d,identifier:y,isPressed:w&&(!T||E),"aria-expanded":w,"aria-disabled":S,label:h,icon:T?Ho:b,showTooltip:!T,variant:T?"tertiary":void 0,size:"compact",shortcut:g})}),m&&a&&(0,L.jsx)(Ka,{target:m,scope:d,icon:b,children:h}),(0,L.jsxs)(Ja,{activeArea:P,isActive:w,className:Di("interface-complementary-area",t),scope:d,id:y.replace("/",":"),children:[(0,L.jsx)(Ga,{className:i,closeLabel:s,onClose:()=>N(d),toggleButtonProps:{label:s,size:"compact",shortcut:g,scope:d,identifier:y},children:n||(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("h2",{className:"interface-complementary-area-header__title",children:h}),a&&!B&&(0,L.jsx)(Uo.Button,{className:"interface-complementary-area__pin-unpin-item",icon:C?xa:va,label:C?(0,fs.__)("Unpin from toolbar"):(0,fs.__)("Pin to toolbar"),onClick:()=>(C?A:D)(d,y),isPressed:C,"aria-expanded":C,size:"compact"})]})}),(0,L.jsx)(Uo.Panel,{className:l,children:e})]})]})}el.Slot=function({scope:e,...t}){return(0,L.jsx)(Uo.Slot,{name:`ComplementaryArea/${e}`,...t})};const tl=el,sl=({isActive:e})=>((0,u.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,u.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),ol=(0,u.forwardRef)((({children:e,className:t,ariaLabel:s,as:o="div",...n},i)=>(0,L.jsx)(o,{ref:i,className:Di("interface-navigable-region",t),"aria-label":s,role:"region",tabIndex:"-1",...n,children:e})));ol.displayName="NavigableRegion";const nl=ol,il={type:"tween",duration:.25,ease:[.6,0,.4,1]};const rl={hidden:{opacity:1,marginTop:-60},visible:{opacity:1,marginTop:0},distractionFreeHover:{opacity:1,marginTop:0,transition:{...il,delay:.2,delayChildren:.2}},distractionFreeHidden:{opacity:0,marginTop:-60},distractionFreeDisabled:{opacity:0,marginTop:0,transition:{...il,delay:.8,delayChildren:.8}}};const al=(0,u.forwardRef)((function({isDistractionFree:e,footer:t,header:s,editorNotices:o,sidebar:n,secondarySidebar:i,content:r,actions:a,labels:l,className:c},d){const[m,h]=(0,p.useResizeObserver)(),g=(0,p.useViewportMatch)("medium","<"),_={type:"tween",duration:(0,p.useReducedMotion)()?0:.25,ease:[.6,0,.4,1]};!function(e){(0,u.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 f={...{header:(0,fs._x)("Header","header landmark area"),body:(0,fs.__)("Content"),secondarySidebar:(0,fs.__)("Block Library"),sidebar:(0,fs._x)("Settings","settings landmark area"),actions:(0,fs.__)("Publish"),footer:(0,fs.__)("Footer")},...l};return(0,L.jsxs)("div",{ref:d,className:Di(c,"interface-interface-skeleton",!!t&&"has-footer"),children:[(0,L.jsxs)("div",{className:"interface-interface-skeleton__editor",children:[(0,L.jsx)(Uo.__unstableAnimatePresence,{initial:!1,children:!!s&&(0,L.jsx)(nl,{as:Uo.__unstableMotion.div,className:"interface-interface-skeleton__header","aria-label":f.header,initial:e&&!g?"distractionFreeHidden":"hidden",whileHover:e&&!g?"distractionFreeHover":"visible",animate:e&&!g?"distractionFreeDisabled":"visible",exit:e&&!g?"distractionFreeHidden":"hidden",variants:rl,transition:_,children:s})}),e&&(0,L.jsx)("div",{className:"interface-interface-skeleton__header",children:o}),(0,L.jsxs)("div",{className:"interface-interface-skeleton__body",children:[(0,L.jsx)(Uo.__unstableAnimatePresence,{initial:!1,children:!!i&&(0,L.jsx)(nl,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:f.secondarySidebar,as:Uo.__unstableMotion.div,initial:"closed",animate:"open",exit:"closed",variants:{open:{width:h.width},closed:{width:0}},transition:_,children:(0,L.jsxs)(Uo.__unstableMotion.div,{style:{position:"absolute",width:g?"100vw":"fit-content",height:"100%",left:0},variants:{open:{x:0},closed:{x:"-100%"}},transition:_,children:[m,i]})})}),(0,L.jsx)(nl,{className:"interface-interface-skeleton__content",ariaLabel:f.body,children:r}),!!n&&(0,L.jsx)(nl,{className:"interface-interface-skeleton__sidebar",ariaLabel:f.sidebar,children:n}),!!a&&(0,L.jsx)(nl,{className:"interface-interface-skeleton__actions",ariaLabel:f.actions,children:a})]})]}),!!t&&(0,L.jsx)(nl,{className:"interface-interface-skeleton__footer",ariaLabel:f.footer,children:t})]})})),{RenamePatternModal:ll}=$(ln.privateApis),cl="editor/pattern-rename";function dl(){const{record:e,postType:t}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(Ac),{getEditedEntityRecord:o}=e(d.store),n=t();return{record:o("postType",n,s()),postType:n}}),[]),{closeModal:s}=(0,c.useDispatch)(Ua);return(0,c.useSelect)((e=>e(Ua).isModalActive(cl)))&&t===I?(0,L.jsx)(ll,{onClose:s,pattern:e}):null}const{DuplicatePatternModal:ul}=$(ln.privateApis),pl="editor/pattern-duplicate";function ml(){const{record:e,postType:t}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(Ac),{getEditedEntityRecord:o}=e(d.store),n=t();return{record:o("postType",n,s()),postType:n}}),[]),{closeModal:s}=(0,c.useDispatch)(Ua);return(0,c.useSelect)((e=>e(Ua).isModalActive(pl)))&&t===I?(0,L.jsx)(ul,{onClose:s,onSuccess:()=>s(),pattern:e}):null}const{BlockRemovalWarningModal:hl}=$(h.privateApis),gl=["core/post-content","core/post-template","core/query"],_l=[{postTypes:["wp_template","wp_template_part"],callback(e){if(e.filter((({name:e})=>gl.includes(e))).length)return(0,fs._n)("Deleting this block will stop your post or page content from displaying on this template. It is not recommended.","Some of the deleted blocks will stop your post or page content from displaying on this template. It is not recommended.",e.length)}},{postTypes:["wp_block"],callback(e){if(e.filter((({attributes:e})=>e?.metadata?.bindings&&Object.values(e.metadata.bindings).some((e=>"core/pattern-overrides"===e.source)))).length)return(0,fs._n)("The deleted block allows instance overrides. Removing it may result in content not displaying where this pattern is used. Are you sure you want to proceed?","Some of the deleted blocks allow instance overrides. Removing them may result in content not displaying where this pattern is used. Are you sure you want to proceed?",e.length)}}];function fl(){const e=(0,c.useSelect)((e=>e(Ac).getCurrentPostType()),[]),t=(0,u.useMemo)((()=>_l.filter((t=>t.postTypes.includes(e)))),[e]);return hl&&t?(0,L.jsx)(hl,{rules:t}):null}function bl({blockPatterns:e,onChoosePattern:t}){const{editEntityRecord:s}=(0,c.useDispatch)(d.store),{postType:o,postId:n}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(Ac);return{postType:t(),postId:s()}}),[]);return(0,L.jsx)(h.__experimentalBlockPatternsList,{blockPatterns:e,onClickPattern:(e,i)=>{s("postType",o,n,{blocks:i,content:({blocks:e=[]})=>(0,y.__unstableSerializeAndClean)(e)}),t()}})}function yl({onClose:e}){const[t,s]=(0,u.useState)(!0),{set:o}=(0,c.useDispatch)(k.store),n=function(){const{blockPatternsWithPostContentBlockType:e,postType:t}=(0,c.useSelect)((e=>{const{getPatternsByBlockTypes:t,getBlocksByName:s}=e(h.store),{getCurrentPostType:o,getRenderingMode:n}=e(Ac);return{blockPatternsWithPostContentBlockType:t("core/post-content","post-only"===n()?"":s("core/post-content")?.[0]),postType:o()}}),[]);return(0,u.useMemo)((()=>e?.length?e.filter((e=>"page"===t&&!e.postTypes||Array.isArray(e.postTypes)&&e.postTypes.includes(t))):[]),[t,e])}();if(!(n.length>0))return null;function i(){e(),o("core","enableChoosePatternModal",t)}return(0,L.jsxs)(Uo.Modal,{className:"editor-start-page-options__modal",title:(0,fs.__)("Choose a pattern"),isFullScreen:!0,onRequestClose:i,children:[(0,L.jsx)("div",{className:"editor-start-page-options__modal-content",children:(0,L.jsx)(bl,{blockPatterns:n,onChoosePattern:i})}),(0,L.jsx)(Uo.Flex,{className:"editor-start-page-options__modal__actions",justify:"flex-end",expanded:!1,children:(0,L.jsx)(Uo.FlexItem,{children:(0,L.jsx)(Uo.ToggleControl,{__nextHasNoMarginBottom:!0,checked:t,label:(0,fs.__)("Show starter patterns"),help:(0,fs.__)("Shows starter patterns when creating a new page."),onChange:e=>{s(e)}})})})]})}function xl(){const[e,t]=(0,u.useState)(!1),{isEditedPostDirty:s,isEditedPostEmpty:o}=(0,c.useSelect)(Ac),{isModalActive:n}=(0,c.useSelect)(Ua),{enabled:i,postId:r}=(0,c.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s}=e(Ac),o=e(k.store).get("core","enableChoosePatternModal");return{postId:t(),enabled:o&&T!==s()}}),[]);return(0,u.useEffect)((()=>{const e=!s()&&o(),r=n("editor/preferences");i&&e&&!r&&t(!0)}),[i,r,s,o,n]),e?(0,L.jsx)(yl,{onClose:()=>t(!1)}):null}const vl=window.wp.keyboardShortcuts,Sl=[{keyCombination:{modifier:"primary",character:"b"},description:(0,fs.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,fs.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,fs.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,fs.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,fs.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,fs.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,fs.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,fs.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}],description:(0,fs.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,fs.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")},{keyCombination:{modifier:"primaryShift",character:"SPACE"},description:(0,fs.__)("Add non breaking space.")}],wl=window.wp.keycodes;function kl({keyCombination:e,forceAriaLabel:t}){const s=e.modifier?wl.displayShortcutList[e.modifier](e.character):e.character,o=e.modifier?wl.shortcutAriaLabel[e.modifier](e.character):e.character;return(0,L.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,L.jsx)(u.Fragment,{children:e},t):(0,L.jsx)("kbd",{className:"editor-keyboard-shortcut-help-modal__shortcut-key",children:e},t)))})}const Cl=function({description:e,keyCombination:t,aliases:s=[],ariaLabel:o}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("div",{className:"editor-keyboard-shortcut-help-modal__shortcut-description",children:e}),(0,L.jsxs)("div",{className:"editor-keyboard-shortcut-help-modal__shortcut-term",children:[(0,L.jsx)(kl,{keyCombination:t,forceAriaLabel:o}),s.map(((e,t)=>(0,L.jsx)(kl,{keyCombination:e,forceAriaLabel:o},t)))]})]})};const Pl=function({name:e}){const{keyCombination:t,description:s,aliases:o}=(0,c.useSelect)((t=>{const{getShortcutKeyCombination:s,getShortcutDescription:o,getShortcutAliases:n}=t(vl.store);return{keyCombination:s(e),aliases:n(e),description:o(e)}}),[e]);return t?(0,L.jsx)(Cl,{keyCombination:t,description:s,aliases:o}):null},jl="editor/keyboard-shortcut-help",El=({shortcuts:e})=>(0,L.jsx)("ul",{className:"editor-keyboard-shortcut-help-modal__shortcut-list",role:"list",children:e.map(((e,t)=>(0,L.jsx)("li",{className:"editor-keyboard-shortcut-help-modal__shortcut",children:"string"==typeof e?(0,L.jsx)(Pl,{name:e}):(0,L.jsx)(Cl,{...e})},t)))}),Tl=({title:e,shortcuts:t,className:s})=>(0,L.jsxs)("section",{className:Di("editor-keyboard-shortcut-help-modal__section",s),children:[!!e&&(0,L.jsx)("h2",{className:"editor-keyboard-shortcut-help-modal__section-title",children:e}),(0,L.jsx)(El,{shortcuts:t})]}),Bl=({title:e,categoryName:t,additionalShortcuts:s=[]})=>{const o=(0,c.useSelect)((e=>e(vl.store).getCategoryShortcuts(t)),[t]);return(0,L.jsx)(Tl,{title:e,shortcuts:o.concat(s)})};const Il=function(){const e=(0,c.useSelect)((e=>e(Ua).isModalActive(jl)),[]),{openModal:t,closeModal:s}=(0,c.useDispatch)(Ua),o=()=>{e?s():t(jl)};return(0,vl.useShortcut)("core/editor/keyboard-shortcuts",o),e?(0,L.jsxs)(Uo.Modal,{className:"editor-keyboard-shortcut-help-modal",title:(0,fs.__)("Keyboard shortcuts"),closeButtonLabel:(0,fs.__)("Close"),onRequestClose:o,children:[(0,L.jsx)(Tl,{className:"editor-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/editor/keyboard-shortcuts"]}),(0,L.jsx)(Bl,{title:(0,fs.__)("Global shortcuts"),categoryName:"global"}),(0,L.jsx)(Bl,{title:(0,fs.__)("Selection shortcuts"),categoryName:"selection"}),(0,L.jsx)(Bl,{title:(0,fs.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,fs.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,fs.__)("Forward-slash")}]}),(0,L.jsx)(Tl,{title:(0,fs.__)("Text formatting"),shortcuts:Sl}),(0,L.jsx)(Bl,{title:(0,fs.__)("List View shortcuts"),categoryName:"list-view"})]}):null};function Nl({clientId:e,onClose:t}){const s=oa(),{entity:o,onNavigateToEntityRecord:n,canEditTemplates:i}=(0,c.useSelect)((t=>{const{getBlockParentsByBlockName:o,getSettings:n,getBlockAttributes:i,getBlockParents:r}=t(h.store),{getCurrentTemplateId:a,getRenderingMode:l}=t(Ac),c=o(e,"core/block",!0)[0];let u;if(c?u=t(d.store).getEntityRecord("postType","wp_block",i(c).ref):"template-locked"!==l()||r(e).some((e=>s.includes(e)))||(u=t(d.store).getEntityRecord("postType","wp_template",a())),!u)return{};return{canEditTemplates:t(d.store).canUser("create",{kind:"postType",name:"wp_template"}),entity:u,onNavigateToEntityRecord:n().onNavigateToEntityRecord}}),[e,s]);if(!o)return(0,L.jsx)(Dl,{clientId:e,onClose:t});const r="wp_block"===o.type;let a=r?(0,fs.__)("Edit the pattern to move, delete, or make further changes to this block."):(0,fs.__)("Edit the template to move, delete, or make further changes to this block.");return i||(a=(0,fs.__)("Only users with permissions to edit the template can move or delete this block")),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(h.__unstableBlockSettingsMenuFirstItem,{children:(0,L.jsx)(Uo.MenuItem,{onClick:()=>{n({postId:o.id,postType:o.type})},disabled:!i,children:r?(0,fs.__)("Edit pattern"):(0,fs.__)("Edit template")})}),(0,L.jsx)(Uo.__experimentalText,{variant:"muted",as:"p",className:"editor-content-only-settings-menu__description",children:a})]})}function Dl({clientId:e,onClose:t}){const{contentLockingParent:s}=(0,c.useSelect)((t=>{const{getContentLockingParent:s}=$(t(h.store));return{contentLockingParent:s(e)}}),[e]),o=(0,h.useBlockDisplayInformation)(s),n=(0,c.useDispatch)(h.store);if(!o?.title)return null;const{modifyContentLockBlock:i}=$(n);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(h.__unstableBlockSettingsMenuFirstItem,{children:(0,L.jsx)(Uo.MenuItem,{onClick:()=>{i(s),t()},children:(0,fs._x)("Unlock","Unlock content locked blocks")})}),(0,L.jsx)(Uo.__experimentalText,{variant:"muted",as:"p",className:"editor-content-only-settings-menu__description",children:(0,fs.__)("Temporarily unlock the parent block to edit, delete or make further changes to this block.")})]})}function Al(){return(0,L.jsx)(h.BlockSettingsMenuControls,{children:({selectedClientIds:e,onClose:t})=>1===e.length&&(0,L.jsx)(Nl,{clientId:e[0],onClose:t})})}function Rl(e){const{slug:t,patterns:s}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(Ac),{getEntityRecord:o,getBlockPatterns:n}=e(d.store),i=s();return{slug:o("postType",t(),i).slug,patterns:n()}}),[]),o=(0,c.useSelect)((e=>e(d.store).getCurrentTheme().stylesheet));return(0,u.useMemo)((()=>[{name:"fallback",blocks:(0,y.parse)(e),title:(0,fs.__)("Fallback content")},...s.filter((e=>Array.isArray(e.templateTypes)&&e.templateTypes.some((e=>t.startsWith(e))))).map((e=>({...e,blocks:(0,y.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 Ml({fallbackContent:e,onChoosePattern:t,postType:s}){const[,,o]=(0,d.useEntityBlockEditor)("postType",s),n=Rl(e);return(0,L.jsx)(h.__experimentalBlockPatternsList,{blockPatterns:n,onClickPattern:(e,s)=>{o(s,{selection:void 0}),t()}})}function Ll({slug:e,isCustom:t,onClose:s,postType:o}){const n=function(e,t=!1){return(0,c.useSelect)((s=>{const{getEntityRecord:o,getDefaultTemplateId:n}=s(d.store),i=n({slug:e,is_custom:t,ignore_empty:!0});return i?o("postType",T,i)?.content?.raw:void 0}),[e,t])}(e,t);return n?(0,L.jsxs)(Uo.Modal,{className:"editor-start-template-options__modal",title:(0,fs.__)("Choose a pattern"),closeLabel:(0,fs.__)("Cancel"),focusOnMount:"firstElement",onRequestClose:s,isFullScreen:!0,children:[(0,L.jsx)("div",{className:"editor-start-template-options__modal-content",children:(0,L.jsx)(Ml,{fallbackContent:n,slug:e,isCustom:t,postType:o,onChoosePattern:()=>{s()}})}),(0,L.jsx)(Uo.Flex,{className:"editor-start-template-options__modal__actions",justify:"flex-end",expanded:!1,children:(0,L.jsx)(Uo.FlexItem,{children:(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:s,children:(0,fs.__)("Skip")})})})]}):null}function Ol(){const[e,t]=(0,u.useState)(!1),{shouldOpenModal:s,slug:o,isCustom:n,postType:i,postId:r}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(Ac),o=t(),n=s(),{getEditedEntityRecord:i,hasEditsForEntityRecord:r}=e(d.store),a=i("postType",o,n);return{shouldOpenModal:!r("postType",o,n)&&""===a.content&&T===o,slug:a.slug,isCustom:a.is_custom,postType:o,postId:n}}),[]);return(0,u.useEffect)((()=>{t(!1)}),[i,r]),!s||e?null:(0,L.jsx)(Ll,{slug:o,isCustom:n,postType:i,onClose:()=>t(!0)})}function Fl(){const e=(0,c.useSelect)((e=>{const{richEditingEnabled:t,codeEditingEnabled:s}=e(Ac).getEditorSettings();return!t||!s}),[]),{getBlockSelectionStart:t}=(0,c.useSelect)(h.store),{getActiveComplementaryArea:s}=(0,c.useSelect)(Ua),{enableComplementaryArea:o,disableComplementaryArea:n}=(0,c.useDispatch)(Ua),{redo:i,undo:r,savePost:a,setIsListViewOpened:l,switchEditorMode:d,toggleDistractionFree:u}=(0,c.useDispatch)(Ac),{isEditedPostDirty:p,isPostSavingLocked:m,isListViewOpened:g,getEditorMode:_}=(0,c.useSelect)(Ac);return(0,vl.useShortcut)("core/editor/toggle-mode",(()=>{d("visual"===_()?"text":"visual")}),{isDisabled:e}),(0,vl.useShortcut)("core/editor/toggle-distraction-free",(()=>{u()})),(0,vl.useShortcut)("core/editor/undo",(e=>{r(),e.preventDefault()})),(0,vl.useShortcut)("core/editor/redo",(e=>{i(),e.preventDefault()})),(0,vl.useShortcut)("core/editor/save",(e=>{e.preventDefault(),m()||p()&&a()})),(0,vl.useShortcut)("core/editor/toggle-list-view",(e=>{g()||(e.preventDefault(),l(!0))})),(0,vl.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}function Vl({clientId:e,onClose:t}){const{getBlocks:s}=(0,c.useSelect)(h.store),{replaceBlocks:o}=(0,c.useDispatch)(h.store);return(0,c.useSelect)((t=>t(h.store).canRemoveBlock(e)),[e])?(0,L.jsx)(Uo.MenuItem,{onClick:()=>{o(e,s(e)),t()},children:(0,fs.__)("Detach")}):null}function zl({clientIds:e,blocks:t}){const[s,o]=(0,u.useState)(!1),{replaceBlocks:n}=(0,c.useDispatch)(h.store),{createSuccessNotice:i}=(0,c.useDispatch)(_s.store),{canCreate:r}=(0,c.useSelect)((e=>({canCreate:e(h.store).canInsertBlockType("core/template-part")})),[]);if(!r)return null;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.MenuItem,{icon:z,onClick:()=>{o(!0)},"aria-expanded":s,"aria-haspopup":"dialog",children:(0,fs.__)("Create template part")}),s&&(0,L.jsx)(Jo,{closeModal:()=>{o(!1)},blocks:t,onCreate:async t=>{n(e,(0,y.createBlock)("core/template-part",{slug:t.slug,theme:t.theme})),i((0,fs.__)("Template part created."),{type:"snackbar"})}})]})}function Ul(){return(0,L.jsx)(h.BlockSettingsMenuControls,{children:({selectedClientIds:e,onClose:t})=>(0,L.jsx)(Hl,{clientIds:e,onClose:t})})}function Hl({clientIds:e,onClose:t}){const{blocks:s}=(0,c.useSelect)((t=>{const{getBlocksByClientId:s}=t(h.store);return{blocks:s(e)}}),[e]);return 1===s.length&&"core/template-part"===s[0]?.name?(0,L.jsx)(Vl,{clientId:e[0],onClose:t}):(0,L.jsx)(zl,{clientIds:e,blocks:s})}const{ExperimentalBlockEditorProvider:Gl}=$(h.privateApis),{PatternsMenuItems:$l}=$(ln.privateApis),Wl=()=>{},Zl=["wp_block","wp_navigation","wp_template_part"];const Yl=Sr((({post:e,settings:t,recovery:s,initialEdits:o,children:n,BlockEditorProviderComponent:i=Gl,__unstableTemplate:r})=>{const a=!!r,{editorSettings:l,selection:p,isReady:g,mode:_,defaultMode:f,postTypeEntities:b}=(0,c.useSelect)((t=>{const{getEditorSettings:s,getEditorSelection:o,getRenderingMode:n,__unstableIsEditorReady:i,getDefaultRenderingMode:r}=$(t(Ac)),{getEntitiesConfig:l}=t(d.store),c=n(),u=r(e.type),p="template-locked"===u?a:void 0!==u,m=void 0!==u;return{editorSettings:s(),isReady:i(),mode:m?c:void 0,defaultMode:p?u:void 0,selection:o(),postTypeEntities:"wp_template"===e.type?l("postType"):null}}),[e.type,a]),x=a&&"post-only"!==_,S=x?r:e,w=(0,u.useMemo)((()=>{const t={};if("wp_template"===e.type){if("page"===e.slug)t.postType="page";else if("single"===e.slug)t.postType="post";else if("single"===e.slug.split("-")[0]){const s=b?.map((e=>e.name))||[],o=e.slug.match(`^single-(${s.join("|")})(?:-.+)?$`);o&&(t.postType=o[1])}}else Zl.includes(S.type)&&!x||(t.postId=e.id,t.postType=e.type);return{...t,templateSlug:"wp_template"===S.type?S.slug:void 0}}),[x,e.id,e.type,e.slug,S.type,S.slug,b]),{id:C,type:P}=S,j=ta(l,P,C,_),[E,N,D]=function(e,t,s){const o="template-locked"===s?"template":"post",[n,i,r]=(0,d.useEntityBlockEditor)("postType",e.type,{id:e.id}),[a,l,c]=(0,d.useEntityBlockEditor)("postType",t?.type,{id:t?.id}),p=(0,u.useMemo)((()=>{if("wp_navigation"===e.type)return[(0,y.createBlock)("core/navigation",{ref:e.id,templateLock:!1})]}),[e.type,e.id]),m=(0,u.useMemo)((()=>p||("template"===o?a:n)),[p,o,a,n]);return t&&"template-locked"===s||"wp_navigation"===e.type?[m,Wl,Wl]:[m,"post"===o?i:l,"post"===o?r:c]}(e,r,_),{updatePostLock:A,setupEditor:R,updateEditorSettings:M,setCurrentTemplateId:O,setEditedPost:F,setRenderingMode:V}=$((0,c.useDispatch)(Ac)),{createWarningNotice:z}=(0,c.useDispatch)(_s.store);return(0,u.useLayoutEffect)((()=>{s||(A(t.postLock),R(e,o,t.template),t.autosave&&z((0,fs.__)("There is an autosave of this post that is more recent than the version below."),{id:"autosave-exists",actions:[{label:(0,fs.__)("View the autosave"),url:t.autosave.editLink}]}))}),[]),(0,u.useEffect)((()=>{F(e.type,e.id)}),[e.type,e.id,F]),(0,u.useEffect)((()=>{M(t)}),[t,M]),(0,u.useEffect)((()=>{O(r?.id)}),[r?.id,O]),(0,u.useEffect)((()=>{f&&V(f)}),[f,V]),function(e,t){(0,u.useEffect)((()=>((0,m.addFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter",((s,o)=>!(!ra.includes(e)&&"core/template-part"===o.name&&"post-only"===t)&&s)),(0,m.addFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter",((t,s,o,{getBlockParentsByBlockName:n})=>ra.includes(e)||"core/post-content"!==s.name?t:n(o,"core/query").length>0)),()=>{(0,m.removeFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter"),(0,m.removeFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter")})),[e,t])}(e.type,_),(0,ya.useCommandLoader)({name:"core/editor/edit-ui",hook:function(){const{editorMode:e,isListViewOpen:t,showBlockBreadcrumbs:s,isDistractionFree:o,isFocusMode:n,isPreviewMode:i,isViewable:r,isCodeEditingEnabled:a,isRichEditingEnabled:l,isPublishSidebarEnabled:u}=(0,c.useSelect)((e=>{var t,s;const{get:o}=e(k.store),{isListViewOpened:n,getCurrentPostType:i,getEditorSettings:r}=e(Ac),{getSettings:a}=e(h.store),{getPostType:l}=e(d.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"),isPreviewMode:a().isPreviewMode,isViewable:null!==(s=l(i())?.viewable)&&void 0!==s&&s,isCodeEditingEnabled:r().codeEditingEnabled,isRichEditingEnabled:r().richEditingEnabled,isPublishSidebarEnabled:e(Ac).isPublishSidebarEnabled()}}),[]),{getActiveComplementaryArea:p}=(0,c.useSelect)(Ua),{toggle:m}=(0,c.useDispatch)(k.store),{createInfoNotice:g}=(0,c.useDispatch)(_s.store),{__unstableSaveForPreview:_,setIsListViewOpened:f,switchEditorMode:b,toggleDistractionFree:y,toggleSpotlightMode:x,toggleTopToolbar:S}=(0,c.useDispatch)(Ac),{openModal:w,enableComplementaryArea:C,disableComplementaryArea:P}=(0,c.useDispatch)(Ua),{getCurrentPostId:j}=(0,c.useSelect)(Ac),{isBlockBasedTheme:E,canCreateTemplate:T}=(0,c.useSelect)((e=>({isBlockBasedTheme:e(d.store).getCurrentTheme()?.is_block_theme,canCreateTemplate:e(d.store).canUser("create",{kind:"postType",name:"wp_template"})})),[]),B=a&&l;if(i)return{commands:[],isLoading:!1};const I=[];if(I.push({name:"core/open-shortcut-help",label:(0,fs.__)("Keyboard shortcuts"),icon:aa,callback:({close:e})=>{e(),w("editor/keyboard-shortcut-help")}}),I.push({name:"core/toggle-distraction-free",label:o?(0,fs.__)("Exit Distraction free"):(0,fs.__)("Enter Distraction free"),callback:({close:e})=>{y(),e()}}),I.push({name:"core/open-preferences",label:(0,fs.__)("Editor preferences"),callback:({close:e})=>{e(),w("editor/preferences")}}),I.push({name:"core/toggle-spotlight-mode",label:n?(0,fs.__)("Exit Spotlight mode"):(0,fs.__)("Enter Spotlight mode"),callback:({close:e})=>{x(),e()}}),I.push({name:"core/toggle-list-view",label:t?(0,fs.__)("Close List View"):(0,fs.__)("Open List View"),icon:la,callback:({close:e})=>{f(!t),e(),g(t?(0,fs.__)("List View off."):(0,fs.__)("List View on."),{id:"core/editor/toggle-list-view/notice",type:"snackbar"})}}),I.push({name:"core/toggle-top-toolbar",label:(0,fs.__)("Top toolbar"),callback:({close:e})=>{S(),e()}}),B&&I.push({name:"core/toggle-code-editor",label:"visual"===e?(0,fs.__)("Open code editor"):(0,fs.__)("Exit code editor"),icon:ca,callback:({close:t})=>{b("visual"===e?"text":"visual"),t()}}),I.push({name:"core/toggle-breadcrumbs",label:s?(0,fs.__)("Hide block breadcrumbs"):(0,fs.__)("Show block breadcrumbs"),callback:({close:e})=>{m("core","showBlockBreadcrumbs"),e(),g(s?(0,fs.__)("Breadcrumbs hidden."):(0,fs.__)("Breadcrumbs visible."),{id:"core/editor/toggle-breadcrumbs/notice",type:"snackbar"})}}),I.push({name:"core/open-settings-sidebar",label:(0,fs.__)("Show or hide the Settings panel."),icon:(0,fs.isRTL)()?da:ua,callback:({close:e})=>{const t=p("core");e(),"edit-post/document"===t?P("core"):C("core","edit-post/document")}}),I.push({name:"core/open-block-inspector",label:(0,fs.__)("Show or hide the Block settings panel"),icon:pa,callback:({close:e})=>{const t=p("core");e(),"edit-post/block"===t?P("core"):C("core","edit-post/block")}}),I.push({name:"core/toggle-publish-sidebar",label:u?(0,fs.__)("Disable pre-publish checks"):(0,fs.__)("Enable pre-publish checks"),icon:ma,callback:({close:e})=>{e(),m("core","isPublishSidebarEnabled"),g(u?(0,fs.__)("Pre-publish checks disabled."):(0,fs.__)("Pre-publish checks enabled."),{id:"core/editor/publish-sidebar/notice",type:"snackbar"})}}),r&&I.push({name:"core/preview-link",label:(0,fs.__)("Preview in a new tab"),icon:Fo,callback:async({close:e})=>{e();const t=j(),s=await _();window.open(s,`wp-preview-${t}`)}}),T&&E){const e=(0,v.getPath)(window.location.href)?.includes("site-editor.php");e||I.push({name:"core/go-to-site-editor",label:(0,fs.__)("Open Site Editor"),callback:({close:e})=>{e(),document.location="site-editor.php"}})}return{commands:I,isLoading:!1}}}),(0,ya.useCommandLoader)({name:"core/editor/contextual-commands",hook:function(){const{postType:e}=(0,c.useSelect)((e=>{const{getCurrentPostType:t}=e(Ac);return{postType:t()}}),[]),{openModal:t}=(0,c.useDispatch)(Ua),s=[];return e===I&&(s.push({name:"core/rename-pattern",label:(0,fs.__)("Rename pattern"),icon:ha,callback:({close:e})=>{t(cl),e()}}),s.push({name:"core/duplicate-pattern",label:(0,fs.__)("Duplicate pattern"),icon:ga,callback:({close:e})=>{t(pl),e()}})),{isLoading:!1,commands:s}},context:"entity-edit"}),(0,ya.useCommandLoader)({name:"core/editor/page-content-focus",hook:function(){const{onNavigateToEntityRecord:e,goBack:t,templateId:s,isPreviewMode:o}=(0,c.useSelect)((e=>{const{getRenderingMode:t,getEditorSettings:s,getCurrentTemplateId:o}=$(e(Ac)),n=s();return{isTemplateHidden:"post-only"===t(),onNavigateToEntityRecord:n.onNavigateToEntityRecord,getEditorSettings:s,goBack:n.onNavigateToPreviousEntityRecord,templateId:o(),isPreviewMode:n.isPreviewMode}}),[]),{editedRecord:n,hasResolved:i}=(0,d.useEntityRecord)("postType","wp_template",s);if(o)return{isLoading:!1,commands:[]};const r=[];return s&&i&&r.push({name:"core/switch-to-template-focus",label:(0,fs.sprintf)((0,fs.__)("Edit template: %s"),(0,Lo.decodeEntities)(n.title)),icon:W,callback:({close:t})=>{e({postId:s,postType:"wp_template"}),t()}}),t&&r.push({name:"core/switch-to-previous-entity",label:(0,fs.__)("Go back"),icon:_a,callback:({close:e})=>{t(),e()}}),{isLoading:!1,commands:r}},context:"entity-edit"}),(0,ya.useCommandLoader)({name:"core/edit-site/manipulate-document",hook:function(){const{postType:e,postId:t}=(0,c.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s}=e(Ac);return{postType:s(),postId:t()}}),[]),{editedRecord:s,hasResolved:o}=(0,d.useEntityRecord)("postType",e,t),{revertTemplate:n}=$((0,c.useDispatch)(Ac));if(!o||![B,T].includes(e))return{isLoading:!0,commands:[]};const i=[];if(Oo(s)){const e=s.type===T?(0,fs.sprintf)((0,fs.__)("Reset template: %s"),(0,Lo.decodeEntities)(s.title)):(0,fs.sprintf)((0,fs.__)("Reset template part: %s"),(0,Lo.decodeEntities)(s.title));i.push({name:"core/reset-template",label:e,icon:(0,fs.isRTL)()?fa:ba,callback:({close:e})=>{n(s),e()}})}return{isLoading:!o,commands:i}}}),g&&_?(0,L.jsx)(d.EntityProvider,{kind:"root",type:"site",children:(0,L.jsx)(d.EntityProvider,{kind:"postType",type:e.type,id:e.id,children:(0,L.jsx)(h.BlockContextProvider,{value:w,children:(0,L.jsxs)(i,{value:E,onChange:D,onInput:N,selection:p,settings:j,useSubRegistry:!1,children:[n,!t.isPreviewMode&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)($l,{}),(0,L.jsx)(Ul,{}),(0,L.jsx)(Al,{}),"template-locked"===_&&(0,L.jsx)(na,{}),"wp_navigation"===P&&(0,L.jsx)(ia,{}),(0,L.jsx)(Fl,{}),(0,L.jsx)(Il,{}),(0,L.jsx)(fl,{}),(0,L.jsx)(xl,{}),(0,L.jsx)(Ol,{}),(0,L.jsx)(dl,{}),(0,L.jsx)(ml,{})]})]})})})}):null}));function Kl(e){return(0,L.jsx)(Yl,{...e,BlockEditorProviderComponent:h.BlockEditorProvider,children:e.children})}const ql=Kl,{useGlobalStyle:Ql}=$(h.privateApis);function Xl({template:e,post:t}){const[s="white"]=Ql("color.background"),[o]=(0,d.useEntityBlockEditor)("postType",t.type,{id:t.id}),[n]=(0,d.useEntityBlockEditor)("postType",e?.type,{id:e?.id}),i=e&&n?n:o,r=!i?.length;return(0,L.jsxs)("div",{className:"editor-fields-content-preview",style:{backgroundColor:s},children:[r&&(0,L.jsx)("span",{className:"editor-fields-content-preview__empty",children:(0,fs.__)("Empty content")}),!r&&(0,L.jsx)(h.BlockPreview.Async,{children:(0,L.jsx)(h.BlockPreview,{blocks:i})})]})}const Jl={type:"media",id:"content-preview",label:(0,fs.__)("Content preview"),render:function({item:e}){const{settings:t,template:s}=(0,c.useSelect)((t=>{var s;const{canUser:o,getPostType:n,getTemplateId:i,getEntityRecord:r}=$(t(d.store)),a=o("read",{kind:"postType",name:"wp_template"}),l=t(Ac).getEditorSettings(),c=l.supportsTemplateMode,u=null!==(s=n(e.type)?.viewable)&&void 0!==s&&s,p=c&&u&&a?i(e.type,e.id):null;return{settings:l,template:p?r("postType","wp_template",p):void 0}}),[e.type,e.id]);return(0,L.jsx)(Kl,{post:e,settings:t,__unstableTemplate:s,children:(0,L.jsx)(Xl,{template:s,post:e})})},enableSorting:!1},ec=Jl;function tc(e,t,s){return{type:"REGISTER_ENTITY_ACTION",kind:e,name:t,config:s}}function sc(e,t,s){return{type:"UNREGISTER_ENTITY_ACTION",kind:e,name:t,actionId:s}}function oc(e,t,s){return{type:"REGISTER_ENTITY_FIELD",kind:e,name:t,config:s}}function nc(e,t,s){return{type:"UNREGISTER_ENTITY_FIELD",kind:e,name:t,fieldId:s}}function ic(e,t){return{type:"SET_IS_READY",kind:e,name:t}}const rc=e=>async({registry:t})=>{if($(t.select(Ac)).isEntityReady("postType",e))return;$(t.dispatch(Ac)).setIsReady("postType",e);const s=await t.resolveSelect(d.store).getPostType(e),o=await t.resolveSelect(d.store).canUser("create",{kind:"postType",name:e}),n=await t.resolveSelect(d.store).getCurrentTheme(),i=[s.viewable?Vo:void 0,s.supports?.revisions?zo:void 0,void 0,"wp_template_part"===s.slug&&o&&n?.is_block_theme?an:void 0,o&&"wp_block"===s.slug?hn:void 0,s.supports?.title?fn:void 0,s.supports?.["page-attributes"]?Fn:void 0,"wp_block"===s.slug?mi:void 0,gi,bi,wi,Ci,ji].filter(Boolean),r=[s.supports?.thumbnail&&n?.theme_supports?.["post-thumbnails"]&&Ii,s.supports?.author&&Li,$i,Yi,er,s.supports?.["page-attributes"]&&rr,s.supports?.comments&&ar,dr,ur,s.supports?.editor&&s.viewable&&ec].filter(Boolean);if(s.supports?.title){let t;t="page"===e?gr:"wp_template"===e?_r:"wp_block"===e?xr:vr,r.push(t)}t.batch((()=>{i.forEach((s=>{$(t.dispatch(Ac)).registerEntityAction("postType",e,s)})),r.forEach((s=>{$(t.dispatch(Ac)).registerEntityField("postType",e,s)}))})),(0,m.doAction)("core.registerPostTypeSchema",e)};function ac(e){return{type:"SET_CURRENT_TEMPLATE_ID",id:e}}const lc=e=>async({select:t,dispatch:s,registry:o})=>{const n=await o.dispatch(d.store).saveEntityRecord("postType","wp_template",e);return o.dispatch(d.store).editEntityRecord("postType",t.getCurrentPostType(),t.getCurrentPostId(),{template:n.slug}),o.dispatch(_s.store).createSuccessNotice((0,fs.__)("Custom template created. You're in template mode now."),{type:"snackbar",actions:[{label:(0,fs.__)("Go back"),onClick:()=>s.setRenderingMode(t.getEditorSettings().defaultRenderingMode)}]}),n},cc=e=>({registry:t})=>{var s;const o=(null!==(s=t.select(k.store).get("core","hiddenBlockTypes"))&&void 0!==s?s:[]).filter((t=>!(Array.isArray(e)?e:[e]).includes(t)));t.dispatch(k.store).set("core","hiddenBlockTypes",o)},dc=e=>({registry:t})=>{var s;const o=null!==(s=t.select(k.store).get("core","hiddenBlockTypes"))&&void 0!==s?s:[],n=new Set([...o,...Array.isArray(e)?e:[e]]);t.dispatch(k.store).set("core","hiddenBlockTypes",[...n])},uc=({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(d.store).getEntityRecord("root","__unstableBase")?.home;n.dispatch(_s.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=[],u=[];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(d.store).editEntityRecord(e,t,s,{status:"publish"}),u.push(n.dispatch(d.store).saveEditedEntityRecord(e,t,s)))})),c.length&&u.push(n.dispatch(d.store).__experimentalSaveSpecifiedEntityEdits("root","site",void 0,c)),n.dispatch(h.store).__unstableMarkLastChangeAsPersistent(),Promise.all(u).then((t=>e?e(t):t)).then((e=>{e.some((e=>void 0===e))?n.dispatch(_s.store).createErrorNotice((0,fs.__)("Saving failed.")):n.dispatch(_s.store).createSuccessNotice((0,fs.__)("Site updated."),{type:"snackbar",id:r,actions:[{label:(0,fs.__)("View site"),url:a}]})})).catch((e=>n.dispatch(_s.store).createErrorNotice(`${(0,fs.__)("Saving failed.")} ${e}`)))},pc=(e,{allowUndo:t=!0}={})=>async({registry:s})=>{const o="edit-site-template-reverted";if(s.dispatch(_s.store).removeNotice(o),Oo(e))try{const n=s.select(d.store).getEntityConfig("postType",e.type);if(!n)return void s.dispatch(_s.store).createErrorNotice((0,fs.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const i=(0,v.addQueryArgs)(`${n.baseURL}/${e.id}`,{context:"edit",source:e.origin}),r=await gs()({path:i});if(!r)return void s.dispatch(_s.store).createErrorNotice((0,fs.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const a=({blocks:e=[]})=>(0,y.__unstableSerializeAndClean)(e),l=s.select(d.store).getEditedEntityRecord("postType",e.type,e.id);s.dispatch(d.store).editEntityRecord("postType",e.type,e.id,{content:a,blocks:l.blocks,source:"custom"},{undoIgnore:!0});const c=(0,y.parse)(r?.content?.raw);if(s.dispatch(d.store).editEntityRecord("postType",e.type,r.id,{content:a,blocks:c,source:"theme"}),t){const t=()=>{s.dispatch(d.store).editEntityRecord("postType",e.type,l.id,{content:a,blocks:l.blocks,source:"custom"})};s.dispatch(_s.store).createSuccessNotice((0,fs.__)("Template reset."),{type:"snackbar",id:o,actions:[{label:(0,fs.__)("Undo"),onClick:t}]})}}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("Template revert failed. Please reload.");s.dispatch(_s.store).createErrorNotice(t,{type:"snackbar"})}else s.dispatch(_s.store).createErrorNotice((0,fs.__)("This template is not revertable."),{type:"snackbar"})},mc=e=>async({registry:t})=>{const s=e.every((e=>e?.has_theme_file)),o=await Promise.allSettled(e.map((e=>t.dispatch(d.store).deleteEntityRecord("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(o.every((({status:e})=>"fulfilled"===e))){let o;if(1===e.length){let t;"string"==typeof e[0].title?t=e[0].title:"string"==typeof e[0].title?.rendered?t=e[0].title?.rendered:"string"==typeof e[0].title?.raw&&(t=e[0].title?.raw),o=s?(0,fs.sprintf)((0,fs.__)('"%s" reset.'),(0,Lo.decodeEntities)(t)):(0,fs.sprintf)((0,fs._x)('"%s" deleted.',"template part"),(0,Lo.decodeEntities)(t))}else o=s?(0,fs.__)("Items reset."):(0,fs.__)("Items deleted.");t.dispatch(_s.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,fs.__)("An error occurred while reverting the item."):(0,fs.__)("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,fs.__)("An error occurred while deleting the items."):1===t.size?s?(0,fs.sprintf)((0,fs.__)("An error occurred while reverting the items: %s"),[...t][0]):(0,fs.sprintf)((0,fs.__)("An error occurred while deleting the items: %s"),[...t][0]):s?(0,fs.sprintf)((0,fs.__)("Some errors occurred while reverting the items: %s"),[...t].join(",")):(0,fs.sprintf)((0,fs.__)("Some errors occurred while deleting the items: %s"),[...t].join(","))}t.dispatch(_s.store).createErrorNotice(e,{type:"snackbar"})}},hc=e=>({select:t,registry:s})=>{var o;const n=t.getCurrentPostType(),i=s.select(d.store).getCurrentTheme()?.stylesheet,r=null!==(o=s.select(k.store).get("core","renderingModes")?.[i])&&void 0!==o?o:{};if(r[n]===e)return;const a={[i]:{...r,[n]:e}};s.dispatch(k.store).set("core","renderingModes",a)};var gc=s(5215),_c=s.n(gc);const fc=(0,L.jsx)(M.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,L.jsx)(M.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"})}),bc=(0,L.jsx)(M.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,L.jsx)(M.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"})}),yc=[];const xc={rootClientId:void 0,insertionIndex:void 0,filterValue:void 0},vc=["post-only","template-locked"],Sc=(0,c.createRegistrySelector)((e=>(0,c.createSelector)((t=>{if("object"==typeof t.blockInserterPanel)return t.blockInserterPanel;if("template-locked"===st(t)){const[t]=e(h.store).getBlocksByName("core/post-content");if(t)return{rootClientId:t,insertionIndex:void 0,filterValue:void 0}}return xc}),(t=>{const[s]=e(h.store).getBlocksByName("core/post-content");return[t.blockInserterPanel,st(t),s]}))));function wc(e){return e.listViewToggleRef}function kc(e){return e.inserterSidebarToggleRef}const Cc={wp_block:ga,wp_navigation:fc,page:_a,post:bc},Pc=(0,c.createRegistrySelector)((e=>(t,s,o)=>{{if("wp_template_part"===s||"wp_template"===s){const t=(e(d.store).getCurrentTheme()?.default_template_part_areas||[]).find((e=>o.area===e.area));return t?.icon?U(t.icon):W}if(Cc[s])return Cc[s];const t=e(d.store).getPostType(s);return"string"==typeof t?.icon&&t.icon.startsWith("dashicons-")?t.icon.slice(10):_a}})),jc=(0,c.createRegistrySelector)((e=>(t,s,o)=>{const{type:n,id:i}=oe(t),r=e(d.store).getEntityRecordNonTransientEdits("postType",s||n,o||i);if(!r?.meta)return!1;const a=e(d.store).getEntityRecord("postType",s||n,o||i)?.meta;return!_c()({...a,footnotes:void 0},{...r.meta,footnotes:void 0})}));function Ec(e,...t){return function(e,t,s){var o;return null!==(o=e.actions[t]?.[s])&&void 0!==o?o:yc}(e.dataviews,...t)}function Tc(e,...t){return function(e,t,s){return e.isReady[t]?.[s]}(e.dataviews,...t)}function Bc(e,...t){return function(e,t,s){var o;return null!==(o=e.fields[t]?.[s])&&void 0!==o?o:yc}(e.dataviews,...t)}const Ic=(0,c.createRegistrySelector)((e=>(0,c.createSelector)(((t,s)=>{s=Array.isArray(s)?s:[s];const{getBlocksByName:o,getBlockParents:n,getBlockName:i}=e(h.store);return o(s).filter((e=>n(e).every((e=>{const t=i(e);return"core/query"!==t&&!s.includes(t)}))))}),(()=>[e(h.store).getBlocks()])))),Nc=(0,c.createRegistrySelector)((e=>(t,s)=>{const{getPostType:o,getCurrentTheme:n,hasFinishedResolution:i}=e(d.store),r=n(),a=o(s);if(!i("getPostType",[s])||!i("getCurrentTheme"))return;const l=r?.stylesheet,c=e(k.store).get("core","renderingModes")?.[l]?.[s],u=Array.isArray(a?.supports?.editor)?a.supports.editor.find((e=>"default-mode"in e))?.["default-mode"]:void 0,p=c||u;return vc.includes(p)?p:"post-only"})),Dc={reducer:b,selectors:e,actions:t},Ac=(0,c.createReduxStore)("core/editor",{...Dc});(0,c.register)(Ac),$(Ac).registerPrivateActions(a),$(Ac).registerPrivateSelectors(l);function Rc(e){const t=e.avatar_urls&&e.avatar_urls[24]?(0,L.jsx)("img",{className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls[24]}):(0,L.jsx)("span",{className:"editor-autocompleters__no-avatar"});return(0,L.jsxs)(L.Fragment,{children:[t,(0,L.jsx)("span",{className:"editor-autocompleters__user-name",children:e.name}),(0,L.jsx)("span",{className:"editor-autocompleters__user-slug",children:e.slug})]})}(0,m.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,p.createHigherOrderComponent)((t=>({attributes:s,setAttributes:o,...n})=>{const i=(0,c.useSelect)((e=>e(Ac).getCurrentPostType()),[]),[r,a]=(0,d.useEntityProp)("postType",i,"meta"),l=(0,u.useMemo)((()=>({...s,...Object.fromEntries(Object.entries(e).map((([e,t])=>[e,r[t]])))})),[s,r]);return(0,L.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 Mc={name:"users",className:"editor-autocompleters__user",triggerPrefix:"@",useItems(e){const t=(0,c.useSelect)((t=>{const{getUsers:s}=t(d.store);return s({context:"view",search:encodeURIComponent(e)})}),[e]),s=(0,u.useMemo)((()=>t?t.map((e=>({key:`user-${e.slug}`,value:e,label:Rc(e)}))):[]),[t]);return[s]},getOptionCompletion:e=>`@${e.slug}`};(0,m.addFilter)("editor.Autocomplete.completers","editor/autocompleters/set-default-completers",(function(e=[]){return e.push({...Mc}),e})),(0,m.addFilter)("editor.MediaUpload","core/editor/components/media-upload",(()=>Ei.MediaUpload));const{PatternOverridesControls:Lc,ResetOverridesControl:Oc,PatternOverridesBlockControls:Fc,PATTERN_TYPES:Vc,PARTIAL_SYNCING_SUPPORTED_BLOCKS:zc,PATTERN_SYNC_TYPES:Uc}=$(ln.privateApis),Hc=(0,p.createHigherOrderComponent)((e=>t=>{const s=!!zc[t.name];return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(e,{...t},"edit"),t.isSelected&&s&&(0,L.jsx)(Gc,{...t}),s&&(0,L.jsx)(Fc,{})]})}),"withPatternOverrideControls");function Gc(e){const t=(0,h.useBlockEditingMode)(),{hasPatternOverridesSource:s,isEditingSyncedPattern:o}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getEditedPostAttribute:s}=e(Ac);return{hasPatternOverridesSource:!!(0,y.getBlockBindingsSource)("core/pattern-overrides"),isEditingSyncedPattern:t()===Vc.user&&s("meta")?.wp_pattern_sync_status!==Uc.unsynced&&s("wp_pattern_sync_status")!==Uc.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,L.jsxs)(L.Fragment,{children:[r&&(0,L.jsx)(Lc,{...e}),a&&(0,L.jsx)(Oc,{...e})]}):null}(0,m.addFilter)("editor.BlockEdit","core/editor/with-pattern-override-controls",Hc);class $c extends u.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 Wc=(0,p.compose)([(0,c.withSelect)(((e,t)=>{const{getReferenceByDistinctEdits:s}=e(d.store),{isEditedPostDirty:o,isEditedPostAutosaveable:n,isAutosavingPost:i,getEditorSettings:r}=e(Ac),{interval:a=r().autosaveInterval}=t;return{editsReference:s(),isDirty:o(),isAutosaveable:n(),isAutosaving:i(),interval:a}})),(0,c.withDispatch)(((e,t)=>({autosave(){const{autosave:s=e(Ac).autosave}=t;s()}})))])($c),Zc=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})}),Yc=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})}),Kc=window.wp.dom;function qc(e){const{isFrontPage:t,isPostsPage:s}=(0,c.useSelect)((t=>{const{canUser:s,getEditedEntityRecord:o}=t(d.store),n=s("read",{kind:"root",name:"site"})?o("root","site"):void 0,i=parseInt(e,10);return{isFrontPage:n?.page_on_front===i,isPostsPage:n?.page_for_posts===i}}));return t?(0,fs.__)("Homepage"):!!s&&(0,fs.__)("Posts Page")}const Qc=(0,Uo.__unstableMotion)(Uo.Button);function Xc(e){const{postId:t,postType:s,postTypeLabel:o,documentTitle:n,isNotFound:i,templateTitle:r,onNavigateToPreviousEntityRecord:a,isTemplatePreview:l}=(0,c.useSelect)((e=>{var t;const{getCurrentPostType:s,getCurrentPostId:o,getEditorSettings:n,getRenderingMode:i}=e(Ac),{getEditedEntityRecord:r,getPostType:a,getCurrentTheme:l,isResolving:c}=e(d.store),u=s(),p=o(),m=r("postType",u,p),{default_template_types:h=[]}=null!==(t=l())&&void 0!==t?t:{},g=Y({templateTypes:h,template:m}),_=a(u)?.labels?.singular_name;return{postId:p,postType:u,postTypeLabel:_,documentTitle:m.title,isNotFound:!m&&!c("getEditedEntityRecord","postType",u,p),templateTitle:g.title,onNavigateToPreviousEntityRecord:n().onNavigateToPreviousEntityRecord,isTemplatePreview:"template-locked"===i()}}),[]),{open:m}=(0,c.useDispatch)(ya.store),g=(0,p.useReducedMotion)(),_=A.includes(s),f=!!a,b=_?r:n,y=e.title||b,x=e.icon,v=qc(t),S=(0,u.useRef)(!1);return(0,u.useEffect)((()=>{S.current=!0}),[]),(0,L.jsxs)("div",{className:Di("editor-document-bar",{"has-back-button":f}),children:[(0,L.jsx)(Uo.__unstableAnimatePresence,{children:f&&(0,L.jsx)(Qc,{className:"editor-document-bar__back",icon:(0,fs.isRTL)()?Zc:Yc,onClick:e=>{e.stopPropagation(),a()},size:"compact",initial:!!S.current&&{opacity:0,transform:"translateX(15%)"},animate:{opacity:1,transform:"translateX(0%)"},exit:{opacity:0,transform:"translateX(15%)"},transition:g?{duration:0}:void 0,children:(0,fs.__)("Back")})}),!_&&l&&(0,L.jsx)(h.BlockIcon,{icon:W,className:"editor-document-bar__icon-layout"}),i?(0,L.jsx)(Uo.__experimentalText,{children:(0,fs.__)("Document not found")}):(0,L.jsxs)(Uo.Button,{className:"editor-document-bar__command",onClick:()=>m(),size:"compact",children:[(0,L.jsxs)(Uo.__unstableMotion.div,{className:"editor-document-bar__title",initial:!!S.current&&{opacity:0,transform:f?"translateX(15%)":"translateX(-15%)"},animate:{opacity:1,transform:"translateX(0%)"},transition:g?{duration:0}:void 0,children:[x&&(0,L.jsx)(h.BlockIcon,{icon:x}),(0,L.jsxs)(Uo.__experimentalText,{size:"body",as:"h1",children:[(0,L.jsx)("span",{className:"editor-document-bar__post-title",children:y?(0,Kc.__unstableStripHTML)(y):(0,fs.__)("No title")}),v&&(0,L.jsx)("span",{className:"editor-document-bar__post-type-label",children:`· ${v}`}),o&&!e.title&&!v&&(0,L.jsx)("span",{className:"editor-document-bar__post-type-label",children:`· ${(0,Lo.decodeEntities)(o)}`})]})]},f),(0,L.jsx)("span",{className:"editor-document-bar__shortcut",children:wl.displayShortcut.primary("k")})]})]})}const Jc=window.wp.richText,ed=({children:e,isValid:t,isDisabled:s,level:o,href:n,onSelect:i})=>(0,L.jsx)("li",{className:Di("document-outline__item",`is-${o.toLowerCase()}`,{"is-invalid":!t,"is-disabled":s}),children:(0,L.jsxs)("a",{href:n,className:"document-outline__button","aria-disabled":s,onClick:function(e){s?e.preventDefault():i()},children:[(0,L.jsx)("span",{className:"document-outline__emdash","aria-hidden":"true"}),(0,L.jsx)("strong",{className:"document-outline__level",children:o}),(0,L.jsx)("span",{className:"document-outline__item-content",children:e})]})}),td=(0,L.jsx)("em",{children:(0,fs.__)("(Empty heading)")}),sd=[(0,L.jsx)("br",{},"incorrect-break"),(0,L.jsx)("em",{children:(0,fs.__)("(Incorrect heading level)")},"incorrect-message")],od=[(0,L.jsx)("br",{},"incorrect-break-h1"),(0,L.jsx)("em",{children:(0,fs.__)("(Your theme may already use a H1 for the post title)")},"incorrect-message-h1")],nd=[(0,L.jsx)("br",{},"incorrect-break-multiple-h1"),(0,L.jsx)("em",{children:(0,fs.__)("(Multiple H1 headings are not recommended)")},"incorrect-message-multiple-h1")];function id(){return(0,L.jsxs)(Uo.SVG,{width:"138",height:"148",viewBox:"0 0 138 148",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,L.jsx)(Uo.Rect,{width:"138",height:"148",rx:"4",fill:"#F0F6FC"}),(0,L.jsx)(Uo.Line,{x1:"44",y1:"28",x2:"24",y2:"28",stroke:"#DDDDDD"}),(0,L.jsx)(Uo.Rect,{x:"48",y:"16",width:"27",height:"23",rx:"4",fill:"#DDDDDD"}),(0,L.jsx)(Uo.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,L.jsx)(Uo.Line,{x1:"55",y1:"59",x2:"24",y2:"59",stroke:"#DDDDDD"}),(0,L.jsx)(Uo.Rect,{x:"59",y:"47",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,L.jsx)(Uo.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,L.jsx)(Uo.Line,{x1:"80",y1:"90",x2:"24",y2:"90",stroke:"#DDDDDD"}),(0,L.jsx)(Uo.Rect,{x:"84",y:"78",width:"30",height:"23",rx:"4",fill:"#F0B849"}),(0,L.jsx)(Uo.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,L.jsx)(Uo.Line,{x1:"66",y1:"121",x2:"24",y2:"121",stroke:"#DDDDDD"}),(0,L.jsx)(Uo.Rect,{x:"70",y:"109",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,L.jsx)(Uo.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 rd=(e=[])=>e.filter((e=>"core/heading"===e.name)).map((e=>({...e,level:e.attributes.level,isEmpty:ad(e)}))),ad=e=>!e.attributes.content||0===e.attributes.content.trim().length;function ld({onSelect:e,hasOutlineItemsDisabled:t}){const{selectBlock:s}=(0,c.useDispatch)(h.store),{title:o,isTitleSupported:n}=(0,c.useSelect)((e=>{var t;const{getEditedPostAttribute:s}=e(Ac),{getPostType:o}=e(d.store),n=o(s("type"));return{title:s("title"),isTitleSupported:null!==(t=n?.supports?.title)&&void 0!==t&&t}})),i=(0,c.useSelect)((e=>{const{getClientIdsWithDescendants:t,getBlock:s}=e(h.store);return t().map((e=>s(e)))})),r=(0,c.useSelect)((e=>{if("post-only"===e(Ac).getRenderingMode())return;const{getBlocksByName:t,getClientIdsOfDescendants:s}=e(h.store),[o]=t("core/post-content");return o?s(o):void 0}),[]),a=(0,u.useRef)(1),l=(0,u.useMemo)((()=>rd(i)),[i]);if(l.length<1)return(0,L.jsxs)("div",{className:"editor-document-outline has-no-headings",children:[(0,L.jsx)(id,{}),(0,L.jsx)("p",{children:(0,fs.__)("Navigate the structure of your document and address issues like empty or incorrect heading levels.")})]});const p=document.querySelector(".editor-post-title__input"),m=n&&o&&p,g=l.reduce(((e,t)=>({...e,[t.level]:(e[t.level]||0)+1})),{})[1]>1;return(0,L.jsx)("div",{className:"document-outline",children:(0,L.jsxs)("ul",{children:[m&&(0,L.jsx)(ed,{level:(0,fs.__)("Title"),isValid:!0,onSelect:e,href:`#${p.id}`,isDisabled:t,children:o}),l.map((o=>{const n=o.level>a.current+1,i=!(o.isEmpty||n||!o.level||1===o.level&&(g||m));return a.current=o.level,(0,L.jsxs)(ed,{level:`H${o.level}`,isValid:i,isDisabled:t||(l=o.clientId,!(!Array.isArray(r)||r.includes(l))),href:`#block-${o.clientId}`,onSelect:()=>{s(o.clientId),e?.()},children:[o.isEmpty?td:(0,Jc.getTextContent)((0,Jc.create)({html:o.attributes.content})),n&&sd,1===o.level&&g&&nd,m&&1===o.level&&!g&&od]},o.clientId);var l}))]})})}function cd({children:e}){const t=(0,c.useSelect)((e=>{const{getGlobalBlockCount:t}=e(h.store);return t("core/heading")>0}));return t?e:null}const dd=function(){const{registerShortcut:e}=(0,c.useDispatch)(vl.store);return(0,u.useEffect)((()=>{e({name:"core/editor/toggle-mode",category:"global",description:(0,fs.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}}),e({name:"core/editor/save",category:"global",description:(0,fs.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/editor/undo",category:"global",description:(0,fs.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/editor/redo",category:"global",description:(0,fs.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,wl.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/editor/toggle-list-view",category:"global",description:(0,fs.__)("Show or hide the List View."),keyCombination:{modifier:"access",character:"o"}}),e({name:"core/editor/toggle-distraction-free",category:"global",description:(0,fs.__)("Enter or exit distraction free mode."),keyCombination:{modifier:"primaryShift",character:"\\"}}),e({name:"core/editor/toggle-sidebar",category:"global",description:(0,fs.__)("Show or hide the Settings panel."),keyCombination:{modifier:"primaryShift",character:","}}),e({name:"core/editor/keyboard-shortcuts",category:"main",description:(0,fs.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/editor/next-region",category:"global",description:(0,fs.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/editor/previous-region",category:"global",description:(0,fs.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]})}),[e]),(0,L.jsx)(h.BlockEditorKeyboardShortcuts.Register,{})},ud=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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"})}),pd=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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 md=(0,u.forwardRef)((function(e,t){const s=(0,wl.isAppleOS)()?wl.displayShortcut.primaryShift("z"):wl.displayShortcut.primary("y"),o=(0,c.useSelect)((e=>e(Ac).hasEditorRedo()),[]),{redo:n}=(0,c.useDispatch)(Ac);return(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,...e,ref:t,icon:(0,fs.isRTL)()?pd:ud,label:(0,fs.__)("Redo"),shortcut:s,"aria-disabled":!o,onClick:o?n:void 0,className:"editor-history__redo"})}));const hd=(0,u.forwardRef)((function(e,t){const s=(0,c.useSelect)((e=>e(Ac).hasEditorUndo()),[]),{undo:o}=(0,c.useDispatch)(Ac);return(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,...e,ref:t,icon:(0,fs.isRTL)()?ud:pd,label:(0,fs.__)("Undo"),shortcut:wl.displayShortcut.primary("z"),"aria-disabled":!s,onClick:s?o:void 0,className:"editor-history__undo"})}));function gd(){const[e,t]=(0,u.useState)(!1),s=(0,c.useSelect)((e=>e(h.store).isValidTemplate()),[]),{setTemplateValidity:o,synchronizeTemplate:n}=(0,c.useDispatch)(h.store);return s?null:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.Notice,{className:"editor-template-validation-notice",isDismissible:!1,status:"warning",actions:[{label:(0,fs.__)("Keep it as is"),onClick:()=>o(!0)},{label:(0,fs.__)("Reset the template"),onClick:()=>t(!0)}],children:(0,fs.__)("The content of your post doesn’t match the template assigned to your post type.")}),(0,L.jsx)(Uo.__experimentalConfirmDialog,{isOpen:e,confirmButtonText:(0,fs.__)("Reset"),onConfirm:()=>{t(!1),n()},onCancel:()=>t(!1),size:"medium",children:(0,fs.__)("Resetting the template may result in loss of content, do you want to continue?")})]})}const _d=function(){const{notices:e}=(0,c.useSelect)((e=>({notices:e(_s.store).getNotices()})),[]),{removeNotice:t}=(0,c.useDispatch)(_s.store),s=e.filter((({isDismissible:e,type:t})=>e&&"default"===t)),o=e.filter((({isDismissible:e,type:t})=>!e&&"default"===t));return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.NoticeList,{notices:o,className:"components-editor-notices__pinned"}),(0,L.jsx)(Uo.NoticeList,{notices:s,className:"components-editor-notices__dismissible",onRemove:t,children:(0,L.jsx)(gd,{})})]})},fd=-3;function bd(){const e=(0,c.useSelect)((e=>e(_s.store).getNotices()),[]),{removeNotice:t}=(0,c.useDispatch)(_s.store),s=e.filter((({type:e})=>"snackbar"===e)).slice(fd);return(0,L.jsx)(Uo.SnackbarList,{notices:s,className:"components-editor-notices__snackbar",onRemove:t})}function yd({record:e,checked:t,onChange:s}){const{name:o,kind:n,title:i,key:r}=e,{entityRecordTitle:a,hasPostMetaChanges:l}=(0,c.useSelect)((e=>{var t;if("postType"!==n||"wp_template"!==o)return{entityRecordTitle:i,hasPostMetaChanges:$(e(Ac)).hasPostMetaChanges(o,r)};const s=e(d.store).getEditedEntityRecord(n,o,r),{default_template_types:a=[]}=null!==(t=e(d.store).getCurrentTheme())&&void 0!==t?t:{};return{entityRecordTitle:Y({template:s,templateTypes:a}).title,hasPostMetaChanges:$(e(Ac)).hasPostMetaChanges(o,r)}}),[o,n,i,r]);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.PanelRow,{children:(0,L.jsx)(Uo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,Lo.decodeEntities)(a)||(0,fs.__)("Untitled"),checked:t,onChange:s,className:"entities-saved-states__change-control"})}),l&&(0,L.jsx)("ul",{className:"entities-saved-states__changes",children:(0,L.jsx)("li",{children:(0,fs.__)("Post Meta.")})})]})}const{getGlobalStylesChanges:xd,GlobalStylesContext:vd}=$(h.privateApis);function Sd({record:e}){const{user:t}=(0,u.useContext)(vd),s=(0,c.useSelect)((t=>t(d.store).getEntityRecord(e.kind,e.name,e.key)),[e.kind,e.name,e.key]),o=xd(t,s,{maxResults:10});return o.length?(0,L.jsx)("ul",{className:"entities-saved-states__changes",children:o.map((e=>(0,L.jsx)("li",{children:e},e)))}):null}function wd({record:e,count:t}){if("globalStyles"===e?.name)return null;const s=function(e,t){switch(e){case"site":return 1===t?(0,fs.__)("This change will affect your whole site."):(0,fs.__)("These changes will affect your whole site.");case"wp_template":return(0,fs.__)("This change will affect other parts of your site that use this template.");case"page":case"post":return(0,fs.__)("The following has been modified.")}}(e?.name,t);return s?(0,L.jsx)(Uo.PanelRow,{children:s}):null}function kd({list:e,unselectedEntities:t,setUnselectedEntities:s}){const o=e.length,n=e[0];let i=(0,c.useSelect)((e=>e(d.store).getEntityConfig(n.kind,n.name)),[n.kind,n.name]).label;return"wp_template_part"===n?.name&&(i=1===o?(0,fs.__)("Template Part"):(0,fs.__)("Template Parts")),(0,L.jsxs)(Uo.PanelBody,{title:i,initialOpen:!0,className:"entities-saved-states__panel-body",children:[(0,L.jsx)(wd,{record:n,count:o}),e.map((e=>(0,L.jsx)(yd,{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,L.jsx)(Sd,{record:n})]})}const Cd=()=>{const{editedEntities:e,siteEdits:t,siteEntityConfig:s}=(0,c.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,getEntityRecordEdits:s,getEntityConfig:o}=e(d.store);return{editedEntities:t(),siteEdits:s("root","site"),siteEntityConfig:o("root","site")}}),[]),o=(0,u.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,u.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 Pd(e){return e}function jd({close:e,renderDialog:t,variant:s}){const o=Cd();return(0,L.jsx)(Ed,{close:e,renderDialog:t,variant:s,...o})}function Ed({additionalPrompt:e,close:t,onSave:s=Pd,saveEnabled:o,saveLabel:n=(0,fs.__)("Save"),renderDialog:i,dirtyEntityRecords:r,isDirty:a,setUnselectedEntities:l,unselectedEntities:d,variant:m="default"}){const h=(0,u.useRef)(),{saveDirtyEntities:g}=$((0,c.useDispatch)(Ac)),_=r.reduce(((e,t)=>{const{name:s}=t;return e[s]||(e[s]=[]),e[s].push(t),e}),{}),{site:f,wp_template:b,wp_template_part:y,...x}=_,v=[f,b,y,...Object.values(x)].filter(Array.isArray),S=null!=o?o:a,w=(0,u.useCallback)((()=>t()),[t]),[k,C]=(0,p.__experimentalUseDialog)({onClose:()=>w()}),P=(0,p.useInstanceId)(Ed,"entities-saved-states__panel-label"),j=(0,p.useInstanceId)(Ed,"entities-saved-states__panel-description"),E=r.length?(0,fs.__)("Select the items you want to save."):void 0,T="inline"===m,B=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.FlexItem,{isBlock:!T,as:Uo.Button,variant:T?"tertiary":"secondary",size:T?void 0:"compact",onClick:w,children:(0,fs.__)("Cancel")}),(0,L.jsx)(Uo.FlexItem,{isBlock:!T,as:Uo.Button,ref:h,variant:"primary",size:T?void 0:"compact",disabled:!S,accessibleWhenDisabled:!0,onClick:()=>g({onSave:s,dirtyEntityRecords:r,entitiesToSkip:d,close:t}),className:"editor-entities-saved-states__save-button",children:n})]});return(0,L.jsxs)("div",{ref:i?k:void 0,...i&&C,className:Di("entities-saved-states__panel",{"is-inline":T}),role:i?"dialog":void 0,"aria-labelledby":i?P:void 0,"aria-describedby":i?j:void 0,children:[!T&&(0,L.jsx)(Uo.Flex,{className:"entities-saved-states__panel-header",gap:2,children:B}),(0,L.jsxs)("div",{className:"entities-saved-states__text-prompt",children:[(0,L.jsx)("div",{className:"entities-saved-states__text-prompt--header-wrapper",children:(0,L.jsx)("strong",{id:i?P:void 0,className:"entities-saved-states__text-prompt--header",children:(0,fs.__)("Are you ready to save?")})}),(0,L.jsxs)("div",{id:i?j:void 0,children:[e,(0,L.jsx)("p",{className:"entities-saved-states__text-prompt--changes-count",children:a?(0,u.createInterpolateElement)((0,fs.sprintf)((0,fs._n)("There is <strong>%d site change</strong> waiting to be saved.","There are <strong>%d site changes</strong> waiting to be saved.",r.length),r.length),{strong:(0,L.jsx)("strong",{})}):E})]})]}),v.map((e=>(0,L.jsx)(kd,{list:e,unselectedEntities:d,setUnselectedEntities:l},e[0].name))),T&&(0,L.jsx)(Uo.Flex,{direction:"row",justify:"flex-end",className:"entities-saved-states__panel-footer",children:B})]})}function Td(){try{return(0,c.select)(Ac).getEditedPostContent()}catch(e){}}function Bd({text:e,children:t,variant:s="secondary"}){const o=(0,p.useCopyToClipboard)(e);return(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:s,ref:o,children:t})}class Id extends u.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){(0,m.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}render(){const{error:e}=this.state,{canCopyContent:t=!1}=this.props;return e?(0,L.jsxs)(Uo.__experimentalHStack,{className:"editor-error-boundary",alignment:"baseline",spacing:4,justify:"space-between",expanded:!1,wrap:!0,children:[(0,L.jsx)(Uo.__experimentalText,{as:"p",children:(0,fs.__)("The editor has encountered an unexpected error.")}),(0,L.jsxs)(Uo.__experimentalHStack,{expanded:!1,children:[t&&(0,L.jsx)(Bd,{text:Td,children:(0,fs.__)("Copy contents")}),(0,L.jsx)(Bd,{variant:"primary",text:e?.stack,children:(0,fs.__)("Copy error")})]})]}):this.props.children}}const Nd=Id,Dd=window.requestIdleCallback?window.requestIdleCallback:window.requestAnimationFrame;let Ad;function Rd(){const{postId:e,isEditedPostNew:t,hasRemoteAutosave:s}=(0,c.useSelect)((e=>({postId:e(Ac).getCurrentPostId(),isEditedPostNew:e(Ac).isEditedPostNew(),hasRemoteAutosave:!!e(Ac).getEditorSettings().autosave})),[]),{getEditedPostAttribute:o}=(0,c.useSelect)(Ac),{createWarningNotice:n,removeNotice:i}=(0,c.useDispatch)(_s.store),{editPost:r,resetEditorBlocks:a}=(0,c.useDispatch)(Ac);(0,u.useEffect)((()=>{let l=function(e,t){return window.sessionStorage.getItem(bs(e,t))}(e,t);if(!l)return;try{l=JSON.parse(l)}catch{return}const{post_title:c,content:d,excerpt:u}=l,p={title:c,content:d,excerpt:u};if(!Object.keys(p).some((e=>p[e]!==o(e))))return void ys(e,t);if(s)return;const m="wpEditorAutosaveRestore";n((0,fs.__)("The backup of this post in your browser is different from the version below."),{id:m,actions:[{label:(0,fs.__)("Restore the backup"),onClick(){const{content:e,...t}=p;r(t),a((0,y.parse)(p.content)),i(m)}}]})}),[t,e])}const Md=(0,p.ifCondition)((()=>{if(void 0!==Ad)return Ad;try{window.sessionStorage.setItem("__wpEditorTestSessionStorage",""),window.sessionStorage.removeItem("__wpEditorTestSessionStorage"),Ad=!0}catch{Ad=!1}return Ad}))((function(){const{autosave:e}=(0,c.useDispatch)(Ac),t=(0,u.useCallback)((()=>{Dd((()=>e({local:!0})))}),[]);Rd(),function(){const{postId:e,isEditedPostNew:t,isDirty:s,isAutosaving:o,didError:n}=(0,c.useSelect)((e=>({postId:e(Ac).getCurrentPostId(),isEditedPostNew:e(Ac).isEditedPostNew(),isDirty:e(Ac).isEditedPostDirty(),isAutosaving:e(Ac).isAutosavingPost(),didError:e(Ac).didPostSaveRequestFail()})),[]),i=(0,u.useRef)(s),r=(0,u.useRef)(o);(0,u.useEffect)((()=>{!n&&(r.current&&!o||i.current&&!s)&&ys(e,t),i.current=s,r.current=o}),[s,o,n]);const a=(0,p.usePrevious)(t),l=(0,p.usePrevious)(e);(0,u.useEffect)((()=>{l===e&&a&&!t&&ys(e,!0)}),[t,e])}();const s=(0,c.useSelect)((e=>e(Ac).getEditorSettings().localAutosaveInterval),[]);return(0,L.jsx)(Wc,{interval:s,autosave:t})}));const Ld=function({children:e}){const t=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Ac),{getPostType:s}=e(d.store),o=s(t("type"));return!!o?.supports?.["page-attributes"]}),[]);return t?e:null};const Od=function({children:e,supportKeys:t}){const s=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Ac),{getPostType:s}=e(d.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 Fd(){const e=(0,c.useSelect)((e=>{var t;return null!==(t=e(Ac).getEditedPostAttribute("menu_order"))&&void 0!==t?t:0}),[]),{editPost:t}=(0,c.useDispatch)(Ac),[s,o]=(0,u.useState)(null),n=null!=s?s:e;return(0,L.jsx)(Uo.Flex,{children:(0,L.jsx)(Uo.FlexBlock,{children:(0,L.jsx)(Uo.__experimentalNumberControl,{__next40pxDefaultSize:!0,label:(0,fs.__)("Order"),help:(0,fs.__)("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 Vd(){return(0,L.jsx)(Od,{supportKeys:"page-attributes",children:(0,L.jsx)(Fd,{})})}const zd=(0,u.forwardRef)((({className:e,label:t,children:s},o)=>(0,L.jsxs)(Uo.__experimentalHStack,{className:Di("editor-post-panel__row",e),ref:o,children:[t&&(0,L.jsx)("div",{className:"editor-post-panel__row-label",children:t}),(0,L.jsx)("div",{className:"editor-post-panel__row-control",children:s})]})));function Ud(e){const t=e.map((e=>({children:[],parent:void 0,...e})));if(t.some((({parent:e})=>void 0===e)))return t;const s=t.reduce(((e,t)=>{const{parent:s}=t;return e[s]||(e[s]=[]),e[s].push(t),e}),{}),o=e=>e.map((e=>{const t=s[e.id];return{...e,children:t&&t.length?o(t):[]}}));return o(s[0]||[])}const Hd=e=>(0,Lo.decodeEntities)(e),Gd=e=>({...e,name:Hd(e.name)}),$d=e=>(null!=e?e:[]).map(Gd);function Wd(e){return e?.title?.rendered?(0,Lo.decodeEntities)(e.title.rendered):`#${e.id} (${(0,fs.__)("no title")})`}const Zd=(e,t)=>{const s=sr()(e||"").toLowerCase(),o=sr()(t||"").toLowerCase();return s===o?0:s.startsWith(o)?s.length:1/0};function Yd(){const{editPost:e}=(0,c.useDispatch)(Ac),[t,s]=(0,u.useState)(!1),{isHierarchical:o,parentPostId:n,parentPostTitle:i,pageItems:r,isLoading:a}=(0,c.useSelect)((e=>{var s;const{getPostType:o,getEntityRecords:n,getEntityRecord:i,isResolving:r}=e(d.store),{getCurrentPostId:a,getEditedPostAttribute:l}=e(Ac),c=l("type"),u=l("parent"),p=o(c),m=a(),h=null!==(s=p?.hierarchical)&&void 0!==s&&s,g={per_page:100,exclude:m,parent_exclude:m,orderby:"menu_order",order:"asc",_fields:"id,title,parent"};t&&(g.search=t);const _=u?i("postType",c,u):null;return{isHierarchical:h,parentPostId:u,parentPostTitle:_?Wd(_):"",pageItems:h?n("postType",c,g):null,isLoading:!!h&&r("getEntityRecords",["postType",c,g])}}),[t]),l=(0,u.useMemo)((()=>{const e=(s,o=0)=>{const n=s.map((t=>[{value:t.id,label:"— ".repeat(o)+(0,Lo.decodeEntities)(t.name),rawName:t.name},...e(t.children||[],o+1)])).sort((([e],[s])=>Zd(e.rawName,t)>=Zd(s.rawName,t)?1:-1));return n.flat()};if(!r)return[];let s=r.map((e=>({id:e.id,parent:e.parent,name:Wd(e)})));t||(s=Ud(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,L.jsx)(Uo.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"editor-page-attributes__parent",label:(0,fs.__)("Parent"),help:(0,fs.__)("Choose a parent page."),value:n,options:l,onFilterValueChange:(0,p.debounce)((e=>{s(e)}),300),onChange:t=>{e({parent:t})},hideLabelFromVision:!0,isLoading:a})}function Kd({isOpen:e,onClick:t}){const s=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Ac),s=t("parent");if(!s)return null;const{getEntityRecord:o}=e(d.store);return o("postType",t("type"),s)}),[]),o=(0,u.useMemo)((()=>s?Wd(s):(0,fs.__)("None")),[s]);return(0,L.jsx)(Uo.Button,{size:"compact",className:"editor-post-parent__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change parent: %s"),o),onClick:t,children:o})}function qd(){const e=(0,c.useSelect)((e=>e(d.store).getEntityRecord("root","__unstableBase")?.home),[]),[t,s]=(0,u.useState)(null),o=(0,u.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]);return(0,L.jsx)(zd,{label:(0,fs.__)("Parent"),ref:s,children:(0,L.jsx)(Uo.Dropdown,{popoverProps:o,className:"editor-post-parent__panel-dropdown",contentClassName:"editor-post-parent__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,L.jsx)(Kd,{isOpen:e,onClick:t}),renderContent:({onClose:t})=>(0,L.jsxs)("div",{className:"editor-post-parent",children:[(0,L.jsx)(h.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Parent"),onClose:t}),(0,L.jsxs)("div",{children:[(0,u.createInterpolateElement)((0,fs.sprintf)((0,fs.__)('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %s<wbr />/services<wbr />/pricing.'),(0,v.filterURLForDisplay)(e).replace(/([/.])/g,"<wbr />$1")),{wbr:(0,L.jsx)("wbr",{})}),(0,L.jsx)("p",{children:(0,u.createInterpolateElement)((0,fs.__)("They also show up as sub-items in the default navigation menu. <a>Learn more.</a>"),{a:(0,L.jsx)(Uo.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes")})})})]}),(0,L.jsx)(Yd,{})]})})})}const Qd=Yd,Xd="page-attributes";function Jd(){const{isEnabled:e,postType:t}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t,isEditorPanelEnabled:s}=e(Ac),{getPostType:o}=e(d.store);return{isEnabled:s(Xd),postType:o(t("type"))}}),[]);return e&&t?(0,L.jsx)(qd,{}):null}function eu(){return(0,L.jsx)(Ld,{children:(0,L.jsx)(Jd,{})})}const tu=(0,L.jsx)(M.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,L.jsx)(M.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"})}),su=(0,fs.__)("Custom Template");function ou({onClose:e}){const{defaultBlockTemplate:t,onNavigateToEntityRecord:s}=(0,c.useSelect)((e=>{const{getEditorSettings:t,getCurrentTemplateId:s}=e(Ac);return{defaultBlockTemplate:t().defaultBlockTemplate,onNavigateToEntityRecord:t().onNavigateToEntityRecord,getTemplateId:s}})),{createTemplate:o}=$((0,c.useDispatch)(Ac)),[n,i]=(0,u.useState)(""),[r,a]=(0,u.useState)(!1),l=()=>{i(""),e()};return(0,L.jsx)(Uo.Modal,{title:(0,fs.__)("Create custom template"),onRequestClose:l,focusOnMount:"firstContentElement",size:"small",children:(0,L.jsx)("form",{className:"editor-post-template__create-form",onSubmit:async e=>{if(e.preventDefault(),r)return;a(!0);const i=null!=t?t:(0,y.serialize)([(0,y.createBlock)("core/group",{tagName:"header",layout:{inherit:!0}},[(0,y.createBlock)("core/site-title"),(0,y.createBlock)("core/site-tagline")]),(0,y.createBlock)("core/separator"),(0,y.createBlock)("core/group",{tagName:"main"},[(0,y.createBlock)("core/group",{layout:{inherit:!0}},[(0,y.createBlock)("core/post-title")]),(0,y.createBlock)("core/post-content",{layout:{inherit:!0}})])]),c=await o({slug:(0,v.cleanForSlug)(n||su),content:i,title:n||su});a(!1),s({postId:c.id,postType:"wp_template"}),l()},children:(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"3",children:[(0,L.jsx)(Uo.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,fs.__)("Name"),value:n,onChange:i,placeholder:su,disabled:r,help:(0,fs.__)('Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.')}),(0,L.jsxs)(Uo.__experimentalHStack,{justify:"right",children:[(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:l,children:(0,fs.__)("Cancel")}),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",isBusy:r,"aria-disabled":r,children:(0,fs.__)("Create")})]})]})})})}function nu(){return(0,c.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s}=e(Ac);return{postId:t(),postType:s()}}),[])}function iu(){const{postType:e,postId:t}=nu();return(0,c.useSelect)((s=>{const{canUser:o,getEntityRecord:n,getEntityRecords:i}=s(d.store),r=o("read",{kind:"root",name:"site"})?n("root","site"):void 0,a=i("postType","wp_template",{per_page:-1}),l=+t===r?.page_for_posts,c="page"===e&&+t===r?.page_on_front&&a?.some((({slug:e})=>"front-page"===e));return!l&&!c}),[t,e])}function ru(e){return(0,c.useSelect)((t=>t(d.store).getEntityRecords("postType","wp_template",{per_page:-1,post_type:e})),[e])}function au(e){const t=lu(),s=iu(),o=ru(e);return(0,u.useMemo)((()=>s&&o?.filter((e=>e.is_custom&&e.slug!==t&&!!e.content.raw))),[o,t,s])}function lu(){const{postType:e,postId:t}=nu(),s=ru(e),o=(0,c.useSelect)((s=>{const o=s(d.store).getEditedEntityRecord("postType",e,t);return o?.template}),[e,t]);if(o)return s?.find((e=>e.slug===o))?.slug}function cu({isOpen:e,onClick:t}){const s=(0,c.useSelect)((e=>{const t=e(Ac).getEditedPostAttribute("template"),{supportsTemplateMode:s,availableTemplates:o}=e(Ac).getEditorSettings();if(!s&&o[t])return o[t];const n=e(d.store).canUser("create",{kind:"postType",name:"wp_template"})&&e(Ac).getCurrentTemplateId();return n?.title||n?.slug||o?.[t]}),[]);return(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.__)("Template options"),onClick:t,children:null!=s?s:(0,fs.__)("Default template")})}function du({onClose:e}){var t,s;const o=iu(),{availableTemplates:n,fetchedTemplates:i,selectedTemplateSlug:r,canCreate:a,canEdit:l,currentTemplateId:p,onNavigateToEntityRecord:m,getEditorSettings:g}=(0,c.useSelect)((e=>{const{canUser:t,getEntityRecords:s}=e(d.store),n=e(Ac).getEditorSettings(),i=t("create",{kind:"postType",name:"wp_template"}),r=e(Ac).getCurrentTemplateId();return{availableTemplates:n.availableTemplates,fetchedTemplates:i?s("postType","wp_template",{post_type:e(Ac).getCurrentPostType(),per_page:-1}):void 0,selectedTemplateSlug:e(Ac).getEditedPostAttribute("template"),canCreate:o&&i&&n.supportsTemplateMode,canEdit:o&&i&&n.supportsTemplateMode&&!!r,currentTemplateId:r,onNavigateToEntityRecord:n.onNavigateToEntityRecord,getEditorSettings:e(Ac).getEditorSettings}}),[o]),_=(0,u.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]),f=null!==(t=_.find((e=>e.value===r)))&&void 0!==t?t:_.find((e=>!e.value)),{editPost:b}=(0,c.useDispatch)(Ac),{createSuccessNotice:y}=(0,c.useDispatch)(_s.store),[x,v]=(0,u.useState)(!1);return(0,L.jsxs)("div",{className:"editor-post-template__classic-theme-dropdown",children:[(0,L.jsx)(h.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Template"),help:(0,fs.__)("Templates define the way content is displayed when viewing your site."),actions:a?[{icon:tu,label:(0,fs.__)("Add template"),onClick:()=>v(!0)}]:[],onClose:e}),o?(0,L.jsx)(Uo.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,label:(0,fs.__)("Template"),value:null!==(s=f?.value)&&void 0!==s?s:"",options:_,onChange:e=>b({template:e||""})}):(0,L.jsx)(Uo.Notice,{status:"warning",isDismissible:!1,children:(0,fs.__)("The posts page template cannot be changed.")}),l&&m&&(0,L.jsx)("p",{children:(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>{m({postId:p,postType:"wp_template"}),e(),y((0,fs.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:[{label:(0,fs.__)("Go back"),onClick:()=>g().onNavigateToPreviousEntityRecord()}]})},children:(0,fs.__)("Edit template")})}),x&&(0,L.jsx)(ou,{onClose:()=>v(!1)})]})}const uu=function(){const[e,t]=(0,u.useState)(null),s=(0,u.useMemo)((()=>({anchor:e,className:"editor-post-template__dropdown",placement:"left-start",offset:36,shift:!0})),[e]);return(0,L.jsx)(zd,{label:(0,fs.__)("Template"),ref:t,children:(0,L.jsx)(Uo.Dropdown,{popoverProps:s,focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,L.jsx)(cu,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,L.jsx)(du,{onClose:e})})})},{PreferenceBaseOption:pu}=(window.wp.warning,$(k.privateApis));function mu(e){const{toggleEditorPanelEnabled:t}=(0,c.useDispatch)(Ac),{isChecked:s,isRemoved:o}=(0,c.useSelect)((t=>{const{isEditorPanelEnabled:s,isEditorPanelRemoved:o}=t(Ac);return{isChecked:s(e.panelName),isRemoved:o(e.panelName)}}),[e.panelName]);return o?null:(0,L.jsx)(pu,{isChecked:s,onChange:()=>t(e.panelName),...e})}const{Fill:hu,Slot:gu}=(0,Uo.createSlotFill)("EnablePluginDocumentSettingPanelOption"),_u=({label:e,panelName:t})=>(0,L.jsx)(hu,{children:(0,L.jsx)(mu,{label:e,panelName:t})});_u.Slot=gu;const fu=_u,{Fill:bu,Slot:yu}=(0,Uo.createSlotFill)("PluginDocumentSettingPanel"),xu=({name:e,className:t,title:s,icon:o,children:n})=>{const{name:i}=(0,wa.usePluginContext)(),r=`${i}/${e}`,{opened:a,isEnabled:l}=(0,c.useSelect)((e=>{const{isEditorPanelOpened:t,isEditorPanelEnabled:s}=e(Ac);return{opened:t(r),isEnabled:s(r)}}),[r]),{toggleEditorPanelOpened:d}=(0,c.useDispatch)(Ac);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(fu,{label:s,panelName:r}),(0,L.jsx)(bu,{children:l&&(0,L.jsx)(Uo.PanelBody,{className:t,title:s,icon:o,opened:a,onToggle:()=>d(r),children:n})})]})};xu.Slot=yu;const vu=xu,Su=({allowedBlocks:e,icon:t,label:s,onClick:o,small:n,role:i})=>(0,L.jsx)(h.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,L.jsx)(Uo.MenuItem,{onClick:(0,p.compose)(o,a),icon:t,label:n?s:void 0,role:i,children:!n&&s}):null});function wu(e){var t;const s=(0,wa.usePluginContext)();return(0,L.jsx)(Za,{name:"core/plugin-more-menu",as:null!==(t=e.as)&&void 0!==t?t:Uo.MenuItem,icon:e.icon||s.icon,...e})}const{Fill:ku,Slot:Cu}=(0,Uo.createSlotFill)("PluginPostPublishPanel"),Pu=({children:e,className:t,title:s,initialOpen:o=!1,icon:n})=>{const{icon:i}=(0,wa.usePluginContext)();return(0,L.jsx)(ku,{children:(0,L.jsx)(Uo.PanelBody,{className:t,initialOpen:o||!s,title:s,icon:null!=n?n:i,children:e})})};Pu.Slot=Cu;const ju=Pu,{Fill:Eu,Slot:Tu}=(0,Uo.createSlotFill)("PluginPostStatusInfo"),Bu=({children:e,className:t})=>(0,L.jsx)(Eu,{children:(0,L.jsx)(Uo.PanelRow,{className:t,children:e})});Bu.Slot=Tu;const Iu=Bu,{Fill:Nu,Slot:Du}=(0,Uo.createSlotFill)("PluginPrePublishPanel"),Au=({children:e,className:t,title:s,initialOpen:o=!1,icon:n})=>{const{icon:i}=(0,wa.usePluginContext)();return(0,L.jsx)(Nu,{children:(0,L.jsx)(Uo.PanelBody,{className:t,initialOpen:o||!s,title:s,icon:null!=n?n:i,children:e})})};Au.Slot=Du;const Ru=Au;function Mu(e){var t;const s=(0,wa.usePluginContext)();return(0,L.jsx)(Za,{name:"core/plugin-preview-menu",as:null!==(t=e.as)&&void 0!==t?t:Uo.MenuItem,icon:e.icon||s.icon,...e})}function Lu({className:e,...t}){return(0,L.jsx)(tl,{panelClassName:e,className:"editor-sidebar",scope:"core",...t})}function Ou(e){return(0,L.jsx)(Ka,{__unstableExplicitMenuItem:!0,scope:"core",...e})}function Fu({onClick:e}){const[t,s]=(0,u.useState)(!1),{postType:o,postId:n}=nu(),i=au(o),{editEntityRecord:r}=(0,c.useDispatch)(d.store);if(!i?.length)return null;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.MenuItem,{onClick:()=>s(!0),children:(0,fs.__)("Change template")}),t&&(0,L.jsx)(Uo.Modal,{title:(0,fs.__)("Choose a template"),onRequestClose:()=>s(!1),overlayClassName:"editor-post-template__swap-template-modal",isFullScreen:!0,children:(0,L.jsx)("div",{className:"editor-post-template__swap-template-modal-content",children:(0,L.jsx)(Vu,{postType:o,onSelect:async t=>{r("postType",o,n,{template:t.name},{undoIgnore:!0}),s(!1),e()}})})})]})}function Vu({postType:e,onSelect:t}){const s=au(e),o=(0,u.useMemo)((()=>s.map((e=>({name:e.slug,blocks:(0,y.parse)(e.content.raw),title:(0,Lo.decodeEntities)(e.title.rendered),id:e.id})))),[s]);return(0,L.jsx)(h.__experimentalBlockPatternsList,{label:(0,fs.__)("Templates"),blockPatterns:o,onClickPattern:t})}function zu({onClick:e}){const t=lu(),s=iu(),{postType:o,postId:n}=nu(),{editEntityRecord:i}=(0,c.useDispatch)(d.store);return t&&s?(0,L.jsx)(Uo.MenuItem,{onClick:()=>{i("postType",o,n,{template:""},{undoIgnore:!0}),e()},children:(0,fs.__)("Use default template")}):null}function Uu({onClick:e}){const{canCreateTemplates:t}=(0,c.useSelect)((e=>{const{canUser:t}=e(d.store);return{canCreateTemplates:t("create",{kind:"postType",name:"wp_template"})}}),[]),[s,o]=(0,u.useState)(!1),n=iu();return t&&n?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.MenuItem,{onClick:()=>{o(!0)},children:(0,fs.__)("Create new template")}),s&&(0,L.jsx)(ou,{onClose:()=>{o(!1),e()}})]}):null}function Hu({id:e}){const{isTemplateHidden:t,onNavigateToEntityRecord:s,getEditorSettings:o,hasGoBack:n}=(0,c.useSelect)((e=>{const{getRenderingMode:t,getEditorSettings:s}=$(e(Ac)),o=s();return{isTemplateHidden:"post-only"===t(),onNavigateToEntityRecord:o.onNavigateToEntityRecord,getEditorSettings:s,hasGoBack:o.hasOwnProperty("onNavigateToPreviousEntityRecord")}}),[]),{get:i}=(0,c.useSelect)(k.store),{editedRecord:r,hasResolved:a}=(0,d.useEntityRecord)("postType","wp_template",e),{createSuccessNotice:l}=(0,c.useDispatch)(_s.store),{setRenderingMode:p,setDefaultRenderingMode:m}=$((0,c.useDispatch)(Ac)),h=(0,c.useSelect)((e=>!!e(d.store).canUser("create",{kind:"postType",name:"wp_template"})),[]),[g,_]=(0,u.useState)(null),f=(0,u.useMemo)((()=>({anchor:g,className:"editor-post-template__dropdown",placement:"left-start",offset:36,shift:!0})),[g]);if(!a)return null;const b=n?[{label:(0,fs.__)("Go back"),onClick:()=>o().onNavigateToPreviousEntityRecord()}]:void 0;return(0,L.jsx)(zd,{label:(0,fs.__)("Template"),ref:_,children:(0,L.jsx)(Uo.DropdownMenu,{popoverProps:f,focusOnMount:!0,toggleProps:{size:"compact",variant:"tertiary",tooltipPosition:"middle left"},label:(0,fs.__)("Template options"),text:(0,Lo.decodeEntities)(r.title),icon:null,children:({onClose:e})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(Uo.MenuGroup,{children:[h&&(0,L.jsx)(Uo.MenuItem,{onClick:()=>{s({postId:r.id,postType:"wp_template"}),e(),i("core/edit-site","welcomeGuideTemplate")||l((0,fs.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:b})},children:(0,fs.__)("Edit template")}),(0,L.jsx)(Fu,{onClick:e}),(0,L.jsx)(zu,{onClick:e}),h&&(0,L.jsx)(Uu,{onClick:e})]}),(0,L.jsx)(Uo.MenuGroup,{children:(0,L.jsx)(Uo.MenuItem,{icon:t?void 0:Ho,isSelected:!t,role:"menuitemcheckbox",onClick:()=>{const e=t?"template-locked":"post-only";p(e),m(e)},children:(0,fs.__)("Show template")})})]})})})}function Gu(){const{templateId:e,isBlockTheme:t}=(0,c.useSelect)((e=>{const{getCurrentTemplateId:t,getEditorSettings:s}=e(Ac);return{templateId:t(),isBlockTheme:s().__unstableIsBlockBasedTheme}}),[]),s=(0,c.useSelect)((e=>{var t;const s=e(Ac).getCurrentPostType(),o=e(d.store).getPostType(s);if(!o?.viewable)return!1;const n=e(Ac).getEditorSettings();if(!!n.availableTemplates&&Object.keys(n.availableTemplates).length>0)return!0;if(!n.supportsTemplateMode)return!1;return null!==(t=e(d.store).canUser("create",{kind:"postType",name:"wp_template"}))&&void 0!==t&&t}),[]),o=(0,c.useSelect)((e=>{var t;return null!==(t=e(d.store).canUser("read",{kind:"postType",name:"wp_template"}))&&void 0!==t&&t}),[]);return t&&o||!s?t&&e?(0,L.jsx)(Hu,{id:e}):null:(0,L.jsx)(uu,{})}const $u={_fields:"id,name",context:"view"},Wu={who:"authors",per_page:100,...$u};function Zu(e){const{authorId:t,authors:s,postAuthor:o,isLoading:n}=(0,c.useSelect)((t=>{const{getUser:s,getUsers:o,isResolving:n}=t(d.store),{getEditedPostAttribute:i}=t(Ac),r=i("author"),a={...Wu};return e&&(a.search=e,a.search_columns=["name"]),{authorId:r,authors:o(a),postAuthor:s(r,$u),isLoading:n("getUsers",[a])}}),[e]),i=(0,u.useMemo)((()=>{const e=(null!=s?s:[]).map((e=>({value:e.id,label:(0,Lo.decodeEntities)(e.name)}))),t=e.findIndex((({value:e})=>o?.id===e));let n=[];return t<0&&o?n=[{value:o.id,label:(0,Lo.decodeEntities)(o.name)}]:t<0&&!o&&(n=[{value:0,label:(0,fs.__)("(No author)")}]),[...n,...e]}),[s,o]);return{authorId:t,authorOptions:i,postAuthor:o,isLoading:n}}function Yu(){const[e,t]=(0,u.useState)(),{editPost:s}=(0,c.useDispatch)(Ac),{authorId:o,authorOptions:n,isLoading:i}=Zu(e);return(0,L.jsx)(Uo.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,fs.__)("Author"),options:n,value:o,onFilterValueChange:(0,p.debounce)((e=>{t(e)}),300),onChange:e=>{e&&s({author:e})},allowReset:!1,hideLabelFromVision:!0,isLoading:i})}function Ku(){const{editPost:e}=(0,c.useDispatch)(Ac),{authorId:t,authorOptions:s}=Zu();return(0,L.jsx)(Uo.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"post-author-selector",label:(0,fs.__)("Author"),options:s,onChange:t=>{const s=Number(t);e({author:s})},value:t,hideLabelFromVision:!0})}const qu=function(){return(0,c.useSelect)((e=>{const t=e(d.store).getUsers(Wu);return t?.length>=25}),[])?(0,L.jsx)(Yu,{}):(0,L.jsx)(Ku,{})};function Qu({children:e}){const{hasAssignAuthorAction:t,hasAuthors:s}=(0,c.useSelect)((e=>{const t=e(Ac).getCurrentPost(),s=!!t?._links?.["wp:action-assign-author"];return{hasAssignAuthorAction:s,hasAuthors:!!s&&e(d.store).getUsers(Wu)?.length>=1}}),[]);return t&&s?(0,L.jsx)(Od,{supportKeys:"author",children:e}):null}function Xu({isOpen:e,onClick:t}){const{postAuthor:s}=Zu(),o=(0,Lo.decodeEntities)(s?.name)||(0,fs.__)("(No author)");return(0,L.jsx)(Uo.Button,{size:"compact",className:"editor-post-author__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change author: %s"),o),onClick:t,children:o})}const Ju=function(){const[e,t]=(0,u.useState)(null),s=(0,u.useMemo)((()=>({anchor:e,placement:"left-start",offset:36,shift:!0})),[e]);return(0,L.jsx)(Qu,{children:(0,L.jsx)(zd,{label:(0,fs.__)("Author"),ref:t,children:(0,L.jsx)(Uo.Dropdown,{popoverProps:s,contentClassName:"editor-post-author__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,L.jsx)(Xu,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,L.jsxs)("div",{className:"editor-post-author",children:[(0,L.jsx)(h.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Author"),onClose:e}),(0,L.jsx)(qu,{onClose:e})]})})})})},ep=[{label:(0,fs._x)("Open",'Adjective: e.g. "Comments are open"'),value:"open",description:(0,fs.__)("Visitors can add new comments and replies.")},{label:(0,fs.__)("Closed"),value:"closed",description:[(0,fs.__)("Visitors cannot add new comments or replies."),(0,fs.__)("Existing comments remain visible.")].join(" ")}];const tp=function(){const e=(0,c.useSelect)((e=>{var t;return null!==(t=e(Ac).getEditedPostAttribute("comment_status"))&&void 0!==t?t:"open"}),[]),{editPost:t}=(0,c.useDispatch)(Ac);return(0,L.jsx)("form",{children:(0,L.jsx)(Uo.__experimentalVStack,{spacing:4,children:(0,L.jsx)(Uo.RadioControl,{className:"editor-change-status__options",hideLabelFromVision:!0,label:(0,fs.__)("Comment status"),options:ep,onChange:e=>t({comment_status:e}),selected:e})})})};const sp=function(){const e=(0,c.useSelect)((e=>{var t;return null!==(t=e(Ac).getEditedPostAttribute("ping_status"))&&void 0!==t?t:"open"}),[]),{editPost:t}=(0,c.useDispatch)(Ac);return(0,L.jsx)(Uo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Enable pingbacks & trackbacks"),checked:"open"===e,onChange:()=>t({ping_status:"open"===e?"closed":"open"}),help:(0,L.jsx)(Uo.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/trackbacks-and-pingbacks/"),children:(0,fs.__)("Learn more about pingbacks & trackbacks")})})},op="discussion-panel";function np({onClose:e}){return(0,L.jsxs)("div",{className:"editor-post-discussion",children:[(0,L.jsx)(h.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Discussion"),onClose:e}),(0,L.jsxs)(Uo.__experimentalVStack,{spacing:4,children:[(0,L.jsx)(Od,{supportKeys:"comments",children:(0,L.jsx)(tp,{})}),(0,L.jsx)(Od,{supportKeys:"trackbacks",children:(0,L.jsx)(sp,{})})]})]})}function ip({isOpen:e,onClick:t}){const{commentStatus:s,pingStatus:o,commentsSupported:n,trackbacksSupported:i}=(0,c.useSelect)((e=>{var t,s;const{getEditedPostAttribute:o}=e(Ac),{getPostType:n}=e(d.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,fs._x)("Open",'Adjective: e.g. "Comments are open"'):i?(0,fs.__)("Comments only"):(0,fs._x)("Open",'Adjective: e.g. "Comments are open"'):"open"===o?n?(0,fs.__)("Pings only"):(0,fs.__)("Pings enabled"):(0,fs.__)("Closed"),(0,L.jsx)(Uo.Button,{size:"compact",className:"editor-post-discussion__panel-toggle",variant:"tertiary","aria-label":(0,fs.__)("Change discussion options"),"aria-expanded":e,onClick:t,children:r})}function rp(){const{isEnabled:e}=(0,c.useSelect)((e=>{const{isEditorPanelEnabled:t}=e(Ac);return{isEnabled:t(op)}}),[]),[t,s]=(0,u.useState)(null),o=(0,u.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]);return e?(0,L.jsx)(Od,{supportKeys:["comments","trackbacks"],children:(0,L.jsx)(zd,{label:(0,fs.__)("Discussion"),ref:s,children:(0,L.jsx)(Uo.Dropdown,{popoverProps:o,className:"editor-post-discussion__panel-dropdown",contentClassName:"editor-post-discussion__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,L.jsx)(ip,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,L.jsx)(np,{onClose:e})})})}):null}function ap({hideLabelFromVision:e=!1,updateOnBlur:t=!1}){const{excerpt:s,shouldUseDescriptionLabel:o,usedAttribute:n}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getEditedPostAttribute:s}=e(Ac),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,c.useDispatch)(Ac),[r,a]=(0,u.useState)((0,Lo.decodeEntities)(s)),l=e=>{i({[n]:e})},d=o?(0,fs.__)("Write a description (optional)"):(0,fs.__)("Write an excerpt (optional)");return(0,L.jsx)("div",{className:"editor-post-excerpt",children:(0,L.jsx)(Uo.TextareaControl,{__nextHasNoMarginBottom:!0,label:d,hideLabelFromVision:e,className:"editor-post-excerpt__textarea",onChange:t?a:l,onBlur:t?()=>l(r):void 0,value:t?r:s,help:o?(0,fs.__)("Write a description"):(0,L.jsx)(Uo.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#excerpt"),children:(0,fs.__)("Learn more about manual excerpts")})})})}const lp=function({children:e}){return(0,L.jsx)(Od,{supportKeys:"excerpt",children:e})},{Fill:cp,Slot:dp}=(0,Uo.createSlotFill)("PluginPostExcerpt"),up=({children:e,className:t})=>(0,L.jsx)(cp,{children:(0,L.jsx)(Uo.PanelRow,{className:t,children:e})});up.Slot=dp;const pp=up,mp="post-excerpt";function hp(){const{isOpened:e,isEnabled:t,postType:s}=(0,c.useSelect)((e=>{const{isEditorPanelOpened:t,isEditorPanelEnabled:s,getCurrentPostType:o}=e(Ac);return{isOpened:t(mp),isEnabled:s(mp),postType:o()}}),[]),{toggleEditorPanelOpened:o}=(0,c.useDispatch)(Ac);if(!t)return null;const n=["wp_template","wp_template_part","wp_block"].includes(s);return(0,L.jsx)(Uo.PanelBody,{title:n?(0,fs.__)("Description"):(0,fs.__)("Excerpt"),opened:e,onToggle:()=>o(mp),children:(0,L.jsx)(pp.Slot,{children:e=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(ap,{}),e]})})})}function gp(){return(0,L.jsx)(lp,{children:(0,L.jsx)(hp,{})})}function _p(){return(0,L.jsx)(lp,{children:(0,L.jsx)(fp,{})})}function fp(){const{shouldRender:e,excerpt:t,shouldBeUsedAsDescription:s,allowEditing:o}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s,getEditedPostAttribute:o,isEditorPanelEnabled:n}=e(Ac),i=t(),r=["wp_template","wp_template_part"].includes(i),a="wp_block"===i,l=r||a,c=r?"description":"excerpt",u=r&&e(d.store).getEntityRecord("postType",i,s()),p=n(mp)||l;return{excerpt:o(c),shouldRender:p,shouldBeUsedAsDescription:l,allowEditing:p&&(!l||a||u&&u.source===D&&!u.has_theme_file&&u.is_custom)}}),[]),[n,i]=(0,u.useState)(null),r=s?(0,fs.__)("Description"):(0,fs.__)("Excerpt"),a=(0,u.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,L.jsx)(Uo.__experimentalText,{align:"left",numberOfLines:4,truncate:o,children:(0,Lo.decodeEntities)(t)});if(!o)return l;const p=s?(0,fs.__)("Add a description…"):(0,fs.__)("Add an excerpt…"),m=s?(0,fs.__)("Edit description"):(0,fs.__)("Edit excerpt");return(0,L.jsxs)(Uo.__experimentalVStack,{children:[l,(0,L.jsx)(Uo.Dropdown,{className:"editor-post-excerpt__dropdown",contentClassName:"editor-post-excerpt__dropdown__content",popoverProps:a,focusOnMount:!0,ref:i,renderToggle:({onToggle:e})=>(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,onClick:e,variant:"link",children:l?m:p}),renderContent:({onClose:e})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(h.__experimentalInspectorPopoverHeader,{title:r,onClose:e}),(0,L.jsx)(Uo.__experimentalVStack,{spacing:4,children:(0,L.jsx)(pp.Slot,{children:e=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(ap,{hideLabelFromVision:!0,updateOnBlur:!0}),e]})})})]})})]})}function bp({children:e,supportKeys:t}){const{postType:s,themeSupports:o}=(0,c.useSelect)((e=>({postType:e(Ac).getEditedPostAttribute("type"),themeSupports:e(d.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 yp=function({children:e}){return(0,L.jsx)(bp,{supportKeys:"post-thumbnails",children:(0,L.jsx)(Od,{supportKeys:"thumbnail",children:e})})},xp=["image"],vp=(0,fs.__)("Featured image"),Sp=(0,fs.__)("Add a featured image"),wp=(0,L.jsx)("p",{children:(0,fs.__)("To edit the featured image, you need permission to upload media.")});const kp=(0,c.withSelect)((e=>{const{getMedia:t,getPostType:s,hasFinishedResolution:o}=e(d.store),{getCurrentPostId:n,getEditedPostAttribute:i}=e(Ac),r=i("featured_media");return{media:r?t(r,{context:"view"}):null,currentPostId:n(),postType:s(i("type")),featuredImageId:r,isRequestingFeaturedImageMedia:!!r&&!o("getMedia",[r,{context:"view"}])}})),Cp=(0,c.withDispatch)(((e,{noticeOperations:t},{select:s})=>{const{editPost:o}=e(Ac);return{onUpdateImage(e){o({featured_media:e.id})},onDropImage(e){s(h.store).getSettings().mediaUpload({allowedTypes:["image"],filesList:e,onFileChange([e]){o({featured_media:e.id})},onError(e){t.removeAllNotices(),t.createErrorNotice(e)},multiple:!1})},onRemoveImage(){o({featured_media:0})}}})),Pp=(0,p.compose)(Uo.withNotices,kp,Cp,(0,Uo.withFilters)("editor.PostFeaturedImage"))((function({currentPostId:e,featuredImageId:t,onUpdateImage:s,onRemoveImage:o,media:n,postType:i,noticeUI:r,noticeOperations:a,isRequestingFeaturedImageMedia:l}){const d=(0,u.useRef)(!1),[p,g]=(0,u.useState)(!1),{getSettings:_}=(0,c.useSelect)(h.store),{mediaSourceUrl:f}=function(e,t){var s,o;if(!e)return{};const n=(0,m.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,m.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 b(e){_().mediaUpload({allowedTypes:xp,filesList:e,onFileChange([e]){(0,di.isBlobURL)(e?.url)?g(!0):(e&&s(e),g(!1))},onError(e){a.removeAllNotices(),a.createErrorNotice(e)},multiple:!1})}function y(e){return e.alt_text?(0,fs.sprintf)((0,fs.__)("Current image: %s"),e.alt_text):(0,fs.sprintf)((0,fs.__)("The current image has no alternative text. The file name is: %s"),e.media_details.sizes?.full?.file||e.slug)}function x(e){d.current&&e&&(e.focus(),d.current=!1)}const v=!l&&!!t&&!n;return(0,L.jsxs)(yp,{children:[r,(0,L.jsxs)("div",{className:"editor-post-featured-image",children:[n&&(0,L.jsx)("div",{id:`editor-post-featured-image-${t}-describedby`,className:"hidden",children:y(n)}),(0,L.jsx)(h.MediaUploadCheck,{fallback:wp,children:(0,L.jsx)(h.MediaUpload,{title:i?.labels?.featured_image||vp,onSelect:s,unstableFeaturedImageFlow:!0,allowedTypes:xp,modalClass:"editor-post-featured-image__media-modal",render:({open:e})=>(0,L.jsxs)("div",{className:"editor-post-featured-image__container",children:[v?(0,L.jsx)(Uo.Notice,{status:"warning",isDismissible:!1,children:(0,fs.__)("Could not retrieve the featured image data.")}):(0,L.jsxs)(Uo.Button,{__next40pxDefaultSize:!0,ref:x,className:t?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:e,"aria-label":t?(0,fs.__)("Edit or replace the featured image"):null,"aria-describedby":t?`editor-post-featured-image-${t}-describedby`:null,"aria-haspopup":"dialog",disabled:p,accessibleWhenDisabled:!0,children:[!!t&&n&&(0,L.jsx)("img",{className:"editor-post-featured-image__preview-image",src:f,alt:y(n)}),(p||l)&&(0,L.jsx)(Uo.Spinner,{}),!t&&!p&&(i?.labels?.set_featured_image||Sp)]}),!!t&&(0,L.jsxs)(Uo.__experimentalHStack,{className:Di("editor-post-featured-image__actions",{"editor-post-featured-image__actions-missing-image":v,"editor-post-featured-image__actions-is-requesting-image":l}),children:[(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,className:"editor-post-featured-image__action",onClick:e,"aria-haspopup":"dialog",variant:v?"secondary":void 0,children:(0,fs.__)("Replace")}),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,className:"editor-post-featured-image__action",onClick:()=>{o(),d.current=!0},variant:v?"secondary":void 0,isDestructive:v,children:(0,fs.__)("Remove")})]}),(0,L.jsx)(Uo.DropZone,{onFilesDrop:b})]}),value:t})})]})]})})),jp="featured-image";function Ep({withPanelBody:e=!0}){var t;const{postType:s,isEnabled:o,isOpened:n}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t,isEditorPanelEnabled:s,isEditorPanelOpened:o}=e(Ac),{getPostType:n}=e(d.store);return{postType:n(t("type")),isEnabled:s(jp),isOpened:o(jp)}}),[]),{toggleEditorPanelOpened:i}=(0,c.useDispatch)(Ac);return o?e?(0,L.jsx)(yp,{children:(0,L.jsx)(Uo.PanelBody,{title:null!==(t=s?.labels?.featured_image)&&void 0!==t?t:(0,fs.__)("Featured image"),opened:n,onToggle:()=>i(jp),children:(0,L.jsx)(Pp,{})})}):(0,L.jsx)(yp,{children:(0,L.jsx)(Pp,{})}):null}function Tp({children:e}){return(0,c.useSelect)((e=>e(Ac).getEditorSettings().disablePostFormats),[])?null:(0,L.jsx)(Od,{supportKeys:"post-formats",children:e})}const Bp=[{id:"aside",caption:(0,fs.__)("Aside")},{id:"audio",caption:(0,fs.__)("Audio")},{id:"chat",caption:(0,fs.__)("Chat")},{id:"gallery",caption:(0,fs.__)("Gallery")},{id:"image",caption:(0,fs.__)("Image")},{id:"link",caption:(0,fs.__)("Link")},{id:"quote",caption:(0,fs.__)("Quote")},{id:"standard",caption:(0,fs.__)("Standard")},{id:"status",caption:(0,fs.__)("Status")},{id:"video",caption:(0,fs.__)("Video")}].sort(((e,t)=>{const s=e.caption.toUpperCase(),o=t.caption.toUpperCase();return s<o?-1:s>o?1:0}));function Ip(){const e=`post-format-selector-${(0,p.useInstanceId)(Ip)}`,{postFormat:t,suggestedFormat:s,supportedFormats:o}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:s}=e(Ac),o=t("format"),n=e(d.store).getThemeSupports();return{postFormat:null!=o?o:"standard",suggestedFormat:s(),supportedFormats:n.formats}}),[]),n=Bp.filter((e=>o?.includes(e.id)||t===e.id)),i=n.find((e=>e.id===s)),{editPost:r}=(0,c.useDispatch)(Ac),a=e=>r({format:e});return(0,L.jsx)(Tp,{children:(0,L.jsxs)("div",{className:"editor-post-format",children:[(0,L.jsx)(Uo.RadioControl,{className:"editor-post-format__options",label:(0,fs.__)("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,L.jsx)("p",{className:"editor-post-format__suggestion",children:(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>a(i.id),children:(0,fs.sprintf)((0,fs.__)("Apply suggested format: %s"),i.caption)})})]})})}const Np=function({children:e}){const{lastRevisionId:t,revisionsCount:s}=(0,c.useSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:s}=e(Ac);return{lastRevisionId:t(),revisionsCount:s()}}),[]);return!t||s<2?null:(0,L.jsx)(Od,{supportKeys:"revisions",children:e})};function Dp(){return(0,c.useSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:s}=e(Ac);return{lastRevisionId:t(),revisionsCount:s()}}),[])}function Ap(){const{lastRevisionId:e,revisionsCount:t}=Dp();return(0,L.jsx)(Np,{children:(0,L.jsx)(zd,{label:(0,fs.__)("Revisions"),children:(0,L.jsx)(Uo.Button,{href:(0,v.addQueryArgs)("revision.php",{revision:e}),className:"editor-private-post-last-revision__button",text:t,variant:"tertiary",size:"compact"})})})}const Rp=function(){const{lastRevisionId:e,revisionsCount:t}=Dp();return(0,L.jsx)(Np,{children:(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,href:(0,v.addQueryArgs)("revision.php",{revision:e}),className:"editor-post-last-revision__title",icon:hi,iconPosition:"right",text:(0,fs.sprintf)((0,fs.__)("Revisions (%s)"),t)})})};const Mp=function(){return(0,L.jsx)(Np,{children:(0,L.jsx)(Uo.PanelBody,{className:"editor-post-last-revision__panel",children:(0,L.jsx)(Rp,{})})})};function Lp(){const e="core/editor/post-locked-modal-"+(0,p.useInstanceId)(Lp),{autosave:t,updatePostLock:s}=(0,c.useDispatch)(Ac),{isLocked:o,isTakeover:n,user:i,postId:r,postLockUtils:a,activePostLock:l,postType:h,previewLink:g}=(0,c.useSelect)((e=>{const{isPostLocked:t,isPostLockTakeover:s,getPostLockUser:o,getCurrentPostId:n,getActivePostLock:i,getEditedPostAttribute:r,getEditedPostPreviewLink:a,getEditorSettings:l}=e(Ac),{getPostType:c}=e(d.store);return{isLocked:t(),isTakeover:s(),user:o(),postId:n(),postLockUtils:l().postLockUtils,activePostLock:i(),postType:c(r("type")),previewLink:a()}}),[]);if((0,u.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,m.addAction)("heartbeat.send",e,(function(e){o||(e["wp-refresh-post-lock"]={lock:l,post_id:r})})),(0,m.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,m.removeAction)("heartbeat.send",e),(0,m.removeAction)("heartbeat.tick",e),window.removeEventListener("beforeunload",n)}}),[]),!o)return null;const _=i.name,f=i.avatar,b=(0,v.addQueryArgs)("post.php",{"get-post-lock":"1",lockKey:!0,post:r,action:"edit",_wpnonce:a.nonce}),y=(0,v.addQueryArgs)("edit.php",{post_type:h?.slug}),x=(0,fs.__)("Exit editor");return(0,L.jsx)(Uo.Modal,{title:n?(0,fs.__)("Someone else has taken over this post"):(0,fs.__)("This post is already being edited"),focusOnMount:!0,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,isDismissible:!1,className:"editor-post-locked-modal",size:"medium",children:(0,L.jsxs)(Uo.__experimentalHStack,{alignment:"top",spacing:6,children:[!!f&&(0,L.jsx)("img",{src:f,alt:(0,fs.__)("Avatar"),className:"editor-post-locked-modal__avatar",width:64,height:64}),(0,L.jsxs)("div",{children:[!!n&&(0,L.jsx)("p",{children:(0,u.createInterpolateElement)(_?(0,fs.sprintf)((0,fs.__)("<strong>%s</strong> now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved."),_):(0,fs.__)("Another user now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved."),{strong:(0,L.jsx)("strong",{}),PreviewLink:(0,L.jsx)(Uo.ExternalLink,{href:g,children:(0,fs.__)("preview")})})}),!n&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("p",{children:(0,u.createInterpolateElement)(_?(0,fs.sprintf)((0,fs.__)("<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over."),_):(0,fs.__)("Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over."),{strong:(0,L.jsx)("strong",{}),PreviewLink:(0,L.jsx)(Uo.ExternalLink,{href:g,children:(0,fs.__)("preview")})})}),(0,L.jsx)("p",{children:(0,fs.__)("If you take over, the other user will lose editing control to the post, but their changes will be saved.")})]}),(0,L.jsxs)(Uo.__experimentalHStack,{className:"editor-post-locked-modal__buttons",justify:"flex-end",children:[!n&&(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",href:b,children:(0,fs.__)("Take over")}),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"primary",href:y,children:x})]})]})]})})}const Op=function({children:e}){const{hasPublishAction:t,isPublished:s}=(0,c.useSelect)((e=>{var t;const{isCurrentPostPublished:s,getCurrentPost:o}=e(Ac);return{hasPublishAction:null!==(t=o()._links?.["wp:action-publish"])&&void 0!==t&&t,isPublished:s()}}),[]);return s||!t?null:e};const Fp=function(){const e=(0,c.useSelect)((e=>e(Ac).getEditedPostAttribute("status")),[]),{editPost:t}=(0,c.useDispatch)(Ac);return(0,L.jsx)(Op,{children:(0,L.jsx)(Uo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Pending review"),checked:"pending"===e,onChange:()=>{t({status:"pending"===e?"draft":"pending"})}})})};function Vp({className:e,textContent:t,forceIsAutosaveable:s,role:o,onPreview:n}){const{postId:i,currentPostLink:r,previewLink:a,isSaveable:l,isViewable:p}=(0,c.useSelect)((e=>{var t;const s=e(Ac),o=e(d.store).getPostType(s.getCurrentPostType("type")),n=null!==(t=o?.viewable)&&void 0!==t&&t;return n?{postId:s.getCurrentPostId(),currentPostLink:s.getCurrentPostAttribute("link"),previewLink:s.getEditedPostPreviewLink(),isSaveable:s.isEditedPostSaveable(),isViewable:n}:{isViewable:n}}),[]),{__unstableSaveForPreview:h}=(0,c.useDispatch)(Ac);if(!p)return null;const g=`wp-preview-${i}`,_=a||r;return(0,L.jsx)(Uo.Button,{variant:e?void 0:"tertiary",className:e||"editor-post-preview",href:_,target:g,accessibleWhenDisabled:!0,disabled:!l,onClick:async e=>{e.preventDefault();const t=window.open("",g);t.focus(),function(e){let t=(0,u.renderToString)((0,L.jsxs)("div",{className:"editor-post-preview-button__interstitial-message",children:[(0,L.jsxs)(Uo.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 96 96",children:[(0,L.jsx)(Uo.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,L.jsx)(Uo.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,L.jsx)("p",{children:(0,fs.__)("Generating preview…")})]}));t+='\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n\t\t\t}\n\t\t</style>\n\t',t=(0,m.applyFilters)("editor.PostPreview.interstitialMarkup",t),e.write(t),e.title=(0,fs.__)("Generating preview…"),e.close()}(t.document);const o=await h({forceIsAutosaveable:s});t.location=o,n?.()},role:o,size:"compact",children:t||(0,L.jsxs)(L.Fragment,{children:[(0,fs._x)("Preview","imperative verb"),(0,L.jsx)(Uo.VisuallyHidden,{as:"span",children:(0,fs.__)("(opens in a new tab)")})]})})}function zp(){const e=(0,p.useViewportMatch)("medium","<"),{isPublished:t,isBeingScheduled:s,isSaving:o,isPublishing:n,hasPublishAction:i,isAutosaving:r,hasNonPostEntityChanges:a,postStatusHasChanged:l,postStatus:d}=(0,c.useSelect)((e=>{var t;const{isCurrentPostPublished:s,isEditedPostBeingScheduled:o,isSavingPost:n,isPublishingPost:i,getCurrentPost:r,getCurrentPostType:a,isAutosavingPost:l,getPostEdits:c,getEditedPostAttribute:d}=e(Ac);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(Ac).hasNonPostEntityChanges(),postStatusHasChanged:!!c()?.status,postStatus:d("status")}}),[]);return n?(0,fs.__)("Publishing…"):(t||s)&&o&&!r?(0,fs.__)("Saving…"):i?a||t||l&&!["future","publish"].includes(d)||!l&&"future"===d?(0,fs.__)("Save"):s?(0,fs.__)("Schedule"):(0,fs.__)("Publish"):e?(0,fs.__)("Publish"):(0,fs.__)("Submit for Review")}const Up=()=>{};class Hp extends u.Component{constructor(e){super(e),this.createOnClick=this.createOnClick.bind(this),this.closeEntitiesSavedStates=this.closeEntitiesSavedStates.bind(this),this.state={entitiesSavedStatesCallback:!1}}createOnClick(e){return(...t)=>{const{hasNonPostEntityChanges:s,setEntitiesSavedStatesCallback:o}=this.props;return s&&o?(this.setState({entitiesSavedStatesCallback:()=>e(...t)}),o((()=>this.closeEntitiesSavedStates)),Up):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=Up,onToggle:m,visibility:h,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"===h?v="private":s&&(v="future"):v="pending";const S={"aria-disabled":y,className:"editor-post-publish-button",isBusy:!c&&l,variant:"primary",onClick:this.createOnClick((()=>{y||(p(),u(v))})),"aria-haspopup":g?"dialog":void 0},w={"aria-disabled":x,"aria-expanded":o,className:"editor-post-publish-panel__toggle",isBusy:l&&r,variant:"primary",size:"compact",onClick:this.createOnClick((()=>{x||m()})),"aria-haspopup":g?"dialog":void 0},k=d?w:S;return(0,L.jsx)(L.Fragment,{children:(0,L.jsx)(Uo.Button,{...k,className:`${k.className} editor-post-publish-button__button`,size:"compact",children:(0,L.jsx)(zp,{})})})}}const Gp=(0,p.compose)([(0,c.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:m,isSavingNonPostEntityChanges:h,getEditedPostAttribute:g,getPostEdits:_}=e(Ac);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:m(),isSavingNonPostEntityChanges:h()}})),(0,c.withDispatch)((e=>{const{editPost:t,savePost:s}=e(Ac);return{savePostStatus:e=>{t({status:e},{undoIgnore:!0}),s()}}}))])(Hp),$p=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,L.jsx)(M.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"})}),Wp={public:{label:(0,fs.__)("Public"),info:(0,fs.__)("Visible to everyone.")},private:{label:(0,fs.__)("Private"),info:(0,fs.__)("Only visible to site admins and editors.")},password:{label:(0,fs.__)("Password protected"),info:(0,fs.__)("Only those with the password can view this post.")}};function Zp({onClose:e}){const t=(0,p.useInstanceId)(Zp),{status:s,visibility:o,password:n}=(0,c.useSelect)((e=>({status:e(Ac).getEditedPostAttribute("status"),visibility:e(Ac).getEditedPostVisibility(),password:e(Ac).getEditedPostAttribute("password")}))),{editPost:i,savePost:r}=(0,c.useDispatch)(Ac),[a,l]=(0,u.useState)(!!n),[d,m]=(0,u.useState)(!1);return(0,L.jsxs)("div",{className:"editor-post-visibility",children:[(0,L.jsx)(h.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Visibility"),help:(0,fs.__)("Control how this post is viewed."),onClose:e}),(0,L.jsxs)("fieldset",{className:"editor-post-visibility__fieldset",children:[(0,L.jsx)(Uo.VisuallyHidden,{as:"legend",children:(0,fs.__)("Visibility")}),(0,L.jsx)(Yp,{instanceId:t,value:"public",label:Wp.public.label,info:Wp.public.info,checked:"public"===o&&!a,onChange:()=>{i({status:"private"===o?"draft":s,password:""}),l(!1)}}),(0,L.jsx)(Yp,{instanceId:t,value:"private",label:Wp.private.label,info:Wp.private.info,checked:"private"===o,onChange:()=>{m(!0)}}),(0,L.jsx)(Yp,{instanceId:t,value:"password",label:Wp.password.label,info:Wp.password.info,checked:a,onChange:()=>{i({status:"private"===o?"draft":s,password:n||""}),l(!0)}}),a&&(0,L.jsxs)("div",{className:"editor-post-visibility__password",children:[(0,L.jsx)(Uo.VisuallyHidden,{as:"label",htmlFor:`editor-post-visibility__password-input-${t}`,children:(0,fs.__)("Create password")}),(0,L.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,fs.__)("Use a secure password")})]})]}),(0,L.jsx)(Uo.__experimentalConfirmDialog,{isOpen:d,onConfirm:()=>{i({status:"private",password:""}),l(!1),m(!1),r()},onCancel:()=>{m(!1)},confirmButtonText:(0,fs.__)("Publish"),size:"medium",children:(0,fs.__)("Would you like to privately publish this post now?")})]})}function Yp({instanceId:e,value:t,label:s,info:o,...n}){return(0,L.jsxs)("div",{className:"editor-post-visibility__choice",children:[(0,L.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,L.jsx)("label",{htmlFor:`editor-post-${t}-${e}`,className:"editor-post-visibility__label",children:s}),(0,L.jsx)("p",{id:`editor-post-${t}-${e}-description`,className:"editor-post-visibility__info",children:o})]})}function Kp(){return qp()}function qp(){const e=(0,c.useSelect)((e=>e(Ac).getEditedPostVisibility()));return Wp[e]?.label}function Qp(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 Xp(e){const t=Qp(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Jp(e){const t=Qp(e),s=t.getMonth();return t.setFullYear(t.getFullYear(),s+1,0),t.setHours(23,59,59,999),t}Math.pow(10,8);const em=6e4,tm=36e5;function sm(e,t){const s=t?.additionalDigits??2,o=function(e){const t={},s=e.split(om.dateTimeDelimiter);let o;if(s.length>2)return t;/:/.test(s[0])?o=s[0]:(t.date=s[0],o=s[1],om.timeZoneDelimiter.test(t.date)&&(t.date=e.split(om.timeZoneDelimiter)[0],o=e.substr(t.date.length,e.length)));if(o){const e=om.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(nm);if(!s)return new Date(NaN);const o=!!s[4],n=am(s[1]),i=am(s[2])-1,r=am(s[3]),a=am(s[4]),l=am(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<=(cm[t]||(dm(e)?29:28))}(t,i,r)&&function(e,t){return t>=1&&t<=(dm(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(im);if(!t)return NaN;const s=lm(t[1]),o=lm(t[2]),n=lm(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*tm+o*em+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(rm);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*tm+n*em)}(o.timezone),isNaN(r)?new Date(NaN):new Date(i+a+r)}const om={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},nm=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,im=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,rm=/^([+-])(\d{2})(?::?(\d{2}))?$/;function am(e){return e?parseInt(e):1}function lm(e){return e&&parseFloat(e.replace(",","."))||0}const cm=[31,null,31,30,31,30,31,31,30,31,30,31];function dm(e){return e%400==0||e%4==0&&e%100!=0}const{PrivatePublishDateTimePicker:um}=$(h.privateApis);function pm(e){return(0,L.jsx)(mm,{...e,showPopoverHeaderActions:!0,isCompact:!1})}function mm({onClose:e,showPopoverHeaderActions:t,isCompact:s}){const{postDate:o,postType:n}=(0,c.useSelect)((e=>({postDate:e(Ac).getEditedPostAttribute("date"),postType:e(Ac).getCurrentPostType()})),[]),{editPost:i}=(0,c.useDispatch)(Ac),[r,a]=(0,u.useState)(Xp(new Date(o))),l=(0,c.useSelect)((e=>e(d.store).getEntityRecords("postType",n,{status:"publish,future",after:Xp(r).toISOString(),before:Jp(r).toISOString(),exclude:[e(Ac).getCurrentPostId()],per_page:100,_fields:"id,date"})),[r,n]),p=(0,u.useMemo)((()=>(l||[]).map((({date:e})=>({date:new Date(e)})))),[l]),m=(0,x.getSettings)(),h=/a(?!\\)/i.test(m.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,L.jsx)(um,{currentDate:o,onChange:e=>i({date:e}),is12Hour:h,dateOrder:(0,fs._x)("dmy","date order"),events:p,onMonthPreviewed:e=>a(sm(e)),onClose:e,isCompact:s,showPopoverHeaderActions:t})}function hm(e){return gm(e)}function gm({full:e=!1}={}){const{date:t,isFloating:s}=(0,c.useSelect)((e=>({date:e(Ac).getEditedPostAttribute("date"),isFloating:e(Ac).isEditedPostDateFloating()})),[]);return e?_m(t):function(e,{isFloating:t=!1,now:s=new Date}={}){if(!e||t)return(0,fs.__)("Immediately");if(!function(e){const{timezone:t}=(0,x.getSettings)(),s=Number(t.offset),o=e.getTimezoneOffset()/60*-1;return s===o}(s))return _m(e);const o=(0,x.getDate)(e);if(fm(o,s))return(0,fs.sprintf)((0,fs.__)("Today at %s"),(0,x.dateI18n)((0,fs._x)("g:i a","post schedule time format"),o));const n=new Date(s);if(n.setDate(n.getDate()+1),fm(o,n))return(0,fs.sprintf)((0,fs.__)("Tomorrow at %s"),(0,x.dateI18n)((0,fs._x)("g:i a","post schedule time format"),o));if(o.getFullYear()===s.getFullYear())return(0,x.dateI18n)((0,fs._x)("F j g:i a","post schedule date format without year"),o);return(0,x.dateI18n)((0,fs._x)("F j, Y g:i a","post schedule full date format"),o)}(t,{isFloating:s})}function _m(e){const t=(0,x.getDate)(e),s=function(){const{timezone:e}=(0,x.getSettings)();if(e.abbr&&isNaN(Number(e.abbr)))return e.abbr;const t=e.offset<0?"":"+";return`UTC${t}${e.offsetFormatted}`}(),o=(0,x.dateI18n)((0,fs._x)("F j, Y g:i a","post schedule full date format"),t);return(0,fs.isRTL)()?`${s} ${o}`:`${o} ${s}`}function fm(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}const bm=3,ym={per_page:10,orderby:"count",order:"desc",hide_empty:!0,_fields:"id,name,count",context:"view"};function xm({onSelect:e,taxonomy:t}){const{_terms:s,showTerms:o}=(0,c.useSelect)((e=>{const s=e(d.store).getEntityRecords("taxonomy",t.slug,ym);return{_terms:s,showTerms:s?.length>=bm}}),[t.slug]);if(!o)return null;const n=$d(s);return(0,L.jsxs)("div",{className:"editor-post-taxonomies__flat-term-most-used",children:[(0,L.jsx)(Uo.BaseControl.VisualLabel,{as:"h3",className:"editor-post-taxonomies__flat-term-most-used-label",children:t.labels.most_used}),(0,L.jsx)("ul",{role:"list",className:"editor-post-taxonomies__flat-term-most-used-list",children:n.map((t=>(0,L.jsx)("li",{children:(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>e(t),children:t.name})},t.id)))})]})}const vm=[],Sm=100,wm={per_page:Sm,_fields:"id,name",context:"view"},km=(e,t)=>Hd(e).toLowerCase()===Hd(t).toLowerCase(),Cm=(e,t)=>e.map((e=>t.find((t=>km(t.name,e)))?.id)).filter((e=>void 0!==e)),Pm=({children:e,__nextHasNoMarginBottom:t})=>t?(0,L.jsx)(Uo.__experimentalVStack,{spacing:4,children:e}):(0,L.jsx)(u.Fragment,{children:e});function jm({slug:e,__nextHasNoMarginBottom:t}){var s,o;const[n,i]=(0,u.useState)([]),[r,a]=(0,u.useState)(""),l=(0,p.useDebounce)(a,500);t||w()("Bottom margin styles for wp.editor.PostTaxonomiesFlatTermSelector",{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."});const{terms:m,termIds:h,taxonomy:g,hasAssignAction:_,hasCreateAction:f,hasResolvedTerms:b}=(0,c.useSelect)((t=>{var s,o;const{getCurrentPost:n,getEditedPostAttribute:i}=t(Ac),{getEntityRecords:r,getEntityRecord:a,hasFinishedResolution:l}=t(d.store),c=n(),u=a("root","taxonomy",e),p=u?i(u.rest_base):vm,m={...wm,include:p?.join(","),per_page:-1};return{hasCreateAction:!!u&&(null!==(s=c._links?.["wp:action-create-"+u.rest_base])&&void 0!==s&&s),hasAssignAction:!!u&&(null!==(o=c._links?.["wp:action-assign-"+u.rest_base])&&void 0!==o&&o),taxonomy:u,termIds:p,terms:p?.length?r("taxonomy",e,m):vm,hasResolvedTerms:l("getEntityRecords",["taxonomy",e,m])}}),[e]),{searchResults:y}=(0,c.useSelect)((t=>{const{getEntityRecords:s}=t(d.store);return{searchResults:r?s("taxonomy",e,{...wm,search:r}):vm}}),[r,e]);(0,u.useEffect)((()=>{if(b){const e=(null!=m?m:[]).map((e=>Hd(e.name)));i(e)}}),[m,b]);const x=(0,u.useMemo)((()=>(null!=y?y:[]).map((e=>Hd(e.name)))),[y]),{editPost:v}=(0,c.useDispatch)(Ac),{saveEntityRecord:S}=(0,c.useDispatch)(d.store),{createErrorNotice:k}=(0,c.useDispatch)(_s.store);if(!_)return null;function C(e){v({[g.rest_base]:e})}const P=null!==(s=g?.labels?.add_new_item)&&void 0!==s?s:"post_tag"===e?(0,fs.__)("Add new tag"):(0,fs.__)("Add new Term"),j=null!==(o=g?.labels?.singular_name)&&void 0!==o?o:"post_tag"===e?(0,fs.__)("Tag"):(0,fs.__)("Term"),E=(0,fs.sprintf)((0,fs._x)("%s added","term"),j),T=(0,fs.sprintf)((0,fs._x)("%s removed","term"),j),B=(0,fs.sprintf)((0,fs._x)("Remove %s","term"),j);return(0,L.jsxs)(Pm,{__nextHasNoMarginBottom:t,children:[(0,L.jsx)(Uo.FormTokenField,{__next40pxDefaultSize:!0,value:n,suggestions:x,onChange:function(t){const s=[...null!=m?m:[],...null!=y?y:[]],o=t.reduce(((e,t)=>(e.some((e=>e.toLowerCase()===t.toLowerCase()))||e.push(t),e)),[]),n=o.filter((e=>!s.find((t=>km(t.name,e)))));i(o),0!==n.length?f&&Promise.all(n.map((t=>async function(t){try{const s=await S("taxonomy",e,t,{throwOnError:!0});return Gd(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);C(Cm(o,t))})).catch((e=>{k(e.message,{type:"snackbar"}),C(Cm(o,s))})):C(Cm(o,s))},onInputChange:l,maxSuggestions:Sm,label:P,messages:{added:E,removed:T,remove:B},__nextHasNoMarginBottom:t}),(0,L.jsx)(xm,{taxonomy:g,onSelect:function(t){var s;if(h.includes(t.id))return;const o=[...h,t.id],n="post_tag"===e?(0,fs.__)("Tag"):(0,fs.__)("Term"),i=(0,fs.sprintf)((0,fs._x)("%s added","term"),null!==(s=g?.labels?.singular_name)&&void 0!==s?s:n);(0,ms.speak)(i,"assertive"),C(o)}})]})}const Em=(0,Uo.withFilters)("editor.PostTaxonomyType")(jm),Tm=()=>{const e=[(0,fs.__)("Suggestion:"),(0,L.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,fs.__)("Add tags")},"label")];return(0,L.jsxs)(Uo.PanelBody,{initialOpen:!1,title:e,children:[(0,L.jsx)("p",{children:(0,fs.__)("Tags help users and search engines navigate your site and find your content. Add a few keywords to describe your post.")}),(0,L.jsx)(Em,{slug:"post_tag",__nextHasNoMarginBottom:!0})]})},Bm=()=>{const{hasTags:e,isPostTypeSupported:t}=(0,c.useSelect)((e=>{const t=e(Ac).getCurrentPostType(),s=e(d.store).getEntityRecord("root","taxonomy","post_tag"),o=s?.types?.includes(t),n=void 0!==s,i=s&&e(Ac).getEditedPostAttribute(s.rest_base);return{hasTags:!!i?.length,isPostTypeSupported:n&&o}}),[]),[s]=(0,u.useState)(e);return t?s?null:(0,L.jsx)(Tm,{}):null},Im=(e,t)=>Bp.filter((t=>e?.includes(t.id))).find((e=>e.id===t)),Nm=({suggestedPostFormat:e,suggestionText:t,onUpdatePostFormat:s})=>(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>s(e),children:t});function Dm(){const{currentPostFormat:e,suggestion:t}=(0,c.useSelect)((e=>{var t;const{getEditedPostAttribute:s,getSuggestedPostFormat:o}=e(Ac),n=null!==(t=e(d.store).getThemeSupports().formats)&&void 0!==t?t:[];return{currentPostFormat:s("format"),suggestion:Im(n,o())}}),[]),{editPost:s}=(0,c.useDispatch)(Ac),o=[(0,fs.__)("Suggestion:"),(0,L.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,fs.__)("Use a post format")},"label")];return t&&t.id!==e?(0,L.jsxs)(Uo.PanelBody,{initialOpen:!1,title:o,children:[(0,L.jsx)("p",{children:(0,fs.__)("Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.")}),(0,L.jsx)("p",{children:(0,L.jsx)(Nm,{onUpdatePostFormat:e=>s({format:e}),suggestedPostFormat:t.id,suggestionText:(0,fs.sprintf)((0,fs.__)('Apply the "%1$s" format.'),t.caption)})})]}):null}const Am={per_page:-1,orderby:"name",order:"asc",_fields:"id,name,parent",context:"view"},Rm=8,Mm=[];function Lm({slug:e}){var t,s;const[o,n]=(0,u.useState)(!1),[i,r]=(0,u.useState)(""),[a,l]=(0,u.useState)(""),[m,h]=(0,u.useState)(!1),[g,_]=(0,u.useState)(""),[f,b]=(0,u.useState)([]),y=(0,p.useDebounce)(ms.speak,500),{hasCreateAction:x,hasAssignAction:v,terms:S,loading:w,availableTerms:k,taxonomy:C}=(0,c.useSelect)((t=>{var s,o;const{getCurrentPost:n,getEditedPostAttribute:i}=t(Ac),{getEntityRecord:r,getEntityRecords:a,isResolving:l}=t(d.store),c=r("root","taxonomy",e),u=n();return{hasCreateAction:!!c&&(null!==(s=u._links?.["wp:action-create-"+c.rest_base])&&void 0!==s&&s),hasAssignAction:!!c&&(null!==(o=u._links?.["wp:action-assign-"+c.rest_base])&&void 0!==o&&o),terms:c?i(c.rest_base):Mm,loading:l("getEntityRecords",["taxonomy",e,Am]),availableTerms:a("taxonomy",e,Am)||Mm,taxonomy:c}}),[e]),{editPost:P}=(0,c.useDispatch)(Ac),{saveEntityRecord:j}=(0,c.useDispatch)(d.store),E=(0,u.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}(Ud(k),S)),[k]),{createErrorNotice:T}=(0,c.useDispatch)(_s.store);if(!v)return null;const B=e=>{P({[C.rest_base]:e})},I=e=>e.map((e=>(0,L.jsxs)("div",{className:"editor-post-taxonomies__hierarchical-terms-choice",children:[(0,L.jsx)(Uo.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:-1!==S.indexOf(e.id),onChange:()=>{(e=>{const t=S.includes(e)?S.filter((t=>t!==e)):[...S,e];B(t)})(parseInt(e.id,10))},label:(0,Lo.decodeEntities)(e.name)}),!!e.children.length&&(0,L.jsx)("div",{className:"editor-post-taxonomies__hierarchical-terms-subchoices",children:I(e.children)})]},e.id))),N=(t,s,o)=>{var n;return null!==(n=C?.labels?.[t])&&void 0!==n?n:"category"===e?s:o},D=N("add_new_item",(0,fs.__)("Add new category"),(0,fs.__)("Add new term")),A=N("new_item_name",(0,fs.__)("Add new category"),(0,fs.__)("Add new term")),R=N("parent_item",(0,fs.__)("Parent Category"),(0,fs.__)("Parent Term")),M=`— ${R} —`,O=D,F=null!==(t=C?.labels?.search_items)&&void 0!==t?t:(0,fs.__)("Search Terms"),V=null!==(s=C?.name)&&void 0!==s?s:(0,fs.__)("Terms"),z=k.length>=Rm;return(0,L.jsxs)(Uo.Flex,{direction:"column",gap:"4",children:[z&&(0,L.jsx)(Uo.SearchControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:F,placeholder:F,value:g,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};_(e),b(t);const o=s(t),n=(0,fs.sprintf)((0,fs._n)("%d result found.","%d results found.",o),o);y(n,"assertive")}}),(0,L.jsx)("div",{className:"editor-post-taxonomies__hierarchical-terms-list",tabIndex:"0",role:"group","aria-label":V,children:I(""!==g?f:E)}),!w&&x&&(0,L.jsx)(Uo.FlexItem,{children:(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,onClick:()=>{h(!m)},className:"editor-post-taxonomies__hierarchical-terms-add","aria-expanded":m,variant:"link",children:D})}),m&&(0,L.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()))}(k,a,i);if(c)return S.some((e=>e===c.id))||B([...S,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 T(e.message,{type:"snackbar"})}var u;const p="category"===e?(0,fs.__)("Category"):(0,fs.__)("Term"),m=(0,fs.sprintf)((0,fs._x)("%s added","term"),null!==(s=C?.labels?.singular_name)&&void 0!==s?s:p);(0,ms.speak)(m,"assertive"),n(!1),r(""),l(""),B([...S,d.id])},children:(0,L.jsxs)(Uo.Flex,{direction:"column",gap:"4",children:[(0,L.jsx)(Uo.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"editor-post-taxonomies__hierarchical-terms-input",label:A,value:i,onChange:e=>{r(e)},required:!0}),!!k.length&&(0,L.jsx)(Uo.TreeSelect,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:R,noOptionLabel:M,onChange:e=>{l(e)},selectedId:a,tree:E}),(0,L.jsx)(Uo.FlexItem,{children:(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"secondary",type:"submit",className:"editor-post-taxonomies__hierarchical-terms-submit",children:O})})]})})]})}const Om=(0,Uo.withFilters)("editor.PostTaxonomyType")(Lm);const Fm=function(){const e=(0,c.useSelect)((e=>{const t=e(Ac).getCurrentPostType(),{canUser:s,getEntityRecord:o}=e(d.store),n=o("root","taxonomy","category"),i=s("read",{kind:"root",name:"site"})?o("root","site")?.default_category:void 0,r=i?o("taxonomy","category",i):void 0,a=n&&n.types.some((e=>e===t)),l=n&&e(Ac).getEditedPostAttribute(n.rest_base);return!!n&&!!r&&a&&(0===l?.length||1===l?.length&&r?.id===l[0])}),[]),[t,s]=(0,u.useState)(!1);if((0,u.useEffect)((()=>{e&&s(!0)}),[e]),!t)return null;const o=[(0,fs.__)("Suggestion:"),(0,L.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,fs.__)("Assign a category")},"label")];return(0,L.jsxs)(Uo.PanelBody,{initialOpen:!1,title:o,children:[(0,L.jsx)("p",{children:(0,fs.__)("Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.")}),(0,L.jsx)(Om,{slug:"category"})]})};function Vm(e){return Object.fromEntries(Object.entries(function(e){const t=new Set;return Object.fromEntries(e.map((e=>{const s=(0,v.getFilename)(e);let o="";if(s){const e=s.split(".");e.length>1&&e.pop(),o=e.join(".")}return o||(o=Ar()),t.has(o)&&(o=`${o}-${Ar()}`),t.add(o),[e,o]})))}(e)).map((([e,t])=>{const s=window.fetch(e.includes("?")?e:e+"?").then((e=>e.blob())).then((e=>new File([e],`${t}.png`,{type:e.type})));return[e,s]})))}function zm(e){const t=[];return e.forEach((e=>{t.push(e),t.push(...zm(e.innerBlocks))})),t}function Um(e){if("core/image"===e.name||"core/cover"===e.name){const{url:t,alt:s,id:o}=e.attributes;return{url:t,alt:s,id:o}}if("core/media-text"===e.name){const{mediaUrl:t,mediaAlt:s,mediaId:o}=e.attributes;return{url:t,alt:s,id:o}}return{}}function Hm({clientId:e,alt:t,url:s}){const{selectBlock:o}=(0,c.useDispatch)(h.store);return(0,L.jsx)(Uo.__unstableMotion.img,{tabIndex:0,role:"button","aria-label":(0,fs.__)("Select image block."),onClick:()=>{o(e)},onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(o(e),t.preventDefault())},alt:t,src:s,animate:{opacity:1},exit:{opacity:0,scale:0},style:{width:"32px",height:"32px",objectFit:"cover",borderRadius:"2px",cursor:"pointer"},whileHover:{scale:1.08}},e)}function Gm(){const[e,t]=(0,u.useState)(!1),[s,o]=(0,u.useState)(!1),[n,i]=(0,u.useState)(!1),{editorBlocks:r,mediaUpload:a}=(0,c.useSelect)((e=>({editorBlocks:e(h.store).getBlocks(),mediaUpload:e(h.store).getSettings().mediaUpload})),[]),l=zm(r).filter((e=>function(e){return"core/image"===e.name||"core/cover"===e.name?e.attributes.url&&!e.attributes.id:"core/media-text"===e.name?e.attributes.mediaUrl&&!e.attributes.mediaId:void 0}(e))),{updateBlockAttributes:d}=(0,c.useDispatch)(h.store);if(!a||!l.length)return null;const p=[(0,fs.__)("Suggestion:"),(0,L.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,fs.__)("External media")},"label")];return(0,L.jsxs)(Uo.PanelBody,{initialOpen:!0,title:p,children:[(0,L.jsx)("p",{children:(0,fs.__)("Upload external images to the Media Library. Images from different domains may load slowly, display incorrectly, or be removed unexpectedly.")}),(0,L.jsxs)("div",{style:{display:"inline-flex",flexWrap:"wrap",gap:"8px"},children:[(0,L.jsx)(Uo.__unstableAnimatePresence,{onExitComplete:()=>o(!1),children:l.map((e=>{const{url:t,alt:s}=Um(e);return(0,L.jsx)(Hm,{clientId:e.clientId,url:t,alt:s},e.clientId)}))}),e||s?(0,L.jsx)(Uo.Spinner,{}):(0,L.jsx)(Uo.Button,{size:"compact",variant:"primary",onClick:function(){t(!0),i(!1);const e=new Set(l.map((e=>{const{url:t}=Um(e);return t}))),s=Object.fromEntries(Object.entries(Vm([...e])).map((([e,t])=>[e,t.then((e=>new Promise(((t,s)=>{a({filesList:[e],onFileChange:([e])=>{(0,di.isBlobURL)(e.url)||t(e)},onError(){s()}})}))))])));Promise.allSettled(l.map((e=>{const{url:t}=Um(e);return s[t].then((t=>function(e,t){"core/image"!==e.name&&"core/cover"!==e.name||d(e.clientId,{id:t.id,url:t.url}),"core/media-text"===e.name&&d(e.clientId,{mediaId:t.id,mediaUrl:t.url})}(e,t))).then((()=>o(!0))).catch((()=>i(!0)))}))).finally((()=>{t(!1)}))},children:(0,fs._x)("Upload","verb")})]}),n&&(0,L.jsx)("p",{children:(0,fs.__)("Upload failed, try again.")})]})}const $m=function({children:e}){const{isBeingScheduled:t,isRequestingSiteIcon:s,hasPublishAction:o,siteIconUrl:n,siteTitle:i,siteHome:r}=(0,c.useSelect)((e=>{var t;const{getCurrentPost:s,isEditedPostBeingScheduled:o}=e(Ac),{getEntityRecord:n,isResolving:i}=e(d.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,v.filterURLForDisplay)(r.home)}}),[]);let a,l,u=(0,L.jsx)(Uo.Icon,{className:"components-site-icon",size:"36px",icon:$p});return n&&(u=(0,L.jsx)("img",{alt:(0,fs.__)("Site Icon"),className:"components-site-icon",src:n})),s&&(u=null),o?t?(a=(0,fs.__)("Are you ready to schedule?"),l=(0,fs.__)("Your work will be published at the specified date and time.")):(a=(0,fs.__)("Are you ready to publish?"),l=(0,fs.__)("Double-check your settings before publishing.")):(a=(0,fs.__)("Are you ready to submit for review?"),l=(0,fs.__)("Your work will be reviewed and then approved.")),(0,L.jsxs)("div",{className:"editor-post-publish-panel__prepublish",children:[(0,L.jsx)("div",{children:(0,L.jsx)("strong",{children:a})}),(0,L.jsx)("p",{children:l}),(0,L.jsxs)("div",{className:"components-site-card",children:[u,(0,L.jsxs)("div",{className:"components-site-info",children:[(0,L.jsx)("span",{className:"components-site-name",children:(0,Lo.decodeEntities)(i)||(0,fs.__)("(Untitled)")}),(0,L.jsx)("span",{className:"components-site-home",children:r})]})]}),(0,L.jsx)(Gm,{}),o&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.PanelBody,{initialOpen:!1,title:[(0,fs.__)("Visibility:"),(0,L.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,L.jsx)(Kp,{})},"label")],children:(0,L.jsx)(Zp,{})}),(0,L.jsx)(Uo.PanelBody,{initialOpen:!1,title:[(0,fs.__)("Publish:"),(0,L.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,L.jsx)(hm,{})},"label")],children:(0,L.jsx)(pm,{})})]}),(0,L.jsx)(Dm,{}),(0,L.jsx)(Bm,{}),(0,L.jsx)(Fm,{}),e]})},Wm="%postname%",Zm="%pagename%";function Ym({text:e}){const[t,s]=(0,u.useState)(!1),o=(0,u.useRef)(),n=(0,p.useCopyToClipboard)(e,(()=>{s(!0),o.current&&clearTimeout(o.current),o.current=setTimeout((()=>{s(!1)}),4e3)}));return(0,u.useEffect)((()=>()=>{o.current&&clearTimeout(o.current)}),[]),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"secondary",ref:n,children:t?(0,fs.__)("Copied!"):(0,fs.__)("Copy")})}function Km({focusOnMount:e,children:t}){const{post:s,postType:o,isScheduled:n}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPost:s,isCurrentPostScheduled:o}=e(Ac),{getPostType:n}=e(d.store);return{post:s(),postType:n(t("type")),isScheduled:o()}}),[]),i=o?.labels?.singular_name,r=o?.labels?.view_item,a=o?.labels?.add_new_item,l="future"===s.status?(e=>{const{slug:t}=e;return e.permalink_template.includes(Wm)?e.permalink_template.replace(Wm,t):e.permalink_template.includes(Zm)?e.permalink_template.replace(Zm,t):e.permalink_template})(s):s.link,p=(0,v.addQueryArgs)("post-new.php",{post_type:s.type}),m=(0,u.useCallback)((t=>{e&&t&&t.focus()}),[e]),h=n?(0,L.jsxs)(L.Fragment,{children:[(0,fs.__)("is now scheduled. It will go live on")," ",(0,L.jsx)(hm,{}),"."]}):(0,fs.__)("is now live.");return(0,L.jsxs)("div",{className:"post-publish-panel__postpublish",children:[(0,L.jsxs)(Uo.PanelBody,{className:"post-publish-panel__postpublish-header",children:[(0,L.jsx)("a",{ref:m,href:l,children:(0,Lo.decodeEntities)(s.title)||(0,fs.__)("(no title)")})," ",h]}),(0,L.jsxs)(Uo.PanelBody,{children:[(0,L.jsx)("p",{className:"post-publish-panel__postpublish-subheader",children:(0,L.jsx)("strong",{children:(0,fs.__)("What’s next?")})}),(0,L.jsxs)("div",{className:"post-publish-panel__postpublish-post-address-container",children:[(0,L.jsx)(Uo.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"post-publish-panel__postpublish-post-address",readOnly:!0,label:(0,fs.sprintf)((0,fs.__)("%s address"),i),value:(0,v.safeDecodeURIComponent)(l),onFocus:e=>e.target.select()}),(0,L.jsx)("div",{className:"post-publish-panel__postpublish-post-address__copy-button-wrap",children:(0,L.jsx)(Ym,{text:l})})]}),(0,L.jsxs)("div",{className:"post-publish-panel__postpublish-buttons",children:[!n&&(0,L.jsx)(Uo.Button,{variant:"primary",href:l,__next40pxDefaultSize:!0,children:r}),(0,L.jsx)(Uo.Button,{variant:n?"primary":"secondary",__next40pxDefaultSize:!0,href:p,children:a})]})]}),t]})}class qm extends u.Component{constructor(){super(...arguments),this.onSubmit=this.onSubmit.bind(this),this.cancelButtonNode=(0,u.createRef)()}componentDidMount(){this.timeoutID=setTimeout((()=>{this.cancelButtonNode.current.focus()}),0)}componentWillUnmount(){clearTimeout(this.timeoutID)}componentDidUpdate(e){(e.isPublished&&!this.props.isSaving&&this.props.isDirty||this.props.currentPostId!==e.currentPostId)&&this.props.onClose()}onSubmit(){const{onClose:e,hasPublishAction:t,isPostTypeViewable:s}=this.props;t&&s||e()}render(){const{forceIsDirty:e,isBeingScheduled:t,isPublished:s,isPublishSidebarEnabled:o,isScheduled:n,isSaving:i,isSavingNonPostEntityChanges:r,onClose:a,onTogglePublishSidebar:l,PostPublishExtension:c,PrePublishExtension:d,currentPostId:u,...p}=this.props,{hasPublishAction:m,isDirty:h,isPostTypeViewable:g,..._}=p,f=s||n&&t,b=!f&&!i,y=f&&!i;return(0,L.jsxs)("div",{className:"editor-post-publish-panel",..._,children:[(0,L.jsx)("div",{className:"editor-post-publish-panel__header",children:y?(0,L.jsx)(Uo.Button,{size:"compact",onClick:a,icon:Bn,label:(0,fs.__)("Close panel")}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("div",{className:"editor-post-publish-panel__header-cancel-button",children:(0,L.jsx)(Uo.Button,{ref:this.cancelButtonNode,accessibleWhenDisabled:!0,disabled:r,onClick:a,variant:"secondary",size:"compact",children:(0,fs.__)("Cancel")})}),(0,L.jsx)("div",{className:"editor-post-publish-panel__header-publish-button",children:(0,L.jsx)(Gp,{onSubmit:this.onSubmit,forceIsDirty:e})})]})}),(0,L.jsxs)("div",{className:"editor-post-publish-panel__content",children:[b&&(0,L.jsx)($m,{children:d&&(0,L.jsx)(d,{})}),y&&(0,L.jsx)(Km,{focusOnMount:!0,children:c&&(0,L.jsx)(c,{})}),i&&(0,L.jsx)(Uo.Spinner,{})]}),(0,L.jsx)("div",{className:"editor-post-publish-panel__footer",children:(0,L.jsx)(Uo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Always show pre-publish checks."),checked:o,onChange:l})})]})}}const Qm=(0,p.compose)([(0,c.withSelect)((e=>{var t;const{getPostType:s}=e(d.store),{getCurrentPost:o,getCurrentPostId:n,getEditedPostAttribute:i,isCurrentPostPublished:r,isCurrentPostScheduled:a,isEditedPostBeingScheduled:l,isEditedPostDirty:c,isAutosavingPost:u,isSavingPost:p,isSavingNonPostEntityChanges:m}=e(Ac),{isPublishSidebarEnabled:h}=e(Ac),g=s(i("type"));return{hasPublishAction:null!==(t=o()._links?.["wp:action-publish"])&&void 0!==t&&t,isPostTypeViewable:g?.viewable,isBeingScheduled:l(),isDirty:c(),isPublished:r(),isPublishSidebarEnabled:h(),isSaving:p()&&!u(),isSavingNonPostEntityChanges:m(),isScheduled:a(),currentPostId:n()}})),(0,c.withDispatch)(((e,{isPublishSidebarEnabled:t})=>{const{disablePublishSidebar:s,enablePublishSidebar:o}=e(Ac);return{onTogglePublishSidebar:()=>{t?s():o()}}})),Uo.withFocusReturn,Uo.withConstrainedTabbing])(qm),Xm=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M17.3 10.1C17.3 7.60001 15.2 5.70001 12.5 5.70001C10.3 5.70001 8.4 7.10001 7.9 9.00001H7.7C5.7 9.00001 4 10.7 4 12.8C4 14.9 5.7 16.6 7.7 16.6H9.5V15.2H7.7C6.5 15.2 5.5 14.1 5.5 12.9C5.5 11.7 6.5 10.5 7.7 10.5H9L9.3 9.40001C9.7 8.10001 11 7.20001 12.5 7.20001C14.3 7.20001 15.8 8.50001 15.8 10.1V11.4L17.1 11.6C17.9 11.7 18.5 12.5 18.5 13.4C18.5 14.4 17.7 15.2 16.8 15.2H14.5V16.6H16.7C18.5 16.6 19.9 15.1 19.9 13.3C20 11.7 18.8 10.4 17.3 10.1Z M14.1245 14.2426L15.1852 13.182L12.0032 10L8.82007 13.1831L9.88072 14.2438L11.25 12.8745V18H12.75V12.8681L14.1245 14.2426Z"})}),Jm=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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 eh({children:e}){const{hasStickyAction:t,postType:s}=(0,c.useSelect)((e=>{var t;const s=e(Ac).getCurrentPost();return{hasStickyAction:null!==(t=s._links?.["wp:action-sticky"])&&void 0!==t&&t,postType:e(Ac).getCurrentPostType()}}),[]);return"post"===s&&t?e:null}function th(){const e=(0,c.useSelect)((e=>{var t;return null!==(t=e(Ac).getEditedPostAttribute("sticky"))&&void 0!==t&&t}),[]),{editPost:t}=(0,c.useDispatch)(Ac);return(0,L.jsx)(eh,{children:(0,L.jsx)(Uo.CheckboxControl,{className:"editor-post-sticky__checkbox-control",label:(0,fs.__)("Sticky"),help:(0,fs.__)("Pin this post to the top of the blog"),checked:e,onChange:()=>t({sticky:!e}),__nextHasNoMarginBottom:!0})})}const sh={"auto-draft":{label:(0,fs.__)("Draft"),icon:Oi},draft:{label:(0,fs.__)("Draft"),icon:Oi},pending:{label:(0,fs.__)("Pending"),icon:Vi},private:{label:(0,fs.__)("Private"),icon:zi},future:{label:(0,fs.__)("Scheduled"),icon:Fi},publish:{label:(0,fs.__)("Published"),icon:Ui}},oh=[{label:(0,fs.__)("Draft"),value:"draft",description:(0,fs.__)("Not ready to publish.")},{label:(0,fs.__)("Pending"),value:"pending",description:(0,fs.__)("Waiting for review before publishing.")},{label:(0,fs.__)("Private"),value:"private",description:(0,fs.__)("Only visible to site admins and editors.")},{label:(0,fs.__)("Scheduled"),value:"future",description:(0,fs.__)("Publish automatically on a chosen date.")},{label:(0,fs.__)("Published"),value:"publish",description:(0,fs.__)("Visible to everyone.")}],nh=[T,B,I,N];function ih(){const{status:e,date:t,password:s,postId:o,postType:n,canEdit:i}=(0,c.useSelect)((e=>{var t;const{getEditedPostAttribute:s,getCurrentPostId:o,getCurrentPostType:n,getCurrentPost:i}=e(Ac);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,u.useState)(!!s),l=(0,p.useInstanceId)(ih,"editor-change-status__password-input"),{editEntityRecord:m}=(0,c.useDispatch)(d.store),[g,_]=(0,u.useState)(null),f=(0,u.useMemo)((()=>({anchor:g,"aria-label":(0,fs.__)("Status & visibility"),headerTitle:(0,fs.__)("Status & visibility"),placement:"left-start",offset:36,shift:!0})),[g]);if(nh.includes(n))return null;const b=({status:i=e,password:r=s,date:a=t})=>{m("postType",n,o,{status:i,date:a,password:r})},y=e=>{a(e),e||b({password:""})},x=o=>{let n=t,i=s;"future"===e&&new Date(t)>new Date&&(n=null),"private"===o&&s&&(i=""),b({status:o,date:n,password:i})};return(0,L.jsx)(zd,{label:(0,fs.__)("Status"),ref:_,children:i?(0,L.jsx)(Uo.Dropdown,{className:"editor-post-status",contentClassName:"editor-change-status__content",popoverProps:f,focusOnMount:!0,renderToggle:({onToggle:t,isOpen:s})=>(0,L.jsx)(Uo.Button,{className:"editor-post-status__toggle",variant:"tertiary",size:"compact",onClick:t,icon:sh[e]?.icon,"aria-label":(0,fs.sprintf)((0,fs.__)("Change status: %s"),sh[e]?.label),"aria-expanded":s,children:sh[e]?.label}),renderContent:({onClose:t})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(h.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Status & visibility"),onClose:t}),(0,L.jsx)("form",{children:(0,L.jsxs)(Uo.__experimentalVStack,{spacing:4,children:[(0,L.jsx)(Uo.RadioControl,{className:"editor-change-status__options",hideLabelFromVision:!0,label:(0,fs.__)("Status"),options:oh,onChange:x,selected:"auto-draft"===e?"draft":e}),"future"===e&&(0,L.jsx)("div",{className:"editor-change-status__publish-date-wrapper",children:(0,L.jsx)(mm,{showPopoverHeaderActions:!1,isCompact:!0})}),"private"!==e&&(0,L.jsxs)(Uo.__experimentalVStack,{as:"fieldset",spacing:4,className:"editor-change-status__password-fieldset",children:[(0,L.jsx)(Uo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Password protected"),help:(0,fs.__)("Only visible to those who know the password"),checked:r,onChange:y}),r&&(0,L.jsx)("div",{className:"editor-change-status__password-input",children:(0,L.jsx)(Uo.TextControl,{label:(0,fs.__)("Password"),onChange:e=>b({password:e}),value:s,placeholder:(0,fs.__)("Use a secure password"),type:"text",id:l,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,maxLength:255})})]}),(0,L.jsx)(th,{})]})})]})}):(0,L.jsx)("div",{className:"editor-post-status is-read-only",children:sh[e]?.label})})}function rh({forceIsDirty:e}){const[t,s]=(0,u.useState)(!1),o=(0,p.useViewportMatch)("small"),{isAutosaving:n,isDirty:i,isNew:r,isPublished:a,isSaveable:l,isSaving:d,isScheduled:m,hasPublishAction:h,showIconLabels:g,postStatus:_,postStatusHasChanged:f}=(0,c.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(Ac),{get:m}=t(k.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:m("core","showIconLabels"),postStatus:u("status"),postStatusHasChanged:!!p()?.status}}),[e]),b="pending"===_,{savePost:y}=(0,c.useDispatch)(Ac),x=(0,p.usePrevious)(d);if((0,u.useEffect)((()=>{let e;return x&&!d&&(s(!0),e=setTimeout((()=>{s(!1)}),1e3)),()=>clearTimeout(e)}),[d]),!h&&b)return null;const v=!["pending","draft","auto-draft"].includes(_)&&oh.map((({value:e})=>e)).includes(_);if(a||m||v||f&&["pending","draft"].includes(_))return null;const S=b?(0,fs.__)("Save as pending"):(0,fs.__)("Save draft"),w=(0,fs.__)("Save"),C=t||!r&&!i,P=d||C,j=d||C||!l;let E;return d?E=n?(0,fs.__)("Autosaving"):(0,fs.__)("Saving"):C?E=(0,fs.__)("Saved"):o?E=S:g&&(E=w),(0,L.jsxs)(Uo.Button,{className:l||d?Di({"editor-post-save-draft":!P,"editor-post-saved-state":P,"is-saving":d,"is-autosaving":n,"is-saved":C,[(0,Uo.__unstableGetAnimateClassName)({type:"loading"})]:d}):void 0,onClick:j?void 0:()=>y(),shortcut:j?void 0:wl.displayShortcut.primary("s"),variant:"tertiary",size:"compact",icon:o?void 0:Xm,label:E||S,"aria-disabled":j,children:[P&&(0,L.jsx)(fr,{icon:C?Ho:Jm}),E]})}function ah({children:e}){return(0,c.useSelect)((e=>{var t;return null!==(t=e(Ac).getCurrentPost()._links?.["wp:action-publish"])&&void 0!==t&&t}),[])?e:null}const lh=[T,B,I,N];function ch(){const[e,t]=(0,u.useState)(null),s=(0,c.useSelect)((e=>e(Ac).getCurrentPostType()),[]),o=(0,u.useMemo)((()=>({anchor:e,"aria-label":(0,fs.__)("Change publish date"),placement:"left-start",offset:36,shift:!0})),[e]),n=gm(),i=gm({full:!0});return lh.includes(s)?null:(0,L.jsx)(ah,{children:(0,L.jsx)(zd,{label:(0,fs.__)("Publish"),ref:t,children:(0,L.jsx)(Uo.Dropdown,{popoverProps:o,focusOnMount:!0,className:"editor-post-schedule__panel-dropdown",contentClassName:"editor-post-schedule__dialog",renderToggle:({onToggle:e,isOpen:t})=>(0,L.jsx)(Uo.Button,{size:"compact",className:"editor-post-schedule__dialog-toggle",variant:"tertiary",tooltipPosition:"middle left",onClick:e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change date: %s"),n),label:i,showTooltip:n!==i,"aria-expanded":t,children:n}),renderContent:({onClose:e})=>(0,L.jsx)(pm,{onClose:e})})})})}function dh(){w()("wp.editor.PostSwitchToDraftButton",{since:"6.7",version:"6.9"});const[e,t]=(0,u.useState)(!1),{editPost:s,savePost:o}=(0,c.useDispatch)(Ac),{isSaving:n,isPublished:i,isScheduled:r}=(0,c.useSelect)((e=>{const{isSavingPost:t,isCurrentPostPublished:s,isCurrentPostScheduled:o}=e(Ac);return{isSaving:t(),isPublished:s(),isScheduled:o()}}),[]),a=n||!i&&!r;let l,d;i?(l=(0,fs.__)("Are you sure you want to unpublish this post?"),d=(0,fs.__)("Unpublish")):r&&(l=(0,fs.__)("Are you sure you want to unschedule this post?"),d=(0,fs.__)("Unschedule"));return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,className:"editor-post-switch-to-draft",onClick:()=>{a||t(!0)},"aria-disabled":a,variant:"secondary",style:{flexGrow:"1",justifyContent:"center"},children:(0,fs.__)("Switch to draft")}),(0,L.jsx)(Uo.__experimentalConfirmDialog,{isOpen:e,onConfirm:()=>{t(!1),s({status:"draft"}),o()},onCancel:()=>t(!1),confirmButtonText:d,children:l})]})}function uh(){const{syncStatus:e,postType:t}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Ac),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,L.jsx)(zd,{label:(0,fs.__)("Sync status"),children:(0,L.jsx)("div",{className:"editor-post-sync-status__value",children:"unsynced"===e?(0,fs._x)("Not synced","pattern (singular)"):(0,fs._x)("Synced","pattern (singular)")})})}const ph=e=>e;const mh=function({taxonomyWrapper:e=ph}){const{postType:t,taxonomies:s}=(0,c.useSelect)((e=>({postType:e(Ac).getCurrentPostType(),taxonomies:e(d.store).getEntityRecords("root","taxonomy",{per_page:-1})})),[]);return(null!=s?s:[]).filter((e=>e.types.includes(t)&&e.visibility?.show_ui)).map((t=>{const s=t.hierarchical?Om:Em,o={slug:t.slug,...t.hierarchical?{}:{__nextHasNoMarginBottom:!0}};return(0,L.jsx)(u.Fragment,{children:e((0,L.jsx)(s,{...o}),t)},`taxonomy-${t.slug}`)}))};function hh({children:e}){const t=(0,c.useSelect)((e=>{const t=e(Ac).getCurrentPostType(),s=e(d.store).getEntityRecords("root","taxonomy",{per_page:-1});return s?.some((e=>e.types.includes(t)))}),[]);return t?e:null}function gh({taxonomy:e,children:t}){const s=e?.slug,o=s?`taxonomy-panel-${s}`:"",{isEnabled:n,isOpened:i}=(0,c.useSelect)((e=>{const{isEditorPanelEnabled:t,isEditorPanelOpened:n}=e(Ac);return{isEnabled:!!s&&t(o),isOpened:!!s&&n(o)}}),[o,s]),{toggleEditorPanelOpened:r}=(0,c.useDispatch)(Ac);if(!n)return null;const a=e?.labels?.menu_name;return a?(0,L.jsx)(Uo.PanelBody,{title:a,opened:i,onToggle:()=>r(o),children:t}):null}function _h(){return(0,L.jsx)(hh,{children:(0,L.jsx)(mh,{taxonomyWrapper:(e,t)=>(0,L.jsx)(gh,{taxonomy:t,children:e})})})}var fh=s(4132);function bh(){const e=(0,p.useInstanceId)(bh),{content:t,blocks:s,type:o,id:n}=(0,c.useSelect)((e=>{const{getEditedEntityRecord:t}=e(d.store),{getCurrentPostType:s,getCurrentPostId:o}=e(Ac),n=s(),i=o(),r=t("postType",n,i);return{content:r?.content,blocks:r?.blocks,type:n,id:i}}),[]),{editEntityRecord:i}=(0,c.useDispatch)(d.store),r=(0,u.useMemo)((()=>t instanceof Function?t({blocks:s}):s?(0,y.__unstableSerializeAndClean)(s):t),[t,s]);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.VisuallyHidden,{as:"label",htmlFor:`post-content-${e}`,children:(0,fs.__)("Type text or HTML")}),(0,L.jsx)(fh.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,fs.__)("Start writing with text or HTML")})]})}const yh="wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text",xh=/[\r\n]+/g;function vh(e){const t=(0,u.useRef)(),{isCleanNewPost:s}=(0,c.useSelect)((e=>{const{isCleanNewPost:t}=e(Ac);return{isCleanNewPost:t()}}),[]);return(0,u.useImperativeHandle)(e,(()=>({focus:()=>{t?.current?.focus()}}))),(0,u.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 Sh(){const{editPost:e}=(0,c.useDispatch)(Ac),{title:t}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Ac);return{title:t("title")}}),[]);return{title:t,setTitle:function(t){e({title:t})}}}const wh=(0,u.forwardRef)(((e,t)=>{const{placeholder:s}=(0,c.useSelect)((e=>{const{getSettings:t}=e(h.store),{titlePlaceholder:s}=t();return{placeholder:s}}),[]),[o,n]=(0,u.useState)(!1),{ref:i}=vh(t),{title:r,setTitle:a}=Sh(),[l,d]=(0,u.useState)({}),{clearSelectedBlock:m,insertBlocks:g,insertDefaultBlock:_}=(0,c.useDispatch)(h.store),f=(0,Lo.decodeEntities)(s)||(0,fs.__)("Add title"),{value:b,onChange:x,ref:v}=(0,Jc.__unstableUseRichText)({value:r,onChange(e){a(e.replace(xh," "))},placeholder:f,selectionStart:l.start,selectionEnd:l.end,onSelectionChange(e,t){d((s=>{const{start:o,end:n}=s;return o===e&&n===t?s:{start:e,end:t}}))},__unstableDisableFormats:!1});function S(e){g(e,0)}const w=Di(yh,{"is-selected":o});return(0,L.jsx)("h1",{ref:(0,p.useMergeRefs)([v,i]),contentEditable:!0,className:w,"aria-label":f,role:"textbox","aria-multiline":"true",onFocus:function(){n(!0),m()},onBlur:function(){n(!1),d({})},onKeyDown:function(e){e.keyCode===wl.ENTER&&(e.preventDefault(),_(void 0,void 0,0))},onPaste:function(e){const t=e.clipboardData;let s="",o="";try{s=t.getData("text/plain"),o=t.getData("text/html")}catch(e){return}window.console.log("Received HTML:\n\n",o),window.console.log("Received plain text:\n\n",s);const n=(0,y.pasteHandler)({HTML:o,plainText:s});if(e.preventDefault(),n.length)if("string"!=typeof n){const[e]=n;if(r||"core/heading"!==e.name&&"core/paragraph"!==e.name)S(n);else{const t=(0,Kc.__unstableStripHTML)(e.attributes.content);a(t),S(n.slice(1))}}else{const e=(0,Kc.__unstableStripHTML)(n);x((0,Jc.insert)(b,(0,Jc.create)({html:e})))}}})})),kh=(0,u.forwardRef)(((e,t)=>(0,L.jsx)(Od,{supportKeys:"title",children:(0,L.jsx)(wh,{ref:t})})));const Ch=(0,u.forwardRef)((function(e,t){const{placeholder:s}=(0,c.useSelect)((e=>{const{getSettings:t}=e(h.store),{titlePlaceholder:s}=t();return{placeholder:s}}),[]),[o,n]=(0,u.useState)(!1),{title:i,setTitle:r}=Sh(),{ref:a}=vh(t),l=Di(yh,{"is-selected":o,"is-raw-text":!0}),d=(0,Lo.decodeEntities)(s)||(0,fs.__)("Add title");return(0,L.jsx)(Uo.TextareaControl,{ref:a,value:i,onChange:function(e){r(e.replace(xh," "))},onFocus:function(){n(!0)},onBlur:function(){n(!1)},label:s,className:l,placeholder:d,hideLabelFromVision:!0,autoComplete:"off",dir:"auto",rows:1,__nextHasNoMarginBottom:!0})}));function Ph({children:e}){const{canTrashPost:t}=(0,c.useSelect)((e=>{const{isEditedPostNew:t,getCurrentPostId:s,getCurrentPostType:o}=e(Ac),{canUser:n}=e(d.store),i=o(),r=s(),a=t(),l=!!r&&n("delete",{kind:"postType",name:i,id:r});return{canTrashPost:(!a||r)&&l&&!R.includes(i)}}),[]);return t?e:null}function jh({onActionPerformed:e}){const t=(0,c.useRegistry)(),{isNew:s,isDeleting:o,postId:n,title:i}=(0,c.useSelect)((e=>{const t=e(Ac);return{isNew:t.isEditedPostNew(),isDeleting:t.isDeletingPost(),postId:t.getCurrentPostId(),title:t.getCurrentPostAttribute("title")}}),[]),{trashPost:r}=(0,c.useDispatch)(Ac),[a,l]=(0,u.useState)(!1);if(s||!n)return null;return(0,L.jsxs)(Ph,{children:[(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,className:"editor-post-trash",isDestructive:!0,variant:"secondary",isBusy:o,"aria-disabled":o,onClick:o?void 0:()=>l(!0),children:(0,fs.__)("Move to trash")}),(0,L.jsx)(Uo.__experimentalConfirmDialog,{isOpen:a,onConfirm:async()=>{l(!1),await r();const s=await t.resolveSelect(Ac).getCurrentPost();e?.("move-to-trash",[s])},onCancel:()=>l(!1),confirmButtonText:(0,fs.__)("Move to trash"),size:"small",children:(0,fs.sprintf)((0,fs.__)('Are you sure you want to move "%s" to the trash?'),i)})]})}function Eh({onClose:e}){const{isEditable:t,postSlug:s,postLink:o,permalinkPrefix:n,permalinkSuffix:i,permalink:r}=(0,c.useSelect)((e=>{var t;const s=e(Ac).getCurrentPost(),o=e(Ac).getCurrentPostType(),n=e(d.store).getPostType(o),i=e(Ac).getPermalinkParts(),r=null!==(t=s?._links?.["wp:action-publish"])&&void 0!==t&&t;return{isEditable:e(Ac).isPermalinkEditable()&&r,postSlug:(0,v.safeDecodeURIComponent)(e(Ac).getEditedPostSlug()),viewPostLabel:n?.labels.view_item,postLink:s.link,permalinkPrefix:i?.prefix,permalinkSuffix:i?.suffix,permalink:(0,v.safeDecodeURIComponent)(e(Ac).getPermalink())}}),[]),{editPost:a}=(0,c.useDispatch)(Ac),{createNotice:l}=(0,c.useDispatch)(_s.store),[m,g]=(0,u.useState)(!1),_=(0,p.useCopyToClipboard)(r,(()=>{l("info",(0,fs.__)("Copied Permalink to clipboard."),{isDismissible:!0,type:"snackbar"})})),f="editor-post-url__slug-description-"+(0,p.useInstanceId)(Eh);return(0,L.jsxs)("div",{className:"editor-post-url",children:[(0,L.jsx)(h.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Slug"),onClose:e}),(0,L.jsxs)(Uo.__experimentalVStack,{spacing:3,children:[t&&(0,L.jsx)("p",{className:"editor-post-url__intro",children:(0,u.createInterpolateElement)((0,fs.__)("<span>Customize the last part of the Permalink.</span> <a>Learn more.</a>"),{span:(0,L.jsx)("span",{id:f}),a:(0,L.jsx)(Uo.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink")})})}),(0,L.jsxs)("div",{children:[t&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.__experimentalInputControl,{__next40pxDefaultSize:!0,prefix:(0,L.jsx)(Uo.__experimentalInputControlPrefixWrapper,{children:"/"}),suffix:(0,L.jsx)(Uo.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,L.jsx)(Uo.Button,{icon:Ki,ref:_,size:"small",label:"Copy"})}),label:(0,fs.__)("Slug"),hideLabelFromVision:!0,value:m?"":s,autoComplete:"off",spellCheck:"false",type:"text",className:"editor-post-url__input",onChange:e=>{a({slug:e}),e?m&&g(!1):m||g(!0)},onBlur:e=>{a({slug:(0,v.cleanForSlug)(e.target.value)}),m&&g(!1)},"aria-describedby":f}),(0,L.jsxs)("p",{className:"editor-post-url__permalink",children:[(0,L.jsx)("span",{className:"editor-post-url__permalink-visual-label",children:(0,fs.__)("Permalink:")}),(0,L.jsxs)(Uo.ExternalLink,{className:"editor-post-url__link",href:o,target:"_blank",children:[(0,L.jsx)("span",{className:"editor-post-url__link-prefix",children:n}),(0,L.jsx)("span",{className:"editor-post-url__link-slug",children:s}),(0,L.jsx)("span",{className:"editor-post-url__link-suffix",children:i})]})]})]}),!t&&(0,L.jsx)(Uo.ExternalLink,{className:"editor-post-url__link",href:o,target:"_blank",children:o})]})]})]})}function Th({children:e}){const t=(0,c.useSelect)((e=>{const t=e(Ac).getCurrentPostType(),s=e(d.store).getPostType(t);if(!s?.viewable)return!1;if(!e(Ac).getCurrentPost().link)return!1;return!!e(Ac).getPermalinkParts()}),[]);return t?e:null}function Bh(){return Ih()}function Ih(){const e=(0,c.useSelect)((e=>e(Ac).getPermalink()),[]);return(0,v.filterURLForDisplay)((0,v.safeDecodeURIComponent)(e))}function Nh(){const{isFrontPage:e}=(0,c.useSelect)((e=>{const{getCurrentPostId:t}=e(Ac),{getEditedEntityRecord:s,canUser:o}=e(d.store),n=o("read",{kind:"root",name:"site"})?s("root","site"):void 0,i=t();return{isFrontPage:n?.page_on_front===i}}),[]),[t,s]=(0,u.useState)(null),o=(0,u.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]),n=e?(0,fs.__)("Link"):(0,fs.__)("Slug");return(0,L.jsx)(Th,{children:(0,L.jsxs)(zd,{label:n,ref:s,children:[!e&&(0,L.jsx)(Uo.Dropdown,{popoverProps:o,className:"editor-post-url__panel-dropdown",contentClassName:"editor-post-url__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,L.jsx)(Dh,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,L.jsx)(Eh,{onClose:e})}),e&&(0,L.jsx)(Ah,{})]})})}function Dh({isOpen:e,onClick:t}){const{slug:s}=(0,c.useSelect)((e=>({slug:e(Ac).getEditedPostSlug()})),[]),o=(0,v.safeDecodeURIComponent)(s);return(0,L.jsx)(Uo.Button,{size:"compact",className:"editor-post-url__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change link: %s"),o),onClick:t,children:(0,L.jsx)(L.Fragment,{children:o})})}function Ah(){const{postLink:e}=(0,c.useSelect)((e=>{const{getCurrentPost:t}=e(Ac);return{postLink:t()?.link}}),[]);return(0,L.jsx)(Uo.ExternalLink,{className:"editor-post-url__front-page-link",href:e,target:"_blank",children:e})}function Rh({render:e}){return e({canEdit:(0,c.useSelect)((e=>{var t;return null!==(t=e(Ac).getCurrentPost()._links?.["wp:action-publish"])&&void 0!==t&&t}))})}const Mh=(0,L.jsx)(M.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,L.jsx)(M.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"})}),Lh=window.wp.wordcount;function Oh(){const e=(0,c.useSelect)((e=>e(Ac).getEditedPostAttribute("content")),[]),t=(0,fs._x)("words","Word count type. Do not translate!");return(0,L.jsx)("span",{className:"word-count",children:(0,Lh.count)(e,t)})}const Fh=189;function Vh(){const e=(0,c.useSelect)((e=>e(Ac).getEditedPostAttribute("content")),[]),t=(0,fs._x)("words","Word count type. Do not translate!"),s=Math.round((0,Lh.count)(e,t)/Fh),o=0===s?(0,u.createInterpolateElement)((0,fs.__)("<span>< 1</span> minute"),{span:(0,L.jsx)("span",{})}):(0,u.createInterpolateElement)((0,fs.sprintf)((0,fs._n)("<span>%s</span> minute","<span>%s</span> minutes",s),s),{span:(0,L.jsx)("span",{})});return(0,L.jsx)("span",{className:"time-to-read",children:o})}function zh(){const e=(0,c.useSelect)((e=>e(Ac).getEditedPostAttribute("content")),[]);return(0,Lh.count)(e,"characters_including_spaces")}const Uh=function({hasOutlineItemsDisabled:e,onRequestClose:t}){const{headingCount:s,paragraphCount:o,numberOfBlocks:n}=(0,c.useSelect)((e=>{const{getGlobalBlockCount:t}=e(h.store);return{headingCount:t("core/heading"),paragraphCount:t("core/paragraph"),numberOfBlocks:t()}}),[]);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("div",{className:"table-of-contents__wrapper",role:"note","aria-label":(0,fs.__)("Document Statistics"),tabIndex:"0",children:(0,L.jsxs)("ul",{role:"list",className:"table-of-contents__counts",children:[(0,L.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Words"),(0,L.jsx)(Oh,{})]}),(0,L.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Characters"),(0,L.jsx)("span",{className:"table-of-contents__number",children:(0,L.jsx)(zh,{})})]}),(0,L.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Time to read"),(0,L.jsx)(Vh,{})]}),(0,L.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Headings"),(0,L.jsx)("span",{className:"table-of-contents__number",children:s})]}),(0,L.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Paragraphs"),(0,L.jsx)("span",{className:"table-of-contents__number",children:o})]}),(0,L.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Blocks"),(0,L.jsx)("span",{className:"table-of-contents__number",children:n})]})]})}),s>0&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("hr",{}),(0,L.jsx)("h2",{className:"table-of-contents__title",children:(0,fs.__)("Document Outline")}),(0,L.jsx)(ld,{onSelect:t,hasOutlineItemsDisabled:e})]})]})};const Hh=(0,u.forwardRef)((function({hasOutlineItemsDisabled:e,repositionDropdown:t,...s},o){const n=(0,c.useSelect)((e=>!!e(h.store).getBlockCount()),[]);return(0,L.jsx)(Uo.Dropdown,{popoverProps:{placement:t?"right":"bottom"},className:"table-of-contents",contentClassName:"table-of-contents__popover",renderToggle:({isOpen:e,onToggle:t})=>(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,...s,ref:o,onClick:n?t:void 0,icon:Mh,"aria-expanded":e,"aria-haspopup":"true",label:(0,fs.__)("Details"),tooltipPosition:"bottom","aria-disabled":!n}),renderContent:({onClose:t})=>(0,L.jsx)(Uh,{onRequestClose:t,hasOutlineItemsDisabled:e})})}));function Gh(){const{__experimentalGetDirtyEntityRecords:e}=(0,c.useSelect)(d.store);return(0,u.useEffect)((()=>{const t=t=>{if(e().length>0)return t.returnValue=(0,fs.__)("You have unsaved changes. If you proceed, they will be lost."),t.returnValue};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}}),[e]),null}const $h=window.wp.serverSideRender;var Wh=s.n($h);function Zh(e,t,s=[]){const o=(0,u.forwardRef)(((s,o)=>(w()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),(0,L.jsx)(t,{ref:o,...s}))));return s.forEach((s=>{o[s]=Zh(e+"."+s,t[s])})),o}function Yh(e,t){return(...s)=>(w()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),t(...s))}const Kh=Zh("RichText",h.RichText,["Content"]);Kh.isEmpty=Yh("RichText.isEmpty",h.RichText.isEmpty);const qh=Zh("Autocomplete",h.Autocomplete),Qh=Zh("AlignmentToolbar",h.AlignmentToolbar),Xh=Zh("BlockAlignmentToolbar",h.BlockAlignmentToolbar),Jh=Zh("BlockControls",h.BlockControls,["Slot"]),eg=Zh("BlockEdit",h.BlockEdit),tg=Zh("BlockEditorKeyboardShortcuts",h.BlockEditorKeyboardShortcuts),sg=Zh("BlockFormatControls",h.BlockFormatControls,["Slot"]),og=Zh("BlockIcon",h.BlockIcon),ng=Zh("BlockInspector",h.BlockInspector),ig=Zh("BlockList",h.BlockList),rg=Zh("BlockMover",h.BlockMover),ag=Zh("BlockNavigationDropdown",h.BlockNavigationDropdown),lg=Zh("BlockSelectionClearer",h.BlockSelectionClearer),cg=Zh("BlockSettingsMenu",h.BlockSettingsMenu),dg=Zh("BlockTitle",h.BlockTitle),ug=Zh("BlockToolbar",h.BlockToolbar),pg=Zh("ColorPalette",h.ColorPalette),mg=Zh("ContrastChecker",h.ContrastChecker),hg=Zh("CopyHandler",h.CopyHandler),gg=Zh("DefaultBlockAppender",h.DefaultBlockAppender),_g=Zh("FontSizePicker",h.FontSizePicker),fg=Zh("Inserter",h.Inserter),bg=Zh("InnerBlocks",h.InnerBlocks,["ButtonBlockAppender","DefaultBlockAppender","Content"]),yg=Zh("InspectorAdvancedControls",h.InspectorAdvancedControls,["Slot"]),xg=Zh("InspectorControls",h.InspectorControls,["Slot"]),vg=Zh("PanelColorSettings",h.PanelColorSettings),Sg=Zh("PlainText",h.PlainText),wg=Zh("RichTextShortcut",h.RichTextShortcut),kg=Zh("RichTextToolbarButton",h.RichTextToolbarButton),Cg=Zh("__unstableRichTextInputEvent",h.__unstableRichTextInputEvent),Pg=Zh("MediaPlaceholder",h.MediaPlaceholder),jg=Zh("MediaUpload",h.MediaUpload),Eg=Zh("MediaUploadCheck",h.MediaUploadCheck),Tg=Zh("MultiSelectScrollIntoView",h.MultiSelectScrollIntoView),Bg=Zh("NavigableToolbar",h.NavigableToolbar),Ig=Zh("ObserveTyping",h.ObserveTyping),Ng=Zh("SkipToSelectedBlock",h.SkipToSelectedBlock),Dg=Zh("URLInput",h.URLInput),Ag=Zh("URLInputButton",h.URLInputButton),Rg=Zh("URLPopover",h.URLPopover),Mg=Zh("Warning",h.Warning),Lg=Zh("WritingFlow",h.WritingFlow),Og=Yh("createCustomColorsHOC",h.createCustomColorsHOC),Fg=Yh("getColorClassName",h.getColorClassName),Vg=Yh("getColorObjectByAttributeValues",h.getColorObjectByAttributeValues),zg=Yh("getColorObjectByColorValue",h.getColorObjectByColorValue),Ug=Yh("getFontSize",h.getFontSize),Hg=Yh("getFontSizeClass",h.getFontSizeClass),Gg=Yh("withColorContext",h.withColorContext),$g=Yh("withColors",h.withColors),Wg=Yh("withFontSizes",h.withFontSizes),Zg=Fl,Yg=Fl;function Kg(e){return w()("wp.editor.cleanForSlug",{since:"12.7",plugin:"Gutenberg",alternative:"wp.url.cleanForSlug"}),(0,v.cleanForSlug)(e)}const qg=(0,Uo.createSlotFill)(Symbol("EditCanvasContainerSlot")),Qg="__experimentalMainDashboardButton",{Fill:Xg,Slot:Jg}=(0,Uo.createSlotFill)(Qg),e_=Xg;e_.Slot=()=>{const e=(0,Uo.__experimentalUseSlotFills)(Qg);return(0,L.jsx)(Jg,{bubblesVirtually:!0,fillProps:{length:e?e.length:0}})};const t_=e_,s_=(0,L.jsx)(M.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,L.jsx)(M.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z"})}),o_="edit-post/collab-sidebar",n_=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});const i_=function({avatar:e,name:t,date:s}){const o=(0,x.getSettings)(),[n=o.formats.time]=(0,d.useEntityProp)("root","site","time_format"),{currentUserAvatar:i,currentUserName:r}=(0,c.useSelect)((e=>{var t;const s=e(d.store).getCurrentUser(),{getSettings:o}=e(h.store),{__experimentalDiscussionSettings:n}=o(),i=n?.avatarURL;return{currentUserAvatar:null!==(t=s?.avatar_urls[48])&&void 0!==t?t:i,currentUserName:s?.name}}),[]),a=new Date;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("img",{src:null!=e?e:i,className:"editor-collab-sidebar-panel__user-avatar",alt:(0,fs.__)("User avatar"),width:32,height:32}),(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"0",children:[(0,L.jsx)("span",{className:"editor-collab-sidebar-panel__user-name",children:null!=t?t:r}),(0,L.jsx)("time",{dateTime:(0,x.dateI18n)("c",null!=s?s:a),className:"editor-collab-sidebar-panel__user-time",children:(0,x.dateI18n)(n,null!=s?s:a)})]})]})};const r_=function({onSubmit:e,onCancel:t,thread:s,submitButtonText:o}){var n;const[i,r]=(0,u.useState)(null!==(n=s?.content?.raw)&&void 0!==n?n:"");return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.TextareaControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:null!=i?i:"",onChange:r}),(0,L.jsxs)(Uo.__experimentalHStack,{alignment:"left",spacing:"3",justify:"flex-start",children:[(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,accessibleWhenDisabled:!0,variant:"primary",onClick:()=>{e(i),r("")},disabled:0===(a=i,a.trim()).length,text:o}),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,text:(0,fs._x)("Cancel","Cancel comment button")})]})]});var a};function a_({threads:e,onEditComment:t,onAddReply:s,onCommentDelete:o,onCommentResolve:n,showCommentBoard:i,setShowCommentBoard:r}){const{blockCommentId:a}=(0,c.useSelect)((e=>{const{getBlockAttributes:t,getSelectedBlockClientId:s}=e(h.store),o=s();return{blockCommentId:o?t(o)?.blockCommentId:null}}),[]),[l,d]=(0,u.useState)(i&&a?a:null),p=()=>{d(null),r(!1)};return(0,L.jsxs)(L.Fragment,{children:[(!Array.isArray(e)||0===e.length)&&(0,L.jsx)(Uo.__experimentalVStack,{alignment:"left",className:"editor-collab-sidebar-panel__thread",justify:"flex-start",spacing:"3",children:(0,fs.__)("No comments available")}),Array.isArray(e)&&e.length>0&&e.map((e=>(0,L.jsx)(Uo.__experimentalVStack,{className:Di("editor-collab-sidebar-panel__thread",{"editor-collab-sidebar-panel__active-thread":a&&a===e.id,"editor-collab-sidebar-panel__focus-thread":l&&l===e.id}),id:e.id,spacing:"3",onClick:()=>d(e.id),children:(0,L.jsx)(l_,{thread:e,onAddReply:s,onCommentDelete:o,onCommentResolve:n,onEditComment:t,isFocused:l===e.id,clearThreadFocus:p})},e.id)))]})}function l_({thread:e,onEditComment:t,onAddReply:s,onCommentDelete:o,onCommentResolve:n,isFocused:i,clearThreadFocus:r}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(c_,{thread:e,onResolve:n,onEdit:t,onDelete:o,status:e.status}),0<e?.reply?.length&&(0,L.jsxs)(L.Fragment,{children:[!i&&(0,L.jsx)(Uo.__experimentalVStack,{className:"editor-collab-sidebar-panel__show-more-reply",children:(0,fs.sprintf)((0,fs._x)("%s more replies..","Show replies button"),e?.reply?.length)}),i&&e.reply.map((s=>(0,L.jsxs)(Uo.__experimentalVStack,{className:"editor-collab-sidebar-panel__child-thread",id:s.id,spacing:"2",children:["approved"!==e.status&&(0,L.jsx)(c_,{thread:s,onEdit:t,onDelete:o}),"approved"===e.status&&(0,L.jsx)(c_,{thread:s})]},s.id)))]}),"approved"!==e.status&&i&&(0,L.jsxs)(Uo.__experimentalVStack,{className:"editor-collab-sidebar-panel__child-thread",spacing:"2",children:[(0,L.jsx)(Uo.__experimentalHStack,{alignment:"left",spacing:"3",justify:"flex-start",children:(0,L.jsx)(i_,{})}),(0,L.jsx)(Uo.__experimentalVStack,{spacing:"3",className:"editor-collab-sidebar-panel__comment-field",children:(0,L.jsx)(r_,{onSubmit:t=>{s(t,e.id)},onCancel:e=>{e.stopPropagation(),r()},submitButtonText:(0,fs._x)("Reply","Add reply comment")})})]})]})}const c_=({thread:e,onResolve:t,onEdit:s,onDelete:o,status:n})=>{const[i,r]=(0,u.useState)(!1),[a,l]=(0,u.useState)(!1),c=()=>{r(!1),l(!1)},d=[s&&{title:(0,fs._x)("Edit","Edit comment"),onClick:()=>{r("edit")}},o&&{title:(0,fs._x)("Delete","Delete comment"),onClick:()=>{r("delete"),l(!0)}}].filter((e=>e?.onClick));return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(Uo.__experimentalHStack,{alignment:"left",spacing:"3",justify:"flex-start",children:[(0,L.jsx)(i_,{avatar:e?.author_avatar_urls?.[48],name:e?.author_name,date:e?.date}),(0,L.jsxs)("span",{className:"editor-collab-sidebar-panel__comment-status",children:["approved"!==n&&(0,L.jsxs)(Uo.__experimentalHStack,{alignment:"right",justify:"flex-end",spacing:"0",children:[0===e?.parent&&t&&(0,L.jsx)(Uo.Button,{label:(0,fs._x)("Resolve","Mark comment as resolved"),__next40pxDefaultSize:!0,icon:Ui,onClick:()=>{r("resolve"),l(!0)},showTooltip:!0}),0<d.length&&(0,L.jsx)(Uo.DropdownMenu,{icon:n_,label:(0,fs._x)("Select an action","Select comment action"),className:"editor-collab-sidebar-panel__comment-dropdown-menu",controls:d})]}),"approved"===n&&(0,L.jsx)(Uo.Tooltip,{text:(0,fs.__)("Resolved"),children:(0,L.jsx)(fr,{icon:Ho})})]})]}),(0,L.jsx)(Uo.__experimentalHStack,{alignment:"left",spacing:"3",justify:"flex-start",className:"editor-collab-sidebar-panel__user-comment",children:(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"3",className:"editor-collab-sidebar-panel__comment-field",children:["edit"===i&&(0,L.jsx)(r_,{onSubmit:t=>{s(e.id,t),r(!1)},onCancel:()=>c(),thread:e,submitButtonText:(0,fs._x)("Update","verb")}),"edit"!==i&&(0,L.jsx)(u.RawHTML,{children:e?.content?.raw})]})}),"resolve"===i&&(0,L.jsx)(Uo.__experimentalConfirmDialog,{isOpen:a,onConfirm:()=>{t(e.id),r(!1),l(!1)},onCancel:c,confirmButtonText:"Yes",cancelButtonText:"No",children:(0,fs.__)("Are you sure you want to mark this comment as resolved?")}),"delete"===i&&(0,L.jsx)(Uo.__experimentalConfirmDialog,{isOpen:a,onConfirm:()=>{o(e.id),r(!1),l(!1)},onCancel:c,confirmButtonText:"Yes",cancelButtonText:"No",children:(0,fs.__)("Are you sure you want to delete this comment?")})]})};function d_({onSubmit:e,showCommentBoard:t,setShowCommentBoard:s}){const{clientId:o,blockCommentId:n}=(0,c.useSelect)((e=>{const{getSelectedBlock:t}=e(h.store),s=t();return{clientId:s?.clientId,blockCommentId:s?.attributes?.blockCommentId}}));return t&&o&&void 0===n?(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"3",className:"editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread editor-collab-sidebar-panel__focus-thread",children:[(0,L.jsx)(Uo.__experimentalHStack,{alignment:"left",spacing:"3",children:(0,L.jsx)(i_,{})}),(0,L.jsx)(r_,{onSubmit:t=>{e(t)},onCancel:()=>{s(!1)},submitButtonText:(0,fs._x)("Comment","Add comment button")})]}):null}const{CommentIconSlotFill:u_}=$(h.privateApis),p_=({onClick:e})=>(0,L.jsx)(u_.Fill,{children:({onClose:t})=>(0,L.jsx)(Uo.MenuItem,{icon:s_,onClick:()=>{e(),t()},"aria-haspopup":"dialog",children:(0,fs._x)("Comment","Add comment button")})}),{CommentIconToolbarSlotFill:m_}=$(h.privateApis),h_=({onClick:e})=>(0,L.jsx)(m_.Fill,{children:(0,L.jsx)(Uo.ToolbarButton,{accessibleWhenDisabled:!0,icon:s_,label:(0,fs._x)("Comment","View comment"),onClick:e})});function g_({showCommentBoard:e,setShowCommentBoard:t,styles:s,comments:o}){const{createNotice:n}=(0,c.useDispatch)(_s.store),{saveEntityRecord:i,deleteEntityRecord:r}=(0,c.useDispatch)(d.store),{getEntityRecord:a}=(0,c.resolveSelect)(d.store),{postId:l}=(0,c.useSelect)((e=>{const{getCurrentPostId:t}=e(Ac);return{postId:t()}}),[]),{getSelectedBlockClientId:u}=(0,c.useSelect)(h.store),{updateBlockAttributes:p}=(0,c.useDispatch)(h.store),m=async(e,t)=>{const s={...{post:l,content:e,comment_type:"block_comment",comment_approved:0},...t?{parent:t}:{}},o=await i("root","comment",s);o?(t||p(u(),{blockCommentId:o?.id}),n("snackbar",t?(0,fs.__)("Reply added successfully."):(0,fs.__)("Comment added successfully."),{type:"snackbar",isDismissible:!0})):g()},g=()=>{n("error",(0,fs.__)("Something went wrong. Please try publishing the post, or you may have already submitted your comment earlier."),{isDismissible:!0})};return(0,L.jsxs)("div",{className:"editor-collab-sidebar-panel",style:s,children:[(0,L.jsx)(d_,{onSubmit:m,showCommentBoard:e,setShowCommentBoard:t}),(0,L.jsx)(a_,{threads:o,onEditComment:async(e,t)=>{await i("root","comment",{id:e,content:t})?n("snackbar",(0,fs.__)("Comment edited successfully."),{type:"snackbar",isDismissible:!0}):g()},onAddReply:m,onCommentDelete:async e=>{const t=await a("root","comment",e);await r("root","comment",e),t&&!t.parent&&p(u(),{blockCommentId:void 0}),n("snackbar",(0,fs.__)("Comment deleted successfully."),{type:"snackbar",isDismissible:!0})},onCommentResolve:async e=>{await i("root","comment",{id:e,status:"approved"})?n("snackbar",(0,fs.__)("Comment marked as resolved."),{type:"snackbar",isDismissible:!0}):g()},showCommentBoard:e,setShowCommentBoard:t},u())]})}function __(){const[e,t]=(0,u.useState)(!1),{enableComplementaryArea:s}=(0,c.useDispatch)(Ua),{getActiveComplementaryArea:o}=(0,c.useSelect)(Ua),{postId:n,postType:i,postStatus:r,threads:a}=(0,c.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s}=e(Ac),o=t(),n=o&&"number"==typeof o?e(d.store).getEntityRecords("root","comment",{post:o,type:"block_comment",status:"any",per_page:100}):null;return{postId:o,postType:s(),postStatus:e(Ac).getEditedPostAttribute("status"),threads:n}}),[]),{blockCommentId:l}=(0,c.useSelect)((e=>{const{getBlockAttributes:t,getSelectedBlockClientId:s}=e(h.store),o=s();return{blockCommentId:o?t(o)?.blockCommentId:null}}),[]),[p]=(0,d.useEntityBlockEditor)("postType",i,{id:n}),{resultComments:m,sortedThreads:g}=(0,u.useMemo)((()=>{const e={},t=[],s=(null!=a?a:[]).filter((e=>"trash"!==e.status));if(s.forEach((t=>{e[t.id]={...t,reply:[]}})),s.forEach((s=>{0===s.parent?t.push(e[s.id]):e[s.parent]&&e[s.parent].reply.push(e[s.id])})),0===t?.length)return{resultComments:[],sortedThreads:[]};const o=t.map((e=>({...e,reply:[...e.reply].reverse()}))),n=function(e){const t=e=>e.reduce(((e,s)=>{if(s.attributes&&s.attributes.blockCommentId&&!e.includes(s.attributes.blockCommentId)&&e.push(s.attributes.blockCommentId),s.innerBlocks&&s.innerBlocks.length>0){const o=t(s.innerBlocks);e.push(...o)}return e}),[]);return t(e)}(p),i=new Map(o.map((e=>[e.id,e])));return{resultComments:o,sortedThreads:n.map((e=>i.get(e))).filter((e=>void 0!==e))}}),[a,p]),{merged:_}=Wr(),f=_?.styles?.color?.background;if(0<m.length){const e=(0,c.subscribe)((()=>{o("core")||(s("core",o_),e())}))}if("publish"===r)return null;const b=l?h_:p_;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(b,{onClick:()=>{t(!0),s("core","edit-post/collab-sidebar")}}),(0,L.jsx)(Lu,{identifier:"edit-post/collab-history-sidebar",title:(0,fs.__)("Comments"),icon:s_,children:(0,L.jsx)(g_,{comments:m,showCommentBoard:e,setShowCommentBoard:t})}),(0,L.jsx)(Lu,{isPinnable:!1,header:!1,identifier:o_,className:"editor-collab-sidebar",headerClassName:"editor-collab-sidebar__header",children:(0,L.jsx)(g_,{comments:g,showCommentBoard:e,setShowCommentBoard:t,styles:{backgroundColor:f}})})]})}(0,m.addFilter)("blocks.registerBlockType","block-comment/modify-core-block-attributes",(e=>(e.attributes.blockCommentId||(e.attributes={...e.attributes,blockCommentId:{type:"number"}}),e)));const f_=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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"})}),b_=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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:y_}=$(h.privateApis);function x_({isCollapsed:e,onToggle:t}){const{blockSelectionStart:s}=(0,c.useSelect)((e=>({blockSelectionStart:e(h.store).getBlockSelectionStart()})),[]),o=y_(),n=!!s;return(0,u.useEffect)((()=>{s&&t(!1)}),[s,t]),o?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("div",{className:Di("editor-collapsible-block-toolbar",{"is-collapsed":e||!n}),children:(0,L.jsx)(h.BlockToolbar,{hideDragHandle:!0})}),(0,L.jsx)(Uo.Popover.Slot,{name:"block-toolbar"}),(0,L.jsx)(Uo.Button,{className:"editor-collapsible-block-toolbar__toggle",icon:e?f_:b_,onClick:()=>{t(!e)},label:e?(0,fs.__)("Show block tools"):(0,fs.__)("Hide block tools"),size:"compact"})]}):null}const v_=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})});const S_=function({className:e,disableBlockTools:t=!1}){const{setIsInserterOpened:s,setIsListViewOpened:o}=(0,c.useDispatch)(Ac),{isDistractionFree:n,isInserterOpened:i,isListViewOpen:r,listViewShortcut:a,inserterSidebarToggleRef:l,listViewToggleRef:d,showIconLabels:m,showTools:g}=(0,c.useSelect)((e=>{const{get:t}=e(k.store),{isListViewOpened:s,getEditorMode:o,getInserterSidebarToggleRef:n,getListViewToggleRef:i,getRenderingMode:r,getCurrentPostType:a}=$(e(Ac)),{getShortcutRepresentation:l}=e(vl.store);return{isInserterOpened:e(Ac).isInserterOpened(),isListViewOpen:s(),listViewShortcut:l("core/editor/toggle-list-view"),inserterSidebarToggleRef:n(),listViewToggleRef:i(),showIconLabels:t("core","showIconLabels"),isDistractionFree:t("core","distractionFree"),isVisualMode:"visual"===o(),showTools:!!window?.__experimentalEditorWriteMode&&("post-only"!==r()||"wp_template"===a())}}),[]),_=(0,p.useViewportMatch)("medium"),f=(0,p.useViewportMatch)("wide"),b=(0,fs.__)("Document tools"),y=(0,u.useCallback)((()=>o(!r)),[o,r]),x=(0,u.useCallback)((()=>s(!i)),[i,s]),v=(0,fs._x)("Block Inserter","Generic label for block inserter button"),S=i?(0,fs.__)("Close"):(0,fs.__)("Add");return(0,L.jsx)(h.NavigableToolbar,{className:Di("editor-document-tools","edit-post-header-toolbar",e),"aria-label":b,variant:"unstyled",children:(0,L.jsxs)("div",{className:"editor-document-tools__left",children:[!n&&(0,L.jsx)(Uo.ToolbarButton,{ref:l,className:"editor-document-tools__inserter-toggle",variant:"primary",isPressed:i,onMouseDown:e=>{i&&e.preventDefault()},onClick:x,disabled:t,icon:v_,label:m?S:v,showTooltip:!m,"aria-expanded":i}),(f||!m)&&(0,L.jsxs)(L.Fragment,{children:[g&&_&&(0,L.jsx)(Uo.ToolbarItem,{as:h.ToolSelector,showTooltip:!m,variant:m?"tertiary":void 0,disabled:t,size:"compact"}),(0,L.jsx)(Uo.ToolbarItem,{as:hd,showTooltip:!m,variant:m?"tertiary":void 0,size:"compact"}),(0,L.jsx)(Uo.ToolbarItem,{as:md,showTooltip:!m,variant:m?"tertiary":void 0,size:"compact"}),!n&&(0,L.jsx)(Uo.ToolbarButton,{className:"editor-document-tools__document-overview-toggle",icon:la,disabled:t,isPressed:r,label:(0,fs.__)("Document Overview"),onClick:y,shortcut:a,showTooltip:!m,variant:m?"tertiary":void 0,"aria-expanded":r,ref:d})]})]})})};function w_(){const{createNotice:e}=(0,c.useDispatch)(_s.store),{getCurrentPostId:t,getCurrentPostType:s}=(0,c.useSelect)(Ac),{getEditedEntityRecord:o}=(0,c.useSelect)(d.store);const n=(0,p.useCopyToClipboard)((function(){const e=o("postType",s(),t());return e?"function"==typeof e.content?e.content(e):e.blocks?(0,y.__unstableSerializeAndClean)(e.blocks):e.content?e.content:void 0:""}),(function(){e("info",(0,fs.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,L.jsx)(Uo.MenuItem,{ref:n,children:(0,fs.__)("Copy all blocks")})}const k_=[{value:"visual",label:(0,fs.__)("Visual editor")},{value:"text",label:(0,fs.__)("Code editor")}];const C_=function(){const{shortcut:e,isRichEditingEnabled:t,isCodeEditingEnabled:s,mode:o}=(0,c.useSelect)((e=>({shortcut:e(vl.store).getShortcutRepresentation("core/editor/toggle-mode"),isRichEditingEnabled:e(Ac).getEditorSettings().richEditingEnabled,isCodeEditingEnabled:e(Ac).getEditorSettings().codeEditingEnabled,mode:e(Ac).getEditorMode()})),[]),{switchEditorMode:n}=(0,c.useDispatch)(Ac);let i=o;t||"visual"!==o||(i="text"),s||"text"!==o||(i="visual");const r=k_.map((o=>(s||"text"!==o.value||(o={...o,disabled:!0}),t||"visual"!==o.value||(o={...o,disabled:!0,info:(0,fs.__)("You can enable the visual editor in your profile settings.")}),o.value===i||o.disabled?o:{...o,shortcut:e})));return(0,L.jsx)(Uo.MenuGroup,{label:(0,fs.__)("Editor"),children:(0,L.jsx)(Uo.MenuItemsChoice,{choices:r,value:i,onSelect:n})})},{Fill:P_,Slot:j_}=(0,Uo.createSlotFill)("ToolsMoreMenuGroup");P_.Slot=({fillProps:e})=>(0,L.jsx)(j_,{fillProps:e});const E_=P_,{Fill:T_,Slot:B_}=(0,Uo.createSlotFill)("web"===u.Platform.OS?Symbol("ViewMoreMenuGroup"):"ViewMoreMenuGroup");T_.Slot=({fillProps:e})=>(0,L.jsx)(B_,{fillProps:e});const I_=T_;function N_(){const{openModal:e}=(0,c.useDispatch)(Ua),{set:t}=(0,c.useDispatch)(k.store),{toggleDistractionFree:s}=(0,c.useDispatch)(Ac),o=(0,c.useSelect)((e=>e(k.store).get("core","showIconLabels")),[]),n=()=>{t("core","distractionFree",!1)};return(0,L.jsx)(L.Fragment,{children:(0,L.jsx)(Uo.DropdownMenu,{icon:n_,label:(0,fs.__)("Options"),popoverProps:{placement:"bottom-end",className:"more-menu-dropdown__content"},toggleProps:{showTooltip:!o,...o&&{variant:"tertiary"},tooltipPosition:"bottom",size:"compact"},children:({onClose:t})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(Uo.MenuGroup,{label:(0,fs._x)("View","noun"),children:[(0,L.jsx)(k.PreferenceToggleMenuItem,{scope:"core",name:"fixedToolbar",onToggle:n,label:(0,fs.__)("Top toolbar"),info:(0,fs.__)("Access all block and document tools in a single place"),messageActivated:(0,fs.__)("Top toolbar activated."),messageDeactivated:(0,fs.__)("Top toolbar deactivated.")}),(0,L.jsx)(k.PreferenceToggleMenuItem,{scope:"core",name:"distractionFree",label:(0,fs.__)("Distraction free"),info:(0,fs.__)("Write with calmness"),handleToggling:!1,onToggle:()=>s({createNotice:!1}),messageActivated:(0,fs.__)("Distraction free mode activated."),messageDeactivated:(0,fs.__)("Distraction free mode deactivated."),shortcut:wl.displayShortcut.primaryShift("\\")}),(0,L.jsx)(k.PreferenceToggleMenuItem,{scope:"core",name:"focusMode",label:(0,fs.__)("Spotlight mode"),info:(0,fs.__)("Focus on one block at a time"),messageActivated:(0,fs.__)("Spotlight mode activated."),messageDeactivated:(0,fs.__)("Spotlight mode deactivated.")}),(0,L.jsx)(I_.Slot,{fillProps:{onClose:t}})]}),(0,L.jsx)(C_,{}),(0,L.jsx)(Za.Slot,{name:"core/plugin-more-menu",label:(0,fs.__)("Plugins"),fillProps:{onClick:t}}),(0,L.jsxs)(Uo.MenuGroup,{label:(0,fs.__)("Tools"),children:[(0,L.jsx)(Uo.MenuItem,{onClick:()=>e("editor/keyboard-shortcut-help"),shortcut:wl.displayShortcut.access("h"),children:(0,fs.__)("Keyboard shortcuts")}),(0,L.jsx)(w_,{}),(0,L.jsxs)(Uo.MenuItem,{icon:Fo,href:(0,fs.__)("https://wordpress.org/documentation/article/wordpress-block-editor/"),target:"_blank",rel:"noopener noreferrer",children:[(0,fs.__)("Help"),(0,L.jsx)(Uo.VisuallyHidden,{as:"span",children:(0,fs.__)("(opens in a new tab)")})]}),(0,L.jsx)(E_.Slot,{fillProps:{onClose:t}})]}),(0,L.jsx)(Uo.MenuGroup,{children:(0,L.jsx)(Uo.MenuItem,{onClick:()=>e("editor/preferences"),children:(0,fs.__)("Preferences")})})]})})})}const D_="toggle",A_="button";function R_({forceIsDirty:e,setEntitiesSavedStatesCallback:t}){let s;const o=(0,p.useViewportMatch)("medium","<"),{togglePublishSidebar:n}=(0,c.useDispatch)(Ac),{hasPublishAction:i,isBeingScheduled:r,isPending:a,isPublished:l,isPublishSidebarEnabled:d,isPublishSidebarOpened:u,isScheduled:m,postStatus:h,postStatusHasChanged:g}=(0,c.useSelect)((e=>{var t;return{hasPublishAction:null!==(t=!!e(Ac).getCurrentPost()?._links?.["wp:action-publish"])&&void 0!==t&&t,isBeingScheduled:e(Ac).isEditedPostBeingScheduled(),isPending:e(Ac).isCurrentPostPending(),isPublished:e(Ac).isCurrentPostPublished(),isPublishSidebarEnabled:e(Ac).isPublishSidebarEnabled(),isPublishSidebarOpened:e(Ac).isPublishSidebarOpened(),isScheduled:e(Ac).isCurrentPostScheduled(),postStatus:e(Ac).getEditedPostAttribute("status"),postStatusHasChanged:e(Ac).getPostEdits()?.status}}),[]);return s=l||g&&!["future","publish"].includes(h)||m&&r||a&&!i&&!o?A_:o||d?D_:A_,(0,L.jsx)(Gp,{forceIsDirty:e,isOpen:u,isToggle:s===D_,onToggle:n,setEntitiesSavedStatesCallback:t})}function M_(){const{hasLoaded:e,permalink:t,isPublished:s,label:o,showIconLabels:n}=(0,c.useSelect)((e=>{const t=e(Ac).getCurrentPostType(),s=e(d.store).getPostType(t),{get:o}=e(k.store);return{permalink:e(Ac).getPermalink(),isPublished:e(Ac).isCurrentPostPublished(),label:s?.labels.view_item,hasLoaded:!!s,showIconLabels:o("core","showIconLabels")}}),[]);return s&&t&&e?(0,L.jsx)(Uo.Button,{icon:Fo,label:o||(0,fs.__)("View post"),href:t,target:"_blank",showTooltip:!n,size:"compact"}):null}const L_=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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"})}),O_=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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"})}),F_=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M17 4H7c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12zm-7.5-.5h4V16h-4v1.5z"})});function V_({forceIsAutosaveable:e,disabled:t}){const{deviceType:s,homeUrl:o,isTemplate:n,isViewable:i,showIconLabels:r,isTemplateHidden:a,templateId:l}=(0,c.useSelect)((e=>{var t;const{getDeviceType:s,getCurrentPostType:o,getCurrentTemplateId:n}=e(Ac),{getRenderingMode:i}=$(e(Ac)),{getEntityRecord:r,getPostType:a}=e(d.store),{get:l}=e(k.store),c=o();return{deviceType:s(),homeUrl:r("root","__unstableBase")?.home,isTemplate:"wp_template"===c,isViewable:null!==(t=a(c)?.viewable)&&void 0!==t&&t,showIconLabels:l("core","showIconLabels"),isTemplateHidden:"post-only"===i(),templateId:n()}}),[]),{setDeviceType:u,setRenderingMode:m,setDefaultRenderingMode:g}=$((0,c.useDispatch)(Ac)),{resetZoomLevel:_}=$((0,c.useDispatch)(h.store)),f=e=>{u(e),_()};if((0,p.useViewportMatch)("medium","<"))return null;const b={className:"editor-preview-dropdown__toggle",iconPosition:"right",size:"compact",showTooltip:!r,disabled:t,accessibleWhenDisabled:t},y={"aria-label":(0,fs.__)("View options")},x={desktop:L_,mobile:O_,tablet:F_},v=[{value:"Desktop",label:(0,fs.__)("Desktop"),icon:L_},{value:"Tablet",label:(0,fs.__)("Tablet"),icon:F_},{value:"Mobile",label:(0,fs.__)("Mobile"),icon:O_}];return(0,L.jsx)(Uo.DropdownMenu,{className:Di("editor-preview-dropdown",`editor-preview-dropdown--${s.toLowerCase()}`),popoverProps:{placement:"bottom-end"},toggleProps:b,menuProps:y,icon:x[s.toLowerCase()],label:(0,fs.__)("View"),disableOpenOnArrowDown:t,children:({onClose:t})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.MenuGroup,{children:(0,L.jsx)(Uo.MenuItemsChoice,{choices:v,value:s,onSelect:f})}),n&&(0,L.jsx)(Uo.MenuGroup,{children:(0,L.jsxs)(Uo.MenuItem,{href:o,target:"_blank",icon:Fo,onClick:t,children:[(0,fs.__)("View site"),(0,L.jsx)(Uo.VisuallyHidden,{as:"span",children:(0,fs.__)("(opens in a new tab)")})]})}),!n&&!!l&&(0,L.jsx)(Uo.MenuGroup,{children:(0,L.jsx)(Uo.MenuItem,{icon:a?void 0:Ho,isSelected:!a,role:"menuitemcheckbox",onClick:()=>{const e=a?"template-locked":"post-only";m(e),g(e)},children:(0,fs.__)("Show template")})}),i&&(0,L.jsx)(Uo.MenuGroup,{children:(0,L.jsx)(Vp,{className:"editor-preview-dropdown__button-external",role:"menuitem",forceIsAutosaveable:e,"aria-label":(0,fs.__)("Preview in new tab"),textContent:(0,L.jsxs)(L.Fragment,{children:[(0,fs.__)("Preview in new tab"),(0,L.jsx)(Uo.Icon,{icon:Fo})]}),onPreview:t})}),(0,L.jsx)(Za.Slot,{name:"core/plugin-preview-menu",fillProps:{onClick:t}})]})})}const z_=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{fill:"none",d:"M5.75 12.75V18.25H11.25M12.75 5.75H18.25V11.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"square"})}),U_=({disabled:e})=>{const{isZoomOut:t,showIconLabels:s,isDistractionFree:o}=(0,c.useSelect)((e=>({isZoomOut:$(e(h.store)).isZoomOut(),showIconLabels:e(k.store).get("core","showIconLabels"),isDistractionFree:e(k.store).get("core","distractionFree")}))),{resetZoomLevel:n,setZoomLevel:i}=$((0,c.useDispatch)(h.store)),{registerShortcut:r,unregisterShortcut:a}=(0,c.useDispatch)(vl.store);(0,u.useEffect)((()=>(r({name:"core/editor/zoom",category:"global",description:(0,fs.__)("Enter or exit zoom out."),keyCombination:{modifier:(0,wl.isAppleOS)()?"primaryShift":"secondary",character:"0"}}),()=>{a("core/editor/zoom")})),[r,a]),(0,vl.useShortcut)("core/editor/zoom",(()=>{t?n():i("auto-scaled")}),{isDisabled:o});return(0,L.jsx)(Uo.Button,{accessibleWhenDisabled:!0,disabled:e,onClick:()=>{t?n():i("auto-scaled")},icon:z_,label:(0,fs.__)("Zoom Out"),isPressed:t,size:"compact",showTooltip:!s,className:"editor-zoom-out-toggle"})},H_=window?.__experimentalEnableBlockComment,G_={distractionFreeDisabled:{y:"-50px"},distractionFreeHover:{y:0},distractionFreeHidden:{y:"-50px"},visible:{y:0},hidden:{y:0}},$_={distractionFreeDisabled:{x:"-100%"},distractionFreeHover:{x:0},distractionFreeHidden:{x:"-100%"},visible:{x:0},hidden:{x:0}};const W_=function({customSaveButton:e,forceIsDirty:t,forceDisableBlockTools:s,setEntitiesSavedStatesCallback:o,title:n}){const i=(0,p.useViewportMatch)("large"),r=(0,p.useViewportMatch)("medium"),a=(0,p.useMediaQuery)("(max-width: 403px)"),{postType:l,isTextEditor:d,isPublishSidebarOpened:m,showIconLabels:g,hasFixedToolbar:_,hasBlockSelection:f,hasSectionRootClientId:b}=(0,c.useSelect)((e=>{const{get:t}=e(k.store),{getEditorMode:s,getCurrentPostType:o,isPublishSidebarOpened:n}=e(Ac),{getBlockSelectionStart:i,getSectionRootClientId:r}=$(e(h.store));return{postType:o(),isTextEditor:"text"===s(),isPublishSidebarOpened:n(),showIconLabels:t("core","showIconLabels"),hasFixedToolbar:t("core","fixedToolbar"),hasBlockSelection:!!i(),hasSectionRootClientId:!!r()}}),[]),y=["post","page","wp_template"].includes(l)&&b,x=[N,B,I].includes(l)||s,[v,S]=(0,u.useState)(!0),w=!a&&(!_||_&&(!f||v)),C=(()=>{const e=(0,Uo.__experimentalUseSlotFills)(Qg);return Boolean(e&&e.length)})();return(0,L.jsxs)("div",{className:"editor-header edit-post-header",children:[C&&(0,L.jsx)(Uo.__unstableMotion.div,{className:"editor-header__back-button",variants:$_,transition:{type:"tween"},children:(0,L.jsx)(t_.Slot,{})}),(0,L.jsxs)(Uo.__unstableMotion.div,{variants:G_,className:"editor-header__toolbar",transition:{type:"tween"},children:[(0,L.jsx)(S_,{disableBlockTools:s||d}),_&&r&&(0,L.jsx)(x_,{isCollapsed:v,onToggle:S})]}),w&&(0,L.jsx)(Uo.__unstableMotion.div,{className:"editor-header__center",variants:G_,transition:{type:"tween"},children:(0,L.jsx)(Xc,{title:n})}),(0,L.jsxs)(Uo.__unstableMotion.div,{variants:G_,transition:{type:"tween"},className:"editor-header__settings",children:[!e&&!m&&(0,L.jsx)(rh,{forceIsDirty:t}),(0,L.jsx)(M_,{}),(0,L.jsx)(V_,{forceIsAutosaveable:t,disabled:x}),(0,L.jsx)(Vp,{className:"editor-header__post-preview-button",forceIsAutosaveable:t}),i&&y&&(0,L.jsx)(U_,{disabled:s}),(i||!g)&&(0,L.jsx)(Qa.Slot,{scope:"core"}),!e&&(0,L.jsx)(R_,{forceIsDirty:t,setEntitiesSavedStatesCallback:o}),H_?(0,L.jsx)(__,{}):void 0,e,(0,L.jsx)(N_,{})]})]})},{PrivateInserterLibrary:Z_}=$(h.privateApis);function Y_(){const{blockSectionRootClientId:e,inserterSidebarToggleRef:t,inserter:s,showMostUsedBlocks:o,sidebarIsOpened:n}=(0,c.useSelect)((e=>{const{getInserterSidebarToggleRef:t,getInserter:s,isPublishSidebarOpened:o}=$(e(Ac)),{getBlockRootClientId:n,isZoomOut:i,getSectionRootClientId:r}=$(e(h.store)),{get:a}=e(k.store),{getActiveComplementaryArea:l}=e(Ua);return{inserterSidebarToggleRef:t(),inserter:s(),showMostUsedBlocks:a("core","mostUsedBlocks"),blockSectionRootClientId:(()=>{if(i()){const e=r();if(e)return e}return n()})(),sidebarIsOpened:!(!l("core")&&!o())}}),[]),{setIsInserterOpened:i}=(0,c.useDispatch)(Ac),{disableComplementaryArea:r}=(0,c.useDispatch)(Ua),a=(0,p.useViewportMatch)("medium","<"),l=(0,u.useRef)(),d=(0,u.useCallback)((()=>{i(!1),t.current?.focus()}),[t,i]),m=(0,u.useCallback)((e=>{e.keyCode!==wl.ESCAPE||e.defaultPrevented||(e.preventDefault(),d())}),[d]),g=(0,L.jsx)("div",{className:"editor-inserter-sidebar__content",children:(0,L.jsx)(Z_,{showMostUsedBlocks:o,showInserterHelpPanel:!0,shouldFocusBlock:a,rootClientId:e,onSelect:s.onSelect,__experimentalInitialTab:s.tab,__experimentalInitialCategory:s.category,__experimentalFilterValue:s.filterValue,onPatternCategorySelection:n?()=>r("core"):void 0,ref:l,onClose:d})});return(0,L.jsx)("div",{onKeyDown:m,className:"editor-inserter-sidebar",children:g})}function K_(){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)("div",{className:"editor-list-view-sidebar__outline",children:[(0,L.jsxs)("div",{children:[(0,L.jsx)(Uo.__experimentalText,{children:(0,fs.__)("Characters:")}),(0,L.jsx)(Uo.__experimentalText,{children:(0,L.jsx)(zh,{})})]}),(0,L.jsxs)("div",{children:[(0,L.jsx)(Uo.__experimentalText,{children:(0,fs.__)("Words:")}),(0,L.jsx)(Oh,{})]}),(0,L.jsxs)("div",{children:[(0,L.jsx)(Uo.__experimentalText,{children:(0,fs.__)("Time to read:")}),(0,L.jsx)(Vh,{})]})]}),(0,L.jsx)(ld,{})]})}const{TabbedSidebar:q_}=$(h.privateApis);function Q_(){const{setIsListViewOpened:e}=(0,c.useDispatch)(Ac),{getListViewToggleRef:t}=$((0,c.useSelect)(Ac)),s=(0,p.useFocusOnMount)("firstElement"),o=(0,u.useCallback)((()=>{e(!1),t().current?.focus()}),[t,e]),n=(0,u.useCallback)((e=>{e.keyCode!==wl.ESCAPE||e.defaultPrevented||(e.preventDefault(),o())}),[o]),[i,r]=(0,u.useState)(null),[a,l]=(0,u.useState)("list-view"),d=(0,u.useRef)(),m=(0,u.useRef)(),g=(0,u.useRef)(),_=(0,p.useMergeRefs)([s,g,r]);const f=(0,u.useCallback)((()=>{d.current.contains(d.current.ownerDocument.activeElement)?o():function(e){const t=Kc.focus.tabbable.find(m.current)[0];if("list-view"===e){const e=Kc.focus.tabbable.find(g.current)[0];(d.current.contains(e)?e:t).focus()}else t.focus()}(a)}),[o,a]);return(0,vl.useShortcut)("core/editor/toggle-list-view",f),(0,L.jsx)("div",{className:"editor-list-view-sidebar",onKeyDown:n,ref:d,children:(0,L.jsx)(q_,{tabs:[{name:"list-view",title:(0,fs._x)("List View","Post overview"),panel:(0,L.jsx)("div",{className:"editor-list-view-sidebar__list-view-container",children:(0,L.jsx)("div",{className:"editor-list-view-sidebar__list-view-panel-content",children:(0,L.jsx)(h.__experimentalListView,{dropZoneElement:i})})}),panelRef:_},{name:"outline",title:(0,fs._x)("Outline","Post overview"),panel:(0,L.jsx)("div",{className:"editor-list-view-sidebar__list-view-container",children:(0,L.jsx)(K_,{})})}],onClose:o,onSelect:e=>l(e),defaultTabId:"list-view",ref:m,closeButtonLabel:(0,fs.__)("Close")})})}const{Fill:X_,Slot:J_}=(0,Uo.createSlotFill)("ActionsPanel");function ef({setEntitiesSavedStatesCallback:e,closeEntitiesSavedStates:t,isEntitiesSavedStatesOpen:s,forceIsDirtyPublishPanel:o}){const{closePublishSidebar:n,togglePublishSidebar:i}=(0,c.useDispatch)(Ac),{publishSidebarOpened:r,isPublishable:a,isDirty:l,hasOtherEntitiesChanges:d}=(0,c.useSelect)((e=>{const{isPublishSidebarOpened:t,isEditedPostPublishable:s,isCurrentPostPublished:o,isEditedPostDirty:n,hasNonPostEntityChanges:i}=e(Ac),r=i();return{publishSidebarOpened:t(),isPublishable:!o()&&s(),isDirty:r||n(),hasOtherEntitiesChanges:r}}),[]),p=(0,u.useCallback)((()=>e(!0)),[]);let m;return m=r?(0,L.jsx)(Qm,{onClose:n,forceIsDirty:o,PrePublishExtension:Ru.Slot,PostPublishExtension:ju.Slot}):a&&!d?(0,L.jsx)("div",{className:"editor-layout__toggle-publish-panel",children:(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:i,"aria-expanded":!1,children:(0,fs.__)("Open publish panel")})}):(0,L.jsx)("div",{className:"editor-layout__toggle-entities-saved-states-panel",children:(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:p,"aria-expanded":!1,"aria-haspopup":"dialog",disabled:!l,accessibleWhenDisabled:!0,children:(0,fs.__)("Open save panel")})}),(0,L.jsxs)(L.Fragment,{children:[s&&(0,L.jsx)(jd,{close:t,renderDialog:!0}),(0,L.jsx)(J_,{bubblesVirtually:!0}),!s&&m]})}function tf({autoFocus:e=!1}){const{switchEditorMode:t}=(0,c.useDispatch)(Ac),{shortcut:s,isRichEditingEnabled:o}=(0,c.useSelect)((e=>{const{getEditorSettings:t}=e(Ac),{getShortcutRepresentation:s}=e(vl.store);return{shortcut:s("core/editor/toggle-mode"),isRichEditingEnabled:t().richEditingEnabled}}),[]),n=(0,u.useRef)();return(0,u.useEffect)((()=>{e||n?.current?.focus()}),[e]),(0,L.jsxs)("div",{className:"editor-text-editor",children:[o&&(0,L.jsxs)("div",{className:"editor-text-editor__toolbar",children:[(0,L.jsx)("h2",{children:(0,fs.__)("Editing code")}),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t("visual"),shortcut:s,children:(0,fs.__)("Exit code editor")})]}),(0,L.jsxs)("div",{className:"editor-text-editor__body",children:[(0,L.jsx)(Ch,{ref:n}),(0,L.jsx)(bh,{})]})]})}function sf({contentRef:e}){const{onNavigateToEntityRecord:t,templateId:s}=(0,c.useSelect)((e=>{const{getEditorSettings:t,getCurrentTemplateId:s}=e(Ac);return{onNavigateToEntityRecord:t().onNavigateToEntityRecord,templateId:s()}}),[]),o=(0,c.useSelect)((e=>!!e(d.store).canUser("create",{kind:"postType",name:"wp_template"})),[]),[n,i]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{const t=e=>{o&&e.target.classList.contains("is-root-container")&&"core/template-part"!==e.target.dataset?.type&&(e.defaultPrevented||(e.preventDefault(),i(!0)))},s=e.current;return s?.addEventListener("dblclick",t),()=>{s?.removeEventListener("dblclick",t)}}),[e,o]),o?(0,L.jsx)(Uo.__experimentalConfirmDialog,{isOpen:n,confirmButtonText:(0,fs.__)("Edit template"),onConfirm:()=>{i(!1),t({postId:s,postType:"wp_template"})},onCancel:()=>i(!1),size:"medium",children:(0,fs.__)("You’ve tried to select a block that is part of a template that may be used elsewhere on your site. Would you like to edit the template?")}):null}function of({direction:e,resizeWidthBy:t}){const s=`resizable-editor__resize-help-${e}`;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.Tooltip,{text:(0,fs.__)("Drag to resize"),children:(0,L.jsx)(Uo.__unstableMotion.button,{className:`editor-resizable-editor__resize-handle is-${e}`,"aria-label":(0,fs.__)("Drag to resize"),"aria-describedby":s,onKeyDown:function(s){const{keyCode:o}=s;o!==wl.LEFT&&o!==wl.RIGHT||(s.preventDefault(),"left"===e&&o===wl.LEFT||"right"===e&&o===wl.RIGHT?t(20):("left"===e&&o===wl.RIGHT||"right"===e&&o===wl.LEFT)&&t(-20))},variants:{active:{opacity:1,scaleY:1.3}},whileFocus:"active",whileHover:"active",whileTap:"active",role:"separator","aria-orientation":"vertical"},"handle")}),(0,L.jsx)(Uo.VisuallyHidden,{id:s,children:(0,fs.__)("Use left and right arrow keys to resize the canvas.")})]})}const nf={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 rf=function({className:e,enableResizing:t,height:s,children:o}){const[n,i]=(0,u.useState)("100%"),r=(0,u.useRef)(),a=(0,u.useCallback)((e=>{r.current&&i(r.current.offsetWidth+e)}),[]);return(0,L.jsx)(Uo.ResizableBox,{className:Di("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,L.jsx)(of,{direction:"left",resizeWidthBy:a}),right:(0,L.jsx)(of,{direction:"right",resizeWidthBy:a})},handleClasses:void 0,handleStyles:{left:nf,right:nf},children:o})};function af(e,t,s){return Math.min(Math.max(e,t),s)}function lf(e,t,s){const o=e-af(e,s.left,s.right),n=t-af(t,s.top,s.bottom);return Math.sqrt(o*o+n*n)}function cf({isEnabled:e=!0}={}){const{getEnabledClientIdsTree:t,getBlockName:s,getBlockOrder:o}=$((0,c.useSelect)(h.store)),{selectBlock:n}=(0,c.useDispatch)(h.store);return(0,p.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=lf(e,r,s.getBoundingClientRect());o<l&&o<500&&(l=o,c=t)}c&&n(c)})(e.clientX,e.clientY)};return i.addEventListener("click",r),()=>i.removeEventListener("click",r)}),[e])}function df(){const{getSettings:e,isZoomOut:t}=$((0,c.useSelect)(h.store)),{resetZoomLevel:s}=$((0,c.useDispatch)(h.store));return(0,p.useRefEffect)((o=>{function n(o){if(t()&&!o.defaultPrevented){o.preventDefault();const{__experimentalSetIsInserterOpened:t}=e();"function"==typeof t&&t(!1),s()}}return o.addEventListener("dblclick",n),()=>{o.removeEventListener("dblclick",n)}}),[e,t,s])}const{LayoutStyle:uf,useLayoutClasses:pf,useLayoutStyles:mf,ExperimentalBlockCanvas:hf,useFlashEditableBlocks:gf}=$(h.privateApis),_f=[I,T,N,B];function ff(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=ff(e[t].innerBlocks);if(s)return s}}}function bf(e){for(let t=0;t<e.length;t++)if("core/post-content"===e[t].name)return!0;return!1}const yf=function({autoFocus:e,styles:t,disableIframe:s=!1,iframeProps:o,contentRef:n,className:i}){const[r,a]=(0,u.useState)(""),l=(0,p.useResizeObserver)((([e])=>{a(e.borderBoxSize[0].blockSize)})),m=(0,p.useViewportMatch)("small","<"),{renderingMode:g,postContentAttributes:_,editedPostTemplate:f={},wrapperBlockName:b,wrapperUniqueId:x,deviceType:v,isFocusedEntity:S,isDesignPostType:w,postType:k,isPreview:C}=(0,c.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s,getCurrentTemplateId:o,getEditorSettings:n,getRenderingMode:i,getDeviceType:r}=e(Ac),{getPostType:a,getEditedEntityRecord:l}=e(d.store),c=s(),u=i();let p;c===I?p="core/block":"post-only"===u&&(p="core/post-content");const m=n(),h=m.supportsTemplateMode,g=a(c),_=o(),f=_?l("postType",T,_):void 0;return{renderingMode:u,postContentAttributes:m.postContentAttributes,isDesignPostType:_f.includes(c),editedPostTemplate:g?.viewable&&h?f:void 0,wrapperBlockName:p,wrapperUniqueId:t(),deviceType:r(),isFocusedEntity:!!m.onNavigateToPreviousEntityRecord,postType:c,isPreview:m.isPreviewMode}}),[]),{isCleanNewPost:P}=(0,c.useSelect)(Ac),{hasRootPaddingAwareAlignments:j,themeHasDisabledLayoutStyles:E,themeSupportsLayout:D,isZoomedOut:A}=(0,c.useSelect)((e=>{const{getSettings:t,isZoomOut:s}=$(e(h.store)),o=t();return{themeHasDisabledLayoutStyles:o.disableLayoutStyles,themeSupportsLayout:o.supportsLayout,hasRootPaddingAwareAlignments:o.__experimentalFeatures?.useRootPaddingAwareAlignments,isZoomedOut:s()}}),[]),R=(0,h.__experimentalUseResizeCanvas)(v),[M]=(0,h.useSettings)("layout"),O=(0,u.useMemo)((()=>"post-only"!==g||w?{type:"default"}:D?{...M,type:"constrained"}:{type:"default"}),[g,D,M,w]),F=(0,u.useMemo)((()=>{if(!f?.content&&!f?.blocks&&_)return _;if(f?.blocks)return ff(f?.blocks);const e="string"==typeof f?.content?f?.content:"";return ff((0,y.parse)(e))||{}}),[f?.content,f?.blocks,_]),V=(0,u.useMemo)((()=>{if(!f?.content&&!f?.blocks)return!1;if(f?.blocks)return bf(f?.blocks);const e="string"==typeof f?.content?f?.content:"";return bf((0,y.parse)(e))||!1}),[f?.content,f?.blocks]),{layout:z={},align:U=""}=F||{},H=pf(F,"core/post-content"),G=Di({"is-layout-flow":!D},D&&H,U&&`align${U}`),W=mf(F,"core/post-content",".block-editor-block-list__layout.is-root-container"),Z=(0,u.useMemo)((()=>z&&("constrained"===z?.type||z?.inherit||z?.contentSize||z?.wideSize)?{...M,...z,type:"constrained"}:{...M,...z,type:"default"}),[z?.type,z?.inherit,z?.contentSize,z?.wideSize,M]),Y=_?Z:O,K="default"!==Y?.type||V?Y:O,q=(0,h.__unstableUseTypingObserver)(),Q=(0,u.useRef)();(0,u.useEffect)((()=>{e&&P()&&Q?.current?.focus()}),[e,P]);const X=k===N,J=[N,B,I].includes(k)&&!C&&!m&&!A,ee=(0,u.useMemo)((()=>[...null!=t?t:[],{css:`:where(.block-editor-iframe__body){display:flow-root;}.is-root-container{display:flow-root;${J?"min-height:0!important;":""}}`}]),[t,J]),te=(0,u.useRef)(),se=(0,h.__unstableUseTypewriter)();return n=(0,p.useMergeRefs)([te,n,"post-only"===g?se:null,gf({isEnabled:"template-locked"===g}),cf({isEnabled:"template-locked"===g}),df(),J?l:null]),(0,L.jsx)("div",{className:Di("editor-visual-editor","edit-post-visual-editor",i,{"has-padding":S||J,"is-resizable":J,"is-iframed":!s}),children:(0,L.jsx)(rf,{enableResizing:J,height:r&&!X?r:"100%",children:(0,L.jsxs)(hf,{shouldIframe:!s,contentRef:n,styles:ee,height:"100%",iframeProps:{...o,style:{...o?.style,...R}},children:[D&&!E&&"post-only"===g&&!w&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(uf,{selector:".editor-visual-editor__post-title-wrapper",layout:O}),(0,L.jsx)(uf,{selector:".block-editor-block-list__layout.is-root-container",layout:K}),U&&(0,L.jsx)(uf,{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;}"}),W&&(0,L.jsx)(uf,{layout:Z,css:W})]}),"post-only"===g&&!w&&(0,L.jsx)("div",{className:Di("editor-visual-editor__post-title-wrapper","edit-post-visual-editor__post-title-wrapper",{"has-global-padding":j}),contentEditable:!1,ref:q,style:{marginTop:"4rem"},children:(0,L.jsx)(kh,{ref:Q})}),(0,L.jsxs)(h.RecursionProvider,{blockName:b,uniqueId:x,children:[(0,L.jsx)(h.BlockList,{className:Di("is-"+v.toLowerCase()+"-preview","post-only"!==g||w?"wp-site-blocks":`${G} wp-block-post-content`,{"has-global-padding":"post-only"===g&&!w&&j}),layout:Y,dropZoneElement:s?te.current:te.current?.parentNode,__unstableDisableDropZone:"template-locked"===g}),"template-locked"===g&&(0,L.jsx)(sf,{contentRef:te})]})]})})})},xf={header:(0,fs.__)("Editor top bar"),body:(0,fs.__)("Editor content"),sidebar:(0,fs.__)("Editor settings"),actions:(0,fs.__)("Editor publish"),footer:(0,fs.__)("Editor footer")};function vf({className:e,styles:t,children:s,forceIsDirty:o,contentRef:n,disableIframe:i,autoFocus:r,customSaveButton:a,customSavePanel:l,forceDisableBlockTools:d,title:m,iframeProps:g}){const{mode:_,isRichEditingEnabled:f,isInserterOpened:b,isListViewOpened:y,isDistractionFree:x,isPreviewMode:v,showBlockBreadcrumbs:S,documentLabel:w}=(0,c.useSelect)((e=>{const{get:t}=e(k.store),{getEditorSettings:s,getPostTypeLabel:o}=e(Ac),n=s(),i=o();return{mode:e(Ac).getEditorMode(),isRichEditingEnabled:n.richEditingEnabled,isInserterOpened:e(Ac).isInserterOpened(),isListViewOpened:e(Ac).isListViewOpened(),isDistractionFree:t("core","distractionFree"),isPreviewMode:n.isPreviewMode,showBlockBreadcrumbs:t("core","showBlockBreadcrumbs"),documentLabel:i||(0,fs._x)("Document","noun, breadcrumb")}}),[]),C=(0,p.useViewportMatch)("medium"),P=y?(0,fs.__)("Document Overview"):(0,fs.__)("Block Library"),[j,E]=(0,u.useState)(!1),T=(0,u.useCallback)((e=>{"function"==typeof j&&j(e),E(!1)}),[j]);return(0,L.jsx)(al,{isDistractionFree:x,className:Di("editor-editor-interface",e,{"is-entity-save-view-open":!!j,"is-distraction-free":x&&!v}),labels:{...xf,secondarySidebar:P},header:!v&&(0,L.jsx)(W_,{forceIsDirty:o,setEntitiesSavedStatesCallback:E,customSaveButton:a,forceDisableBlockTools:d,title:m}),editorNotices:(0,L.jsx)(_d,{}),secondarySidebar:!v&&"visual"===_&&(b&&(0,L.jsx)(Y_,{})||y&&(0,L.jsx)(Q_,{})),sidebar:!v&&!x&&(0,L.jsx)(tl.Slot,{scope:"core"}),content:(0,L.jsxs)(L.Fragment,{children:[!x&&!v&&(0,L.jsx)(_d,{}),(0,L.jsx)(qg.Slot,{children:([e])=>e||(0,L.jsxs)(L.Fragment,{children:[!v&&("text"===_||!f)&&(0,L.jsx)(tf,{autoFocus:r}),!v&&!C&&"visual"===_&&(0,L.jsx)(h.BlockToolbar,{hideDragHandle:!0}),(v||f&&"visual"===_)&&(0,L.jsx)(yf,{styles:t,contentRef:n,disableIframe:i,autoFocus:r,iframeProps:g}),s]})})]}),footer:!v&&!x&&C&&S&&f&&"visual"===_&&(0,L.jsx)(h.BlockBreadcrumb,{rootLabelText:w}),actions:v?void 0:l||(0,L.jsx)(ef,{closeEntitiesSavedStates:T,isEntitiesSavedStatesOpen:j,setEntitiesSavedStatesCallback:E,forceIsDirtyPublishPanel:o})})}const{OverridesPanel:Sf}=$(ln.privateApis);function wf(){return(0,c.useSelect)((e=>"wp_block"===e(Ac).getCurrentPostType()),[])?(0,L.jsx)(Sf,{}):null}function kf(e){return"string"==typeof e.title?(0,Lo.decodeEntities)(e.title):e.title&&"rendered"in e.title?(0,Lo.decodeEntities)(e.title.rendered):e.title&&"raw"in e.title?(0,Lo.decodeEntities)(e.title.raw):""}const Cf=({items:e,closeModal:t})=>{const[s]=e,o=kf(s),{showOnFront:n,currentHomePage:i,isSaving:r}=(0,c.useSelect)((e=>{const{getEntityRecord:t,isSavingEntityRecord:s}=e(d.store),o=t("root","site"),n=t("postType","page",o?.page_on_front);return{showOnFront:o?.show_on_front,currentHomePage:n,isSaving:s("root","site")}})),{saveEntityRecord:a}=(0,c.useDispatch)(d.store),{createSuccessNotice:l,createErrorNotice:u}=(0,c.useDispatch)(_s.store);let p="";"posts"===n?p=(0,fs.__)("This will replace the current homepage which is set to display latest posts."):i&&(p=(0,fs.sprintf)((0,fs.__)('This will replace the current homepage: "%s"'),kf(i)));const m=(0,fs.sprintf)((0,fs.__)('Set "%1$s" as the site homepage? %2$s'),o,p).trim(),h=(0,fs.__)("Set homepage");return(0,L.jsx)("form",{onSubmit:async function(e){e.preventDefault();try{await a("root","site",{page_on_front:s.id,show_on_front:"page"}),l((0,fs.__)("Homepage updated."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("An error occurred while setting the homepage.");u(t,{type:"snackbar"})}finally{t?.()}},children:(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"5",children:[(0,L.jsx)(Uo.__experimentalText,{children:m}),(0,L.jsxs)(Uo.__experimentalHStack,{justify:"right",children:[(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},disabled:r,accessibleWhenDisabled:!0,children:(0,fs.__)("Cancel")}),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",disabled:r,accessibleWhenDisabled:!0,children:h})]})]})})},Pf=({items:e,closeModal:t})=>{const[s]=e,o=kf(s),{currentPostsPage:n,isPageForPostsSet:i,isSaving:r}=(0,c.useSelect)((e=>{const{getEntityRecord:t,isSavingEntityRecord:s}=e(d.store),o=t("root","site");return{currentPostsPage:t("postType","page",o?.page_for_posts),isPageForPostsSet:0!==o?.page_for_posts,isSaving:s("root","site")}})),{saveEntityRecord:a}=(0,c.useDispatch)(d.store),{createSuccessNotice:l,createErrorNotice:u}=(0,c.useDispatch)(_s.store);const p=i&&n?(0,fs.sprintf)((0,fs.__)('This will replace the current posts page: "%s"'),kf(n)):(0,fs.__)("This page will show the latest posts."),m=(0,fs.sprintf)((0,fs.__)('Set "%1$s" as the posts page? %2$s'),o,p),h=(0,fs.__)("Set posts page");return(0,L.jsx)("form",{onSubmit:async function(e){e.preventDefault();try{await a("root","site",{page_for_posts:s.id,show_on_front:"page"}),l((0,fs.__)("Posts page updated."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("An error occurred while setting the posts page.");u(t,{type:"snackbar"})}finally{t?.()}},children:(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"5",children:[(0,L.jsx)(Uo.__experimentalText,{children:m}),(0,L.jsxs)(Uo.__experimentalHStack,{justify:"right",children:[(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},disabled:r,accessibleWhenDisabled:!0,children:(0,fs.__)("Cancel")}),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",disabled:r,accessibleWhenDisabled:!0,children:h})]})]})})};function jf({postType:e,onActionPerformed:t,context:s}){const{defaultActions:o}=(0,c.useSelect)((t=>{const{getEntityActions:s}=$(t(Ac));return{defaultActions:s("postType",e)}}),[e]),{canManageOptions:n,hasFrontPageTemplate:i}=(0,c.useSelect)((e=>{const{getEntityRecords:t}=e(d.store),s=t("postType","wp_template",{per_page:-1});return{canManageOptions:e(d.store).canUser("update",{kind:"root",name:"site"}),hasFrontPageTemplate:!!s?.find((e=>"front-page"===e?.slug))}})),r=(()=>{const{pageOnFront:e,pageForPosts:t}=(0,c.useSelect)((e=>{const{getEntityRecord:t,canUser:s}=e(d.store),o=s("read",{kind:"root",name:"site"})?t("root","site"):void 0;return{pageOnFront:o?.page_on_front,pageForPosts:o?.page_for_posts}}));return(0,u.useMemo)((()=>({id:"set-as-homepage",label:(0,fs.__)("Set as homepage"),isEligible:s=>"publish"===s.status&&"page"===s.type&&e!==s.id&&t!==s.id,RenderModal:Cf})),[t,e])})(),a=(()=>{const{pageOnFront:e,pageForPosts:t}=(0,c.useSelect)((e=>{const{getEntityRecord:t,canUser:s}=e(d.store),o=s("read",{kind:"root",name:"site"})?t("root","site"):void 0;return{pageOnFront:o?.page_on_front,pageForPosts:o?.page_for_posts}}));return(0,u.useMemo)((()=>({id:"set-as-posts-page",label:(0,fs.__)("Set as posts page"),isEligible:s=>"publish"===s.status&&"page"===s.type&&e!==s.id&&t!==s.id,RenderModal:Pf})),[t,e])})(),l=n&&!i,{registerPostTypeSchema:p}=$((0,c.useDispatch)(Ac));return(0,u.useEffect)((()=>{p(e)}),[p,e]),(0,u.useMemo)((()=>{let e=[...o];if(l&&e.push(r,a),e=e.sort(((e,t)=>"move-to-trash"===t.id?-1:0)),e=e.filter((e=>!e.context||e.context===s)),t)for(let s=0;s<e.length;++s){if(e[s].callback){const o=e[s].callback;e[s]={...e[s],callback:(n,i)=>{o(n,{...i,onActionPerformed:o=>{i?.onActionPerformed&&i.onActionPerformed(o),t(e[s].id,o)}})}}}if(e[s].RenderModal){const o=e[s].RenderModal;e[s]={...e[s],RenderModal:n=>(0,L.jsx)(o,{...n,onActionPerformed:o=>{n.onActionPerformed&&n.onActionPerformed(o),t(e[s].id,o)}})}}}return e}),[s,o,t,r,a,l])}const{Menu:Ef,kebabCase:Tf}=$(Uo.privateApis);function Bf({postType:e,postId:t,onActionPerformed:s}){const[o,n]=(0,u.useState)(null),{item:i,permissions:r}=(0,c.useSelect)((s=>{const{getEditedEntityRecord:o,getEntityRecordPermissions:n}=$(s(d.store));return{item:o("postType",e,t),permissions:n("postType",e,t)}}),[t,e]),a=(0,u.useMemo)((()=>({...i,permissions:r})),[i,r]),l=jf({postType:e,onActionPerformed:s}),p=(0,u.useMemo)((()=>l.filter((e=>!e.isEligible||e.isEligible(a)))),[l,a]);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(Ef,{placement:"bottom-end",children:[(0,L.jsx)(Ef.TriggerButton,{render:(0,L.jsx)(Uo.Button,{size:"small",icon:n_,label:(0,fs.__)("Actions"),disabled:!p.length,accessibleWhenDisabled:!0,className:"editor-all-actions-button"})}),(0,L.jsx)(Ef.Popover,{children:(0,L.jsx)(Df,{actions:p,items:[a],setActiveModalAction:n})})]}),!!o&&(0,L.jsx)(Nf,{action:o,items:[a],closeModal:()=>n(null)})]})}function If({action:e,onClick:t,items:s}){const o="string"==typeof e.label?e.label:e.label(s);return(0,L.jsx)(Ef.Item,{onClick:t,children:(0,L.jsx)(Ef.ItemLabel,{children:o})})}function Nf({action:e,items:t,closeModal:s}){const o="string"==typeof e.label?e.label:e.label(t);return(0,L.jsx)(Uo.Modal,{title:e.modalHeader||o,__experimentalHideHeader:!!e.hideModalHeader,onRequestClose:null!=s?s:()=>{},focusOnMount:"firstContentElement",size:"medium",overlayClassName:`editor-action-modal editor-action-modal__${Tf(e.id)}`,children:(0,L.jsx)(e.RenderModal,{items:t,closeModal:s})})}function Df({actions:e,items:t,setActiveModalAction:s}){const o=(0,c.useRegistry)();return(0,L.jsx)(Ef.Group,{children:e.map((e=>(0,L.jsx)(If,{action:e,onClick:()=>{"RenderModal"in e?s(e):e.callback(t,{registry:o})},items:t},e.id)))})}const{Badge:Af}=$(Uo.privateApis);function Rf({postType:e,postId:t,onActionPerformed:s}){const o=(0,u.useMemo)((()=>Array.isArray(t)?t:[t]),[t]),{postTitle:n,icon:i,labels:r}=(0,c.useSelect)((t=>{const{getEditedEntityRecord:s,getCurrentTheme:n,getPostType:i}=t(d.store),{getPostIcon:r}=$(t(Ac));let a="";const l=s("postType",e,o[0]);if(1===o.length){var c;const{default_template_types:t=[]}=null!==(c=n())&&void 0!==c?c:{},s=[T,B].includes(e)?Y({template:l,templateTypes:t}):{};a=s?.title||l?.title}return{postTitle:a,icon:r(e,{area:l?.area}),labels:i(e)?.labels}}),[o,e]),a=qc(t);let l=(0,fs.__)("No title");return r?.name&&o.length>1?l=(0,fs.sprintf)((0,fs.__)("%i %s"),t.length,r?.name):n&&(l=(0,Kc.__unstableStripHTML)(n)),(0,L.jsxs)(Uo.__experimentalVStack,{spacing:1,className:"editor-post-card-panel",children:[(0,L.jsxs)(Uo.__experimentalHStack,{spacing:2,className:"editor-post-card-panel__header",align:"flex-start",children:[(0,L.jsx)(Uo.Icon,{className:"editor-post-card-panel__icon",icon:i}),(0,L.jsxs)(Uo.__experimentalText,{numberOfLines:2,truncate:!0,className:"editor-post-card-panel__title",as:"h2",children:[(0,L.jsx)("span",{className:"editor-post-card-panel__title-name",children:l}),a&&1===o.length&&(0,L.jsx)(Af,{children:a})]}),1===o.length&&(0,L.jsx)(Bf,{postType:e,postId:o[0],onActionPerformed:s})]}),o.length>1&&(0,L.jsx)(Uo.__experimentalText,{className:"editor-post-card-panel__description",children:(0,fs.sprintf)((0,fs.__)("Changes will be applied to all selected %s."),r?.name.toLowerCase())})]})}function Mf(){const{postContent:e}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s,getCurrentPostId:o}=e(Ac),{canUser:n}=e(d.store),{getEntityRecord:i}=e(d.store),r=n("read",{kind:"root",name:"site"})?i("root","site"):void 0,a=s();return{postContent:!(+o()===r?.page_for_posts)&&![T,B].includes(a)&&t("content")}}),[]),t=(0,fs._x)("words","Word count type. Do not translate!"),s=(0,u.useMemo)((()=>e?(0,Lh.count)(e,t):0),[e,t]);if(!s)return null;const o=Math.round(s/189),n=(0,fs.sprintf)((0,fs._n)("%s word","%s words",s),s.toLocaleString()),i=o<=1?(0,fs.__)("1 minute"):(0,fs.sprintf)((0,fs._n)("%s minute","%s minutes",o),o.toLocaleString());return(0,L.jsx)("div",{className:"editor-post-content-information",children:(0,L.jsx)(Uo.__experimentalText,{children:(0,fs.sprintf)((0,fs.__)("%1$s, %2$s read time."),n,i)})})}const Lf=function(){const{postFormat:e}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Ac),s=t("format");return{postFormat:null!=s?s:"standard"}}),[]),t=Bp.find((t=>t.id===e)),[s,o]=(0,u.useState)(null),n=(0,u.useMemo)((()=>({anchor:s,placement:"left-start",offset:36,shift:!0})),[s]);return(0,L.jsx)(Tp,{children:(0,L.jsx)(zd,{label:(0,fs.__)("Format"),ref:o,children:(0,L.jsx)(Uo.Dropdown,{popoverProps:n,contentClassName:"editor-post-format__dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:s})=>(0,L.jsx)(Uo.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change format: %s"),t?.caption),onClick:s,children:t?.caption}),renderContent:({onClose:e})=>(0,L.jsxs)("div",{className:"editor-post-format__dialog-content",children:[(0,L.jsx)(h.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Format"),onClose:e}),(0,L.jsx)(Ip,{})]})})})})};function Of(){const e=(0,c.useSelect)((e=>e(Ac).getEditedPostAttribute("modified")),[]),t=e&&(0,fs.sprintf)((0,fs.__)("Last edited %s."),(0,x.humanTimeDiff)(e));return t?(0,L.jsx)("div",{className:"editor-post-last-edited-panel",children:(0,L.jsx)(Uo.__experimentalText,{children:t})}):null}const Ff=function({className:e,children:t}){return(0,L.jsx)(Uo.__experimentalVStack,{className:Di("editor-post-panel__section",e),children:t})},Vf={};function zf(){const{editEntityRecord:e}=(0,c.useDispatch)(d.store),{postsPageTitle:t,postsPageId:s,isTemplate:o,postSlug:n}=(0,c.useSelect)((e=>{const{getEntityRecord:t,getEditedEntityRecord:s,canUser:o}=e(d.store),n=o("read",{kind:"root",name:"site"})?t("root","site"):void 0,i=n?.page_for_posts?s("postType","page",n?.page_for_posts):Vf,{getEditedPostAttribute:r,getCurrentPostType:a}=e(Ac);return{postsPageId:i?.id,postsPageTitle:i?.title,isTemplate:a()===T,postSlug:r("slug")}}),[]),[i,r]=(0,u.useState)(null),a=(0,u.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})},m=(0,Lo.decodeEntities)(t);return(0,L.jsx)(zd,{label:(0,fs.__)("Blog title"),ref:r,children:(0,L.jsx)(Uo.Dropdown,{popoverProps:a,contentClassName:"editor-blog-title-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,L.jsx)(Uo.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change blog title: %s"),m),onClick:t,children:m}),renderContent:({onClose:e})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(h.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Blog title"),onClose:e}),(0,L.jsx)(Uo.__experimentalInputControl,{placeholder:(0,fs.__)("No title"),size:"__unstable-large",value:t,onChange:(0,p.debounce)(l,300),label:(0,fs.__)("Blog title"),help:(0,fs.__)("Set the Posts Page title. Appears in search results, and when the page is shared on social media."),hideLabelFromVision:!0})]})})})}function Uf(){const{editEntityRecord:e}=(0,c.useDispatch)(d.store),{postsPerPage:t,isTemplate:s,postSlug:o}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s}=e(Ac),{getEditedEntityRecord:o,canUser:n}=e(d.store),i=n("read",{kind:"root",name:"site"})?o("root","site"):void 0;return{isTemplate:s()===T,postSlug:t("slug"),postsPerPage:i?.posts_per_page||1}}),[]),[n,i]=(0,u.useState)(null),r=(0,u.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,L.jsx)(zd,{label:(0,fs.__)("Posts per page"),ref:i,children:(0,L.jsx)(Uo.Dropdown,{popoverProps:r,contentClassName:"editor-posts-per-page-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:s})=>(0,L.jsx)(Uo.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.__)("Change posts per page"),onClick:s,children:t}),renderContent:({onClose:e})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(h.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Posts per page"),onClose:e}),(0,L.jsx)(Uo.__experimentalNumberControl,{placeholder:0,value:t,size:"__unstable-large",spinControls:"custom",step:"1",min:"1",onChange:a,label:(0,fs.__)("Posts per page"),help:(0,fs.__)("Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting."),hideLabelFromVision:!0})]})})})}const Hf=[{label:(0,fs._x)("Open",'Adjective: e.g. "Comments are open"'),value:"open",description:(0,fs.__)("Visitors can add new comments and replies.")},{label:(0,fs.__)("Closed"),value:"",description:[(0,fs.__)("Visitors cannot add new comments or replies."),(0,fs.__)("Existing comments remain visible.")].join(" ")}];function Gf(){const{editEntityRecord:e}=(0,c.useDispatch)(d.store),{allowCommentsOnNewPosts:t,isTemplate:s,postSlug:o}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s}=e(Ac),{getEditedEntityRecord:o,canUser:n}=e(d.store),i=n("read",{kind:"root",name:"site"})?o("root","site"):void 0;return{isTemplate:s()===T,postSlug:t("slug"),allowCommentsOnNewPosts:i?.default_comment_status||""}}),[]),[n,i]=(0,u.useState)(null),r=(0,u.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,L.jsx)(zd,{label:(0,fs.__)("Discussion"),ref:i,children:(0,L.jsx)(Uo.Dropdown,{popoverProps:r,contentClassName:"editor-site-discussion-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:s})=>(0,L.jsx)(Uo.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.__)("Change discussion settings"),onClick:s,children:t?(0,fs.__)("Comments open"):(0,fs.__)("Comments closed")}),renderContent:({onClose:e})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(h.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Discussion"),onClose:e}),(0,L.jsxs)(Uo.__experimentalVStack,{spacing:3,children:[(0,L.jsx)(Uo.__experimentalText,{children:(0,fs.__)("Changes will apply to new posts only. Individual posts may override these settings.")}),(0,L.jsx)(Uo.RadioControl,{className:"editor-site-discussion__options",hideLabelFromVision:!0,label:(0,fs.__)("Comment status"),options:Hf,onChange:a,selected:t})]})]})})})}function $f({onActionPerformed:e}){const{isRemovedPostStatusPanel:t,postType:s,postId:o}=(0,c.useSelect)((e=>{const{isEditorPanelRemoved:t,getCurrentPostType:s,getCurrentPostId:o}=e(Ac);return{isRemovedPostStatusPanel:t("post-status"),postType:s(),postId:o()}}),[]);return(0,L.jsx)(Ff,{className:"editor-post-summary",children:(0,L.jsx)(Iu.Slot,{children:n=>(0,L.jsx)(L.Fragment,{children:(0,L.jsxs)(Uo.__experimentalVStack,{spacing:4,children:[(0,L.jsx)(Rf,{postType:s,postId:o,onActionPerformed:e}),(0,L.jsx)(Ep,{withPanelBody:!1}),(0,L.jsx)(_p,{}),(0,L.jsxs)(Uo.__experimentalVStack,{spacing:1,children:[(0,L.jsx)(Mf,{}),(0,L.jsx)(Of,{})]}),!t&&(0,L.jsxs)(Uo.__experimentalVStack,{spacing:4,children:[(0,L.jsxs)(Uo.__experimentalVStack,{spacing:1,children:[(0,L.jsx)(ih,{}),(0,L.jsx)(ch,{}),(0,L.jsx)(Nh,{}),(0,L.jsx)(Ju,{}),(0,L.jsx)(Gu,{}),(0,L.jsx)(rp,{}),(0,L.jsx)(Ap,{}),(0,L.jsx)(eu,{}),(0,L.jsx)(uh,{}),(0,L.jsx)(zf,{}),(0,L.jsx)(Uf,{}),(0,L.jsx)(Gf,{}),(0,L.jsx)(Lf,{}),n]}),(0,L.jsx)(jh,{onActionPerformed:e})]})]})})})})}const{EXCLUDED_PATTERN_SOURCES:Wf,PATTERN_TYPES:Zf}=$(ln.privateApis);function Yf(e,t){return e.innerBlocks=e.innerBlocks.map((e=>Yf(e,t))),"core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=t),e}function Kf(e,t){return e.filter(((e,s,o)=>((e,t,s)=>t===s.findIndex((t=>e.name===t.name)))(e,s,o)&&(e=>!Wf.includes(e.source))(e)&&(e=>e.templateTypes?.includes(t.slug)||e.blockTypes?.includes("core/template-part/"+t.area))(e)))}function qf(e,t){return e.map((e=>({...e,keywords:e.keywords||[],type:Zf.theme,blocks:(0,y.parse)(e.content,{__unstableSkipMigrationLogs:!0}).map((e=>Yf(e,t)))})))}function Qf({availableTemplates:e,onSelect:t}){return e&&0!==e?.length?(0,L.jsx)(h.__experimentalBlockPatternsList,{label:(0,fs.__)("Templates"),blockPatterns:e,onClickPattern:t,showTitlesAsTooltip:!0}):null}function Xf(){const{record:e,postType:t,postId:s}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(Ac),{getEditedEntityRecord:o}=e(d.store),n=t(),i=s();return{postType:n,postId:i,record:o("postType",n,i)}}),[]),{editEntityRecord:o}=(0,c.useDispatch)(d.store),n=function(e){const{blockPatterns:t,restBlockPatterns:s,currentThemeStylesheet:o}=(0,c.useSelect)((e=>{var t;const{getEditorSettings:s}=e(Ac),o=s();return{blockPatterns:null!==(t=o.__experimentalAdditionalBlockPatterns)&&void 0!==t?t:o.__experimentalBlockPatterns,restBlockPatterns:e(d.store).getBlockPatterns(),currentThemeStylesheet:e(d.store).getCurrentTheme().stylesheet}}),[]);return(0,u.useMemo)((()=>qf(Kf([...t||[],...s||[]],e),e)),[t,s,e,o])}(e);return n?.length?(0,L.jsx)(Uo.PanelBody,{title:(0,fs.__)("Design"),initialOpen:e.type===B,children:(0,L.jsx)(Qf,{availableTemplates:n,onSelect:async e=>{await o("postType",t,s,{blocks:e.blocks,content:(0,y.serialize)(e.blocks)})}})}):null}function Jf(){const{postType:e}=(0,c.useSelect)((e=>{const{getCurrentPostType:t}=e(Ac);return{postType:t()}}),[]);return[B,T].includes(e)?(0,L.jsx)(Xf,{}):null}const eb={document:"edit-post/document",block:"edit-post/block"},{Tabs:tb}=$(Uo.privateApis),sb=(0,u.forwardRef)(((e,t)=>{const{documentLabel:s}=(0,c.useSelect)((e=>{const{getPostTypeLabel:t}=e(Ac);return{documentLabel:t()||(0,fs._x)("Document","noun, panel")}}),[]);return(0,L.jsxs)(tb.TabList,{ref:t,children:[(0,L.jsx)(tb.Tab,{tabId:eb.document,"data-tab-id":eb.document,children:s}),(0,L.jsx)(tb.Tab,{tabId:eb.block,"data-tab-id":eb.block,children:(0,fs.__)("Block")})]})})),{BlockQuickNavigation:ob}=$(h.privateApis),nb=["core/post-title","core/post-featured-image","core/post-content"];function ib(){const e=(0,u.useMemo)((()=>(0,m.applyFilters)("editor.postContentBlockTypes",nb)),[]),{clientIds:t,postType:s,renderingMode:o}=(0,c.useSelect)((t=>{const{getCurrentPostType:s,getPostBlocksByName:o,getRenderingMode:n}=$(t(Ac)),i=s();return{postType:i,clientIds:o(T===i?"core/template-part":e),renderingMode:n()}}),[e]),{enableComplementaryArea:n}=(0,c.useDispatch)(Ua);return"post-only"===o&&s!==T||0===t.length?null:(0,L.jsx)(Uo.PanelBody,{title:(0,fs.__)("Content"),children:(0,L.jsx)(ob,{clientIds:t,onSelect:()=>{n("core","edit-post/document")}})})}const{BlockQuickNavigation:rb}=$(h.privateApis);function ab(){const e=(0,c.useSelect)((e=>{const{getBlockTypes:t}=e(y.store);return t()}),[]),t=(0,u.useMemo)((()=>e.filter((e=>"theme"===e.category)).map((({name:e})=>e))),[e]),s=(0,c.useSelect)((e=>{const{getBlocksByName:s}=e(h.store);return s(t)}),[t]);return 0===s.length?null:(0,L.jsx)(Uo.PanelBody,{title:(0,fs.__)("Content"),children:(0,L.jsx)(rb,{clientIds:s})})}function lb(){const e=(0,c.useSelect)((e=>{const{getCurrentPostType:t}=e(Ac);return t()}),[]);return e!==B?null:(0,L.jsx)(ab,{})}const cb=function(){const{hasBlockSelection:e}=(0,c.useSelect)((e=>({hasBlockSelection:!!e(h.store).getBlockSelectionStart()})),[]),{getActiveComplementaryArea:t}=(0,c.useSelect)(Ua),{enableComplementaryArea:s}=(0,c.useDispatch)(Ua),{get:o}=(0,c.useSelect)(k.store);(0,u.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:db}=$(Uo.privateApis),ub=u.Platform.select({web:!0,native:!1}),pb=({tabName:e,keyboardShortcut:t,onActionPerformed:s,extraPanels:o})=>{const n=(0,u.useRef)(null),i=(0,u.useContext)(db.Context);return(0,u.useEffect)((()=>{const t=Array.from(n.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,L.jsx)(Lu,{identifier:e,header:(0,L.jsx)(db.Context.Provider,{value:i,children:(0,L.jsx)(sb,{ref:n})}),closeLabel:(0,fs.__)("Close Settings"),className:"editor-sidebar__panel",headerClassName:"editor-sidebar__panel-tabs",title:(0,fs._x)("Settings","panel button label"),toggleShortcut:t,icon:(0,fs.isRTL)()?da:ua,isActiveByDefault:ub,children:(0,L.jsxs)(db.Context.Provider,{value:i,children:[(0,L.jsxs)(db.TabPanel,{tabId:eb.document,focusable:!1,children:[(0,L.jsx)($f,{onActionPerformed:s}),(0,L.jsx)(vu.Slot,{}),(0,L.jsx)(ib,{}),(0,L.jsx)(lb,{}),(0,L.jsx)(Jf,{}),(0,L.jsx)(_h,{}),(0,L.jsx)(wf,{}),o]}),(0,L.jsx)(db.TabPanel,{tabId:eb.block,focusable:!1,children:(0,L.jsx)(h.BlockInspector,{})})]})})},mb=({extraPanels:e,onActionPerformed:t})=>{cb();const{tabName:s,keyboardShortcut:o,showSummary:n}=(0,c.useSelect)((e=>{const t=e(vl.store).getShortcutRepresentation("core/editor/toggle-sidebar"),s=e(Ua).getActiveComplementaryArea("core");let o=s;return[eb.block,eb.document].includes(s)||(o=e(h.store).getBlockSelectionStart()?eb.block:eb.document),{tabName:o,keyboardShortcut:t,showSummary:![T,B,N].includes(e(Ac).getCurrentPostType())}}),[]),{enableComplementaryArea:i}=(0,c.useDispatch)(Ua),r=(0,u.useCallback)((e=>{e&&i("core",e)}),[i]);return(0,L.jsx)(db,{selectedTabId:s,onSelect:r,selectOnMove:!1,children:(0,L.jsx)(pb,{tabName:s,keyboardShortcut:o,showSummary:n,onActionPerformed:t,extraPanels:e})})};const hb=function({postType:e,postId:t,templateId:s,settings:o,children:n,initialEdits:i,onActionPerformed:r,extraContent:a,extraSidebarPanels:l,...u}){const{post:p,template:m,hasLoadedPost:h,error:g}=(0,c.useSelect)((o=>{const{getEntityRecord:n,getResolutionError:i,hasFinishedResolution:r}=o(d.store),a=["postType",e,t];return{post:n(...a),template:s?n("postType",T,s):void 0,hasLoadedPost:r("getEntityRecord",a),error:i("getEntityRecord",a)?.message}}),[e,t,s]);return(0,L.jsxs)(L.Fragment,{children:[h&&!p&&(0,L.jsx)(Uo.Notice,{status:g?"error":"warning",isDismissible:!1,children:g||(0,fs.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")}),!!p&&(0,L.jsxs)(Yl,{post:p,__unstableTemplate:m,settings:o,initialEdits:i,useSubRegistry:!1,children:[(0,L.jsx)(vf,{...u,children:a}),n,(0,L.jsx)(mb,{onActionPerformed:r,extraPanels:l})]})]})},{PreferenceBaseOption:gb}=$(k.privateApis);function _b(e){const t=(0,c.useSelect)((e=>e(Ac).isPublishSidebarEnabled()),[]),{enablePublishSidebar:s,disablePublishSidebar:o}=(0,c.useDispatch)(Ac);return(0,L.jsx)(gb,{isChecked:t,onChange:e=>e?s():o(),...e})}const{BlockManager:fb}=$(h.privateApis),bb=[];function yb(){const{showBlockTypes:e,hideBlockTypes:t}=$((0,c.useDispatch)(Ac)),{blockTypes:s,allowedBlockTypes:o,hiddenBlockTypes:n}=(0,c.useSelect)((e=>{var t;return{blockTypes:e(y.store).getBlockTypes(),allowedBlockTypes:e(Ac).getEditorSettings().allowedBlockTypes,hiddenBlockTypes:null!==(t=e(k.store).get("core","hiddenBlockTypes"))&&void 0!==t?t:bb}}),[]),i=(0,u.useMemo)((()=>!0===o?s:s.filter((({name:e})=>o?.includes(e)))),[o,s]).filter((e=>(0,y.hasBlockSupport)(e,"inserter",!0)&&(!e.parent||e.parent.includes("core/post-content")))),r=n.filter((e=>i.some((t=>t.name===e)))),a=i.filter((e=>!r.includes(e.name)));return(0,L.jsx)(fb,{blockTypes:i,selectedBlockTypes:a,onChange:s=>{if(a.length>s.length){const e=a.filter((e=>!s.find((({name:t})=>t===e.name))));t(e.map((({name:e})=>e)))}else if(a.length<s.length){const t=s.filter((e=>!a.find((({name:t})=>t===e.name))));e(t.map((({name:e})=>e)))}}})}const{PreferencesModal:xb,PreferencesModalTabs:vb,PreferencesModalSection:Sb,PreferenceToggleControl:wb}=$(k.privateApis);function kb({extraSections:e={}}){const t=(0,p.useViewportMatch)("medium"),s=(0,c.useSelect)((e=>{const{getEditorSettings:s}=e(Ac),{get:o}=e(k.store),n=s().richEditingEnabled;return!o("core","distractionFree")&&t&&n}),[t]),{setIsListViewOpened:o,setIsInserterOpened:n}=(0,c.useDispatch)(Ac),{set:i}=(0,c.useDispatch)(k.store),r=(0,u.useMemo)((()=>[{name:"general",tabLabel:(0,fs.__)("General"),content:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(Sb,{title:(0,fs.__)("Interface"),children:[(0,L.jsx)(wb,{scope:"core",featureName:"showListViewByDefault",help:(0,fs.__)("Opens the List View panel by default."),label:(0,fs.__)("Always open List View")}),s&&(0,L.jsx)(wb,{scope:"core",featureName:"showBlockBreadcrumbs",help:(0,fs.__)("Display the block hierarchy trail at the bottom of the editor."),label:(0,fs.__)("Show block breadcrumbs")}),(0,L.jsx)(wb,{scope:"core",featureName:"allowRightClickOverrides",help:(0,fs.__)("Allows contextual List View menus via right-click, overriding browser defaults."),label:(0,fs.__)("Allow right-click contextual menus")}),(0,L.jsx)(wb,{scope:"core",featureName:"enableChoosePatternModal",help:(0,fs.__)("Shows starter patterns when creating a new page."),label:(0,fs.__)("Show starter patterns")})]}),(0,L.jsxs)(Sb,{title:(0,fs.__)("Document settings"),description:(0,fs.__)("Select what settings are shown in the document panel."),children:[(0,L.jsx)(fu.Slot,{}),(0,L.jsx)(mh,{taxonomyWrapper:(e,t)=>(0,L.jsx)(mu,{label:t.labels.menu_name,panelName:`taxonomy-panel-${t.slug}`})}),(0,L.jsx)(yp,{children:(0,L.jsx)(mu,{label:(0,fs.__)("Featured image"),panelName:"featured-image"})}),(0,L.jsx)(lp,{children:(0,L.jsx)(mu,{label:(0,fs.__)("Excerpt"),panelName:"post-excerpt"})}),(0,L.jsx)(Od,{supportKeys:["comments","trackbacks"],children:(0,L.jsx)(mu,{label:(0,fs.__)("Discussion"),panelName:"discussion-panel"})}),(0,L.jsx)(Ld,{children:(0,L.jsx)(mu,{label:(0,fs.__)("Page attributes"),panelName:"page-attributes"})})]}),t&&(0,L.jsx)(Sb,{title:(0,fs.__)("Publishing"),children:(0,L.jsx)(_b,{help:(0,fs.__)("Review settings, such as visibility and tags."),label:(0,fs.__)("Enable pre-publish checks")})}),e?.general]})},{name:"appearance",tabLabel:(0,fs.__)("Appearance"),content:(0,L.jsxs)(Sb,{title:(0,fs.__)("Appearance"),description:(0,fs.__)("Customize the editor interface to suit your needs."),children:[(0,L.jsx)(wb,{scope:"core",featureName:"fixedToolbar",onToggle:()=>i("core","distractionFree",!1),help:(0,fs.__)("Access all block and document tools in a single place."),label:(0,fs.__)("Top toolbar")}),(0,L.jsx)(wb,{scope:"core",featureName:"distractionFree",onToggle:()=>{i("core","fixedToolbar",!0),n(!1),o(!1)},help:(0,fs.__)("Reduce visual distractions by hiding the toolbar and other elements to focus on writing."),label:(0,fs.__)("Distraction free")}),(0,L.jsx)(wb,{scope:"core",featureName:"focusMode",help:(0,fs.__)("Highlights the current block and fades other content."),label:(0,fs.__)("Spotlight mode")}),e?.appearance]})},{name:"accessibility",tabLabel:(0,fs.__)("Accessibility"),content:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Sb,{title:(0,fs.__)("Navigation"),description:(0,fs.__)("Optimize the editing experience for enhanced control."),children:(0,L.jsx)(wb,{scope:"core",featureName:"keepCaretInsideBlock",help:(0,fs.__)("Keeps the text cursor within blocks while navigating with arrow keys, preventing it from moving to other blocks and enhancing accessibility for keyboard users."),label:(0,fs.__)("Contain text cursor inside block")})}),(0,L.jsx)(Sb,{title:(0,fs.__)("Interface"),children:(0,L.jsx)(wb,{scope:"core",featureName:"showIconLabels",label:(0,fs.__)("Show button text labels"),help:(0,fs.__)("Show text instead of icons on buttons across the interface.")})})]})},{name:"blocks",tabLabel:(0,fs.__)("Blocks"),content:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Sb,{title:(0,fs.__)("Inserter"),children:(0,L.jsx)(wb,{scope:"core",featureName:"mostUsedBlocks",help:(0,fs.__)("Adds a category with the most frequently used blocks in the inserter."),label:(0,fs.__)("Show most used blocks")})}),(0,L.jsx)(Sb,{title:(0,fs.__)("Manage block visibility"),description:(0,fs.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later."),children:(0,L.jsx)(yb,{})})]})},window.__experimentalMediaProcessing&&{name:"media",tabLabel:(0,fs.__)("Media"),content:(0,L.jsx)(L.Fragment,{children:(0,L.jsxs)(Sb,{title:(0,fs.__)("General"),description:(0,fs.__)("Customize options related to the media upload flow."),children:[(0,L.jsx)(wb,{scope:"core/media",featureName:"optimizeOnUpload",help:(0,fs.__)("Compress media items before uploading to the server."),label:(0,fs.__)("Pre-upload compression")}),(0,L.jsx)(wb,{scope:"core/media",featureName:"requireApproval",help:(0,fs.__)("Require approval step when optimizing existing media."),label:(0,fs.__)("Approval step")})]})})}].filter(Boolean)),[s,e,n,o,i,t]);return(0,L.jsx)(vb,{sections:r})}const Cb=function({postType:e}){const{registerPostTypeSchema:t}=$((0,c.useDispatch)(Ac));(0,u.useEffect)((()=>{t(e)}),[t,e]);const{defaultFields:s}=(0,c.useSelect)((t=>{const{getEntityFields:s}=$(t(Ac));return{defaultFields:s("postType",e)}}),[e]),{records:o,isResolving:n}=(0,d.useEntityRecords)("root","user",{per_page:-1});return{isLoading:n,fields:(0,u.useMemo)((()=>s.map((e=>"author"===e.id?{...e,elements:o?.map((({id:e,name:t})=>({value:e,label:t})))}:e))),[o,s])}},Pb="content",jb={name:"core/pattern-overrides",getValues({select:e,clientId:t,context:s,bindings:o}){const n=s["pattern/overrides"],{getBlockAttributes:i}=e(h.store),r=i(t),a={};for(const e of Object.keys(o)){const t=n?.[r?.metadata?.name]?.[e];void 0!==t?a[e]=""===t?void 0:t:a[e]=r[e]}return a},setValues({select:e,dispatch:t,clientId:s,bindings:o}){const{getBlockAttributes:n,getBlockParentsByBlockName:i,getBlocks:r}=e(h.store),a=n(s),l=a?.metadata?.name;if(!l)return;const[c]=i(s,"core/block",!0),d=Object.entries(o).reduce(((e,[t,{newValue:s}])=>(e[t]=s,e)),{});if(!c){const e=s=>{for(const o of s)o.attributes?.metadata?.name===l&&t(h.store).updateBlockAttributes(o.clientId,d),e(o.innerBlocks)};return void e(r())}const u=n(c)?.[Pb];t(h.store).updateBlockAttributes(c,{[Pb]:{...u,[l]:{...u?.[l],...Object.entries(d).reduce(((e,[t,s])=>(e[t]=void 0===s?"":s,e)),{})}}})},canUserEditValue:()=>!0};function Eb(e,t){const{getEditedEntityRecord:s}=e(d.store),{getRegisteredPostMeta:o}=$(e(d.store));let n;t?.postType&&t?.postId&&(n=s("postType",t?.postType,t?.postId).meta);const i=o(t?.postType),r={};return Object.entries(i||{}).forEach((([e,t])=>{var s;"footnotes"!==e&&"_"!==e.charAt(0)&&(r[e]={label:t.title||e,value:null!==(s=n?.[e])&&void 0!==s?s:t.default||void 0,type:t.type})})),Object.keys(r||{}).length?r:null}const Tb={name:"core/post-meta",getValues({select:e,context:t,bindings:s}){const o=Eb(e,t),n={};for(const[e,t]of Object.entries(s)){var i;const s=t.args.key,{value:r,label:a}=o?.[s]||{};n[e]=null!==(i=null!=r?r:a)&&void 0!==i?i:s}return n},setValues({dispatch:e,context:t,bindings:s}){const o={};Object.values(s).forEach((({args:e,newValue:t})=>{o[e.key]=t})),e(d.store).editEntityRecord("postType",t?.postType,t?.postId,{meta:o})},canUserEditValue({select:e,context:t,args:s}){if(t?.query||t?.queryId)return!1;if(!t?.postType)return!1;const o=Eb(e,t)?.[s.key]?.value;if(void 0===o)return!1;if(e(Ac).getEditorSettings().enableCustomFields)return!1;return!!e(d.store).canUser("update",{kind:"postType",name:t?.postType,id:t?.postId})},getFieldsList:({select:e,context:t})=>Eb(e,t)};const{store:Bb,...Ib}=r,Nb={};function Db(e,t,s){const{registerEntityAction:o}=$((0,c.dispatch)(Ac))}function Ab(e,t,s){const{unregisterEntityAction:o}=$((0,c.dispatch)(Ac))}function Rb(e,t,s){const{registerEntityField:o}=$((0,c.dispatch)(Ac))}function Mb(e,t,s){const{unregisterEntityField:o}=$((0,c.dispatch)(Ac))}G(Nb,{CreateTemplatePartModal:Jo,patternTitleField:xr,templateTitleField:_r,BackButton:t_,EntitiesSavedStatesExtensible:Ed,Editor:hb,EditorContentSlotFill:qg,GlobalStylesProvider:function({children:e}){const t=Wr();return t.isReady?(0,L.jsx)(Hr.Provider,{value:t,children:e}):null},mergeBaseAndUserConfigs:$r,PluginPostExcerpt:pp,PostCardPanel:Rf,PreferencesModal:function({extraSections:e={}}){const t=(0,c.useSelect)((e=>e(Ua).isModalActive("editor/preferences")),[]),{closeModal:s}=(0,c.useDispatch)(Ua);return t?(0,L.jsx)(xb,{closeModal:s,children:(0,L.jsx)(kb,{extraSections:e})}):null},usePostActions:jf,usePostFields:Cb,ToolsMoreMenuGroup:E_,ViewMoreMenuGroup:I_,ResizableEditor:rf,registerCoreBlockBindingsSources:function(){(0,y.registerBlockBindingsSource)(jb),(0,y.registerBlockBindingsSource)(Tb)},getTemplateInfo:Y,interfaceStore:Bb,...Ib})})(),(window.wp=window.wp||{}).editor=o})();
وزير الاتصالات وتكنولوجيا المعلومات: نُخطط لمستقبل رقمي لا يعتمد على الورق” – tahkoom.com
خطوة

وزير الاتصالات وتكنولوجيا المعلومات: نُخطط لمستقبل رقمي لا يعتمد على الورق”

كتبت : فرح سمير                                                                                                                                                           في ضوء التحولات المتسارعة التي يشهدها العالم في مجالات الاتصالات وتكنولوجيا

المعلومات، تسعى مصر، من خلال رؤية استراتيجية طموحة، إلى تحقيق التحول الرقمي الشامل وتعزيز مكانتها الإقليمية والدولية في الاقتصاد الرقمي.

وفي هذا الإطار، يسعدنا أن نلتقي مع معالي الدكتور” عمرو طلعت، وزير الاتصالات وتكنولوجيا المعلومات”،

 لمناقشة أبرز إنجازات الوزارة، وخططها المستقبلية في مجالات التحول الرقمي، وتطوير البنية التحتية، ودعم الشركات الناشئة، وتنمية الكفاءات التكنولوجية، بالإضافة إلى استعراض جهود الدولة في تبني الذكاء الاصطناعي كأحد ركائز التنمية المستدامة.

يأتي هذا اللقاء لإلقاء الضوء على ملامح المشهد الرقمي في مصر، والتعرف على المبادرات والمشروعات الوطنية التي تسعى لتحقيق نقلة نوعية في حياة المواطنين وتعزيز تنافسية الاقتصاد المصري.

– في ضوء الجهود المستمرة لتطوير منصة مصر الرقمية وتوسيع نطاق خدماتها، ما هو الموقف الحالي للخدمات المقدمة من خلال المنصة من حيث عدد الخدمات المقدمة وعدد المستخدمين؟ وما هي الخطط المستقبلية لتعزيز دورها في تحسين كفاءة الخدمات الحكومية وتسهيل حياة المواطنين؟

نعمل على بناء مصر الرقمية التى ترتكز على الفكر الابتكارىوتطويع التكنولوجيات الحديثة للوصول إلى مجتمع رقمى متكامل يتم من خلاله دفع مسيرة التحول الرقمي ومعاونة كافة قطاعات الدولة فىتطويع التكنولوجيات الحديثة لرفع كفاءة الأداء الحكومى وزيادة الانتاجية، وتمكين الشباب من الحصول على فرص عمل متميزة، بالإضافة إلى دعم الابداع الرقمي وريادة الأعمال.

ويعد التحول الرقمي أحد المحاور الرئيسية لاستراتيجية مصر الرقمية. ونسعى من خلال مشروعات التحول الرقمي التعاون مع كافة قطاعات الدولة فى تطويع التكنولوجيات الحديثة لرفع كفاءة الأداء الحكومى وزيادة الإنتاجية وتحسين جودة الخدمات الحكومية المقدمة للمواطنين.

وفي هذا الإطار، تُمثل منصة “مصر الرقمية” أحد أبرز ثمار هذا التوجه؛ حيت توفر المنصة حتى الآن أكثر من 180 خدمة حكومية على المنصة، كما يوجد حاليا 9 مليون مواطن مسجل على منصة مصر الرقمية. ونعمل على التوسع في عدد الخدمات الخدمات الحكومية على المنصة بشكل مستمر، حيث نخطط لإطلاق المزيد منها خلال العام الجاري..

كما نخطط حاليا للمرحلة الثانية من رقمنة الخدمات الحكومية والتي سيتم خلالها قصر تقديم بعض الخدمات الحكومية على المنصات الرقمية بحيث أنه لا يتم تقديمها إلا من خلال منصة رقمية لتخفيف العبء على المكاتب المقدمة للخدمة وتخفيف الجهد على العاملين المقدمين لهذه الخدمات. حيث من المقرر أن يكون هناك 55 خدمة حكومية مقدمة فقط من خلال منصة مصر الرقمية وذلك بنهاية هذا العام وتشمل خدمات التأمينات والسجل التجاري والتعليم وخدمات متعلقة بالأحوال الشخصية بالتعاون مع وزارة الداخلية.

– ما هي أبرز مشروعات التحول الرقمي الجاري تنفيذها؟

هناك العديد من المشروعات التى يتم تنفيذها بالتعاون مع مختلف قطاعات الدولة أبرزها مشروعات تستهدف تفعيل دور التحول الرقمىفى رفع كفاءة خدمات الرعاية الصحية لتطوير الخدمات المقدمة للمواطنين وحوكمة المنظومة وتشمل مشروع النشر المرقمن لمنظومة التأمين الصحى الشامل، والتوسع فى استخدام تقنيات إنترنت الأشياء والتشخيص والتطبيب عن بعد لخدمة المناطق النائية بالتعاون مع وزارتى الصحة والتعليم العالى والبحث العلمى.

كما يتم التعاون مع وزارة الاستثمار والتجارة الخارجية في عدد من المشروعات التي تستهدف إنشاء منظومة رقمية لخدمة الكيانات الاقتصادية وتحسين خدمة المستثمرين في مراحل التعامل مع الجهات الحكومية، وعمل رقمنة كاملة لدورة حياة الشركات تبدأ من تأسيس الشركات حتى تصفية الأعمال. بالإضافة إلى التعاون مع وزارة الزرعة في تنفيذ مشروعات ميكنة الحيازة الزراعية وإصدار كارت الفلاح، وتطوير البوابة المعلوماتية لوزارة الزراعة واستصلاح الأراضى، وحصر وإدارة املاك وأصول وزارة الزراعة، وميكنة الهيئة العامة لمشروعات التعمير والتنمية الزراعية.

كما يتم التعاون مع وزارة الأوقاف في تنفيذ مشروع ميكنة خدمات وزارة الأوقاف وإطلاقها على منصة مصر الرقمية، ورقمنة عملية تلقى تبرعات صكوك الأضاحي، ومشروع رقمنة أطلس وزارة الأوقاف، بالإضافة إلى التعاون فى تنفيذ مشروع حصر وإدارة املاك وأصول الدولة لتمكين وزارة الأوقاف وهيئة الأوقاف المصرية من إدارة أملاكهم على نحو كفء.

– ما العوامل التي ساهمت في حصول مصر على لقب أسرع إنترنت ثابت في أفريقيا في فترات سابقة؟ وما هي أبرز الجهود الحالية والمستقبلية لتحسين خدمات الاتصالات بشكل عام؟

تمثل البنية التحتية الرقمية أحد الممكنات الرئيسية لاستراتيجية مصر الرقمية من أجل تقديم خدمات اتصالات ذات كفاءة عالية، ودعم عمليات التحول الرقمي؛ ولذا كانت من أهم محاور العمل التي تم البدء في تنفيذها لتحقيق استراتيجية مصر الرقمية هو تطوير البنية التحتية الرقمية ورفع كفاءة الانترنت؛ وعند البدء في تنفيذ المشروع في 2018 كان ترتيب مصر في متوسط سرعة الانترنت في المركز الأربعين على مستوى القارة الأفريقية؛ وتم تنفيذ المشروع باستثمارات منذ 2018. حيث تم ضخ استثمارات بقيمة 3.5 مليار دولار فى تطوير البنية التحتية الرقمية ساهمت في مضاعفة سرعة الانترنت الثابت أكثر من 15 مرة خلال 7 أعوام.

وفيما يخض الجهود المعنية بتحسين خدمات المحمول؛ فقد تم مؤخرا منح تراخيص تشغيل خدمات الجيل الخامس للتليفون المحمول لشركات المحمول الأربعة العاملة فى مصر بقيمة 675 مليون دولار. كما يتم استكمال العمل فى تنفيذ خطة لزيادة عدد أبراج المحمول حيث بلغ الاجمالى حتى الان نحو 37 ألف برج محمول فى كافة أنحاء الجمهورية. ومن المقرر خلال منتصف العام الحالي الانتهاء من تغطية كافة الطرق السريعة مكتملة الإنشاء بخدمات المحمول. وذلك بالإضافة الى إطلاق خدمات جديدة لتحسين الجودة ومن أبرزها الشرائح المدمجة eSIM، وخدمات مكالمات المحمول عبر شبكة الإنترنت الهوائى WiFi Calling.

كذلك يتم تنفيذ عدد من المشروعات لتطوير البنية التحتية الرقمية فىقرى مشروع حياة كريمة لخدمة 60 مليون مواطن وتستهدف المشروعات توصيل كابلات الألياف الضوئية إلى 9.3 مليون مبنى لتوفير الانترنت فائق السرعة، وكذلك نشر 3700 برج محمول لتحسين خدمات الاتصالات بالقرى. باستثمارات تقدر بنحو 8.8 مليار جنيه في مختلف مراحل المشروع، ومن المخطط الانتهاء من كافة مراحل المشروع فى منتصف العام الحالي.

– ما هي أبرز جهود وزارة الاتصالات وتكنولوجيا المعلومات في بناء القدرات الرقمية للشباب وتأهيلهم لسوق العمل المحلي والعالمي؟

تحظى مصر بثورة بشرية الأغلبية منها شباب، وتخرج مصر سنويًا أكثر من 50,000 متخصص في تكنولوجيا المعلومات؛ وتعد الكفاءات الرقمية أبرز العناصر الجاذبة لاستثمارات الشركات العالمية لمصر. لذا تحرص وزارة الاتصالات وتكنولوجيا المعلومات على توفير مبادرات لكل فئات المجتمع في مختلف المراحل العمرية ومن خريجي مختلف التخصصات سواء تكنولوجية أو غير تكنولوجية وفي جميع أنحاء الجمهورية.

وفى خلال 7 أعوام تضاعفت موازنة التدريب بالوزارة 40 مرة، وتضاعف عدد المتدربين 125 مرة ليصل إلى 500 ألف متدرب بموازنة 2 مليار جنيه خلال العام المالى الحالي.

ونحرص على أن تشمل البرامج التدريبية كافة المراحل العمرية بدءا من سن 8 سنوات من خلال مبادرات أجيال مصر الرقمية التي توفر برامج تدريبية متخصصة لطلاب المدارس والجامعات والخريجين بهدف تنمية مهاراتهم فى التخصصات الحديثة فى مجال الاتصالات وتكنولوجيا المعلومات ومنها الذكاء الاصطناعى، وعلوم البيانات، والأمن السيبرانى، والنظم المدمجة، والفنون الرقمية، وإدارة موارد المؤسسات وغيرها بما يتواكب مع متطلبات سوق العمل المحلى والعالمى، كما يتم توفير برامج تعليمية متخصصة بأعلى معايير الكفاءة والجودة في مجال الاتصالات وتكنولوجيا المعلومات من خلال مدارسwe للتكنولوجيا التطبيقية. حيث تم إطلاق 19 مدرسة في إطار خطة تستهدف إنشاء مدرسة بكل محافظة.

كما يتم توفير برامج تعليمية متقدمة فى أحدث مجالات الاتصالات وتكنولوجيا المعلومات مثل: الذكاء الاصطناعى وعلوم وهندسة البيانات، وهندسة الإلكترونيات والاتصالات، وتحليل الأعمال والتسويق الرقمي، والفنون الرقمية من خلال جامعة مصر للمعلوماتية، التى تعد أول جامعة متخصصة فى الاتصالات وتكنولوجيا المعلومات فى أفريقيا.

ومؤخرا أطلقنا مبادرة الرواد الرقميون التي توفر مجموعة من البرامج الأكاديمية المكثفة التى تتيح الحصول على دبلومات وماجستير مهنىأو علمى في التخصصات التكنولوجية بالشراكة مع كبرى الشركات التكنولوجية المحلية والعالمية وكذلك الشركات المتخصصة فى تنمية المهارات الشخصية واللغوية والجامعات المرموقة

 – ما أشكال الدعم التي تقدمها الوزارة لرواد الأعمال في مجال التكنولوجيا والشركات الناشئة؟

صناعة الاتصالات وتكنولوجيا المعلومات هي صناعة قوامها الابداع؛ لذا نحرص على تحفيز الشباب على العمل الابتكاري وتعزيز نمو قطاع الشركات التكنولوجية الناشئة، وتذليل العقبات التى تواجه رواد الأعمال في مختلف المحافظات.

ويمكن للشركات الناشئة والمبتكرين الالتحاق بالبرامج المقدمة في مراكز إبداع مصر الرقمية في مختلف المحافظات والتي يتم من خلالها تقديم سلسلة القيمة للشركات الناشئة والتي تبدأ بالعصف الفكرى وبناء أفكار تصلح لإقامة شركات ثم تدريب الشباب أصحاب هذه الأفكار تدريب تقني واقتصادى وتسويقى ثم بناء خطة لتأسيس الشركة تمهيدا لبدء النشاط، ثم إنشاء الشركات واحتضانها، ثم عقد محافل تشبيك لجذب الاستثمارات.

ولقد تم حتى الآن إنشاء 23 مركزا في مختلف المحافظات في إطار خطة تستهدف إنشاء مركز إبداع مصر الرقمية بكل محافظة. كما تم الاتفاق مع شركتين عالميتين مرموقتين فى مجال تمكين الشركات الناشئة وتسريع نموها للاستفادة من الخبرات العالمية في تنمية الاستثمارات فى الشركات الناشئة.

ونعمل حاليا على التوسع في انشاء الحاضنات التي تركز على تخصصات تكنولوجية محددة؛ حيث تم إنشاء معمل الابتكار الحكومى في مركز إبداع مصر الرقمية الجيزة الذي يهدف إلى تمكين الشركات الناشئة المبتكرة المهتمة بمجال التكنولوجيا الحكومية، وتعزيز الابتكار فى مجال التكنولوجيا الحكومية مما يساهم فىتحسين جودة الخدمات الحكومية المقدمة للمواطنين، وتعزيز مكانة مصر في المؤشرات العالمية للتحول الرقمي.

ونعمل حاليا على توفير بنية تحتية حوسبية للشركات الناشئة التي تعمل في مجال الذكاء الاصطناعي من خلال مركز الابتكار التطبيقي، كما نوفر منظومة متكاملة لدعم الشركات العاملة في مجال تصميم الالكترونيات من خلال مركز امحوتب للابداع والتطوير في مدينة المعرفة بالعاصمة الإدارية الجديدة. وذلك بالإضافة الى دعم الشركات الناشئة العاملة في مجال التكنولوجيات المساعدة من خلال الأكاديمية الوطنية لتكنولوجيا المعلومات للأشخاص ذوي الإعاقة.

– يشهد سوق العمل تحولًا متزايدًا نحو العمل الحر. ما هي أبرز المبادرات وأنواع الدعم التي تقدمها الوزارة للمهنيين المستقلين لتمكينهم وتنمية مساهمتهم في الاقتصاد الرقمي؟

تولي وزارة الاتصالات وتكنولوجيا المعلومات أهمية كبيرة لدعم المهنيين المستقلين، بما يمثله من أهمية في توفير فرص عمل جديدة وغير تقليدية، والمساهمة في دعم نمو الاقتصاد الرقمي.  لذلك، حرصنا على أن تشتمل جميع المبادرات التدريبية التي تقدمها الوزارة على توفير تدريب متخصص في مهارات العمل الحر، إلى جانب التدريب التقني، بما يتيح للمتدربين خيارات متعددة للالتحاق بسوق العمل، سواء من خلال وظيفة تقليدية أو من خلال العمل كمحترف مستقل على المنصات الرقمية.

وترتكز استراتيجية الوزارة لدعم العمل الحر على أربعة محاور رئيسية وهي: إتاحة البرامج التدريبية، وتطوير خدمات الإنترنت، وتوفير مساحات عمل مجهزة، إلى جانب تقديم الحوافز والدعم الفني والمالي للمهنيين المستقلين.

ومن خلال الجهات التدريبية التابعة للوزارة كالمعهد القومي للاتصالات، ومعهد تكنولوجيا المعلومات، ومدارس WE للتكنولوجيا التطبيقية، والبرامج التدريبية المتاحة على منصة “مهارة تك”، وضمن مبادرة “رواد مصر الرقمية”، ومبادرة “ITIDA Gigs”، نعمل على إعداد وتأهيل كفاءات قادرة على المنافسة في سوق العمل الحر، وصقلها بالمهارات التقنية المطلوبة، ومهارات تقديم العروض والتسعير والتفاوض، إلى جانب تدريب المتدربين على كيفية إنشاء حسابات فعالة على منصات العمل الحر الدولية.

كما نضخ استثمارات مستمرة لتطوير شبكة الإنترنت، وتوفير بيئة عمل محفزة من خلال مراكز “إبداع مصر الرقمية” المنتشرة في مختلف المحافظات، والتي وصل عددها إلى 23 مركزاً، ومستهدف زيادتها إلى 27 مركزاً بنهاية العام الجاري.

ندعم أيضًا المهنيين المستقلين من خلال إقامة معسكرات تدريب تطبيقية وملتقيات تشبيك، وإطلاق مبادرة بالتعاون مع بنك ناصر لتوفير تمويل ميسر لشراء أجهزة الحاسب الآلي. كذلك تم بناء منصة رقمية للمهنيين المستقلين تتضمن مجموعة من المميزات لهم بما فىذلك توفير خدمات استشارية فى مجال الضرائب، وتمكينهم من كتابة عقود منمطة وفتح حساب بنكى.

في ختام لقاءنا مع معالي الوزير تتضح ملامح الرؤية المستقبلية التي تتبناها الدولة لبناء مجتمع رقمي متكامل، يدعم الابتكار، ويعزز الشمول الرقمي، ويرسخ مكانة مصر كمركز إقليمي في مجالات التكنولوجيا الحديثة. 

وقد أبرز الحوار حجم الجهود المبذولة في تطوير البنية التحتية الرقمية، ودعم رواد الأعمال، وتأهيل الكوادر الوطنية، بما يتماشى مع مستهدفات “مصر الرقمية” واستراتيجية الذكاء الاصطناعي.

كما تبين لنا أيضا قوة مصر العقلية المبتكرة من قديم الازل حيث أوضح لنا معالي الوزير اثناء زيارته شعار الوزارة الرسمي، حيث تتمركز ايست أله التدوين للمعلومات وحفظها، فهى ركز لقوة مصر من قديم الزمان حتى الان على الابتكار والتطور التكنولوجي والعلمي

نتوجه بالشكر إلى معالي الوزير “عمرو طلعت ” على سعة صدره وإجاباته الوافية، ونتطلع إلى استمرار هذا الزخم لتحقيق المزيد من الإنجازات التي تصب في مصلحة المواطن المصري وتواكب تطورات العصر الرقمي.

 

ممثلين فريق عمل مجلة تحكم مع معالي وزير الاتصالات وتكنولوجيا المعلومات “عمرو طلعت”
اظهر المزيد

مقالات ذات صلة

زر الذهاب إلى الأعلى