/*! This file is auto-generated */ (()=>{var e={4306:function(e,t){var n,o,r; /*! autosize 4.0.4 license: MIT http://www.jacklmoore.com/autosize */o=[e,t],n=function(e,t){"use strict";var n,o,r="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),o.splice(t,1))}}),s=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){s=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function a(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,o=null,a=function(){e.clientWidth!==n&&p()},i=function(t){window.removeEventListener("resize",a,!1),e.removeEventListener("input",p,!1),e.removeEventListener("keyup",p,!1),e.removeEventListener("autosize:destroy",i,!1),e.removeEventListener("autosize:update",p,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),r.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",i,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",p,!1),window.addEventListener("resize",a,!1),e.addEventListener("input",p,!1),e.addEventListener("autosize:update",p,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:i,update:p}),l()}function l(){var n=window.getComputedStyle(e,null);"vertical"===n.resize?e.style.resize="none":"both"===n.resize&&(e.style.resize="horizontal"),t="content-box"===n.boxSizing?-(parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)):parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),isNaN(t)&&(t=0),p()}function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}function d(){if(0!==e.scrollHeight){var o=u(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function p(){d();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r{e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},66:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)};var n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function o(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function r(e,t,n){return e.concat(t).map((function(e){return o(e,n)}))}function s(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 a(e,t){try{return t in e}catch(e){return!1}}function i(e,t,n){var r={};return n.isMergeableObject(e)&&s(e).forEach((function(t){r[t]=o(e[t],n)})),s(t).forEach((function(s){(function(e,t){return a(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,s)||(a(e,s)&&n.isMergeableObject(t[s])?r[s]=function(e,t){if(!t.customMerge)return l;var n=t.customMerge(e);return"function"==typeof n?n:l}(s,n)(e[s],t[s],n):r[s]=o(t[s],n))})),r}function l(e,n,s){(s=s||{}).arrayMerge=s.arrayMerge||r,s.isMergeableObject=s.isMergeableObject||t,s.cloneUnlessOtherwiseSpecified=o;var a=Array.isArray(n);return a===Array.isArray(e)?a?s.arrayMerge(e,n,s):i(e,n,s):o(n,s)}l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return l(e,n,t)}),{})};var c=l;e.exports=c},461:(e,t,n)=>{var o=n(6109);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var s=e.nodeName,a=document.createElement(s);a.innerHTML=" ","TEXTAREA"===s.toUpperCase()&&a.setAttribute("rows","1");var i=o(e,"font-size");a.style.fontSize=i,a.style.padding="0px",a.style.border="0px";var l=document.body;l.appendChild(a),n=a.offsetHeight,l.removeChild(a)}return n}},628:(e,t,n)=>{"use strict";var o=n(4067);function r(){}function s(){}s.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,s,a){if(a!==o){var i=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 i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:s,resetWarningCache:r};return n.PropTypes=n,n}},5826:(e,t,n)=>{e.exports=n(628)()},4067:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4462:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n{"use strict";var o=n(4462);t.A=o.TextareaAutosize},9681:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},n=Object.keys(t).join("|"),o=new RegExp(n,"g"),r=new RegExp(n,"");function s(e){return t[e]}var a=function(e){return e.replace(o,s)};e.exports=a,e.exports.has=function(e){return!!e.match(r)},e.exports.remove=a},1609:e=>{"use strict";e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var s=t[o]={exports:{}};return e[o].call(s.exports,s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";n.r(o),n.d(o,{AlignmentToolbar:()=>vd,Autocomplete:()=>yd,AutosaveMonitor:()=>ps,BlockAlignmentToolbar:()=>kd,BlockControls:()=>wd,BlockEdit:()=>Sd,BlockEditorKeyboardShortcuts:()=>Pd,BlockFormatControls:()=>Cd,BlockIcon:()=>Td,BlockInspector:()=>xd,BlockList:()=>Id,BlockMover:()=>Bd,BlockNavigationDropdown:()=>Nd,BlockSelectionClearer:()=>Ad,BlockSettingsMenu:()=>Dd,BlockTitle:()=>Rd,BlockToolbar:()=>Md,CharacterCount:()=>su,ColorPalette:()=>Ld,ContrastChecker:()=>Od,CopyHandler:()=>Fd,DefaultBlockAppender:()=>Vd,DocumentBar:()=>vs,DocumentOutline:()=>Ns,DocumentOutlineCheck:()=>As,EditorHistoryRedo:()=>Ls,EditorHistoryUndo:()=>Os,EditorKeyboardShortcuts:()=>us,EditorKeyboardShortcutsRegister:()=>Ds,EditorNotices:()=>Vs,EditorProvider:()=>gd,EditorSnackbars:()=>Hs,EntitiesSavedStates:()=>qs,ErrorBoundary:()=>ta,FontSizePicker:()=>Ud,InnerBlocks:()=>zd,Inserter:()=>Hd,InspectorAdvancedControls:()=>Gd,InspectorControls:()=>jd,LocalAutosaveMonitor:()=>sa,MediaPlaceholder:()=>qd,MediaUpload:()=>Qd,MediaUploadCheck:()=>Xd,MultiSelectScrollIntoView:()=>Jd,NavigableToolbar:()=>ep,ObserveTyping:()=>tp,PageAttributesCheck:()=>aa,PageAttributesOrder:()=>ca,PageAttributesPanel:()=>va,PageAttributesParent:()=>fa,PageTemplate:()=>Da,PanelColorSettings:()=>$d,PlainText:()=>Wd,PluginBlockSettingsMenuItem:()=>ja,PluginDocumentSettingPanel:()=>Ga,PluginMoreMenuItem:()=>$a,PluginPostPublishPanel:()=>Ya,PluginPostStatusInfo:()=>Ja,PluginPrePublishPanel:()=>oi,PluginSidebar:()=>ri,PluginSidebarMoreMenuItem:()=>si,PostAuthor:()=>Ei,PostAuthorCheck:()=>yi,PostAuthorPanel:()=>vi,PostComments:()=>wi,PostDiscussionPanel:()=>xi,PostExcerpt:()=>Ii,PostExcerptCheck:()=>Bi,PostExcerptPanel:()=>Oi,PostFeaturedImage:()=>Yi,PostFeaturedImageCheck:()=>zi,PostFeaturedImagePanel:()=>Qi,PostFormat:()=>el,PostFormatCheck:()=>Xi,PostLastRevision:()=>ol,PostLastRevisionCheck:()=>nl,PostLastRevisionPanel:()=>rl,PostLockedModal:()=>sl,PostPendingStatus:()=>il,PostPendingStatusCheck:()=>al,PostPingbacks:()=>Si,PostPreviewButton:()=>ll,PostPublishButton:()=>pl,PostPublishButtonLabel:()=>cl,PostPublishPanel:()=>_c,PostSavedState:()=>Ec,PostSchedule:()=>Dl,PostScheduleCheck:()=>yc,PostScheduleLabel:()=>Rl,PostSchedulePanel:()=>kc,PostSlug:()=>Pc,PostSlugCheck:()=>wc,PostSticky:()=>Tc,PostStickyCheck:()=>Cc,PostSwitchToDraftButton:()=>xc,PostSyncStatus:()=>Ic,PostTaxonomies:()=>Nc,PostTaxonomiesCheck:()=>Ac,PostTaxonomiesFlatTermSelector:()=>Wl,PostTaxonomiesHierarchicalTermSelector:()=>nc,PostTaxonomiesPanel:()=>Rc,PostTemplatePanel:()=>mi,PostTextEditor:()=>Lc,PostTitle:()=>zc,PostTitleRaw:()=>Gc,PostTrash:()=>jc,PostTrashCheck:()=>$c,PostTypeSupportCheck:()=>ia,PostURL:()=>Yc,PostURLCheck:()=>qc,PostURLLabel:()=>Kc,PostURLPanel:()=>Qc,PostVisibility:()=>_l,PostVisibilityCheck:()=>Jc,PostVisibilityLabel:()=>bl,RichText:()=>Ed,RichTextShortcut:()=>Kd,RichTextToolbarButton:()=>Zd,ServerSideRender:()=>hd(),SkipToSelectedBlock:()=>np,TableOfContents:()=>iu,TextEditorGlobalKeyboardShortcuts:()=>fp,ThemeSupportCheck:()=>Hi,TimeToRead:()=>ru,URLInput:()=>op,URLInputButton:()=>rp,URLPopover:()=>sp,UnsavedChangesWarning:()=>lu,VisualEditorGlobalKeyboardShortcuts:()=>bp,Warning:()=>ap,WordCount:()=>nu,WritingFlow:()=>ip,__unstableRichTextInputEvent:()=>Yd,cleanForSlug:()=>Ep,createCustomColorsHOC:()=>lp,getColorClassName:()=>cp,getColorObjectByAttributeValues:()=>up,getColorObjectByColorValue:()=>dp,getFontSize:()=>pp,getFontSizeClass:()=>mp,getTemplatePartIcon:()=>j,mediaUpload:()=>bu,privateApis:()=>Pg,store:()=>tr,storeConfig:()=>er,transformStyles:()=>_.transformStyles,useEntitiesSavedStatesIsDirty:()=>Zs,usePostScheduleLabel:()=>Ml,usePostURLLabel:()=>Zc,usePostVisibilityLabel:()=>fl,userAutocompleter:()=>ar,withColorContext:()=>gp,withColors:()=>_p,withFontSizes:()=>hp});var e={};n.r(e),n.d(e,{__experimentalGetDefaultTemplatePartAreas:()=>rn,__experimentalGetDefaultTemplateType:()=>sn,__experimentalGetDefaultTemplateTypes:()=>on,__experimentalGetTemplateInfo:()=>an,__unstableIsEditorReady:()=>qe,canInsertBlockType:()=>Jt,canUserUseUnfilteredHTML:()=>He,didPostSaveRequestFail:()=>Se,didPostSaveRequestSucceed:()=>we,getActivePostLock:()=>Ue,getAdjacentBlockClientId:()=>St,getAutosaveAttribute:()=>ce,getBlock:()=>ct,getBlockAttributes:()=>lt,getBlockCount:()=>_t,getBlockHierarchyRootClientId:()=>wt,getBlockIndex:()=>Ft,getBlockInsertionPoint:()=>Zt,getBlockListSettings:()=>nn,getBlockMode:()=>$t,getBlockName:()=>at,getBlockOrder:()=>Ot,getBlockRootClientId:()=>kt,getBlockSelectionEnd:()=>bt,getBlockSelectionStart:()=>ht,getBlocks:()=>ut,getBlocksByClientId:()=>gt,getClientIdsOfDescendants:()=>dt,getClientIdsWithDescendants:()=>pt,getCurrentPost:()=>J,getCurrentPostAttribute:()=>ae,getCurrentPostId:()=>te,getCurrentPostLastRevisionId:()=>re,getCurrentPostRevisionsCount:()=>oe,getCurrentPostType:()=>ee,getCurrentTemplateId:()=>ne,getDeviceType:()=>Je,getEditedPostAttribute:()=>le,getEditedPostContent:()=>Ie,getEditedPostPreviewLink:()=>Te,getEditedPostSlug:()=>De,getEditedPostVisibility:()=>ue,getEditorBlocks:()=>Ge,getEditorMode:()=>nt,getEditorSelection:()=>Ye,getEditorSelectionEnd:()=>Ze,getEditorSelectionStart:()=>Ke,getEditorSettings:()=>Qe,getFirstMultiSelectedBlockClientId:()=>Bt,getGlobalBlockCount:()=>mt,getInserterItems:()=>en,getLastMultiSelectedBlockClientId:()=>Nt,getMultiSelectedBlockClientIds:()=>xt,getMultiSelectedBlocks:()=>It,getMultiSelectedBlocksEndClientId:()=>Lt,getMultiSelectedBlocksStartClientId:()=>Mt,getNextBlockClientId:()=>Ct,getPermalink:()=>Ae,getPermalinkParts:()=>Re,getPostEdits:()=>se,getPostLockUser:()=>Ve,getPostTypeLabel:()=>ln,getPreviousBlockClientId:()=>Pt,getRenderingMode:()=>Xe,getSelectedBlock:()=>vt,getSelectedBlockClientId:()=>yt,getSelectedBlockCount:()=>ft,getSelectedBlocksInitialCaretPosition:()=>Tt,getStateBeforeOptimisticTransaction:()=>ot,getSuggestedPostFormat:()=>xe,getTemplate:()=>Qt,getTemplateLock:()=>Xt,hasChangedContent:()=>Y,hasEditorRedo:()=>K,hasEditorUndo:()=>W,hasInserterItems:()=>tn,hasMultiSelection:()=>zt,hasNonPostEntityChanges:()=>Q,hasSelectedBlock:()=>Et,hasSelectedInnerBlock:()=>Ut,inSomeHistory:()=>rt,isAncestorMultiSelected:()=>Rt,isAutosavingPost:()=>Pe,isBlockInsertionPointVisible:()=>Yt,isBlockMultiSelected:()=>Dt,isBlockSelected:()=>Vt,isBlockValid:()=>it,isBlockWithinSelection:()=>Ht,isCaretWithinFormattedText:()=>Kt,isCleanNewPost:()=>X,isCurrentPostPending:()=>de,isCurrentPostPublished:()=>pe,isCurrentPostScheduled:()=>me,isDeletingPost:()=>ye,isEditedPostAutosaveable:()=>be,isEditedPostBeingScheduled:()=>fe,isEditedPostDateFloating:()=>Ee,isEditedPostDirty:()=>q,isEditedPostEmpty:()=>he,isEditedPostNew:()=>Z,isEditedPostPublishable:()=>ge,isEditedPostSaveable:()=>_e,isEditorPanelEnabled:()=>$e,isEditorPanelOpened:()=>We,isEditorPanelRemoved:()=>je,isFirstMultiSelectedBlock:()=>At,isInserterOpened:()=>tt,isListViewOpened:()=>et,isMultiSelecting:()=>Gt,isPermalinkEditable:()=>Ne,isPostAutosavingLocked:()=>Oe,isPostLockTakeover:()=>Fe,isPostLocked:()=>Me,isPostSavingLocked:()=>Le,isPreviewingPost:()=>Ce,isPublishSidebarEnabled:()=>ze,isPublishSidebarOpened:()=>cn,isPublishingPost:()=>Be,isSavingNonPostEntityChanges:()=>ke,isSavingPost:()=>ve,isSelectionEnabled:()=>jt,isTyping:()=>Wt,isValidTemplate:()=>qt});var t={};n.r(t),n.d(t,{__experimentalTearDownEditor:()=>fn,__unstableSaveForPreview:()=>xn,autosave:()=>Tn,clearSelectedBlock:()=>lo,closePublishSidebar:()=>Qn,createUndoLevel:()=>Nn,disablePublishSidebar:()=>Rn,editPost:()=>wn,enablePublishSidebar:()=>Dn,enterFormattedText:()=>xo,exitFormattedText:()=>Io,hideInsertionPoint:()=>Eo,insertBlock:()=>ho,insertBlocks:()=>bo,insertDefaultBlock:()=>Bo,lockPostAutosaving:()=>On,lockPostSaving:()=>Mn,mergeBlocks:()=>ko,moveBlockToPosition:()=>_o,moveBlocksDown:()=>mo,moveBlocksUp:()=>go,multiSelect:()=>io,openPublishSidebar:()=>qn,receiveBlocks:()=>to,redo:()=>In,refreshPost:()=>Pn,removeBlock:()=>So,removeBlocks:()=>wo,removeEditorPanel:()=>$n,replaceBlock:()=>po,replaceBlocks:()=>uo,resetBlocks:()=>eo,resetEditorBlocks:()=>Vn,resetPost:()=>En,savePost:()=>Sn,selectBlock:()=>ro,setDeviceType:()=>zn,setEditedPost:()=>kn,setIsInserterOpened:()=>Wn,setIsListViewOpened:()=>Kn,setRenderingMode:()=>Hn,setTemplateValidity:()=>yo,setupEditor:()=>bn,setupEditorState:()=>vn,showInsertionPoint:()=>fo,startMultiSelect:()=>so,startTyping:()=>Co,stopMultiSelect:()=>ao,stopTyping:()=>To,switchEditorMode:()=>Yn,synchronizeTemplate:()=>vo,toggleBlockMode:()=>Po,toggleDistractionFree:()=>Zn,toggleEditorPanelEnabled:()=>Gn,toggleEditorPanelOpened:()=>jn,togglePublishSidebar:()=>Xn,toggleSelection:()=>co,trashPost:()=>Cn,undo:()=>Bn,unlockPostAutosaving:()=>Fn,unlockPostSaving:()=>Ln,updateBlock:()=>no,updateBlockAttributes:()=>oo,updateBlockListSettings:()=>No,updateEditorSettings:()=>Un,updatePost:()=>yn,updatePostLock:()=>An});var r={};n.r(r),n.d(r,{createTemplate:()=>Mo,hideBlockTypes:()=>Oo,removeTemplates:()=>Uo,revertTemplate:()=>Vo,saveDirtyEntities:()=>Fo,setCurrentTemplateId:()=>Ro,showBlockTypes:()=>Lo});var s={};n.r(s),n.d(s,{getCurrentTemplateTemplateParts:()=>Jo,getInserterSidebarToggleRef:()=>qo,getInsertionPoint:()=>Zo,getListViewToggleRef:()=>Yo,getPostIcon:()=>Xo});var a={};n.r(a),n.d(a,{closeModal:()=>Mr,disableComplementaryArea:()=>xr,enableComplementaryArea:()=>Tr,openModal:()=>Rr,pinItem:()=>Ir,setDefaultComplementaryArea:()=>Cr,setFeatureDefaults:()=>Dr,setFeatureValue:()=>Ar,toggleFeature:()=>Nr,unpinItem:()=>Br});var i={};n.r(i),n.d(i,{getActiveComplementaryArea:()=>Lr,isComplementaryAreaLoading:()=>Or,isFeatureActive:()=>Vr,isItemPinned:()=>Fr,isModalActive:()=>Ur});var l={};n.r(l),n.d(l,{ActionItem:()=>Yr,ComplementaryArea:()=>ss,ComplementaryAreaMoreMenuItem:()=>Qr,FullscreenMode:()=>as,InterfaceSkeleton:()=>cs,NavigableRegion:()=>is,PinnedItems:()=>Jr,store:()=>zr});const c=window.wp.blocks,u=window.wp.data,d=window.wp.privateApis,{lock:p,unlock:m}=(0,d.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/editor"),g=window.wp.i18n,_=window.wp.blockEditor,h=((0,g._x)("Pattern Overrides","block bindings source"),window.wp.coreData),b={..._.SETTINGS_DEFAULTS,richEditingEnabled:!0,codeEditingEnabled:!0,fontLibraryEnabled:!0,enableCustomFields:void 0,defaultRenderingMode:"post-only"};function f(e){return e&&"object"==typeof e&&"raw"in e?e.raw:e}const E=(0,u.combineReducers)({postId:function(e=null,t){return"SET_EDITED_POST"===t.type?t.postId:e},postType:function(e=null,t){return"SET_EDITED_POST"===t.type?t.postType:e},templateId:function(e=null,t){return"SET_CURRENT_TEMPLATE_ID"===t.type?t.id:e},saving:function(e={},t){switch(t.type){case"REQUEST_POST_UPDATE_START":case"REQUEST_POST_UPDATE_FINISH":return{pending:"REQUEST_POST_UPDATE_START"===t.type,options:t.options||{}}}return e},deleting:function(e={},t){switch(t.type){case"REQUEST_POST_DELETE_START":case"REQUEST_POST_DELETE_FINISH":return{pending:"REQUEST_POST_DELETE_START"===t.type}}return e},postLock:function(e={isLocked:!1},t){return"UPDATE_POST_LOCK"===t.type?t.lock:e},template:function(e={isValid:!0},t){return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},postSavingLock:function(e={},t){switch(t.type){case"LOCK_POST_SAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_SAVING":{const{[t.lockName]:n,...o}=e;return o}}return e},editorSettings:function(e=b,t){return"UPDATE_EDITOR_SETTINGS"===t.type?{...e,...t.settings}:e},postAutosavingLock:function(e={},t){switch(t.type){case"LOCK_POST_AUTOSAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_AUTOSAVING":{const{[t.lockName]:n,...o}=e;return o}}return e},renderingMode:function(e="post-only",t){return"SET_RENDERING_MODE"===t.type?t.mode:e},deviceType:function(e="Desktop",t){return"SET_DEVICE_TYPE"===t.type?t.deviceType:e},removedPanels:function(e=[],t){if("REMOVE_PANEL"===t.type)if(!e.includes(t.panelName))return[...e,t.panelName];return e},blockInserterPanel:function(e=!1,t){switch(t.type){case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value}return e},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}}),y=window.wp.date,v=window.wp.url,k=window.wp.deprecated;var w=n.n(k);const S=window.wp.element;var P=n(1609);const C=window.wp.primitives,T=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.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"})),x=window.wp.preferences,I=new Set(["meta"]),B="SAVE_POST_NOTICE_ID",N="TRASH_POST_NOTICE_ID",A=/%(?:postname|pagename)%/,D=6e4,R=["title","excerpt","content"],M="wp_template",L="wp_template_part",O="wp_block",F="wp_navigation",V={custom:"custom",theme:"theme",plugin:"plugin"},U=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.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"})),H=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.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"})),z=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.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"})),G=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.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 j(e){return"header"===e?U:"footer"===e?H:"sidebar"===e?z:G}const $={},W=(0,u.createRegistrySelector)((e=>()=>e(h.store).hasUndo())),K=(0,u.createRegistrySelector)((e=>()=>e(h.store).hasRedo()));function Z(e){return"auto-draft"===J(e).status}function Y(e){return"content"in se(e)}const q=(0,u.createRegistrySelector)((e=>t=>{const n=ee(t),o=te(t);return e(h.store).hasEditsForEntityRecord("postType",n,o)})),Q=(0,u.createRegistrySelector)((e=>t=>{const n=e(h.store).__experimentalGetDirtyEntityRecords(),{type:o,id:r}=J(t);return n.some((e=>"postType"!==e.kind||e.name!==o||e.key!==r))}));function X(e){return!q(e)&&Z(e)}const J=(0,u.createRegistrySelector)((e=>t=>{const n=te(t),o=ee(t),r=e(h.store).getRawEntityRecord("postType",o,n);return r||$}));function ee(e){return e.postType}function te(e){return e.postId}function ne(e){return e.templateId}function oe(e){var t;return null!==(t=J(e)._links?.["version-history"]?.[0]?.count)&&void 0!==t?t:0}function re(e){var t;return null!==(t=J(e)._links?.["predecessor-version"]?.[0]?.id)&&void 0!==t?t:null}const se=(0,u.createRegistrySelector)((e=>t=>{const n=ee(t),o=te(t);return e(h.store).getEntityRecordEdits("postType",n,o)||$}));function ae(e,t){switch(t){case"type":return ee(e);case"id":return te(e);default:const n=J(e);if(!n.hasOwnProperty(t))break;return f(n[t])}}const ie=(0,u.createSelector)(((e,t)=>{const n=se(e);return n.hasOwnProperty(t)?{...ae(e,t),...n[t]}:ae(e,t)}),((e,t)=>[ae(e,t),se(e)[t]]));function le(e,t){if("content"===t)return Ie(e);const n=se(e);return n.hasOwnProperty(t)?I.has(t)?ie(e,t):n[t]:ae(e,t)}const ce=(0,u.createRegistrySelector)((e=>(t,n)=>{if(!R.includes(n)&&"preview_link"!==n)return;const o=ee(t);if("wp_template"===o)return!1;const r=te(t),s=e(h.store).getCurrentUser()?.id,a=e(h.store).getAutosave(o,r,s);return a?f(a[n]):void 0}));function ue(e){if("private"===le(e,"status"))return"private";return le(e,"password")?"password":"public"}function de(e){return"pending"===J(e).status}function pe(e,t){const n=t||J(e);return-1!==["publish","private"].indexOf(n.status)||"future"===n.status&&!(0,y.isInTheFuture)(new Date(Number((0,y.getDate)(n.date))-D))}function me(e){return"future"===J(e).status&&!pe(e)}function ge(e){const t=J(e);return q(e)||-1===["publish","private","future"].indexOf(t.status)}function _e(e){return!ve(e)&&(!!le(e,"title")||!!le(e,"excerpt")||!he(e)||"native"===S.Platform.OS)}const he=(0,u.createRegistrySelector)((e=>t=>{const n=te(t),o=ee(t),r=e(h.store).getEditedEntityRecord("postType",o,n);if("function"!=typeof r.content)return!r.content;const s=le(t,"blocks");if(0===s.length)return!0;if(s.length>1)return!1;const a=s[0].name;return(a===(0,c.getDefaultBlockName)()||a===(0,c.getFreeformContentHandlerName)())&&!Ie(t)})),be=(0,u.createRegistrySelector)((e=>t=>{if(!_e(t))return!1;if(Oe(t))return!1;const n=ee(t);if("wp_template"===n)return!1;const o=te(t),r=e(h.store).hasFetchedAutosaves(n,o),s=e(h.store).getCurrentUser()?.id,a=e(h.store).getAutosave(n,o,s);return!!r&&(!a||(!!Y(t)||["title","excerpt","meta"].some((e=>f(a[e])!==le(t,e)))))}));function fe(e){const t=le(e,"date"),n=new Date(Number((0,y.getDate)(t))-D);return(0,y.isInTheFuture)(n)}function Ee(e){const t=le(e,"date"),n=le(e,"modified"),o=J(e).status;return("draft"===o||"auto-draft"===o||"pending"===o)&&(t===n||null===t)}function ye(e){return!!e.deleting.pending}function ve(e){return!!e.saving.pending}const ke=(0,u.createRegistrySelector)((e=>t=>{const n=e(h.store).__experimentalGetEntitiesBeingSaved(),{type:o,id:r}=J(t);return n.some((e=>"postType"!==e.kind||e.name!==o||e.key!==r))})),we=(0,u.createRegistrySelector)((e=>t=>{const n=ee(t),o=te(t);return!e(h.store).getLastEntitySaveError("postType",n,o)})),Se=(0,u.createRegistrySelector)((e=>t=>{const n=ee(t),o=te(t);return!!e(h.store).getLastEntitySaveError("postType",n,o)}));function Pe(e){return ve(e)&&Boolean(e.saving.options?.isAutosave)}function Ce(e){return ve(e)&&Boolean(e.saving.options?.isPreview)}function Te(e){if(e.saving.pending||ve(e))return;let t=ce(e,"preview_link");t&&"draft"!==J(e).status||(t=le(e,"link"),t&&(t=(0,v.addQueryArgs)(t,{preview:!0})));const n=le(e,"featured_media");return t&&n?(0,v.addQueryArgs)(t,{_thumbnail_id:n}):t}const xe=(0,u.createRegistrySelector)((e=>()=>{const t=e(_.store).getBlocks();if(t.length>2)return null;let n;if(1===t.length&&(n=t[0].name,"core/embed"===n)){const e=t[0].attributes?.providerNameSlug;["youtube","vimeo"].includes(e)?n="core/video":["spotify","soundcloud"].includes(e)&&(n="core/audio")}switch(2===t.length&&"core/paragraph"===t[1].name&&(n=t[0].name),n){case"core/image":return"image";case"core/quote":case"core/pullquote":return"quote";case"core/gallery":return"gallery";case"core/video":return"video";case"core/audio":return"audio";default:return null}})),Ie=(0,u.createRegistrySelector)((e=>t=>{const n=te(t),o=ee(t),r=e(h.store).getEditedEntityRecord("postType",o,n);if(r){if("function"==typeof r.content)return r.content(r);if(r.blocks)return(0,c.__unstableSerializeAndClean)(r.blocks);if(r.content)return r.content}return""}));function Be(e){return ve(e)&&!pe(e)&&"publish"===le(e,"status")}function Ne(e){const t=le(e,"permalink_template");return A.test(t)}function Ae(e){const t=Re(e);if(!t)return null;const{prefix:n,postName:o,suffix:r}=t;return Ne(e)?n+o+r:n}function De(e){return le(e,"slug")||(0,v.cleanForSlug)(le(e,"title"))||te(e)}function Re(e){const t=le(e,"permalink_template");if(!t)return null;const n=le(e,"slug")||le(e,"generated_slug"),[o,r]=t.split(A);return{prefix:o,postName:n,suffix:r}}function Me(e){return e.postLock.isLocked}function Le(e){return Object.keys(e.postSavingLock).length>0}function Oe(e){return Object.keys(e.postAutosavingLock).length>0}function Fe(e){return e.postLock.isTakeover}function Ve(e){return e.postLock.user}function Ue(e){return e.postLock.activePostLock}function He(e){return Boolean(J(e)._links?.hasOwnProperty("wp:action-unfiltered-html"))}const ze=(0,u.createRegistrySelector)((e=>()=>!!e(x.store).get("core","isPublishSidebarEnabled"))),Ge=(0,u.createSelector)((e=>le(e,"blocks")||(0,c.parse)(Ie(e))),(e=>[le(e,"blocks"),Ie(e)]));function je(e,t){return e.removedPanels.includes(t)}const $e=(0,u.createRegistrySelector)((e=>(t,n)=>{const o=e(x.store).get("core","inactivePanels");return!je(t,n)&&!o?.includes(n)})),We=(0,u.createRegistrySelector)((e=>(t,n)=>{const o=e(x.store).get("core","openPanels");return!!o?.includes(n)}));function Ke(e){return w()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),le(e,"selection")?.selectionStart}function Ze(e){return w()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),le(e,"selection")?.selectionEnd}function Ye(e){return le(e,"selection")}function qe(e){return!!e.postId}function Qe(e){return e.editorSettings}function Xe(e){return e.renderingMode}function Je(e){return e.deviceType}function et(e){return e.listViewPanel}function tt(e){return!!e.blockInserterPanel}const nt=(0,u.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(x.store).get("core","editorMode"))&&void 0!==t?t:"visual"}));function ot(){return w()("select('core/editor').getStateBeforeOptimisticTransaction",{since:"5.7",hint:"No state history is kept on this store anymore"}),null}function rt(){return w()("select('core/editor').inSomeHistory",{since:"5.7",hint:"No state history is kept on this store anymore"}),!1}function st(e){return(0,u.createRegistrySelector)((t=>(n,...o)=>(w()("`wp.data.select( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.select( 'core/block-editor' )."+e+"`",version:"6.2"}),t(_.store)[e](...o))))}const at=st("getBlockName"),it=st("isBlockValid"),lt=st("getBlockAttributes"),ct=st("getBlock"),ut=st("getBlocks"),dt=st("getClientIdsOfDescendants"),pt=st("getClientIdsWithDescendants"),mt=st("getGlobalBlockCount"),gt=st("getBlocksByClientId"),_t=st("getBlockCount"),ht=st("getBlockSelectionStart"),bt=st("getBlockSelectionEnd"),ft=st("getSelectedBlockCount"),Et=st("hasSelectedBlock"),yt=st("getSelectedBlockClientId"),vt=st("getSelectedBlock"),kt=st("getBlockRootClientId"),wt=st("getBlockHierarchyRootClientId"),St=st("getAdjacentBlockClientId"),Pt=st("getPreviousBlockClientId"),Ct=st("getNextBlockClientId"),Tt=st("getSelectedBlocksInitialCaretPosition"),xt=st("getMultiSelectedBlockClientIds"),It=st("getMultiSelectedBlocks"),Bt=st("getFirstMultiSelectedBlockClientId"),Nt=st("getLastMultiSelectedBlockClientId"),At=st("isFirstMultiSelectedBlock"),Dt=st("isBlockMultiSelected"),Rt=st("isAncestorMultiSelected"),Mt=st("getMultiSelectedBlocksStartClientId"),Lt=st("getMultiSelectedBlocksEndClientId"),Ot=st("getBlockOrder"),Ft=st("getBlockIndex"),Vt=st("isBlockSelected"),Ut=st("hasSelectedInnerBlock"),Ht=st("isBlockWithinSelection"),zt=st("hasMultiSelection"),Gt=st("isMultiSelecting"),jt=st("isSelectionEnabled"),$t=st("getBlockMode"),Wt=st("isTyping"),Kt=st("isCaretWithinFormattedText"),Zt=st("getBlockInsertionPoint"),Yt=st("isBlockInsertionPointVisible"),qt=st("isValidTemplate"),Qt=st("getTemplate"),Xt=st("getTemplateLock"),Jt=st("canInsertBlockType"),en=st("getInserterItems"),tn=st("hasInserterItems"),nn=st("getBlockListSettings");function on(e){return Qe(e)?.defaultTemplateTypes}const rn=(0,u.createSelector)((e=>{var t;return(null!==(t=Qe(e)?.defaultTemplatePartAreas)&&void 0!==t?t:[]).map((e=>({...e,icon:j(e.icon)})))}),(e=>[Qe(e)?.defaultTemplatePartAreas])),sn=(0,u.createSelector)(((e,t)=>{var n;const o=on(e);return o&&null!==(n=Object.values(o).find((e=>e.slug===t)))&&void 0!==n?n:$}),(e=>[on(e)])),an=(0,u.createSelector)(((e,t)=>{if(!t)return $;const{description:n,slug:o,title:r,area:s}=t,{title:a,description:i}=sn(e,o),l="string"==typeof r?r:r?.rendered;return{title:l&&l!==o?l:a||o,description:("string"==typeof n?n:n?.raw)||i,icon:rn(e).find((e=>s===e.area))?.icon||T}}),(e=>[on(e),rn(e)])),ln=(0,u.createRegistrySelector)((e=>t=>{const n=ee(t),o=e(h.store).getPostType(n);return o?.labels?.singular_name}));function cn(e){return e.publishSidebarActive}const un=window.wp.a11y,dn=window.wp.apiFetch;var pn=n.n(dn);const mn=window.wp.notices,gn=window.wp.hooks;function _n(e,t){return`wp-autosave-block-editor-post-${t?"auto-draft":e}`}function hn(e,t){window.sessionStorage.removeItem(_n(e,t))}const bn=(e,t,n)=>({dispatch:o})=>{o.setEditedPost(e.type,e.id);if("auto-draft"===e.status&&n){let r;r="content"in t?t.content:e.content.raw;let s=(0,c.parse)(r);s=(0,c.synchronizeBlocksWithTemplate)(s,n),o.resetEditorBlocks(s,{__unstableShouldCreateUndoLevel:!1})}t&&Object.values(t).some((([t,n])=>{var o;return n!==(null!==(o=e[t]?.raw)&&void 0!==o?o:e[t])}))&&o.editPost(t)};function fn(){return w()("wp.data.dispatch( 'core/editor' ).__experimentalTearDownEditor",{since:"6.5"}),{type:"DO_NOTHING"}}function En(){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 yn(){return w()("wp.data.dispatch( 'core/editor' ).updatePost",{since:"5.7",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function vn(e){return w()("wp.data.dispatch( 'core/editor' ).setupEditorState",{since:"6.5",alternative:"wp.data.dispatch( 'core/editor' ).setEditedPost"}),kn(e.type,e.id)}function kn(e,t){return{type:"SET_EDITED_POST",postType:e,postId:t}}const wn=(e,t)=>({select:n,registry:o})=>{const{id:r,type:s}=n.getCurrentPost();o.dispatch(h.store).editEntityRecord("postType",s,r,e,t)},Sn=(e={})=>async({select:t,dispatch:n,registry:o})=>{if(!t.isEditedPostSaveable())return;const r=t.getEditedPostContent();e.isAutosave||n.editPost({content:r},{undoIgnore:!0});const s=t.getCurrentPost(),a={id:s.id,...o.select(h.store).getEntityRecordNonTransientEdits("postType",s.type,s.id),content:r};n({type:"REQUEST_POST_UPDATE_START",options:e}),await o.dispatch(h.store).saveEntityRecord("postType",s.type,a,e);let i=o.select(h.store).getLastEntitySaveError("postType",s.type,s.id);if(i||await(0,gn.applyFilters)("editor.__unstableSavePost",Promise.resolve(),e).catch((e=>{i=e})),n({type:"REQUEST_POST_UPDATE_FINISH",options:e}),i){const e=function(e){const{post:t,edits:n,error:o}=e;if(o&&"rest_autosave_no_changes"===o.code)return[];const r=["publish","private","future"],s=-1!==r.indexOf(t.status),a={publish:(0,g.__)("Publishing failed."),private:(0,g.__)("Publishing failed."),future:(0,g.__)("Scheduling failed.")};let i=s||-1===r.indexOf(n.status)?(0,g.__)("Updating failed."):a[n.status];return o.message&&!/<\/?[^>]*>/.test(o.message)&&(i=[i,o.message].join(" ")),[i,{id:B}]}({post:s,edits:a,error:i});e.length&&o.dispatch(mn.store).createErrorNotice(...e)}else{const n=t.getCurrentPost(),r=function(e){var t;const{previousPost:n,post:o,postType:r}=e;if(e.options?.isAutosave)return[];const s=["publish","private","future"],a=s.includes(n.status),i=s.includes(o.status),l="trash"===o.status&&"trash"!==n.status;let c,u,d=null!==(t=r?.viewable)&&void 0!==t&&t;l?(c=r.labels.item_trashed,d=!1):a||i?a&&!i?(c=r.labels.item_reverted_to_draft,d=!1):c=!a&&i?{publish:r.labels.item_published,private:r.labels.item_published_privately,future:r.labels.item_scheduled}[o.status]:r.labels.item_updated:(c=(0,g.__)("Draft saved."),u=!0);const p=[];return d&&p.push({label:u?(0,g.__)("View Preview"):r.labels.view_item,url:o.link}),[c,{id:B,type:"snackbar",actions:p}]}({previousPost:s,post:n,postType:await o.resolveSelect(h.store).getPostType(n.type),options:e});r.length&&o.dispatch(mn.store).createSuccessNotice(...r),e.isAutosave||o.dispatch(_.store).__unstableMarkLastChangeAsPersistent()}};function Pn(){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 Cn=()=>async({select:e,dispatch:t,registry:n})=>{const o=e.getCurrentPostType(),r=await n.resolveSelect(h.store).getPostType(o);n.dispatch(mn.store).removeNotice(N);const{rest_base:s,rest_namespace:a="wp/v2"}=r;t({type:"REQUEST_POST_DELETE_START"});try{const n=e.getCurrentPost();await pn()({path:`/${a}/${s}/${n.id}`,method:"DELETE"}),await t.savePost()}catch(e){n.dispatch(mn.store).createErrorNotice(...(i={error:e},[i.error.message&&"unknown_error"!==i.error.code?i.error.message:(0,g.__)("Trashing failed"),{id:N}]))}var i;t({type:"REQUEST_POST_DELETE_FINISH"})},Tn=({local:e=!1,...t}={})=>async({select:n,dispatch:o})=>{const r=n.getCurrentPost();if("wp_template"!==r.type)if(e){const e=n.isEditedPostNew(),t=n.getEditedPostAttribute("title"),o=n.getEditedPostAttribute("content"),s=n.getEditedPostAttribute("excerpt");!function(e,t,n,o,r){window.sessionStorage.setItem(_n(e,t),JSON.stringify({post_title:n,content:o,excerpt:r}))}(r.id,e,t,o,s)}else await o.savePost({isAutosave:!0,...t})},xn=({forceIsAutosaveable:e}={})=>async({select:t,dispatch:n})=>{if((e||t.isEditedPostAutosaveable())&&!t.isPostLocked()){["draft","auto-draft"].includes(t.getEditedPostAttribute("status"))?await n.savePost({isPreview:!0}):await n.autosave({isPreview:!0})}return t.getEditedPostPreviewLink()},In=()=>({registry:e})=>{e.dispatch(h.store).redo()},Bn=()=>({registry:e})=>{e.dispatch(h.store).undo()};function Nn(){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 An(e){return{type:"UPDATE_POST_LOCK",lock:e}}const Dn=()=>({registry:e})=>{e.dispatch(x.store).set("core","isPublishSidebarEnabled",!0)},Rn=()=>({registry:e})=>{e.dispatch(x.store).set("core","isPublishSidebarEnabled",!1)};function Mn(e){return{type:"LOCK_POST_SAVING",lockName:e}}function Ln(e){return{type:"UNLOCK_POST_SAVING",lockName:e}}function On(e){return{type:"LOCK_POST_AUTOSAVING",lockName:e}}function Fn(e){return{type:"UNLOCK_POST_AUTOSAVING",lockName:e}}const Vn=(e,t={})=>({select:n,dispatch:o,registry:r})=>{const{__unstableShouldCreateUndoLevel:s,selection:a}=t,i={blocks:e,selection:a};if(!1!==s){const{id:e,type:t}=n.getCurrentPost();if(r.select(h.store).getEditedEntityRecord("postType",t,e).blocks===i.blocks)return void r.dispatch(h.store).__unstableCreateUndoLevel("postType",t,e);i.content=({blocks:e=[]})=>(0,c.__unstableSerializeAndClean)(e)}o.editPost(i)};function Un(e){return{type:"UPDATE_EDITOR_SETTINGS",settings:e}}const Hn=e=>({dispatch:t,registry:n,select:o})=>{o.__unstableIsEditorReady()&&(n.dispatch(_.store).clearSelectedBlock(),t.editPost({selection:void 0},{undoIgnore:!0})),t({type:"SET_RENDERING_MODE",mode:e})};function zn(e){return{type:"SET_DEVICE_TYPE",deviceType:e}}const Gn=e=>({registry:t})=>{var n;const o=null!==(n=t.select(x.store).get("core","inactivePanels"))&&void 0!==n?n:[];let r;r=!!o?.includes(e)?o.filter((t=>t!==e)):[...o,e],t.dispatch(x.store).set("core","inactivePanels",r)},jn=e=>({registry:t})=>{var n;const o=null!==(n=t.select(x.store).get("core","openPanels"))&&void 0!==n?n:[];let r;r=!!o?.includes(e)?o.filter((t=>t!==e)):[...o,e],t.dispatch(x.store).set("core","openPanels",r)};function $n(e){return{type:"REMOVE_PANEL",panelName:e}}function Wn(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function Kn(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}const Zn=()=>({dispatch:e,registry:t})=>{const n=t.select(x.store).get("core","distractionFree");n&&t.dispatch(x.store).set("core","fixedToolbar",!1),n||t.batch((()=>{t.dispatch(x.store).set("core","fixedToolbar",!0),e.setIsInserterOpened(!1),e.setIsListViewOpened(!1)})),t.batch((()=>{t.dispatch(x.store).set("core","distractionFree",!n),t.dispatch(mn.store).createInfoNotice(n?(0,g.__)("Distraction free off."):(0,g.__)("Distraction free on."),{id:"core/editor/distraction-free-mode/notice",type:"snackbar",actions:[{label:(0,g.__)("Undo"),onClick:()=>{t.batch((()=>{t.dispatch(x.store).set("core","fixedToolbar",!!n),t.dispatch(x.store).toggle("core","distractionFree")}))}}]})}))},Yn=e=>({dispatch:t,registry:n})=>{if(n.dispatch(x.store).set("core","editorMode",e),"visual"!==e&&n.dispatch(_.store).clearSelectedBlock(),"visual"===e)(0,un.speak)((0,g.__)("Visual editor selected"),"assertive");else if("text"===e){n.select(x.store).get("core","distractionFree")&&t.toggleDistractionFree(),(0,un.speak)((0,g.__)("Code editor selected"),"assertive")}};function qn(){return{type:"OPEN_PUBLISH_SIDEBAR"}}function Qn(){return{type:"CLOSE_PUBLISH_SIDEBAR"}}function Xn(){return{type:"TOGGLE_PUBLISH_SIDEBAR"}}const Jn=e=>(...t)=>({registry:n})=>{w()("`wp.data.dispatch( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.dispatch( 'core/block-editor' )."+e+"`",version:"6.2"}),n.dispatch(_.store)[e](...t)},eo=Jn("resetBlocks"),to=Jn("receiveBlocks"),no=Jn("updateBlock"),oo=Jn("updateBlockAttributes"),ro=Jn("selectBlock"),so=Jn("startMultiSelect"),ao=Jn("stopMultiSelect"),io=Jn("multiSelect"),lo=Jn("clearSelectedBlock"),co=Jn("toggleSelection"),uo=Jn("replaceBlocks"),po=Jn("replaceBlock"),mo=Jn("moveBlocksDown"),go=Jn("moveBlocksUp"),_o=Jn("moveBlockToPosition"),ho=Jn("insertBlock"),bo=Jn("insertBlocks"),fo=Jn("showInsertionPoint"),Eo=Jn("hideInsertionPoint"),yo=Jn("setTemplateValidity"),vo=Jn("synchronizeTemplate"),ko=Jn("mergeBlocks"),wo=Jn("removeBlocks"),So=Jn("removeBlock"),Po=Jn("toggleBlockMode"),Co=Jn("startTyping"),To=Jn("stopTyping"),xo=Jn("enterFormattedText"),Io=Jn("exitFormattedText"),Bo=Jn("insertDefaultBlock"),No=Jn("updateBlockListSettings"),Ao=window.wp.htmlEntities;function Do(e){return!!e&&(e?.source===V.custom&&e?.has_theme_file)}function Ro(e){return{type:"SET_CURRENT_TEMPLATE_ID",id:e}}const Mo=e=>async({select:t,dispatch:n,registry:o})=>{const r=await o.dispatch(h.store).saveEntityRecord("postType","wp_template",e);return o.dispatch(h.store).editEntityRecord("postType",t.getCurrentPostType(),t.getCurrentPostId(),{template:r.slug}),o.dispatch(mn.store).createSuccessNotice((0,g.__)("Custom template created. You're in template mode now."),{type:"snackbar",actions:[{label:(0,g.__)("Go back"),onClick:()=>n.setRenderingMode(t.getEditorSettings().defaultRenderingMode)}]}),r},Lo=e=>({registry:t})=>{var n;const o=(null!==(n=t.select(x.store).get("core","hiddenBlockTypes"))&&void 0!==n?n:[]).filter((t=>!(Array.isArray(e)?e:[e]).includes(t)));t.dispatch(x.store).set("core","hiddenBlockTypes",o)},Oo=e=>({registry:t})=>{var n;const o=null!==(n=t.select(x.store).get("core","hiddenBlockTypes"))&&void 0!==n?n:[],r=new Set([...o,...Array.isArray(e)?e:[e]]);t.dispatch(x.store).set("core","hiddenBlockTypes",[...r])},Fo=({onSave:e,dirtyEntityRecords:t=[],entitiesToSkip:n=[],close:o}={})=>({registry:r})=>{const s=[{kind:"postType",name:"wp_navigation"}],a="site-editor-save-success",i=r.select(h.store).getUnstableBase()?.home;r.dispatch(mn.store).removeNotice(a);const l=t.filter((({kind:e,name:t,key:o,property:r})=>!n.some((n=>n.kind===e&&n.name===t&&n.key===o&&n.property===r))));o?.(l);const c=[],u=[];l.forEach((({kind:e,name:t,key:n,property:o})=>{"root"===e&&"site"===t?c.push(o):(s.some((n=>n.kind===e&&n.name===t))&&r.dispatch(h.store).editEntityRecord(e,t,n,{status:"publish"}),u.push(r.dispatch(h.store).saveEditedEntityRecord(e,t,n)))})),c.length&&u.push(r.dispatch(h.store).__experimentalSaveSpecifiedEntityEdits("root","site",void 0,c)),r.dispatch(_.store).__unstableMarkLastChangeAsPersistent(),Promise.all(u).then((t=>e?e(t):t)).then((e=>{e.some((e=>void 0===e))?r.dispatch(mn.store).createErrorNotice((0,g.__)("Saving failed.")):r.dispatch(mn.store).createSuccessNotice((0,g.__)("Site updated."),{type:"snackbar",id:a,actions:[{label:(0,g.__)("View site"),url:i}]})})).catch((e=>r.dispatch(mn.store).createErrorNotice(`${(0,g.__)("Saving failed.")} ${e}`)))},Vo=(e,{allowUndo:t=!0}={})=>async({registry:n})=>{const o="edit-site-template-reverted";if(n.dispatch(mn.store).removeNotice(o),Do(e))try{const r=n.select(h.store).getEntityConfig("postType",e.type);if(!r)return void n.dispatch(mn.store).createErrorNotice((0,g.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const s=(0,v.addQueryArgs)(`${r.baseURL}/${e.id}`,{context:"edit",source:"theme"}),a=await pn()({path:s});if(!a)return void n.dispatch(mn.store).createErrorNotice((0,g.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const i=({blocks:e=[]})=>(0,c.__unstableSerializeAndClean)(e),l=n.select(h.store).getEditedEntityRecord("postType",e.type,e.id);n.dispatch(h.store).editEntityRecord("postType",e.type,e.id,{content:i,blocks:l.blocks,source:"custom"},{undoIgnore:!0});const u=(0,c.parse)(a?.content?.raw);if(n.dispatch(h.store).editEntityRecord("postType",e.type,a.id,{content:i,blocks:u,source:"theme"}),t){const t=()=>{n.dispatch(h.store).editEntityRecord("postType",e.type,l.id,{content:i,blocks:l.blocks,source:"custom"})};n.dispatch(mn.store).createSuccessNotice((0,g.__)("Template reset."),{type:"snackbar",id:o,actions:[{label:(0,g.__)("Undo"),onClick:t}]})}}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,g.__)("Template revert failed. Please reload.");n.dispatch(mn.store).createErrorNotice(t,{type:"snackbar"})}else n.dispatch(mn.store).createErrorNotice((0,g.__)("This template is not revertable."),{type:"snackbar"})},Uo=e=>async({registry:t})=>{const n=e[0].type===M,o=await Promise.allSettled(e.map((e=>t.dispatch(h.store).deleteEntityRecord("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(o.every((({status:e})=>"fulfilled"===e))){let o;if(1===e.length){const t="string"==typeof e[0].title?e[0].title:e[0].title?.rendered;o=(0,g.sprintf)((0,g.__)('"%s" deleted.'),(0,Ao.decodeEntities)(t))}else o=n?(0,g.__)("Templates deleted."):(0,g.__)("Template parts deleted.");t.dispatch(mn.store).createSuccessNotice(o,{type:"snackbar",id:"site-editor-template-deleted-success"})}else{let e;if(1===o.length)e=o[0].reason?.message?o[0].reason.message:n?(0,g.__)("An error occurred while deleting the template."):(0,g.__)("An error occurred while deleting the template part.");else{const t=new Set,r=o.filter((({status:e})=>"rejected"===e));for(const e of r)e.reason?.message&&t.add(e.reason.message);e=0===t.size?n?(0,g.__)("An error occurred while deleting the templates."):(0,g.__)("An error occurred while deleting the template parts."):1===t.size?n?(0,g.sprintf)((0,g.__)("An error occurred while deleting the templates: %s"),[...t][0]):(0,g.sprintf)((0,g.__)("An error occurred while deleting the template parts: %s"),[...t][0]):n?(0,g.sprintf)((0,g.__)("Some errors occurred while deleting the templates: %s"),[...t].join(",")):(0,g.sprintf)((0,g.__)("Some errors occurred while deleting the template parts: %s"),[...t].join(","))}t.dispatch(mn.store).createErrorNotice(e,{type:"snackbar"})}},Ho=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})),zo=(0,P.createElement)(C.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,P.createElement)(C.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"})),Go=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,P.createElement)(C.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"})),jo=(0,P.createElement)(C.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,P.createElement)(C.Path,{d:"M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"}));const $o=[];const Wo=function(e,t){var n,o,r=0;function s(){var s,a,i=n,l=arguments.length;e:for(;i;){if(i.args.length===arguments.length){for(a=0;a({...e,[t.id]:t})),{}):{},o=[],r=[...e];for(;r.length;){const{innerBlocks:e,...t}=r.shift();if(r.unshift(...e),(0,c.isTemplatePart)(t)){const{attributes:{theme:e,slug:r}}=t,s=n[`${e}//${r}`];s&&o.push({templatePart:s,block:t})}}return o})),Ko={rootClientId:void 0,insertionIndex:void 0,filterValue:void 0},Zo=(0,u.createRegistrySelector)((e=>(0,u.createSelector)((t=>{if("object"==typeof t.blockInserterPanel)return t.blockInserterPanel;if("template-locked"===Xe(t)){const[t]=e(_.store).getBlocksByName("core/post-content");if(t)return{rootClientId:t,insertionIndex:void 0,filterValue:void 0}}return Ko}),(t=>{const[n]=e(_.store).getBlocksByName("core/post-content");return[t.blockInserterPanel,Xe(t),n]}))));function Yo(e){return e.listViewToggleRef}function qo(e){return e.inserterSidebarToggleRef}const Qo={wp_block:Ho,wp_navigation:zo,page:Go,post:jo},Xo=(0,u.createRegistrySelector)((e=>(t,n,o)=>{{if("wp_template_part"===n||"wp_template"===n)return rn(t).find((e=>o.area===e.area))?.icon||T;if(Qo[n])return Qo[n];const r=e(h.store).getPostType(n);return r?.icon?.startsWith("dashicons-")?r.icon.slice(10):Go}})),Jo=(0,u.createRegistrySelector)((e=>()=>{const t=e(h.store).getEntityRecords("postType",L,{per_page:-1}),n=e(_.store).getBlocksByName("core/template-part"),o=e(_.store).getBlocksByClientId(n);return Wo(o,t)})),er={reducer:E,selectors:e,actions:t},tr=(0,u.createReduxStore)("core/editor",{...er});(0,u.register)(tr),m(tr).registerPrivateActions(r),m(tr).registerPrivateSelectors(s);const nr={name:"core/post-meta",label:(0,g._x)("Post Meta","block bindings source"),getPlaceholder:({args:e})=>e.key,getValue({registry:e,context:t,args:n}){const o=t.postType?t.postType:e.select(tr).getCurrentPostType();return e.select(h.store).getEditedEntityRecord("postType",o,t.postId).meta?.[n.key]}},{registerBlockBindingsSource:or}=m((0,u.dispatch)(c.store));or(nr);const rr=window.wp.compose;function sr(e){const t=e.avatar_urls&&e.avatar_urls[24]?(0,P.createElement)("img",{className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls[24]}):(0,P.createElement)("span",{className:"editor-autocompleters__no-avatar"});return(0,P.createElement)(P.Fragment,null,t,(0,P.createElement)("span",{className:"editor-autocompleters__user-name"},e.name),(0,P.createElement)("span",{className:"editor-autocompleters__user-slug"},e.slug))}(0,gn.addFilter)("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",(function(e){var t;const n=Object.fromEntries(Object.entries(null!==(t=e.attributes)&&void 0!==t?t:{}).filter((([,{source:e}])=>"meta"===e)).map((([e,{meta:t}])=>[e,t])));return Object.entries(n).length&&(e.edit=(e=>(0,rr.createHigherOrderComponent)((t=>({attributes:n,setAttributes:o,...r})=>{const s=(0,u.useSelect)((e=>e(tr).getCurrentPostType()),[]),[a,i]=(0,h.useEntityProp)("postType",s,"meta"),l=(0,S.useMemo)((()=>({...n,...Object.fromEntries(Object.entries(e).map((([e,t])=>[e,a[t]])))})),[n,a]);return(0,P.createElement)(t,{attributes:l,setAttributes:t=>{const n=Object.fromEntries(Object.entries(null!=t?t:{}).filter((([t])=>t in e)).map((([t,n])=>[e[t],n])));Object.entries(n).length&&i(n),o(t)},...r})}),"withMetaAttributeSource"))(n)(e.edit)),e}));const ar={name:"users",className:"editor-autocompleters__user",triggerPrefix:"@",useItems(e){const t=(0,u.useSelect)((t=>{const{getUsers:n}=t(h.store);return n({context:"view",search:encodeURIComponent(e)})}),[e]),n=(0,S.useMemo)((()=>t?t.map((e=>({key:`user-${e.slug}`,value:e,label:sr(e)}))):[]),[t]);return[n]},getOptionCompletion:e=>`@${e.slug}`};(0,gn.addFilter)("editor.Autocomplete.completers","editor/autocompleters/set-default-completers",(function(e=[]){return e.push({...ar}),e}));const ir=window.wp.patterns,{PatternOverridesControls:lr,ResetOverridesControl:cr,PATTERN_TYPES:ur,PARTIAL_SYNCING_SUPPORTED_BLOCKS:dr,PATTERN_SYNC_TYPES:pr}=m(ir.privateApis),mr=(0,rr.createHigherOrderComponent)((e=>t=>{const n=Object.keys(dr).includes(t.name);return(0,P.createElement)(P.Fragment,null,(0,P.createElement)(e,{...t}),t.isSelected&&n&&(0,P.createElement)(gr,{...t}))}));function gr(e){const t=(0,_.useBlockEditingMode)(),{hasPatternOverridesSource:n,isEditingSyncedPattern:o}=(0,u.useSelect)((e=>{const{getBlockBindingsSource:t}=m(e(c.store)),{getCurrentPostType:n,getEditedPostAttribute:o}=e(tr);return{hasPatternOverridesSource:!!t("core/pattern-overrides"),isEditingSyncedPattern:n()===ur.user&&o("meta")?.wp_pattern_sync_status!==pr.unsynced&&o("wp_pattern_sync_status")!==pr.unsynced}}),[]),r=e.attributes.metadata?.bindings,s=!!r&&Object.values(r).some((e=>"core/pattern-overrides"===e.source)),a=o&&"default"===t,i=!o&&!!e.attributes.metadata?.name&&"disabled"!==t&&s;return n?(0,P.createElement)(P.Fragment,null,a&&(0,P.createElement)(lr,{...e}),i&&(0,P.createElement)(cr,{...e})):null}(0,gn.addFilter)("editor.BlockEdit","core/editor/with-pattern-override-controls",mr);const _r=window.wp.keyboardShortcuts;function hr(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e=Sr(e),area:t=Pr(e,t)}),Tr=(e,t)=>({registry:n,dispatch:o})=>{if(!t)return;e=Sr(e),t=Pr(e,t);n.select(x.store).get(e,"isComplementaryAreaVisible")||n.dispatch(x.store).set(e,"isComplementaryAreaVisible",!0),o({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},xr=e=>({registry:t})=>{e=Sr(e);t.select(x.store).get(e,"isComplementaryAreaVisible")&&t.dispatch(x.store).set(e,"isComplementaryAreaVisible",!1)},Ir=(e,t)=>({registry:n})=>{if(!t)return;e=Sr(e),t=Pr(e,t);const o=n.select(x.store).get(e,"pinnedItems");!0!==o?.[t]&&n.dispatch(x.store).set(e,"pinnedItems",{...o,[t]:!0})},Br=(e,t)=>({registry:n})=>{if(!t)return;e=Sr(e),t=Pr(e,t);const o=n.select(x.store).get(e,"pinnedItems");n.dispatch(x.store).set(e,"pinnedItems",{...o,[t]:!1})};function Nr(e,t){return function({registry:n}){w()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),n.dispatch(x.store).toggle(e,t)}}function Ar(e,t,n){return function({registry:o}){w()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),o.dispatch(x.store).set(e,t,!!n)}}function Dr(e,t){return function({registry:n}){w()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),n.dispatch(x.store).setDefaults(e,t)}}function Rr(e){return{type:"OPEN_MODAL",name:e}}function Mr(){return{type:"CLOSE_MODAL"}}const Lr=(0,u.createRegistrySelector)((e=>(t,n)=>{n=Sr(n);const o=e(x.store).get(n,"isComplementaryAreaVisible");if(void 0!==o)return!1===o?null:t?.complementaryAreas?.[n]})),Or=(0,u.createRegistrySelector)((e=>(t,n)=>{n=Sr(n);const o=e(x.store).get(n,"isComplementaryAreaVisible"),r=t?.complementaryAreas?.[n];return o&&void 0===r})),Fr=(0,u.createRegistrySelector)((e=>(t,n,o)=>{var r;o=Pr(n=Sr(n),o);const s=e(x.store).get(n,"pinnedItems");return null===(r=s?.[o])||void 0===r||r})),Vr=(0,u.createRegistrySelector)((e=>(t,n,o)=>(w()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(x.store).get(n,o))));function Ur(e,t){return e.activeModal===t}const Hr=(0,u.combineReducers)({complementaryAreas:function(e={},t){switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:n,area:o}=t;return e[n]?e:{...e,[n]:o}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:n,area:o}=t;return{...e,[n]:o}}}return e},activeModal:function(e=null,t){switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e}}),zr=(0,u.createReduxStore)("core/interface",{reducer:Hr,actions:a,selectors:i});(0,u.register)(zr);const Gr=window.wp.plugins,jr=(0,Gr.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`})));const $r=jr((function({as:e=fr.Button,scope:t,identifier:n,icon:o,selectedIcon:r,name:s,...a}){const i=e,l=(0,u.useSelect)((e=>e(zr).getActiveComplementaryArea(t)===n),[n,t]),{enableComplementaryArea:c,disableComplementaryArea:d}=(0,u.useDispatch)(zr);return(0,P.createElement)(i,{icon:r&&l?r:o,"aria-controls":n.replace("/",":"),onClick:()=>{l?d(t):c(t,n)},...a})})),Wr=({smallScreenTitle:e,children:t,className:n,toggleButtonProps:o})=>{const r=(0,P.createElement)($r,{icon:wr,...o});return(0,P.createElement)(P.Fragment,null,(0,P.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},e&&(0,P.createElement)("h2",{className:"interface-complementary-area-header__small-title"},e),r),(0,P.createElement)("div",{className:br("components-panel__header","interface-complementary-area-header",n),tabIndex:-1},t,r))},Kr=()=>{};function Zr({name:e,as:t=fr.Button,onClick:n,...o}){return(0,P.createElement)(fr.Fill,{name:e},(({onClick:e})=>(0,P.createElement)(t,{onClick:n||e?(...t)=>{(n||Kr)(...t),(e||Kr)(...t)}:void 0,...o})))}Zr.Slot=function({name:e,as:t=fr.ButtonGroup,fillProps:n={},bubblesVirtually:o,...r}){return(0,P.createElement)(fr.Slot,{name:e,bubblesVirtually:o,fillProps:n},(e=>{if(!S.Children.toArray(e).length)return null;const n=[];S.Children.forEach(e,(({props:{__unstableExplicitMenuItem:e,__unstableTarget:t}})=>{t&&e&&n.push(t)}));const o=S.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&n.includes(e.props.__unstableTarget)?null:e));return(0,P.createElement)(t,{...r},o)}))};const Yr=Zr,qr=({__unstableExplicitMenuItem:e,__unstableTarget:t,...n})=>(0,P.createElement)(fr.MenuItem,{...n});function Qr({scope:e,target:t,__unstableExplicitMenuItem:n,...o}){return(0,P.createElement)($r,{as:o=>(0,P.createElement)(Yr,{__unstableExplicitMenuItem:n,__unstableTarget:`${e}/${t}`,as:qr,name:`${e}/plugin-more-menu`,...o}),role:"menuitemcheckbox",selectedIcon:Er,name:t,scope:e,...o})}function Xr({scope:e,...t}){return(0,P.createElement)(fr.Fill,{name:`PinnedItems/${e}`,...t})}Xr.Slot=function({scope:e,className:t,...n}){return(0,P.createElement)(fr.Slot,{name:`PinnedItems/${e}`,...n},(e=>e?.length>0&&(0,P.createElement)("div",{className:br(t,"interface-pinned-items")},e)))};const Jr=Xr,es=.3;const ts=280,ns={open:{width:ts},closed:{width:0},mobileOpen:{width:"100vw"}};function os({activeArea:e,isActive:t,scope:n,children:o,className:r,id:s}){const a=(0,rr.useReducedMotion)(),i=(0,rr.useViewportMatch)("medium","<"),l=(0,rr.usePrevious)(e),c=(0,rr.usePrevious)(t),[,u]=(0,S.useState)({});(0,S.useEffect)((()=>{u({})}),[t]);const d={type:"tween",duration:a||i||l&&e&&e!==l?0:es,ease:[.6,0,.4,1]};return(0,P.createElement)(fr.Fill,{name:`ComplementaryArea/${n}`},(0,P.createElement)(fr.__unstableAnimatePresence,{initial:!1},(c||t)&&(0,P.createElement)(fr.__unstableMotion.div,{variants:ns,initial:"closed",animate:i?"mobileOpen":"open",exit:"closed",transition:d,className:"interface-complementary-area__fill"},(0,P.createElement)("div",{id:s,className:r,style:{width:i?"100vw":ts}},o))))}const rs=jr((function({children:e,className:t,closeLabel:n=(0,g.__)("Close plugin"),identifier:o,header:r,headerClassName:s,icon:a,isPinnable:i=!0,panelClassName:l,scope:c,name:d,smallScreenTitle:p,title:m,toggleShortcut:_,isActiveByDefault:h}){const[b,f]=(0,S.useState)(!1),{isLoading:E,isActive:y,isPinned:v,activeArea:k,isSmall:w,isLarge:C,showIconLabels:T}=(0,u.useSelect)((e=>{const{getActiveComplementaryArea:t,isComplementaryAreaLoading:n,isItemPinned:r}=e(zr),{get:s}=e(x.store),a=t(c);return{isLoading:n(c),isActive:a===o,isPinned:r(c,o),activeArea:a,isSmall:e(kr.store).isViewportMatch("< medium"),isLarge:e(kr.store).isViewportMatch("large"),showIconLabels:s("core","showIconLabels")}}),[o,c]);!function(e,t,n,o,r){const s=(0,S.useRef)(!1),a=(0,S.useRef)(!1),{enableComplementaryArea:i,disableComplementaryArea:l}=(0,u.useDispatch)(zr);(0,S.useEffect)((()=>{o&&r&&!s.current?(l(e),a.current=!0):a.current&&!r&&s.current?(a.current=!1,i(e,t)):a.current&&n&&n!==t&&(a.current=!1),r!==s.current&&(s.current=r)}),[o,r,e,t,n,l,i])}(c,o,k,y,w);const{enableComplementaryArea:I,disableComplementaryArea:B,pinItem:N,unpinItem:A}=(0,u.useDispatch)(zr);if((0,S.useEffect)((()=>{h&&void 0===k&&!w?I(c,o):void 0===k&&w&&B(c,o),f(!0)}),[k,h,c,o,w,I,B]),b)return(0,P.createElement)(P.Fragment,null,i&&(0,P.createElement)(Jr,{scope:c},v&&(0,P.createElement)($r,{scope:c,identifier:o,isPressed:y&&(!T||C),"aria-expanded":y,"aria-disabled":E,label:m,icon:T?Er:a,showTooltip:!T,variant:T?"tertiary":void 0,size:"compact"})),d&&i&&(0,P.createElement)(Qr,{target:d,scope:c,icon:a},m),(0,P.createElement)(os,{activeArea:k,isActive:y,className:br("interface-complementary-area",t),scope:c,id:o.replace("/",":")},(0,P.createElement)(Wr,{className:s,closeLabel:n,onClose:()=>B(c),smallScreenTitle:p,toggleButtonProps:{label:n,size:"small",shortcut:_,scope:c,identifier:o}},r||(0,P.createElement)(P.Fragment,null,(0,P.createElement)("h2",{className:"interface-complementary-area-header__title"},m),i&&(0,P.createElement)(fr.Button,{className:"interface-complementary-area__pin-unpin-item",icon:v?yr:vr,label:v?(0,g.__)("Unpin from toolbar"):(0,g.__)("Pin to toolbar"),onClick:()=>(v?A:N)(c,o),isPressed:v,"aria-expanded":v,size:"compact"}))),(0,P.createElement)(fr.Panel,{className:l},e)))}));rs.Slot=function({scope:e,...t}){return(0,P.createElement)(fr.Slot,{name:`ComplementaryArea/${e}`,...t})};const ss=rs,as=({isActive:e})=>((0,S.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,S.useEffect)((()=>(e?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode"),()=>{e&&document.body.classList.remove("is-fullscreen-mode")})),[e]),null);function is({children:e,className:t,ariaLabel:n,as:o="div",...r}){return(0,P.createElement)(o,{className:br("interface-navigable-region",t),"aria-label":n,role:"region",tabIndex:"-1",...r},e)}const ls={hidden:{opacity:0},hover:{opacity:1,transition:{type:"tween",delay:.2,delayChildren:.2}},distractionFreeInactive:{opacity:1,transition:{delay:0}}};const cs=(0,S.forwardRef)((function({isDistractionFree:e,footer:t,header:n,editorNotices:o,sidebar:r,secondarySidebar:s,notices:a,content:i,actions:l,labels:c,className:u,enableRegionNavigation:d=!0,shortcuts:p},m){const[_,h]=(0,rr.useResizeObserver)(),b=(0,rr.useViewportMatch)("medium","<"),f={type:"tween",duration:(0,rr.useReducedMotion)()?0:.25,ease:[.6,0,.4,1]},E=(0,fr.__unstableUseNavigateRegions)(p);!function(e){(0,S.useEffect)((()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}}),[e])}("interface-interface-skeleton__html-container");const y={...{header:(0,g._x)("Header","header landmark area"),body:(0,g.__)("Content"),secondarySidebar:(0,g.__)("Block Library"),sidebar:(0,g.__)("Settings"),actions:(0,g.__)("Publish"),footer:(0,g.__)("Footer")},...c};return(0,P.createElement)("div",{...d?E:{},ref:(0,rr.useMergeRefs)([m,d?E.ref:void 0]),className:br(u,"interface-interface-skeleton",E.className,!!t&&"has-footer")},(0,P.createElement)("div",{className:"interface-interface-skeleton__editor"},!!n&&(0,P.createElement)(is,{as:fr.__unstableMotion.div,className:"interface-interface-skeleton__header","aria-label":y.header,initial:e?"hidden":"distractionFreeInactive",whileHover:e?"hover":"distractionFreeInactive",animate:e?"hidden":"distractionFreeInactive",variants:ls,transition:e?{type:"tween",delay:.8}:void 0},n),e&&(0,P.createElement)("div",{className:"interface-interface-skeleton__header"},o),(0,P.createElement)("div",{className:"interface-interface-skeleton__body"},(0,P.createElement)(fr.__unstableAnimatePresence,{initial:!1},!!s&&(0,P.createElement)(is,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:y.secondarySidebar,as:fr.__unstableMotion.div,initial:"closed",animate:b?"mobileOpen":"open",exit:"closed",variants:{open:{width:h.width},closed:{width:0},mobileOpen:{width:"100vw"}},transition:f},(0,P.createElement)("div",{style:{position:"absolute",width:b?"100vw":"fit-content",height:"100%",right:0}},_,s))),!!a&&(0,P.createElement)("div",{className:"interface-interface-skeleton__notices"},a),(0,P.createElement)(is,{className:"interface-interface-skeleton__content",ariaLabel:y.body},i),!!r&&(0,P.createElement)(is,{className:"interface-interface-skeleton__sidebar",ariaLabel:y.sidebar},r),!!l&&(0,P.createElement)(is,{className:"interface-interface-skeleton__actions",ariaLabel:y.actions},l))),!!t&&(0,P.createElement)(is,{className:"interface-interface-skeleton__footer",ariaLabel:y.footer},t))}));function us(){const e=(0,u.useSelect)((e=>{const{richEditingEnabled:t,codeEditingEnabled:n}=e(tr).getEditorSettings();return!t||!n}),[]),{getBlockSelectionStart:t}=(0,u.useSelect)(_.store),{getActiveComplementaryArea:n}=(0,u.useSelect)(zr),{enableComplementaryArea:o,disableComplementaryArea:r}=(0,u.useDispatch)(zr),{redo:s,undo:a,savePost:i,setIsListViewOpened:l,switchEditorMode:c,toggleDistractionFree:d}=(0,u.useDispatch)(tr),{isEditedPostDirty:p,isPostSavingLocked:m,isListViewOpened:g,getEditorMode:h}=(0,u.useSelect)(tr);return(0,_r.useShortcut)("core/editor/toggle-mode",(()=>{c("visual"===h()?"text":"visual")}),{isDisabled:e}),(0,_r.useShortcut)("core/editor/toggle-distraction-free",(()=>{d()})),(0,_r.useShortcut)("core/editor/undo",(e=>{a(),e.preventDefault()})),(0,_r.useShortcut)("core/editor/redo",(e=>{s(),e.preventDefault()})),(0,_r.useShortcut)("core/editor/save",(e=>{e.preventDefault(),m()||p()&&i()})),(0,_r.useShortcut)("core/editor/toggle-list-view",(e=>{g()||(e.preventDefault(),l(!0))})),(0,_r.useShortcut)("core/editor/toggle-sidebar",(e=>{e.preventDefault();if(["edit-post/document","edit-post/block"].includes(n("core")))r("core");else{const e=t()?"edit-post/block":"edit-post/document";o("core",e)}})),null}class ds extends S.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 ps=(0,rr.compose)([(0,u.withSelect)(((e,t)=>{const{getReferenceByDistinctEdits:n}=e(h.store),{isEditedPostDirty:o,isEditedPostAutosaveable:r,isAutosavingPost:s,getEditorSettings:a}=e(tr),{interval:i=a().autosaveInterval}=t;return{editsReference:n(),isDirty:o(),isAutosaveable:r(),isAutosaving:s(),interval:i}})),(0,u.withDispatch)(((e,t)=>({autosave(){const{autosave:n=e(tr).autosave}=t;n()}})))])(ds),ms=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),gs=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})),_s=window.wp.keycodes,hs=window.wp.commands,bs={wp_pattern:(0,g.__)("Editing pattern: %s"),wp_navigation:(0,g.__)("Editing navigation menu: %s"),wp_template:(0,g.__)("Editing template: %s"),wp_template_part:(0,g.__)("Editing template part: %s")},fs=["wp_template","wp_template_part"],Es=[...fs,"wp_block","wp_navigation"],ys=(0,fr.__unstableMotion)(fr.Button);function vs(){const{postType:e,document:t,isResolving:n,templateIcon:o,templateTitle:r,onNavigateToPreviousEntityRecord:s}=(0,u.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:n,getEditorSettings:o,__experimentalGetTemplateInfo:r}=e(tr),{getEditedEntityRecord:s,isResolving:a}=e(h.store),i=t(),l=n(),c=s("postType",i,l),u=r(c);return{postType:i,document:c,isResolving:a("getEditedEntityRecord","postType",i,l),templateIcon:m(e(tr)).getPostIcon(i,{area:c?.area}),templateTitle:u.title,onNavigateToPreviousEntityRecord:o().onNavigateToPreviousEntityRecord}}),[]),{open:a}=(0,u.useDispatch)(hs.store),i=(0,rr.useReducedMotion)(),l=!t&&!n,c=fs.includes(e),d=Es.includes(e),p=!!s,b=c?r:t.title,f=(0,S.useRef)(!1);return(0,S.useEffect)((()=>{f.current=!0}),[]),(0,P.createElement)("div",{className:br("editor-document-bar",{"has-back-button":p,"is-global":d})},(0,P.createElement)(fr.__unstableAnimatePresence,null,p&&(0,P.createElement)(ys,{className:"editor-document-bar__back",icon:(0,g.isRTL)()?ms:gs,onClick:e=>{e.stopPropagation(),s()},size:"compact",initial:!!f.current&&{opacity:0,transform:"translateX(15%)"},animate:{opacity:1,transform:"translateX(0%)"},exit:{opacity:0,transform:"translateX(15%)"},transition:i?{duration:0}:void 0},(0,g.__)("Back"))),l?(0,P.createElement)(fr.__experimentalText,null,(0,g.__)("Document not found")):(0,P.createElement)(fr.Button,{className:"editor-document-bar__command",onClick:()=>a(),size:"compact"},(0,P.createElement)(fr.__unstableMotion.div,{className:"editor-document-bar__title",key:p,initial:!!f.current&&{opacity:0,transform:p?"translateX(15%)":"translateX(-15%)"},animate:{opacity:1,transform:"translateX(0%)"},transition:i?{duration:0}:void 0},(0,P.createElement)(_.BlockIcon,{icon:o}),(0,P.createElement)(fr.__experimentalText,{size:"body",as:"h1","aria-label":bs[e]?(0,g.sprintf)(bs[e],b):void 0},b)),(0,P.createElement)("span",{className:"editor-document-bar__shortcut"},_s.displayShortcut.primary("k"))))}const ks=window.wp.richText,ws=({children:e,isValid:t,level:n,href:o,onSelect:r})=>(0,P.createElement)("li",{className:br("document-outline__item",`is-${n.toLowerCase()}`,{"is-invalid":!t})},(0,P.createElement)("a",{href:o,className:"document-outline__button",onClick:r},(0,P.createElement)("span",{className:"document-outline__emdash","aria-hidden":"true"}),(0,P.createElement)("strong",{className:"document-outline__level"},n),(0,P.createElement)("span",{className:"document-outline__item-content"},e))),Ss=(0,P.createElement)("em",null,(0,g.__)("(Empty heading)")),Ps=[(0,P.createElement)("br",{key:"incorrect-break"}),(0,P.createElement)("em",{key:"incorrect-message"},(0,g.__)("(Incorrect heading level)"))],Cs=[(0,P.createElement)("br",{key:"incorrect-break-h1"}),(0,P.createElement)("em",{key:"incorrect-message-h1"},(0,g.__)("(Your theme may already use a H1 for the post title)"))],Ts=[(0,P.createElement)("br",{key:"incorrect-break-multiple-h1"}),(0,P.createElement)("em",{key:"incorrect-message-multiple-h1"},(0,g.__)("(Multiple H1 headings are not recommended)"))];function xs(){return(0,P.createElement)(fr.SVG,{width:"138",height:"148",viewBox:"0 0 138 148",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,P.createElement)(fr.Rect,{width:"138",height:"148",rx:"4",fill:"#F0F6FC"}),(0,P.createElement)(fr.Line,{x1:"44",y1:"28",x2:"24",y2:"28",stroke:"#DDDDDD"}),(0,P.createElement)(fr.Rect,{x:"48",y:"16",width:"27",height:"23",rx:"4",fill:"#DDDDDD"}),(0,P.createElement)(fr.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,P.createElement)(fr.Line,{x1:"55",y1:"59",x2:"24",y2:"59",stroke:"#DDDDDD"}),(0,P.createElement)(fr.Rect,{x:"59",y:"47",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,P.createElement)(fr.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,P.createElement)(fr.Line,{x1:"80",y1:"90",x2:"24",y2:"90",stroke:"#DDDDDD"}),(0,P.createElement)(fr.Rect,{x:"84",y:"78",width:"30",height:"23",rx:"4",fill:"#F0B849"}),(0,P.createElement)(fr.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,P.createElement)(fr.Line,{x1:"66",y1:"121",x2:"24",y2:"121",stroke:"#DDDDDD"}),(0,P.createElement)(fr.Rect,{x:"70",y:"109",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,P.createElement)(fr.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 Is=(e=[])=>e.flatMap(((e={})=>"core/heading"===e.name?{...e,level:e.attributes.level,isEmpty:Bs(e)}:Is(e.innerBlocks))),Bs=e=>!e.attributes.content||0===e.attributes.content.trim().length;function Ns({onSelect:e,isTitleSupported:t,hasOutlineItemsDisabled:n}){const{selectBlock:o}=(0,u.useDispatch)(_.store),{blocks:r,title:s}=(0,u.useSelect)((e=>{var t;const{getBlocks:n}=e(_.store),{getEditedPostAttribute:o}=e(tr),{getPostType:r}=e(h.store),s=r(o("type"));return{title:o("title"),blocks:n(),isTitleSupported:null!==(t=s?.supports?.title)&&void 0!==t&&t}})),a=Is(r);if(a.length<1)return(0,P.createElement)("div",{className:"editor-document-outline has-no-headings"},(0,P.createElement)(xs,null),(0,P.createElement)("p",null,(0,g.__)("Navigate the structure of your document and address issues like empty or incorrect heading levels.")));let i=1;const l=document.querySelector(".editor-post-title__input"),c=t&&s&&l,d=a.reduce(((e,t)=>({...e,[t.level]:(e[t.level]||0)+1})),{})[1]>1;return(0,P.createElement)("div",{className:"document-outline"},(0,P.createElement)("ul",null,c&&(0,P.createElement)(ws,{level:(0,g.__)("Title"),isValid:!0,onSelect:e,href:`#${l.id}`,isDisabled:n},s),a.map(((t,r)=>{const s=t.level>i+1,a=!(t.isEmpty||s||!t.level||1===t.level&&(d||c));return i=t.level,(0,P.createElement)(ws,{key:r,level:`H${t.level}`,isValid:a,isDisabled:n,href:`#block-${t.clientId}`,onSelect:()=>{o(t.clientId),e?.()}},t.isEmpty?Ss:(0,ks.getTextContent)((0,ks.create)({html:t.attributes.content})),s&&Ps,1===t.level&&d&&Ts,c&&1===t.level&&!d&&Cs)}))))}function As({children:e}){const t=(0,u.useSelect)((e=>{const{getGlobalBlockCount:t}=e(_.store);return t("core/heading")>0}));return t?null:e}const Ds=function(){const{registerShortcut:e}=(0,u.useDispatch)(_r.store);return(0,S.useEffect)((()=>{e({name:"core/editor/toggle-mode",category:"global",description:(0,g.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}}),e({name:"core/editor/save",category:"global",description:(0,g.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/editor/undo",category:"global",description:(0,g.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/editor/redo",category:"global",description:(0,g.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,_s.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/editor/toggle-list-view",category:"global",description:(0,g.__)("Open the List View."),keyCombination:{modifier:"access",character:"o"}}),e({name:"core/editor/toggle-distraction-free",category:"global",description:(0,g.__)("Toggle distraction free mode."),keyCombination:{modifier:"primaryShift",character:"\\"}}),e({name:"core/editor/toggle-sidebar",category:"global",description:(0,g.__)("Show or hide the Settings sidebar."),keyCombination:{modifier:"primaryShift",character:","}}),e({name:"core/editor/keyboard-shortcuts",category:"main",description:(0,g.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/editor/next-region",category:"global",description:(0,g.__)("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,g.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]})}),[e]),(0,P.createElement)(_.BlockEditorKeyboardShortcuts.Register,null)},Rs=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.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"})),Ms=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.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 Ls=(0,S.forwardRef)((function(e,t){const n=(0,_s.isAppleOS)()?_s.displayShortcut.primaryShift("z"):_s.displayShortcut.primary("y"),o=(0,u.useSelect)((e=>e(tr).hasEditorRedo()),[]),{redo:r}=(0,u.useDispatch)(tr);return(0,P.createElement)(fr.Button,{...e,ref:t,icon:(0,g.isRTL)()?Ms:Rs,label:(0,g.__)("Redo"),shortcut:n,"aria-disabled":!o,onClick:o?r:void 0,className:"editor-history__redo"})}));const Os=(0,S.forwardRef)((function(e,t){const n=(0,u.useSelect)((e=>e(tr).hasEditorUndo()),[]),{undo:o}=(0,u.useDispatch)(tr);return(0,P.createElement)(fr.Button,{...e,ref:t,icon:(0,g.isRTL)()?Rs:Ms,label:(0,g.__)("Undo"),shortcut:_s.displayShortcut.primary("z"),"aria-disabled":!n,onClick:n?o:void 0,className:"editor-history__undo"})}));function Fs(){const[e,t]=(0,S.useState)(!1),n=(0,u.useSelect)((e=>e(_.store).isValidTemplate()),[]),{setTemplateValidity:o,synchronizeTemplate:r}=(0,u.useDispatch)(_.store);return n?null:(0,P.createElement)(P.Fragment,null,(0,P.createElement)(fr.Notice,{className:"editor-template-validation-notice",isDismissible:!1,status:"warning",actions:[{label:(0,g.__)("Keep it as is"),onClick:()=>o(!0)},{label:(0,g.__)("Reset the template"),onClick:()=>t(!0)}]},(0,g.__)("The content of your post doesn’t match the template assigned to your post type.")),(0,P.createElement)(fr.__experimentalConfirmDialog,{isOpen:e,confirmButtonText:(0,g.__)("Reset"),onConfirm:()=>{t(!1),r()},onCancel:()=>t(!1)},(0,g.__)("Resetting the template may result in loss of content, do you want to continue?")))}const Vs=function(){const{notices:e}=(0,u.useSelect)((e=>({notices:e(mn.store).getNotices()})),[]),{removeNotice:t}=(0,u.useDispatch)(mn.store),n=e.filter((({isDismissible:e,type:t})=>e&&"default"===t)),o=e.filter((({isDismissible:e,type:t})=>!e&&"default"===t));return(0,P.createElement)(P.Fragment,null,(0,P.createElement)(fr.NoticeList,{notices:o,className:"components-editor-notices__pinned"}),(0,P.createElement)(fr.NoticeList,{notices:n,className:"components-editor-notices__dismissible",onRemove:t},(0,P.createElement)(Fs,null)))},Us=-3;function Hs(){const e=(0,u.useSelect)((e=>e(mn.store).getNotices()),[]),{removeNotice:t}=(0,u.useDispatch)(mn.store),n=e.filter((({type:e})=>"snackbar"===e)).slice(Us);return(0,P.createElement)(fr.SnackbarList,{notices:n,className:"components-editor-notices__snackbar",onRemove:t})}function zs({record:e,checked:t,onChange:n}){const{name:o,kind:r,title:s,key:a}=e,i=(0,u.useSelect)((e=>{if("postType"!==r||"wp_template"!==o)return s;const t=e(h.store).getEditedEntityRecord(r,o,a);return e(tr).__experimentalGetTemplateInfo(t).title}),[o,r,s,a]);return(0,P.createElement)(fr.PanelRow,null,(0,P.createElement)(fr.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,Ao.decodeEntities)(i)||(0,g.__)("Untitled"),checked:t,onChange:n}))}const{getGlobalStylesChanges:Gs,GlobalStylesContext:js}=m(_.privateApis);function $s({record:e}){const{user:t}=(0,S.useContext)(js),n=(0,u.useSelect)((t=>t(h.store).getEntityRecord(e.kind,e.name,e.key)),[e.kind,e.name,e.key]),o=Gs(t,n,{maxResults:10});return o.length?(0,P.createElement)("ul",{className:"entities-saved-states__changes"},o.map((e=>(0,P.createElement)("li",{key:e},e)))):null}function Ws({record:e,count:t}){if("globalStyles"===e?.name)return null;const n=function(e,t){switch(e){case"site":return 1===t?(0,g.__)("This change will affect your whole site."):(0,g.__)("These changes will affect your whole site.");case"wp_template":return(0,g.__)("This change will affect pages and posts that use this template.");case"page":case"post":return(0,g.__)("The following has been modified.")}}(e?.name,t);return n?(0,P.createElement)(fr.PanelRow,null,n):null}function Ks({list:e,unselectedEntities:t,setUnselectedEntities:n}){const o=e.length,r=e[0];let s=(0,u.useSelect)((e=>e(h.store).getEntityConfig(r.kind,r.name)),[r.kind,r.name]).label;return"wp_template_part"===r?.name&&(s=1===o?(0,g.__)("Template Part"):(0,g.__)("Template Parts")),(0,P.createElement)(fr.PanelBody,{title:s,initialOpen:!0},(0,P.createElement)(Ws,{record:r,count:o}),e.map((e=>(0,P.createElement)(zs,{key:e.key||e.property,record:e,checked:!t.some((t=>t.kind===e.kind&&t.name===e.name&&t.key===e.key&&t.property===e.property)),onChange:t=>n(e,t)}))),"globalStyles"===r?.name&&(0,P.createElement)($s,{record:r}))}const Zs=()=>{const{editedEntities:e,siteEdits:t,siteEntityConfig:n}=(0,u.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,getEntityRecordEdits:n,getEntityConfig:o}=e(h.store);return{editedEntities:t(),siteEdits:n("root","site"),siteEntityConfig:o("root","site")}}),[]),o=(0,S.useMemo)((()=>{var o;const r=e.filter((e=>!("root"===e.kind&&"site"===e.name))),s=null!==(o=n?.meta?.labels)&&void 0!==o?o:{},a=[];for(const e in t)a.push({kind:"root",name:"site",title:s[e]||e,property:e});return[...r,...a]}),[e,t,n]),[r,s]=(0,S.useState)([]);return{dirtyEntityRecords:o,isDirty:o.length-r.length>0,setUnselectedEntities:({kind:e,name:t,key:n,property:o},a)=>{s(a?r.filter((r=>r.kind!==e||r.name!==t||r.key!==n||r.property!==o)):[...r,{kind:e,name:t,key:n,property:o}])},unselectedEntities:r}};function Ys(e){return e}function qs({close:e,renderDialog:t}){const n=Zs();return(0,P.createElement)(Qs,{close:e,renderDialog:t,...n})}function Qs({additionalPrompt:e,close:t,onSave:n=Ys,saveEnabled:o,saveLabel:r=(0,g.__)("Save"),renderDialog:s,dirtyEntityRecords:a,isDirty:i,setUnselectedEntities:l,unselectedEntities:c}){const d=(0,S.useRef)(),{saveDirtyEntities:p}=m((0,u.useDispatch)(tr)),_=a.reduce(((e,t)=>{const{name:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e}),{}),{site:h,wp_template:b,wp_template_part:f,...E}=_,y=[h,b,f,...Object.values(E)].filter(Array.isArray),v=null!=o?o:i,k=(0,S.useCallback)((()=>t()),[t]),[w,C]=(0,rr.__experimentalUseDialog)({onClose:()=>k()}),T=(0,rr.useInstanceId)(Qs,"label"),x=(0,rr.useInstanceId)(Qs,"description");return(0,P.createElement)("div",{ref:w,...C,className:"entities-saved-states__panel",role:s?"dialog":void 0,"aria-labelledby":s?T:void 0,"aria-describedby":s?x:void 0},(0,P.createElement)(fr.Flex,{className:"entities-saved-states__panel-header",gap:2},(0,P.createElement)(fr.FlexItem,{isBlock:!0,as:fr.Button,ref:d,variant:"primary",disabled:!v,__experimentalIsFocusable:!0,onClick:()=>p({onSave:n,dirtyEntityRecords:a,entitiesToSkip:c,close:t}),className:"editor-entities-saved-states__save-button"},r),(0,P.createElement)(fr.FlexItem,{isBlock:!0,as:fr.Button,variant:"secondary",onClick:k},(0,g.__)("Cancel"))),(0,P.createElement)("div",{className:"entities-saved-states__text-prompt"},(0,P.createElement)("div",{className:"entities-saved-states__text-prompt--header-wrapper",id:s?T:void 0},(0,P.createElement)("strong",{className:"entities-saved-states__text-prompt--header"},(0,g.__)("Are you ready to save?")),e),(0,P.createElement)("p",{id:s?x:void 0},i?(0,S.createInterpolateElement)((0,g.sprintf)((0,g._n)("There is %d site change waiting to be saved.","There are %d site changes waiting to be saved.",y.length),y.length),{strong:(0,P.createElement)("strong",null)}):(0,g.__)("Select the items you want to save."))),y.map((e=>(0,P.createElement)(Ks,{key:e[0].name,list:e,unselectedEntities:c,setUnselectedEntities:l}))))}function Xs(){try{return(0,u.select)(tr).getEditedPostContent()}catch(e){}}function Js({text:e,children:t}){const n=(0,rr.useCopyToClipboard)(e);return(0,P.createElement)(fr.Button,{variant:"secondary",ref:n},t)}class ea extends S.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){(0,gn.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}render(){const{error:e}=this.state;if(!e)return this.props.children;const t=[(0,P.createElement)(Js,{key:"copy-post",text:Xs},(0,g.__)("Copy Post Text")),(0,P.createElement)(Js,{key:"copy-error",text:e.stack},(0,g.__)("Copy Error"))];return(0,P.createElement)(_.Warning,{className:"editor-error-boundary",actions:t},(0,g.__)("The editor has encountered an unexpected error."))}}const ta=ea,na=window.requestIdleCallback?window.requestIdleCallback:window.requestAnimationFrame;let oa;function ra(){const{postId:e,isEditedPostNew:t,hasRemoteAutosave:n}=(0,u.useSelect)((e=>({postId:e(tr).getCurrentPostId(),isEditedPostNew:e(tr).isEditedPostNew(),hasRemoteAutosave:!!e(tr).getEditorSettings().autosave})),[]),{getEditedPostAttribute:o}=(0,u.useSelect)(tr),{createWarningNotice:r,removeNotice:s}=(0,u.useDispatch)(mn.store),{editPost:a,resetEditorBlocks:i}=(0,u.useDispatch)(tr);(0,S.useEffect)((()=>{let l=function(e,t){return window.sessionStorage.getItem(_n(e,t))}(e,t);if(!l)return;try{l=JSON.parse(l)}catch{return}const{post_title:u,content:d,excerpt:p}=l,m={title:u,content:d,excerpt:p};if(!Object.keys(m).some((e=>m[e]!==o(e))))return void hn(e,t);if(n)return;const _="wpEditorAutosaveRestore";r((0,g.__)("The backup of this post in your browser is different from the version below."),{id:_,actions:[{label:(0,g.__)("Restore the backup"),onClick(){const{content:e,...t}=m;a(t),i((0,c.parse)(m.content)),s(_)}}]})}),[t,e])}const sa=(0,rr.ifCondition)((()=>{if(void 0!==oa)return oa;try{window.sessionStorage.setItem("__wpEditorTestSessionStorage",""),window.sessionStorage.removeItem("__wpEditorTestSessionStorage"),oa=!0}catch{oa=!1}return oa}))((function(){const{autosave:e}=(0,u.useDispatch)(tr),t=(0,S.useCallback)((()=>{na((()=>e({local:!0})))}),[]);ra(),function(){const{postId:e,isEditedPostNew:t,isDirty:n,isAutosaving:o,didError:r}=(0,u.useSelect)((e=>({postId:e(tr).getCurrentPostId(),isEditedPostNew:e(tr).isEditedPostNew(),isDirty:e(tr).isEditedPostDirty(),isAutosaving:e(tr).isAutosavingPost(),didError:e(tr).didPostSaveRequestFail()})),[]),s=(0,S.useRef)(n),a=(0,S.useRef)(o);(0,S.useEffect)((()=>{!r&&(a.current&&!o||s.current&&!n)&&hn(e,t),s.current=n,a.current=o}),[n,o,r]);const i=(0,rr.usePrevious)(t),l=(0,rr.usePrevious)(e);(0,S.useEffect)((()=>{l===e&&i&&!t&&hn(e,!0)}),[t,e])}();const n=(0,u.useSelect)((e=>e(tr).getEditorSettings().localAutosaveInterval),[]);return(0,P.createElement)(ps,{interval:n,autosave:t})}));const aa=function({children:e}){const t=(0,u.useSelect)((e=>{const{getEditedPostAttribute:t}=e(tr),{getPostType:n}=e(h.store),o=n(t("type"));return!!o?.supports?.["page-attributes"]}),[]);return t?e:null};const ia=function({children:e,supportKeys:t}){const n=(0,u.useSelect)((e=>{const{getEditedPostAttribute:t}=e(tr),{getPostType:n}=e(h.store);return n(t("type"))}),[]);let o=!!n;return n&&(o=(Array.isArray(t)?t:[t]).some((e=>!!n.supports[e]))),o?e:null};function la(){const e=(0,u.useSelect)((e=>{var t;return null!==(t=e(tr).getEditedPostAttribute("menu_order"))&&void 0!==t?t:0}),[]),{editPost:t}=(0,u.useDispatch)(tr),[n,o]=(0,S.useState)(null),r=null!=n?n:e;return(0,P.createElement)(fr.Flex,null,(0,P.createElement)(fr.FlexBlock,null,(0,P.createElement)(fr.__experimentalNumberControl,{__next40pxDefaultSize:!0,label:(0,g.__)("Order"),value:r,onChange:e=>{o(e);const n=Number(e);Number.isInteger(n)&&""!==e.trim?.()&&t({menu_order:n})},labelPosition:"side",onBlur:()=>{o(null)}})))}function ca(){return(0,P.createElement)(ia,{supportKeys:"page-attributes"},(0,P.createElement)(la,null))}var ua=n(9681),da=n.n(ua);function pa(e){const t=e.map((e=>({children:[],parent:null,...e})));if(t.some((({parent:e})=>null===e)))return t;const n=t.reduce(((e,t)=>{const{parent:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e}),{}),o=e=>e.map((e=>{const t=n[e.id];return{...e,children:t&&t.length?o(t):[]}}));return o(n[0]||[])}const ma=e=>(0,Ao.decodeEntities)(e),ga=e=>({...e,name:ma(e.name)}),_a=e=>(null!=e?e:[]).map(ga);function ha(e){return e?.title?.rendered?(0,Ao.decodeEntities)(e.title.rendered):`#${e.id} (${(0,g.__)("no title")})`}const ba=(e,t)=>{const n=da()(e||"").toLowerCase(),o=da()(t||"").toLowerCase();return n===o?0:n.startsWith(o)?n.length:1/0};const fa=function(){const{editPost:e}=(0,u.useDispatch)(tr),[t,n]=(0,S.useState)(!1),{isHierarchical:o,parentPostId:r,parentPostTitle:s,pageItems:a}=(0,u.useSelect)((e=>{var n;const{getPostType:o,getEntityRecords:r,getEntityRecord:s}=e(h.store),{getCurrentPostId:a,getEditedPostAttribute:i}=e(tr),l=i("type"),c=i("parent"),u=o(l),d=a(),p=null!==(n=u?.hierarchical)&&void 0!==n&&n,m={per_page:100,exclude:d,parent_exclude:d,orderby:"menu_order",order:"asc",_fields:"id,title,parent"};t&&(m.search=t);const g=c?s("postType",l,c):null;return{isHierarchical:p,parentPostId:c,parentPostTitle:g?ha(g):"",pageItems:p?r("postType",l,m):null}}),[t]),i=(0,S.useMemo)((()=>{const e=(n,o=0)=>n.map((t=>[{value:t.id,label:"— ".repeat(o)+(0,Ao.decodeEntities)(t.name),rawName:t.name},...e(t.children||[],o+1)])).sort((([e],[n])=>ba(e.rawName,t)>=ba(n.rawName,t)?1:-1)).flat();if(!a)return[];let n=a.map((e=>({id:e.id,parent:e.parent,name:ha(e)})));t||(n=pa(n));const o=e(n),i=o.find((e=>e.value===r));return s&&!i&&o.unshift({value:r,label:s}),o}),[a,t,s,r]);return o?(0,P.createElement)(fr.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"editor-page-attributes__parent",label:(0,g.__)("Parent"),value:r,options:i,onFilterValueChange:(0,rr.debounce)((e=>{n(e)}),300),onChange:t=>{e({parent:t})}}):null},Ea="page-attributes";function ya(){var e;const{isEnabled:t,isOpened:n,postType:o}=(0,u.useSelect)((e=>{const{getEditedPostAttribute:t,isEditorPanelEnabled:n,isEditorPanelOpened:o}=e(tr),{getPostType:r}=e(h.store);return{isEnabled:n(Ea),isOpened:o(Ea),postType:r(t("type"))}}),[]),{toggleEditorPanelOpened:r}=(0,u.useDispatch)(tr);return t&&o?(0,P.createElement)(fr.PanelBody,{title:null!==(e=o?.labels?.attributes)&&void 0!==e?e:(0,g.__)("Page attributes"),opened:n,onToggle:()=>r(Ea)},(0,P.createElement)(fa,null),(0,P.createElement)(fr.PanelRow,null,(0,P.createElement)(ca,null))):null}function va(){return(0,P.createElement)(aa,null,(0,P.createElement)(ya,null))}const ka=(0,P.createElement)(C.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,P.createElement)(C.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"})),wa=(0,g.__)("Custom Template");function Sa({onClose:e}){const{defaultBlockTemplate:t,onNavigateToEntityRecord:n}=(0,u.useSelect)((e=>{const{getEditorSettings:t,getCurrentTemplateId:n}=e(tr);return{defaultBlockTemplate:t().defaultBlockTemplate,onNavigateToEntityRecord:t().onNavigateToEntityRecord,getTemplateId:n}})),{createTemplate:o}=m((0,u.useDispatch)(tr)),[r,s]=(0,S.useState)(""),[a,i]=(0,S.useState)(!1),l=()=>{s(""),e()};return(0,P.createElement)(fr.Modal,{title:(0,g.__)("Create custom template"),onRequestClose:l},(0,P.createElement)("form",{className:"editor-post-template__create-form",onSubmit:async e=>{if(e.preventDefault(),a)return;i(!0);const s=null!=t?t:(0,c.serialize)([(0,c.createBlock)("core/group",{tagName:"header",layout:{inherit:!0}},[(0,c.createBlock)("core/site-title"),(0,c.createBlock)("core/site-tagline")]),(0,c.createBlock)("core/separator"),(0,c.createBlock)("core/group",{tagName:"main"},[(0,c.createBlock)("core/group",{layout:{inherit:!0}},[(0,c.createBlock)("core/post-title")]),(0,c.createBlock)("core/post-content",{layout:{inherit:!0}})])]),u=await o({slug:(0,v.cleanForSlug)(r||wa),content:s,title:r||wa});i(!1),n({postId:u.id,postType:"wp_template"}),l()}},(0,P.createElement)(fr.__experimentalVStack,{spacing:"3"},(0,P.createElement)(fr.TextControl,{__nextHasNoMarginBottom:!0,label:(0,g.__)("Name"),value:r,onChange:s,placeholder:wa,disabled:a,help:(0,g.__)('Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.')}),(0,P.createElement)(fr.__experimentalHStack,{justify:"right"},(0,P.createElement)(fr.Button,{variant:"tertiary",onClick:l},(0,g.__)("Cancel")),(0,P.createElement)(fr.Button,{variant:"primary",type:"submit",isBusy:a,"aria-disabled":a},(0,g.__)("Create"))))))}function Pa(){return(0,u.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:n}=e(tr);return{postId:t(),postType:n()}}),[])}function Ca(){const{postType:e,postId:t}=Pa();return(0,u.useSelect)((n=>{const{getEntityRecord:o,getEntityRecords:r}=n(h.store),s=o("root","site"),a=r("postType","wp_template",{per_page:-1}),i=+t===s?.page_for_posts,l="page"===e&&+t===s?.page_on_front&&a?.some((({slug:e})=>"front-page"===e));return!i&&!l}),[t,e])}function Ta(e){return(0,u.useSelect)((t=>t(h.store).getEntityRecords("postType","wp_template",{per_page:-1,post_type:e})),[e])}function xa(e){const t=Ia(),n=Ca(),o=Ta(e);return(0,S.useMemo)((()=>n&&o?.filter((e=>e.is_custom&&e.slug!==t&&!!e.content.raw))),[o,t,n])}function Ia(){const{postType:e,postId:t}=Pa(),n=Ta(e),o=(0,u.useSelect)((n=>{const o=n(h.store).getEditedEntityRecord("postType",e,t);return o?.template}),[e,t]);if(o)return n?.find((e=>e.slug===o))?.slug}const Ba={className:"editor-post-template__dropdown",placement:"bottom-start"};function Na({isOpen:e,onClick:t}){const n=(0,u.useSelect)((e=>{const t=e(tr).getEditedPostAttribute("template"),{supportsTemplateMode:n,availableTemplates:o}=e(tr).getEditorSettings();if(!n&&o[t])return o[t];const r=e(h.store).canUser("create","templates")&&e(tr).getCurrentTemplateId();return r?.title||r?.slug||o?.[t]}),[]);return(0,P.createElement)(fr.Button,{__next40pxDefaultSize:!0,variant:"tertiary","aria-expanded":e,"aria-label":(0,g.__)("Template options"),onClick:t},null!=n?n:(0,g.__)("Default template"))}function Aa({onClose:e}){var t,n;const o=Ca(),{availableTemplates:r,fetchedTemplates:s,selectedTemplateSlug:a,canCreate:i,canEdit:l,currentTemplateId:c,onNavigateToEntityRecord:d,getEditorSettings:p}=(0,u.useSelect)((e=>{const{canUser:t,getEntityRecords:n}=e(h.store),r=e(tr).getEditorSettings(),s=t("create","templates"),a=e(tr).getCurrentTemplateId();return{availableTemplates:r.availableTemplates,fetchedTemplates:s?n("postType","wp_template",{post_type:e(tr).getCurrentPostType(),per_page:-1}):void 0,selectedTemplateSlug:e(tr).getEditedPostAttribute("template"),canCreate:o&&s&&r.supportsTemplateMode,canEdit:o&&s&&r.supportsTemplateMode&&!!a,currentTemplateId:a,onNavigateToEntityRecord:r.onNavigateToEntityRecord,getEditorSettings:e(tr).getEditorSettings}}),[o]),m=(0,S.useMemo)((()=>Object.entries({...r,...Object.fromEntries((null!=s?s:[]).map((({slug:e,title:t})=>[e,t.rendered])))}).map((([e,t])=>({value:e,label:t})))),[r,s]),b=null!==(t=m.find((e=>e.value===a)))&&void 0!==t?t:m.find((e=>!e.value)),{editPost:f}=(0,u.useDispatch)(tr),{createSuccessNotice:E}=(0,u.useDispatch)(mn.store),[y,v]=(0,S.useState)(!1);return(0,P.createElement)("div",{className:"editor-post-template__classic-theme-dropdown"},(0,P.createElement)(_.__experimentalInspectorPopoverHeader,{title:(0,g.__)("Template"),help:(0,g.__)("Templates define the way content is displayed when viewing your site."),actions:i?[{icon:ka,label:(0,g.__)("Add template"),onClick:()=>v(!0)}]:[],onClose:e}),o?(0,P.createElement)(fr.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,label:(0,g.__)("Template"),value:null!==(n=b?.value)&&void 0!==n?n:"",options:m,onChange:e=>f({template:e||""})}):(0,P.createElement)(fr.Notice,{status:"warning",isDismissible:!1},(0,g.__)("The posts page template cannot be changed.")),l&&d&&(0,P.createElement)("p",null,(0,P.createElement)(fr.Button,{variant:"link",onClick:()=>{d({postId:c,postType:"wp_template"}),e(),E((0,g.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:[{label:(0,g.__)("Go back"),onClick:()=>p().onNavigateToPreviousEntityRecord()}]})}},(0,g.__)("Edit template"))),y&&(0,P.createElement)(Sa,{onClose:()=>v(!1)}))}const Da=function(){return(0,P.createElement)(fr.Dropdown,{popoverProps:Ba,focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,P.createElement)(Na,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,P.createElement)(Aa,{onClose:e})})},{PreferenceBaseOption:Ra}=(window.wp.warning,m(x.privateApis)),Ma=(0,rr.compose)((0,u.withSelect)(((e,{panelName:t})=>{const{isEditorPanelEnabled:n,isEditorPanelRemoved:o}=e(tr);return{isRemoved:o(t),isChecked:n(t)}})),(0,rr.ifCondition)((({isRemoved:e})=>!e)),(0,u.withDispatch)(((e,{panelName:t})=>({onChange:()=>e(tr).toggleEditorPanelEnabled(t)}))))(Ra),{Fill:La,Slot:Oa}=(0,fr.createSlotFill)("EnablePluginDocumentSettingPanelOption"),Fa=({label:e,panelName:t})=>(0,P.createElement)(La,null,(0,P.createElement)(Ma,{label:e,panelName:t}));Fa.Slot=Oa;const Va=Fa,{Fill:Ua,Slot:Ha}=(0,fr.createSlotFill)("PluginDocumentSettingPanel"),za=({name:e,className:t,title:n,icon:o,children:r})=>{const{name:s}=(0,Gr.usePluginContext)(),a=`${s}/${e}`,{opened:i,isEnabled:l}=(0,u.useSelect)((e=>{const{isEditorPanelOpened:t,isEditorPanelEnabled:n}=e(tr);return{opened:t(a),isEnabled:n(a)}}),[a]),{toggleEditorPanelOpened:c}=(0,u.useDispatch)(tr);return(0,P.createElement)(P.Fragment,null,(0,P.createElement)(Va,{label:n,panelName:a}),(0,P.createElement)(Ua,null,l&&(0,P.createElement)(fr.PanelBody,{className:t,title:n,icon:o,opened:i,onToggle:()=>c(a)},r)))};za.Slot=Ha;const Ga=za,ja=({allowedBlocks:e,icon:t,label:n,onClick:o,small:r,role:s})=>(0,P.createElement)(_.BlockSettingsMenuControls,null,(({selectedBlocks:a,onClose:i})=>((e,t)=>{return!Array.isArray(t)||(n=t,0===e.filter((e=>!n.includes(e))).length);var n})(a,e)?(0,P.createElement)(fr.MenuItem,{onClick:(0,rr.compose)(o,i),icon:t,label:r?n:void 0,role:s},!r&&n):null)),$a=(0,rr.compose)((0,Gr.withPluginContext)(((e,t)=>{var n;return{as:null!==(n=t.as)&&void 0!==n?n:fr.MenuItem,icon:t.icon||e.icon,name:"core/plugin-more-menu"}})))(Yr),{Fill:Wa,Slot:Ka}=(0,fr.createSlotFill)("PluginPostPublishPanel"),Za=({children:e,className:t,title:n,initialOpen:o=!1,icon:r})=>{const{icon:s}=(0,Gr.usePluginContext)();return(0,P.createElement)(Wa,null,(0,P.createElement)(fr.PanelBody,{className:t,initialOpen:o||!n,title:n,icon:null!=r?r:s},e))};Za.Slot=Ka;const Ya=Za,{Fill:qa,Slot:Qa}=(0,fr.createSlotFill)("PluginPostStatusInfo"),Xa=({children:e,className:t})=>(0,P.createElement)(qa,null,(0,P.createElement)(fr.PanelRow,{className:t},e));Xa.Slot=Qa;const Ja=Xa,{Fill:ei,Slot:ti}=(0,fr.createSlotFill)("PluginPrePublishPanel"),ni=({children:e,className:t,title:n,initialOpen:o=!1,icon:r})=>{const{icon:s}=(0,Gr.usePluginContext)();return(0,P.createElement)(ei,null,(0,P.createElement)(fr.PanelBody,{className:t,initialOpen:o||!n,title:n,icon:null!=r?r:s},e))};ni.Slot=ti;const oi=ni;function ri({className:e,...t}){const{postTitle:n,shortcut:o}=(0,u.useSelect)((e=>({postTitle:e(tr).getEditedPostAttribute("title"),shortcut:e(_r.store).getShortcutRepresentation("core/editor/toggle-sidebar")})),[]);return(0,P.createElement)(ss,{panelClassName:e,className:"editor-sidebar",smallScreenTitle:n||(0,g.__)("(no title)"),scope:"core",toggleShortcut:o,...t})}function si(e){return(0,P.createElement)(Qr,{__unstableExplicitMenuItem:!0,scope:"core",...e})}function ai({onClick:e}){const[t,n]=(0,S.useState)(!1),{postType:o,postId:r}=Pa(),s=xa(o),{editEntityRecord:a}=(0,u.useDispatch)(h.store);if(!s?.length)return null;return(0,P.createElement)(P.Fragment,null,(0,P.createElement)(fr.MenuItem,{onClick:()=>n(!0)},(0,g.__)("Swap template")),t&&(0,P.createElement)(fr.Modal,{title:(0,g.__)("Choose a template"),onRequestClose:()=>n(!1),overlayClassName:"editor-post-template__swap-template-modal",isFullScreen:!0},(0,P.createElement)("div",{className:"editor-post-template__swap-template-modal-content"},(0,P.createElement)(ii,{postType:o,onSelect:async t=>{a("postType",o,r,{template:t.name},{undoIgnore:!0}),n(!1),e()}}))))}function ii({postType:e,onSelect:t}){const n=xa(e),o=(0,S.useMemo)((()=>n.map((e=>({name:e.slug,blocks:(0,c.parse)(e.content.raw),title:(0,Ao.decodeEntities)(e.title.rendered),id:e.id})))),[n]),r=(0,rr.useAsyncList)(o);return(0,P.createElement)(_.__experimentalBlockPatternsList,{label:(0,g.__)("Templates"),blockPatterns:o,shownPatterns:r,onClickPattern:t})}function li({onClick:e}){const t=Ia(),n=Ca(),{postType:o,postId:r}=Pa(),{editEntityRecord:s}=(0,u.useDispatch)(h.store);return t&&n?(0,P.createElement)(fr.MenuItem,{onClick:()=>{s("postType",o,r,{template:""},{undoIgnore:!0}),e()}},(0,g.__)("Use default template")):null}function ci({onClick:e}){const{canCreateTemplates:t}=(0,u.useSelect)((e=>{const{canUser:t}=e(h.store);return{canCreateTemplates:t("create","templates")}}),[]),[n,o]=(0,S.useState)(!1),r=Ca();return t&&r?(0,P.createElement)(P.Fragment,null,(0,P.createElement)(fr.MenuItem,{onClick:()=>{o(!0)}},(0,g.__)("Create new template")),n&&(0,P.createElement)(Sa,{onClose:()=>{o(!1),e()}})):null}const ui={className:"editor-post-template__dropdown",placement:"bottom-start"};function di({id:e}){const{isTemplateHidden:t,onNavigateToEntityRecord:n,getEditorSettings:o,hasGoBack:r}=(0,u.useSelect)((e=>{const{getRenderingMode:t,getEditorSettings:n}=m(e(tr)),o=n();return{isTemplateHidden:"post-only"===t(),onNavigateToEntityRecord:o.onNavigateToEntityRecord,getEditorSettings:n,hasGoBack:o.hasOwnProperty("onNavigateToPreviousEntityRecord")}}),[]),{editedRecord:s,hasResolved:a}=(0,h.useEntityRecord)("postType","wp_template",e),{createSuccessNotice:i}=(0,u.useDispatch)(mn.store),{setRenderingMode:l}=(0,u.useDispatch)(tr),c=(0,u.useSelect)((e=>{var t;return null!==(t=e(h.store).canUser("create","templates"))&&void 0!==t&&t}));if(!a)return null;const d=r?[{label:(0,g.__)("Go back"),onClick:()=>o().onNavigateToPreviousEntityRecord()}]:void 0;return(0,P.createElement)(fr.DropdownMenu,{popoverProps:ui,focusOnMount:!0,toggleProps:{size:"compact",variant:"tertiary"},label:(0,g.__)("Template options"),text:(0,Ao.decodeEntities)(s.title),icon:null},(({onClose:e})=>(0,P.createElement)(P.Fragment,null,(0,P.createElement)(fr.MenuGroup,null,c&&(0,P.createElement)(fr.MenuItem,{onClick:()=>{n({postId:s.id,postType:"wp_template"}),e(),i((0,g.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:d})}},(0,g.__)("Edit template")),(0,P.createElement)(ai,{onClick:e}),(0,P.createElement)(li,{onClick:e}),c&&(0,P.createElement)(ci,{onClick:e})),(0,P.createElement)(fr.MenuGroup,null,(0,P.createElement)(fr.MenuItem,{icon:t?void 0:Er,isSelected:!t,role:"menuitemcheckbox",onClick:()=>{l(t?"template-locked":"post-only")}},(0,g.__)("Show template"))))))}const pi=(0,S.forwardRef)((({className:e,label:t,children:n},o)=>(0,P.createElement)(fr.__experimentalHStack,{className:br("editor-post-panel__row",e),ref:o},t&&(0,P.createElement)("div",{className:"editor-post-panel__row-label"},t),(0,P.createElement)("div",{className:"editor-post-panel__row-control"},n))));function mi(){const{templateId:e,isBlockTheme:t}=(0,u.useSelect)((e=>{const{getCurrentTemplateId:t,getEditorSettings:n}=e(tr);return{templateId:t(),isBlockTheme:n().__unstableIsBlockBasedTheme}}),[]),n=(0,u.useSelect)((e=>{var t;const n=e(tr).getCurrentPostType(),o=e(h.store).getPostType(n);if(!o?.viewable)return!1;const r=e(tr).getEditorSettings();if(!!r.availableTemplates&&Object.keys(r.availableTemplates).length>0)return!0;if(!r.supportsTemplateMode)return!1;return null!==(t=e(h.store).canUser("create","templates"))&&void 0!==t&&t}),[]),o=(0,u.useSelect)((e=>{var t;return null!==(t=e(h.store).canUser("read","templates"))&&void 0!==t&&t}),[]);return t&&o||!n?t&&e?(0,P.createElement)(pi,{label:(0,g.__)("Template")},(0,P.createElement)(di,{id:e})):null:(0,P.createElement)(pi,{label:(0,g.__)("Template")},(0,P.createElement)(Da,null))}const gi={_fields:"id,name",context:"view"},_i={who:"authors",per_page:50,...gi};function hi(e){const{authorId:t,authors:n,postAuthor:o}=(0,u.useSelect)((t=>{const{getUser:n,getUsers:o}=t(h.store),{getEditedPostAttribute:r}=t(tr),s=r("author"),a={..._i};return e&&(a.search=e),{authorId:s,authors:o(a),postAuthor:n(s,gi)}}),[e]);return{authorId:t,authorOptions:(0,S.useMemo)((()=>{const e=(null!=n?n:[]).map((e=>({value:e.id,label:(0,Ao.decodeEntities)(e.name)})));return e.findIndex((({value:e})=>o?.id===e))<0&&o?[{value:o.id,label:(0,Ao.decodeEntities)(o.name)},...e]:e}),[n,o])}}function bi(){const[e,t]=(0,S.useState)(),{editPost:n}=(0,u.useDispatch)(tr),{authorId:o,authorOptions:r}=hi(e);return(0,P.createElement)(fr.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,g.__)("Author"),options:r,value:o,onFilterValueChange:(0,rr.debounce)((e=>{t(e)}),300),onChange:e=>{e&&n({author:e})},allowReset:!1})}function fi(){const{editPost:e}=(0,u.useDispatch)(tr),{authorId:t,authorOptions:n}=hi();return(0,P.createElement)(fr.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"post-author-selector",label:(0,g.__)("Author"),options:n,onChange:t=>{const n=Number(t);e({author:n})},value:t})}const Ei=function(){return(0,u.useSelect)((e=>{const t=e(h.store).getUsers(_i);return t?.length>=25}),[])?(0,P.createElement)(bi,null):(0,P.createElement)(fi,null)};function yi({children:e}){const{hasAssignAuthorAction:t,hasAuthors:n}=(0,u.useSelect)((e=>{var t;const n=e(tr).getCurrentPost(),o=e(h.store).getUsers(_i);return{hasAssignAuthorAction:null!==(t=n._links?.["wp:action-assign-author"])&&void 0!==t&&t,hasAuthors:o?.length>=1}}),[]);return t&&n?(0,P.createElement)(ia,{supportKeys:"author"},e):null}const vi=function(){return(0,P.createElement)(yi,null,(0,P.createElement)(pi,{className:"editor-post-author__panel"},(0,P.createElement)(Ei,null)))},ki=[{label:(0,P.createElement)(P.Fragment,null,(0,g.__)("Open"),(0,P.createElement)(fr.__experimentalText,{variant:"muted",size:12},(0,g.__)("Visitors can add new comments and replies."))),value:"open"},{label:(0,P.createElement)(P.Fragment,null,(0,g.__)("Closed"),(0,P.createElement)(fr.__experimentalText,{variant:"muted",size:12},(0,g.__)("Visitors cannot add new comments or replies.")),(0,P.createElement)(fr.__experimentalText,{variant:"muted",size:12},(0,g.__)("Existing comments remain visible."))),value:"closed"}];const wi=function(){const e=(0,u.useSelect)((e=>{var t;return null!==(t=e(tr).getEditedPostAttribute("comment_status"))&&void 0!==t?t:"open"}),[]),{editPost:t}=(0,u.useDispatch)(tr);return(0,P.createElement)("form",null,(0,P.createElement)(fr.__experimentalVStack,{spacing:4},(0,P.createElement)(fr.RadioControl,{className:"editor-change-status__options",hideLabelFromVision:!0,label:(0,g.__)("Comment status"),options:ki,onChange:e=>t({comment_status:e}),selected:e})))};const Si=function(){const e=(0,u.useSelect)((e=>{var t;return null!==(t=e(tr).getEditedPostAttribute("ping_status"))&&void 0!==t?t:"open"}),[]),{editPost:t}=(0,u.useDispatch)(tr);return(0,P.createElement)(fr.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,g.__)("Enable pingbacks & trackbacks"),checked:"open"===e,onChange:()=>t({ping_status:"open"===e?"closed":"open"}),help:(0,P.createElement)(fr.ExternalLink,{href:(0,g.__)("https://wordpress.org/documentation/article/trackbacks-and-pingbacks/")},(0,g.__)("Learn more about pingbacks & trackbacks"))})},Pi="discussion-panel";function Ci({onClose:e}){return(0,P.createElement)("div",{className:"editor-post-discussion"},(0,P.createElement)(_.__experimentalInspectorPopoverHeader,{title:(0,g.__)("Discussion"),onClose:e}),(0,P.createElement)(fr.__experimentalVStack,{spacing:4},(0,P.createElement)(ia,{supportKeys:"comments"},(0,P.createElement)(wi,null)),(0,P.createElement)(ia,{supportKeys:"trackbacks"},(0,P.createElement)(Si,null))))}function Ti({isOpen:e,onClick:t}){const{commentStatus:n,pingStatus:o,commentsSupported:r,trackbacksSupported:s}=(0,u.useSelect)((e=>{var t,n;const{getEditedPostAttribute:o}=e(tr),{getPostType:r}=e(h.store),s=r(o("type"));return{commentStatus:null!==(t=o("comment_status"))&&void 0!==t?t:"open",pingStatus:null!==(n=o("ping_status"))&&void 0!==n?n:"open",commentsSupported:!!s.supports.comments,trackbacksSupported:!!s.supports.trackbacks}}),[]);let a;return a="open"===n?"open"===o?(0,g.__)("Open"):s?(0,g.__)("Comments only"):(0,g.__)("Open"):"open"===o?r?(0,g.__)("Pings only"):(0,g.__)("Pings enabled"):(0,g.__)("Closed"),(0,P.createElement)(fr.Button,{size:"compact",className:"editor-post-discussion__panel-toggle",variant:"tertiary","aria-label":(0,g.__)("Change discussion options"),"aria-expanded":e,onClick:t},(0,P.createElement)(fr.__experimentalText,null,a))}function xi(){const{isEnabled:e}=(0,u.useSelect)((e=>{const{isEditorPanelEnabled:t}=e(tr);return{isEnabled:t(Pi)}}),[]),[t,n]=(0,S.useState)(null),o=(0,S.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]);return e?(0,P.createElement)(ia,{supportKeys:["comments","trackbacks"]},(0,P.createElement)(pi,{label:(0,g.__)("Discussion"),ref:n},(0,P.createElement)(fr.Dropdown,{popoverProps:o,className:"editor-post-discussion__panel-dropdown",contentClassName:"editor-post-discussion__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,P.createElement)(Ti,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,P.createElement)(Ci,{onClose:e})}))):null}function Ii({hideLabelFromVision:e=!1,updateOnBlur:t=!1}){const{excerpt:n,shouldUseDescriptionLabel:o,usedAttribute:r}=(0,u.useSelect)((e=>{const{getCurrentPostType:t,getEditedPostAttribute:n}=e(tr),o=t(),r=["wp_template","wp_template_part"].includes(o)?"description":"excerpt";return{excerpt:n(r),shouldUseDescriptionLabel:["wp_template","wp_template_part","wp_block"].includes(o),usedAttribute:r}}),[]),{editPost:s}=(0,u.useDispatch)(tr),[a,i]=(0,S.useState)(n),l=e=>{s({[r]:e})},c=o?(0,g.__)("Write a description (optional)"):(0,g.__)("Write an excerpt (optional)");return(0,P.createElement)("div",{className:"editor-post-excerpt"},(0,P.createElement)(fr.TextareaControl,{__nextHasNoMarginBottom:!0,label:c,hideLabelFromVision:e,className:"editor-post-excerpt__textarea",onChange:t?i:l,onBlur:t?()=>l(a):void 0,value:t?a:n,help:o?(0,g.__)("Write a description"):(0,P.createElement)(fr.ExternalLink,{href:(0,g.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#excerpt")},(0,g.__)("Learn more about manual excerpts"))}))}const Bi=function({children:e}){return(0,P.createElement)(ia,{supportKeys:"excerpt"},e)},{Fill:Ni,Slot:Ai}=(0,fr.createSlotFill)("PluginPostExcerpt"),Di=({children:e,className:t})=>(0,P.createElement)(Ni,null,(0,P.createElement)(fr.PanelRow,{className:t},e));Di.Slot=Ai;const Ri=Di,Mi="post-excerpt";function Li(){const{isOpened:e,isEnabled:t,postType:n}=(0,u.useSelect)((e=>{const{isEditorPanelOpened:t,isEditorPanelEnabled:n,getCurrentPostType:o}=e(tr);return{isOpened:t(Mi),isEnabled:n(Mi),postType:o()}}),[]),{toggleEditorPanelOpened:o}=(0,u.useDispatch)(tr);if(!t)return null;const r=["wp_template","wp_template_part","wp_block"].includes(n);return(0,P.createElement)(fr.PanelBody,{title:r?(0,g.__)("Description"):(0,g.__)("Excerpt"),opened:e,onToggle:()=>o(Mi)},(0,P.createElement)(Ri.Slot,null,(e=>(0,P.createElement)(P.Fragment,null,(0,P.createElement)(Ii,null),e))))}function Oi(){return(0,P.createElement)(Bi,null,(0,P.createElement)(Li,null))}function Fi(){return(0,P.createElement)(Bi,null,(0,P.createElement)(Vi,null))}function Vi(){const{shouldRender:e,excerpt:t,shouldBeUsedAsDescription:n,allowEditing:o}=(0,u.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:n,getEditedPostAttribute:o,isEditorPanelEnabled:r}=e(tr),s=t(),a=["wp_template","wp_template_part"].includes(s),i="wp_block"===s,l=a||i,c=a?"description":"excerpt",u=a&&e(h.store).getEntityRecord("postType",s,n()),d=r(Mi)||l;return{excerpt:o(c),shouldRender:d,shouldBeUsedAsDescription:l,allowEditing:d&&(!l||i||u&&u.source===V.custom&&!u.has_theme_file)}}),[]),[r,s]=(0,S.useState)(null),a=n?(0,g.__)("Description"):(0,g.__)("Excerpt"),i=(0,S.useMemo)((()=>({anchor:r,"aria-label":a,headerTitle:a,placement:"left-start",offset:36,shift:!0})),[r,a]);if(!e)return!1;const l=!!t&&(0,P.createElement)(fr.__experimentalText,{align:"left",numberOfLines:4,truncate:!0},t);if(!o)return l;const c=n?(0,g.__)("Add a description…"):(0,g.__)("Add an excerpt…"),d=n?(0,g.__)("Edit description"):(0,g.__)("Edit excerpt");return(0,P.createElement)(fr.Dropdown,{className:"editor-post-excerpt__dropdown",contentClassName:"editor-post-excerpt__dropdown__content",popoverProps:i,focusOnMount:!0,ref:s,renderToggle:({onToggle:e})=>(0,P.createElement)(fr.Button,{className:br("editor-post-excerpt__dropdown__trigger",{"has-excerpt":!!t}),onClick:e,label:l?d:c,showTooltip:!!l},l||c),renderContent:({onClose:e})=>(0,P.createElement)(P.Fragment,null,(0,P.createElement)(_.__experimentalInspectorPopoverHeader,{title:a,onClose:e}),(0,P.createElement)(fr.__experimentalVStack,{spacing:4},(0,P.createElement)(Ri.Slot,null,(e=>(0,P.createElement)(P.Fragment,null,(0,P.createElement)(Ii,{hideLabelFromVision:!0,updateOnBlur:!0}),e)))))})}const Ui=window.wp.blob;function Hi({children:e,supportKeys:t}){const{postType:n,themeSupports:o}=(0,u.useSelect)((e=>({postType:e(tr).getEditedPostAttribute("type"),themeSupports:e(h.store).getThemeSupports()})),[]);return(Array.isArray(t)?t:[t]).some((e=>{var t;const r=null!==(t=o?.[e])&&void 0!==t&&t;return"post-thumbnails"===e&&Array.isArray(r)?r.includes(n):r}))?e:null}const zi=function({children:e}){return(0,P.createElement)(Hi,{supportKeys:"post-thumbnails"},(0,P.createElement)(ia,{supportKeys:"thumbnail"},e))},Gi=["image"],ji=(0,g.__)("Featured image"),$i=(0,g.__)("Add a featured image"),Wi=(0,P.createElement)("p",null,(0,g.__)("To edit the featured image, you need permission to upload media."));const Ki=(0,u.withSelect)((e=>{const{getMedia:t,getPostType:n}=e(h.store),{getCurrentPostId:o,getEditedPostAttribute:r}=e(tr),s=r("featured_media");return{media:s?t(s,{context:"view"}):null,currentPostId:o(),postType:n(r("type")),featuredImageId:s}})),Zi=(0,u.withDispatch)(((e,{noticeOperations:t},{select:n})=>{const{editPost:o}=e(tr);return{onUpdateImage(e){o({featured_media:e.id})},onDropImage(e){n(_.store).getSettings().mediaUpload({allowedTypes:["image"],filesList:e,onFileChange([e]){o({featured_media:e.id})},onError(e){t.removeAllNotices(),t.createErrorNotice(e)}})},onRemoveImage(){o({featured_media:0})}}})),Yi=(0,rr.compose)(fr.withNotices,Ki,Zi,(0,fr.withFilters)("editor.PostFeaturedImage"))((function({currentPostId:e,featuredImageId:t,onUpdateImage:n,onRemoveImage:o,media:r,postType:s,noticeUI:a,noticeOperations:i}){const l=(0,S.useRef)(),[c,d]=(0,S.useState)(!1),{getSettings:p}=(0,u.useSelect)(_.store),{mediaSourceUrl:m}=function(e,t){var n,o;if(!e)return{};const r=(0,gn.applyFilters)("editor.PostFeaturedImage.imageSize","large",e.id,t);if(r in(null!==(n=e?.media_details?.sizes)&&void 0!==n?n:{}))return{mediaWidth:e.media_details.sizes[r].width,mediaHeight:e.media_details.sizes[r].height,mediaSourceUrl:e.media_details.sizes[r].source_url};const s=(0,gn.applyFilters)("editor.PostFeaturedImage.imageSize","thumbnail",e.id,t);return s in(null!==(o=e?.media_details?.sizes)&&void 0!==o?o:{})?{mediaWidth:e.media_details.sizes[s].width,mediaHeight:e.media_details.sizes[s].height,mediaSourceUrl:e.media_details.sizes[s].source_url}:{mediaWidth:e.media_details.width,mediaHeight:e.media_details.height,mediaSourceUrl:e.source_url}}(r,e);function h(e){p().mediaUpload({allowedTypes:Gi,filesList:e,onFileChange([e]){(0,Ui.isBlobURL)(e?.url)?d(!0):(e&&n(e),d(!1))},onError(e){i.removeAllNotices(),i.createErrorNotice(e)}})}return(0,P.createElement)(zi,null,a,(0,P.createElement)("div",{className:"editor-post-featured-image"},r&&(0,P.createElement)("div",{id:`editor-post-featured-image-${t}-describedby`,className:"hidden"},r.alt_text&&(0,g.sprintf)((0,g.__)("Current image: %s"),r.alt_text),!r.alt_text&&(0,g.sprintf)((0,g.__)("The current image has no alternative text. The file name is: %s"),r.media_details.sizes?.full?.file||r.slug)),(0,P.createElement)(_.MediaUploadCheck,{fallback:Wi},(0,P.createElement)(_.MediaUpload,{title:s?.labels?.featured_image||ji,onSelect:n,unstableFeaturedImageFlow:!0,allowedTypes:Gi,modalClass:"editor-post-featured-image__media-modal",render:({open:e})=>(0,P.createElement)("div",{className:"editor-post-featured-image__container"},(0,P.createElement)(fr.Button,{ref:l,className:t?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:e,"aria-label":t?(0,g.__)("Edit or replace the image"):null,"aria-describedby":t?`editor-post-featured-image-${t}-describedby`:null},!!t&&r&&(0,P.createElement)("img",{className:"editor-post-featured-image__preview-image",src:m,alt:""}),c&&(0,P.createElement)(fr.Spinner,null),!t&&!c&&(s?.labels?.set_featured_image||$i)),!!t&&(0,P.createElement)(fr.__experimentalHStack,{className:"editor-post-featured-image__actions"},(0,P.createElement)(fr.Button,{className:"editor-post-featured-image__action",onClick:e},(0,g.__)("Replace")),(0,P.createElement)(fr.Button,{className:"editor-post-featured-image__action",onClick:()=>{o(),l.current.focus()}},(0,g.__)("Remove"))),(0,P.createElement)(fr.DropZone,{onFilesDrop:h})),value:t}))))})),qi="featured-image";function Qi({withPanelBody:e=!0}){var t;const{postType:n,isEnabled:o,isOpened:r}=(0,u.useSelect)((e=>{const{getEditedPostAttribute:t,isEditorPanelEnabled:n,isEditorPanelOpened:o}=e(tr),{getPostType:r}=e(h.store);return{postType:r(t("type")),isEnabled:n(qi),isOpened:o(qi)}}),[]),{toggleEditorPanelOpened:s}=(0,u.useDispatch)(tr);return o?e?(0,P.createElement)(zi,null,(0,P.createElement)(fr.PanelBody,{title:null!==(t=n?.labels?.featured_image)&&void 0!==t?t:(0,g.__)("Featured image"),opened:r,onToggle:()=>s(qi)},(0,P.createElement)(Yi,null))):(0,P.createElement)(zi,null,(0,P.createElement)(Yi,null)):null}const Xi=function({children:e}){return(0,u.useSelect)((e=>e(tr).getEditorSettings().disablePostFormats),[])?null:(0,P.createElement)(ia,{supportKeys:"post-formats"},e)},Ji=[{id:"aside",caption:(0,g.__)("Aside")},{id:"audio",caption:(0,g.__)("Audio")},{id:"chat",caption:(0,g.__)("Chat")},{id:"gallery",caption:(0,g.__)("Gallery")},{id:"image",caption:(0,g.__)("Image")},{id:"link",caption:(0,g.__)("Link")},{id:"quote",caption:(0,g.__)("Quote")},{id:"standard",caption:(0,g.__)("Standard")},{id:"status",caption:(0,g.__)("Status")},{id:"video",caption:(0,g.__)("Video")}].sort(((e,t)=>{const n=e.caption.toUpperCase(),o=t.caption.toUpperCase();return no?1:0}));function el(){const e=`post-format-selector-${(0,rr.useInstanceId)(el)}`,{postFormat:t,suggestedFormat:n,supportedFormats:o}=(0,u.useSelect)((e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:n}=e(tr),o=t("format"),r=e(h.store).getThemeSupports();return{postFormat:null!=o?o:"standard",suggestedFormat:n(),supportedFormats:r.formats}}),[]),r=Ji.filter((e=>o?.includes(e.id)||t===e.id)),s=r.find((e=>e.id===n)),{editPost:a}=(0,u.useDispatch)(tr),i=e=>a({format:e});return(0,P.createElement)(Xi,null,(0,P.createElement)("div",{className:"editor-post-format"},(0,P.createElement)(fr.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,g.__)("Post Format"),value:t,onChange:e=>i(e),id:e,options:r.map((e=>({label:e.caption,value:e.id})))}),s&&s.id!==t&&(0,P.createElement)("p",{className:"editor-post-format__suggestion"},(0,P.createElement)(fr.Button,{variant:"link",onClick:()=>i(s.id)},(0,g.sprintf)((0,g.__)("Apply suggested format: %s"),s.caption)))))}const tl=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.Path,{d:"M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z"}));const nl=function({children:e}){const{lastRevisionId:t,revisionsCount:n}=(0,u.useSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:n}=e(tr);return{lastRevisionId:t(),revisionsCount:n()}}),[]);return!t||n<2?null:(0,P.createElement)(ia,{supportKeys:"revisions"},e)};const ol=function(){const{lastRevisionId:e,revisionsCount:t}=(0,u.useSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:n}=e(tr);return{lastRevisionId:t(),revisionsCount:n()}}),[]);return(0,P.createElement)(nl,null,(0,P.createElement)(fr.Button,{href:(0,v.addQueryArgs)("revision.php",{revision:e}),className:"editor-post-last-revision__title",icon:tl,iconPosition:"right",text:(0,g.sprintf)((0,g.__)("Revisions (%s)"),t)}))};const rl=function(){return(0,P.createElement)(nl,null,(0,P.createElement)(fr.PanelBody,{className:"editor-post-last-revision__panel"},(0,P.createElement)(ol,null)))};function sl(){const e="core/editor/post-locked-modal-"+(0,rr.useInstanceId)(sl),{autosave:t,updatePostLock:n}=(0,u.useDispatch)(tr),{isLocked:o,isTakeover:r,user:s,postId:a,postLockUtils:i,activePostLock:l,postType:c,previewLink:d}=(0,u.useSelect)((e=>{const{isPostLocked:t,isPostLockTakeover:n,getPostLockUser:o,getCurrentPostId:r,getActivePostLock:s,getEditedPostAttribute:a,getEditedPostPreviewLink:i,getEditorSettings:l}=e(tr),{getPostType:c}=e(h.store);return{isLocked:t(),isTakeover:n(),user:o(),postId:r(),postLockUtils:l().postLockUtils,activePostLock:s(),postType:c(a("type")),previewLink:i()}}),[]);if((0,S.useEffect)((()=>{function r(){if(o||!l)return;const e=new window.FormData;if(e.append("action","wp-remove-post-lock"),e.append("_wpnonce",i.unlockNonce),e.append("post_ID",a),e.append("active_post_lock",l),window.navigator.sendBeacon)window.navigator.sendBeacon(i.ajaxUrl,e);else{const t=new window.XMLHttpRequest;t.open("POST",i.ajaxUrl,!1),t.send(e)}}return(0,gn.addAction)("heartbeat.send",e,(function(e){o||(e["wp-refresh-post-lock"]={lock:l,post_id:a})})),(0,gn.addAction)("heartbeat.tick",e,(function(e){if(!e["wp-refresh-post-lock"])return;const o=e["wp-refresh-post-lock"];o.lock_error?(t(),n({isLocked:!0,isTakeover:!0,user:{name:o.lock_error.name,avatar:o.lock_error.avatar_src_2x}})):o.new_lock&&n({isLocked:!1,activePostLock:o.new_lock})})),window.addEventListener("beforeunload",r),()=>{(0,gn.removeAction)("heartbeat.send",e),(0,gn.removeAction)("heartbeat.tick",e),window.removeEventListener("beforeunload",r)}}),[]),!o)return null;const p=s.name,m=s.avatar,_=(0,v.addQueryArgs)("post.php",{"get-post-lock":"1",lockKey:!0,post:a,action:"edit",_wpnonce:i.nonce}),b=(0,v.addQueryArgs)("edit.php",{post_type:c?.slug}),f=(0,g.__)("Exit editor");return(0,P.createElement)(fr.Modal,{title:r?(0,g.__)("Someone else has taken over this post"):(0,g.__)("This post is already being edited"),focusOnMount:!0,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,isDismissible:!1,size:"medium"},(0,P.createElement)(fr.__experimentalHStack,{alignment:"top",spacing:6},!!m&&(0,P.createElement)("img",{src:m,alt:(0,g.__)("Avatar"),className:"editor-post-locked-modal__avatar",width:64,height:64}),(0,P.createElement)("div",null,!!r&&(0,P.createElement)("p",null,(0,S.createInterpolateElement)(p?(0,g.sprintf)((0,g.__)("%s now has editing control of this post (). Don’t worry, your changes up to this moment have been saved."),p):(0,g.__)("Another user now has editing control of this post (). Don’t worry, your changes up to this moment have been saved."),{strong:(0,P.createElement)("strong",null),PreviewLink:(0,P.createElement)(fr.ExternalLink,{href:d},(0,g.__)("preview"))})),!r&&(0,P.createElement)(P.Fragment,null,(0,P.createElement)("p",null,(0,S.createInterpolateElement)(p?(0,g.sprintf)((0,g.__)("%s is currently working on this post (), which means you cannot make changes, unless you take over."),p):(0,g.__)("Another user is currently working on this post (), which means you cannot make changes, unless you take over."),{strong:(0,P.createElement)("strong",null),PreviewLink:(0,P.createElement)(fr.ExternalLink,{href:d},(0,g.__)("preview"))})),(0,P.createElement)("p",null,(0,g.__)("If you take over, the other user will lose editing control to the post, but their changes will be saved."))),(0,P.createElement)(fr.__experimentalHStack,{className:"editor-post-locked-modal__buttons",justify:"flex-end"},!r&&(0,P.createElement)(fr.Button,{variant:"tertiary",href:_},(0,g.__)("Take over")),(0,P.createElement)(fr.Button,{variant:"primary",href:b},f)))))}const al=function({children:e}){const{hasPublishAction:t,isPublished:n}=(0,u.useSelect)((e=>{var t;const{isCurrentPostPublished:n,getCurrentPost:o}=e(tr);return{hasPublishAction:null!==(t=o()._links?.["wp:action-publish"])&&void 0!==t&&t,isPublished:n()}}),[]);return n||!t?null:e};const il=function(){const e=(0,u.useSelect)((e=>e(tr).getEditedPostAttribute("status")),[]),{editPost:t}=(0,u.useDispatch)(tr);return(0,P.createElement)(al,null,(0,P.createElement)(fr.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,g.__)("Pending review"),checked:"pending"===e,onChange:()=>{t({status:"pending"===e?"draft":"pending"})}}))};function ll({className:e,textContent:t,forceIsAutosaveable:n,role:o,onPreview:r}){const{postId:s,currentPostLink:a,previewLink:i,isSaveable:l,isViewable:c}=(0,u.useSelect)((e=>{var t;const n=e(tr),o=e(h.store).getPostType(n.getCurrentPostType("type"));return{postId:n.getCurrentPostId(),currentPostLink:n.getCurrentPostAttribute("link"),previewLink:n.getEditedPostPreviewLink(),isSaveable:n.isEditedPostSaveable(),isViewable:null!==(t=o?.viewable)&&void 0!==t&&t}}),[]),{__unstableSaveForPreview:d}=(0,u.useDispatch)(tr);if(!c)return null;const p=`wp-preview-${s}`,m=i||a;return(0,P.createElement)(fr.Button,{variant:e?void 0:"tertiary",className:e||"editor-post-preview",href:m,target:p,disabled:!l,onClick:async e=>{e.preventDefault();const t=window.open("",p);t.focus(),function(e){let t=(0,S.renderToString)((0,P.createElement)("div",{className:"editor-post-preview-button__interstitial-message"},(0,P.createElement)(fr.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 96 96"},(0,P.createElement)(fr.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,P.createElement)(fr.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,P.createElement)("p",null,(0,g.__)("Generating preview…"))));t+='\n\t\t\n\t',t=(0,gn.applyFilters)("editor.PostPreview.interstitialMarkup",t),e.write(t),e.title=(0,g.__)("Generating preview…"),e.close()}(t.document);const o=await d({forceIsAutosaveable:n});t.location=o,r?.()},role:o,size:"compact"},t||(0,P.createElement)(P.Fragment,null,(0,g._x)("Preview","imperative verb"),(0,P.createElement)(fr.VisuallyHidden,{as:"span"},(0,g.__)("(opens in a new tab)"))))}function cl(){const e=(0,rr.useViewportMatch)("medium","<"),{isPublished:t,isBeingScheduled:n,isSaving:o,isPublishing:r,hasPublishAction:s,isAutosaving:a,hasNonPostEntityChanges:i,postStatusHasChanged:l,postStatus:c}=(0,u.useSelect)((e=>{var t;const{isCurrentPostPublished:n,isEditedPostBeingScheduled:o,isSavingPost:r,isPublishingPost:s,getCurrentPost:a,getCurrentPostType:i,isAutosavingPost:l,getPostEdits:c,getEditedPostAttribute:u}=e(tr);return{isPublished:n(),isBeingScheduled:o(),isSaving:r(),isPublishing:s(),hasPublishAction:null!==(t=a()._links?.["wp:action-publish"])&&void 0!==t&&t,postType:i(),isAutosaving:l(),hasNonPostEntityChanges:e(tr).hasNonPostEntityChanges(),postStatusHasChanged:!!c()?.status,postStatus:u("status")}}),[]);return r?(0,g.__)("Publishing…"):(t||n)&&o&&!a?(0,g.__)("Saving…"):s?i||t||l&&!["future","publish"].includes(c)||!l&&"future"===c?(0,g.__)("Save"):n?(0,g.__)("Schedule"):(0,g.__)("Publish"):e?(0,g.__)("Publish"):(0,g.__)("Submit for Review")}const ul=()=>{};class dl extends S.Component{constructor(e){super(e),this.buttonNode=(0,S.createRef)(),this.createOnClick=this.createOnClick.bind(this),this.closeEntitiesSavedStates=this.closeEntitiesSavedStates.bind(this),this.state={entitiesSavedStatesCallback:!1}}componentDidMount(){this.props.focusOnMount&&(this.timeoutID=setTimeout((()=>{this.buttonNode.current.focus()}),0))}componentWillUnmount(){clearTimeout(this.timeoutID)}createOnClick(e){return(...t)=>{const{hasNonPostEntityChanges:n,setEntitiesSavedStatesCallback:o}=this.props;return n&&o?(this.setState({entitiesSavedStatesCallback:()=>e(...t)}),o((()=>this.closeEntitiesSavedStates)),ul):e(...t)}}closeEntitiesSavedStates(e){const{postType:t,postId:n}=this.props,{entitiesSavedStatesCallback:o}=this.state;this.setState({entitiesSavedStatesCallback:!1},(()=>{e&&e.some((e=>"postType"===e.kind&&e.name===t&&e.key===n))&&o()}))}render(){const{forceIsDirty:e,hasPublishAction:t,isBeingScheduled:n,isOpen:o,isPostSavingLocked:r,isPublishable:s,isPublished:a,isSaveable:i,isSaving:l,isAutoSaving:c,isToggle:u,savePostStatus:d,onSubmit:p=ul,onToggle:m,visibility:g,hasNonPostEntityChanges:_,isSavingNonPostEntityChanges:h,postStatus:b,postStatusHasChanged:f}=this.props,E=(l||!i||r||!s&&!e)&&(!_||h),y=(a||l||!i||!s&&!e)&&(!_||h);let v="publish";f?v=b:t?"private"===g?v="private":n&&(v="future"):v="pending";const k={"aria-disabled":E,className:"editor-post-publish-button",isBusy:!c&&l,variant:"primary",onClick:this.createOnClick((()=>{E||(p(),d(v))}))},w={"aria-disabled":y,"aria-expanded":o,className:"editor-post-publish-panel__toggle",isBusy:l&&a,variant:"primary",size:"compact",onClick:this.createOnClick((()=>{y||m()}))},S=u?w:k;return(0,P.createElement)(P.Fragment,null,(0,P.createElement)(fr.Button,{ref:this.buttonNode,...S,className:`${S.className} editor-post-publish-button__button`,size:"compact"},(0,P.createElement)(cl,null)))}}const pl=(0,rr.compose)([(0,u.withSelect)((e=>{var t;const{isSavingPost:n,isAutosavingPost:o,isEditedPostBeingScheduled:r,getEditedPostVisibility:s,isCurrentPostPublished:a,isEditedPostSaveable:i,isEditedPostPublishable:l,isPostSavingLocked:c,getCurrentPost:u,getCurrentPostType:d,getCurrentPostId:p,hasNonPostEntityChanges:m,isSavingNonPostEntityChanges:g,getEditedPostAttribute:_,getPostEdits:h}=e(tr);return{isSaving:n(),isAutoSaving:o(),isBeingScheduled:r(),visibility:s(),isSaveable:i(),isPostSavingLocked:c(),isPublishable:l(),isPublished:a(),hasPublishAction:null!==(t=u()._links?.["wp:action-publish"])&&void 0!==t&&t,postType:d(),postId:p(),postStatus:_("status"),postStatusHasChanged:h()?.status,hasNonPostEntityChanges:m(),isSavingNonPostEntityChanges:g()}})),(0,u.withDispatch)((e=>{const{editPost:t,savePost:n}=e(tr);return{savePostStatus:e=>{t({status:e},{undoIgnore:!0}),n()}}}))])(dl),ml=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,P.createElement)(C.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"})),gl={public:{label:(0,g.__)("Public"),info:(0,g.__)("Visible to everyone.")},private:{label:(0,g.__)("Private"),info:(0,g.__)("Only visible to site admins and editors.")},password:{label:(0,g.__)("Password protected"),info:(0,g.__)("Only those with the password can view this post.")}};function _l({onClose:e}){const t=(0,rr.useInstanceId)(_l),{status:n,visibility:o,password:r}=(0,u.useSelect)((e=>({status:e(tr).getEditedPostAttribute("status"),visibility:e(tr).getEditedPostVisibility(),password:e(tr).getEditedPostAttribute("password")}))),{editPost:s,savePost:a}=(0,u.useDispatch)(tr),[i,l]=(0,S.useState)(!!r),[c,d]=(0,S.useState)(!1);return(0,P.createElement)("div",{className:"editor-post-visibility"},(0,P.createElement)(_.__experimentalInspectorPopoverHeader,{title:(0,g.__)("Visibility"),help:(0,g.__)("Control how this post is viewed."),onClose:e}),(0,P.createElement)("fieldset",{className:"editor-post-visibility__fieldset"},(0,P.createElement)(fr.VisuallyHidden,{as:"legend"},(0,g.__)("Visibility")),(0,P.createElement)(hl,{instanceId:t,value:"public",label:gl.public.label,info:gl.public.info,checked:"public"===o&&!i,onChange:()=>{s({status:"private"===o?"draft":n,password:""}),l(!1)}}),(0,P.createElement)(hl,{instanceId:t,value:"private",label:gl.private.label,info:gl.private.info,checked:"private"===o,onChange:()=>{d(!0)}}),(0,P.createElement)(hl,{instanceId:t,value:"password",label:gl.password.label,info:gl.password.info,checked:i,onChange:()=>{s({status:"private"===o?"draft":n,password:r||""}),l(!0)}}),i&&(0,P.createElement)("div",{className:"editor-post-visibility__password"},(0,P.createElement)(fr.VisuallyHidden,{as:"label",htmlFor:`editor-post-visibility__password-input-${t}`},(0,g.__)("Create password")),(0,P.createElement)("input",{className:"editor-post-visibility__password-input",id:`editor-post-visibility__password-input-${t}`,type:"text",onChange:e=>{s({password:e.target.value})},value:r,placeholder:(0,g.__)("Use a secure password")}))),(0,P.createElement)(fr.__experimentalConfirmDialog,{isOpen:c,onConfirm:()=>{s({status:"private",password:""}),l(!1),d(!1),a()},onCancel:()=>{d(!1)},confirmButtonText:(0,g.__)("Publish")},(0,g.__)("Would you like to privately publish this post now?")))}function hl({instanceId:e,value:t,label:n,info:o,...r}){return(0,P.createElement)("div",{className:"editor-post-visibility__choice"},(0,P.createElement)("input",{type:"radio",name:`editor-post-visibility__setting-${e}`,value:t,id:`editor-post-${t}-${e}`,"aria-describedby":`editor-post-${t}-${e}-description`,className:"editor-post-visibility__radio",...r}),(0,P.createElement)("label",{htmlFor:`editor-post-${t}-${e}`,className:"editor-post-visibility__label"},n),(0,P.createElement)("p",{id:`editor-post-${t}-${e}-description`,className:"editor-post-visibility__info"},o))}function bl(){return fl()}function fl(){const e=(0,u.useSelect)((e=>e(tr).getEditedPostVisibility()));return gl[e]?.label}function El(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 yl(e){const t=El(e);return t.setDate(1),t.setHours(0,0,0,0),t}function vl(e){const t=El(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}Math.pow(10,8);const kl=6e4,wl=36e5;function Sl(e,t){const n=t?.additionalDigits??2,o=function(e){const t={},n=e.split(Pl.dateTimeDelimiter);let o;if(n.length>2)return t;/:/.test(n[0])?o=n[0]:(t.date=n[0],o=n[1],Pl.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Pl.timeZoneDelimiter)[0],o=e.substr(t.date.length,e.length)));if(o){const e=Pl.timezone.exec(o);e?(t.time=o.replace(e[1],""),t.timezone=e[1]):t.time=o}return t}(e);let r;if(o.date){const e=function(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),o=e.match(n);if(!o)return{year:NaN,restDateString:""};const r=o[1]?parseInt(o[1]):null,s=o[2]?parseInt(o[2]):null;return{year:null===s?r:100*s,restDateString:e.slice((o[1]||o[2]).length)}}(o.date,n);r=function(e,t){if(null===t)return new Date(NaN);const n=e.match(Cl);if(!n)return new Date(NaN);const o=!!n[4],r=Il(n[1]),s=Il(n[2])-1,a=Il(n[3]),i=Il(n[4]),l=Il(n[5])-1;if(o)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,i,l)?function(e,t,n){const o=new Date(0);o.setUTCFullYear(e,0,4);const r=o.getUTCDay()||7,s=7*(t-1)+n+1-r;return o.setUTCDate(o.getUTCDate()+s),o}(t,i,l):new Date(NaN);{const e=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(Nl[t]||(Al(e)?29:28))}(t,s,a)&&function(e,t){return t>=1&&t<=(Al(e)?366:365)}(t,r)?(e.setUTCFullYear(t,s,Math.max(r,a)),e):new Date(NaN)}}(e.restDateString,e.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);const s=r.getTime();let a,i=0;if(o.time&&(i=function(e){const t=e.match(Tl);if(!t)return NaN;const n=Bl(t[1]),o=Bl(t[2]),r=Bl(t[3]);if(!function(e,t,n){if(24===e)return 0===t&&0===n;return n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,o,r))return NaN;return n*wl+o*kl+1e3*r}(o.time),isNaN(i)))return new Date(NaN);if(!o.timezone){const e=new Date(s+i),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 a=function(e){if("Z"===e)return 0;const t=e.match(xl);if(!t)return 0;const n="+"===t[1]?-1:1,o=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;if(!function(e,t){return t>=0&&t<=59}(0,r))return NaN;return n*(o*wl+r*kl)}(o.timezone),isNaN(a)?new Date(NaN):new Date(s+i+a)}const Pl={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Cl=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Tl=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,xl=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Il(e){return e?parseInt(e):1}function Bl(e){return e&&parseFloat(e.replace(",","."))||0}const Nl=[31,null,31,30,31,30,31,31,30,31,30,31];function Al(e){return e%400==0||e%4==0&&e%100!=0}function Dl({onClose:e}){const{postDate:t,postType:n}=(0,u.useSelect)((e=>({postDate:e(tr).getEditedPostAttribute("date"),postType:e(tr).getCurrentPostType()})),[]),{editPost:o}=(0,u.useDispatch)(tr),[r,s]=(0,S.useState)(yl(new Date(t))),a=(0,u.useSelect)((e=>e(h.store).getEntityRecords("postType",n,{status:"publish,future",after:yl(r).toISOString(),before:vl(r).toISOString(),exclude:[e(tr).getCurrentPostId()],per_page:100,_fields:"id,date"})),[r,n]),i=(0,S.useMemo)((()=>(a||[]).map((({date:e})=>({date:new Date(e)})))),[a]),l=(0,y.getSettings)(),c=/a(?!\\)/i.test(l.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,P.createElement)(_.__experimentalPublishDateTimePicker,{currentDate:t,onChange:e=>o({date:e}),is12Hour:c,events:i,onMonthPreviewed:e=>s(Sl(e)),onClose:e})}function Rl(e){return Ml(e)}function Ml({full:e=!1}={}){const{date:t,isFloating:n}=(0,u.useSelect)((e=>({date:e(tr).getEditedPostAttribute("date"),isFloating:e(tr).isEditedPostDateFloating()})),[]);return e?Ll(t):function(e,{isFloating:t=!1,now:n=new Date}={}){if(!e||t)return(0,g.__)("Immediately");if(!function(e){const{timezone:t}=(0,y.getSettings)(),n=Number(t.offset),o=e.getTimezoneOffset()/60*-1;return n===o}(n))return Ll(e);const o=(0,y.getDate)(e);if(Ol(o,n))return(0,g.sprintf)((0,g.__)("Today at %s"),(0,y.dateI18n)((0,g._x)("g:i a","post schedule time format"),o));const r=new Date(n);if(r.setDate(r.getDate()+1),Ol(o,r))return(0,g.sprintf)((0,g.__)("Tomorrow at %s"),(0,y.dateI18n)((0,g._x)("g:i a","post schedule time format"),o));if(o.getFullYear()===n.getFullYear())return(0,y.dateI18n)((0,g._x)("F j g:i a","post schedule date format without year"),o);return(0,y.dateI18n)((0,g._x)("F j, Y g:i a","post schedule full date format"),o)}(t,{isFloating:n})}function Ll(e){const t=(0,y.getDate)(e),n=function(){const{timezone:e}=(0,y.getSettings)();if(e.abbr&&isNaN(Number(e.abbr)))return e.abbr;const t=e.offset<0?"":"+";return`UTC${t}${e.offsetFormatted}`}(),o=(0,y.dateI18n)((0,g._x)("F j, Y g:i a","post schedule full date format"),t);return(0,g.isRTL)()?`${n} ${o}`:`${o} ${n}`}function Ol(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}const Fl=3,Vl={per_page:10,orderby:"count",order:"desc",hide_empty:!0,_fields:"id,name,count",context:"view"};function Ul({onSelect:e,taxonomy:t}){const{_terms:n,showTerms:o}=(0,u.useSelect)((e=>{const n=e(h.store).getEntityRecords("taxonomy",t.slug,Vl);return{_terms:n,showTerms:n?.length>=Fl}}),[t.slug]);if(!o)return null;const r=_a(n);return(0,P.createElement)("div",{className:"editor-post-taxonomies__flat-term-most-used"},(0,P.createElement)(fr.BaseControl.VisualLabel,{as:"h3",className:"editor-post-taxonomies__flat-term-most-used-label"},t.labels.most_used),(0,P.createElement)("ul",{role:"list",className:"editor-post-taxonomies__flat-term-most-used-list"},r.map((t=>(0,P.createElement)("li",{key:t.id},(0,P.createElement)(fr.Button,{variant:"link",onClick:()=>e(t)},t.name))))))}const Hl=[],zl=20,Gl={per_page:zl,_fields:"id,name",context:"view"},jl=(e,t)=>ma(e).toLowerCase()===ma(t).toLowerCase(),$l=(e,t)=>e.map((e=>t.find((t=>jl(t.name,e)))?.id)).filter((e=>void 0!==e));function Wl({slug:e}){var t,n;const[o,r]=(0,S.useState)([]),[s,a]=(0,S.useState)(""),i=(0,rr.useDebounce)(a,500),{terms:l,termIds:c,taxonomy:d,hasAssignAction:p,hasCreateAction:m,hasResolvedTerms:_}=(0,u.useSelect)((t=>{var n,o;const{getCurrentPost:r,getEditedPostAttribute:s}=t(tr),{getEntityRecords:a,getTaxonomy:i,hasFinishedResolution:l}=t(h.store),c=r(),u=i(e),d=u?s(u.rest_base):Hl,p={...Gl,include:d.join(","),per_page:-1};return{hasCreateAction:!!u&&(null!==(n=c._links?.["wp:action-create-"+u.rest_base])&&void 0!==n&&n),hasAssignAction:!!u&&(null!==(o=c._links?.["wp:action-assign-"+u.rest_base])&&void 0!==o&&o),taxonomy:u,termIds:d,terms:d.length?a("taxonomy",e,p):Hl,hasResolvedTerms:l("getEntityRecords",["taxonomy",e,p])}}),[e]),{searchResults:b}=(0,u.useSelect)((t=>{const{getEntityRecords:n}=t(h.store);return{searchResults:s?n("taxonomy",e,{...Gl,search:s}):Hl}}),[s,e]);(0,S.useEffect)((()=>{if(_){const e=(null!=l?l:[]).map((e=>ma(e.name)));r(e)}}),[l,_]);const f=(0,S.useMemo)((()=>(null!=b?b:[]).map((e=>ma(e.name)))),[b]),{editPost:E}=(0,u.useDispatch)(tr),{saveEntityRecord:y}=(0,u.useDispatch)(h.store),{createErrorNotice:v}=(0,u.useDispatch)(mn.store);if(!p)return null;function k(e){E({[d.rest_base]:e})}const w=null!==(t=d?.labels?.add_new_item)&&void 0!==t?t:"post_tag"===e?(0,g.__)("Add new tag"):(0,g.__)("Add new Term"),C=null!==(n=d?.labels?.singular_name)&&void 0!==n?n:"post_tag"===e?(0,g.__)("Tag"):(0,g.__)("Term"),T=(0,g.sprintf)((0,g._x)("%s added","term"),C),x=(0,g.sprintf)((0,g._x)("%s removed","term"),C),I=(0,g.sprintf)((0,g._x)("Remove %s","term"),C);return(0,P.createElement)(P.Fragment,null,(0,P.createElement)(fr.FormTokenField,{__next40pxDefaultSize:!0,value:o,suggestions:f,onChange:function(t){const n=[...null!=l?l:[],...null!=b?b:[]],o=t.reduce(((e,t)=>(e.some((e=>e.toLowerCase()===t.toLowerCase()))||e.push(t),e)),[]),s=o.filter((e=>!n.find((t=>jl(t.name,e)))));r(o),0!==s.length?m&&Promise.all(s.map((t=>async function(t){try{const n=await y("taxonomy",e,t,{throwOnError:!0});return ga(n)}catch(e){if("term_exists"!==e.code)throw e;return{id:e.data.term_id,name:t.name}}}({name:t})))).then((e=>{const t=n.concat(e);k($l(o,t))})).catch((e=>{v(e.message,{type:"snackbar"}),k($l(o,n))})):k($l(o,n))},onInputChange:i,maxSuggestions:zl,label:w,messages:{added:T,removed:x,remove:I}}),(0,P.createElement)(Ul,{taxonomy:d,onSelect:function(t){var n;if(c.includes(t.id))return;const o=[...c,t.id],r="post_tag"===e?(0,g.__)("Tag"):(0,g.__)("Term"),s=(0,g.sprintf)((0,g._x)("%s added","term"),null!==(n=d?.labels?.singular_name)&&void 0!==n?n:r);(0,un.speak)(s,"assertive"),k(o)}}))}const Kl=(0,fr.withFilters)("editor.PostTaxonomyType")(Wl),Zl=()=>{const e=[(0,g.__)("Suggestion:"),(0,P.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,g.__)("Add tags"))];return(0,P.createElement)(fr.PanelBody,{initialOpen:!1,title:e},(0,P.createElement)("p",null,(0,g.__)("Tags help users and search engines navigate your site and find your content. Add a few keywords to describe your post.")),(0,P.createElement)(Kl,{slug:"post_tag"}))},Yl=()=>{const{hasTags:e,isPostTypeSupported:t}=(0,u.useSelect)((e=>{const t=e(tr).getCurrentPostType(),n=e(h.store).getTaxonomy("post_tag"),o=n?.types?.includes(t),r=void 0!==n,s=n&&e(tr).getEditedPostAttribute(n.rest_base);return{hasTags:!!s?.length,isPostTypeSupported:r&&o}}),[]),[n]=(0,S.useState)(e);return t?n?null:(0,P.createElement)(Zl,null):null},ql=(e,t)=>Ji.filter((t=>e?.includes(t.id))).find((e=>e.id===t)),Ql=({suggestedPostFormat:e,suggestionText:t,onUpdatePostFormat:n})=>(0,P.createElement)(fr.Button,{variant:"link",onClick:()=>n(e)},t);function Xl(){const{currentPostFormat:e,suggestion:t}=(0,u.useSelect)((e=>{var t;const{getEditedPostAttribute:n,getSuggestedPostFormat:o}=e(tr),r=null!==(t=e(h.store).getThemeSupports().formats)&&void 0!==t?t:[];return{currentPostFormat:n("format"),suggestion:ql(r,o())}}),[]),{editPost:n}=(0,u.useDispatch)(tr),o=[(0,g.__)("Suggestion:"),(0,P.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,g.__)("Use a post format"))];return t&&t.id!==e?(0,P.createElement)(fr.PanelBody,{initialOpen:!1,title:o},(0,P.createElement)("p",null,(0,g.__)("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,P.createElement)("p",null,(0,P.createElement)(Ql,{onUpdatePostFormat:e=>n({format:e}),suggestedPostFormat:t.id,suggestionText:(0,g.sprintf)((0,g.__)('Apply the "%1$s" format.'),t.caption)}))):null}const Jl={per_page:-1,orderby:"name",order:"asc",_fields:"id,name,parent",context:"view"},ec=8,tc=[];function nc({slug:e}){var t,n;const[o,r]=(0,S.useState)(!1),[s,a]=(0,S.useState)(""),[i,l]=(0,S.useState)(""),[c,d]=(0,S.useState)(!1),[p,m]=(0,S.useState)(""),[_,b]=(0,S.useState)([]),f=(0,rr.useDebounce)(un.speak,500),{hasCreateAction:E,hasAssignAction:y,terms:v,loading:k,availableTerms:w,taxonomy:C}=(0,u.useSelect)((t=>{var n,o;const{getCurrentPost:r,getEditedPostAttribute:s}=t(tr),{getTaxonomy:a,getEntityRecords:i,isResolving:l}=t(h.store),c=a(e),u=r();return{hasCreateAction:!!c&&(null!==(n=u._links?.["wp:action-create-"+c.rest_base])&&void 0!==n&&n),hasAssignAction:!!c&&(null!==(o=u._links?.["wp:action-assign-"+c.rest_base])&&void 0!==o&&o),terms:c?s(c.rest_base):tc,loading:l("getEntityRecords",["taxonomy",e,Jl]),availableTerms:i("taxonomy",e,Jl)||tc,taxonomy:c}}),[e]),{editPost:T}=(0,u.useDispatch)(tr),{saveEntityRecord:x}=(0,u.useDispatch)(h.store),I=(0,S.useMemo)((()=>function(e,t){const n=e=>-1!==t.indexOf(e.id)||void 0!==e.children&&e.children.map(n).filter((e=>e)).length>0,o=[...e];return o.sort(((e,t)=>{const o=n(e),r=n(t);return o===r?0:o&&!r?-1:!o&&r?1:0})),o}(pa(w),v)),[w]),{createErrorNotice:B}=(0,u.useDispatch)(mn.store);if(!y)return null;const N=e=>{T({[C.rest_base]:e})},A=e=>e.map((e=>(0,P.createElement)("div",{key:e.id,className:"editor-post-taxonomies__hierarchical-terms-choice"},(0,P.createElement)(fr.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:-1!==v.indexOf(e.id),onChange:()=>{(e=>{const t=v.includes(e)?v.filter((t=>t!==e)):[...v,e];N(t)})(parseInt(e.id,10))},label:(0,Ao.decodeEntities)(e.name)}),!!e.children.length&&(0,P.createElement)("div",{className:"editor-post-taxonomies__hierarchical-terms-subchoices"},A(e.children))))),D=(t,n,o)=>{var r;return null!==(r=C?.labels?.[t])&&void 0!==r?r:"category"===e?n:o},R=D("add_new_item",(0,g.__)("Add new category"),(0,g.__)("Add new term")),M=D("new_item_name",(0,g.__)("Add new category"),(0,g.__)("Add new term")),L=D("parent_item",(0,g.__)("Parent Category"),(0,g.__)("Parent Term")),O=`— ${L} —`,F=R,V=null!==(t=C?.labels?.search_items)&&void 0!==t?t:(0,g.__)("Search Terms"),U=null!==(n=C?.name)&&void 0!==n?n:(0,g.__)("Terms"),H=w.length>=ec;return(0,P.createElement)(fr.Flex,{direction:"column",gap:"4"},H&&(0,P.createElement)(fr.TextControl,{__nextHasNoMarginBottom:!0,label:V,value:p,onChange:e=>{const t=I.map(function(e){const t=n=>{if(""===e)return n;const o={...n};return o.children.length>0&&(o.children=o.children.map(t).filter((e=>e))),(-1!==o.name.toLowerCase().indexOf(e.toLowerCase())||o.children.length>0)&&o};return t}(e)).filter((e=>e)),n=e=>{let t=0;for(let o=0;o{d(!c)},className:"editor-post-taxonomies__hierarchical-terms-add","aria-expanded":c,variant:"link"},R)),c&&(0,P.createElement)("form",{onSubmit:async t=>{var n;if(t.preventDefault(),""===s||o)return;const c=function(e,t,n){return e.find((e=>(!e.parent&&!t||parseInt(e.parent)===parseInt(t))&&e.name.toLowerCase()===n.toLowerCase()))}(w,i,s);if(c)return v.some((e=>e===c.id))||N([...v,c.id]),a(""),void l("");let u;r(!0);try{u=await(d={name:s,parent:i||void 0},x("taxonomy",e,d,{throwOnError:!0}))}catch(e){return void B(e.message,{type:"snackbar"})}var d;const p="category"===e?(0,g.__)("Category"):(0,g.__)("Term"),m=(0,g.sprintf)((0,g._x)("%s added","term"),null!==(n=C?.labels?.singular_name)&&void 0!==n?n:p);(0,un.speak)(m,"assertive"),r(!1),a(""),l(""),N([...v,u.id])}},(0,P.createElement)(fr.Flex,{direction:"column",gap:"4"},(0,P.createElement)(fr.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"editor-post-taxonomies__hierarchical-terms-input",label:M,value:s,onChange:e=>{a(e)},required:!0}),!!w.length&&(0,P.createElement)(fr.TreeSelect,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:L,noOptionLabel:O,onChange:e=>{l(e)},selectedId:i,tree:I}),(0,P.createElement)(fr.FlexItem,null,(0,P.createElement)(fr.Button,{__next40pxDefaultSize:!0,variant:"secondary",type:"submit",className:"editor-post-taxonomies__hierarchical-terms-submit"},F)))))}const oc=(0,fr.withFilters)("editor.PostTaxonomyType")(nc);const rc=function(){const e=(0,u.useSelect)((e=>{const t=e(tr).getCurrentPostType(),{canUser:n,getEntityRecord:o,getTaxonomy:r}=e(h.store),s=r("category"),a=n("read","settings")?o("root","site")?.default_category:void 0,i=a?o("taxonomy","category",a):void 0,l=s&&s.types.some((e=>e===t)),c=s&&e(tr).getEditedPostAttribute(s.rest_base);return!!s&&!!i&&l&&(0===c?.length||1===c?.length&&i?.id===c[0])}),[]),[t,n]=(0,S.useState)(!1);if((0,S.useEffect)((()=>{e&&n(!0)}),[e]),!t)return null;const o=[(0,g.__)("Suggestion:"),(0,P.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,g.__)("Assign a category"))];return(0,P.createElement)(fr.PanelBody,{initialOpen:!1,title:o},(0,P.createElement)("p",null,(0,g.__)("Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.")),(0,P.createElement)(oc,{slug:"category"}))};function sc(e){const t=[];return e.forEach((e=>{t.push(e),t.push(...sc(e.innerBlocks))})),t}function ac(e){const{selectBlock:t}=(0,u.useDispatch)(_.store);return(0,P.createElement)(fr.__unstableMotion.img,{tabIndex:0,role:"button","aria-label":(0,g.__)("Select image block."),onClick:()=>{t(e.clientId)},onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||(t(e.clientId),n.preventDefault())},key:e.clientId,alt:e.attributes.alt,src:e.attributes.url,animate:{opacity:1},exit:{opacity:0,scale:0},style:{width:"36px",height:"36px",objectFit:"cover",borderRadius:"2px",cursor:"pointer"},whileHover:{scale:1.08}})}function ic(){const[e,t]=(0,S.useState)(!1),{editorBlocks:n,mediaUpload:o}=(0,u.useSelect)((e=>({editorBlocks:e(tr).getEditorBlocks(),mediaUpload:e(_.store).getSettings().mediaUpload})),[]),r=sc(n).filter((e=>"core/image"===e.name&&e.attributes.url&&!e.attributes.id)),{updateBlockAttributes:s}=(0,u.useDispatch)(_.store);if(!o||!r.length)return null;const a=[(0,g.__)("Suggestion:"),(0,P.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,g.__)("External media"))];return(0,P.createElement)(fr.PanelBody,{initialOpen:!0,title:a},(0,P.createElement)("p",null,(0,g.__)("Upload external images to the Media Library. Images from different domains may load slowly, display incorrectly, or be removed unexpectedly.")),(0,P.createElement)("div",{style:{display:"inline-flex",flexWrap:"wrap",gap:"8px"}},(0,P.createElement)(fr.__unstableAnimatePresence,null,r.map((e=>(0,P.createElement)(ac,{key:e.clientId,...e})))),e?(0,P.createElement)(fr.Spinner,null):(0,P.createElement)(fr.Button,{variant:"primary",onClick:function(){t(!0),Promise.all(r.map((e=>window.fetch(e.attributes.url.includes("?")?e.attributes.url:e.attributes.url+"?").then((e=>e.blob())).then((t=>new Promise(((n,r)=>{o({filesList:[t],onFileChange:([t])=>{(0,Ui.isBlobURL)(t.url)||(s(e.clientId,{id:t.id,url:t.url}),n())},onError(){r()}})}))))))).finally((()=>{t(!1)}))}},(0,g.__)("Upload"))))}const lc=function({children:e}){const{isBeingScheduled:t,isRequestingSiteIcon:n,hasPublishAction:o,siteIconUrl:r,siteTitle:s,siteHome:a}=(0,u.useSelect)((e=>{var t;const{getCurrentPost:n,isEditedPostBeingScheduled:o}=e(tr),{getEntityRecord:r,isResolving:s}=e(h.store),a=r("root","__unstableBase",void 0)||{};return{hasPublishAction:null!==(t=n()._links?.["wp:action-publish"])&&void 0!==t&&t,isBeingScheduled:o(),isRequestingSiteIcon:s("getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:a.site_icon_url,siteTitle:a.name,siteHome:a.home&&(0,v.filterURLForDisplay)(a.home)}}),[]);let i,l,c=(0,P.createElement)(fr.Icon,{className:"components-site-icon",size:"36px",icon:ml});return r&&(c=(0,P.createElement)("img",{alt:(0,g.__)("Site Icon"),className:"components-site-icon",src:r})),n&&(c=null),o?t?(i=(0,g.__)("Are you ready to schedule?"),l=(0,g.__)("Your work will be published at the specified date and time.")):(i=(0,g.__)("Are you ready to publish?"),l=(0,g.__)("Double-check your settings before publishing.")):(i=(0,g.__)("Are you ready to submit for review?"),l=(0,g.__)("When you’re ready, submit your work for review, and an Editor will be able to approve it for you.")),(0,P.createElement)("div",{className:"editor-post-publish-panel__prepublish"},(0,P.createElement)("div",null,(0,P.createElement)("strong",null,i)),(0,P.createElement)("p",null,l),(0,P.createElement)("div",{className:"components-site-card"},c,(0,P.createElement)("div",{className:"components-site-info"},(0,P.createElement)("span",{className:"components-site-name"},(0,Ao.decodeEntities)(s)||(0,g.__)("(Untitled)")),(0,P.createElement)("span",{className:"components-site-home"},a))),(0,P.createElement)(ic,null),o&&(0,P.createElement)(P.Fragment,null,(0,P.createElement)(fr.PanelBody,{initialOpen:!1,title:[(0,g.__)("Visibility:"),(0,P.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,P.createElement)(bl,null))]},(0,P.createElement)(_l,null)),(0,P.createElement)(fr.PanelBody,{initialOpen:!1,title:[(0,g.__)("Publish:"),(0,P.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,P.createElement)(Rl,null))]},(0,P.createElement)(Dl,null))),(0,P.createElement)(Xl,null),(0,P.createElement)(Yl,null),(0,P.createElement)(rc,null),e)},cc="%postname%",uc="%pagename%";function dc({text:e,onCopy:t,children:n}){const o=(0,rr.useCopyToClipboard)(e,t);return(0,P.createElement)(fr.Button,{variant:"secondary",ref:o},n)}class pc extends S.Component{constructor(){super(...arguments),this.state={showCopyConfirmation:!1},this.onCopy=this.onCopy.bind(this),this.onSelectInput=this.onSelectInput.bind(this),this.postLink=(0,S.createRef)()}componentDidMount(){this.props.focusOnMount&&this.postLink.current.focus()}componentWillUnmount(){clearTimeout(this.dismissCopyConfirmation)}onCopy(){this.setState({showCopyConfirmation:!0}),clearTimeout(this.dismissCopyConfirmation),this.dismissCopyConfirmation=setTimeout((()=>{this.setState({showCopyConfirmation:!1})}),4e3)}onSelectInput(e){e.target.select()}render(){const{children:e,isScheduled:t,post:n,postType:o}=this.props,r=o?.labels?.singular_name,s=o?.labels?.view_item,a=o?.labels?.add_new_item,i="future"===n.status?(e=>{const{slug:t}=e;return e.permalink_template.includes(cc)?e.permalink_template.replace(cc,t):e.permalink_template.includes(uc)?e.permalink_template.replace(uc,t):e.permalink_template})(n):n.link,l=(0,v.addQueryArgs)("post-new.php",{post_type:n.type}),c=t?(0,P.createElement)(P.Fragment,null,(0,g.__)("is now scheduled. It will go live on")," ",(0,P.createElement)(Rl,null),"."):(0,g.__)("is now live.");return(0,P.createElement)("div",{className:"post-publish-panel__postpublish"},(0,P.createElement)(fr.PanelBody,{className:"post-publish-panel__postpublish-header"},(0,P.createElement)("a",{ref:this.postLink,href:i},(0,Ao.decodeEntities)(n.title)||(0,g.__)("(no title)"))," ",c),(0,P.createElement)(fr.PanelBody,null,(0,P.createElement)("p",{className:"post-publish-panel__postpublish-subheader"},(0,P.createElement)("strong",null,(0,g.__)("What’s next?"))),(0,P.createElement)("div",{className:"post-publish-panel__postpublish-post-address-container"},(0,P.createElement)(fr.TextControl,{__nextHasNoMarginBottom:!0,className:"post-publish-panel__postpublish-post-address",readOnly:!0,label:(0,g.sprintf)((0,g.__)("%s address"),r),value:(0,v.safeDecodeURIComponent)(i),onFocus:this.onSelectInput}),(0,P.createElement)("div",{className:"post-publish-panel__postpublish-post-address__copy-button-wrap"},(0,P.createElement)(dc,{text:i,onCopy:this.onCopy},this.state.showCopyConfirmation?(0,g.__)("Copied!"):(0,g.__)("Copy")))),(0,P.createElement)("div",{className:"post-publish-panel__postpublish-buttons"},!t&&(0,P.createElement)(fr.Button,{variant:"primary",href:i},s),(0,P.createElement)(fr.Button,{variant:t?"primary":"secondary",href:l},a))),e)}}const mc=(0,u.withSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPost:n,isCurrentPostScheduled:o}=e(tr),{getPostType:r}=e(h.store);return{post:n(),postType:r(t("type")),isScheduled:o()}}))(pc);class gc extends S.Component{constructor(){super(...arguments),this.onSubmit=this.onSubmit.bind(this)}componentDidUpdate(e){e.isPublished&&!this.props.isSaving&&this.props.isDirty&&this.props.onClose()}onSubmit(){const{onClose:e,hasPublishAction:t,isPostTypeViewable:n}=this.props;t&&n||e()}render(){const{forceIsDirty:e,isBeingScheduled:t,isPublished:n,isPublishSidebarEnabled:o,isScheduled:r,isSaving:s,isSavingNonPostEntityChanges:a,onClose:i,onTogglePublishSidebar:l,PostPublishExtension:c,PrePublishExtension:u,...d}=this.props,{hasPublishAction:p,isDirty:m,isPostTypeViewable:_,...h}=d,b=n||r&&t,f=!b&&!s,E=b&&!s;return(0,P.createElement)("div",{className:"editor-post-publish-panel",...h},(0,P.createElement)("div",{className:"editor-post-publish-panel__header"},E?(0,P.createElement)(fr.Button,{onClick:i,icon:wr,label:(0,g.__)("Close panel")}):(0,P.createElement)(P.Fragment,null,(0,P.createElement)("div",{className:"editor-post-publish-panel__header-publish-button"},(0,P.createElement)(pl,{focusOnMount:!0,onSubmit:this.onSubmit,forceIsDirty:e})),(0,P.createElement)("div",{className:"editor-post-publish-panel__header-cancel-button"},(0,P.createElement)(fr.Button,{disabled:a,onClick:i,variant:"secondary"},(0,g.__)("Cancel"))))),(0,P.createElement)("div",{className:"editor-post-publish-panel__content"},f&&(0,P.createElement)(lc,null,u&&(0,P.createElement)(u,null)),E&&(0,P.createElement)(mc,{focusOnMount:!0},c&&(0,P.createElement)(c,null)),s&&(0,P.createElement)(fr.Spinner,null)),(0,P.createElement)("div",{className:"editor-post-publish-panel__footer"},(0,P.createElement)(fr.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,g.__)("Always show pre-publish checks."),checked:o,onChange:l})))}}const _c=(0,rr.compose)([(0,u.withSelect)((e=>{var t;const{getPostType:n}=e(h.store),{getCurrentPost:o,getEditedPostAttribute:r,isCurrentPostPublished:s,isCurrentPostScheduled:a,isEditedPostBeingScheduled:i,isEditedPostDirty:l,isAutosavingPost:c,isSavingPost:u,isSavingNonPostEntityChanges:d}=e(tr),{isPublishSidebarEnabled:p}=e(tr),m=n(r("type"));return{hasPublishAction:null!==(t=o()._links?.["wp:action-publish"])&&void 0!==t&&t,isPostTypeViewable:m?.viewable,isBeingScheduled:i(),isDirty:l(),isPublished:s(),isPublishSidebarEnabled:p(),isSaving:u()&&!c(),isSavingNonPostEntityChanges:d(),isScheduled:a()}})),(0,u.withDispatch)(((e,{isPublishSidebarEnabled:t})=>{const{disablePublishSidebar:n,enablePublishSidebar:o}=e(tr);return{onTogglePublishSidebar:()=>{t?n():o()}}})),fr.withFocusReturn,fr.withConstrainedTabbing])(gc),hc=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.Path,{d:"M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-4v-2.4L14 14l1-1-3-3-3 3 1 1 1.2-1.2v2.4H7.7c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4H9l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8 0 1-.8 1.8-1.7 1.8z"}));const bc=(0,S.forwardRef)((function({icon:e,size:t=24,...n},o){return(0,S.cloneElement)(e,{width:t,height:t,...n,ref:o})})),fc=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.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 Ec({forceIsDirty:e}){const[t,n]=(0,S.useState)(!1),o=(0,rr.useViewportMatch)("small"),{isAutosaving:r,isDirty:s,isNew:a,isPublished:i,isSaveable:l,isSaving:c,isScheduled:d,hasPublishAction:p,showIconLabels:m,postStatus:_,postStatusHasChanged:h}=(0,u.useSelect)((t=>{var n;const{isEditedPostNew:o,isCurrentPostPublished:r,isCurrentPostScheduled:s,isEditedPostDirty:a,isSavingPost:i,isEditedPostSaveable:l,getCurrentPost:c,isAutosavingPost:u,getEditedPostAttribute:d,getPostEdits:p}=t(tr),{get:m}=t(x.store);return{isAutosaving:u(),isDirty:e||a(),isNew:o(),isPublished:r(),isSaving:i(),isSaveable:l(),isScheduled:s(),hasPublishAction:null!==(n=c()?._links?.["wp:action-publish"])&&void 0!==n&&n,showIconLabels:m("core","showIconLabels"),postStatus:d("status"),postStatusHasChanged:!!p()?.status}}),[e]),b="pending"===_,{savePost:f}=(0,u.useDispatch)(tr),E=(0,rr.usePrevious)(c);if((0,S.useEffect)((()=>{let e;return E&&!c&&(n(!0),e=setTimeout((()=>{n(!1)}),1e3)),()=>clearTimeout(e)}),[c]),!p&&b)return null;if(i||d||!["pending","draft","auto-draft"].includes(_)||h&&["pending","draft"].includes(_))return null;const y=b?(0,g.__)("Save as pending"):(0,g.__)("Save draft"),v=(0,g.__)("Save"),k=t||!a&&!s,w=c||k,C=c||k||!l;let T;return c?T=r?(0,g.__)("Autosaving"):(0,g.__)("Saving"):k?T=(0,g.__)("Saved"):o?T=y:m&&(T=v),(0,P.createElement)(fr.Button,{className:l||c?br({"editor-post-save-draft":!w,"editor-post-saved-state":w,"is-saving":c,"is-autosaving":r,"is-saved":k,[(0,fr.__unstableGetAnimateClassName)({type:"loading"})]:c}):void 0,onClick:C?void 0:()=>f(),shortcut:C?void 0:_s.displayShortcut.primary("s"),variant:"tertiary",size:"compact",icon:o?void 0:hc,label:T||y,"aria-disabled":C},w&&(0,P.createElement)(bc,{icon:k?Er:fc}),T)}function yc({children:e}){return(0,u.useSelect)((e=>{var t;return null!==(t=e(tr).getCurrentPost()._links?.["wp:action-publish"])&&void 0!==t&&t}),[])?e:null}const vc=[M,L,O,F];function kc(){const[e,t]=(0,S.useState)(null),n=(0,u.useSelect)((e=>e(tr).getCurrentPostType()),[]),o=(0,S.useMemo)((()=>({anchor:e,"aria-label":(0,g.__)("Change publish date"),placement:"bottom-end"})),[e]),r=Ml(),s=Ml({full:!0});return vc.includes(n)?null:(0,P.createElement)(yc,null,(0,P.createElement)(pi,{label:(0,g.__)("Publish"),ref:t},(0,P.createElement)(fr.Dropdown,{popoverProps:o,focusOnMount:!0,className:"editor-post-schedule__panel-dropdown",contentClassName:"editor-post-schedule__dialog",renderToggle:({onToggle:e,isOpen:t})=>(0,P.createElement)(fr.Button,{size:"compact",className:"editor-post-schedule__dialog-toggle",variant:"tertiary",onClick:e,"aria-label":(0,g.sprintf)((0,g.__)("Change date: %s"),r),label:s,showTooltip:r!==s,"aria-expanded":t},r),renderContent:({onClose:e})=>(0,P.createElement)(Dl,{onClose:e})})))}function wc({children:e}){return(0,P.createElement)(ia,{supportKeys:"slug"},e)}function Sc(){const e=(0,u.useSelect)((e=>(0,v.safeDecodeURIComponent)(e(tr).getEditedPostSlug())),[]),{editPost:t}=(0,u.useDispatch)(tr),[n,o]=(0,S.useState)(!1);return(0,P.createElement)(fr.TextControl,{__nextHasNoMarginBottom:!0,label:(0,g.__)("Slug"),autoComplete:"off",spellCheck:"false",value:n?"":e,onChange:e=>{t({slug:e}),e?n&&o(!1):n||o(!0)},onBlur:e=>{t({slug:(0,v.cleanForSlug)(e.target.value)}),n&&o(!1)},className:"editor-post-slug"})}function Pc(){return(0,P.createElement)(wc,null,(0,P.createElement)(Sc,null))}function Cc({children:e}){const{hasStickyAction:t,postType:n}=(0,u.useSelect)((e=>{var t;const n=e(tr).getCurrentPost();return{hasStickyAction:null!==(t=n._links?.["wp:action-sticky"])&&void 0!==t&&t,postType:e(tr).getCurrentPostType()}}),[]);return"post"===n&&t?e:null}function Tc(){const e=(0,u.useSelect)((e=>{var t;return null!==(t=e(tr).getEditedPostAttribute("sticky"))&&void 0!==t&&t}),[]),{editPost:t}=(0,u.useDispatch)(tr);return(0,P.createElement)(Cc,null,(0,P.createElement)(fr.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,g.__)("Stick to the top of the blog"),checked:e,onChange:()=>t({sticky:!e})}))}function xc(){const[e,t]=(0,S.useState)(!1),{editPost:n,savePost:o}=(0,u.useDispatch)(tr),{isSaving:r,isPublished:s,isScheduled:a}=(0,u.useSelect)((e=>{const{isSavingPost:t,isCurrentPostPublished:n,isCurrentPostScheduled:o}=e(tr);return{isSaving:t(),isPublished:n(),isScheduled:o()}}),[]),i=r||!s&&!a;let l,c;s?(l=(0,g.__)("Are you sure you want to unpublish this post?"),c=(0,g.__)("Unpublish")):a&&(l=(0,g.__)("Are you sure you want to unschedule this post?"),c=(0,g.__)("Unschedule"));return(0,P.createElement)(P.Fragment,null,(0,P.createElement)(fr.Button,{__next40pxDefaultSize:!0,className:"editor-post-switch-to-draft",onClick:()=>{i||t(!0)},"aria-disabled":i,variant:"secondary",style:{flexGrow:"1",justifyContent:"center"}},(0,g.__)("Switch to draft")),(0,P.createElement)(fr.__experimentalConfirmDialog,{isOpen:e,onConfirm:()=>{t(!1),n({status:"draft"}),o()},onCancel:()=>t(!1),confirmButtonText:c},l))}function Ic(){const{syncStatus:e,postType:t}=(0,u.useSelect)((e=>{const{getEditedPostAttribute:t}=e(tr),n=t("meta");return{syncStatus:"unsynced"===n?.wp_pattern_sync_status?"unsynced":t("wp_pattern_sync_status"),postType:t("type")}}));return"wp_block"!==t?null:(0,P.createElement)(pi,{label:(0,g.__)("Sync status")},(0,P.createElement)("div",{className:"editor-post-sync-status__value"},"unsynced"===e?(0,g._x)("Not synced","Text that indicates that the pattern is not synchronized"):(0,g._x)("Synced","Text that indicates that the pattern is synchronized")))}const Bc=e=>e;const Nc=function({taxonomyWrapper:e=Bc}){const{postType:t,taxonomies:n}=(0,u.useSelect)((e=>({postType:e(tr).getCurrentPostType(),taxonomies:e(h.store).getTaxonomies({per_page:-1})})),[]);return(null!=n?n:[]).filter((e=>e.types.includes(t)&&e.visibility?.show_ui)).map((t=>{const n=t.hierarchical?oc:Kl;return(0,P.createElement)(S.Fragment,{key:`taxonomy-${t.slug}`},e((0,P.createElement)(n,{slug:t.slug}),t))}))};function Ac({children:e}){const t=(0,u.useSelect)((e=>{const t=e(tr).getCurrentPostType(),n=e(h.store).getTaxonomies({per_page:-1});return n?.some((e=>e.types.includes(t)))}),[]);return t?e:null}function Dc({taxonomy:e,children:t}){const n=e?.slug,o=n?`taxonomy-panel-${n}`:"",{isEnabled:r,isOpened:s}=(0,u.useSelect)((e=>{const{isEditorPanelEnabled:t,isEditorPanelOpened:r}=e(tr);return{isEnabled:!!n&&t(o),isOpened:!!n&&r(o)}}),[o,n]),{toggleEditorPanelOpened:a}=(0,u.useDispatch)(tr);if(!r)return null;const i=e?.labels?.menu_name;return i?(0,P.createElement)(fr.PanelBody,{title:i,opened:s,onToggle:()=>a(o)},t):null}const Rc=function(){return(0,P.createElement)(Ac,null,(0,P.createElement)(Nc,{taxonomyWrapper:(e,t)=>(0,P.createElement)(Dc,{taxonomy:t},e)}))};var Mc=n(4132);function Lc(){const e=(0,rr.useInstanceId)(Lc),{content:t,blocks:n,type:o,id:r}=(0,u.useSelect)((e=>{const{getEditedEntityRecord:t}=e(h.store),{getCurrentPostType:n,getCurrentPostId:o}=e(tr),r=n(),s=o(),a=t("postType",r,s);return{content:a?.content,blocks:a?.blocks,type:r,id:s}}),[]),{editEntityRecord:s}=(0,u.useDispatch)(h.store),a=(0,S.useMemo)((()=>t instanceof Function?t({blocks:n}):n?(0,c.__unstableSerializeAndClean)(n):t),[t,n]);return(0,P.createElement)(P.Fragment,null,(0,P.createElement)(fr.VisuallyHidden,{as:"label",htmlFor:`post-content-${e}`},(0,g.__)("Type text or HTML")),(0,P.createElement)(Mc.A,{autoComplete:"off",dir:"auto",value:a,onChange:e=>{s("postType",o,r,{content:e.target.value,blocks:void 0,selection:void 0})},className:"editor-post-text-editor",id:`post-content-${e}`,placeholder:(0,g.__)("Start writing with text or HTML")}))}const Oc=window.wp.dom,Fc="wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text",Vc=/[\r\n]+/g;function Uc(e){const t=(0,S.useRef)(),{isCleanNewPost:n}=(0,u.useSelect)((e=>{const{isCleanNewPost:t}=e(tr);return{isCleanNewPost:t()}}),[]);return(0,S.useImperativeHandle)(e,(()=>({focus:()=>{t?.current?.focus()}}))),(0,S.useEffect)((()=>{if(!t.current)return;const{defaultView:e}=t.current.ownerDocument,{name:o,parent:r}=e,s="editor-canvas"===o?r.document:e.document,{activeElement:a,body:i}=s;!n||a&&i!==a||t.current.focus()}),[n]),{ref:t}}function Hc(){const{editPost:e}=(0,u.useDispatch)(tr),{title:t}=(0,u.useSelect)((e=>{const{getEditedPostAttribute:t}=e(tr);return{title:t("title")}}),[]);return{title:t,setTitle:function(t){e({title:t})}}}const zc=(0,S.forwardRef)((function(e,t){const{placeholder:n,hasFixedToolbar:o}=(0,u.useSelect)((e=>{const{getSettings:t}=e(_.store),{titlePlaceholder:n,hasFixedToolbar:o}=t();return{placeholder:n,hasFixedToolbar:o}}),[]),[r,s]=(0,S.useState)(!1),{ref:a}=Uc(t),{title:i,setTitle:l}=Hc(),[d,p]=(0,S.useState)({}),{clearSelectedBlock:m,insertBlocks:h,insertDefaultBlock:b}=(0,u.useDispatch)(_.store);function f(e){h(e,0)}function E(){s(!1),p({})}const y=(0,Ao.decodeEntities)(n)||(0,g.__)("Add title"),{ref:v}=(0,ks.__unstableUseRichText)({value:i,onChange:function(e){l(e.replace(Vc," "))},placeholder:y,selectionStart:d.start,selectionEnd:d.end,onSelectionChange(e,t){p((n=>{const{start:o,end:r}=n;return o===e&&r===t?n:{start:e,end:t}}))},__unstableDisableFormats:!1}),k=br(Fc,{"is-selected":r,"has-fixed-toolbar":o});return(0,P.createElement)(ia,{supportKeys:"title"},(0,P.createElement)("h1",{ref:(0,rr.useMergeRefs)([v,a]),contentEditable:!0,className:k,"aria-label":y,role:"textbox","aria-multiline":"true",onFocus:function(){s(!0),m()},onBlur:E,onKeyDown:function(e){e.keyCode===_s.ENTER&&(e.preventDefault(),b(void 0,void 0,0))},onKeyPress:E,onPaste:function(e){const t=e.clipboardData;let n="",o="";try{n=t.getData("text/plain"),o=t.getData("text/html")}catch(e){try{o=t.getData("Text")}catch(e){return}}window.console.log("Received HTML:\n\n",o),window.console.log("Received plain text:\n\n",n);const r=(0,c.pasteHandler)({HTML:o,plainText:n});if(e.preventDefault(),r.length)if("string"!=typeof r){const[e]=r;if(i||"core/heading"!==e.name&&"core/paragraph"!==e.name)f(r);else{const t=(0,Oc.__unstableStripHTML)(e.attributes.content);l(t),f(r.slice(1))}}else{const e={...(0,ks.create)({html:i}),...d},t=(0,Oc.__unstableStripHTML)(r),n=(0,ks.insert)(e,(0,ks.create)({html:t}));l((0,ks.toHTMLString)({value:n})),p({start:n.start,end:n.end})}}}))}));const Gc=(0,S.forwardRef)((function(e,t){const{placeholder:n,hasFixedToolbar:o}=(0,u.useSelect)((e=>{const{getSettings:t}=e(_.store),{titlePlaceholder:n,hasFixedToolbar:o}=t();return{placeholder:n,hasFixedToolbar:o}}),[]),[r,s]=(0,S.useState)(!1),{title:a,setTitle:i}=Hc(),{ref:l}=Uc(t),c=br(Fc,{"is-selected":r,"has-fixed-toolbar":o,"is-raw-text":!0}),d=(0,Ao.decodeEntities)(n)||(0,g.__)("Add title");return(0,P.createElement)(fr.TextareaControl,{ref:l,value:a,onChange:function(e){i(e.replace(Vc," "))},onFocus:function(){s(!0)},onBlur:function(){s(!1)},label:n,className:c,placeholder:d,hideLabelFromVision:!0,autoComplete:"off",dir:"auto",rows:1,__nextHasNoMarginBottom:!0})}));function jc(){const{isNew:e,isDeleting:t,postId:n}=(0,u.useSelect)((e=>{const t=e(tr);return{isNew:t.isEditedPostNew(),isDeleting:t.isDeletingPost(),postId:t.getCurrentPostId()}}),[]),{trashPost:o}=(0,u.useDispatch)(tr),[r,s]=(0,S.useState)(!1);if(e||!n)return null;return(0,P.createElement)(P.Fragment,null,(0,P.createElement)(fr.Button,{__next40pxDefaultSize:!0,className:"editor-post-trash",isDestructive:!0,variant:"secondary",isBusy:t,"aria-disabled":t,onClick:t?void 0:()=>s(!0)},(0,g.__)("Move to trash")),(0,P.createElement)(fr.__experimentalConfirmDialog,{isOpen:r,onConfirm:()=>{s(!1),o()},onCancel:()=>s(!1),confirmButtonText:(0,g.__)("Move to trash")},(0,g.__)("Are you sure you want to move this post to the trash?")))}function $c({children:e}){const{canTrashPost:t}=(0,u.useSelect)((e=>{const{isEditedPostNew:t,getCurrentPostId:n,getCurrentPostType:o}=e(tr),{getPostType:r,canUser:s}=e(h.store),a=r(o()),i=n(),l=t(),c=a?.rest_base||"",u=!(!i||!c)&&s("delete",c,i);return{canTrashPost:(!l||i)&&u}}),[]);return t?e:null}const Wc=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.625 5.5h9.75c.069 0 .125.056.125.125v9.75a.125.125 0 0 1-.125.125h-9.75a.125.125 0 0 1-.125-.125v-9.75c0-.069.056-.125.125-.125ZM4 5.625C4 4.728 4.728 4 5.625 4h9.75C16.273 4 17 4.728 17 5.625v9.75c0 .898-.727 1.625-1.625 1.625h-9.75A1.625 1.625 0 0 1 4 15.375v-9.75Zm14.5 11.656v-9H20v9C20 18.8 18.77 20 17.251 20H6.25v-1.5h11.001c.69 0 1.249-.528 1.249-1.219Z"}));function Kc(){return Zc()}function Zc(){const e=(0,u.useSelect)((e=>e(tr).getPermalink()),[]);return(0,v.filterURLForDisplay)((0,v.safeDecodeURIComponent)(e))}function Yc({onClose:e}){const{isEditable:t,postSlug:n,postLink:o,permalinkPrefix:r,permalinkSuffix:s}=(0,u.useSelect)((e=>{var t;const n=e(tr).getCurrentPost(),o=e(tr).getCurrentPostType(),r=e(h.store).getPostType(o),s=e(tr).getPermalinkParts(),a=null!==(t=n?._links?.["wp:action-publish"])&&void 0!==t&&t;return{isEditable:e(tr).isPermalinkEditable()&&a,postSlug:(0,v.safeDecodeURIComponent)(e(tr).getEditedPostSlug()),viewPostLabel:r?.labels.view_item,postLink:n.link,permalinkPrefix:s?.prefix,permalinkSuffix:s?.suffix}}),[]),{editPost:a}=(0,u.useDispatch)(tr),{createNotice:i}=(0,u.useDispatch)(mn.store),[l,c]=(0,S.useState)(!1),d=Zc(),p=(0,rr.useCopyToClipboard)(d,(()=>{i("info",(0,g.__)("Copied URL to clipboard."),{isDismissible:!0,type:"snackbar"})}));return(0,P.createElement)("div",{className:"editor-post-url"},(0,P.createElement)(_.__experimentalInspectorPopoverHeader,{title:(0,g.__)("Link"),onClose:e}),(0,P.createElement)(fr.__experimentalVStack,{spacing:3},t&&(0,P.createElement)("div",null,(0,g.__)("Customize the last part of the URL. "),(0,P.createElement)(fr.ExternalLink,{href:(0,g.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink")},(0,g.__)("Learn more."))),(0,P.createElement)("div",null,t&&(0,P.createElement)(fr.__experimentalInputControl,{__next40pxDefaultSize:!0,prefix:(0,P.createElement)(fr.__experimentalInputControlPrefixWrapper,null,"/"),suffix:(0,P.createElement)(fr.Button,{icon:Wc,ref:p,label:(0,g.__)("Copy")}),label:(0,g.__)("Link"),hideLabelFromVision:!0,value:l?"":n,autoComplete:"off",spellCheck:"false",type:"text",className:"editor-post-url__input",onChange:e=>{a({slug:e}),e?l&&c(!1):l||c(!0)},onBlur:e=>{a({slug:(0,v.cleanForSlug)(e.target.value)}),l&&c(!1)},help:(0,P.createElement)(fr.ExternalLink,{className:"editor-post-url__link",href:o,target:"_blank"},(0,P.createElement)("span",{className:"editor-post-url__link-prefix"},r),(0,P.createElement)("span",{className:"editor-post-url__link-slug"},n),(0,P.createElement)("span",{className:"editor-post-url__link-suffix"},s))}),!t&&(0,P.createElement)(fr.ExternalLink,{className:"editor-post-url__link",href:o,target:"_blank"},o))))}function qc({children:e}){const t=(0,u.useSelect)((e=>{const t=e(tr).getCurrentPostType(),n=e(h.store).getPostType(t);if(!n?.viewable)return!1;if(!e(tr).getCurrentPost().link)return!1;return!!e(tr).getPermalinkParts()}),[]);return t?e:null}function Qc(){const[e,t]=(0,S.useState)(null),n=(0,S.useMemo)((()=>({anchor:e,placement:"left-start",offset:36,shift:!0})),[e]);return(0,P.createElement)(qc,null,(0,P.createElement)(pi,{label:(0,g.__)("Link"),ref:t},(0,P.createElement)(fr.Dropdown,{popoverProps:n,className:"editor-post-url__panel-dropdown",contentClassName:"editor-post-url__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,P.createElement)(Xc,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,P.createElement)(Yc,{onClose:e})})))}function Xc({isOpen:e,onClick:t}){const n=(0,u.useSelect)((e=>e(tr).getEditedPostSlug()),[]),o=(0,v.safeDecodeURIComponent)(n);return(0,P.createElement)(fr.Button,{size:"compact",className:"editor-post-url__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,g.sprintf)((0,g.__)("Change link: %s"),o),onClick:t},o)}function Jc({render:e}){return e({canEdit:(0,u.useSelect)((e=>{var t;return null!==(t=e(tr).getCurrentPost()._links?.["wp:action-publish"])&&void 0!==t&&t}))})}const eu=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})),tu=window.wp.wordcount;function nu(){const e=(0,u.useSelect)((e=>e(tr).getEditedPostAttribute("content")),[]),t=(0,g._x)("words","Word count type. Do not translate!");return(0,P.createElement)("span",{className:"word-count"},(0,tu.count)(e,t))}const ou=189;function ru(){const e=(0,u.useSelect)((e=>e(tr).getEditedPostAttribute("content")),[]),t=(0,g._x)("words","Word count type. Do not translate!"),n=Math.round((0,tu.count)(e,t)/ou),o=0===n?(0,S.createInterpolateElement)((0,g.__)("< 1 minute"),{span:(0,P.createElement)("span",null)}):(0,S.createInterpolateElement)((0,g.sprintf)((0,g._n)("%d minute","%d minutes",n),n),{span:(0,P.createElement)("span",null)});return(0,P.createElement)("span",{className:"time-to-read"},o)}function su(){const e=(0,u.useSelect)((e=>e(tr).getEditedPostAttribute("content")),[]);return(0,tu.count)(e,"characters_including_spaces")}const au=function({hasOutlineItemsDisabled:e,onRequestClose:t}){const{headingCount:n,paragraphCount:o,numberOfBlocks:r}=(0,u.useSelect)((e=>{const{getGlobalBlockCount:t}=e(_.store);return{headingCount:t("core/heading"),paragraphCount:t("core/paragraph"),numberOfBlocks:t()}}),[]);return(0,P.createElement)(P.Fragment,null,(0,P.createElement)("div",{className:"table-of-contents__wrapper",role:"note","aria-label":(0,g.__)("Document Statistics"),tabIndex:"0"},(0,P.createElement)("ul",{role:"list",className:"table-of-contents__counts"},(0,P.createElement)("li",{className:"table-of-contents__count"},(0,g.__)("Words"),(0,P.createElement)(nu,null)),(0,P.createElement)("li",{className:"table-of-contents__count"},(0,g.__)("Characters"),(0,P.createElement)("span",{className:"table-of-contents__number"},(0,P.createElement)(su,null))),(0,P.createElement)("li",{className:"table-of-contents__count"},(0,g.__)("Time to read"),(0,P.createElement)(ru,null)),(0,P.createElement)("li",{className:"table-of-contents__count"},(0,g.__)("Headings"),(0,P.createElement)("span",{className:"table-of-contents__number"},n)),(0,P.createElement)("li",{className:"table-of-contents__count"},(0,g.__)("Paragraphs"),(0,P.createElement)("span",{className:"table-of-contents__number"},o)),(0,P.createElement)("li",{className:"table-of-contents__count"},(0,g.__)("Blocks"),(0,P.createElement)("span",{className:"table-of-contents__number"},r)))),n>0&&(0,P.createElement)(P.Fragment,null,(0,P.createElement)("hr",null),(0,P.createElement)("h2",{className:"table-of-contents__title"},(0,g.__)("Document Outline")),(0,P.createElement)(Ns,{onSelect:t,hasOutlineItemsDisabled:e})))};const iu=(0,S.forwardRef)((function({hasOutlineItemsDisabled:e,repositionDropdown:t,...n},o){const r=(0,u.useSelect)((e=>!!e(_.store).getBlockCount()),[]);return(0,P.createElement)(fr.Dropdown,{popoverProps:{placement:t?"right":"bottom"},className:"table-of-contents",contentClassName:"table-of-contents__popover",renderToggle:({isOpen:e,onToggle:t})=>(0,P.createElement)(fr.Button,{...n,ref:o,onClick:r?t:void 0,icon:eu,"aria-expanded":e,"aria-haspopup":"true",label:(0,g.__)("Details"),tooltipPosition:"bottom","aria-disabled":!r}),renderContent:({onClose:t})=>(0,P.createElement)(au,{onRequestClose:t,hasOutlineItemsDisabled:e})})}));function lu(){const{__experimentalGetDirtyEntityRecords:e}=(0,u.useSelect)(h.store);return(0,S.useEffect)((()=>{const t=t=>{if(e().length>0)return t.returnValue=(0,g.__)("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 cu=(0,rr.createHigherOrderComponent)((e=>(0,u.withRegistry)((t=>{const{useSubRegistry:n=!0,registry:o,...r}=t;if(!n)return(0,P.createElement)(e,{...r});const[s,a]=(0,S.useState)(null);return(0,S.useEffect)((()=>{const e=(0,u.createRegistry)({"core/block-editor":_.storeConfig},o);e.registerStore("core/editor",er),a(e)}),[o]),s?(0,P.createElement)(u.RegistryProvider,{value:s},(0,P.createElement)(e,{...r})):null}))),"withRegistryProvider"),uu=(e,t)=>`${t}`,du=e=>`href="${e}" target="_blank" rel="noreferrer noopener"`,pu=e=>{const{title:t,foreign_landing_url:n,creator:o,creator_url:r,license:s,license_version:a,license_url:i}=e,l=((e,t)=>{let n=e.trim();return"pdm"!==e&&(n=e.toUpperCase().replace("SAMPLING","Sampling")),t&&(n+=` ${t}`),["pdm","cc0"].includes(e)||(n=`CC ${n}`),n})(s,a),c=(0,Ao.decodeEntities)(o);let u;return u=c?t?(0,g.sprintf)((0,g._x)('"%1$s" by %2$s/ %3$s',"caption"),uu(n,(0,Ao.decodeEntities)(t)),r?uu(r,c):c,i?uu(`${i}?ref=openverse`,l):l):(0,g.sprintf)((0,g._x)("Work by %2$s/ %3$s","caption"),du(n),r?uu(r,c):c,i?uu(`${i}?ref=openverse`,l):l):t?(0,g.sprintf)((0,g._x)('"%1$s"/ %2$s',"caption"),uu(n,(0,Ao.decodeEntities)(t)),i?uu(`${i}?ref=openverse`,l):l):(0,g.sprintf)((0,g._x)("Work/ %2$s","caption"),du(n),i?uu(`${i}?ref=openverse`,l):l),u.replace(/\s{2}/g," ")},mu=async(e={})=>(await(0,u.resolveSelect)(h.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}))),gu=[{name:"images",labels:{name:(0,g.__)("Images"),search_items:(0,g.__)("Search images")},mediaType:"image",fetch:async(e={})=>mu({...e,media_type:"image"})},{name:"videos",labels:{name:(0,g.__)("Videos"),search_items:(0,g.__)("Search videos")},mediaType:"video",fetch:async(e={})=>mu({...e,media_type:"video"})},{name:"audio",labels:{name:(0,g.__)("Audio"),search_items:(0,g.__)("Search audio")},mediaType:"audio",fetch:async(e={})=>mu({...e,media_type:"audio"})},{name:"openverse",labels:{name:(0,g.__)("Openverse"),search_items:(0,g.__)("Search Openverse")},mediaType:"image",async fetch(e={}){const t={...e,mature:!1,excluded_source:"flickr,inaturalist,wikimedia",license:"pdm,cc0"},n={per_page:"page_size",search:"q"},o=new URL("https://api.openverse.engineering/v1/images/");Object.entries(t).forEach((([e,t])=>{const r=n[e]||e;o.searchParams.set(r,t)}));const r=await window.fetch(o,{headers:{"User-Agent":"WordPress/inserter-media-fetch"}});return(await r.json()).results.map((e=>({...e,title:e.title?.toLowerCase().startsWith("file:")?e.title.slice(5):e.title,sourceId:e.id,id:void 0,caption:pu(e),previewUrl:e.thumbnail})))},getReportUrl:({sourceId:e})=>`https://wordpress.org/openverse/image/${e}/report/`,isExternalResource:!0}],_u=window.wp.mediaUtils,hu=()=>{};function bu({additionalData:e={},allowedTypes:t,filesList:n,maxUploadFileSize:o,onError:r=hu,onFileChange:s}){const{getCurrentPost:a,getEditorSettings:i}=(0,u.select)(tr),l=i().allowedMimeTypes;o=o||i().maxUploadFileSize;const c=a(),d="number"==typeof c?.id?c.id:c?.wp_id,p=d?{post:d}:{};(0,_u.uploadMedia)({allowedTypes:t,filesList:n,onFileChange:s,additionalData:{...p,...e},maxUploadFileSize:o,onError:({message:e})=>r(e),wpAllowedMimeTypes:l})}var fu=n(66),Eu=n.n(fu); /*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ function yu(e){return"[object Object]"===Object.prototype.toString.call(e)}function vu(e){var t,n;return!1!==yu(e)&&(void 0===(t=e.constructor)||!1!==yu(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}const{GlobalStylesContext:ku,cleanEmptyObject:wu}=m(_.privateApis);function Su(e,t){return Eu()(e,t,{isMergeableObject:vu})}function Pu(){const[e,t,n]=function(){const{globalStylesId:e,isReady:t,settings:n,styles:o}=(0,u.useSelect)((e=>{const{getEditedEntityRecord:t,hasFinishedResolution:n}=e(h.store),o=e(h.store).__experimentalGetCurrentGlobalStylesId(),r=o?t("root","globalStyles",o):void 0;let s=!1;return n("__experimentalGetCurrentGlobalStylesId")&&(s=!o||n("getEditedEntityRecord",["root","globalStyles",o])),{globalStylesId:o,isReady:s,settings:r?.settings,styles:r?.styles}}),[]),{getEditedEntityRecord:r}=(0,u.useSelect)(h.store),{editEntityRecord:s}=(0,u.useDispatch)(h.store);return[t,(0,S.useMemo)((()=>({settings:null!=n?n:{},styles:null!=o?o:{}})),[n,o]),(0,S.useCallback)(((t,n={})=>{var o,a;const i=r("root","globalStyles",e),l=t({styles:null!==(o=i?.styles)&&void 0!==o?o:{},settings:null!==(a=i?.settings)&&void 0!==a?a:{}});s("root","globalStyles",e,{styles:wu(l.styles)||{},settings:wu(l.settings)||{}},n)}),[e])]}(),[o,r]=function(){const e=(0,u.useSelect)((e=>e(h.store).__experimentalGetCurrentThemeBaseGlobalStyles()),[]);return[!!e,e]}(),s=(0,S.useMemo)((()=>r&&t?Su(r,t):{}),[t,r]);return(0,S.useMemo)((()=>({isReady:e&&o,user:t,base:r,merged:s,setUserConfig:n})),[s,t,r,n,e,o])}const Cu=[],Tu={};function xu(e){var t;return null!==(t=e(h.store).getEntityRecords("postType","wp_block",{per_page:-1}))&&void 0!==t?t:Cu}const Iu=["__experimentalBlockDirectory","__experimentalDiscussionSettings","__experimentalFeatures","__experimentalGlobalStylesBaseStyles","__unstableGalleryWithImageBlocks","alignWide","blockInspectorTabs","allowedMimeTypes","bodyPlaceholder","canLockBlocks","capabilities","clearBlockSelection","codeEditingEnabled","colors","disableCustomColors","disableCustomFontSizes","disableCustomSpacingSizes","disableCustomGradients","disableLayoutStyles","enableCustomLineHeight","enableCustomSpacing","enableCustomUnits","enableOpenverseMediaCategory","fontSizes","gradients","generateAnchors","onNavigateToEntityRecord","imageDefaultSize","imageDimensions","imageEditing","imageSizes","isRTL","locale","maxWidth","postContentAttributes","postsPerPage","readOnly","sectionRootClientId","styles","titlePlaceholder","supportsLayout","widgetTypesToHideFromLegacyWidgetBlock","__unstableHasCustomAppender","__unstableIsPreviewMode","__unstableResolvedAssets","__unstableIsBlockBasedTheme","__experimentalArchiveTitleTypeLabel","__experimentalArchiveTitleNameLabel"];const Bu=function(e,t,n,o){var r,s,a;const i=(0,rr.useViewportMatch)("medium"),{allowRightClickOverrides:l,blockTypes:d,focusMode:b,hasFixedToolbar:f,isDistractionFree:E,keepCaretInsideBlock:y,hasUploadPermissions:v,hiddenBlockTypes:k,canUseUnfilteredHTML:w,userCanCreatePages:P,pageOnFront:C,pageForPosts:T,userPatternCategories:I,restBlockPatternCategories:B,sectionRootClientId:N}=(0,u.useSelect)((e=>{var r;const{canUser:s,getRawEntityRecord:a,getEntityRecord:l,getUserPatternCategories:u,getBlockPatternCategories:d}=e(h.store),{get:p}=e(x.store),{getBlockTypes:m}=e(c.store),{getBlocksByName:g,getBlockAttributes:b}=e(_.store),f=s("read","settings")?l("root","site"):void 0;return{allowRightClickOverrides:p("core","allowRightClickOverrides"),blockTypes:m(),canUseUnfilteredHTML:a("postType",t,n)?._links?.hasOwnProperty("wp:action-unfiltered-html"),focusMode:p("core","focusMode"),hasFixedToolbar:p("core","fixedToolbar")||!i,hiddenBlockTypes:p("core","hiddenBlockTypes"),isDistractionFree:p("core","distractionFree"),keepCaretInsideBlock:p("core","keepCaretInsideBlock"),hasUploadPermissions:null===(r=s("create","media"))||void 0===r||r,userCanCreatePages:s("create","pages"),pageOnFront:f?.page_on_front,pageForPosts:f?.page_for_posts,userPatternCategories:u(),restBlockPatternCategories:d(),sectionRootClientId:"template-locked"===o?null!==(y=g("core/post-content")?.[0])&&void 0!==y?y:"":null!==(E=g("core/group").find((e=>"main"===b(e)?.tagName)))&&void 0!==E?E:""};var E,y}),[t,n,i,o]),{merged:A}=Pu(),D=null!==(r=A.styles)&&void 0!==r?r:Tu,R=null!==(s=e.__experimentalAdditionalBlockPatterns)&&void 0!==s?s:e.__experimentalBlockPatterns,M=null!==(a=e.__experimentalAdditionalBlockPatternCategories)&&void 0!==a?a:e.__experimentalBlockPatternCategories,L=(0,S.useMemo)((()=>[...R||[]].filter((({postTypes:e})=>!e||Array.isArray(e)&&e.includes(t)))),[R,t]),O=(0,S.useMemo)((()=>[...M||[],...B||[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name))))),[M,B]),{undo:F,setIsInserterOpened:V}=(0,u.useDispatch)(tr),{saveEntityRecord:U}=(0,u.useDispatch)(h.store),H=(0,S.useCallback)((e=>P?U("postType","page",e):Promise.reject({message:(0,g.__)("You do not have permission to create Pages.")})),[U,P]),z=(0,S.useMemo)((()=>{if(k&&k.length>0){return(!0===e.allowedBlockTypes?d.map((({name:e})=>e)):e.allowedBlockTypes||[]).filter((e=>!k.includes(e)))}return e.allowedBlockTypes}),[e.allowedBlockTypes,k,d]),G=!1===e.focusMode,{globalStylesDataKey:j,selectBlockPatternsKey:$}=m(_.privateApis);return(0,S.useMemo)((()=>{const n={...Object.fromEntries(Object.entries(e).filter((([e])=>Iu.includes(e)))),[j]:D,allowedBlockTypes:z,allowRightClickOverrides:l,focusMode:b&&!G,hasFixedToolbar:f,isDistractionFree:E,keepCaretInsideBlock:y,mediaUpload:v?bu:void 0,__experimentalBlockPatterns:L,[$]:e=>{const{hasFinishedResolution:n,getBlockPatternsForPostType:o}=m(e(h.store)),r=o(t);return n("getBlockPatterns")?r:void 0},[m(_.privateApis).reusableBlocksSelectKey]:xu,__experimentalBlockPatternCategories:O,__experimentalUserPatternCategories:I,__experimentalFetchLinkSuggestions:(t,n)=>(0,h.__experimentalFetchLinkSuggestions)(t,n,e),inserterMediaCategories:gu,__experimentalFetchRichUrlData:h.__experimentalFetchUrlData,__experimentalCanUserUseUnfilteredHTML:w,__experimentalUndo:F,outlineMode:"wp_template"===t,__experimentalCreatePageEntity:H,__experimentalUserCanCreatePages:P,pageOnFront:C,pageForPosts:T,__experimentalPreferPatternsOnRoot:"wp_template"===t,templateLock:"wp_navigation"===t?"insert":e.templateLock,template:"wp_navigation"===t?[["core/navigation",{},[]]]:e.template,__experimentalSetIsInserterOpened:V};return p(n,{sectionRootClientId:N}),n}),[z,l,b,G,f,E,y,e,v,I,L,O,w,F,H,P,C,T,t,V,N,D,j,$])},Nu=(0,gn.applyFilters)("editor.postContentBlockTypes",["core/post-title","core/post-featured-image","core/post-content","core/template-part"]);function Au(){const e=(0,u.useSelect)((e=>{const{getBlocksByName:t,getBlockParents:n,getBlockName:o}=e(_.store);return t(Nu).filter((e=>n(e).every((e=>{const t=o(e);return"core/query"!==t&&!Nu.includes(t)}))))}),[]),t=(0,u.useSelect)((e=>{const{getBlocksByName:t,getBlockOrder:n}=e(_.store);return t(["core/template-part"]).flatMap((e=>n(e)))}),[]),n=(0,u.useRegistry)();return(0,S.useEffect)((()=>{const{setBlockEditingMode:o,unsetBlockEditingMode:r}=n.dispatch(_.store);return n.batch((()=>{o("","disabled");for(const t of e)o(t,"contentOnly");for(const e of t)o(e,"disabled")})),()=>{n.batch((()=>{r("");for(const t of e)r(t);for(const e of t)r(e)}))}}),[e,t,n]),null}function Du(){const e=(0,u.useSelect)((e=>e(_.store).getBlockOrder()?.[0]),[]),{setBlockEditingMode:t,unsetBlockEditingMode:n}=(0,u.useDispatch)(_.store);(0,S.useEffect)((()=>{if(e)return t(e,"contentOnly"),()=>{n(e)}}),[e,n,t])}const Ru=["wp_block","wp_template","wp_template_part"];const Mu=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.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,P.createElement)(C.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"})),Lu=(0,P.createElement)(C.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,P.createElement)(C.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})),Ou=(0,P.createElement)(C.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,P.createElement)(C.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"})),Fu=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.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"}));function Vu(){const{editorMode:e,isListViewOpen:t,showBlockBreadcrumbs:n,isDistractionFree:o,isTopToolbar:r,isFocusMode:s,isPreviewMode:a,isViewable:i,isCodeEditingEnabled:l,isRichEditingEnabled:c}=(0,u.useSelect)((e=>{var t,n;const{get:o}=e(x.store),{isListViewOpened:r,getCurrentPostType:s,getEditorSettings:a}=e(tr),{getSettings:i}=e(_.store),{getPostType:l}=e(h.store);return{editorMode:null!==(t=o("core","editorMode"))&&void 0!==t?t:"visual",isListViewOpen:r(),showBlockBreadcrumbs:o("core","showBlockBreadcrumbs"),isDistractionFree:o("core","distractionFree"),isFocusMode:o("core","focusMode"),isTopToolbar:o("core","fixedToolbar"),isPreviewMode:i().__unstableIsPreviewMode,isViewable:null!==(n=l(s())?.viewable)&&void 0!==n&&n,isCodeEditingEnabled:a().codeEditingEnabled,isRichEditingEnabled:a().richEditingEnabled}}),[]),{toggle:d}=(0,u.useDispatch)(x.store),{createInfoNotice:p}=(0,u.useDispatch)(mn.store),{__unstableSaveForPreview:m,setIsListViewOpened:b,switchEditorMode:f,toggleDistractionFree:E}=(0,u.useDispatch)(tr),{openModal:y}=(0,u.useDispatch)(zr),{getCurrentPostId:v}=(0,u.useSelect)(tr),k=l&&c;if(a)return{commands:[],isLoading:!1};const w=[];return w.push({name:"core/open-shortcut-help",label:(0,g.__)("Keyboard shortcuts"),icon:Mu,callback:()=>{y("editor/keyboard-shortcut-help")}}),w.push({name:"core/toggle-distraction-free",label:o?(0,g.__)("Exit Distraction Free"):(0,g.__)("Enter Distraction Free"),callback:({close:e})=>{E(),e()}}),w.push({name:"core/open-preferences",label:(0,g.__)("Editor preferences"),callback:()=>{y("editor/preferences")}}),w.push({name:"core/toggle-spotlight-mode",label:(0,g.__)("Toggle spotlight"),callback:({close:e})=>{d("core","focusMode"),e(),p(s?(0,g.__)("Spotlight off."):(0,g.__)("Spotlight on."),{id:"core/editor/toggle-spotlight-mode/notice",type:"snackbar",actions:[{label:(0,g.__)("Undo"),onClick:()=>{d("core","focusMode")}}]})}}),w.push({name:"core/toggle-list-view",label:t?(0,g.__)("Close List View"):(0,g.__)("Open List View"),icon:Lu,callback:({close:e})=>{b(!t),e(),p(t?(0,g.__)("List View off."):(0,g.__)("List View on."),{id:"core/editor/toggle-list-view/notice",type:"snackbar"})}}),w.push({name:"core/toggle-top-toolbar",label:(0,g.__)("Toggle top toolbar"),callback:({close:e})=>{d("core","fixedToolbar"),o&&E(),e(),p(r?(0,g.__)("Top toolbar off."):(0,g.__)("Top toolbar on."),{id:"core/editor/toggle-top-toolbar/notice",type:"snackbar",actions:[{label:(0,g.__)("Undo"),onClick:()=>{d("core","fixedToolbar")}}]})}}),k&&w.push({name:"core/toggle-code-editor",label:"visual"===e?(0,g.__)("Open code editor"):(0,g.__)("Exit code editor"),icon:Ou,callback:({close:t})=>{f("visual"===e?"text":"visual"),t()}}),w.push({name:"core/toggle-breadcrumbs",label:n?(0,g.__)("Hide block breadcrumbs"):(0,g.__)("Show block breadcrumbs"),callback:({close:e})=>{d("core","showBlockBreadcrumbs"),e(),p(n?(0,g.__)("Breadcrumbs hidden."):(0,g.__)("Breadcrumbs visible."),{id:"core/editor/toggle-breadcrumbs/notice",type:"snackbar"})}}),i&&w.push({name:"core/preview-link",label:(0,g.__)("Preview in a new tab"),icon:Fu,callback:async({close:e})=>{e();const t=v(),n=await m();window.open(n,`wp-preview-${t}`)}}),{commands:w,isLoading:!1}}const{BlockRemovalWarningModal:Uu}=m(_.privateApis),Hu=["core/post-content","core/post-template","core/query"],zu=[{postTypes:["wp_template","wp_template_part"],callback(e){if(e.filter((({name:e})=>Hu.includes(e))).length)return(0,g._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,g._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 Gu(){const e=(0,u.useSelect)((e=>e(tr).getCurrentPostType()),[]),t=(0,S.useMemo)((()=>zu.filter((t=>t.postTypes.includes(e)))),[e]);return Uu&&t?(0,P.createElement)(Uu,{rules:t}):null}function ju({blockPatterns:e,onChoosePattern:t}){const n=(0,rr.useAsyncList)(e),{editEntityRecord:o}=(0,u.useDispatch)(h.store),{postType:r,postId:s}=(0,u.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:n}=e(tr);return{postType:t(),postId:n()}}),[]);return(0,P.createElement)(_.__experimentalBlockPatternsList,{blockPatterns:e,shownPatterns:n,onClickPattern:(e,n)=>{o("postType",r,s,{blocks:n,content:({blocks:e=[]})=>(0,c.__unstableSerializeAndClean)(e)}),t()}})}function $u({onClose:e}){const t=function(){const{blockPatternsWithPostContentBlockType:e,postType:t}=(0,u.useSelect)((e=>{const{getPatternsByBlockTypes:t,getBlocksByName:n}=e(_.store),{getCurrentPostType:o,getRenderingMode:r}=e(tr);return{blockPatternsWithPostContentBlockType:t("core/post-content","post-only"===r()?"":n("core/post-content")?.[0]),postType:o()}}),[]);return(0,S.useMemo)((()=>e.filter((e=>"page"===t&&!e.postTypes||Array.isArray(e.postTypes)&&e.postTypes.includes(t)))),[t,e])}();return t.length>0?(0,P.createElement)(fr.Modal,{title:(0,g.__)("Choose a pattern"),isFullScreen:!0,onRequestClose:e},(0,P.createElement)("div",{className:"editor-start-page-options__modal-content"},(0,P.createElement)(ju,{blockPatterns:t,onChoosePattern:e}))):null}function Wu(){const[e,t]=(0,S.useState)(!1),{shouldEnableModal:n,postType:o,postId:r}=(0,u.useSelect)((e=>{const{isEditedPostDirty:t,isEditedPostEmpty:n,getCurrentPostType:o,getCurrentPostId:r}=e(tr),s=o();return{shouldEnableModal:!t()&&n()&&M!==s,postType:s,postId:r()}}),[]);return(0,S.useEffect)((()=>{t(!1)}),[o,r]),!n||e?null:(0,P.createElement)($u,{onClose:()=>t(!0)})}const Ku=[{keyCombination:{modifier:"primary",character:"b"},description:(0,g.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,g.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,g.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,g.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,g.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,g.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,g.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,g.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}],description:(0,g.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,g.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")},{keyCombination:{modifier:"primaryShift",character:"SPACE"},description:(0,g.__)("Add non breaking space.")}];function Zu({keyCombination:e,forceAriaLabel:t}){const n=e.modifier?_s.displayShortcutList[e.modifier](e.character):e.character,o=e.modifier?_s.shortcutAriaLabel[e.modifier](e.character):e.character;return(0,P.createElement)("kbd",{className:"editor-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||o},(Array.isArray(n)?n:[n]).map(((e,t)=>"+"===e?(0,P.createElement)(S.Fragment,{key:t},e):(0,P.createElement)("kbd",{key:t,className:"editor-keyboard-shortcut-help-modal__shortcut-key"},e))))}const Yu=function({description:e,keyCombination:t,aliases:n=[],ariaLabel:o}){return(0,P.createElement)(S.Fragment,null,(0,P.createElement)("div",{className:"editor-keyboard-shortcut-help-modal__shortcut-description"},e),(0,P.createElement)("div",{className:"editor-keyboard-shortcut-help-modal__shortcut-term"},(0,P.createElement)(Zu,{keyCombination:t,forceAriaLabel:o}),n.map(((e,t)=>(0,P.createElement)(Zu,{keyCombination:e,forceAriaLabel:o,key:t})))))};const qu=function({name:e}){const{keyCombination:t,description:n,aliases:o}=(0,u.useSelect)((t=>{const{getShortcutKeyCombination:n,getShortcutDescription:o,getShortcutAliases:r}=t(_r.store);return{keyCombination:n(e),aliases:r(e),description:o(e)}}),[e]);return t?(0,P.createElement)(Yu,{keyCombination:t,description:n,aliases:o}):null},Qu="editor/keyboard-shortcut-help",Xu=({shortcuts:e})=>(0,P.createElement)("ul",{className:"editor-keyboard-shortcut-help-modal__shortcut-list",role:"list"},e.map(((e,t)=>(0,P.createElement)("li",{className:"editor-keyboard-shortcut-help-modal__shortcut",key:t},"string"==typeof e?(0,P.createElement)(qu,{name:e}):(0,P.createElement)(Yu,{...e}))))),Ju=({title:e,shortcuts:t,className:n})=>(0,P.createElement)("section",{className:br("editor-keyboard-shortcut-help-modal__section",n)},!!e&&(0,P.createElement)("h2",{className:"editor-keyboard-shortcut-help-modal__section-title"},e),(0,P.createElement)(Xu,{shortcuts:t})),ed=({title:e,categoryName:t,additionalShortcuts:n=[]})=>{const o=(0,u.useSelect)((e=>e(_r.store).getCategoryShortcuts(t)),[t]);return(0,P.createElement)(Ju,{title:e,shortcuts:o.concat(n)})};const td=function(){const e=(0,u.useSelect)((e=>e(zr).isModalActive(Qu)),[]),{openModal:t,closeModal:n}=(0,u.useDispatch)(zr),o=()=>{e?n():t(Qu)};return(0,_r.useShortcut)("core/editor/keyboard-shortcuts",o),e?(0,P.createElement)(fr.Modal,{className:"editor-keyboard-shortcut-help-modal",title:(0,g.__)("Keyboard shortcuts"),closeButtonLabel:(0,g.__)("Close"),onRequestClose:o},(0,P.createElement)(Ju,{className:"editor-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/editor/keyboard-shortcuts"]}),(0,P.createElement)(ed,{title:(0,g.__)("Global shortcuts"),categoryName:"global"}),(0,P.createElement)(ed,{title:(0,g.__)("Selection shortcuts"),categoryName:"selection"}),(0,P.createElement)(ed,{title:(0,g.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,g.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,g.__)("Forward-slash")}]}),(0,P.createElement)(Ju,{title:(0,g.__)("Text formatting"),shortcuts:Ku}),(0,P.createElement)(ed,{title:(0,g.__)("List View shortcuts"),categoryName:"list-view"})):null};function nd({clientId:e,onClose:t}){const{entity:n,onNavigateToEntityRecord:o}=(0,u.useSelect)((t=>{const{getBlockEditingMode:n,getBlockParentsByBlockName:o,getSettings:r,getBlockAttributes:s}=t(_.store);if(!("contentOnly"===n(e)))return{};const a=o(e,"core/block",!0)[0];let i;if(a)i=t(h.store).getEntityRecord("postType","wp_block",s(a).ref);else{const{getCurrentPostType:e,getCurrentTemplateId:n}=t(tr),o=e(),r=n();"page"===o&&r&&(i=t(h.store).getEntityRecord("postType","wp_template",r))}return{entity:i,onNavigateToEntityRecord:r().onNavigateToEntityRecord}}),[e]);if(!n)return(0,P.createElement)(od,{clientId:e,onClose:t});const r="wp_block"===n.type;return(0,P.createElement)(P.Fragment,null,(0,P.createElement)(_.__unstableBlockSettingsMenuFirstItem,null,(0,P.createElement)(fr.MenuItem,{onClick:()=>{o({postId:n.id,postType:n.type})}},r?(0,g.__)("Edit pattern"):(0,g.__)("Edit template"))),(0,P.createElement)(fr.__experimentalText,{variant:"muted",as:"p",className:"editor-content-only-settings-menu__description"},r?(0,g.__)("Edit the pattern to move, delete, or make further changes to this block."):(0,g.__)("Edit the template to move, delete, or make further changes to this block.")))}function od({clientId:e,onClose:t}){const{contentLockingParent:n}=(0,u.useSelect)((t=>{const{getContentLockingParent:n}=m(t(_.store));return{contentLockingParent:n(e)}}),[e]),o=(0,_.useBlockDisplayInformation)(n),{modifyContentLockBlock:r,selectBlock:s}=m((0,u.useDispatch)(_.store));return o?.title?(0,P.createElement)(P.Fragment,null,(0,P.createElement)(_.__unstableBlockSettingsMenuFirstItem,null,(0,P.createElement)(fr.MenuItem,{onClick:()=>{s(n),r(n),t()}},(0,g.__)("Unlock"))),(0,P.createElement)(fr.__experimentalText,{variant:"muted",as:"p",className:"editor-content-only-settings-menu__description"},(0,g.__)("Temporarily unlock the parent block to edit, delete or make further changes to this block."))):null}function rd(){return(0,P.createElement)(_.BlockSettingsMenuControls,null,(({selectedClientIds:e,onClose:t})=>1===e.length&&(0,P.createElement)(nd,{clientId:e[0],onClose:t})))}function sd(e){const{slug:t,patterns:n}=(0,u.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:n}=e(tr),{getEntityRecord:o,getBlockPatterns:r}=e(h.store),s=n();return{slug:o("postType",t(),s).slug,patterns:r()}}),[]),o=(0,u.useSelect)((e=>e(h.store).getCurrentTheme().stylesheet));return(0,S.useMemo)((()=>[{name:"fallback",blocks:(0,c.parse)(e),title:(0,g.__)("Fallback content")},...n.filter((e=>Array.isArray(e.templateTypes)&&e.templateTypes.some((e=>t.startsWith(e))))).map((e=>({...e,blocks:(0,c.parse)(e.content).map((e=>function(e){return e.innerBlocks.find((e=>"core/template-part"===e.name))&&(e.innerBlocks=e.innerBlocks.map((e=>("core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=o),e)))),"core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=o),e}(e)))})))]),[e,t,n])}function ad({fallbackContent:e,onChoosePattern:t,postType:n}){const[,,o]=(0,h.useEntityBlockEditor)("postType",n),r=sd(e),s=(0,rr.useAsyncList)(r);return(0,P.createElement)(_.__experimentalBlockPatternsList,{blockPatterns:r,shownPatterns:s,onClickPattern:(e,n)=>{o(n,{selection:void 0}),t()}})}function id({slug:e,isCustom:t,onClose:n,postType:o}){const r=function(e,t=!1){return(0,u.useSelect)((n=>{const{getEntityRecord:o,getDefaultTemplateId:r}=n(h.store),s=r({slug:e,is_custom:t,ignore_empty:!0});return s?o("postType",M,s)?.content?.raw:void 0}),[e,t])}(e,t);return r?(0,P.createElement)(fr.Modal,{className:"editor-start-template-options__modal",title:(0,g.__)("Choose a pattern"),closeLabel:(0,g.__)("Cancel"),focusOnMount:"firstElement",onRequestClose:n,isFullScreen:!0},(0,P.createElement)("div",{className:"editor-start-template-options__modal-content"},(0,P.createElement)(ad,{fallbackContent:r,slug:e,isCustom:t,postType:o,onChoosePattern:()=>{n()}})),(0,P.createElement)(fr.Flex,{className:"editor-start-template-options__modal__actions",justify:"flex-end",expanded:!1},(0,P.createElement)(fr.FlexItem,null,(0,P.createElement)(fr.Button,{variant:"tertiary",onClick:n},(0,g.__)("Skip"))))):null}function ld(){const[e,t]=(0,S.useState)(!1),{shouldOpenModal:n,slug:o,isCustom:r,postType:s,postId:a}=(0,u.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:n}=e(tr),o=t(),r=n(),{getEditedEntityRecord:s,hasEditsForEntityRecord:a}=e(h.store),i=s("postType",o,r);return{shouldOpenModal:!a("postType",o,r)&&""===i.content&&M===o,slug:i.slug,isCustom:i.is_custom,postType:o,postId:r}}),[]);return(0,S.useEffect)((()=>{t(!1)}),[s,a]),!n||e?null:(0,P.createElement)(id,{slug:o,isCustom:r,postType:s,onClose:()=>t(!0)})}const{ExperimentalBlockEditorProvider:cd}=m(_.privateApis),{PatternsMenuItems:ud}=m(ir.privateApis),dd=()=>{},pd=["wp_block","wp_template","wp_navigation","wp_template_part"];const md=cu((({post:e,settings:t,recovery:n,initialEdits:o,children:r,BlockEditorProviderComponent:s=cd,__unstableTemplate:a})=>{const i=(0,u.useSelect)((e=>e(tr).getRenderingMode()),[]),l=!!a&&"post-only"!==i,d=l?a:e,p=(0,S.useMemo)((()=>({...!pd.includes(d.type)||l?{postId:e.id,postType:e.type}:{},templateSlug:"wp_template"===d.type?d.slug:void 0})),[l,e.id,e.type,d.type,d.slug]),{editorSettings:b,selection:f,isReady:E}=(0,u.useSelect)((e=>{const{getEditorSettings:t,getEditorSelection:n,__unstableIsEditorReady:o}=e(tr);return{editorSettings:t(),isReady:o(),selection:n()}}),[]),{id:y,type:v}=d,k=Bu(b,v,y,i),[w,C,T]=function(e,t,n){const o="post-only"!==n&&t?"template":"post",[r,s,a]=(0,h.useEntityBlockEditor)("postType",e.type,{id:e.id}),[i,l,u]=(0,h.useEntityBlockEditor)("postType",t?.type,{id:t?.id}),d=(0,S.useMemo)((()=>{if("wp_navigation"===e.type)return[(0,c.createBlock)("core/navigation",{ref:e.id,templateLock:!1})]}),[e.type,e.id]),p=(0,S.useMemo)((()=>d||("template"===o?i:r)),[d,o,i,r]);return t&&"template-locked"===n||"wp_navigation"===e.type?[p,dd,dd]:[p,"post"===o?s:l,"post"===o?a:u]}(e,a,i),{updatePostLock:x,setupEditor:I,updateEditorSettings:B,setCurrentTemplateId:N,setEditedPost:A,setRenderingMode:D}=m((0,u.useDispatch)(tr)),{createWarningNotice:R}=(0,u.useDispatch)(mn.store);return(0,S.useLayoutEffect)((()=>{n||(x(t.postLock),I(e,o,t.template),t.autosave&&R((0,g.__)("There is an autosave of this post that is more recent than the version below."),{id:"autosave-exists",actions:[{label:(0,g.__)("View the autosave"),url:t.autosave.editLink}]}))}),[]),(0,S.useEffect)((()=>{A(e.type,e.id)}),[e.type,e.id,A]),(0,S.useEffect)((()=>{B(t)}),[t,B]),(0,S.useEffect)((()=>{N(a?.id)}),[a?.id,N]),(0,S.useEffect)((()=>{var e;D(null!==(e=t.defaultRenderingMode)&&void 0!==e?e:"post-only")}),[t.defaultRenderingMode,D]),function(e,t){(0,S.useEffect)((()=>((0,gn.addFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter",((n,o)=>!(!Ru.includes(e)&&"core/template-part"===o.name&&"post-only"===t)&&n)),(0,gn.addFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter",((t,n,o,{getBlockParentsByBlockName:r})=>Ru.includes(e)||"core/post-content"!==n.name?t:r(o,"core/query").length>0)),()=>{(0,gn.removeFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter"),(0,gn.removeFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter")})),[e,t])}(e.type,i),(0,hs.useCommandLoader)({name:"core/editor/edit-ui",hook:Vu}),E?(0,P.createElement)(h.EntityProvider,{kind:"root",type:"site"},(0,P.createElement)(h.EntityProvider,{kind:"postType",type:e.type,id:e.id},(0,P.createElement)(_.BlockContextProvider,{value:p},(0,P.createElement)(s,{value:w,onChange:T,onInput:C,selection:f,settings:k,useSubRegistry:!1},r,!t.__unstableIsPreviewMode&&(0,P.createElement)(P.Fragment,null,(0,P.createElement)(ud,null),(0,P.createElement)(rd,null),"template-locked"===i&&(0,P.createElement)(Au,null),"wp_navigation"===v&&(0,P.createElement)(Du,null),(0,P.createElement)(td,null),(0,P.createElement)(Gu,null),(0,P.createElement)(Wu,null),(0,P.createElement)(ld,null)))))):null}));const gd=function(e){return(0,P.createElement)(md,{...e,BlockEditorProviderComponent:_.BlockEditorProvider},e.children)},_d=window.wp.serverSideRender;var hd=n.n(_d);function bd(e,t,n=[]){const o=(0,S.forwardRef)(((n,o)=>(w()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),(0,P.createElement)(t,{ref:o,...n}))));return n.forEach((n=>{o[n]=bd(e+"."+n,t[n])})),o}function fd(e,t){return(...n)=>(w()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),t(...n))}const Ed=bd("RichText",_.RichText,["Content"]);Ed.isEmpty=fd("RichText.isEmpty",_.RichText.isEmpty);const yd=bd("Autocomplete",_.Autocomplete),vd=bd("AlignmentToolbar",_.AlignmentToolbar),kd=bd("BlockAlignmentToolbar",_.BlockAlignmentToolbar),wd=bd("BlockControls",_.BlockControls,["Slot"]),Sd=bd("BlockEdit",_.BlockEdit),Pd=bd("BlockEditorKeyboardShortcuts",_.BlockEditorKeyboardShortcuts),Cd=bd("BlockFormatControls",_.BlockFormatControls,["Slot"]),Td=bd("BlockIcon",_.BlockIcon),xd=bd("BlockInspector",_.BlockInspector),Id=bd("BlockList",_.BlockList),Bd=bd("BlockMover",_.BlockMover),Nd=bd("BlockNavigationDropdown",_.BlockNavigationDropdown),Ad=bd("BlockSelectionClearer",_.BlockSelectionClearer),Dd=bd("BlockSettingsMenu",_.BlockSettingsMenu),Rd=bd("BlockTitle",_.BlockTitle),Md=bd("BlockToolbar",_.BlockToolbar),Ld=bd("ColorPalette",_.ColorPalette),Od=bd("ContrastChecker",_.ContrastChecker),Fd=bd("CopyHandler",_.CopyHandler),Vd=bd("DefaultBlockAppender",_.DefaultBlockAppender),Ud=bd("FontSizePicker",_.FontSizePicker),Hd=bd("Inserter",_.Inserter),zd=bd("InnerBlocks",_.InnerBlocks,["ButtonBlockAppender","DefaultBlockAppender","Content"]),Gd=bd("InspectorAdvancedControls",_.InspectorAdvancedControls,["Slot"]),jd=bd("InspectorControls",_.InspectorControls,["Slot"]),$d=bd("PanelColorSettings",_.PanelColorSettings),Wd=bd("PlainText",_.PlainText),Kd=bd("RichTextShortcut",_.RichTextShortcut),Zd=bd("RichTextToolbarButton",_.RichTextToolbarButton),Yd=bd("__unstableRichTextInputEvent",_.__unstableRichTextInputEvent),qd=bd("MediaPlaceholder",_.MediaPlaceholder),Qd=bd("MediaUpload",_.MediaUpload),Xd=bd("MediaUploadCheck",_.MediaUploadCheck),Jd=bd("MultiSelectScrollIntoView",_.MultiSelectScrollIntoView),ep=bd("NavigableToolbar",_.NavigableToolbar),tp=bd("ObserveTyping",_.ObserveTyping),np=bd("SkipToSelectedBlock",_.SkipToSelectedBlock),op=bd("URLInput",_.URLInput),rp=bd("URLInputButton",_.URLInputButton),sp=bd("URLPopover",_.URLPopover),ap=bd("Warning",_.Warning),ip=bd("WritingFlow",_.WritingFlow),lp=fd("createCustomColorsHOC",_.createCustomColorsHOC),cp=fd("getColorClassName",_.getColorClassName),up=fd("getColorObjectByAttributeValues",_.getColorObjectByAttributeValues),dp=fd("getColorObjectByColorValue",_.getColorObjectByColorValue),pp=fd("getFontSize",_.getFontSize),mp=fd("getFontSizeClass",_.getFontSizeClass),gp=fd("withColorContext",_.withColorContext),_p=fd("withColors",_.withColors),hp=fd("withFontSizes",_.withFontSizes),bp=us,fp=us;function Ep(e){return w()("wp.editor.cleanForSlug",{since:"12.7",plugin:"Gutenberg",alternative:"wp.url.cleanForSlug"}),(0,v.cleanForSlug)(e)}function yp({contentRef:e}){const{onNavigateToEntityRecord:t,templateId:n}=(0,u.useSelect)((e=>{const{getEditorSettings:t,getCurrentTemplateId:n}=e(tr);return{onNavigateToEntityRecord:t().onNavigateToEntityRecord,templateId:n()}}),[]),o=(0,u.useSelect)((e=>{var t;return null!==(t=e(h.store).canUser("create","templates"))&&void 0!==t&&t})),[r,s]=(0,S.useState)(!1);return(0,S.useEffect)((()=>{const t=e=>{o&&e.target.classList.contains("is-root-container")&&s(!0)},n=e.current;return n?.addEventListener("dblclick",t),()=>{n?.removeEventListener("dblclick",t)}}),[e,o]),o?(0,P.createElement)(fr.__experimentalConfirmDialog,{isOpen:r,confirmButtonText:(0,g.__)("Edit template"),onConfirm:()=>{s(!1),t({postId:n,postType:"wp_template"})},onCancel:()=>s(!1)},(0,g.__)("You’ve tried to select a block that is part of a template, which may be used on other posts and pages. Would you like to edit the template?")):null}const vp=500;function kp(e,t,n){return Math.min(Math.max(e,t),n)}function wp(e,t,n){const o=e-kp(e,n.left,n.right),r=t-kp(t,n.top,n.bottom);return Math.sqrt(o*o+r*r)}function Sp({isEnabled:e=!0}={}){const{getEnabledClientIdsTree:t,getBlockName:n,getBlockOrder:o}=m((0,u.useSelect)(_.store)),{selectBlock:r}=(0,u.useDispatch)(_.store);return(0,rr.useRefEffect)((s=>{if(!e)return;const a=e=>{(e.target===s||e.target.classList.contains("is-root-container"))&&((e,a)=>{const i=t().flatMap((({clientId:e})=>{const t=n(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 i){const n=s.querySelector(`[data-block="${t}"]`);if(!n)continue;const o=wp(e,a,n.getBoundingClientRect());os.removeEventListener("click",a)}),[e])}const{LayoutStyle:Pp,useLayoutClasses:Cp,useLayoutStyles:Tp,ExperimentalBlockCanvas:xp,useFlashEditableBlocks:Ip}=m(_.privateApis),Bp=["wp_block","wp_template","wp_navigation","wp_template_part"];function Np(e){for(let t=0;t{const{getCurrentPostId:t,getCurrentPostType:n,getCurrentTemplateId:o,getEditorSettings:r,getRenderingMode:s,getDeviceType:a}=e(tr),{getPostType:i,canUser:l,getEditedEntityRecord:c}=e(h.store),u=n(),d=s();let p;"wp_block"===u?p="core/block":"post-only"===d&&(p="core/post-content");const m=r(),g=m.supportsTemplateMode,_=i(u),b=l("create","templates"),f=o(),E=f?c("postType","wp_template",f):void 0;return{renderingMode:d,postContentAttributes:m.postContentAttributes,isDesignPostType:Bp.includes(u),editedPostTemplate:_?.viewable&&g&&b?E:void 0,wrapperBlockName:p,wrapperUniqueId:t(),deviceType:a(),showEditorPadding:!!m.onNavigateToPreviousEntityRecord}}),[]),{isCleanNewPost:y}=(0,u.useSelect)(tr),{hasRootPaddingAwareAlignments:v,themeHasDisabledLayoutStyles:k,themeSupportsLayout:w,isZoomOutMode:C}=(0,u.useSelect)((e=>{const{getSettings:t,__unstableGetEditorMode:n}=e(_.store),o=t();return{themeHasDisabledLayoutStyles:o.disableLayoutStyles,themeSupportsLayout:o.supportsLayout,hasRootPaddingAwareAlignments:o.__experimentalFeatures?.useRootPaddingAwareAlignments,isZoomOutMode:"zoom-out"===n()}}),[]),T=(0,_.__experimentalUseResizeCanvas)(b),[x]=(0,_.useSettings)("layout"),I=(0,S.useMemo)((()=>"post-only"!==l||E?{type:"default"}:w?{...x,type:"constrained"}:{type:"default"}),[l,w,x,E]),B=(0,S.useMemo)((()=>{if(!p?.content&&!p?.blocks&&d)return d;if(p?.blocks)return Np(p?.blocks);const e="string"==typeof p?.content?p?.content:"";return Np((0,c.parse)(e))||{}}),[p?.content,p?.blocks,d]),N=(0,S.useMemo)((()=>{if(!p?.content&&!p?.blocks)return!1;if(p?.blocks)return Ap(p?.blocks);const e="string"==typeof p?.content?p?.content:"";return Ap((0,c.parse)(e))||!1}),[p?.content,p?.blocks]),{layout:A={},align:D=""}=B||{},R=Cp(B,"core/post-content"),M=br({"is-layout-flow":!w},w&&R,D&&`align${D}`),L=Tp(B,"core/post-content",".block-editor-block-list__layout.is-root-container"),O=(0,S.useMemo)((()=>A&&("constrained"===A?.type||A?.inherit||A?.contentSize||A?.wideSize)?{...x,...A,type:"constrained"}:{...x,...A,type:"default"}),[A?.type,A?.inherit,A?.contentSize,A?.wideSize,x]),F=d?O:I,V="default"!==F?.type||N?F:I,U=(0,_.__unstableUseTypingObserver)(),H=(0,S.useRef)();(0,S.useEffect)((()=>{e&&y()&&H?.current?.focus()}),[e,y]);const z=(0,S.useRef)(),G=(0,_.__unstableUseTypewriter)();a=(0,rr.useMergeRefs)([z,a,"post-only"===l?G:null,Ip({isEnabled:"template-locked"===l}),Sp({isEnabled:"template-locked"===l})]);const j=C?{scale:"default",frameSize:"20px"}:{};return(0,P.createElement)(xp,{shouldIframe:!r||["Tablet","Mobile"].includes(b),contentRef:a,styles:o,height:"100%",iframeProps:{className:br("editor-canvas__iframe",{"has-editor-padding":f}),...s,...j,style:{...s?.style,...T}}},w&&!k&&"post-only"===l&&!E&&(0,P.createElement)(P.Fragment,null,(0,P.createElement)(Pp,{selector:".editor-editor-canvas__post-title-wrapper",layout:I}),(0,P.createElement)(Pp,{selector:".block-editor-block-list__layout.is-root-container",layout:V}),D&&(0,P.createElement)(Pp,{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;}"}),L&&(0,P.createElement)(Pp,{layout:O,css:L})),"post-only"===l&&!E&&(0,P.createElement)("div",{className:br("editor-editor-canvas__post-title-wrapper","edit-post-visual-editor__post-title-wrapper",{"has-global-padding":v}),contentEditable:!1,ref:U,style:{marginTop:"4rem"}},(0,P.createElement)(zc,{ref:H})),(0,P.createElement)(_.RecursionProvider,{blockName:m,uniqueId:g},(0,P.createElement)(_.BlockList,{className:br(t,"is-"+b.toLowerCase()+"-preview","post-only"!==l||E?"wp-site-blocks":`${M} wp-block-post-content`),layout:F,dropZoneElement:r?z.current:z.current?.parentNode,renderAppender:n,__unstableDisableDropZone:"template-locked"===l}),"template-locked"===l&&(0,P.createElement)(yp,{contentRef:z})),i)};const Rp=function(){const{hasBlockSelection:e}=(0,u.useSelect)((e=>({hasBlockSelection:!!e(_.store).getBlockSelectionStart()})),[]),{getActiveComplementaryArea:t}=(0,u.useSelect)(zr),{enableComplementaryArea:n}=(0,u.useDispatch)(zr),{get:o}=(0,u.useSelect)(x.store);(0,S.useEffect)((()=>{const r=t("core"),s=["edit-post/document","edit-post/block"].includes(r),a=o("core","distractionFree");s&&!a&&n("core",e?"edit-post/block":"edit-post/document")}),[e,t,n,o])},Mp=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.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"})),Lp=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.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:Op}=m(_.privateApis);const Fp=function({isCollapsed:e,onToggle:t}){const{blockSelectionStart:n}=(0,u.useSelect)((e=>({blockSelectionStart:e(_.store).getBlockSelectionStart()})),[]),o=Op(),r=!!n;return(0,S.useEffect)((()=>{n&&t(!1)}),[n,t]),o?(0,P.createElement)(P.Fragment,null,(0,P.createElement)("div",{className:br("editor-collapsible-block-toolbar",{"is-collapsed":e||!r})},(0,P.createElement)(_.BlockToolbar,{hideDragHandle:!0})),(0,P.createElement)(fr.Popover.Slot,{name:"block-toolbar"}),(0,P.createElement)(fr.Button,{className:"editor-collapsible-block-toolbar__toggle",icon:e?Mp:Lp,onClick:()=>{t(!e)},label:e?(0,g.__)("Show block tools"):(0,g.__)("Hide block tools"),size:"compact"})):null},Vp=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})),Up=e=>{e.preventDefault()};const Hp=function({className:e,disableBlockTools:t=!1,listViewLabel:n=(0,g.__)("Document Overview")}){const{setIsInserterOpened:o,setIsListViewOpened:r}=(0,u.useDispatch)(tr),{isDistractionFree:s,isInserterOpened:a,isListViewOpen:i,listViewShortcut:l,inserterSidebarToggleRef:c,listViewToggleRef:d,hasFixedToolbar:p,showIconLabels:h}=(0,u.useSelect)((e=>{const{getSettings:t}=e(_.store),{get:n}=e(x.store),{isListViewOpened:o,getEditorMode:r,getInserterSidebarToggleRef:s,getListViewToggleRef:a}=m(e(tr)),{getShortcutRepresentation:i}=e(_r.store),{__unstableGetEditorMode:l}=e(_.store);return{isInserterOpened:e(tr).isInserterOpened(),isListViewOpen:o(),listViewShortcut:i("core/editor/toggle-list-view"),inserterSidebarToggleRef:s(),listViewToggleRef:a(),hasFixedToolbar:t().hasFixedToolbar,showIconLabels:n("core","showIconLabels"),isDistractionFree:n("core","distractionFree"),isVisualMode:"visual"===r(),isZoomedOutView:"zoom-out"===l()}}),[]),b=(0,rr.useViewportMatch)("medium"),f=(0,rr.useViewportMatch)("wide"),E=(0,g.__)("Document tools"),y=(0,S.useCallback)((()=>r(!i)),[r,i]),v=(0,S.useCallback)((()=>o(!a)),[a,o]),k=(0,g._x)("Toggle block inserter","Generic label for block inserter button"),w=a?(0,g.__)("Close"):(0,g.__)("Add");return(0,P.createElement)(_.NavigableToolbar,{className:br("editor-document-tools","edit-post-header-toolbar",e),"aria-label":E,variant:"unstyled"},(0,P.createElement)("div",{className:"editor-document-tools__left"},!s&&(0,P.createElement)(fr.ToolbarItem,{ref:c,as:fr.Button,className:"editor-document-tools__inserter-toggle",variant:"primary",isPressed:a,onMouseDown:Up,onClick:v,disabled:t,icon:Vp,label:h?w:k,showTooltip:!h,"aria-expanded":a}),(f||!h)&&(0,P.createElement)(P.Fragment,null,b&&!p&&(0,P.createElement)(fr.ToolbarItem,{as:_.ToolSelector,showTooltip:!h,variant:h?"tertiary":void 0,disabled:t,size:"compact"}),(0,P.createElement)(fr.ToolbarItem,{as:Os,showTooltip:!h,variant:h?"tertiary":void 0,size:"compact"}),(0,P.createElement)(fr.ToolbarItem,{as:Ls,showTooltip:!h,variant:h?"tertiary":void 0,size:"compact"}),!s&&(0,P.createElement)(fr.ToolbarItem,{as:fr.Button,className:"editor-document-tools__document-overview-toggle",icon:Lu,disabled:t,isPressed:i,label:n,onClick:y,shortcut:l,showTooltip:!h,variant:h?"tertiary":void 0,"aria-expanded":i,ref:d,size:"compact"}))))},zp=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));function Gp(){const{createNotice:e}=(0,u.useDispatch)(mn.store),{getCurrentPostId:t,getCurrentPostType:n}=(0,u.useSelect)(tr),{getEditedEntityRecord:o}=(0,u.useSelect)(h.store);const r=(0,rr.useCopyToClipboard)((function(){const e=o("postType",n(),t());return e?"function"==typeof e.content?e.content(e):e.blocks?(0,c.__unstableSerializeAndClean)(e.blocks):e.content?e.content:void 0:""}),(function(){e("info",(0,g.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,P.createElement)(fr.MenuItem,{ref:r},(0,g.__)("Copy all blocks"))}const jp=[{value:"visual",label:(0,g.__)("Visual editor")},{value:"text",label:(0,g.__)("Code editor")}];const $p=function(){const{shortcut:e,isRichEditingEnabled:t,isCodeEditingEnabled:n,mode:o}=(0,u.useSelect)((e=>({shortcut:e(_r.store).getShortcutRepresentation("core/editor/toggle-mode"),isRichEditingEnabled:e(tr).getEditorSettings().richEditingEnabled,isCodeEditingEnabled:e(tr).getEditorSettings().codeEditingEnabled,mode:e(tr).getEditorMode()})),[]),{switchEditorMode:r}=(0,u.useDispatch)(tr);let s=o;t||"visual"!==o||(s="text"),n||"text"!==o||(s="visual");const a=jp.map((o=>(n||"text"!==o.value||(o={...o,disabled:!0}),t||"visual"!==o.value||(o={...o,disabled:!0,info:(0,g.__)("You can enable the visual editor in your profile settings.")}),o.value===s||o.disabled?o:{...o,shortcut:e})));return(0,P.createElement)(fr.MenuGroup,{label:(0,g.__)("Editor")},(0,P.createElement)(fr.MenuItemsChoice,{choices:a,value:s,onSelect:r}))},{Fill:Wp,Slot:Kp}=(0,fr.createSlotFill)("ToolsMoreMenuGroup");Wp.Slot=({fillProps:e})=>(0,P.createElement)(Kp,{fillProps:e});const Zp=Wp,{Fill:Yp,Slot:qp}=(0,fr.createSlotFill)("web"===S.Platform.OS?Symbol("ViewMoreMenuGroup"):"ViewMoreMenuGroup");Yp.Slot=({fillProps:e})=>(0,P.createElement)(qp,{fillProps:e});const Qp=Yp;function Xp(){const{openModal:e}=(0,u.useDispatch)(zr),{set:t}=(0,u.useDispatch)(x.store),{toggleDistractionFree:n}=(0,u.useDispatch)(tr),o=(0,u.useSelect)((e=>e(x.store).get("core","showIconLabels")),[]),r=()=>{t("core","distractionFree",!1)};return(0,P.createElement)(P.Fragment,null,(0,P.createElement)(fr.DropdownMenu,{icon:zp,label:(0,g.__)("Options"),popoverProps:{placement:"bottom-end",className:"more-menu-dropdown__content"},toggleProps:{showTooltip:!o,...o&&{variant:"tertiary"},tooltipPosition:"bottom",size:"compact"}},(({onClose:t})=>(0,P.createElement)(P.Fragment,null,(0,P.createElement)(fr.MenuGroup,{label:(0,g._x)("View","noun")},(0,P.createElement)(x.PreferenceToggleMenuItem,{scope:"core",name:"fixedToolbar",onToggle:r,label:(0,g.__)("Top toolbar"),info:(0,g.__)("Access all block and document tools in a single place"),messageActivated:(0,g.__)("Top toolbar activated"),messageDeactivated:(0,g.__)("Top toolbar deactivated")}),(0,P.createElement)(x.PreferenceToggleMenuItem,{scope:"core",name:"distractionFree",label:(0,g.__)("Distraction free"),info:(0,g.__)("Write with calmness"),handleToggling:!1,onToggle:n,messageActivated:(0,g.__)("Distraction free mode activated"),messageDeactivated:(0,g.__)("Distraction free mode deactivated"),shortcut:_s.displayShortcut.primaryShift("\\")}),(0,P.createElement)(x.PreferenceToggleMenuItem,{scope:"core",name:"focusMode",label:(0,g.__)("Spotlight mode"),info:(0,g.__)("Focus on one block at a time"),messageActivated:(0,g.__)("Spotlight mode activated"),messageDeactivated:(0,g.__)("Spotlight mode deactivated")}),(0,P.createElement)(Qp.Slot,{fillProps:{onClose:t}})),(0,P.createElement)($p,null),(0,P.createElement)(Yr.Slot,{name:"core/plugin-more-menu",label:(0,g.__)("Plugins"),as:fr.MenuGroup,fillProps:{onClick:t}}),(0,P.createElement)(fr.MenuGroup,{label:(0,g.__)("Tools")},(0,P.createElement)(fr.MenuItem,{onClick:()=>e("editor/keyboard-shortcut-help"),shortcut:_s.displayShortcut.access("h")},(0,g.__)("Keyboard shortcuts")),(0,P.createElement)(Gp,null),(0,P.createElement)(fr.MenuItem,{icon:Fu,href:(0,g.__)("https://wordpress.org/documentation/article/wordpress-block-editor/"),target:"_blank",rel:"noopener noreferrer"},(0,g.__)("Help"),(0,P.createElement)(fr.VisuallyHidden,{as:"span"},(0,g.__)("(opens in a new tab)"))),(0,P.createElement)(Zp.Slot,{fillProps:{onClose:t}})),(0,P.createElement)(fr.MenuGroup,null,(0,P.createElement)(fr.MenuItem,{onClick:()=>e("editor/preferences")},(0,g.__)("Preferences")))))))}const Jp=(0,rr.compose)((0,u.withSelect)((e=>{var t;return{hasPublishAction:null!==(t=e(tr).getCurrentPost()?._links?.["wp:action-publish"])&&void 0!==t&&t,isBeingScheduled:e(tr).isEditedPostBeingScheduled(),isPending:e(tr).isCurrentPostPending(),isPublished:e(tr).isCurrentPostPublished(),isPublishSidebarEnabled:e(tr).isPublishSidebarEnabled(),isPublishSidebarOpened:e(tr).isPublishSidebarOpened(),isScheduled:e(tr).isCurrentPostScheduled(),postStatus:e(tr).getEditedPostAttribute("status"),postStatusHasChanged:e(tr).getPostEdits()?.status}})),(0,u.withDispatch)((e=>{const{togglePublishSidebar:t}=e(tr);return{togglePublishSidebar:t}})))((function({forceIsDirty:e,hasPublishAction:t,isBeingScheduled:n,isPending:o,isPublished:r,isPublishSidebarEnabled:s,isPublishSidebarOpened:a,isScheduled:i,togglePublishSidebar:l,setEntitiesSavedStatesCallback:c,postStatusHasChanged:u,postStatus:d}){const p="toggle",m="button",g=(0,rr.useViewportMatch)("medium","<");let _;return _=r||u&&!["future","publish"].includes(d)||i&&n||o&&!t&&!g?m:g||s?p:m,(0,P.createElement)(pl,{forceIsDirty:e,isOpen:a,isToggle:_===p,onToggle:l,setEntitiesSavedStatesCallback:c})}));function em(){const{hasLoaded:e,permalink:t,isPublished:n,label:o,showIconLabels:r}=(0,u.useSelect)((e=>{const t=e(tr).getCurrentPostType(),n=e(h.store).getPostType(t),{get:o}=e(x.store);return{permalink:e(tr).getPermalink(),isPublished:e(tr).isCurrentPostPublished(),label:n?.labels.view_item,hasLoaded:!!n,showIconLabels:o("core","showIconLabels")}}),[]);return n&&t&&e?(0,P.createElement)(fr.Button,{icon:Fu,label:o||(0,g.__)("View post"),href:t,target:"_blank",showTooltip:!r,size:"compact"}):null}const tm=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.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"})),nm=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.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"})),om=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.Path,{d:"M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"}));function rm({forceIsAutosaveable:e,disabled:t}){const{deviceType:n,homeUrl:o,isTemplate:r,isViewable:s,showIconLabels:a}=(0,u.useSelect)((e=>{var t;const{getDeviceType:n,getCurrentPostType:o}=e(tr),{getUnstableBase:r,getPostType:s}=e(h.store),{get:a}=e(x.store),i=o();return{deviceType:n(),homeUrl:r()?.home,isTemplate:"wp_template"===i,isViewable:null!==(t=s(i)?.viewable)&&void 0!==t&&t,showIconLabels:a("core","showIconLabels")}}),[]),{setDeviceType:i}=(0,u.useDispatch)(tr);if((0,rr.useViewportMatch)("medium","<"))return null;const l={className:"editor-preview-dropdown__toggle",size:"compact",showTooltip:!a,disabled:t,__experimentalIsFocusable:t},c={"aria-label":(0,g.__)("View options")},d={mobile:tm,tablet:nm,desktop:om};return(0,P.createElement)(fr.DropdownMenu,{className:"editor-preview-dropdown",popoverProps:{placement:"bottom-end"},toggleProps:l,menuProps:c,icon:d[n.toLowerCase()],label:(0,g.__)("View"),disableOpenOnArrowDown:t},(({onClose:t})=>(0,P.createElement)(P.Fragment,null,(0,P.createElement)(fr.MenuGroup,null,(0,P.createElement)(fr.MenuItem,{onClick:()=>i("Desktop"),icon:"Desktop"===n&&Er},(0,g.__)("Desktop")),(0,P.createElement)(fr.MenuItem,{onClick:()=>i("Tablet"),icon:"Tablet"===n&&Er},(0,g.__)("Tablet")),(0,P.createElement)(fr.MenuItem,{onClick:()=>i("Mobile"),icon:"Mobile"===n&&Er},(0,g.__)("Mobile"))),r&&(0,P.createElement)(fr.MenuGroup,null,(0,P.createElement)(fr.MenuItem,{href:o,target:"_blank",icon:Fu,onClick:t},(0,g.__)("View site"),(0,P.createElement)(fr.VisuallyHidden,{as:"span"},(0,g.__)("(opens in a new tab)")))),s&&(0,P.createElement)(fr.MenuGroup,null,(0,P.createElement)(ll,{className:"editor-preview-dropdown__button-external",role:"menuitem",forceIsAutosaveable:e,textContent:(0,P.createElement)(P.Fragment,null,(0,g.__)("Preview in new tab"),(0,P.createElement)(fr.Icon,{icon:Fu})),onPreview:t})))))}const sm={hidden:{y:"-50px"},distractionFreeInactive:{y:0},hover:{y:0,transition:{type:"tween",delay:.2}}};const am=function({customSaveButton:e,forceIsDirty:t,forceDisableBlockTools:n,setEntitiesSavedStatesCallback:o,title:r,children:s}){const a=(0,rr.useViewportMatch)("large"),i=(0,rr.useViewportMatch)("medium"),{isTextEditor:l,isPublishSidebarOpened:c,showIconLabels:d,hasFixedToolbar:p,isNestedEntity:m,isZoomedOutView:g}=(0,u.useSelect)((e=>{const{get:t}=e(x.store),{getEditorMode:n,getEditorSettings:o,isPublishSidebarOpened:r}=e(tr),{__unstableGetEditorMode:s}=e(_.store);return{isTextEditor:"text"===n(),isPublishSidebarOpened:r(),showIconLabels:t("core","showIconLabels"),hasFixedToolbar:t("core","fixedToolbar"),isNestedEntity:!!o().onNavigateToPreviousEntityRecord,isZoomedOutView:"zoom-out"===s()}}),[]),h=i&&p,[b,f]=(0,S.useState)(!0);return(0,P.createElement)("div",{className:"editor-header edit-post-header"},s,(0,P.createElement)(fr.__unstableMotion.div,{variants:sm,transition:{type:"tween",delay:.8},className:"editor-header__toolbar"},(0,P.createElement)(Hp,{disableBlockTools:n||l}),h&&(0,P.createElement)(Fp,{isCollapsed:b,onToggle:f}),(0,P.createElement)("div",{className:br("editor-header__center",{"is-collapsed":!b&&h})},r||(0,P.createElement)(ia,{supportKeys:"title"},(0,P.createElement)(vs,null)))),(0,P.createElement)(fr.__unstableMotion.div,{variants:sm,transition:{type:"tween",delay:.8},className:"editor-header__settings"},!e&&!c&&(0,P.createElement)(Ec,{forceIsDirty:t}),(0,P.createElement)(rm,{forceIsAutosaveable:t,disabled:m||g}),(0,P.createElement)(ll,{className:"editor-header__post-preview-button",forceIsAutosaveable:t}),(0,P.createElement)(em,null),!e&&(0,P.createElement)(Jp,{forceIsDirty:t,setEntitiesSavedStatesCallback:o}),e,(a||!d)&&(0,P.createElement)(Jr.Slot,{scope:"core"}),(0,P.createElement)(Xp,null)))};function im(){return(0,P.createElement)(P.Fragment,null,(0,P.createElement)("div",{className:"editor-list-view-sidebar__outline"},(0,P.createElement)("div",null,(0,P.createElement)(fr.__experimentalText,null,(0,g.__)("Characters:")),(0,P.createElement)(fr.__experimentalText,null,(0,P.createElement)(su,null))),(0,P.createElement)("div",null,(0,P.createElement)(fr.__experimentalText,null,(0,g.__)("Words:")),(0,P.createElement)(nu,null)),(0,P.createElement)("div",null,(0,P.createElement)(fr.__experimentalText,null,(0,g.__)("Time to read:")),(0,P.createElement)(ru,null))),(0,P.createElement)(Ns,null))}const{Tabs:lm}=m(fr.privateApis);const{OverridesPanel:cm}=m(ir.privateApis);function um(){return(0,u.useSelect)((e=>"wp_block"===e(tr).getCurrentPostType()),[])?(0,P.createElement)(cm,null):null}const{PreferenceBaseOption:dm}=m(x.privateApis),pm=(0,rr.compose)((0,u.withSelect)((e=>({isChecked:e(tr).isPublishSidebarEnabled()}))),(0,u.withDispatch)((e=>{const{enablePublishSidebar:t,disablePublishSidebar:n}=e(tr);return{onChange:e=>e?t():n()}})))(dm);const mm=function({blockTypes:e,value:t,onItemChange:n}){return(0,P.createElement)("ul",{className:"editor-block-manager__checklist"},e.map((e=>(0,P.createElement)("li",{key:e.name,className:"editor-block-manager__checklist-item"},(0,P.createElement)(fr.CheckboxControl,{__nextHasNoMarginBottom:!0,label:e.title,checked:t.includes(e.name),onChange:(...t)=>n(e.name,...t)}),(0,P.createElement)(_.BlockIcon,{icon:e.icon})))))};const gm=function e({title:t,blockTypes:n}){const o=(0,rr.useInstanceId)(e),{allowedBlockTypes:r,hiddenBlockTypes:s}=(0,u.useSelect)((e=>{const{getEditorSettings:t}=e(tr),{get:n}=e(x.store);return{allowedBlockTypes:t().allowedBlockTypes,hiddenBlockTypes:n("core","hiddenBlockTypes")}}),[]),a=(0,S.useMemo)((()=>!0===r?n:n.filter((({name:e})=>r?.includes(e)))),[r,n]),{showBlockTypes:i,hideBlockTypes:l}=m((0,u.useDispatch)(tr)),c=(0,S.useCallback)(((e,t)=>{t?i(e):l(e)}),[i,l]),d=(0,S.useCallback)((e=>{const t=n.map((({name:e})=>e));e?i(t):l(t)}),[n,i,l]);if(!a.length)return null;const p=a.map((({name:e})=>e)).filter((e=>!(null!=s?s:[]).includes(e))),g="editor-block-manager__category-title-"+o,_=p.length===a.length,h=!_&&p.length>0;return(0,P.createElement)("div",{role:"group","aria-labelledby":g,className:"editor-block-manager__category"},(0,P.createElement)(fr.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:_,onChange:d,className:"editor-block-manager__category-title",indeterminate:h,label:(0,P.createElement)("span",{id:g},t)}),(0,P.createElement)(mm,{blockTypes:a,value:p,onItemChange:c}))};const _m=(0,rr.compose)([(0,u.withSelect)((e=>{var t;const{getBlockTypes:n,getCategories:o,hasBlockSupport:r,isMatchingSearchTerm:s}=e(c.store),{get:a}=e(x.store),i=n(),l=(null!==(t=a("core","hiddenBlockTypes"))&&void 0!==t?t:[]).filter((e=>i.some((t=>t.name===e)))),u=Array.isArray(l)&&l.length;return{blockTypes:i,categories:o(),hasBlockSupport:r,isMatchingSearchTerm:s,numberOfHiddenBlocks:u}})),(0,u.withDispatch)((e=>{const{showBlockTypes:t}=m(e(tr));return{enableAllBlockTypes:e=>{const n=e.map((({name:e})=>e));t(n)}}}))])((function({blockTypes:e,categories:t,hasBlockSupport:n,isMatchingSearchTerm:o,numberOfHiddenBlocks:r,enableAllBlockTypes:s}){const a=(0,rr.useDebounce)(un.speak,500),[i,l]=(0,S.useState)("");return e=e.filter((e=>n(e,"inserter",!0)&&(!i||o(e,i))&&(!e.parent||e.parent.includes("core/post-content")))),(0,S.useEffect)((()=>{if(!i)return;const t=e.length,n=(0,g.sprintf)((0,g._n)("%d result found.","%d results found.",t),t);a(n)}),[e.length,i,a]),(0,P.createElement)("div",{className:"editor-block-manager__content"},!!r&&(0,P.createElement)("div",{className:"editor-block-manager__disabled-blocks-count"},(0,g.sprintf)((0,g._n)("%d block is hidden.","%d blocks are hidden.",r),r),(0,P.createElement)(fr.Button,{variant:"link",onClick:()=>s(e)},(0,g.__)("Reset"))),(0,P.createElement)(fr.SearchControl,{__nextHasNoMarginBottom:!0,label:(0,g.__)("Search for a block"),placeholder:(0,g.__)("Search for a block"),value:i,onChange:e=>l(e),className:"editor-block-manager__search"}),(0,P.createElement)("div",{tabIndex:"0",role:"region","aria-label":(0,g.__)("Available block types"),className:"editor-block-manager__results"},0===e.length&&(0,P.createElement)("p",{className:"editor-block-manager__no-results"},(0,g.__)("No blocks found.")),t.map((t=>(0,P.createElement)(gm,{key:t.slug,title:t.title,blockTypes:e.filter((e=>e.category===t.slug))}))),(0,P.createElement)(gm,{title:(0,g.__)("Uncategorized"),blockTypes:e.filter((({category:e})=>!e))})))})),{PreferencesModal:hm,PreferencesModalTabs:bm,PreferencesModalSection:fm,PreferenceToggleControl:Em}=m(x.privateApis);const ym=(0,P.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.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 vm(e){return"string"==typeof e.title?(0,Ao.decodeEntities)(e.title):(0,Ao.decodeEntities)(e.title?.rendered||"")}const km={id:"move-to-trash",label:(0,g.__)("Move to Trash"),isPrimary:!0,icon:ym,isEligible:({status:e})=>"trash"!==e,supportsBulk:!0,hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionStart:n,onActionPerformed:o})=>{const[r,s]=(0,S.useState)(!1),{createSuccessNotice:a,createErrorNotice:i}=(0,u.useDispatch)(mn.store),{deleteEntityRecord:l}=(0,u.useDispatch)(h.store);return(0,P.createElement)(fr.__experimentalVStack,{spacing:"5"},(0,P.createElement)(fr.__experimentalText,null,1===e.length?(0,g.sprintf)((0,g.__)('Are you sure you want to delete "%s"?'),vm(e[0])):(0,g.sprintf)((0,g._n)("Are you sure you want to delete %d page?","Are you sure you want to delete %d pages?",e.length),e.length)),(0,P.createElement)(fr.__experimentalHStack,{justify:"right"},(0,P.createElement)(fr.Button,{variant:"tertiary",onClick:t,disabled:r,__experimentalIsFocusable:!0},(0,g.__)("Cancel")),(0,P.createElement)(fr.Button,{variant:"primary",onClick:async()=>{s(!0),n&&n(e);const r=await Promise.allSettled(e.map((e=>l("postType",e.type,e.id,{},{throwOnError:!0}))));if(r.every((({status:e})=>"fulfilled"===e))){let t;t=1===r.length?(0,g.sprintf)((0,g.__)('"%s" moved to the Trash.'),vm(e[0])):"page"===e[0].type?(0,g.sprintf)((0,g.__)("%s pages moved to the Trash."),e.length):(0,g.sprintf)((0,g.__)("%s posts moved to the Trash."),e.length),a(t,{type:"snackbar",id:"trash-post-action"})}else{let e;if(1===r.length)e=r[0].reason?.message?r[0].reason.message:(0,g.__)("An error occurred while moving the post to the trash.");else{const t=new Set,n=r.filter((({status:e})=>"rejected"===e));for(const e of n)e.reason?.message&&t.add(e.reason.message);e=0===t.size?(0,g.__)("An error occurred while moving the posts to the trash."):1===t.size?(0,g.sprintf)((0,g.__)("An error occurred while moving the posts to the trash: %s"),[...t][0]):(0,g.sprintf)((0,g.__)("Some errors occurred while moving the pages to the trash: %s"),[...t].join(","))}i(e,{type:"snackbar"})}o&&o(e),s(!1),t()},isBusy:r,disabled:r,__experimentalIsFocusable:!0},(0,g.__)("Delete"))))}};const wm={id:"view-post",label:(0,g.__)("View"),isPrimary:!0,icon:Fu,isEligible:e=>"trash"!==e.status,callback(e,t){const n=e[0];window.open(n.link,"_blank"),t&&t(e)}},Sm={id:"view-post-revisions",label:(0,g.__)("View revisions"),isPrimary:!1,isEligible:e=>{var t,n;if("trash"===e.status)return!1;const o=null!==(t=e?._links?.["predecessor-version"]?.[0]?.id)&&void 0!==t?t:null,r=null!==(n=e?._links?.["version-history"]?.[0]?.count)&&void 0!==n?n:0;return o&&r>1},callback(e,t){const n=e[0],o=(0,v.addQueryArgs)("revision.php",{revision:n?._links?.["predecessor-version"]?.[0]?.id});document.location.href=o,t&&t(e)}},Pm={id:"rename-post",label:(0,g.__)("Rename"),isEligible:e=>"trash"!==e.status,RenderModal:({items:e,closeModal:t,onActionPerformed:n})=>{const[o]=e,r=(0,Ao.decodeEntities)("string"==typeof o.title?o.title:o.title.rendered),[s,a]=(0,S.useState)((()=>r)),{editEntityRecord:i,saveEditedEntityRecord:l}=(0,u.useDispatch)(h.store),{createSuccessNotice:c,createErrorNotice:d}=(0,u.useDispatch)(mn.store);return(0,P.createElement)("form",{onSubmit:async function(r){r.preventDefault();try{await i("postType",o.type,o.id,{title:s}),a(""),t(),await l("postType",o.type,o.id,{throwOnError:!0}),c((0,g.__)("Name updated"),{type:"snackbar"}),n?.(e)}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,g.__)("An error occurred while updating the name");d(t,{type:"snackbar"})}}},(0,P.createElement)(fr.__experimentalVStack,{spacing:"5"},(0,P.createElement)(fr.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,g.__)("Name"),value:s,onChange:a,required:!0}),(0,P.createElement)(fr.__experimentalHStack,{justify:"right"},(0,P.createElement)(fr.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t()}},(0,g.__)("Cancel")),(0,P.createElement)(fr.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit"},(0,g.__)("Save")))))}},Cm=((0,g._x)("Duplicate","action label"),{id:"reset-template",label:(0,g.__)("Reset"),isEligible:Do,icon:tl,supportsBulk:!0,hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionStart:n,onActionPerformed:o})=>{const[r,s]=(0,S.useState)(!1),{revertTemplate:a}=m((0,u.useDispatch)(tr)),{saveEditedEntityRecord:i}=(0,u.useDispatch)(h.store),{createSuccessNotice:l,createErrorNotice:c}=(0,u.useDispatch)(mn.store);return(0,P.createElement)(fr.__experimentalVStack,{spacing:"5"},(0,P.createElement)(fr.__experimentalText,null,(0,g.__)("Reset to default and clear all customizations?")),(0,P.createElement)(fr.__experimentalHStack,{justify:"right"},(0,P.createElement)(fr.Button,{variant:"tertiary",onClick:t,disabled:r,__experimentalIsFocusable:!0},(0,g.__)("Cancel")),(0,P.createElement)(fr.Button,{variant:"primary",onClick:async()=>{s(!0),n&&n(e),await(async()=>{try{for(const t of e)await a(t,{allowUndo:!1}),await i("postType",t.type,t.id);l(e.length>1?(0,g.sprintf)((0,g.__)("%s items reset."),e.length):(0,g.sprintf)((0,g.__)('"%s" reset.'),(0,Ao.decodeEntities)(e[0].title.rendered)),{type:"snackbar",id:"revert-template-action"})}catch(t){let n;n=e[0].type===M?1===e.length?(0,g.__)("An error occurred while reverting the template."):(0,g.__)("An error occurred while reverting the templates."):1===e.length?(0,g.__)("An error occurred while reverting the template part."):(0,g.__)("An error occurred while reverting the template parts.");const o=t.message&&"unknown_error"!==t.code?t.message:n;c(o,{type:"snackbar"})}})(),o?.(e),t(),r(!1)},isBusy:r,disabled:r,__experimentalIsFocusable:!0},(0,g.__)("Reset"))))}});function Tm(e){return!!e&&(e.source===V.custom&&!e.has_theme_file)}const xm={id:"delete-template",label:(0,g.__)("Delete"),isEligible:Tm,icon:ym,supportsBulk:!0,hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionStart:n,onActionPerformed:o})=>{const[r,s]=(0,S.useState)(!1),{removeTemplates:a}=m((0,u.useDispatch)(tr));return(0,P.createElement)(fr.__experimentalVStack,{spacing:"5"},(0,P.createElement)(fr.__experimentalText,null,e.length>1?(0,g.sprintf)((0,g._n)("Delete %d item?","Delete %d items?",e.length),e.length):(0,g.sprintf)((0,g.__)('Delete "%s"?'),(0,Ao.decodeEntities)(e?.[0]?.title?.rendered))),(0,P.createElement)(fr.__experimentalHStack,{justify:"right"},(0,P.createElement)(fr.Button,{variant:"tertiary",onClick:t,disabled:r,__experimentalIsFocusable:!0},(0,g.__)("Cancel")),(0,P.createElement)(fr.Button,{variant:"primary",onClick:async()=>{s(!0),n&&n(e),await a(e,{allowUndo:!1}),o?.(e),s(!1),t()},isBusy:r,disabled:r,__experimentalIsFocusable:!0},(0,g.__)("Delete"))))}},Im={id:"rename-template",label:(0,g.__)("Rename"),isEligible:e=>!(!Tm(e)||e.type===M&&!e.is_custom),RenderModal:({items:e,closeModal:t,onActionPerformed:n})=>{const o=e[0],r=(0,Ao.decodeEntities)(o.title.rendered),[s,a]=(0,S.useState)(r),{editEntityRecord:i,__experimentalSaveSpecifiedEntityEdits:l}=(0,u.useDispatch)(h.store),{createSuccessNotice:c,createErrorNotice:d}=(0,u.useDispatch)(mn.store);return(0,P.createElement)("form",{onSubmit:async function(r){r.preventDefault();try{await i("postType",o.type,o.id,{title:s}),a(""),t(),await l("postType",o.type,o.id,["title"],{throwOnError:!0}),c(o.type===M?(0,g.__)("Template renamed."):(0,g.__)("Template part renamed."),{type:"snackbar"}),n?.(e)}catch(e){const t=o.type===M?(0,g.__)("An error occurred while renaming the template."):(0,g.__)("An error occurred while renaming the template part."),n=e.message&&"unknown_error"!==e.code?e.message:t;d(n,{type:"snackbar"})}}},(0,P.createElement)(fr.__experimentalVStack,{spacing:"5"},(0,P.createElement)(fr.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,g.__)("Name"),value:s,onChange:a,required:!0}),(0,P.createElement)(fr.__experimentalHStack,{justify:"right"},(0,P.createElement)(fr.Button,{variant:"tertiary",onClick:t,__next40pxDefaultSize:!0},(0,g.__)("Cancel")),(0,P.createElement)(fr.Button,{variant:"primary",type:"submit",__next40pxDefaultSize:!0},(0,g.__)("Save")))))}};function Bm(e,t){const{postTypeObject:n}=(0,u.useSelect)((t=>{const{getPostType:n}=t(h.store);return{postTypeObject:n(e)}}),[e]),o=function(){const{createSuccessNotice:e,createErrorNotice:t}=(0,u.useDispatch)(mn.store),{deleteEntityRecord:n}=(0,u.useDispatch)(h.store);return(0,S.useMemo)((()=>({id:"permanently-delete",label:(0,g.__)("Permanently delete"),supportsBulk:!0,isEligible:({status:e})=>"trash"===e,async callback(o,r){const s=await Promise.allSettled(o.map((e=>n("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(s.every((({status:e})=>"fulfilled"===e))){let t;t=1===s.length?(0,g.sprintf)((0,g.__)('"%s" permanently deleted.'),vm(o[0])):(0,g.__)("The posts were permanently deleted."),e(t,{type:"snackbar",id:"permanently-delete-post-action"}),r&&r(o)}else{let e;if(1===s.length)e=s[0].reason?.message?s[0].reason.message:(0,g.__)("An error occurred while permanently deleting the post.");else{const t=new Set,n=s.filter((({status:e})=>"rejected"===e));for(const e of n)e.reason?.message&&t.add(e.reason.message);e=0===t.size?(0,g.__)("An error occurred while permanently deleting the posts."):1===t.size?(0,g.sprintf)((0,g.__)("An error occurred while permanently deleting the posts: %s"),[...t][0]):(0,g.sprintf)((0,g.__)("Some errors occurred while permanently deleting the posts: %s"),[...t].join(","))}t(e,{type:"snackbar"})}}})),[e,t,n])}(),r=function(){const{createSuccessNotice:e,createErrorNotice:t}=(0,u.useDispatch)(mn.store),{editEntityRecord:n,saveEditedEntityRecord:o}=(0,u.useDispatch)(h.store);return(0,S.useMemo)((()=>({id:"restore",label:(0,g.__)("Restore"),isPrimary:!0,icon:tl,supportsBulk:!0,isEligible:({status:e})=>"trash"===e,async callback(r,s){await Promise.allSettled(r.map((e=>n("postType",e.type,e.id,{status:"draft"}))));const a=await Promise.allSettled(r.map((e=>o("postType",e.type,e.id,{throwOnError:!0}))));if(a.every((({status:e})=>"fulfilled"===e))){let t;t=1===r.length?(0,g.sprintf)((0,g.__)('"%s" has been restored.'),vm(r[0])):"page"===r[0].type?(0,g.sprintf)((0,g.__)("%d pages have been restored."),r.length):(0,g.sprintf)((0,g.__)("%d posts have been restored."),r.length),e(t,{type:"snackbar",id:"restore-post-action"}),s&&s(r)}else{let e;if(1===a.length)e=a[0].reason?.message?a[0].reason.message:(0,g.__)("An error occurred while restoring the post.");else{const t=new Set,n=a.filter((({status:e})=>"rejected"===e));for(const e of n)e.reason?.message&&t.add(e.reason.message);e=0===t.size?(0,g.__)("An error occurred while restoring the posts."):1===t.size?(0,g.sprintf)((0,g.__)("An error occurred while restoring the posts: %s"),[...t][0]):(0,g.sprintf)((0,g.__)("Some errors occurred while restoring the posts: %s"),[...t].join(","))}t(e,{type:"snackbar"})}}})),[e,t,n,o])}(),s=[M,L].includes(e),a=e===O,i=!!n;return(0,S.useMemo)((()=>{if(!i)return[];const e=[s&&Cm,n?.viewable&&wm,!s&&r,s&&xm,!s&&o,Sm,!1,!s&&Pm,s&&Im,!s&&km].filter(Boolean);if(t)for(let n=0;n{o(r,(o=>{s&&s(o),t(e[n].id,o)}))}}}if(e[n].RenderModal){const o=e[n].RenderModal;e[n]={...e[n],RenderModal:r=>(0,P.createElement)(o,{...r,onActionPerformed:o=>{r.onActionPerformed&&r.onActionPerformed(o),t(e[n].id,o)}})}}}return e}),[s,a,n?.viewable,o,r,t,i])}const{DropdownMenuV2:Nm,DropdownMenuGroupV2:Am,DropdownMenuItemV2:Dm,DropdownMenuItemLabelV2:Rm,kebabCase:Mm}=m(fr.privateApis);function Lm({onActionPerformed:e,buttonProps:t}){const[n,o]=(0,S.useState)(!1),{item:r,postType:s}=(0,u.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPost:n}=e(tr);return{item:n(),postType:t()}}),[]),a=Bm(s,e),i=(0,S.useMemo)((()=>a.filter((e=>!e.isEligible||e.isEligible(r)))),[a,r]);return(0,P.createElement)(Nm,{open:n,trigger:(0,P.createElement)(fr.Button,{size:"small",icon:zp,label:(0,g.__)("Actions"),disabled:!i.length,__experimentalIsFocusable:!0,className:"editor-all-actions-button",onClick:()=>o(!n),...t}),onOpenChange:o,placement:"bottom-end"},(0,P.createElement)(Vm,{actions:i,item:r,onClose:()=>{o(!1)}}))}function Om({action:e,onClick:t}){return(0,P.createElement)(Dm,{onClick:t,hideOnClick:!e.RenderModal},(0,P.createElement)(Rm,null,e.label))}function Fm({action:e,item:t,ActionTrigger:n,onClose:o}){const[r,s]=(0,S.useState)(!1),a={action:e,onClick:()=>s(!0)},{RenderModal:i,hideModalHeader:l}=e;return(0,P.createElement)(P.Fragment,null,(0,P.createElement)(n,{...a}),r&&(0,P.createElement)(fr.Modal,{title:e.modalHeader||e.label,__experimentalHideHeader:!!l,onRequestClose:()=>{s(!1)},overlayClassName:`editor-action-modal editor-action-modal__${Mm(e.id)}`},(0,P.createElement)(i,{items:[t],closeModal:()=>{s(!1),o()}})))}function Vm({actions:e,item:t,onClose:n}){return(0,P.createElement)(Am,null,e.map((e=>e.RenderModal?(0,P.createElement)(Fm,{key:e.id,action:e,item:t,ActionTrigger:Om,onClose:n}):(0,P.createElement)(Om,{key:e.id,action:e,onClick:()=>e.callback([t])}))))}function Um({actions:e}){const{title:t,icon:n}=(0,u.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:n,getCurrentPostId:o,__experimentalGetTemplateInfo:r}=e(tr),{getEditedEntityRecord:s}=e(h.store),a=n(),i=s("postType",a,o()),l=[M,L].includes(a)&&r(i);return{title:l?.title||t("title"),icon:m(e(tr)).getPostIcon(a,{area:i?.area})}}),[]);return(0,P.createElement)("div",{className:"editor-post-card-panel"},(0,P.createElement)(fr.__experimentalHStack,{spacing:2,className:"editor-post-card-panel__header",align:"flex-start"},(0,P.createElement)(fr.Icon,{className:"editor-post-card-panel__icon",icon:n}),(0,P.createElement)(fr.__experimentalText,{numberOfLines:2,truncate:!0,className:"editor-post-card-panel__title",weight:500,as:"h2"},t?(0,Ao.decodeEntities)(t):(0,g.__)("No Title")),e))}const Hm=(0,P.createElement)(C.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,P.createElement)(C.Path,{d:"m15.99 10.889-3.988 3.418-3.988-3.418.976-1.14 3.012 2.582 3.012-2.581.976 1.139Z"}));function zm({canEdit:e}){const t=(0,u.useSelect)((e=>e(tr).getEditedPostAttribute("status")),[]);let n;switch(t){case"publish":n=(0,g.__)("Published");break;case"future":n=(0,g.__)("Scheduled");break;case"draft":case"auto-draft":n=(0,g.__)("Draft");break;case"pending":n=(0,g.__)("Pending");break;case"private":n=(0,g.__)("Private")}return(0,P.createElement)(fr.__experimentalText,{className:br("editor-post-status-label",{[` has-status-${t}`]:!!t,"has-icon":e})},n,e&&(0,P.createElement)(bc,{icon:Hm}))}const Gm=[{label:(0,P.createElement)(P.Fragment,null,(0,g.__)("Draft"),(0,P.createElement)(fr.__experimentalText,{variant:"muted",size:12},(0,g.__)("Not ready to publish."))),value:"draft"},{label:(0,P.createElement)(P.Fragment,null,(0,g.__)("Pending"),(0,P.createElement)(fr.__experimentalText,{variant:"muted",size:12},(0,g.__)("Waiting for review before publishing."))),value:"pending"},{label:(0,P.createElement)(P.Fragment,null,(0,g.__)("Private"),(0,P.createElement)(fr.__experimentalText,{variant:"muted",size:12},(0,g.__)("Only visible to site admins and editors."))),value:"private"},{label:(0,P.createElement)(P.Fragment,null,(0,g.__)("Scheduled"),(0,P.createElement)(fr.__experimentalText,{variant:"muted",size:12},(0,g.__)("Publish automatically on a chosen date."))),value:"future"},{label:(0,P.createElement)(P.Fragment,null,(0,g.__)("Published"),(0,P.createElement)(fr.__experimentalText,{variant:"muted",size:12},(0,g.__)("Visible to everyone."))),value:"publish"}],jm=[M,L,O,F];function $m(){const{status:e,date:t,password:n,postId:o,postType:r,canEdit:s}=(0,u.useSelect)((e=>{var t;const{getEditedPostAttribute:n,getCurrentPostId:o,getCurrentPostType:r,getCurrentPost:s}=e(tr);return{status:n("status"),date:n("date"),password:n("password"),postId:o(),postType:r(),canEdit:null!==(t=s()._links?.["wp:action-publish"])&&void 0!==t&&t}}),[]),[a,i]=(0,S.useState)(!!n),l=(0,rr.useInstanceId)($m,"editor-change-status__password-input"),{editEntityRecord:c}=(0,u.useDispatch)(h.store),[d,p]=(0,S.useState)(null),m=(0,S.useMemo)((()=>({anchor:d,"aria-label":(0,g.__)("Status & visibility"),headerTitle:(0,g.__)("Status & visibility"),placement:"left-start",offset:36,shift:!0})),[d]);if(jm.includes(r))return null;const b=({status:s=e,password:a=n,date:i=t})=>{c("postType",r,o,{status:s,date:i,password:a})},f=e=>{i(e),e||b({password:""})},E=o=>{let r=t,s=n;"future"===e&&new Date(t)>new Date?r=null:"future"===o&&(!t||new Date(t)(0,P.createElement)(fr.Button,{className:"editor-post-status-trigger",onClick:e},(0,P.createElement)(zm,{canEdit:s})),renderContent:({onClose:t})=>(0,P.createElement)(P.Fragment,null,(0,P.createElement)(_.__experimentalInspectorPopoverHeader,{title:(0,g.__)("Status & visibility"),onClose:t}),(0,P.createElement)("form",null,(0,P.createElement)(fr.__experimentalVStack,{spacing:4},(0,P.createElement)(fr.RadioControl,{className:"editor-change-status__options",hideLabelFromVision:!0,label:(0,g.__)("Status"),options:Gm,onChange:E,selected:"auto-draft"===e?"draft":e}),"private"!==e&&(0,P.createElement)(fr.__experimentalVStack,{as:"fieldset",spacing:4,className:"editor-change-status__password-fieldset"},(0,P.createElement)(fr.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,g.__)("Password protected"),help:(0,g.__)("Only visible to those who know the password"),checked:a,onChange:f}),a&&(0,P.createElement)("div",{className:"editor-change-status__password-input"},(0,P.createElement)(fr.TextControl,{label:(0,g.__)("Password"),onChange:e=>b({password:e}),value:n,placeholder:(0,g.__)("Use a secure password"),type:"text",id:l,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}))))))}):(0,P.createElement)("div",{className:"editor-post-status"},(0,P.createElement)(zm,null)))}const{Fill:Wm,Slot:Km}=(0,fr.createSlotFill)("ActionsPanel");const Zm=189;function Ym(){const{postContent:e}=(0,u.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:n,getCurrentPostId:o}=e(tr),{getEntityRecord:r}=e(h.store),s=r("root","site"),a=n();return{postContent:!(+o()===s?.page_for_posts)&&![M,L].includes(a)&&t("content")}}),[]),t=(0,g._x)("words","Word count type. Do not translate!"),n=(0,S.useMemo)((()=>e?(0,tu.count)(e,t):0),[e,t]);if(!n)return null;const o=Math.round(n/Zm),r=(0,g.sprintf)((0,g._n)("%s word","%s words",n),n.toLocaleString()),s=o<=1?(0,g.__)("1 minute"):(0,g.sprintf)((0,g._n)("%s minute","%s minutes",o),o.toLocaleString());return(0,P.createElement)("div",{className:"editor-post-content-information"},(0,P.createElement)(fr.__experimentalText,null,(0,g.sprintf)((0,g.__)("%1$s, %2$s read time."),r,s)))}function qm(){const e=(0,u.useSelect)((e=>e(tr).getEditedPostAttribute("modified")),[]),t=e&&(0,g.sprintf)((0,g.__)("Last edited %s."),(0,y.humanTimeDiff)(e));return t?(0,P.createElement)("div",{className:"editor-post-last-edited-panel"},(0,P.createElement)(fr.__experimentalText,null,t)):null}const Qm=(0,P.createElement)(C.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.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"})),Xm=(0,P.createElement)(C.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,P.createElement)(C.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"}));const Jm=function(){return(0,P.createElement)(Xi,null,(0,P.createElement)(fr.PanelRow,{className:"editor-post-format__panel"},(0,P.createElement)(el,null)))};const eg=function({className:e,children:t}){return(0,P.createElement)(fr.__experimentalVStack,{className:br("editor-post-panel__section",e)},t)};function tg(){return(0,P.createElement)($c,null,(0,P.createElement)(jc,null))}function ng({area:e,clientId:t}){const{selectBlock:n,toggleBlockHighlight:o}=(0,u.useDispatch)(_.store),r=(0,u.useSelect)((t=>t(tr).__experimentalGetDefaultTemplatePartAreas().find((t=>t.area===e))),[e]),s=()=>o(t,!0),a=()=>o(t,!1);return(0,P.createElement)(fr.Button,{className:"editor-template-areas__item",icon:r?.icon,onMouseOver:s,onMouseLeave:a,onFocus:s,onBlur:a,onClick:()=>{n(t)}},r?.label)}function og(){const e=(0,u.useSelect)((e=>m(e(tr)).getCurrentTemplateTemplateParts()),[]);return e.length?(0,P.createElement)("section",{className:"editor-template-areas"},(0,P.createElement)(fr.__experimentalHeading,{level:3,className:"editor-template-areas__title"},(0,g.__)("Areas")),(0,P.createElement)("ul",{className:"editor-template-areas__list"},e.map((({templatePart:e,block:t})=>(0,P.createElement)("li",{key:t.clientId},(0,P.createElement)(ng,{area:e.area,clientId:t.clientId})))))):null}function rg({onActionPerformed:e}){const{isRemovedPostStatusPanel:t,postType:n}=(0,u.useSelect)((e=>{const{isEditorPanelRemoved:t,getCurrentPostType:n}=e(tr);return{isRemovedPostStatusPanel:t("post-status"),postType:n()}}),[]),o=n===O,r=n===M,s=n===L,a=n===F;return(0,P.createElement)(eg,{className:"editor-post-summary"},(0,P.createElement)(Ja.Slot,null,(n=>(0,P.createElement)(P.Fragment,null,(0,P.createElement)(fr.__experimentalVStack,{spacing:4},(0,P.createElement)(Um,{actions:(0,P.createElement)(Lm,{onActionPerformed:e})}),(0,P.createElement)(Qi,{withPanelBody:!1}),(0,P.createElement)(Fi,null),(0,P.createElement)(fr.__experimentalVStack,{spacing:1},(0,P.createElement)(Ym,null),(0,P.createElement)(qm,null)),!t&&(0,P.createElement)(fr.__experimentalVStack,{spacing:2},(0,P.createElement)(fr.__experimentalVStack,{spacing:1},(0,P.createElement)($m,null),(0,P.createElement)(kc,null),(0,P.createElement)(mi,null),(0,P.createElement)(Qc,null),(0,P.createElement)(xi,null),(0,P.createElement)(Ic,null)),(0,P.createElement)(Tc,null),(0,P.createElement)(Jm,null),(0,P.createElement)(vi,null),r&&(0,P.createElement)(og,null),n,!o&&!r&&!s&&!a&&(0,P.createElement)(tg,null)))))))}const{EXCLUDED_PATTERN_SOURCES:sg,PATTERN_TYPES:ag}=m(ir.privateApis);function ig(e,t){return e.innerBlocks=e.innerBlocks.map((e=>ig(e,t))),"core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=t),e}function lg(e,t){return e.filter(((e,n,o)=>((e,t,n)=>t===n.findIndex((t=>e.name===t.name)))(e,n,o)&&(e=>!sg.includes(e.source))(e)&&(e=>e.templateTypes?.includes(t.slug)||e.blockTypes?.includes("core/template-part/"+t.area))(e)))}function cg(e,t){return e.map((e=>({...e,keywords:e.keywords||[],type:ag.theme,blocks:(0,c.parse)(e.content,{__unstableSkipMigrationLogs:!0}).map((e=>ig(e,t)))})))}function ug({availableTemplates:e,onSelect:t}){const n=(0,rr.useAsyncList)(e);return e&&0!==e?.length?(0,P.createElement)(_.__experimentalBlockPatternsList,{label:(0,g.__)("Templates"),blockPatterns:e,shownPatterns:n,onClickPattern:t,showTitlesAsTooltip:!0}):null}function dg(){const{record:e,postType:t,postId:n}=(0,u.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:n}=e(tr),{getEditedEntityRecord:o}=e(h.store),r=t(),s=n();return{postType:r,postId:s,record:o("postType",r,s)}}),[]),{editEntityRecord:o}=(0,u.useDispatch)(h.store),r=function(e){const{blockPatterns:t,restBlockPatterns:n,currentThemeStylesheet:o}=(0,u.useSelect)((e=>{var t;const{getEditorSettings:n}=e(tr),o=n();return{blockPatterns:null!==(t=o.__experimentalAdditionalBlockPatterns)&&void 0!==t?t:o.__experimentalBlockPatterns,restBlockPatterns:e(h.store).getBlockPatterns(),currentThemeStylesheet:e(h.store).getCurrentTheme().stylesheet}}),[]);return(0,S.useMemo)((()=>cg(lg([...t||[],...n||[]],e),e)),[t,n,e,o])}(e);return r?.length?(0,P.createElement)(fr.PanelBody,{title:(0,g.__)("Transform into:"),initialOpen:e.type===L},(0,P.createElement)(fr.PanelRow,null,(0,P.createElement)("p",null,(0,g.__)("Choose a predefined pattern to switch up the look of your template."))),(0,P.createElement)(ug,{availableTemplates:r,onSelect:async e=>{await o("postType",t,n,{blocks:e.blocks,content:(0,c.serialize)(e.blocks)})}})):null}function pg(){const{postType:e}=(0,u.useSelect)((e=>{const{getCurrentPostType:t}=e(tr);return{postType:t()}}),[]);return[L,M].includes(e)?(0,P.createElement)(dg,null):null}const mg={document:"edit-post/document",block:"edit-post/block"},{Tabs:gg}=m(fr.privateApis),_g=(0,S.forwardRef)(((e,t)=>{const{documentLabel:n}=(0,u.useSelect)((e=>{const{getPostTypeLabel:t}=e(tr);return{documentLabel:t()||(0,g._x)("Document","noun")}}),[]);return(0,P.createElement)(gg.TabList,{ref:t},(0,P.createElement)(gg.Tab,{tabId:mg.document,"data-tab-id":mg.document},n),(0,P.createElement)(gg.Tab,{tabId:mg.block,"data-tab-id":mg.block},(0,g.__)("Block")))})),{BlockQuickNavigation:hg}=m(_.privateApis),bg=["core/post-content","core/post-featured-image","core/post-title"];function fg(){const e=(0,u.useSelect)((e=>{const{getBlocksByName:t}=e(_.store);return t(bg)}),[]);return(0,P.createElement)(fr.PanelBody,{title:(0,g.__)("Content")},(0,P.createElement)(hg,{clientIds:e}))}const{Tabs:Eg}=m(fr.privateApis),yg=S.Platform.select({web:!0,native:!1}),vg=({tabName:e,keyboardShortcut:t,renderingMode:n,onActionPerformed:o,extraPanels:r})=>{const s=(0,S.useRef)(null),a=(0,S.useContext)(Eg.Context);return(0,S.useEffect)((()=>{const t=Array.from(s.current?.querySelectorAll('[role="tab"]')||[]),n=t.find((t=>t.getAttribute("data-tab-id")===e)),o=n?.ownerDocument.activeElement;t.some((e=>o&&o.id===e.id))&&n&&n.id!==o?.id&&n?.focus()}),[e]),(0,P.createElement)(ri,{identifier:e,header:(0,P.createElement)(Eg.Context.Provider,{value:a},(0,P.createElement)(_g,{ref:s})),closeLabel:(0,g.__)("Close Settings"),className:"editor-sidebar__panel",headerClassName:"editor-sidebar__panel-tabs",title:(0,g.__)("Settings"),toggleShortcut:t,icon:(0,g.isRTL)()?Qm:Xm,isActiveByDefault:yg},(0,P.createElement)(Eg.Context.Provider,{value:a},(0,P.createElement)(Eg.TabPanel,{tabId:mg.document,focusable:!1},(0,P.createElement)(rg,{onActionPerformed:o}),(0,P.createElement)(Ga.Slot,null),"post-only"!==n&&(0,P.createElement)(fg,null),(0,P.createElement)(pg,null),(0,P.createElement)(rl,null),(0,P.createElement)(Rc,null),(0,P.createElement)(va,null),(0,P.createElement)(um,null),r),(0,P.createElement)(Eg.TabPanel,{tabId:mg.block,focusable:!1},(0,P.createElement)(_.BlockInspector,null))))},kg=({extraPanels:e,onActionPerformed:t})=>{Rp();const{tabName:n,keyboardShortcut:o,showSummary:r,renderingMode:s}=(0,u.useSelect)((e=>{const t=e(_r.store).getShortcutRepresentation("core/editor/toggle-sidebar"),n=e(zr).getActiveComplementaryArea("core");let o=n;return[mg.block,mg.document].includes(n)||(o=e(_.store).getBlockSelectionStart()?mg.block:mg.document),{tabName:o,keyboardShortcut:t,showSummary:![M,L,F].includes(e(tr).getCurrentPostType()),renderingMode:e(tr).getRenderingMode()}}),[]),{enableComplementaryArea:a}=(0,u.useDispatch)(zr),i=(0,S.useCallback)((e=>{e&&a("core",e)}),[a]);return(0,P.createElement)(Eg,{selectedTabId:n,onSelect:i,selectOnMove:!1},(0,P.createElement)(vg,{tabName:n,keyboardShortcut:o,showSummary:r,renderingMode:s,onActionPerformed:t,extraPanels:e}))},{store:wg,...Sg}=l,Pg={};p(Pg,{EditorCanvas:Dp,ExperimentalEditorProvider:md,EntitiesSavedStatesExtensible:Qs,GlobalStylesProvider:function({children:e}){const t=Pu();return t.isReady?(0,P.createElement)(ku.Provider,{value:t},e):null},Header:am,InserterSidebar:function({closeGeneralSidebar:e,isRightSidebarOpen:t}){const{blockSectionRootClientId:n,inserterSidebarToggleRef:o,insertionPoint:r,showMostUsedBlocks:s}=(0,u.useSelect)((e=>{const{getInserterSidebarToggleRef:t,getInsertionPoint:n}=m(e(tr)),{getBlockRootClientId:o,__unstableGetEditorMode:r,getSettings:s}=e(_.store),{get:a}=e(x.store);return{inserterSidebarToggleRef:t(),insertionPoint:n(),showMostUsedBlocks:a("core","mostUsedBlocks"),blockSectionRootClientId:(()=>{if("zoom-out"===r()){const{sectionRootClientId:e}=m(s());if(e)return e}return o()})()}}),[]),{setIsInserterOpened:a}=(0,u.useDispatch)(tr),i=(0,rr.useViewportMatch)("medium","<"),l=(0,S.useRef)(),c=(0,S.useCallback)((()=>{a(!1),o.current?.focus()}),[o,a]),d=(0,S.useCallback)((e=>{e.keyCode!==_s.ESCAPE||e.defaultPrevented||(e.preventDefault(),c())}),[c]);return(0,P.createElement)("div",{onKeyDown:d,className:"editor-inserter-sidebar"},(0,P.createElement)("div",{className:"editor-inserter-sidebar__content"},(0,P.createElement)(_.__experimentalLibrary,{showMostUsedBlocks:s,showInserterHelpPanel:!0,shouldFocusBlock:i,rootClientId:null!=n?n:r.rootClientId,__experimentalInsertionIndex:r.insertionIndex,__experimentalInitialTab:r.tab,__experimentalInitialCategory:r.category,__experimentalFilterValue:r.filterValue,__experimentalOnPatternCategorySelection:t?e:void 0,ref:l,onClose:c})))},ListViewSidebar:function(){const{setIsListViewOpened:e}=(0,u.useDispatch)(tr),{getListViewToggleRef:t}=m((0,u.useSelect)(tr)),n=(0,rr.useFocusOnMount)("firstElement"),o=(0,S.useCallback)((()=>{e(!1),t().current?.focus()}),[t,e]),r=(0,S.useCallback)((e=>{e.keyCode!==_s.ESCAPE||e.defaultPrevented||(e.preventDefault(),o())}),[o]),[s,a]=(0,S.useState)(null),[i,l]=(0,S.useState)("list-view"),c=(0,S.useRef)(),d=(0,S.useRef)(),p=(0,S.useRef)(),h=(0,rr.useMergeRefs)([n,p,a]),b=(0,S.useCallback)((()=>{c.current.contains(c.current.ownerDocument.activeElement)?o():function(e){const t=Oc.focus.tabbable.find(d.current)[0];if("list-view"===e){const e=Oc.focus.tabbable.find(p.current)[0];(c.current.contains(e)?e:t).focus()}else t.focus()}(i)}),[o,i]);return(0,_r.useShortcut)("core/editor/toggle-list-view",b),(0,P.createElement)("div",{className:"editor-list-view-sidebar",onKeyDown:r,ref:c},(0,P.createElement)(lm,{onSelect:e=>l(e),selectOnMove:!1,defaultTabId:"list-view"},(0,P.createElement)("div",{className:"editor-list-view-sidebar__header"},(0,P.createElement)(fr.Button,{className:"editor-list-view-sidebar__close-button",icon:wr,label:(0,g.__)("Close"),onClick:o,size:"small"}),(0,P.createElement)(lm.TabList,{className:"editor-list-view-sidebar__tabs-tablist",ref:d},(0,P.createElement)(lm.Tab,{className:"editor-list-view-sidebar__tabs-tab",tabId:"list-view"},(0,g._x)("List View","Post overview")),(0,P.createElement)(lm.Tab,{className:"editor-list-view-sidebar__tabs-tab",tabId:"outline"},(0,g._x)("Outline","Post overview")))),(0,P.createElement)(lm.TabPanel,{ref:h,className:"editor-list-view-sidebar__tabs-tabpanel",tabId:"list-view",focusable:!1},(0,P.createElement)("div",{className:"editor-list-view-sidebar__list-view-container"},(0,P.createElement)("div",{className:"editor-list-view-sidebar__list-view-panel-content"},(0,P.createElement)(_.__experimentalListView,{dropZoneElement:s})))),(0,P.createElement)(lm.TabPanel,{className:"editor-list-view-sidebar__tabs-tabpanel",tabId:"outline",focusable:!1},(0,P.createElement)("div",{className:"editor-list-view-sidebar__list-view-container"},(0,P.createElement)(im,null)))))},mergeBaseAndUserConfigs:Su,PatternOverridesPanel:um,PluginPostExcerpt:Ri,PostActions:Lm,PostPanelRow:pi,PreferencesModal:function({extraSections:e={}}){const t=(0,rr.useViewportMatch)("medium"),{isActive:n,showBlockBreadcrumbsOption:o}=(0,u.useSelect)((e=>{const{getEditorSettings:n}=e(tr),{get:o}=e(x.store),{isModalActive:r}=e(zr),s=n().richEditingEnabled;return{showBlockBreadcrumbsOption:!o("core","distractionFree")&&t&&s,isActive:r("editor/preferences")}}),[t]),{closeModal:r}=(0,u.useDispatch)(zr),{setIsListViewOpened:s,setIsInserterOpened:a}=(0,u.useDispatch)(tr),{set:i}=(0,u.useDispatch)(x.store),l=(0,S.useMemo)((()=>[{name:"general",tabLabel:(0,g.__)("General"),content:(0,P.createElement)(P.Fragment,null,(0,P.createElement)(fm,{title:(0,g.__)("Interface")},(0,P.createElement)(Em,{scope:"core",featureName:"showListViewByDefault",help:(0,g.__)("Opens the List View sidebar by default."),label:(0,g.__)("Always open List View")}),o&&(0,P.createElement)(Em,{scope:"core",featureName:"showBlockBreadcrumbs",help:(0,g.__)("Display the block hierarchy trail at the bottom of the editor."),label:(0,g.__)("Show block breadcrumbs")}),(0,P.createElement)(Em,{scope:"core",featureName:"allowRightClickOverrides",help:(0,g.__)("Allows contextual List View menus via right-click, overriding browser defaults."),label:(0,g.__)("Allow right-click contextual menus")})),(0,P.createElement)(fm,{title:(0,g.__)("Document settings"),description:(0,g.__)("Select what settings are shown in the document panel.")},(0,P.createElement)(Va.Slot,null),(0,P.createElement)(Nc,{taxonomyWrapper:(e,t)=>(0,P.createElement)(Ma,{label:t.labels.menu_name,panelName:`taxonomy-panel-${t.slug}`})}),(0,P.createElement)(zi,null,(0,P.createElement)(Ma,{label:(0,g.__)("Featured image"),panelName:"featured-image"})),(0,P.createElement)(Bi,null,(0,P.createElement)(Ma,{label:(0,g.__)("Excerpt"),panelName:"post-excerpt"})),(0,P.createElement)(ia,{supportKeys:["comments","trackbacks"]},(0,P.createElement)(Ma,{label:(0,g.__)("Discussion"),panelName:"discussion-panel"})),(0,P.createElement)(aa,null,(0,P.createElement)(Ma,{label:(0,g.__)("Page attributes"),panelName:"page-attributes"}))),t&&(0,P.createElement)(fm,{title:(0,g.__)("Publishing")},(0,P.createElement)(pm,{help:(0,g.__)("Review settings, such as visibility and tags."),label:(0,g.__)("Enable pre-publish checks")})),e?.general)},{name:"appearance",tabLabel:(0,g.__)("Appearance"),content:(0,P.createElement)(fm,{title:(0,g.__)("Appearance"),description:(0,g.__)("Customize the editor interface to suit your needs.")},(0,P.createElement)(Em,{scope:"core",featureName:"fixedToolbar",onToggle:()=>i("core","distractionFree",!1),help:(0,g.__)("Access all block and document tools in a single place."),label:(0,g.__)("Top toolbar")}),(0,P.createElement)(Em,{scope:"core",featureName:"distractionFree",onToggle:()=>{i("core","fixedToolbar",!0),a(!1),s(!1)},help:(0,g.__)("Reduce visual distractions by hiding the toolbar and other elements to focus on writing."),label:(0,g.__)("Distraction free")}),(0,P.createElement)(Em,{scope:"core",featureName:"focusMode",help:(0,g.__)("Highlights the current block and fades other content."),label:(0,g.__)("Spotlight mode")}),e?.appearance)},{name:"accessibility",tabLabel:(0,g.__)("Accessibility"),content:(0,P.createElement)(P.Fragment,null,(0,P.createElement)(fm,{title:(0,g.__)("Navigation"),description:(0,g.__)("Optimize the editing experience for enhanced control.")},(0,P.createElement)(Em,{scope:"core",featureName:"keepCaretInsideBlock",help:(0,g.__)("Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block."),label:(0,g.__)("Contain text cursor inside block")})),(0,P.createElement)(fm,{title:(0,g.__)("Interface")},(0,P.createElement)(Em,{scope:"core",featureName:"showIconLabels",label:(0,g.__)("Show button text labels"),help:(0,g.__)("Show text instead of icons on buttons across the interface.")})))},{name:"blocks",tabLabel:(0,g.__)("Blocks"),content:(0,P.createElement)(P.Fragment,null,(0,P.createElement)(fm,{title:(0,g.__)("Inserter")},(0,P.createElement)(Em,{scope:"core",featureName:"mostUsedBlocks",help:(0,g.__)("Adds a category with the most frequently used blocks in the inserter."),label:(0,g.__)("Show most used blocks")})),(0,P.createElement)(fm,{title:(0,g.__)("Manage block visibility"),description:(0,g.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.")},(0,P.createElement)(_m,null)))}]),[o,e,a,s,i,t]);return n?(0,P.createElement)(hm,{closeModal:r},(0,P.createElement)(bm,{sections:l})):null},usePostActions:Bm,PostCardPanel:Um,PostStatus:$m,ToolsMoreMenuGroup:Zp,ViewMoreMenuGroup:Qp,PrivatePostExcerptPanel:Fi,SavePublishPanels:function({setEntitiesSavedStatesCallback:e,closeEntitiesSavedStates:t,isEntitiesSavedStatesOpen:n,forceIsDirtyPublishPanel:o}){const{closePublishSidebar:r,togglePublishSidebar:s}=(0,u.useDispatch)(tr),{publishSidebarOpened:a,hasNonPostEntityChanges:i}=(0,u.useSelect)((e=>({publishSidebarOpened:e(tr).isPublishSidebarOpened(),hasNonPostEntityChanges:e(tr).hasNonPostEntityChanges()})),[]),l=(0,S.useCallback)((()=>e(!0)),[]);let c;return c=a?(0,P.createElement)(_c,{onClose:r,forceIsDirty:o,PrePublishExtension:oi.Slot,PostPublishExtension:Ya.Slot}):i?(0,P.createElement)("div",{className:"editor-layout__toggle-entities-saved-states-panel"},(0,P.createElement)(fr.Button,{variant:"secondary",className:"editor-layout__toggle-entities-saved-states-panel-button",onClick:l,"aria-expanded":!1},(0,g.__)("Open save panel"))):(0,P.createElement)("div",{className:"editor-layout__toggle-publish-panel"},(0,P.createElement)(fr.Button,{variant:"secondary",className:"editor-layout__toggle-publish-panel-button",onClick:s,"aria-expanded":!1},(0,g.__)("Open publish panel"))),(0,P.createElement)(P.Fragment,null,n&&(0,P.createElement)(qs,{close:t}),(0,P.createElement)(Km,{bubblesVirtually:!0}),!n&&c)},PostContentInformation:Ym,PostLastEditedPanel:qm,Sidebar:kg,useAutoSwitchEditorSidebars:Rp,useBlockEditorSettings:Bu,interfaceStore:wg,...Sg})})(),(window.wp=window.wp||{}).editor=o})();