[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/dist/ -> editor.min.js (source)

   1  /*! This file is auto-generated */
   2  !function(){var e={6411:function(e,t){var n,o,r;
   3  /*!
   4      autosize 4.0.4
   5      license: MIT
   6      http://www.jacklmoore.com/autosize
   7  */o=[e,t],n=function(e,t){"use strict";var n="function"==typeof Map?new Map:function(){var e=[],t=[];return{has:function(t){return e.indexOf(t)>-1},get:function(n){return t[e.indexOf(n)]},set:function(n,o){-1===e.indexOf(n)&&(e.push(n),t.push(o))},delete:function(n){var o=e.indexOf(n);o>-1&&(e.splice(o,1),t.splice(o,1))}}}(),o=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){o=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function r(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!n.has(e)){var t=null,r=null,i=null,s=function(){e.clientWidth!==r&&p()},a=function(t){window.removeEventListener("resize",s,!1),e.removeEventListener("input",p,!1),e.removeEventListener("keyup",p,!1),e.removeEventListener("autosize:destroy",a,!1),e.removeEventListener("autosize:update",p,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),n.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",a,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",p,!1),window.addEventListener("resize",s,!1),e.addEventListener("input",p,!1),e.addEventListener("autosize:update",p,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",n.set(e,{destroy:a,update:p}),l()}function l(){var 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 n=u(e),o=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",r=e.clientWidth,n.forEach((function(e){e.node.scrollTop=e.scrollTop})),o&&(document.documentElement.scrollTop=o)}}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<t?"hidden"===n.overflowY&&(c("scroll"),d(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),d(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),i!==r){i=r;var s=o("autosize:resized");try{e.dispatchEvent(s)}catch(e){}}}}function i(e){var t=n.get(e);t&&t.destroy()}function s(e){var t=n.get(e);t&&t.update()}var a=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((a=function(e){return e}).destroy=function(e){return e},a.update=function(e){return e}):((a=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return r(e,t)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e},a.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),e}),t.default=a,e.exports=t.default},void 0===(r="function"==typeof n?n.apply(t,o):n)||(e.exports=r)},4403:function(e,t){var n;
   8  /*!
   9    Copyright (c) 2018 Jed Watson.
  10    Licensed under the MIT License (MIT), see
  11    http://jedwatson.github.io/classnames
  12  */!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var s=r.apply(null,n);s&&e.push(s)}}else if("object"===i)if(n.toString===Object.prototype.toString)for(var a in n)o.call(n,a)&&n[a]&&e.push(a);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},4827:function(e){e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},9894:function(e,t,n){var o=n(4827);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 i=e.nodeName,s=document.createElement(i);s.innerHTML="&nbsp;","TEXTAREA"===i.toUpperCase()&&s.setAttribute("rows","1");var a=o(e,"font-size");s.style.fontSize=a,s.style.padding="0px",s.style.border="0px";var l=document.body;l.appendChild(s),n=s.offsetHeight,l.removeChild(s)}return n}},5372:function(e,t,n){"use strict";var o=n(9567);function r(){}function i(){}i.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,i,s){if(s!==o){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return n.PropTypes=n,n}},2652:function(e,t,n){e.exports=n(5372)()},9567:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5438: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)}),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},s=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};t.__esModule=!0;var a=n(9196),l=n(2652),c=n(6411),u=n(9894),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,o=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||o?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),o=(t.onChange,t.style),r=(t.innerRef,t.children),l=s(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return a.createElement("textarea",i({},l,{onChange:this.onChange,style:u?i({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),r)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:l.number,maxRows:l.number,onResize:l.func,innerRef:l.any,async:l.bool},t}(a.Component);t.TextareaAutosize=a.forwardRef((function(e,t){return a.createElement(p,i({},e,{innerRef:t}))}))},773:function(e,t,n){"use strict";var o=n(5438);t.Z=o.TextareaAutosize},9196:function(e){"use strict";e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(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=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";n.r(o),n.d(o,{AlignmentToolbar:function(){return ss},Autocomplete:function(){return is},AutosaveMonitor:function(){return lo},BlockAlignmentToolbar:function(){return as},BlockControls:function(){return ls},BlockEdit:function(){return cs},BlockEditorKeyboardShortcuts:function(){return us},BlockFormatControls:function(){return ds},BlockIcon:function(){return ps},BlockInspector:function(){return ms},BlockList:function(){return hs},BlockMover:function(){return gs},BlockNavigationDropdown:function(){return fs},BlockSelectionClearer:function(){return vs},BlockSettingsMenu:function(){return _s},BlockTitle:function(){return ys},BlockToolbar:function(){return bs},ColorPalette:function(){return Es},ContrastChecker:function(){return ws},CopyHandler:function(){return Ss},DefaultBlockAppender:function(){return Ps},DocumentOutline:function(){return bo},DocumentOutlineCheck:function(){return Eo},EditorHistoryRedo:function(){return Io},EditorHistoryUndo:function(){return No},EditorKeyboardShortcutsRegister:function(){return Co},EditorNotices:function(){return Do},EditorProvider:function(){return Ji},EditorSnackbars:function(){return Lo},EntitiesSavedStates:function(){return Vo},ErrorBoundary:function(){return Go},FontSizePicker:function(){return ks},InnerBlocks:function(){return Ts},Inserter:function(){return Cs},InspectorAdvancedControls:function(){return xs},InspectorControls:function(){return Bs},LocalAutosaveMonitor:function(){return qo},MediaPlaceholder:function(){return Ls},MediaUpload:function(){return Os},MediaUploadCheck:function(){return Fs},MultiSelectScrollIntoView:function(){return Us},NavigableToolbar:function(){return Ms},ObserveTyping:function(){return zs},PageAttributesCheck:function(){return Qo},PageAttributesOrder:function(){return Zo},PageAttributesParent:function(){return ir},PageTemplate:function(){return sr},PanelColorSettings:function(){return As},PlainText:function(){return Is},PostAuthor:function(){return ur},PostAuthorCheck:function(){return dr},PostComments:function(){return pr},PostExcerpt:function(){return mr},PostExcerptCheck:function(){return hr},PostFeaturedImage:function(){return Sr},PostFeaturedImageCheck:function(){return fr},PostFormat:function(){return Cr},PostFormatCheck:function(){return Pr},PostLastRevision:function(){return Br},PostLastRevisionCheck:function(){return xr},PostLockedModal:function(){return Ar},PostPendingStatus:function(){return Nr},PostPendingStatusCheck:function(){return Ir},PostPingbacks:function(){return Rr},PostPreviewButton:function(){return Lr},PostPublishButton:function(){return Ur},PostPublishButtonLabel:function(){return Or},PostPublishPanel:function(){return yi},PostSavedState:function(){return ki},PostSchedule:function(){return Kr},PostScheduleCheck:function(){return Ci},PostScheduleLabel:function(){return qr},PostSlug:function(){return Bi},PostSlugCheck:function(){return Ti},PostSticky:function(){return Ii},PostStickyCheck:function(){return Ai},PostSwitchToDraftButton:function(){return Pi},PostTaxonomies:function(){return Ni},PostTaxonomiesCheck:function(){return Ri},PostTaxonomiesFlatTermSelector:function(){return ni},PostTaxonomiesHierarchicalTermSelector:function(){return di},PostTextEditor:function(){return Li},PostTitle:function(){return Fi},PostTrash:function(){return Ui},PostTrashCheck:function(){return Mi},PostTypeSupportCheck:function(){return Yo},PostVisibility:function(){return Gr},PostVisibilityCheck:function(){return zi},PostVisibilityLabel:function(){return jr},RichText:function(){return rs},RichTextShortcut:function(){return Ns},RichTextToolbarButton:function(){return Rs},ServerSideRender:function(){return ts()},SkipToSelectedBlock:function(){return Vs},TableOfContents:function(){return $i},TextEditorGlobalKeyboardShortcuts:function(){return ko},ThemeSupportCheck:function(){return gr},URLInput:function(){return Hs},URLInputButton:function(){return Ws},URLPopover:function(){return Gs},UnsavedChangesWarning:function(){return Ki},VisualEditorGlobalKeyboardShortcuts:function(){return Po},Warning:function(){return js},WordCount:function(){return Wi},WritingFlow:function(){return $s},__unstableRichTextInputEvent:function(){return Ds},cleanForSlug:function(){return na},createCustomColorsHOC:function(){return Ks},getColorClassName:function(){return qs},getColorObjectByAttributeValues:function(){return Qs},getColorObjectByColorValue:function(){return Ys},getFontSize:function(){return Xs},getFontSizeClass:function(){return Zs},getTemplatePartIcon:function(){return U},mediaUpload:function(){return Xi},store:function(){return oo},storeConfig:function(){return no},transformStyles:function(){return p.transformStyles},userAutocompleter:function(){return so},withColorContext:function(){return Js},withColors:function(){return ea},withFontSizes:function(){return ta}});var e={};n.r(e),n.d(e,{__experimentalGetDefaultTemplatePartAreas:function(){return Ht},__experimentalGetDefaultTemplateType:function(){return Wt},__experimentalGetDefaultTemplateTypes:function(){return Vt},__experimentalGetTemplateInfo:function(){return Gt},__unstableIsEditorReady:function(){return Me},canInsertBlockType:function(){return Ft},canUserUseUnfilteredHTML:function(){return Re},didPostSaveRequestFail:function(){return fe},didPostSaveRequestSucceed:function(){return ge},getActivePostLock:function(){return Ne},getAdjacentBlockClientId:function(){return lt},getAutosaveAttribute:function(){return ne},getBlock:function(){return Ke},getBlockAttributes:function(){return $e},getBlockCount:function(){return Je},getBlockHierarchyRootClientId:function(){return at},getBlockIndex:function(){return wt},getBlockInsertionPoint:function(){return Nt},getBlockListSettings:function(){return zt},getBlockMode:function(){return Bt},getBlockName:function(){return Ge},getBlockOrder:function(){return Et},getBlockRootClientId:function(){return st},getBlockSelectionEnd:function(){return tt},getBlockSelectionStart:function(){return et},getBlocks:function(){return qe},getBlocksByClientId:function(){return Ze},getClientIdsOfDescendants:function(){return Qe},getClientIdsWithDescendants:function(){return Ye},getCurrentPost:function(){return q},getCurrentPostAttribute:function(){return ee},getCurrentPostId:function(){return Y},getCurrentPostLastRevisionId:function(){return Z},getCurrentPostRevisionsCount:function(){return X},getCurrentPostType:function(){return Q},getEditedPostAttribute:function(){return te},getEditedPostContent:function(){return Ee},getEditedPostPreviewLink:function(){return ye},getEditedPostSlug:function(){return ke},getEditedPostVisibility:function(){return oe},getEditorBlocks:function(){return Le},getEditorSelection:function(){return Ue},getEditorSelectionEnd:function(){return Fe},getEditorSelectionStart:function(){return Oe},getEditorSettings:function(){return ze},getFirstMultiSelectedBlockClientId:function(){return ht},getGlobalBlockCount:function(){return Xe},getInserterItems:function(){return Ut},getLastMultiSelectedBlockClientId:function(){return gt},getMultiSelectedBlockClientIds:function(){return pt},getMultiSelectedBlocks:function(){return mt},getMultiSelectedBlocksEndClientId:function(){return bt},getMultiSelectedBlocksStartClientId:function(){return yt},getNextBlockClientId:function(){return ut},getPermalink:function(){return Pe},getPermalinkParts:function(){return Ce},getPostEdits:function(){return J},getPostLockUser:function(){return Ie},getPostTypeLabel:function(){return jt},getPreviousBlockClientId:function(){return ct},getSelectedBlock:function(){return it},getSelectedBlockClientId:function(){return rt},getSelectedBlockCount:function(){return nt},getSelectedBlocksInitialCaretPosition:function(){return dt},getStateBeforeOptimisticTransaction:function(){return Ve},getSuggestedPostFormat:function(){return be},getTemplate:function(){return Lt},getTemplateLock:function(){return Ot},hasChangedContent:function(){return G},hasEditorRedo:function(){return H},hasEditorUndo:function(){return V},hasInserterItems:function(){return Mt},hasMultiSelection:function(){return Ct},hasNonPostEntityChanges:function(){return $},hasSelectedBlock:function(){return ot},hasSelectedInnerBlock:function(){return Pt},inSomeHistory:function(){return He},isAncestorMultiSelected:function(){return _t},isAutosavingPost:function(){return ve},isBlockInsertionPointVisible:function(){return Rt},isBlockMultiSelected:function(){return vt},isBlockSelected:function(){return St},isBlockValid:function(){return je},isBlockWithinSelection:function(){return kt},isCaretWithinFormattedText:function(){return It},isCleanNewPost:function(){return K},isCurrentPostPending:function(){return re},isCurrentPostPublished:function(){return ie},isCurrentPostScheduled:function(){return se},isEditedPostAutosaveable:function(){return ue},isEditedPostBeingScheduled:function(){return de},isEditedPostDateFloating:function(){return pe},isEditedPostDirty:function(){return j},isEditedPostEmpty:function(){return ce},isEditedPostNew:function(){return W},isEditedPostPublishable:function(){return ae},isEditedPostSaveable:function(){return le},isFirstMultiSelectedBlock:function(){return ft},isMultiSelecting:function(){return Tt},isPermalinkEditable:function(){return Se},isPostAutosavingLocked:function(){return Be},isPostLockTakeover:function(){return Ae},isPostLocked:function(){return Te},isPostSavingLocked:function(){return xe},isPreviewingPost:function(){return _e},isPublishSidebarEnabled:function(){return De},isPublishingPost:function(){return we},isSavingNonPostEntityChanges:function(){return he},isSavingPost:function(){return me},isSelectionEnabled:function(){return xt},isTyping:function(){return At},isValidTemplate:function(){return Dt}});var t={};function r(){return r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r.apply(this,arguments)}n.r(t),n.d(t,{__experimentalTearDownEditor:function(){return nn},autosave:function(){return dn},clearSelectedBlock:function(){return Rn},createUndoLevel:function(){return hn},disablePublishSidebar:function(){return vn},editPost:function(){return an},enablePublishSidebar:function(){return fn},enterFormattedText:function(){return Zn},exitFormattedText:function(){return Jn},hideInsertionPoint:function(){return Wn},insertBlock:function(){return zn},insertBlocks:function(){return Vn},insertDefaultBlock:function(){return eo},lockPostAutosaving:function(){return bn},lockPostSaving:function(){return _n},mergeBlocks:function(){return $n},moveBlockToPosition:function(){return Mn},moveBlocksDown:function(){return Fn},moveBlocksUp:function(){return Un},multiSelect:function(){return Nn},receiveBlocks:function(){return Cn},redo:function(){return pn},refreshPost:function(){return cn},removeBlock:function(){return qn},removeBlocks:function(){return Kn},replaceBlock:function(){return On},replaceBlocks:function(){return Ln},resetBlocks:function(){return kn},resetEditorBlocks:function(){return wn},resetPost:function(){return on},savePost:function(){return ln},selectBlock:function(){return Bn},setTemplateValidity:function(){return Gn},setupEditor:function(){return tn},setupEditorState:function(){return sn},showInsertionPoint:function(){return Hn},startMultiSelect:function(){return An},startTyping:function(){return Yn},stopMultiSelect:function(){return In},stopTyping:function(){return Xn},synchronizeTemplate:function(){return jn},toggleBlockMode:function(){return Qn},toggleSelection:function(){return Dn},trashPost:function(){return un},undo:function(){return mn},unlockPostAutosaving:function(){return En},unlockPostSaving:function(){return yn},updateBlock:function(){return Tn},updateBlockAttributes:function(){return xn},updateBlockListSettings:function(){return to},updateEditorSettings:function(){return Sn},updatePost:function(){return rn},updatePostLock:function(){return gn}});var i=window.wp.element,s=window.lodash,a=window.wp.blocks,l=window.wp.data,c=window.wp.coreData,u=window.wp.compose,d=window.wp.hooks,p=window.wp.blockEditor;const m={...p.SETTINGS_DEFAULTS,richEditingEnabled:!0,codeEditingEnabled:!0,enableCustomFields:void 0,supportsLayout:!0};function h(e){return e&&"object"==typeof e&&"raw"in e?e.raw:e}var g,f,v=(0,l.combineReducers)({postId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SETUP_EDITOR_STATE"===t.type?t.post.id:e},postType:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SETUP_EDITOR_STATE"===t.type?t.post.type:e},saving:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;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},postLock:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isLocked:!1},t=arguments.length>1?arguments[1]:void 0;return"UPDATE_POST_LOCK"===t.type?t.lock:e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},postSavingLock:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"LOCK_POST_SAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_SAVING":return(0,s.omit)(e,t.lockName)}return e},isReady:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SETUP_EDITOR_STATE":return!0;case"TEAR_DOWN_EDITOR":return!1}return e},editorSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m,t=arguments.length>1?arguments[1]:void 0;return"UPDATE_EDITOR_SETTINGS"===t.type?{...e,...t.settings}:e},postAutosavingLock:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"LOCK_POST_AUTOSAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_AUTOSAVING":return(0,s.omit)(e,t.lockName)}return e}});function _(e){return[e]}function y(){var e={clear:function(){e.head=null}};return e}function b(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function E(e,t){var n,o;function r(){n=f?new WeakMap:y()}function i(){var n,r,i,s,a,l=arguments.length;for(s=new Array(l),i=0;i<l;i++)s[i]=arguments[i];for(a=t.apply(null,s),(n=o(a)).isUniqueByDependants||(n.lastDependants&&!b(a,n.lastDependants,0)&&n.clear(),n.lastDependants=a),r=n.head;r;){if(b(r.args,s,1))return r!==n.head&&(r.prev.next=r.next,r.next&&(r.next.prev=r.prev),r.next=n.head,r.prev=null,n.head.prev=r,n.head=r),r.val;r=r.next}return r={val:e.apply(null,s)},s[0]=null,r.args=s,n.head&&(n.head.prev=r,r.next=n.head),n.head=r,r.val}return t||(t=_),o=f?function(e){var t,o,r,i,s,a=n,l=!0;for(t=0;t<e.length;t++){if(o=e[t],!(s=o)||"object"!=typeof s){l=!1;break}a.has(o)?a=a.get(o):(r=new WeakMap,a.set(o,r),a=r)}return a.has(g)||((i=y()).isUniqueByDependants=l,a.set(g,i)),a.get(g)}:function(){return n},i.getDependants=t,i.clear=r,r(),i}g={},f="undefined"!=typeof WeakMap;var w=window.wp.date,S=window.wp.url,P=window.wp.deprecated,k=n.n(P),C=window.wp.primitives;var T=(0,i.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.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;const B=new Set(["meta"]),A="SAVE_POST_NOTICE_ID",I="TRASH_POST_NOTICE_ID",N=/%(?:postname|pagename)%/,R=["title","excerpt","content"];var D=(0,i.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.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"}));var L=(0,i.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.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"}));var O=(0,i.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.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"}));var F=(0,i.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.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 U(e){return"header"===e?D:"footer"===e?L:"sidebar"===e?O:F}const M={},z=[],V=(0,l.createRegistrySelector)((e=>()=>e(c.store).hasUndo())),H=(0,l.createRegistrySelector)((e=>()=>e(c.store).hasRedo()));function W(e){return"auto-draft"===q(e).status}function G(e){const t=J(e);return"blocks"in t||"content"in t}const j=(0,l.createRegistrySelector)((e=>t=>{const n=Q(t),o=Y(t);return!!e(c.store).hasEditsForEntityRecord("postType",n,o)})),$=(0,l.createRegistrySelector)((e=>t=>{const n=e(c.store).__experimentalGetDirtyEntityRecords(),{type:o,id:r}=q(t);return(0,s.some)(n,(e=>"postType"!==e.kind||e.name!==o||e.key!==r))}));function K(e){return!j(e)&&W(e)}const q=(0,l.createRegistrySelector)((e=>t=>{const n=Y(t),o=Q(t),r=e(c.store).getRawEntityRecord("postType",o,n);return r||M}));function Q(e){return e.postType}function Y(e){return e.postId}function X(e){return(0,s.get)(q(e),["_links","version-history",0,"count"],0)}function Z(e){return(0,s.get)(q(e),["_links","predecessor-version",0,"id"],null)}const J=(0,l.createRegistrySelector)((e=>t=>{const n=Q(t),o=Y(t);return e(c.store).getEntityRecordEdits("postType",n,o)||M}));function ee(e,t){switch(t){case"type":return Q(e);case"id":return Y(e);default:const n=q(e);if(!n.hasOwnProperty(t))break;return h(n[t])}}function te(e,t){if("content"===t)return Ee(e);const n=J(e);return n.hasOwnProperty(t)?B.has(t)?((e,t)=>{const n=J(e);return n.hasOwnProperty(t)?{...ee(e,t),...n[t]}:ee(e,t)})(e,t):n[t]:ee(e,t)}const ne=(0,l.createRegistrySelector)((e=>(t,n)=>{if(!(0,s.includes)(R,n)&&"preview_link"!==n)return;const o=Q(t),r=Y(t),i=(0,s.get)(e(c.store).getCurrentUser(),["id"]),a=e(c.store).getAutosave(o,r,i);return a?h(a[n]):void 0}));function oe(e){if("private"===te(e,"status"))return"private";return te(e,"password")?"password":"public"}function re(e){return"pending"===q(e).status}function ie(e,t){const n=t||q(e);return-1!==["publish","private"].indexOf(n.status)||"future"===n.status&&!(0,w.isInTheFuture)(new Date(Number((0,w.getDate)(n.date))-6e4))}function se(e){return"future"===q(e).status&&!ie(e)}function ae(e){const t=q(e);return j(e)||-1===["publish","private","future"].indexOf(t.status)}function le(e){return!me(e)&&(!!te(e,"title")||!!te(e,"excerpt")||!ce(e)||"native"===i.Platform.OS)}function ce(e){const t=Le(e);if(t.length){if(t.length>1)return!1;const e=t[0].name;if(e!==(0,a.getDefaultBlockName)()&&e!==(0,a.getFreeformContentHandlerName)())return!1}return!Ee(e)}const ue=(0,l.createRegistrySelector)((e=>t=>{if(!le(t))return!1;if(Be(t))return!1;const n=Q(t),o=Y(t),r=e(c.store).hasFetchedAutosaves(n,o),i=(0,s.get)(e(c.store).getCurrentUser(),["id"]),a=e(c.store).getAutosave(n,o,i);return!!r&&(!a||(!!G(t)||["title","excerpt"].some((e=>h(a[e])!==te(t,e)))))}));function de(e){const t=te(e,"date"),n=new Date(Number((0,w.getDate)(t))-6e4);return(0,w.isInTheFuture)(n)}function pe(e){const t=te(e,"date"),n=te(e,"modified"),o=q(e).status;return("draft"===o||"auto-draft"===o||"pending"===o)&&(t===n||null===t)}const me=(0,l.createRegistrySelector)((e=>t=>{const n=Q(t),o=Y(t);return e(c.store).isSavingEntityRecord("postType",n,o)})),he=(0,l.createRegistrySelector)((e=>t=>{const n=e(c.store).__experimentalGetEntitiesBeingSaved(),{type:o,id:r}=q(t);return(0,s.some)(n,(e=>"postType"!==e.kind||e.name!==o||e.key!==r))})),ge=(0,l.createRegistrySelector)((e=>t=>{const n=Q(t),o=Y(t);return!e(c.store).getLastEntitySaveError("postType",n,o)})),fe=(0,l.createRegistrySelector)((e=>t=>{const n=Q(t),o=Y(t);return!!e(c.store).getLastEntitySaveError("postType",n,o)}));function ve(e){return!!me(e)&&!!(0,s.get)(e.saving,["options","isAutosave"])}function _e(e){return!!me(e)&&!!(0,s.get)(e.saving,["options","isPreview"])}function ye(e){if(e.saving.pending||me(e))return;let t=ne(e,"preview_link");t&&"draft"!==q(e).status||(t=te(e,"link"),t&&(t=(0,S.addQueryArgs)(t,{preview:!0})));const n=te(e,"featured_media");return t&&n?(0,S.addQueryArgs)(t,{_thumbnail_id:n}):t}function be(e){const t=Le(e);if(t.length>2)return null;let n;if(1===t.length&&(n=t[0].name,"core/embed"===n)){var o;const e=null===(o=t[0].attributes)||void 0===o?void 0:o.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}}const Ee=(0,l.createRegistrySelector)((e=>t=>{const n=Y(t),o=Q(t),r=e(c.store).getEditedEntityRecord("postType",o,n);if(r){if("function"==typeof r.content)return r.content(r);if(r.blocks)return(0,a.__unstableSerializeAndClean)(r.blocks);if(r.content)return r.content}return""}));function we(e){return me(e)&&!ie(e)&&"publish"===te(e,"status")}function Se(e){const t=te(e,"permalink_template");return N.test(t)}function Pe(e){const t=Ce(e);if(!t)return null;const{prefix:n,postName:o,suffix:r}=t;return Se(e)?n+o+r:n}function ke(e){return te(e,"slug")||(0,S.cleanForSlug)(te(e,"title"))||Y(e)}function Ce(e){const t=te(e,"permalink_template");if(!t)return null;const n=te(e,"slug")||te(e,"generated_slug"),[o,r]=t.split(N);return{prefix:o,postName:n,suffix:r}}function Te(e){return e.postLock.isLocked}function xe(e){return Object.keys(e.postSavingLock).length>0}function Be(e){return Object.keys(e.postAutosavingLock).length>0}function Ae(e){return e.postLock.isTakeover}function Ie(e){return e.postLock.user}function Ne(e){return e.postLock.activePostLock}function Re(e){return(0,s.has)(q(e),["_links","wp:action-unfiltered-html"])}const De=(0,l.createRegistrySelector)((e=>()=>!!e(x.store).get("core/edit-post","isPublishSidebarEnabled")));function Le(e){return te(e,"blocks")||z}function Oe(e){var t;return k()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),null===(t=te(e,"selection"))||void 0===t?void 0:t.selectionStart}function Fe(e){var t;return k()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),null===(t=te(e,"selection"))||void 0===t?void 0:t.selectionEnd}function Ue(e){return te(e,"selection")}function Me(e){return e.isReady}function ze(e){return e.editorSettings}function Ve(){return k()("select('core/editor').getStateBeforeOptimisticTransaction",{since:"5.7",hint:"No state history is kept on this store anymore"}),null}function He(){return k()("select('core/editor').inSomeHistory",{since:"5.7",hint:"No state history is kept on this store anymore"}),!1}function We(e){return(0,l.createRegistrySelector)((t=>function(n){k()("`wp.data.select( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.select( 'core/block-editor' )."+e+"`",version:"6.2"});for(var o=arguments.length,r=new Array(o>1?o-1:0),i=1;i<o;i++)r[i-1]=arguments[i];return t(p.store)[e](...r)}))}const Ge=We("getBlockName"),je=We("isBlockValid"),$e=We("getBlockAttributes"),Ke=We("getBlock"),qe=We("getBlocks"),Qe=We("getClientIdsOfDescendants"),Ye=We("getClientIdsWithDescendants"),Xe=We("getGlobalBlockCount"),Ze=We("getBlocksByClientId"),Je=We("getBlockCount"),et=We("getBlockSelectionStart"),tt=We("getBlockSelectionEnd"),nt=We("getSelectedBlockCount"),ot=We("hasSelectedBlock"),rt=We("getSelectedBlockClientId"),it=We("getSelectedBlock"),st=We("getBlockRootClientId"),at=We("getBlockHierarchyRootClientId"),lt=We("getAdjacentBlockClientId"),ct=We("getPreviousBlockClientId"),ut=We("getNextBlockClientId"),dt=We("getSelectedBlocksInitialCaretPosition"),pt=We("getMultiSelectedBlockClientIds"),mt=We("getMultiSelectedBlocks"),ht=We("getFirstMultiSelectedBlockClientId"),gt=We("getLastMultiSelectedBlockClientId"),ft=We("isFirstMultiSelectedBlock"),vt=We("isBlockMultiSelected"),_t=We("isAncestorMultiSelected"),yt=We("getMultiSelectedBlocksStartClientId"),bt=We("getMultiSelectedBlocksEndClientId"),Et=We("getBlockOrder"),wt=We("getBlockIndex"),St=We("isBlockSelected"),Pt=We("hasSelectedInnerBlock"),kt=We("isBlockWithinSelection"),Ct=We("hasMultiSelection"),Tt=We("isMultiSelecting"),xt=We("isSelectionEnabled"),Bt=We("getBlockMode"),At=We("isTyping"),It=We("isCaretWithinFormattedText"),Nt=We("getBlockInsertionPoint"),Rt=We("isBlockInsertionPointVisible"),Dt=We("isValidTemplate"),Lt=We("getTemplate"),Ot=We("getTemplateLock"),Ft=We("canInsertBlockType"),Ut=We("getInserterItems"),Mt=We("hasInserterItems"),zt=We("getBlockListSettings");function Vt(e){var t;return null===(t=ze(e))||void 0===t?void 0:t.defaultTemplateTypes}const Ht=E((e=>{var t;const n=(null===(t=ze(e))||void 0===t?void 0:t.defaultTemplatePartAreas)||[];return null==n?void 0:n.map((e=>({...e,icon:U(e.icon)})))}),(e=>{var t;return[null===(t=ze(e))||void 0===t?void 0:t.defaultTemplatePartAreas]})),Wt=E(((e,t)=>(0,s.find)(Vt(e),{slug:t})||{}),((e,t)=>[Vt(e),t]));function Gt(e,t){var n;if(!t)return{};const{excerpt:o,slug:r,title:i,area:a}=t,{title:l,description:c}=Wt(e,r),u=(0,s.isString)(i)?i:null==i?void 0:i.rendered;return{title:u&&u!==r?u:l||r,description:((0,s.isString)(o)?o:null==o?void 0:o.raw)||c,icon:(null===(n=Ht(e).find((e=>a===e.area)))||void 0===n?void 0:n.icon)||T}}const jt=(0,l.createRegistrySelector)((e=>t=>{var n;const o=Q(t),r=e(c.store).getPostType(o);return null==r||null===(n=r.labels)||void 0===n?void 0:n.singular_name}));var $t=window.wp.apiFetch,Kt=n.n($t),qt=window.wp.notices;function Qt(e,t){return`wp-autosave-block-editor-post-$t?"auto-draft":e}`}function Yt(e,t,n,o,r){window.sessionStorage.setItem(Qt(e,t),JSON.stringify({post_title:n,content:o,excerpt:r}))}function Xt(e,t){window.sessionStorage.removeItem(Qt(e,t))}var Zt=window.wp.i18n;function Jt(e){const{previousPost:t,post:n,postType:o}=e;if((0,s.get)(e.options,["isAutosave"]))return[];if("trash"===n.status&&"trash"!==t.status)return[];const r=["publish","private","future"],i=(0,s.includes)(r,t.status),a=(0,s.includes)(r,n.status);let l,c,u=(0,s.get)(o,["viewable"],!1);i||a?i&&!a?(l=o.labels.item_reverted_to_draft,u=!1):l=!i&&a?{publish:o.labels.item_published,private:o.labels.item_published_privately,future:o.labels.item_scheduled}[n.status]:o.labels.item_updated:(l=(0,Zt.__)("Draft saved."),c=!0);const d=[];return u&&d.push({label:c?(0,Zt.__)("View Preview"):o.labels.view_item,url:n.link}),[l,{id:A,type:"snackbar",actions:d}]}function en(e){const{post:t,edits:n,error:o}=e;if(o&&"rest_autosave_no_changes"===o.code)return[];const r=["publish","private","future"],i=-1!==r.indexOf(t.status),s={publish:(0,Zt.__)("Publishing failed."),private:(0,Zt.__)("Publishing failed."),future:(0,Zt.__)("Scheduling failed.")};let a=i||-1===r.indexOf(n.status)?(0,Zt.__)("Updating failed."):s[n.status];return o.message&&!/<\/?[^>]*>/.test(o.message)&&(a=[a,o.message].join(" ")),[a,{id:A}]}const tn=(e,t,n)=>o=>{let{dispatch:r}=o;r.setupEditorState(e);if("auto-draft"===e.status&&n){let o;o=(0,s.has)(t,["content"])?t.content:e.content.raw;let i=(0,a.parse)(o);i=(0,a.synchronizeBlocksWithTemplate)(i,n),r.resetEditorBlocks(i,{__unstableShouldCreateUndoLevel:!1})}t&&Object.values(t).some((t=>{var n,o;let[r,i]=t;return i!==(null!==(n=null===(o=e[r])||void 0===o?void 0:o.raw)&&void 0!==n?n:e[r])}))&&r.editPost(t)};function nn(){return{type:"TEAR_DOWN_EDITOR"}}function on(){return k()("wp.data.dispatch( 'core/editor' ).resetPost",{since:"6.0",version:"6.3",alternative:"Initialize the editor with the setupEditorState action"}),{type:"DO_NOTHING"}}function rn(){return k()("wp.data.dispatch( 'core/editor' ).updatePost",{since:"5.7",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function sn(e){return{type:"SETUP_EDITOR_STATE",post:e}}const an=(e,t)=>n=>{let{select:o,registry:r}=n;const{id:i,type:s}=o.getCurrentPost();r.dispatch(c.store).editEntityRecord("postType",s,i,e,t)},ln=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return async t=>{let{select:n,dispatch:o,registry:r}=t;if(!n.isEditedPostSaveable())return;const i=n.getEditedPostContent();e.isAutosave||o.editPost({content:i},{undoIgnore:!0});const s=n.getCurrentPost(),a={id:s.id,...r.select(c.store).getEntityRecordNonTransientEdits("postType",s.type,s.id),content:i};o({type:"REQUEST_POST_UPDATE_START",options:e}),await r.dispatch(c.store).saveEntityRecord("postType",s.type,a,e),o({type:"REQUEST_POST_UPDATE_FINISH",options:e});const l=r.select(c.store).getLastEntitySaveError("postType",s.type,s.id);if(l){const e=en({post:s,edits:a,error:l});e.length&&r.dispatch(qt.store).createErrorNotice(...e)}else{const t=n.getCurrentPost(),o=Jt({previousPost:s,post:t,postType:await r.resolveSelect(c.store).getPostType(t.type),options:e});o.length&&r.dispatch(qt.store).createSuccessNotice(...o),e.isAutosave||r.dispatch(p.store).__unstableMarkLastChangeAsPersistent()}}};function cn(){return k()("wp.data.dispatch( 'core/editor' ).refreshPost",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}const un=()=>async e=>{let{select:t,dispatch:n,registry:o}=e;const r=t.getCurrentPostType(),i=await o.resolveSelect(c.store).getPostType(r);o.dispatch(qt.store).removeNotice(I);try{const e=t.getCurrentPost();await Kt()({path:`/wp/v2/$i.rest_base}/$e.id}`,method:"DELETE"}),await n.savePost()}catch(e){o.dispatch(qt.store).createErrorNotice(...(s={error:e},[s.error.message&&"unknown_error"!==s.error.code?s.error.message:(0,Zt.__)("Trashing failed"),{id:I}]))}var s},dn=function(){let{local:e=!1,...t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return async n=>{let{select:o,dispatch:r}=n;if(e){const e=o.getCurrentPost(),t=o.isEditedPostNew(),n=o.getEditedPostAttribute("title"),r=o.getEditedPostAttribute("content"),i=o.getEditedPostAttribute("excerpt");Yt(e.id,t,n,r,i)}else await r.savePost({isAutosave:!0,...t})}},pn=()=>e=>{let{registry:t}=e;t.dispatch(c.store).redo()},mn=()=>e=>{let{registry:t}=e;t.dispatch(c.store).undo()};function hn(){return k()("wp.data.dispatch( 'core/editor' ).createUndoLevel",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function gn(e){return{type:"UPDATE_POST_LOCK",lock:e}}const fn=()=>e=>{let{registry:t}=e;t.dispatch(x.store).set("core/edit-post","isPublishSidebarEnabled",!0)},vn=()=>e=>{let{registry:t}=e;t.dispatch(x.store).set("core/edit-post","isPublishSidebarEnabled",!1)};function _n(e){return{type:"LOCK_POST_SAVING",lockName:e}}function yn(e){return{type:"UNLOCK_POST_SAVING",lockName:e}}function bn(e){return{type:"LOCK_POST_AUTOSAVING",lockName:e}}function En(e){return{type:"UNLOCK_POST_AUTOSAVING",lockName:e}}const wn=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{select:o,dispatch:r,registry:i}=n;const{__unstableShouldCreateUndoLevel:s,selection:l}=t,u={blocks:e,selection:l};if(!1!==s){const{id:e,type:t}=o.getCurrentPost();if(i.select(c.store).getEditedEntityRecord("postType",t,e).blocks===u.blocks)return void i.dispatch(c.store).__unstableCreateUndoLevel("postType",t,e);u.content=e=>{let{blocks:t=[]}=e;return(0,a.__unstableSerializeAndClean)(t)}}r.editPost(u)}};function Sn(e){return{type:"UPDATE_EDITOR_SETTINGS",settings:e}}const Pn=e=>function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return t=>{let{registry:o}=t;k()("`wp.data.dispatch( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.dispatch( 'core/block-editor' )."+e+"`",version:"6.2"}),o.dispatch(p.store)[e](...n)}},kn=Pn("resetBlocks"),Cn=Pn("receiveBlocks"),Tn=Pn("updateBlock"),xn=Pn("updateBlockAttributes"),Bn=Pn("selectBlock"),An=Pn("startMultiSelect"),In=Pn("stopMultiSelect"),Nn=Pn("multiSelect"),Rn=Pn("clearSelectedBlock"),Dn=Pn("toggleSelection"),Ln=Pn("replaceBlocks"),On=Pn("replaceBlock"),Fn=Pn("moveBlocksDown"),Un=Pn("moveBlocksUp"),Mn=Pn("moveBlockToPosition"),zn=Pn("insertBlock"),Vn=Pn("insertBlocks"),Hn=Pn("showInsertionPoint"),Wn=Pn("hideInsertionPoint"),Gn=Pn("setTemplateValidity"),jn=Pn("synchronizeTemplate"),$n=Pn("mergeBlocks"),Kn=Pn("removeBlocks"),qn=Pn("removeBlock"),Qn=Pn("toggleBlockMode"),Yn=Pn("startTyping"),Xn=Pn("stopTyping"),Zn=Pn("enterFormattedText"),Jn=Pn("exitFormattedText"),eo=Pn("insertDefaultBlock"),to=Pn("updateBlockListSettings"),no={reducer:v,selectors:e,actions:t},oo=(0,l.createReduxStore)("core/editor",{...no});(0,l.register)(oo);function ro(e){const t=(0,s.mapValues)((0,s.pickBy)(e.attributes,{source:"meta"}),"meta");return(0,s.isEmpty)(t)||(e.edit=(e=>(0,u.createHigherOrderComponent)((t=>n=>{let{attributes:o,setAttributes:a,...u}=n;const d=(0,l.useSelect)((e=>e(oo).getCurrentPostType()),[]),[p,m]=(0,c.useEntityProp)("postType",d,"meta"),h=(0,i.useMemo)((()=>({...o,...(0,s.mapValues)(e,(e=>p[e]))})),[o,p]);return(0,i.createElement)(t,r({attributes:h,setAttributes:t=>{const n=(0,s.mapKeys)((0,s.pickBy)(t,((t,n)=>e[n])),((t,n)=>e[n]));(0,s.isEmpty)(n)||m(n),a(t)}},u))}),"withMetaAttributeSource"))(t)(e.edit)),e}function io(e){const t=e.avatar_urls&&e.avatar_urls[24]?(0,i.createElement)("img",{className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls[24]}):(0,i.createElement)("span",{className:"editor-autocompleters__no-avatar"});return(0,i.createElement)(i.Fragment,null,t,(0,i.createElement)("span",{className:"editor-autocompleters__user-name"},e.name),(0,i.createElement)("span",{className:"editor-autocompleters__user-slug"},e.slug))}(0,d.addFilter)("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",ro),(0,l.select)(a.store).getBlockTypes().map((e=>{let{name:t}=e;return(0,l.select)(a.store).getBlockType(t)})).forEach(ro);var so={name:"users",className:"editor-autocompleters__user",triggerPrefix:"@",useItems(e){const t=(0,l.useSelect)((t=>{const{getUsers:n}=t(c.store);return n({context:"view",search:encodeURIComponent(e)})}),[e]),n=(0,i.useMemo)((()=>t?t.map((e=>({key:`user-$e.slug}`,value:e,label:io(e)}))):[]),[t]);return[n]},getOptionCompletion:e=>`@$e.slug}`};(0,d.addFilter)("editor.Autocomplete.completers","editor/autocompleters/set-default-completers",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.push((0,s.clone)(so)),e}));class ao extends i.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(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3*this.props.interval;this.timerId=setTimeout((()=>{this.autosaveTimerHandler()}),e)}autosaveTimerHandler(){this.props.isAutosaveable?(this.needsAutosave&&(this.needsAutosave=!1,this.props.autosave()),this.setAutosaveTimer()):this.setAutosaveTimer(1e3)}render(){return null}}var lo=(0,u.compose)([(0,l.withSelect)(((e,t)=>{const{getReferenceByDistinctEdits:n}=e(c.store),{isEditedPostDirty:o,isEditedPostAutosaveable:r,isAutosavingPost:i,getEditorSettings:s}=e(oo),{interval:a=s().autosaveInterval}=t;return{editsReference:n(),isDirty:o(),isAutosaveable:r(),isAutosaving:i(),interval:a}})),(0,l.withDispatch)(((e,t)=>({autosave(){const{autosave:n=e(oo).autosave}=t;n()}})))])(ao),co=window.wp.richText,uo=n(4403),po=n.n(uo);var mo=e=>{let{children:t,isValid:n,level:o,href:r,onSelect:s}=e;return(0,i.createElement)("li",{className:po()("document-outline__item",`is-$o.toLowerCase()}`,{"is-invalid":!n})},(0,i.createElement)("a",{href:r,className:"document-outline__button",onClick:s},(0,i.createElement)("span",{className:"document-outline__emdash","aria-hidden":"true"}),(0,i.createElement)("strong",{className:"document-outline__level"},o),(0,i.createElement)("span",{className:"document-outline__item-content"},t)))};const ho=(0,i.createElement)("em",null,(0,Zt.__)("(Empty heading)")),go=[(0,i.createElement)("br",{key:"incorrect-break"}),(0,i.createElement)("em",{key:"incorrect-message"},(0,Zt.__)("(Incorrect heading level)"))],fo=[(0,i.createElement)("br",{key:"incorrect-break-h1"}),(0,i.createElement)("em",{key:"incorrect-message-h1"},(0,Zt.__)("(Your theme may already use a H1 for the post title)"))],vo=[(0,i.createElement)("br",{key:"incorrect-break-multiple-h1"}),(0,i.createElement)("em",{key:"incorrect-message-multiple-h1"},(0,Zt.__)("(Multiple H1 headings are not recommended)"))],_o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(0,s.flatMap)(e,(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return"core/heading"===e.name?{...e,level:e.attributes.level,isEmpty:yo(e)}:_o(e.innerBlocks)}))},yo=e=>!e.attributes.content||0===e.attributes.content.length;var bo=(0,u.compose)((0,l.withSelect)((e=>{const{getBlocks:t}=e(p.store),{getEditedPostAttribute:n}=e(oo),{getPostType:o}=e(c.store),r=o(n("type"));return{title:n("title"),blocks:t(),isTitleSupported:(0,s.get)(r,["supports","title"],!1)}})))((e=>{let{blocks:t=[],title:n,onSelect:o,isTitleSupported:r,hasOutlineItemsDisabled:a}=e;const l=_o(t);if(l.length<1)return null;let c=1;const u=document.querySelector(".editor-post-title__input"),d=r&&n&&u,p=(0,s.countBy)(l,"level")[1]>1;return(0,i.createElement)("div",{className:"document-outline"},(0,i.createElement)("ul",null,d&&(0,i.createElement)(mo,{level:(0,Zt.__)("Title"),isValid:!0,onSelect:o,href:`#$u.id}`,isDisabled:a},n),l.map(((e,t)=>{const n=e.level>c+1,r=!(e.isEmpty||n||!e.level||1===e.level&&(p||d));return c=e.level,(0,i.createElement)(mo,{key:t,level:`H$e.level}`,isValid:r,isDisabled:a,href:`#block-$e.clientId}`,onSelect:o},e.isEmpty?ho:(0,co.getTextContent)((0,co.create)({html:e.attributes.content})),n&&go,1===e.level&&p&&vo,d&&1===e.level&&!p&&fo)}))))}));var Eo=(0,l.withSelect)((e=>({blocks:e(p.store).getBlocks()})))((function(e){let{blocks:t,children:n}=e;return(0,s.filter)(t,(e=>"core/heading"===e.name)).length<1?null:n})),wo=window.wp.keyboardShortcuts;var So=function(e){let{resetBlocksOnSave:t}=e;const{resetEditorBlocks:n,savePost:o}=(0,l.useDispatch)(oo),{isEditedPostDirty:r,getPostEdits:i,isPostSavingLocked:s}=(0,l.useSelect)(oo);return(0,wo.useShortcut)("core/editor/save",(e=>{if(e.preventDefault(),!s()&&r()){if(t){const e=i();if(e.content&&"string"==typeof e.content){const t=(0,a.parse)(e.content);n(t)}}o()}})),null};var Po=function(){const{redo:e,undo:t}=(0,l.useDispatch)(oo);return(0,wo.useShortcut)("core/editor/undo",(e=>{t(),e.preventDefault()})),(0,wo.useShortcut)("core/editor/redo",(t=>{e(),t.preventDefault()})),(0,i.createElement)(So,null)};function ko(){return(0,i.createElement)(So,{resetBlocksOnSave:!0})}var Co=function(){const{registerShortcut:e}=(0,l.useDispatch)(wo.store);return(0,i.useEffect)((()=>{e({name:"core/editor/save",category:"global",description:(0,Zt.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/editor/undo",category:"global",description:(0,Zt.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/editor/redo",category:"global",description:(0,Zt.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"}})}),[e]),(0,i.createElement)(p.BlockEditorKeyboardShortcuts.Register,null)},To=window.wp.components,xo=window.wp.keycodes;var Bo=(0,i.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.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"}));var Ao=(0,i.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.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"}));var Io=(0,i.forwardRef)((function(e,t){const n=(0,l.useSelect)((e=>e(oo).hasEditorRedo()),[]),{redo:o}=(0,l.useDispatch)(oo);return(0,i.createElement)(To.Button,r({},e,{ref:t,icon:(0,Zt.isRTL)()?Ao:Bo,label:(0,Zt.__)("Redo"),shortcut:xo.displayShortcut.primaryShift("z"),"aria-disabled":!n,onClick:n?o:void 0,className:"editor-history__redo"}))}));var No=(0,i.forwardRef)((function(e,t){const n=(0,l.useSelect)((e=>e(oo).hasEditorUndo()),[]),{undo:o}=(0,l.useDispatch)(oo);return(0,i.createElement)(To.Button,r({},e,{ref:t,icon:(0,Zt.isRTL)()?Bo:Ao,label:(0,Zt.__)("Undo"),shortcut:xo.displayShortcut.primary("z"),"aria-disabled":!n,onClick:n?o:void 0,className:"editor-history__undo"}))}));var Ro=(0,u.compose)([(0,l.withSelect)((e=>({isValid:e(p.store).isValidTemplate()}))),(0,l.withDispatch)((e=>{const{setTemplateValidity:t,synchronizeTemplate:n}=e(p.store);return{resetTemplateValidity:()=>t(!0),synchronizeTemplate:n}}))])((function(e){let{isValid:t,...n}=e;return t?null:(0,i.createElement)(To.Notice,{className:"editor-template-validation-notice",isDismissible:!1,status:"warning",actions:[{label:(0,Zt.__)("Keep it as is"),onClick:n.resetTemplateValidity},{label:(0,Zt.__)("Reset the template"),onClick:()=>{window.confirm((0,Zt.__)("Resetting the template may result in loss of content, do you want to continue?"))&&n.synchronizeTemplate()}}]},(0,Zt.__)("The content of your post doesn’t match the template assigned to your post type."))}));var Do=(0,u.compose)([(0,l.withSelect)((e=>({notices:e(qt.store).getNotices()}))),(0,l.withDispatch)((e=>({onRemove:e(qt.store).removeNotice})))])((function(e){let{notices:t,onRemove:n}=e;const o=(0,s.filter)(t,{isDismissible:!0,type:"default"}),r=(0,s.filter)(t,{isDismissible:!1,type:"default"});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(To.NoticeList,{notices:r,className:"components-editor-notices__pinned"}),(0,i.createElement)(To.NoticeList,{notices:o,className:"components-editor-notices__dismissible",onRemove:n},(0,i.createElement)(Ro,null)))}));function Lo(){const e=(0,l.useSelect)((e=>e(qt.store).getNotices()),[]),{removeNotice:t}=(0,l.useDispatch)(qt.store),n=(0,s.filter)(e,{type:"snackbar"});return(0,i.createElement)(To.SnackbarList,{notices:n,className:"components-editor-notices__snackbar",onRemove:t})}var Oo=window.wp.htmlEntities;function Fo(e){let{record:t,checked:n,onChange:o,closePanel:r}=e;const{name:s,kind:a,title:u,key:d}=t,m=(0,l.useSelect)((e=>{var t;const{blocks:n=[]}=e(c.store).getEditedEntityRecord(a,s,d),o=e(p.store).getBlockParents(null===(t=n[0])||void 0===t?void 0:t.clientId);return o[o.length-1]}),[]),h=(0,l.useSelect)((e=>{if("postType"!==a||"wp_template"!==s)return u;const t=e(c.store).getEditedEntityRecord(a,s,d);return e(oo).__experimentalGetTemplateInfo(t).title}),[s,a,u,d]),g=(0,l.useSelect)((e=>e(p.store).getSelectedBlockClientId()===m),[m]),f=g?(0,Zt.__)("Selected"):(0,Zt.__)("Select"),{selectBlock:v}=(0,l.useDispatch)(p.store),_=(0,i.useCallback)((()=>v(m)),[m]),y=(0,i.useCallback)((()=>{v(m),r()}),[m]);return(0,i.createElement)(To.PanelRow,null,(0,i.createElement)(To.CheckboxControl,{label:(0,i.createElement)("strong",null,(0,Oo.decodeEntities)(h)||(0,Zt.__)("Untitled")),checked:n,onChange:o}),m?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(To.Button,{onClick:_,className:"entities-saved-states__find-entity",disabled:g},f),(0,i.createElement)(To.Button,{onClick:y,className:"entities-saved-states__find-entity-small",disabled:g},f)):null)}function Uo(e){let{list:t,unselectedEntities:n,setUnselectedEntities:o,closePanel:r}=e;const a=t.length,u=t[0],d=(0,l.useSelect)((e=>e(c.store).getEntityConfig(u.kind,u.name)),[u.kind,u.name]),{name:p}=u;let m=d.label;"wp_template_part"===p&&(m=1===a?(0,Zt.__)("Template Part"):(0,Zt.__)("Template Parts"));const h=function(e,t){switch(e){case"site":return 1===t?(0,Zt.__)("This change will affect your whole site."):(0,Zt.__)("These changes will affect your whole site.");case"wp_template":return(0,Zt.__)("This change will affect pages and posts that use this template.");case"page":case"post":return(0,Zt.__)("The following content has been modified.")}}(p,a);return(0,i.createElement)(To.PanelBody,{title:m,initialOpen:!0},h&&(0,i.createElement)(To.PanelRow,null,h),t.map((e=>(0,i.createElement)(Fo,{key:e.key||e.property,record:e,checked:!(0,s.some)(n,(t=>t.kind===e.kind&&t.name===e.name&&t.key===e.key&&t.property===e.property)),onChange:t=>o(e,t),closePanel:r}))))}const Mo={title:(0,Zt.__)("Title"),description:(0,Zt.__)("Tagline"),site_logo:(0,Zt.__)("Logo"),site_icon:(0,Zt.__)("Icon"),show_on_front:(0,Zt.__)("Show on front"),page_on_front:(0,Zt.__)("Page on front")},zo=[{kind:"postType",name:"wp_navigation"}];function Vo(e){let{close:t}=e;const n=(0,i.useRef)(),{dirtyEntityRecords:o}=(0,l.useSelect)((e=>{const t=e(c.store).__experimentalGetDirtyEntityRecords().filter((e=>!("root"===e.kind&&"site"===e.name))),n=e(c.store).getEntityRecordEdits("root","site"),o=[];for(const e in n)o.push({kind:"root",name:"site",title:Mo[e]||e,property:e});return{dirtyEntityRecords:[...t,...o]}}),[]),{editEntityRecord:a,saveEditedEntityRecord:d,__experimentalSaveSpecifiedEntityEdits:m}=(0,l.useDispatch)(c.store),{__unstableMarkLastChangeAsPersistent:h}=(0,l.useDispatch)(p.store),{createSuccessNotice:g,createErrorNotice:f}=(0,l.useDispatch)(qt.store),v=(0,s.groupBy)(o,"name"),{site:_,wp_template:y,wp_template_part:b,...E}=v,w=[_,y,b,...Object.values(E)].filter(Array.isArray),[S,P]=(0,i.useState)([]),k=(e,t)=>{let{kind:n,name:o,key:r,property:i}=e;P(t?S.filter((e=>e.kind!==n||e.name!==o||e.key!==r||e.property!==i)):[...S,{kind:n,name:o,key:r,property:i}])},C=(0,i.useCallback)((()=>t()),[t]),[T,x]=(0,u.__experimentalUseDialog)({onClose:()=>C()});return(0,i.createElement)("div",r({ref:T},x,{className:"entities-saved-states__panel"}),(0,i.createElement)(To.Flex,{className:"entities-saved-states__panel-header",gap:2},(0,i.createElement)(To.FlexItem,{isBlock:!0,as:To.Button,ref:n,variant:"primary",disabled:o.length-S.length==0,onClick:()=>{const e=o.filter((e=>{let{kind:t,name:n,key:o,property:r}=e;return!(0,s.some)(S,(e=>e.kind===t&&e.name===n&&e.key===o&&e.property===r))}));t(e);const n=[],r=[];e.forEach((e=>{let{kind:t,name:o,key:i,property:s}=e;"root"===t&&"site"===o?n.push(s):(zo.some((e=>e.kind===t&&e.name===o))&&a(t,o,i,{status:"publish"}),r.push(d(t,o,i)))})),n.length&&r.push(m("root","site",void 0,n)),h(),Promise.all(r).then((e=>{e.some((e=>void 0===e))?f((0,Zt.__)("Saving failed.")):g((0,Zt.__)("Site updated."),{type:"snackbar"})})).catch((e=>f(`${(0,Zt.__)("Saving failed.")} $e}`)))},className:"editor-entities-saved-states__save-button"},(0,Zt.__)("Save")),(0,i.createElement)(To.FlexItem,{isBlock:!0,as:To.Button,variant:"secondary",onClick:C},(0,Zt.__)("Cancel"))),(0,i.createElement)("div",{className:"entities-saved-states__text-prompt"},(0,i.createElement)("strong",null,(0,Zt.__)("Are you ready to save?")),(0,i.createElement)("p",null,(0,Zt.__)("The following changes have been made to your site, templates, and content."))),w.map((e=>(0,i.createElement)(Uo,{key:e[0].name,list:e,closePanel:C,unselectedEntities:S,setUnselectedEntities:k}))))}function Ho(e){let{text:t,children:n}=e;const o=(0,u.useCopyToClipboard)(t);return(0,i.createElement)(To.Button,{variant:"secondary",ref:o},n)}class Wo extends i.Component{constructor(){super(...arguments),this.reboot=this.reboot.bind(this),this.getContent=this.getContent.bind(this),this.state={error:null}}componentDidCatch(e){this.setState({error:e})}reboot(){this.props.onError()}getContent(){try{return(0,l.select)(oo).getEditedPostContent()}catch(e){}}render(){const{error:e}=this.state;return e?(0,i.createElement)(p.Warning,{className:"editor-error-boundary",actions:[(0,i.createElement)(To.Button,{key:"recovery",onClick:this.reboot,variant:"secondary"},(0,Zt.__)("Attempt Recovery")),(0,i.createElement)(Ho,{key:"copy-post",text:this.getContent},(0,Zt.__)("Copy Post Text")),(0,i.createElement)(Ho,{key:"copy-error",text:e.stack},(0,Zt.__)("Copy Error"))]},(0,Zt.__)("The editor has encountered an unexpected error.")):this.props.children}}var Go=Wo;const jo=window.requestIdleCallback?window.requestIdleCallback:window.requestAnimationFrame,$o=(0,s.once)((()=>{try{return window.sessionStorage.setItem("__wpEditorTestSessionStorage",""),window.sessionStorage.removeItem("__wpEditorTestSessionStorage"),!0}catch(e){return!1}}));function Ko(){const{postId:e,isEditedPostNew:t,hasRemoteAutosave:n}=(0,l.useSelect)((e=>({postId:e(oo).getCurrentPostId(),isEditedPostNew:e(oo).isEditedPostNew(),hasRemoteAutosave:!!e(oo).getEditorSettings().autosave})),[]),{getEditedPostAttribute:o}=(0,l.useSelect)(oo),{createWarningNotice:r,removeNotice:c}=(0,l.useDispatch)(qt.store),{editPost:u,resetEditorBlocks:d}=(0,l.useDispatch)(oo);(0,i.useEffect)((()=>{let i=function(e,t){return window.sessionStorage.getItem(Qt(e,t))}(e,t);if(!i)return;try{i=JSON.parse(i)}catch(e){return}const{post_title:l,content:p,excerpt:m}=i,h={title:l,content:p,excerpt:m};if(!Object.keys(h).some((e=>h[e]!==o(e))))return void Xt(e,t);if(n)return;const g=(0,s.uniqueId)("wpEditorAutosaveRestore");r((0,Zt.__)("The backup of this post in your browser is different from the version below."),{id:g,actions:[{label:(0,Zt.__)("Restore the backup"),onClick(){u((0,s.omit)(h,["content"])),d((0,a.parse)(h.content)),c(g)}}]})}),[t,e])}var qo=(0,u.ifCondition)($o)((function(){const{autosave:e}=(0,l.useDispatch)(oo),t=(0,i.useCallback)((()=>{jo((()=>e({local:!0})))}),[]);Ko(),function(){const{postId:e,isEditedPostNew:t,isDirty:n,isAutosaving:o,didError:r}=(0,l.useSelect)((e=>({postId:e(oo).getCurrentPostId(),isEditedPostNew:e(oo).isEditedPostNew(),isDirty:e(oo).isEditedPostDirty(),isAutosaving:e(oo).isAutosavingPost(),didError:e(oo).didPostSaveRequestFail()})),[]),s=(0,i.useRef)(n),a=(0,i.useRef)(o);(0,i.useEffect)((()=>{!r&&(a.current&&!o||s.current&&!n)&&Xt(e,t),s.current=n,a.current=o}),[n,o,r]);const c=(0,u.usePrevious)(t),d=(0,u.usePrevious)(e);(0,i.useEffect)((()=>{d===e&&c&&!t&&Xt(e,!0)}),[t,e])}();const{localAutosaveInterval:n}=(0,l.useSelect)((e=>({localAutosaveInterval:e(oo).getEditorSettings().localAutosaveInterval})),[]);return(0,i.createElement)(lo,{interval:n,autosave:t})}));var Qo=function(e){let{children:t}=e;const n=(0,l.useSelect)((e=>{const{getEditedPostAttribute:t}=e(oo),{getPostType:n}=e(c.store);return n(t("type"))}),[]);return(0,s.get)(n,["supports","page-attributes"],!1)?t:null};var Yo=(0,l.withSelect)((e=>{const{getEditedPostAttribute:t}=e(oo),{getPostType:n}=e(c.store);return{postType:n(t("type"))}}))((function(e){let{postType:t,children:n,supportKeys:o}=e,r=!0;return t&&(r=(0,s.some)((0,s.castArray)(o),(e=>!!t.supports[e]))),r?n:null}));const Xo=e=>{let{onUpdateOrder:t,order:n=0}=e;const[o,r]=(0,i.useState)(null),a=null===o?n:o;return(0,i.createElement)(To.TextControl,{className:"editor-page-attributes__order",type:"number",label:(0,Zt.__)("Order"),value:a,onChange:e=>{r(e);const n=Number(e);Number.isInteger(n)&&""!==(0,s.invoke)(e,["trim"])&&t(Number(e))},size:6,onBlur:()=>{r(null)}})};var Zo=(0,u.compose)([(0,l.withSelect)((e=>({order:e(oo).getEditedPostAttribute("menu_order")}))),(0,l.withDispatch)((e=>({onUpdateOrder(t){e(oo).editPost({menu_order:t})}})))])((function(e){return(0,i.createElement)(Yo,{supportKeys:"page-attributes"},(0,i.createElement)(Xo,e))}));function Jo(e){const t=e.map((e=>({children:[],parent:null,...e}))),n=(0,s.groupBy)(t,"parent");if(n.null&&n.null.length)return t;const o=e=>e.map((e=>{const t=n[e.id];return{...e,children:t&&t.length?o(t):[]}}));return o(n[0]||[])}const er=e=>(0,s.unescape)(e.replace("&#039;","'")),tr=e=>({...e,name:er(e.name)}),nr=e=>(0,s.map)(e,tr);function or(e){var t;return null!=e&&null!==(t=e.title)&&void 0!==t&&t.rendered?(0,Oo.decodeEntities)(e.title.rendered):`#$e.id} (${(0,Zt.__)("no title")})`}const rr=(e,t)=>{const n=(0,s.deburr)(e).toLowerCase(),o=(0,s.deburr)(t).toLowerCase();return n===o?0:n.startsWith(o)?n.length:1/0};var ir=function(){const{editPost:e}=(0,l.useDispatch)(oo),[t,n]=(0,i.useState)(!1),{parentPost:o,parentPostId:r,items:a,postType:u}=(0,l.useSelect)((e=>{const{getPostType:n,getEntityRecords:o,getEntityRecord:r}=e(c.store),{getCurrentPostId:i,getEditedPostAttribute:a}=e(oo),l=a("type"),u=a("parent"),d=n(l),p=i(),m=(0,s.get)(d,["hierarchical"],!1),h={per_page:100,exclude:p,parent_exclude:p,orderby:"menu_order",order:"asc",_fields:"id,title,parent"};return t&&(h.search=t),{parentPostId:u,parentPost:u?r("postType",l,u):null,items:m?o("postType",l,h):[],postType:d}}),[t]),d=(0,s.get)(u,["hierarchical"],!1),p=(0,s.get)(u,["labels","parent_item_colon"]),m=a||[],h=(0,i.useMemo)((()=>{const e=function(n){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=n.map((t=>[{value:t.id,label:(0,s.repeat)("— ",o)+(0,s.unescape)(t.name),rawName:t.name},...e(t.children||[],o+1)])),i=r.sort(((e,n)=>{let[o]=e,[r]=n;return rr(o.rawName,t)>=rr(r.rawName,t)?1:-1}));return(0,s.flatten)(i)};let n=m.map((e=>({id:e.id,parent:e.parent,name:or(e)})));t||(n=Jo(n));const i=e(n),a=(0,s.find)(i,(e=>e.value===r));return o&&!a&&i.unshift({value:r,label:or(o)}),i}),[m,t]);return d&&p?(0,i.createElement)(To.ComboboxControl,{className:"editor-page-attributes__parent",label:p,value:r,options:h,onFilterValueChange:(0,s.debounce)((e=>{n(e)}),300),onChange:t=>{e({parent:t})}}):null};var sr=function(e){let{}=e;const{availableTemplates:t,selectedTemplate:n,isViewable:o}=(0,l.useSelect)((e=>{var t,n;const{getEditedPostAttribute:o,getEditorSettings:r,getCurrentPostType:i}=e(oo),{getPostType:s}=e(c.store);return{selectedTemplate:o("template"),availableTemplates:r().availableTemplates,isViewable:null!==(t=null===(n=s(i()))||void 0===n?void 0:n.viewable)&&void 0!==t&&t}}),[]),{editPost:r}=(0,l.useDispatch)(oo);return!o||(0,s.isEmpty)(t)?null:(0,i.createElement)(To.SelectControl,{label:(0,Zt.__)("Template:"),value:n,onChange:e=>{r({template:e||""})},options:(0,s.map)(t,((e,t)=>({value:t,label:e})))})};const ar={who:"authors",per_page:50,_fields:"id,name",context:"view"};var lr=function(){const[e,t]=(0,i.useState)(),{authorId:n,isLoading:o,authors:r,postAuthor:a}=(0,l.useSelect)((t=>{const{getUser:n,getUsers:o,isResolving:r}=t(c.store),{getEditedPostAttribute:i}=t(oo),s=n(i("author"),{context:"view"}),a={...ar};return e&&(a.search=e),{authorId:i("author"),postAuthor:s,authors:o(a),isLoading:r("core","getUsers",[a])}}),[e]),{editPost:u}=(0,l.useDispatch)(oo),d=(0,i.useMemo)((()=>{const e=(null!=r?r:[]).map((e=>({value:e.id,label:(0,Oo.decodeEntities)(e.name)})));return e.findIndex((e=>{let{value:t}=e;return(null==a?void 0:a.id)===t}))<0&&a?[{value:a.id,label:(0,Oo.decodeEntities)(a.name)},...e]:e}),[r,a]);return a?(0,i.createElement)(To.ComboboxControl,{label:(0,Zt.__)("Author"),options:d,value:n,onFilterValueChange:(0,s.debounce)((e=>{t(e)}),300),onChange:e=>{e&&u({author:e})},isLoading:o,allowReset:!1}):null};var cr=function(){const{editPost:e}=(0,l.useDispatch)(oo),{postAuthor:t,authors:n}=(0,l.useSelect)((e=>({postAuthor:e(oo).getEditedPostAttribute("author"),authors:e(c.store).getUsers(ar)})),[]),o=(0,i.useMemo)((()=>(null!=n?n:[]).map((e=>({value:e.id,label:(0,Oo.decodeEntities)(e.name)})))),[n]);return(0,i.createElement)(To.SelectControl,{className:"post-author-selector",label:(0,Zt.__)("Author"),options:o,onChange:t=>{const n=Number(t);e({author:n})},value:t})};var ur=function(){return(0,l.useSelect)((e=>{const t=e(c.store).getUsers(ar);return(null==t?void 0:t.length)>=25}),[])?(0,i.createElement)(lr,null):(0,i.createElement)(cr,null)};function dr(e){let{children:t}=e;const{hasAssignAuthorAction:n,hasAuthors:o}=(0,l.useSelect)((e=>{const t=e(oo).getCurrentPost(),n=e(c.store).getUsers(ar);return{hasAssignAuthorAction:(0,s.get)(t,["_links","wp:action-assign-author"],!1),hasAuthors:(null==n?void 0:n.length)>=1}}),[]);return n&&o?(0,i.createElement)(Yo,{supportKeys:"author"},t):null}var pr=(0,u.compose)([(0,l.withSelect)((e=>({commentStatus:e(oo).getEditedPostAttribute("comment_status")}))),(0,l.withDispatch)((e=>({editPost:e(oo).editPost})))])((function(e){let{commentStatus:t="open",...n}=e;return(0,i.createElement)(To.CheckboxControl,{label:(0,Zt.__)("Allow comments"),checked:"open"===t,onChange:()=>n.editPost({comment_status:"open"===t?"closed":"open"})})}));var mr=(0,u.compose)([(0,l.withSelect)((e=>({excerpt:e(oo).getEditedPostAttribute("excerpt")}))),(0,l.withDispatch)((e=>({onUpdateExcerpt(t){e(oo).editPost({excerpt:t})}})))])((function(e){let{excerpt:t,onUpdateExcerpt:n}=e;return(0,i.createElement)("div",{className:"editor-post-excerpt"},(0,i.createElement)(To.TextareaControl,{label:(0,Zt.__)("Write an excerpt (optional)"),className:"editor-post-excerpt__textarea",onChange:e=>n(e),value:t}),(0,i.createElement)(To.ExternalLink,{href:(0,Zt.__)("https://wordpress.org/support/article/settings-sidebar/#excerpt")},(0,Zt.__)("Learn more about manual excerpts")))}));var hr=function(e){return(0,i.createElement)(Yo,r({},e,{supportKeys:"excerpt"}))};var gr=(0,l.withSelect)((e=>{const{getThemeSupports:t}=e(c.store),{getEditedPostAttribute:n}=e(oo);return{postType:n("type"),themeSupports:t()}}))((function(e){let{themeSupports:t,children:n,postType:o,supportKeys:r}=e;return(0,s.some)((0,s.castArray)(r),(e=>{const n=(0,s.get)(t,[e],!1);return"post-thumbnails"===e&&(0,s.isArray)(n)?(0,s.includes)(n,o):n}))?n:null}));var fr=function(e){return(0,i.createElement)(gr,{supportKeys:"post-thumbnails"},(0,i.createElement)(Yo,r({},e,{supportKeys:"thumbnail"})))};const vr=["image"],_r=(0,Zt.__)("Featured image"),yr=(0,Zt.__)("Set featured image"),br=(0,Zt.__)("Remove image");const Er=(0,l.withSelect)((e=>{const{getMedia:t,getPostType:n}=e(c.store),{getCurrentPostId:o,getEditedPostAttribute:r}=e(oo),i=r("featured_media");return{media:i?t(i,{context:"view"}):null,currentPostId:o(),postType:n(r("type")),featuredImageId:i}})),wr=(0,l.withDispatch)(((e,t,n)=>{let{noticeOperations:o}=t,{select:r}=n;const{editPost:i}=e(oo);return{onUpdateImage(e){i({featured_media:e.id})},onDropImage(e){r(p.store).getSettings().mediaUpload({allowedTypes:["image"],filesList:e,onFileChange(e){let[t]=e;i({featured_media:t.id})},onError(e){o.removeAllNotices(),o.createErrorNotice(e)}})},onRemoveImage(){i({featured_media:0})}}}));var Sr=(0,u.compose)(To.withNotices,Er,wr,(0,To.withFilters)("editor.PostFeaturedImage"))((function(e){var t,n;let{currentPostId:o,featuredImageId:r,onUpdateImage:a,onDropImage:l,onRemoveImage:c,media:u,postType:m,noticeUI:h}=e;const g=(0,s.get)(m,["labels"],{}),f=(0,i.createElement)("p",null,(0,Zt.__)("To edit the featured image, you need permission to upload media."));let v,_,y;if(u){const e=(0,d.applyFilters)("editor.PostFeaturedImage.imageSize","post-thumbnail",u.id,o);if((0,s.has)(u,["media_details","sizes",e]))v=u.media_details.sizes[e].width,_=u.media_details.sizes[e].height,y=u.media_details.sizes[e].source_url;else{const e=(0,d.applyFilters)("editor.PostFeaturedImage.imageSize","thumbnail",u.id,o);(0,s.has)(u,["media_details","sizes",e])?(v=u.media_details.sizes[e].width,_=u.media_details.sizes[e].height,y=u.media_details.sizes[e].source_url):(v=u.media_details.width,_=u.media_details.height,y=u.source_url)}}return(0,i.createElement)(fr,null,h,(0,i.createElement)("div",{className:"editor-post-featured-image"},u&&(0,i.createElement)("div",{id:`editor-post-featured-image-$r}-describedby`,className:"hidden"},u.alt_text&&(0,Zt.sprintf)((0,Zt.__)("Current image: %s"),u.alt_text),!u.alt_text&&(0,Zt.sprintf)((0,Zt.__)("The current image has no alternative text. The file name is: %s"),(null===(t=u.media_details.sizes)||void 0===t||null===(n=t.full)||void 0===n?void 0:n.file)||u.slug)),(0,i.createElement)(p.MediaUploadCheck,{fallback:f},(0,i.createElement)(p.MediaUpload,{title:g.featured_image||_r,onSelect:a,unstableFeaturedImageFlow:!0,allowedTypes:vr,modalClass:"editor-post-featured-image__media-modal",render:e=>{let{open:t}=e;return(0,i.createElement)("div",{className:"editor-post-featured-image__container"},(0,i.createElement)(To.Button,{className:r?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:t,"aria-label":r?(0,Zt.__)("Edit or update the image"):null,"aria-describedby":r?`editor-post-featured-image-$r}-describedby`:null},!!r&&u&&(0,i.createElement)(To.ResponsiveWrapper,{naturalWidth:v,naturalHeight:_,isInline:!0},(0,i.createElement)("img",{src:y,alt:""})),!!r&&!u&&(0,i.createElement)(To.Spinner,null),!r&&(g.set_featured_image||yr)),(0,i.createElement)(To.DropZone,{onFilesDrop:l}))},value:r})),!!r&&u&&!u.isLoading&&(0,i.createElement)(p.MediaUploadCheck,null,(0,i.createElement)(p.MediaUpload,{title:g.featured_image||_r,onSelect:a,unstableFeaturedImageFlow:!0,allowedTypes:vr,modalClass:"editor-post-featured-image__media-modal",render:e=>{let{open:t}=e;return(0,i.createElement)(To.Button,{onClick:t,variant:"secondary"},(0,Zt.__)("Replace Image"))}})),!!r&&(0,i.createElement)(p.MediaUploadCheck,null,(0,i.createElement)(To.Button,{onClick:c,variant:"link",isDestructive:!0},g.remove_featured_image||br))))}));var Pr=(0,l.withSelect)((e=>({disablePostFormats:e(oo).getEditorSettings().disablePostFormats})))((function(e){let{disablePostFormats:t,...n}=e;return!t&&(0,i.createElement)(Yo,r({},n,{supportKeys:"post-formats"}))}));const kr=[{id:"aside",caption:(0,Zt.__)("Aside")},{id:"audio",caption:(0,Zt.__)("Audio")},{id:"chat",caption:(0,Zt.__)("Chat")},{id:"gallery",caption:(0,Zt.__)("Gallery")},{id:"image",caption:(0,Zt.__)("Image")},{id:"link",caption:(0,Zt.__)("Link")},{id:"quote",caption:(0,Zt.__)("Quote")},{id:"standard",caption:(0,Zt.__)("Standard")},{id:"status",caption:(0,Zt.__)("Status")},{id:"video",caption:(0,Zt.__)("Video")}].sort(((e,t)=>{const n=e.caption.toUpperCase(),o=t.caption.toUpperCase();return n<o?-1:n>o?1:0}));function Cr(){const e=`post-format-selector-${(0,u.useInstanceId)(Cr)}`,{postFormat:t,suggestedFormat:n,supportedFormats:o}=(0,l.useSelect)((e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:n}=e(oo),o=t("format"),r=e(c.store).getThemeSupports();return{postFormat:null!=o?o:"standard",suggestedFormat:n(),supportedFormats:r.formats}}),[]),r=kr.filter((e=>(0,s.includes)(o,e.id)||t===e.id)),a=(0,s.find)(r,(e=>e.id===n)),{editPost:d}=(0,l.useDispatch)(oo),p=e=>d({format:e});return(0,i.createElement)(Pr,null,(0,i.createElement)("div",{className:"editor-post-format"},(0,i.createElement)("div",{className:"editor-post-format__content"},(0,i.createElement)("label",{htmlFor:e},(0,Zt.__)("Post Format")),(0,i.createElement)(To.SelectControl,{value:t,onChange:e=>p(e),id:e,options:r.map((e=>({label:e.caption,value:e.id})))})),a&&a.id!==t&&(0,i.createElement)("div",{className:"editor-post-format__suggestion"},(0,Zt.__)("Suggestion:")," ",(0,i.createElement)(To.Button,{variant:"link",onClick:()=>p(a.id)},(0,Zt.sprintf)((0,Zt.__)("Apply format: %s"),a.caption)))))}var Tr=(0,i.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.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"}));var xr=(0,l.withSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:n}=e(oo);return{lastRevisionId:t(),revisionsCount:n()}}))((function(e){let{lastRevisionId:t,revisionsCount:n,children:o}=e;return!t||n<2?null:(0,i.createElement)(Yo,{supportKeys:"revisions"},o)}));var Br=(0,l.withSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:n}=e(oo);return{lastRevisionId:t(),revisionsCount:n()}}))((function(e){let{lastRevisionId:t,revisionsCount:n}=e;return(0,i.createElement)(xr,null,(0,i.createElement)(To.Button,{href:(0,S.addQueryArgs)("revision.php",{revision:t,gutenberg:!0}),className:"editor-post-last-revision__title",icon:Tr},(0,Zt.sprintf)((0,Zt._n)("%d Revision","%d Revisions",n),n)))}));function Ar(){const e="core/editor/post-locked-modal-"+(0,u.useInstanceId)(Ar),{autosave:t,updatePostLock:n}=(0,l.useDispatch)(oo),{isLocked:o,isTakeover:r,user:a,postId:p,postLockUtils:m,activePostLock:h,postType:g,previewLink:f}=(0,l.useSelect)((e=>{const{isPostLocked:t,isPostLockTakeover:n,getPostLockUser:o,getCurrentPostId:r,getActivePostLock:i,getEditedPostAttribute:s,getEditedPostPreviewLink:a,getEditorSettings:l}=e(oo),{getPostType:u}=e(c.store);return{isLocked:t(),isTakeover:n(),user:o(),postId:r(),postLockUtils:l().postLockUtils,activePostLock:i(),postType:u(s("type")),previewLink:a()}}),[]);if((0,i.useEffect)((()=>{function r(){if(o||!h)return;const e=new window.FormData;if(e.append("action","wp-remove-post-lock"),e.append("_wpnonce",m.unlockNonce),e.append("post_ID",p),e.append("active_post_lock",h),window.navigator.sendBeacon)window.navigator.sendBeacon(m.ajaxUrl,e);else{const t=new window.XMLHttpRequest;t.open("POST",m.ajaxUrl,!1),t.send(e)}}return(0,d.addAction)("heartbeat.send",e,(function(e){o||(e["wp-refresh-post-lock"]={lock:h,post_id:p})})),(0,d.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,d.removeAction)("heartbeat.send",e),(0,d.removeAction)("heartbeat.tick",e),window.removeEventListener("beforeunload",r)}}),[]),!o)return null;const v=a.name,_=a.avatar,y=(0,S.addQueryArgs)("post.php",{"get-post-lock":"1",lockKey:!0,post:p,action:"edit",_wpnonce:m.nonce}),b=(0,S.addQueryArgs)("edit.php",{post_type:(0,s.get)(g,["slug"])}),E=(0,Zt.__)("Exit editor");return(0,i.createElement)(To.Modal,{title:r?(0,Zt.__)("Someone else has taken over this post"):(0,Zt.__)("This post is already being edited"),focusOnMount:!0,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,isDismissible:!1,className:"editor-post-locked-modal"},!!_&&(0,i.createElement)("img",{src:_,alt:(0,Zt.__)("Avatar"),className:"editor-post-locked-modal__avatar",width:64,height:64}),(0,i.createElement)("div",null,!!r&&(0,i.createElement)("p",null,(0,i.createInterpolateElement)(v?(0,Zt.sprintf)((0,Zt.__)("<strong>%s</strong> now has editing control of this posts (<PreviewLink />). Don’t worry, your changes up to this moment have been saved."),v):(0,Zt.__)("Another user now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved."),{strong:(0,i.createElement)("strong",null),PreviewLink:(0,i.createElement)(To.ExternalLink,{href:f},(0,Zt.__)("preview"))})),!r&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("p",null,(0,i.createInterpolateElement)(v?(0,Zt.sprintf)((0,Zt.__)("<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over."),v):(0,Zt.__)("Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over."),{strong:(0,i.createElement)("strong",null),PreviewLink:(0,i.createElement)(To.ExternalLink,{href:f},(0,Zt.__)("preview"))})),(0,i.createElement)("p",null,(0,Zt.__)("If you take over, the other user will lose editing control to the post, but their changes will be saved."))),(0,i.createElement)(To.Flex,{className:"editor-post-locked-modal__buttons",justify:"flex-end",expanded:!1},!r&&(0,i.createElement)(To.FlexItem,null,(0,i.createElement)(To.Button,{variant:"tertiary",href:y},(0,Zt.__)("Take over"))),(0,i.createElement)(To.FlexItem,null,(0,i.createElement)(To.Button,{variant:"primary",href:b},E)))))}var Ir=(0,u.compose)((0,l.withSelect)((e=>{const{isCurrentPostPublished:t,getCurrentPostType:n,getCurrentPost:o}=e(oo);return{hasPublishAction:(0,s.get)(o(),["_links","wp:action-publish"],!1),isPublished:t(),postType:n()}})))((function(e){let{hasPublishAction:t,isPublished:n,children:o}=e;return n||!t?null:o}));var Nr=(0,u.compose)((0,l.withSelect)((e=>({status:e(oo).getEditedPostAttribute("status")}))),(0,l.withDispatch)((e=>({onUpdateStatus(t){e(oo).editPost({status:t})}}))))((function(e){let{status:t,onUpdateStatus:n}=e;return(0,i.createElement)(Ir,null,(0,i.createElement)(To.CheckboxControl,{label:(0,Zt.__)("Pending review"),checked:"pending"===t,onChange:()=>{n("pending"===t?"draft":"pending")}}))}));var Rr=(0,u.compose)([(0,l.withSelect)((e=>({pingStatus:e(oo).getEditedPostAttribute("ping_status")}))),(0,l.withDispatch)((e=>({editPost:e(oo).editPost})))])((function(e){let{pingStatus:t="open",...n}=e;return(0,i.createElement)(To.CheckboxControl,{label:(0,Zt.__)("Allow pingbacks & trackbacks"),checked:"open"===t,onChange:()=>n.editPost({ping_status:"open"===t?"closed":"open"})})}));class Dr extends i.Component{constructor(){super(...arguments),this.buttonRef=(0,i.createRef)(),this.openPreviewWindow=this.openPreviewWindow.bind(this)}componentDidUpdate(e){const{previewLink:t}=this.props;t&&!e.previewLink&&this.setPreviewWindowLink(t)}setPreviewWindowLink(e){const{previewWindow:t}=this;t&&!t.closed&&(t.location=e,this.buttonRef.current&&this.buttonRef.current.focus())}getWindowTarget(){const{postId:e}=this.props;return`wp-preview-$e}`}openPreviewWindow(e){e.preventDefault(),this.previewWindow&&!this.previewWindow.closed||(this.previewWindow=window.open("",this.getWindowTarget())),this.previewWindow.focus(),this.props.isAutosaveable&&!this.props.isPostLocked?(this.props.isDraft?this.props.savePost({isPreview:!0}):this.props.autosave({isPreview:!0}),function(e){let t=(0,i.renderToString)((0,i.createElement)("div",{className:"editor-post-preview-button__interstitial-message"},(0,i.createElement)(To.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 96 96"},(0,i.createElement)(To.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,i.createElement)(To.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,i.createElement)("p",null,(0,Zt.__)("Generating preview…"))));t+='\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n\t\t\t}\n\t\t</style>\n\t',t=(0,d.applyFilters)("editor.PostPreview.interstitialMarkup",t),e.write(t),e.title=(0,Zt.__)("Generating preview…"),e.close()}(this.previewWindow.document)):this.setPreviewWindowLink(e.target.href)}render(){const{previewLink:e,currentPostLink:t,isSaveable:n,role:o}=this.props,r=e||t,s=po()({"editor-post-preview":!this.props.className},this.props.className);return(0,i.createElement)(To.Button,{variant:this.props.className?void 0:"tertiary",className:s,href:r,target:this.getWindowTarget(),disabled:!n,onClick:this.openPreviewWindow,ref:this.buttonRef,role:o},this.props.textContent?this.props.textContent:(0,i.createElement)(i.Fragment,null,(0,Zt._x)("Preview","imperative verb"),(0,i.createElement)(To.VisuallyHidden,{as:"span"},(0,Zt.__)("(opens in a new tab)"))))}}var Lr=(0,u.compose)([(0,l.withSelect)(((e,t)=>{let{forcePreviewLink:n,forceIsAutosaveable:o}=t;const{getCurrentPostId:r,getCurrentPostAttribute:i,getEditedPostAttribute:a,isEditedPostSaveable:l,isEditedPostAutosaveable:u,getEditedPostPreviewLink:d,isPostLocked:p}=e(oo),{getPostType:m}=e(c.store),h=d(),g=m(a("type"));return{postId:r(),currentPostLink:i("link"),previewLink:void 0!==n?n:h,isSaveable:l(),isAutosaveable:o||u(),isViewable:(0,s.get)(g,["viewable"],!1),isDraft:-1!==["draft","auto-draft"].indexOf(a("status")),isPostLocked:p()}})),(0,l.withDispatch)((e=>({autosave:e(oo).autosave,savePost:e(oo).savePost}))),(0,u.ifCondition)((e=>{let{isViewable:t}=e;return t}))])(Dr);var Or=(0,u.compose)([(0,l.withSelect)(((e,t)=>{let{forceIsSaving:n}=t;const{isCurrentPostPublished:o,isEditedPostBeingScheduled:r,isSavingPost:i,isPublishingPost:a,getCurrentPost:l,getCurrentPostType:c,isAutosavingPost:u}=e(oo);return{isPublished:o(),isBeingScheduled:r(),isSaving:n||i(),isPublishing:a(),hasPublishAction:(0,s.get)(l(),["_links","wp:action-publish"],!1),postType:c(),isAutosaving:u()}}))])((function(e){let{isPublished:t,isBeingScheduled:n,isSaving:o,isPublishing:r,hasPublishAction:i,isAutosaving:s,hasNonPostEntityChanges:a}=e;return r?(0,Zt.__)("Publishing…"):t&&o&&!s?(0,Zt.__)("Updating…"):n&&o&&!s?(0,Zt.__)("Scheduling…"):i?t?a?(0,Zt.__)("Update…"):(0,Zt.__)("Update"):n?a?(0,Zt.__)("Schedule…"):(0,Zt.__)("Schedule"):(0,Zt.__)("Publish"):a?(0,Zt.__)("Submit for Review…"):(0,Zt.__)("Submit for Review")}));class Fr extends i.Component{constructor(e){super(e),this.buttonNode=(0,i.createRef)(),this.createOnClick=this.createOnClick.bind(this),this.closeEntitiesSavedStates=this.closeEntitiesSavedStates.bind(this),this.state={entitiesSavedStatesCallback:!1}}componentDidMount(){this.props.focusOnMount&&this.buttonNode.current.focus()}createOnClick(e){var t=this;return function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];const{hasNonPostEntityChanges:i,setEntitiesSavedStatesCallback:a}=t.props;return i&&a?(t.setState({entitiesSavedStatesCallback:()=>e(...o)}),a((()=>t.closeEntitiesSavedStates)),s.noop):e(...o)}}closeEntitiesSavedStates(e){const{postType:t,postId:n}=this.props,{entitiesSavedStatesCallback:o}=this.state;this.setState({entitiesSavedStatesCallback:!1},(()=>{e&&(0,s.some)(e,(e=>"postType"===e.kind&&e.name===t&&e.key===n))&&o()}))}render(){const{forceIsDirty:e,forceIsSaving:t,hasPublishAction:n,isBeingScheduled:o,isOpen:a,isPostSavingLocked:l,isPublishable:c,isPublished:u,isSaveable:d,isSaving:p,isAutoSaving:m,isToggle:h,onSave:g,onStatusChange:f,onSubmit:v=s.noop,onToggle:_,visibility:y,hasNonPostEntityChanges:b,isSavingNonPostEntityChanges:E}=this.props,w=(p||t||!d||l||!c&&!e)&&(!b||E),S=(u||p||t||!d||!c&&!e)&&(!b||E);let P;P=n?"private"===y?"private":o?"future":"publish":"pending";const k={"aria-disabled":w,className:"editor-post-publish-button",isBusy:!m&&p&&u,variant:"primary",onClick:this.createOnClick((()=>{w||(v(),f(P),g())}))},C={"aria-disabled":S,"aria-expanded":a,className:"editor-post-publish-panel__toggle",isBusy:p&&u,variant:"primary",onClick:this.createOnClick((()=>{S||_()}))},T=o?(0,Zt.__)("Schedule…"):(0,Zt.__)("Publish"),x=(0,i.createElement)(Or,{forceIsSaving:t,hasNonPostEntityChanges:b}),B=h?C:k,A=h?T:x;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(To.Button,r({ref:this.buttonNode},B,{className:po()(B.className,"editor-post-publish-button__button",{"has-changes-dot":b})}),A))}}var Ur=(0,u.compose)([(0,l.withSelect)((e=>{const{isSavingPost:t,isAutosavingPost:n,isEditedPostBeingScheduled:o,getEditedPostVisibility:r,isCurrentPostPublished:i,isEditedPostSaveable:a,isEditedPostPublishable:l,isPostSavingLocked:c,getCurrentPost:u,getCurrentPostType:d,getCurrentPostId:p,hasNonPostEntityChanges:m,isSavingNonPostEntityChanges:h}=e(oo),g=n();return{isSaving:t()||g,isAutoSaving:g,isBeingScheduled:o(),visibility:r(),isSaveable:a(),isPostSavingLocked:c(),isPublishable:l(),isPublished:i(),hasPublishAction:(0,s.get)(u(),["_links","wp:action-publish"],!1),postType:d(),postId:p(),hasNonPostEntityChanges:m(),isSavingNonPostEntityChanges:h()}})),(0,l.withDispatch)((e=>{const{editPost:t,savePost:n}=e(oo);return{onStatusChange:e=>t({status:e},{undoIgnore:!0}),onSave:n}}))])(Fr);var Mr=(0,i.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.createElement)(C.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));var zr=(0,i.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,i.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"}));function Vr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Hr=[{value:"public",label:(0,Zt.__)("Public"),info:(0,Zt.__)("Visible to everyone.")},{value:"private",label:(0,Zt.__)("Private"),info:(0,Zt.__)("Only visible to site admins and editors.")},{value:"password",label:(0,Zt.__)("Password Protected"),info:(0,Zt.__)("Protected with a password you choose. Only those with the password can view this post.")}];class Wr extends i.Component{constructor(e){super(...arguments),Vr(this,"confirmPrivate",(()=>{const{onUpdateVisibility:e,onSave:t}=this.props;e("private"),this.setState({hasPassword:!1,showPrivateConfirmDialog:!1}),t()})),Vr(this,"handleDialogCancel",(()=>{this.setState({showPrivateConfirmDialog:!1})})),this.setPublic=this.setPublic.bind(this),this.setPrivate=this.setPrivate.bind(this),this.setPasswordProtected=this.setPasswordProtected.bind(this),this.updatePassword=this.updatePassword.bind(this),this.state={hasPassword:!!e.password,showPrivateConfirmDialog:!1}}setPublic(){const{visibility:e,onUpdateVisibility:t,status:n}=this.props;t("private"===e?"draft":n),this.setState({hasPassword:!1})}setPrivate(){this.setState({showPrivateConfirmDialog:!0})}setPasswordProtected(){const{visibility:e,onUpdateVisibility:t,status:n,password:o}=this.props;t("private"===e?"draft":n,o||""),this.setState({hasPassword:!0})}updatePassword(e){const{status:t,onUpdateVisibility:n}=this.props;n(t,e.target.value)}render(){const{visibility:e,password:t,instanceId:n}=this.props,o={public:{onSelect:this.setPublic,checked:"public"===e&&!this.state.hasPassword},private:{onSelect:this.setPrivate,checked:"private"===e},password:{onSelect:this.setPasswordProtected,checked:this.state.hasPassword}};return[(0,i.createElement)("fieldset",{key:"visibility-selector",className:"editor-post-visibility__dialog-fieldset"},(0,i.createElement)("legend",{className:"editor-post-visibility__dialog-legend"},(0,Zt.__)("Post Visibility")),Hr.map((e=>{let{value:t,label:r,info:s}=e;return(0,i.createElement)("div",{key:t,className:"editor-post-visibility__choice"},(0,i.createElement)("input",{type:"radio",name:`editor-post-visibility__setting-$n}`,value:t,onChange:o[t].onSelect,checked:o[t].checked,id:`editor-post-$t}-$n}`,"aria-describedby":`editor-post-$t}-$n}-description`,className:"editor-post-visibility__dialog-radio"}),(0,i.createElement)("label",{htmlFor:`editor-post-$t}-$n}`,className:"editor-post-visibility__dialog-label"},r),(0,i.createElement)("p",{id:`editor-post-$t}-$n}-description`,className:"editor-post-visibility__dialog-info"},s))}))),this.state.hasPassword&&(0,i.createElement)("div",{className:"editor-post-visibility__dialog-password",key:"password-selector"},(0,i.createElement)(To.VisuallyHidden,{as:"label",htmlFor:`editor-post-visibility__dialog-password-input-$n}`},(0,Zt.__)("Create password")),(0,i.createElement)("input",{className:"editor-post-visibility__dialog-password-input",id:`editor-post-visibility__dialog-password-input-$n}`,type:"text",onChange:this.updatePassword,value:t,placeholder:(0,Zt.__)("Use a secure password")})),(0,i.createElement)(To.__experimentalConfirmDialog,{key:"private-publish-confirmation",isOpen:this.state.showPrivateConfirmDialog,onConfirm:this.confirmPrivate,onCancel:this.handleDialogCancel},(0,Zt.__)("Would you like to privately publish this post now?"))]}}var Gr=(0,u.compose)([(0,l.withSelect)((e=>{const{getEditedPostAttribute:t,getEditedPostVisibility:n}=e(oo);return{status:t("status"),visibility:n(),password:t("password")}})),(0,l.withDispatch)((e=>{const{savePost:t,editPost:n}=e(oo);return{onSave:t,onUpdateVisibility(e){n({status:e,password:arguments.length>1&&void 0!==arguments[1]?arguments[1]:""})}}})),u.withInstanceId])(Wr);var jr=(0,l.withSelect)((e=>({visibility:e(oo).getEditedPostVisibility()})))((function(e){let{visibility:t}=e;return(0,s.find)(Hr,{value:t}).label}));function $r(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=new Date(e);return new Date(n.getFullYear(),n.getMonth()+(t?0:1),t?1:0).toISOString()}function Kr(){const{postDate:e,postType:t}=(0,l.useSelect)((e=>({postDate:e(oo).getEditedPostAttribute("date"),postType:e(oo).getCurrentPostType()})),[]),{editPost:n}=(0,l.useDispatch)(oo),[o,r]=(0,i.useState)($r(e)),s=(0,l.useSelect)((e=>e(c.store).getEntityRecords("postType",t,{status:"publish,future",after:$r(o),before:$r(o,!1),exclude:[e(oo).getCurrentPostId()]})),[o,t]),a=(0,i.useMemo)((()=>(s||[]).map((e=>{let{title:t,type:n,date:o}=e;return{title:null==t?void 0:t.rendered,type:n,date:new Date(o)}}))),[s]),u=(0,i.useRef)(),d=(0,w.__experimentalGetSettings)(),p=/a(?!\\)/i.test(d.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,i.createElement)(To.DateTimePicker,{ref:u,currentDate:e,onChange:function(e){n({date:e});const{ownerDocument:t}=u.current;t.activeElement.blur()},is12Hour:p,events:a,onMonthPreviewed:r})}var qr=(0,l.withSelect)((e=>({date:e(oo).getEditedPostAttribute("date"),isFloating:e(oo).isEditedPostDateFloating()})))((function(e){let{date:t,isFloating:n}=e;const o=(0,w.__experimentalGetSettings)();return t&&!n?(0,w.format)(`$o.formats.date} $o.formats.time}`,t):(0,Zt.__)("Immediately")})),Qr=window.wp.a11y;const Yr={per_page:10,orderby:"count",order:"desc",hide_empty:!0,_fields:"id,name,count",context:"view"};function Xr(e){let{onSelect:t,taxonomy:n}=e;const{_terms:o,showTerms:r}=(0,l.useSelect)((e=>{const t=e(c.store).getEntityRecords("taxonomy",n.slug,Yr);return{_terms:t,showTerms:(null==t?void 0:t.length)>=3}}),[]);if(!r)return null;const a=nr(o),u=(0,s.get)(n,["labels","most_used"]);return(0,i.createElement)("div",{className:"editor-post-taxonomies__flat-term-most-used"},(0,i.createElement)("h3",{className:"editor-post-taxonomies__flat-term-most-used-label"},u),(0,i.createElement)("ul",{role:"list",className:"editor-post-taxonomies__flat-term-most-used-list"},a.map((e=>(0,i.createElement)("li",{key:e.id},(0,i.createElement)(To.Button,{variant:"link",onClick:()=>t(e)},e.name))))))}const Zr=[],Jr={per_page:20,orderby:"count",order:"desc",_fields:"id,name",context:"view"},ei=(e,t)=>er(e).toLowerCase()===er(t).toLowerCase(),ti=(e,t)=>e.map((e=>(0,s.find)(t,(t=>ei(t.name,e))).id));var ni=(0,To.withFilters)("editor.PostTaxonomyType")((function(e){let{slug:t}=e;const[n,o]=(0,i.useState)([]),[r,a]=(0,i.useState)(""),d=(0,u.useDebounce)(a,500),{terms:p,termIds:m,taxonomy:h,hasAssignAction:g,hasCreateAction:f,hasResolvedTerms:v}=(0,l.useSelect)((e=>{const{getCurrentPost:n,getEditedPostAttribute:o}=e(oo),{getEntityRecords:r,getTaxonomy:i,hasFinishedResolution:a}=e(c.store),l=n(),u=i(t),d=u?o(u.rest_base):Zr,p={...Jr,include:d.join(","),per_page:-1};return{hasCreateAction:!!u&&(0,s.get)(l,["_links","wp:action-create-"+u.rest_base],!1),hasAssignAction:!!u&&(0,s.get)(l,["_links","wp:action-assign-"+u.rest_base],!1),taxonomy:u,termIds:d,terms:d.length?r("taxonomy",t,p):Zr,hasResolvedTerms:a("getEntityRecords",["taxonomy",t,p])}}),[t]),{searchResults:_}=(0,l.useSelect)((e=>{const{getEntityRecords:n}=e(c.store);return{searchResults:r?n("taxonomy",t,{...Jr,search:r}):Zr}}),[r]);(0,i.useEffect)((()=>{if(v){const e=p.map((e=>er(e.name)));o(e)}}),[p,v]);const y=(0,i.useMemo)((()=>(null!=_?_:[]).map((e=>er(e.name)))),[_]),{editPost:b}=(0,l.useDispatch)(oo);if(!g)return null;function E(e){b({[h.rest_base]:e})}const w=(0,s.get)(h,["labels","add_new_item"],"post_tag"===t?(0,Zt.__)("Add new tag"):(0,Zt.__)("Add new Term")),P=(0,s.get)(h,["labels","singular_name"],"post_tag"===t?(0,Zt.__)("Tag"):(0,Zt.__)("Term")),k=(0,Zt.sprintf)((0,Zt._x)("%s added","term"),P),C=(0,Zt.sprintf)((0,Zt._x)("%s removed","term"),P),T=(0,Zt.sprintf)((0,Zt._x)("Remove %s","term"),P);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(To.FormTokenField,{value:n,suggestions:y,onChange:function(e){const t=[...p,...null!=_?_:[]],n=(0,s.uniqBy)(e,(e=>e.toLowerCase())),r=n.filter((e=>!(0,s.find)(t,(t=>ei(t.name,e)))));if(o(n),0===r.length)return E(ti(n,t));f&&Promise.all(r.map((e=>function(e,t){const n=(0,s.escape)(e);return Kt()({path:`/wp/v2/$t}`,method:"POST",data:{name:n}}).catch((o=>"term_exists"===o.code?Kt()({path:(0,S.addQueryArgs)(`/wp/v2/$t}`,{...Jr,search:n})}).then(nr).then((t=>(0,s.find)(t,(t=>ei(t.name,e))))):Promise.reject(o))).then(tr)}(e,h.rest_base)))).then((e=>{const o=t.concat(e);return E(ti(n,o))}))},onInputChange:d,maxSuggestions:20,label:w,messages:{added:k,removed:C,remove:T}}),(0,i.createElement)(Xr,{taxonomy:h,onSelect:function(e){if(m.includes(e.id))return;const n=[...m,e.id],o=(0,Zt.sprintf)((0,Zt._x)("%s added","term"),(0,s.get)(h,["labels","singular_name"],"post_tag"===t?(0,Zt.__)("Tag"):(0,Zt.__)("Term")));(0,Qr.speak)(o,"assertive"),E(n)}}))}));const oi=()=>{const e=[(0,Zt.__)("Suggestion:"),(0,i.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,Zt.__)("Add tags"))];return(0,i.createElement)(To.PanelBody,{initialOpen:!1,title:e},(0,i.createElement)("p",null,(0,Zt.__)("Tags help users and search engines navigate your site and find your content. Add a few keywords to describe your post.")),(0,i.createElement)(ni,{slug:"post_tag"}))};class ri extends i.Component{constructor(e){super(e),this.state={hadTagsWhenOpeningThePanel:e.hasTags}}render(){return this.state.hadTagsWhenOpeningThePanel?null:(0,i.createElement)(oi,null)}}var ii=(0,u.compose)((0,l.withSelect)((e=>{const t=e(oo).getCurrentPostType(),n=e(c.store).getTaxonomy("post_tag"),o=n&&e(oo).getEditedPostAttribute(n.rest_base);return{areTagsFetched:void 0!==n,isPostTypeSupported:n&&(0,s.some)(n.types,(e=>e===t)),hasTags:o&&o.length}})),(0,u.ifCondition)((e=>{let{areTagsFetched:t,isPostTypeSupported:n}=e;return n&&t})))(ri);const si=(e,t)=>{const n=kr.filter((t=>(0,s.includes)(e,t.id)));return(0,s.find)(n,(e=>e.id===t))},ai=e=>{let{suggestedPostFormat:t,suggestionText:n,onUpdatePostFormat:o}=e;return(0,i.createElement)(To.Button,{variant:"link",onClick:()=>o(t)},n)};function li(){const{currentPostFormat:e,suggestion:t}=(0,l.useSelect)((e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:n}=e(oo),o=(0,s.get)(e(c.store).getThemeSupports(),["formats"],[]);return{currentPostFormat:t("format"),suggestion:si(o,n())}}),[]),{editPost:n}=(0,l.useDispatch)(oo),o=[(0,Zt.__)("Suggestion:"),(0,i.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,Zt.__)("Use a post format"))];return t&&t.id!==e?(0,i.createElement)(To.PanelBody,{initialOpen:!1,title:o},(0,i.createElement)("p",null,(0,Zt.__)("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,i.createElement)("p",null,(0,i.createElement)(ai,{onUpdatePostFormat:e=>n({format:e}),suggestedPostFormat:t.id,suggestionText:(0,Zt.sprintf)((0,Zt.__)('Apply the "%1$s" format.'),t.caption)}))):null}const ci={per_page:-1,orderby:"name",order:"asc",_fields:"id,name,parent",context:"view"},ui=[];var di=(0,To.withFilters)("editor.PostTaxonomyType")((function(e){let{slug:t}=e;const[n,o]=(0,i.useState)(!1),[r,a]=(0,i.useState)(""),[d,p]=(0,i.useState)(""),[m,h]=(0,i.useState)(!1),[g,f]=(0,i.useState)(""),[v,_]=(0,i.useState)([]),y=(0,u.useDebounce)(Qr.speak,500),{hasCreateAction:b,hasAssignAction:E,terms:w,loading:S,availableTerms:P,taxonomy:k}=(0,l.useSelect)((e=>{const{getCurrentPost:n,getEditedPostAttribute:o}=e(oo),{getTaxonomy:r,getEntityRecords:i,isResolving:a}=e(c.store),l=r(t);return{hasCreateAction:!!l&&(0,s.get)(n(),["_links","wp:action-create-"+l.rest_base],!1),hasAssignAction:!!l&&(0,s.get)(n(),["_links","wp:action-assign-"+l.rest_base],!1),terms:l?o(l.rest_base):ui,loading:a("getEntityRecords",["taxonomy",t,ci]),availableTerms:i("taxonomy",t,ci)||ui,taxonomy:l}}),[t]),{editPost:C}=(0,l.useDispatch)(oo),{saveEntityRecord:T}=(0,l.useDispatch)(c.store),x=(0,i.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}(Jo(P),w)),[P]);if(!E)return null;const B=e=>{C({[k.rest_base]:e})},A=e=>e.map((e=>(0,i.createElement)("div",{key:e.id,className:"editor-post-taxonomies__hierarchical-terms-choice"},(0,i.createElement)(To.CheckboxControl,{checked:-1!==w.indexOf(e.id),onChange:()=>{(e=>{const t=w.includes(e)?(0,s.without)(w,e):[...w,e];B(t)})(parseInt(e.id,10))},label:(0,s.unescape)(e.name)}),!!e.children.length&&(0,i.createElement)("div",{className:"editor-post-taxonomies__hierarchical-terms-subchoices"},A(e.children))))),I=(e,n,o)=>(0,s.get)(k,["labels",e],"category"===t?n:o),N=I("add_new_item",(0,Zt.__)("Add new category"),(0,Zt.__)("Add new term")),R=I("new_item_name",(0,Zt.__)("Add new category"),(0,Zt.__)("Add new term")),D=I("parent_item",(0,Zt.__)("Parent Category"),(0,Zt.__)("Parent Term")),L=`— $D} —`,O=N,F=(0,s.get)(k,["labels","search_items"],(0,Zt.__)("Search Terms")),U=(0,s.get)(k,["name"],(0,Zt.__)("Terms")),M=P.length>=8;return(0,i.createElement)(i.Fragment,null,M&&(0,i.createElement)(To.TextControl,{className:"editor-post-taxonomies__hierarchical-terms-filter",label:F,value:g,onChange:e=>{const t=x.map(function(e){const t=n=>{if(""===e)return n;const o={...n};return o.children.length>0&&(o.children=o.children.map(t).filter((e=>e))),(-1!==o.name.toLowerCase().indexOf(e.toLowerCase())||o.children.length>0)&&o};return t}(e)).filter((e=>e)),n=e=>{let t=0;for(let o=0;o<e.length;o++)t++,void 0!==e[o].children&&(t+=n(e[o].children));return t};f(e),_(t);const o=n(t),r=(0,Zt.sprintf)((0,Zt._n)("%d result found.","%d results found.",o),o);y(r,"assertive")}}),(0,i.createElement)("div",{className:"editor-post-taxonomies__hierarchical-terms-list",tabIndex:"0",role:"group","aria-label":U},A(""!==g?v:x)),!S&&b&&(0,i.createElement)(To.Button,{onClick:()=>{h(!m)},className:"editor-post-taxonomies__hierarchical-terms-add","aria-expanded":m,variant:"link"},N),m&&(0,i.createElement)("form",{onSubmit:async e=>{if(e.preventDefault(),""===r||n)return;const i=function(e,t,n){return(0,s.find)(e,(e=>(!e.parent&&!t||parseInt(e.parent)===parseInt(t))&&e.name.toLowerCase()===n.toLowerCase()))}(P,d,r);if(i)return(0,s.some)(w,(e=>e===i.id))||B([...w,i.id]),a(""),void p("");o(!0);const l=await(c={name:r,parent:d||void 0},T("taxonomy",t,c));var c;const u=(0,Zt.sprintf)((0,Zt._x)("%s added","term"),(0,s.get)(k,["labels","singular_name"],"category"===t?(0,Zt.__)("Category"):(0,Zt.__)("Term")));(0,Qr.speak)(u,"assertive"),o(!1),a(""),p(""),B([...w,l.id])}},(0,i.createElement)(To.TextControl,{className:"editor-post-taxonomies__hierarchical-terms-input",label:R,value:r,onChange:e=>{a(e)},required:!0}),!!P.length&&(0,i.createElement)(To.TreeSelect,{label:D,noOptionLabel:L,onChange:e=>{p(e)},selectedId:d,tree:x}),(0,i.createElement)(To.Button,{variant:"secondary",type:"submit",className:"editor-post-taxonomies__hierarchical-terms-submit"},O)))}));var pi=function(){const e=(0,l.useSelect)((e=>{var t;const n=e(oo).getCurrentPostType(),o=e(c.store).getTaxonomy("category"),r=null===(t=e(c.store).getEntityRecords("taxonomy","category",{slug:"uncategorized"}))||void 0===t?void 0:t[0],i=o&&(0,s.some)(o.types,(e=>e===n)),a=o&&e(oo).getEditedPostAttribute(o.rest_base);return!!o&&!!r&&i&&(0===(null==a?void 0:a.length)||1===(null==a?void 0:a.length)&&r.id===a[0])}),[]),[t,n]=(0,i.useState)(!1);if((0,i.useEffect)((()=>{e&&n(!0)}),[e]),!t)return null;const o=[(0,Zt.__)("Suggestion:"),(0,i.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,Zt.__)("Assign a category"))];return(0,i.createElement)(To.PanelBody,{initialOpen:!1,title:o},(0,i.createElement)("p",null,(0,Zt.__)("Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.")),(0,i.createElement)(di,{slug:"category"}))};var mi=function(e){let{children:t}=e;const{isBeingScheduled:n,isRequestingSiteIcon:o,hasPublishAction:r,siteIconUrl:a,siteTitle:u,siteHome:d}=(0,l.useSelect)((e=>{const{getCurrentPost:t,isEditedPostBeingScheduled:n}=e(oo),{getEntityRecord:o,isResolving:r}=e(c.store),i=o("root","__unstableBase",void 0)||{};return{hasPublishAction:(0,s.get)(t(),["_links","wp:action-publish"],!1),isBeingScheduled:n(),isRequestingSiteIcon:r("getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:i.site_icon_url,siteTitle:i.name,siteHome:i.home&&(0,S.filterURLForDisplay)(i.home)}}),[]);let p,m,h=(0,i.createElement)(To.Icon,{className:"components-site-icon",size:"36px",icon:zr});return a&&(h=(0,i.createElement)("img",{alt:(0,Zt.__)("Site Icon"),className:"components-site-icon",src:a})),o&&(h=null),r?n?(p=(0,Zt.__)("Are you ready to schedule?"),m=(0,Zt.__)("Your work will be published at the specified date and time.")):(p=(0,Zt.__)("Are you ready to publish?"),m=(0,Zt.__)("Double-check your settings before publishing.")):(p=(0,Zt.__)("Are you ready to submit for review?"),m=(0,Zt.__)("When you’re ready, submit your work for review, and an Editor will be able to approve it for you.")),(0,i.createElement)("div",{className:"editor-post-publish-panel__prepublish"},(0,i.createElement)("div",null,(0,i.createElement)("strong",null,p)),(0,i.createElement)("p",null,m),(0,i.createElement)("div",{className:"components-site-card"},h,(0,i.createElement)("div",{className:"components-site-info"},(0,i.createElement)("span",{className:"components-site-name"},(0,Oo.decodeEntities)(u)||(0,Zt.__)("(Untitled)")),(0,i.createElement)("span",{className:"components-site-home"},d))),r&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(To.PanelBody,{initialOpen:!1,title:[(0,Zt.__)("Visibility:"),(0,i.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,i.createElement)(jr,null))]},(0,i.createElement)(Gr,null)),(0,i.createElement)(To.PanelBody,{initialOpen:!1,title:[(0,Zt.__)("Publish:"),(0,i.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,i.createElement)(qr,null))]},(0,i.createElement)(Kr,null))),(0,i.createElement)(li,null),(0,i.createElement)(ii,null),(0,i.createElement)(pi,null),t)};const hi="%postname%";function gi(e){let{text:t,onCopy:n,children:o}=e;const r=(0,u.useCopyToClipboard)(t,n);return(0,i.createElement)(To.Button,{variant:"secondary",ref:r},o)}class fi extends i.Component{constructor(){super(...arguments),this.state={showCopyConfirmation:!1},this.onCopy=this.onCopy.bind(this),this.onSelectInput=this.onSelectInput.bind(this),this.postLink=(0,i.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=(0,s.get)(o,["labels","singular_name"]),a=(0,s.get)(o,["labels","view_item"]),l=(0,s.get)(o,["labels","add_new_item"]),c="future"===n.status?(e=>{const{slug:t}=e;return e.permalink_template.includes(hi)?e.permalink_template.replace(hi,t):e.permalink_template})(n):n.link,u=(0,S.addQueryArgs)("post-new.php",{post_type:n.type}),d=t?(0,i.createElement)(i.Fragment,null,(0,Zt.__)("is now scheduled. It will go live on")," ",(0,i.createElement)(qr,null),"."):(0,Zt.__)("is now live.");return(0,i.createElement)("div",{className:"post-publish-panel__postpublish"},(0,i.createElement)(To.PanelBody,{className:"post-publish-panel__postpublish-header"},(0,i.createElement)("a",{ref:this.postLink,href:c},(0,Oo.decodeEntities)(n.title)||(0,Zt.__)("(no title)"))," ",d),(0,i.createElement)(To.PanelBody,null,(0,i.createElement)("p",{className:"post-publish-panel__postpublish-subheader"},(0,i.createElement)("strong",null,(0,Zt.__)("What’s next?"))),(0,i.createElement)("div",{className:"post-publish-panel__postpublish-post-address-container"},(0,i.createElement)(To.TextControl,{className:"post-publish-panel__postpublish-post-address",readOnly:!0,label:(0,Zt.sprintf)((0,Zt.__)("%s address"),r),value:(0,S.safeDecodeURIComponent)(c),onFocus:this.onSelectInput}),(0,i.createElement)("div",{className:"post-publish-panel__postpublish-post-address__copy-button-wrap"},(0,i.createElement)(gi,{text:c,onCopy:this.onCopy},this.state.showCopyConfirmation?(0,Zt.__)("Copied!"):(0,Zt.__)("Copy")))),(0,i.createElement)("div",{className:"post-publish-panel__postpublish-buttons"},!t&&(0,i.createElement)(To.Button,{variant:"primary",href:c},a),(0,i.createElement)(To.Button,{variant:t?"primary":"secondary",href:u},l))),e)}}var vi=(0,l.withSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPost:n,isCurrentPostScheduled:o}=e(oo),{getPostType:r}=e(c.store);return{post:n(),postType:r(t("type")),isScheduled:o()}}))(fi);class _i extends i.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,forceIsSaving:t,isBeingScheduled:n,isPublished:o,isPublishSidebarEnabled:a,isScheduled:l,isSaving:c,isSavingNonPostEntityChanges:u,onClose:d,onTogglePublishSidebar:p,PostPublishExtension:m,PrePublishExtension:h,...g}=this.props,f=(0,s.omit)(g,["hasPublishAction","isDirty","isPostTypeViewable"]),v=o||l&&n,_=!v&&!c,y=v&&!c;return(0,i.createElement)("div",r({className:"editor-post-publish-panel"},f),(0,i.createElement)("div",{className:"editor-post-publish-panel__header"},y?(0,i.createElement)(To.Button,{onClick:d,icon:Mr,label:(0,Zt.__)("Close panel")}):(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"editor-post-publish-panel__header-publish-button"},(0,i.createElement)(Ur,{focusOnMount:!0,onSubmit:this.onSubmit,forceIsDirty:e,forceIsSaving:t})),(0,i.createElement)("div",{className:"editor-post-publish-panel__header-cancel-button"},(0,i.createElement)(To.Button,{disabled:u,onClick:d,variant:"secondary"},(0,Zt.__)("Cancel"))))),(0,i.createElement)("div",{className:"editor-post-publish-panel__content"},_&&(0,i.createElement)(mi,null,h&&(0,i.createElement)(h,null)),y&&(0,i.createElement)(vi,{focusOnMount:!0},m&&(0,i.createElement)(m,null)),c&&(0,i.createElement)(To.Spinner,null)),(0,i.createElement)("div",{className:"editor-post-publish-panel__footer"},(0,i.createElement)(To.CheckboxControl,{label:(0,Zt.__)("Always show pre-publish checks."),checked:a,onChange:p})))}}var yi=(0,u.compose)([(0,l.withSelect)((e=>{const{getPostType:t}=e(c.store),{getCurrentPost:n,getEditedPostAttribute:o,isCurrentPostPublished:r,isCurrentPostScheduled:i,isEditedPostBeingScheduled:a,isEditedPostDirty:l,isSavingPost:u,isSavingNonPostEntityChanges:d}=e(oo),{isPublishSidebarEnabled:p}=e(oo),m=t(o("type"));return{hasPublishAction:(0,s.get)(n(),["_links","wp:action-publish"],!1),isPostTypeViewable:(0,s.get)(m,["viewable"],!1),isBeingScheduled:a(),isDirty:l(),isPublished:r(),isPublishSidebarEnabled:p(),isSaving:u(),isSavingNonPostEntityChanges:d(),isScheduled:i()}})),(0,l.withDispatch)(((e,t)=>{let{isPublishSidebarEnabled:n}=t;const{disablePublishSidebar:o,enablePublishSidebar:r}=e(oo);return{onTogglePublishSidebar:()=>{n?o():r()}}})),To.withFocusReturn,To.withConstrainedTabbing])(_i);var bi=(0,i.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.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"}));var Ei=function(e){let{icon:t,size:n=24,...o}=e;return(0,i.cloneElement)(t,{width:n,height:n,...o})};var wi=(0,i.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.createElement)(C.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));var Si=(0,i.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.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"}));var Pi=(0,u.compose)([(0,l.withSelect)((e=>{const{isSavingPost:t,isCurrentPostPublished:n,isCurrentPostScheduled:o}=e(oo);return{isSaving:t(),isPublished:n(),isScheduled:o()}})),(0,l.withDispatch)((e=>{const{editPost:t,savePost:n}=e(oo);return{onClick:()=>{t({status:"draft"}),n()}}}))])((function(e){let{isSaving:t,isPublished:n,isScheduled:o,onClick:r}=e;const s=(0,u.useViewportMatch)("small","<"),[a,l]=(0,i.useState)(!1);if(!n&&!o)return null;let c;return n?c=(0,Zt.__)("Are you sure you want to unpublish this post?"):o&&(c=(0,Zt.__)("Are you sure you want to unschedule this post?")),(0,i.createElement)(i.Fragment,null,(0,i.createElement)(To.Button,{className:"editor-post-switch-to-draft",onClick:()=>{l(!0)},disabled:t,variant:"tertiary"},s?(0,Zt.__)("Draft"):(0,Zt.__)("Switch to draft")),(0,i.createElement)(To.__experimentalConfirmDialog,{isOpen:a,onConfirm:()=>{l(!1),r()},onCancel:()=>l(!1)},c))}));function ki(e){let{forceIsDirty:t,forceIsSaving:n,showIconLabels:o=!1}=e;const[r,s]=(0,i.useState)(!1),a=(0,u.useViewportMatch)("small"),{isAutosaving:c,isDirty:d,isNew:p,isPending:m,isPublished:h,isSaveable:g,isSaving:f,isScheduled:v,hasPublishAction:_}=(0,l.useSelect)((e=>{var o,r,i;const{isEditedPostNew:s,isCurrentPostPublished:a,isCurrentPostScheduled:l,isEditedPostDirty:c,isSavingPost:u,isEditedPostSaveable:d,getCurrentPost:p,isAutosavingPost:m,getEditedPostAttribute:h}=e(oo);return{isAutosaving:m(),isDirty:t||c(),isNew:s(),isPending:"pending"===h("status"),isPublished:a(),isSaving:n||u(),isSaveable:d(),isScheduled:l(),hasPublishAction:null!==(o=null===(r=p())||void 0===r||null===(i=r._links)||void 0===i?void 0:i["wp:action-publish"])&&void 0!==o&&o}}),[t,n]),{savePost:y}=(0,l.useDispatch)(oo),b=(0,u.usePrevious)(f);if((0,i.useEffect)((()=>{let e;return b&&!f&&(s(!0),e=setTimeout((()=>{s(!1)}),1e3)),()=>clearTimeout(e)}),[f]),!_&&m)return null;if(h||v)return(0,i.createElement)(Pi,null);const E=m?(0,Zt.__)("Save as pending"):(0,Zt.__)("Save draft"),w=(0,Zt.__)("Save"),S=r||!p&&!d,P=f||S,k=f||S||!g;let C;return f?C=c?(0,Zt.__)("Autosaving"):(0,Zt.__)("Saving"):S?C=(0,Zt.__)("Saved"):a?C=E:o&&(C=w),(0,i.createElement)(To.Button,{className:g||f?po()({"editor-post-save-draft":!P,"editor-post-saved-state":P,"is-saving":f,"is-autosaving":c,"is-saved":S,[(0,To.__unstableGetAnimateClassName)({type:"loading"})]:f}):void 0,onClick:k?void 0:()=>y(),shortcut:xo.displayShortcut.primary("s"),variant:a?"tertiary":void 0,icon:a?void 0:bi,label:o?void 0:E,"aria-disabled":k},P&&(0,i.createElement)(Ei,{icon:S?wi:Si}),C)}var Ci=(0,u.compose)([(0,l.withSelect)((e=>{const{getCurrentPost:t,getCurrentPostType:n}=e(oo);return{hasPublishAction:(0,s.get)(t(),["_links","wp:action-publish"],!1),postType:n()}}))])((function(e){let{hasPublishAction:t,children:n}=e;return t?n:null}));function Ti(e){let{children:t}=e;return(0,i.createElement)(Yo,{supportKeys:"slug"},t)}class xi extends i.Component{constructor(e){let{postSlug:t,postTitle:n,postID:o}=e;super(...arguments),this.state={editedSlug:(0,S.safeDecodeURIComponent)(t)||(0,S.cleanForSlug)(n)||o},this.setSlug=this.setSlug.bind(this)}setSlug(e){const{postSlug:t,onUpdateSlug:n}=this.props,{value:o}=e.target,r=(0,S.cleanForSlug)(o);r!==t&&n(r)}render(){const{instanceId:e}=this.props,{editedSlug:t}=this.state,n="editor-post-slug-"+e;return(0,i.createElement)(Ti,null,(0,i.createElement)("label",{htmlFor:n},(0,Zt.__)("Slug")),(0,i.createElement)("input",{autoComplete:"off",spellCheck:"false",type:"text",id:n,value:t,onChange:e=>this.setState({editedSlug:e.target.value}),onBlur:this.setSlug,className:"editor-post-slug__input"}))}}var Bi=(0,u.compose)([(0,l.withSelect)((e=>{const{getCurrentPost:t,getEditedPostAttribute:n}=e(oo),{id:o}=t();return{postSlug:n("slug"),postTitle:n("title"),postID:o}})),(0,l.withDispatch)((e=>{const{editPost:t}=e(oo);return{onUpdateSlug(e){t({slug:e})}}})),u.withInstanceId])(xi);var Ai=(0,u.compose)([(0,l.withSelect)((e=>{const t=e(oo).getCurrentPost();return{hasStickyAction:(0,s.get)(t,["_links","wp:action-sticky"],!1),postType:e(oo).getCurrentPostType()}}))])((function(e){let{hasStickyAction:t,postType:n,children:o}=e;return"post"===n&&t?o:null}));var Ii=(0,u.compose)([(0,l.withSelect)((e=>({postSticky:e(oo).getEditedPostAttribute("sticky")}))),(0,l.withDispatch)((e=>({onUpdateSticky(t){e(oo).editPost({sticky:t})}})))])((function(e){let{onUpdateSticky:t,postSticky:n=!1}=e;return(0,i.createElement)(Ai,null,(0,i.createElement)(To.CheckboxControl,{label:(0,Zt.__)("Stick to the top of the blog"),checked:n,onChange:()=>t(!n)}))}));var Ni=(0,u.compose)([(0,l.withSelect)((e=>({postType:e(oo).getCurrentPostType(),taxonomies:e(c.store).getTaxonomies({per_page:-1})})))])((function(e){let{postType:t,taxonomies:n,taxonomyWrapper:o=s.identity}=e;const r=(0,s.filter)(n,(e=>(0,s.includes)(e.types,t)));return(0,s.filter)(r,(e=>{var t;return null===(t=e.visibility)||void 0===t?void 0:t.show_ui})).map((e=>{const t=e.hierarchical?di:ni;return(0,i.createElement)(i.Fragment,{key:`taxonomy-$e.slug}`},o((0,i.createElement)(t,{slug:e.slug}),e))}))}));var Ri=(0,u.compose)([(0,l.withSelect)((e=>({postType:e(oo).getCurrentPostType(),taxonomies:e(c.store).getTaxonomies({per_page:-1})})))])((function(e){let{postType:t,taxonomies:n,children:o}=e;return(0,s.some)(n,(e=>(0,s.includes)(e.types,t)))?o:null})),Di=n(773);function Li(){const e=(0,l.useSelect)((e=>e(oo).getEditedPostContent()),[]),{editPost:t,resetEditorBlocks:n}=(0,l.useDispatch)(oo),[o,r]=(0,i.useState)(e),[s,c]=(0,i.useState)(!1),d=(0,u.useInstanceId)(Li);s||o===e||r(e);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(To.VisuallyHidden,{as:"label",htmlFor:`post-content-$d}`},(0,Zt.__)("Type text or HTML")),(0,i.createElement)(Di.Z,{autoComplete:"off",dir:"auto",value:o,onChange:e=>{const n=e.target.value;t({content:n}),r(n),c(!0)},onBlur:()=>{if(s){const e=(0,a.parse)(o);n(e),c(!1)}},className:"editor-post-text-editor",id:`post-content-$d}`,placeholder:(0,Zt.__)("Start writing with text or HTML")}))}const Oi=/[\r\n]+/g;function Fi(){const e=(0,i.useRef)(),[t,n]=(0,i.useState)(!1),{editPost:o}=(0,l.useDispatch)(oo),{insertDefaultBlock:r,clearSelectedBlock:s,insertBlocks:c}=(0,l.useDispatch)(p.store),{isCleanNewPost:d,title:m,placeholder:h,isFocusMode:g,hasFixedToolbar:f}=(0,l.useSelect)((e=>{const{getEditedPostAttribute:t,isCleanNewPost:n}=e(oo),{getSettings:o}=e(p.store),{titlePlaceholder:r,focusMode:i,hasFixedToolbar:s}=o();return{isCleanNewPost:n(),title:t("title"),placeholder:r,isFocusMode:i,hasFixedToolbar:s}}),[]);function v(e){c(e,0)}function _(e){o({title:e})}(0,i.useEffect)((()=>{if(!e.current)return;const{ownerDocument:t}=e.current,{activeElement:n,body:o}=t;!d||n&&o!==n||e.current.focus()}),[d]);const[y,b]=(0,i.useState)({});function E(){n(!1),b({})}const w=po()("wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text",{"is-selected":t,"is-focus-mode":g,"has-fixed-toolbar":f}),S=(0,Oo.decodeEntities)(h)||(0,Zt.__)("Add title"),{ref:P}=(0,co.__unstableUseRichText)({value:m,onChange:function(e){_(e.replace(Oi," "))},placeholder:S,selectionStart:y.start,selectionEnd:y.end,onSelectionChange(e,t){b((n=>{const{start:o,end:r}=n;return o===e&&r===t?n:{start:e,end:t}}))},__unstableDisableFormats:!0,preserveWhiteSpace:!0});return(0,i.createElement)(Yo,{supportKeys:"title"},(0,i.createElement)("h1",{ref:(0,u.useMergeRefs)([P,e]),contentEditable:!0,className:w,"aria-label":S,role:"textbox","aria-multiline":"true",onFocus:function(){n(!0),s()},onBlur:E,onKeyDown:function(e){e.keyCode===xo.ENTER&&(e.preventDefault(),r(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,a.pasteHandler)({HTML:o,plainText:n});if("string"!=typeof r&&r.length){e.preventDefault();const[t]=r;m||"core/heading"!==t.name&&"core/paragraph"!==t.name?v(r):(_(t.attributes.content),v(r.slice(1)))}}}))}function Ui(){const{isNew:e,postId:t}=(0,l.useSelect)((e=>{const t=e(oo);return{isNew:t.isEditedPostNew(),postId:t.getCurrentPostId()}}),[]),{trashPost:n}=(0,l.useDispatch)(oo);return e||!t?null:(0,i.createElement)(To.Button,{className:"editor-post-trash",isDestructive:!0,variant:"secondary",onClick:()=>n()},(0,Zt.__)("Move to trash"))}var Mi=(0,l.withSelect)((e=>{const{isEditedPostNew:t,getCurrentPostId:n,getCurrentPostType:o}=e(oo),{getPostType:r,canUser:i}=e(c.store),s=n(),a=r(o()),l=(null==a?void 0:a.rest_base)||"";return{isNew:t(),postId:s,canUserDelete:!(!s||!l)&&i("delete",l,s)}}))((function(e){let{isNew:t,postId:n,canUserDelete:o,children:r}=e;return!t&&n&&o?r:null}));var zi=(0,u.compose)([(0,l.withSelect)((e=>{const{getCurrentPost:t,getCurrentPostType:n}=e(oo);return{hasPublishAction:(0,s.get)(t(),["_links","wp:action-publish"],!1),postType:n()}}))])((function(e){let{hasPublishAction:t,render:n}=e;return n({canEdit:t})}));var Vi=(0,i.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.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"})),Hi=window.wp.wordcount;function Wi(){const e=(0,l.useSelect)((e=>e(oo).getEditedPostAttribute("content")),[]),t=(0,Zt._x)("words","Word count type. Do not translate!");return(0,i.createElement)("span",{className:"word-count"},(0,Hi.count)(e,t))}function Gi(){const e=(0,l.useSelect)((e=>e(oo).getEditedPostAttribute("content")),[]);return(0,Hi.count)(e,"characters_including_spaces")}var ji=function(e){let{hasOutlineItemsDisabled:t,onRequestClose:n}=e;const{headingCount:o,paragraphCount:r,numberOfBlocks:s}=(0,l.useSelect)((e=>{const{getGlobalBlockCount:t}=e(p.store);return{headingCount:t("core/heading"),paragraphCount:t("core/paragraph"),numberOfBlocks:t()}}),[]);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"table-of-contents__wrapper",role:"note","aria-label":(0,Zt.__)("Document Statistics"),tabIndex:"0"},(0,i.createElement)("ul",{role:"list",className:"table-of-contents__counts"},(0,i.createElement)("li",{className:"table-of-contents__count"},(0,Zt.__)("Characters"),(0,i.createElement)("span",{className:"table-of-contents__number"},(0,i.createElement)(Gi,null))),(0,i.createElement)("li",{className:"table-of-contents__count"},(0,Zt.__)("Words"),(0,i.createElement)(Wi,null)),(0,i.createElement)("li",{className:"table-of-contents__count"},(0,Zt.__)("Headings"),(0,i.createElement)("span",{className:"table-of-contents__number"},o)),(0,i.createElement)("li",{className:"table-of-contents__count"},(0,Zt.__)("Paragraphs"),(0,i.createElement)("span",{className:"table-of-contents__number"},r)),(0,i.createElement)("li",{className:"table-of-contents__count"},(0,Zt.__)("Blocks"),(0,i.createElement)("span",{className:"table-of-contents__number"},s)))),o>0&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("hr",null),(0,i.createElement)("h2",{className:"table-of-contents__title"},(0,Zt.__)("Document Outline")),(0,i.createElement)(bo,{onSelect:n,hasOutlineItemsDisabled:t})))};var $i=(0,i.forwardRef)((function(e,t){let{hasOutlineItemsDisabled:n,repositionDropdown:o,...s}=e;const a=(0,l.useSelect)((e=>!!e(p.store).getBlockCount()),[]);return(0,i.createElement)(To.Dropdown,{position:o?"middle right right":"bottom",className:"table-of-contents",contentClassName:"table-of-contents__popover",renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,i.createElement)(To.Button,r({},s,{ref:t,onClick:a?o:void 0,icon:Vi,"aria-expanded":n,"aria-haspopup":"true",label:(0,Zt.__)("Details"),tooltipPosition:"bottom","aria-disabled":!a}))},renderContent:e=>{let{onClose:t}=e;return(0,i.createElement)(ji,{onRequestClose:t,hasOutlineItemsDisabled:n})}})}));function Ki(){const e=(0,l.useSelect)((e=>()=>{const{__experimentalGetDirtyEntityRecords:t}=e(c.store);return t().length>0}),[]),t=t=>{if(e())return t.returnValue=(0,Zt.__)("You have unsaved changes. If you proceed, they will be lost."),t.returnValue};return(0,i.useEffect)((()=>(window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)})),[]),null}var qi=window.wp.reusableBlocks;var Qi=(0,u.createHigherOrderComponent)((e=>(0,l.withRegistry)((t=>{const{useSubRegistry:n=!0,registry:o,...r}=t;if(!n)return(0,i.createElement)(e,r);const[s,a]=(0,i.useState)(null);return(0,i.useEffect)((()=>{const e=(0,l.createRegistry)({"core/block-editor":p.storeConfig},o);e.registerStore("core/editor",no),a(e)}),[o]),s?(0,i.createElement)(l.RegistryProvider,{value:s},(0,i.createElement)(e,r)):null}))),"withRegistryProvider"),Yi=window.wp.mediaUtils;function Xi(e){let{additionalData:t={},allowedTypes:n,filesList:o,maxUploadFileSize:r,onError:i=s.noop,onFileChange:a}=e;const{getCurrentPostId:c,getEditorSettings:u}=(0,l.select)(oo),d=u().allowedMimeTypes;r=r||u().maxUploadFileSize,(0,Yi.uploadMedia)({allowedTypes:n,filesList:o,onFileChange:a,additionalData:{post:c(),...t},maxUploadFileSize:r,onError:e=>{let{message:t}=e;return i(t)},wpAllowedMimeTypes:d})}var Zi=function(e,t){const{reusableBlocks:n,hasUploadPermissions:o,canUseUnfilteredHTML:r,userCanCreatePages:a,pageOnFront:u}=(0,l.useSelect)((e=>{const{canUserUseUnfilteredHTML:t}=e(oo),n="web"===i.Platform.OS,{canUser:o,getEntityRecord:r}=e(c.store),a=r("root","site");return{canUseUnfilteredHTML:t(),reusableBlocks:n?e(c.store).getEntityRecords("postType","wp_block",{per_page:-1}):[],hasUploadPermissions:(0,s.defaultTo)(o("create","media"),!0),userCanCreatePages:o("create","pages"),pageOnFront:null==a?void 0:a.page_on_front}}),[]),{__experimentalBlockPatterns:d,__experimentalBlockPatternCategories:p}=e,{blockPatterns:m,blockPatternCategories:h}=(0,l.useSelect)((e=>({blockPatterns:null!=d?d:e(c.store).getBlockPatterns(),blockPatternCategories:null!=p?p:e(c.store).getBlockPatternCategories()})),[d,p]),{undo:g}=(0,l.useDispatch)(oo),{saveEntityRecord:f}=(0,l.useDispatch)(c.store),v=e=>a?f("postType","page",e):Promise.reject({message:(0,Zt.__)("You do not have permission to create Pages.")});return(0,i.useMemo)((()=>({...(0,s.pick)(e,["__experimentalBlockDirectory","__experimentalDiscussionSettings","__experimentalFeatures","__experimentalPreferredStyleVariations","__experimentalSetIsInserterOpened","__unstableGalleryWithImageBlocks","alignWide","allowedBlockTypes","bodyPlaceholder","canLockBlocks","codeEditingEnabled","colors","disableCustomColors","disableCustomFontSizes","disableCustomGradients","enableCustomLineHeight","enableCustomSpacing","enableCustomUnits","focusMode","fontSizes","gradients","generateAnchors","hasFixedToolbar","hasReducedUI","imageDefaultSize","imageDimensions","imageEditing","imageSizes","isRTL","keepCaretInsideBlock","maxWidth","onUpdateDefaultBlockStyles","styles","template","templateLock","titlePlaceholder","supportsLayout","widgetTypesToHideFromLegacyWidgetBlock","__unstableResolvedAssets"]),mediaUpload:o?Xi:void 0,__experimentalReusableBlocks:n,__experimentalBlockPatterns:m,__experimentalBlockPatternCategories:h,__experimentalFetchLinkSuggestions:(t,n)=>(0,c.__experimentalFetchLinkSuggestions)(t,n,e),__experimentalFetchRichUrlData:c.__experimentalFetchUrlData,__experimentalCanUserUseUnfilteredHTML:r,__experimentalUndo:g,outlineMode:t,__experimentalCreatePageEntity:v,__experimentalUserCanCreatePages:a,pageOnFront:u,__experimentalPreferPatternsOnRoot:t})),[e,o,n,m,h,r,g,t,a,u])};var Ji=Qi((function(e){let{__unstableTemplate:t,post:n,settings:o,recovery:r,initialEdits:s,children:a}=e;const u=(0,i.useMemo)((()=>"wp_template"===n.type?{}:{postId:n.id,postType:n.type}),[n.id,n.type]),{selection:d,isReady:m}=(0,l.useSelect)((e=>{const{getEditorSelection:t,__unstableIsEditorReady:n}=e(oo);return{isReady:n(),selection:t()}}),[]),{id:h,type:g}=null!=t?t:n,[f,v,_]=(0,c.useEntityBlockEditor)("postType",g,{id:h}),y=Zi(o,!!t),{updatePostLock:b,setupEditor:E,updateEditorSettings:w,__experimentalTearDownEditor:S}=(0,l.useDispatch)(oo),{createWarningNotice:P}=(0,l.useDispatch)(qt.store);return(0,i.useLayoutEffect)((()=>{if(!r)return b(o.postLock),E(n,s,o.template),o.autosave&&P((0,Zt.__)("There is an autosave of this post that is more recent than the version below."),{id:"autosave-exists",actions:[{label:(0,Zt.__)("View the autosave"),url:o.autosave.editLink}]}),()=>{S()}}),[]),(0,i.useEffect)((()=>{w(o)}),[o]),m?(0,i.createElement)(c.EntityProvider,{kind:"root",type:"site"},(0,i.createElement)(c.EntityProvider,{kind:"postType",type:n.type,id:n.id},(0,i.createElement)(p.BlockContextProvider,{value:u},(0,i.createElement)(p.BlockEditorProvider,{value:f,onChange:_,onInput:v,selection:d,settings:y,useSubRegistry:!1},a,(0,i.createElement)(qi.ReusableBlocksMenuItems,null))))):null})),es=window.wp.serverSideRender,ts=n.n(es);function ns(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const o=(0,i.forwardRef)(((n,o)=>(k()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),(0,i.createElement)(t,r({ref:o},n)))));return n.forEach((n=>{o[n]=ns(e+"."+n,t[n])})),o}function os(e,t){return function(){return k()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),t(...arguments)}}const rs=ns("RichText",p.RichText,["Content"]);rs.isEmpty=os("RichText.isEmpty",p.RichText.isEmpty);const is=ns("Autocomplete",p.Autocomplete),ss=ns("AlignmentToolbar",p.AlignmentToolbar),as=ns("BlockAlignmentToolbar",p.BlockAlignmentToolbar),ls=ns("BlockControls",p.BlockControls,["Slot"]),cs=ns("BlockEdit",p.BlockEdit),us=ns("BlockEditorKeyboardShortcuts",p.BlockEditorKeyboardShortcuts),ds=ns("BlockFormatControls",p.BlockFormatControls,["Slot"]),ps=ns("BlockIcon",p.BlockIcon),ms=ns("BlockInspector",p.BlockInspector),hs=ns("BlockList",p.BlockList),gs=ns("BlockMover",p.BlockMover),fs=ns("BlockNavigationDropdown",p.BlockNavigationDropdown),vs=ns("BlockSelectionClearer",p.BlockSelectionClearer),_s=ns("BlockSettingsMenu",p.BlockSettingsMenu),ys=ns("BlockTitle",p.BlockTitle),bs=ns("BlockToolbar",p.BlockToolbar),Es=ns("ColorPalette",p.ColorPalette),ws=ns("ContrastChecker",p.ContrastChecker),Ss=ns("CopyHandler",p.CopyHandler),Ps=ns("DefaultBlockAppender",p.DefaultBlockAppender),ks=ns("FontSizePicker",p.FontSizePicker),Cs=ns("Inserter",p.Inserter),Ts=ns("InnerBlocks",p.InnerBlocks,["ButtonBlockAppender","DefaultBlockAppender","Content"]),xs=ns("InspectorAdvancedControls",p.InspectorAdvancedControls,["Slot"]),Bs=ns("InspectorControls",p.InspectorControls,["Slot"]),As=ns("PanelColorSettings",p.PanelColorSettings),Is=ns("PlainText",p.PlainText),Ns=ns("RichTextShortcut",p.RichTextShortcut),Rs=ns("RichTextToolbarButton",p.RichTextToolbarButton),Ds=ns("__unstableRichTextInputEvent",p.__unstableRichTextInputEvent),Ls=ns("MediaPlaceholder",p.MediaPlaceholder),Os=ns("MediaUpload",p.MediaUpload),Fs=ns("MediaUploadCheck",p.MediaUploadCheck),Us=ns("MultiSelectScrollIntoView",p.MultiSelectScrollIntoView),Ms=ns("NavigableToolbar",p.NavigableToolbar),zs=ns("ObserveTyping",p.ObserveTyping),Vs=ns("SkipToSelectedBlock",p.SkipToSelectedBlock),Hs=ns("URLInput",p.URLInput),Ws=ns("URLInputButton",p.URLInputButton),Gs=ns("URLPopover",p.URLPopover),js=ns("Warning",p.Warning),$s=ns("WritingFlow",p.WritingFlow),Ks=os("createCustomColorsHOC",p.createCustomColorsHOC),qs=os("getColorClassName",p.getColorClassName),Qs=os("getColorObjectByAttributeValues",p.getColorObjectByAttributeValues),Ys=os("getColorObjectByColorValue",p.getColorObjectByColorValue),Xs=os("getFontSize",p.getFontSize),Zs=os("getFontSizeClass",p.getFontSizeClass),Js=os("withColorContext",p.withColorContext),ea=os("withColors",p.withColors),ta=os("withFontSizes",p.withFontSizes);function na(e){return k()("wp.editor.cleanForSlug",{since:"12.7",plugin:"Gutenberg",alternative:"wp.url.cleanForSlug"}),(0,S.cleanForSlug)(e)}}(),(window.wp=window.wp||{}).editor=o}();


Generated: Thu Mar 28 01:00:02 2024 Cross-referenced by PHPXref 0.7.1