/*! This file is auto-generated */ this.wp=this.wp||{},this.wp.editor=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=343)}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},11:function(e,t,n){"use strict";function r(e,t){for(var n=0;n-1},get:function(e){return r[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),r.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),r.splice(t,1))}}),i=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){i=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function c(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!o.has(e)){var t,n=null,r=null,c=null,a=function(){e.clientWidth!==r&&d()},s=function(t){window.removeEventListener("resize",a,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",s,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),o.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",s,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",d,!1),window.addEventListener("resize",a,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",o.set(e,{destroy:s,update:d}),"vertical"===(t=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),n="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(n)&&(n=0),d()}function u(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function l(){if(0!==e.scrollHeight){var t=function(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}(e),o=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+n+"px",r=e.clientWidth,t.forEach((function(e){e.node.scrollTop=e.scrollTop})),o&&(document.documentElement.scrollTop=o)}}function d(){l();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=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}n.d(t,"a",(function(){return r}))},22:function(e,t){!function(){e.exports=this.wp.richText}()},23:function(e,t,n){"use strict";var r=n(38);var o=n(39);function i(e,t){return Object(r.a)(e)||function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var c,a=e[Symbol.iterator]();!(r=(c=a.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}(e,t)||Object(o.a)()}n.d(t,"a",(function(){return i}))},26:function(e,t){!function(){e.exports=this.wp.url}()},27:function(e,t){!function(){e.exports=this.wp.hooks}()},28:function(e,t){!function(){e.exports=this.React}()},3:function(e,t){!function(){e.exports=this.wp.components}()},30:function(e,t,n){"use strict";function r(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}n.d(t,"a",(function(){return r}))},31:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e){return(o="function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?function(e){return r(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":r(e)})(e)}n.d(t,"a",(function(){return o}))},32:function(e,t){!function(){e.exports=this.wp.dataControls}()},325:function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["optimist"])}}return{optimist:a,innerState:e}}e.exports=function(e){function t(t,n,o){return t.length&&(t=t.concat([{action:o}])),u(n=e(n,o),o),r({optimist:t},n)}return function(n,a){if(a.optimist)switch(a.optimist.type){case o:return function(t,n){var o=l(t),i=o.optimist,c=o.innerState;return i=i.concat([{beforeState:c,action:n}]),u(c=e(c,n),n),r({optimist:i},c)}(n,a);case i:return function(e,n){var r=l(e),o=r.optimist,i=r.innerState,c=[],a=!1,u=!1;return o.forEach((function(e){a?e.beforeState&&s(e.action,n.optimist.id)?(u=!0,c.push({action:e.action})):c.push(e):e.beforeState&&!s(e.action,n.optimist.id)?(a=!0,c.push(e)):e.beforeState&&s(e.action,n.optimist.id)&&(u=!0)})),u||console.error('Cannot commit transaction with id "'+n.optimist.id+'" because it does not exist'),t(o=c,i,n)}(n,a);case c:return function(n,r){var o=l(n),i=o.optimist,c=o.innerState,a=[],d=!1,p=!1,b=c;return i.forEach((function(t){t.beforeState&&s(t.action,r.optimist.id)&&(b=t.beforeState,p=!0),s(t.action,r.optimist.id)||(t.beforeState&&(d=!0),d&&(p&&t.beforeState?a.push({beforeState:b,action:t.action}):a.push(t)),p&&(b=e(b,t.action),u(c,r)))})),p||console.error('Cannot revert transaction with id "'+r.optimist.id+'" because it does not exist'),t(i=a,b,r)}(n,a)}var d=l(n),p=d.optimist,b=d.innerState;if(n&&!p.length){var f=e(b,a);return f===b?n:(u(f,a),r({optimist:p},f))}return t(p,b,a)}},e.exports.BEGIN=o,e.exports.COMMIT=i,e.exports.REVERT=c},33:function(e,t,n){e.exports=n(87)()},34:function(e,t){!function(){e.exports=this.wp.apiFetch}()},343:function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"getDependencies",(function(){return ce})),n.d(r,"apply",(function(){return ae})),n.d(r,"update",(function(){return se}));var o={};n.r(o),n.d(o,"meta",(function(){return r}));var i={};n.r(i),n.d(i,"setupEditor",(function(){return Se})),n.d(i,"__experimentalTearDownEditor",(function(){return Pe})),n.d(i,"__experimentalSubscribeSources",(function(){return Ce})),n.d(i,"resetPost",(function(){return Te})),n.d(i,"resetAutosave",(function(){return xe})),n.d(i,"__experimentalRequestPostUpdateStart",(function(){return Be})),n.d(i,"__experimentalRequestPostUpdateFinish",(function(){return Ie})),n.d(i,"updatePost",(function(){return Ae})),n.d(i,"setupEditorState",(function(){return Le})),n.d(i,"editPost",(function(){return Re})),n.d(i,"__experimentalOptimisticUpdatePost",(function(){return Ne})),n.d(i,"savePost",(function(){return De})),n.d(i,"refreshPost",(function(){return Ue})),n.d(i,"trashPost",(function(){return Fe})),n.d(i,"autosave",(function(){return Me})),n.d(i,"__experimentalLocalAutosave",(function(){return Ve})),n.d(i,"redo",(function(){return He})),n.d(i,"undo",(function(){return We})),n.d(i,"createUndoLevel",(function(){return ze})),n.d(i,"updatePostLock",(function(){return Ke})),n.d(i,"__experimentalFetchReusableBlocks",(function(){return Ge})),n.d(i,"__experimentalReceiveReusableBlocks",(function(){return qe})),n.d(i,"__experimentalSaveReusableBlock",(function(){return Ye})),n.d(i,"__experimentalDeleteReusableBlock",(function(){return Qe})),n.d(i,"__experimentalUpdateReusableBlock",(function(){return Xe})),n.d(i,"__experimentalConvertBlockToStatic",(function(){return $e})),n.d(i,"__experimentalConvertBlockToReusable",(function(){return Ze})),n.d(i,"enablePublishSidebar",(function(){return Je})),n.d(i,"disablePublishSidebar",(function(){return et})),n.d(i,"lockPostSaving",(function(){return tt})),n.d(i,"unlockPostSaving",(function(){return nt})),n.d(i,"resetEditorBlocks",(function(){return rt})),n.d(i,"updateEditorSettings",(function(){return ot})),n.d(i,"resetBlocks",(function(){return ct})),n.d(i,"receiveBlocks",(function(){return at})),n.d(i,"updateBlock",(function(){return st})),n.d(i,"updateBlockAttributes",(function(){return ut})),n.d(i,"selectBlock",(function(){return lt})),n.d(i,"startMultiSelect",(function(){return dt})),n.d(i,"stopMultiSelect",(function(){return pt})),n.d(i,"multiSelect",(function(){return bt})),n.d(i,"clearSelectedBlock",(function(){return ft})),n.d(i,"toggleSelection",(function(){return ht})),n.d(i,"replaceBlocks",(function(){return mt})),n.d(i,"replaceBlock",(function(){return vt})),n.d(i,"moveBlocksDown",(function(){return Ot})),n.d(i,"moveBlocksUp",(function(){return gt})),n.d(i,"moveBlockToPosition",(function(){return jt})),n.d(i,"insertBlock",(function(){return yt})),n.d(i,"insertBlocks",(function(){return _t})),n.d(i,"showInsertionPoint",(function(){return kt})),n.d(i,"hideInsertionPoint",(function(){return Et})),n.d(i,"setTemplateValidity",(function(){return wt})),n.d(i,"synchronizeTemplate",(function(){return St})),n.d(i,"mergeBlocks",(function(){return Pt})),n.d(i,"removeBlocks",(function(){return Ct})),n.d(i,"removeBlock",(function(){return Tt})),n.d(i,"toggleBlockMode",(function(){return xt})),n.d(i,"startTyping",(function(){return Bt})),n.d(i,"stopTyping",(function(){return It})),n.d(i,"enterFormattedText",(function(){return At})),n.d(i,"exitFormattedText",(function(){return Lt})),n.d(i,"insertDefaultBlock",(function(){return Rt})),n.d(i,"updateBlockListSettings",(function(){return Nt}));var c={};n.r(c),n.d(c,"hasEditorUndo",(function(){return Ht})),n.d(c,"hasEditorRedo",(function(){return Wt})),n.d(c,"isEditedPostNew",(function(){return zt})),n.d(c,"hasChangedContent",(function(){return Kt})),n.d(c,"isEditedPostDirty",(function(){return Gt})),n.d(c,"isCleanNewPost",(function(){return qt})),n.d(c,"getCurrentPost",(function(){return Yt})),n.d(c,"getCurrentPostType",(function(){return Qt})),n.d(c,"getCurrentPostId",(function(){return Xt})),n.d(c,"getCurrentPostRevisionsCount",(function(){return $t})),n.d(c,"getCurrentPostLastRevisionId",(function(){return Zt})),n.d(c,"getPostEdits",(function(){return Jt})),n.d(c,"getCurrentPostAttribute",(function(){return en})),n.d(c,"getEditedPostAttribute",(function(){return nn})),n.d(c,"getAutosaveAttribute",(function(){return rn})),n.d(c,"getEditedPostVisibility",(function(){return on})),n.d(c,"isCurrentPostPending",(function(){return cn})),n.d(c,"isCurrentPostPublished",(function(){return an})),n.d(c,"isCurrentPostScheduled",(function(){return sn})),n.d(c,"isEditedPostPublishable",(function(){return un})),n.d(c,"isEditedPostSaveable",(function(){return ln})),n.d(c,"isEditedPostEmpty",(function(){return dn})),n.d(c,"isEditedPostAutosaveable",(function(){return pn})),n.d(c,"getAutosave",(function(){return bn})),n.d(c,"hasAutosave",(function(){return fn})),n.d(c,"isEditedPostBeingScheduled",(function(){return hn})),n.d(c,"isEditedPostDateFloating",(function(){return mn})),n.d(c,"isSavingPost",(function(){return vn})),n.d(c,"didPostSaveRequestSucceed",(function(){return On})),n.d(c,"didPostSaveRequestFail",(function(){return gn})),n.d(c,"isAutosavingPost",(function(){return jn})),n.d(c,"isPreviewingPost",(function(){return yn})),n.d(c,"getEditedPostPreviewLink",(function(){return _n})),n.d(c,"getSuggestedPostFormat",(function(){return kn})),n.d(c,"getBlocksForSerialization",(function(){return En})),n.d(c,"getEditedPostContent",(function(){return wn})),n.d(c,"__experimentalGetReusableBlock",(function(){return Sn})),n.d(c,"__experimentalIsSavingReusableBlock",(function(){return Pn})),n.d(c,"__experimentalIsFetchingReusableBlock",(function(){return Cn})),n.d(c,"__experimentalGetReusableBlocks",(function(){return Tn})),n.d(c,"getStateBeforeOptimisticTransaction",(function(){return xn})),n.d(c,"isPublishingPost",(function(){return Bn})),n.d(c,"isPermalinkEditable",(function(){return In})),n.d(c,"getPermalink",(function(){return An})),n.d(c,"getPermalinkParts",(function(){return Ln})),n.d(c,"inSomeHistory",(function(){return Rn})),n.d(c,"isPostLocked",(function(){return Nn})),n.d(c,"isPostSavingLocked",(function(){return Dn})),n.d(c,"isPostAutosavingLocked",(function(){return Un})),n.d(c,"isPostLockTakeover",(function(){return Fn})),n.d(c,"getPostLockUser",(function(){return Mn})),n.d(c,"getActivePostLock",(function(){return Vn})),n.d(c,"canUserUseUnfilteredHTML",(function(){return Hn})),n.d(c,"isPublishSidebarEnabled",(function(){return Wn})),n.d(c,"getEditorBlocks",(function(){return zn})),n.d(c,"__unstableIsEditorReady",(function(){return Kn})),n.d(c,"getEditorSettings",(function(){return Gn})),n.d(c,"getBlockName",(function(){return Yn})),n.d(c,"isBlockValid",(function(){return Qn})),n.d(c,"getBlockAttributes",(function(){return Xn})),n.d(c,"getBlock",(function(){return $n})),n.d(c,"getBlocks",(function(){return Zn})),n.d(c,"__unstableGetBlockWithoutInnerBlocks",(function(){return Jn})),n.d(c,"getClientIdsOfDescendants",(function(){return er})),n.d(c,"getClientIdsWithDescendants",(function(){return tr})),n.d(c,"getGlobalBlockCount",(function(){return nr})),n.d(c,"getBlocksByClientId",(function(){return rr})),n.d(c,"getBlockCount",(function(){return or})),n.d(c,"getBlockSelectionStart",(function(){return ir})),n.d(c,"getBlockSelectionEnd",(function(){return cr})),n.d(c,"getSelectedBlockCount",(function(){return ar})),n.d(c,"hasSelectedBlock",(function(){return sr})),n.d(c,"getSelectedBlockClientId",(function(){return ur})),n.d(c,"getSelectedBlock",(function(){return lr})),n.d(c,"getBlockRootClientId",(function(){return dr})),n.d(c,"getBlockHierarchyRootClientId",(function(){return pr})),n.d(c,"getAdjacentBlockClientId",(function(){return br})),n.d(c,"getPreviousBlockClientId",(function(){return fr})),n.d(c,"getNextBlockClientId",(function(){return hr})),n.d(c,"getSelectedBlocksInitialCaretPosition",(function(){return mr})),n.d(c,"getMultiSelectedBlockClientIds",(function(){return vr})),n.d(c,"getMultiSelectedBlocks",(function(){return Or})),n.d(c,"getFirstMultiSelectedBlockClientId",(function(){return gr})),n.d(c,"getLastMultiSelectedBlockClientId",(function(){return jr})),n.d(c,"isFirstMultiSelectedBlock",(function(){return yr})),n.d(c,"isBlockMultiSelected",(function(){return _r})),n.d(c,"isAncestorMultiSelected",(function(){return kr})),n.d(c,"getMultiSelectedBlocksStartClientId",(function(){return Er})),n.d(c,"getMultiSelectedBlocksEndClientId",(function(){return wr})),n.d(c,"getBlockOrder",(function(){return Sr})),n.d(c,"getBlockIndex",(function(){return Pr})),n.d(c,"isBlockSelected",(function(){return Cr})),n.d(c,"hasSelectedInnerBlock",(function(){return Tr})),n.d(c,"isBlockWithinSelection",(function(){return xr})),n.d(c,"hasMultiSelection",(function(){return Br})),n.d(c,"isMultiSelecting",(function(){return Ir})),n.d(c,"isSelectionEnabled",(function(){return Ar})),n.d(c,"getBlockMode",(function(){return Lr})),n.d(c,"isTyping",(function(){return Rr})),n.d(c,"isCaretWithinFormattedText",(function(){return Nr})),n.d(c,"getBlockInsertionPoint",(function(){return Dr})),n.d(c,"isBlockInsertionPointVisible",(function(){return Ur})),n.d(c,"isValidTemplate",(function(){return Fr})),n.d(c,"getTemplate",(function(){return Mr})),n.d(c,"getTemplateLock",(function(){return Vr})),n.d(c,"canInsertBlockType",(function(){return Hr})),n.d(c,"getInserterItems",(function(){return Wr})),n.d(c,"hasInserterItems",(function(){return zr})),n.d(c,"getBlockListSettings",(function(){return Kr}));var a={};n.r(a),n.d(a,"isRequestingDownloadableBlocks",(function(){return Qc})),n.d(a,"getDownloadableBlocks",(function(){return Xc})),n.d(a,"hasInstallBlocksPermission",(function(){return $c})),n.d(a,"getInstalledBlockTypes",(function(){return Zc}));var s={};n.r(s),n.d(s,"fetchDownloadableBlocks",(function(){return sa})),n.d(s,"receiveDownloadableBlocks",(function(){return ua})),n.d(s,"setInstallBlocksPermission",(function(){return la})),n.d(s,"downloadBlock",(function(){return da})),n.d(s,"installBlock",(function(){return pa})),n.d(s,"uninstallBlock",(function(){return ba})),n.d(s,"addInstalledBlockType",(function(){return fa})),n.d(s,"removeInstalledBlockType",(function(){return ha}));var u=n(6),l=n(9),d=(n(89),n(142),n(61)),p=n(22),b=n(42),f=n(7),h=n(4),m=n(32),v=n(10),O=n(31),g=n(83),j=n.n(g),y=n(2),_={insertUsage:{},isPublishSidebarEnabled:!0},k=Object(f.a)({},u.SETTINGS_DEFAULTS,{richEditingEnabled:!0,codeEditingEnabled:!0,enableCustomFields:!1});function E(e){return e&&"object"===Object(O.a)(e)&&"raw"in e?e.raw:e}var w=Object(h.combineReducers)({data:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_REUSABLE_BLOCKS":return Object(f.a)({},e,Object(y.keyBy)(t.results,"id"));case"UPDATE_REUSABLE_BLOCK":var n=t.id,r=t.changes;return Object(f.a)({},e,Object(v.a)({},n,Object(f.a)({},e[n],r)));case"SAVE_REUSABLE_BLOCK_SUCCESS":var o=t.id,i=t.updatedId;if(o===i)return e;var c=e[o];return Object(f.a)({},Object(y.omit)(e,o),Object(v.a)({},i,Object(f.a)({},c,{id:i})));case"REMOVE_REUSABLE_BLOCK":var a=t.id;return Object(y.omit)(e,a)}return e},isFetching:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"FETCH_REUSABLE_BLOCKS":var n=t.id;return n?Object(f.a)({},e,Object(v.a)({},n,!0)):e;case"FETCH_REUSABLE_BLOCKS_SUCCESS":case"FETCH_REUSABLE_BLOCKS_FAILURE":var r=t.id;return Object(y.omit)(e,r)}return e},isSaving:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SAVE_REUSABLE_BLOCK":return Object(f.a)({},e,Object(v.a)({},t.id,!0));case"SAVE_REUSABLE_BLOCK_SUCCESS":case"SAVE_REUSABLE_BLOCK_FAILURE":var n=t.id;return Object(y.omit)(e,n)}return e}});var S=j()(Object(h.combineReducers)({postId:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SETUP_EDITOR_STATE":case"RESET_POST":case"UPDATE_POST":return t.post.id}return e},postType:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SETUP_EDITOR_STATE":case"RESET_POST":case"UPDATE_POST":return t.post.type}return e},preferences:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_;switch((arguments.length>1?arguments[1]:void 0).type){case"ENABLE_PUBLISH_SIDEBAR":return Object(f.a)({},e,{isPublishSidebarEnabled:!0});case"DISABLE_PUBLISH_SIDEBAR":return Object(f.a)({},e,{isPublishSidebarEnabled:!1})}return e},saving:function(){var 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(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isLocked:!1},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_POST_LOCK":return t.lock}return e},reusableBlocks:w,template:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_TEMPLATE_VALIDITY":return Object(f.a)({},e,{isValid:t.isValid})}return e},postSavingLock:function(){var 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 Object(f.a)({},e,Object(v.a)({},t.lockName,!0));case"UNLOCK_POST_SAVING":return Object(y.omit)(e,t.lockName)}return e},isReady:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];switch((arguments.length>1?arguments[1]:void 0).type){case"SETUP_EDITOR_STATE":return!0;case"TEAR_DOWN_EDITOR":return!1}return e},editorSettings:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:k,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_EDITOR_SETTINGS":return Object(f.a)({},e,t.settings)}return e},postAutosavingLock:function(){var 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 Object(f.a)({},e,Object(v.a)({},t.lockName,!0));case"UNLOCK_POST_AUTOSAVING":return Object(y.omit)(e,t.lockName)}return e}})),P=n(72),C=n.n(P),T=n(20),x=n.n(T),B=n(43),I=n(34),A=n.n(I),L=n(1),R=n(23),N=n(17),D=n(37),U=n.n(D),F=n(41),M=n.n(F),V=new Set(["meta"]),H="core/editor",W="post-update",z="SAVE_POST_NOTICE_ID",K="TRASH_POST_NOTICE_ID",G=/%(?:postname|pagename)%/,q=6e4,Y=["title","excerpt","content"];function Q(e){var t=e.previousPost,n=e.post,r=e.postType;if(Object(y.get)(e.options,["isAutosave"]))return[];var o,i=["publish","private","future"],c=Object(y.includes)(i,t.status),a=Object(y.includes)(i,n.status),s=Object(y.get)(r,["viewable"],!1);if(c||a?c&&!a?(o=r.labels.item_reverted_to_draft,s=!1):o=!c&&a?{publish:r.labels.item_published,private:r.labels.item_published_privately,future:r.labels.item_scheduled}[n.status]:r.labels.item_updated:o=null,o){var u=[];return s&&u.push({label:r.labels.view_item,url:n.link}),[o,{id:z,type:"snackbar",actions:u}]}return[]}function X(e){var t=e.post,n=e.edits,r=e.error;if(r&&"rest_autosave_no_changes"===r.code)return[];var o=["publish","private","future"],i=-1!==o.indexOf(t.status),c={publish:Object(L.__)("Publishing failed."),private:Object(L.__)("Publishing failed."),future:Object(L.__)("Scheduling failed.")},a=i||-1===o.indexOf(n.status)?Object(L.__)("Updating failed."):c[n.status];return r.message&&!/<\/?[^>]*>/.test(r.message)&&(a=Object(L.sprintf)(Object(L.__)("%1$s Error message: %2$s"),a,r.message)),[a,{id:z}]}var $=n(44),Z=n.n($),J=n(69),ee=Z()((function(e){1===e.length&&Object(l.isUnmodifiedDefaultBlock)(e[0])&&(e=[]);var t=Object(l.serialize)(e);return 1===e.length&&e[0].name===Object(l.getFreeformContentHandlerName)()&&(t=Object(J.removep)(t)),t}),{maxSize:1});function te(e){return"wp-autosave-block-editor-post-".concat(e)}function ne(e){window.sessionStorage.removeItem(te(e))}var re={AWAIT_NEXT_STATE_CHANGE:Object(h.createRegistryControl)((function(e){return function(){return new Promise((function(t){var n=e.subscribe((function(){n(),t()}))}))}})),GET_REGISTRY:Object(h.createRegistryControl)((function(e){return function(){return e}})),LOCAL_AUTOSAVE_SET:function(e){!function(e,t,n,r){window.sessionStorage.setItem(te(e),JSON.stringify({post_title:t,content:n,excerpt:r}))}(e.postId,e.title,e.content,e.excerpt)}},oe=x.a.mark(ce),ie=x.a.mark(se);function ce(){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(m.select)("core/editor","getEditedPostAttribute","meta");case 2:return e.t0=e.sent,e.abrupt("return",{meta:e.t0});case 4:case"end":return e.stop()}}),oe)}function ae(e,t){return t.meta[e.meta]}function se(e,t){return x.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Re({meta:Object(v.a)({},e.meta,t)});case 2:case"end":return n.stop()}}),ie)}var ue=x.a.mark(Ee),le=x.a.mark(we),de=x.a.mark(Se),pe=x.a.mark(Ce),be=x.a.mark(xe),fe=x.a.mark(Re),he=x.a.mark(De),me=x.a.mark(Ue),ve=x.a.mark(Fe),Oe=x.a.mark(Me),ge=x.a.mark(Ve),je=x.a.mark(He),ye=x.a.mark(We),_e=x.a.mark(rt),ke=new WeakMap;function Ee(e){var t,n,r,i,c,a,s,u,l,d,p,b,h,O;return x.a.wrap((function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,{type:"GET_REGISTRY"};case 2:if(t=g.sent,ke.has(t)){g.next=5;break}return g.abrupt("return",e);case 5:n=ke.get(t),r=e,i=0;case 8:if(!(i0&&void 0!==d[0]?d[0]:Object.values(o)).length){p.next=3;break}return p.abrupt("return");case 3:return p.next=5,{type:"GET_REGISTRY"};case 5:t=p.sent,ke.has(t)||ke.set(t,new WeakMap),n=ke.get(t),r=!0,i=!1,c=void 0,p.prev=11,a=e[Symbol.iterator]();case 13:if(r=(s=a.next()).done){p.next=21;break}return u=s.value,p.delegateYield(u.getDependencies(),"t0",16);case 16:l=p.t0,n.set(u,l);case 18:r=!0,p.next=13;break;case 21:p.next=27;break;case 23:p.prev=23,p.t1=p.catch(11),i=!0,c=p.t1;case 27:p.prev=27,p.prev=28,r||null==a.return||a.return();case 30:if(p.prev=30,!i){p.next=33;break}throw c;case 33:return p.finish(30);case 34:return p.finish(27);case 35:case"end":return p.stop()}}),le,null,[[11,23,27,35],[28,,30,34]])}function Se(e,t,n){var r,o;return x.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return r=Object(y.has)(t,["content"])?t.content:e.content.raw,o=Object(l.parse)(r),"auto-draft"===e.status&&n&&(o=Object(l.synchronizeBlocksWithTemplate)(o,n)),i.next=6,Te(e);case 6:return i.delegateYield(we(),"t0",7);case 7:return i.next=9,{type:"SETUP_EDITOR",post:e,edits:t,template:n};case 9:return i.next=11,rt(o,{__unstableShouldCreateUndoLevel:!1});case 11:return i.next=13,Le(e);case 13:if(!t||!Object.keys(t).some((function(n){return t[n]!==(Object(y.has)(e,[n,"raw"])?e[n].raw:e[n])}))){i.next=16;break}return i.next=16,Re(t);case 16:return i.delegateYield(Ce(),"t1",17);case 17:case"end":return i.stop()}}),de)}function Pe(){return{type:"TEAR_DOWN_EDITOR"}}function Ce(){var e,t,n,r,i,c,a,s;return x.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=3,{type:"AWAIT_NEXT_STATE_CHANGE"};case 3:return u.next=5,Object(m.select)(H,"__unstableIsEditorReady");case 5:if(u.sent){u.next=8;break}return u.abrupt("break",36);case 8:return u.next=10,{type:"GET_REGISTRY"};case 10:e=u.sent,t=!1,n=0,r=Object.values(o);case 13:if(!(n0&&void 0!==arguments[0]?arguments[0]:{}}}function Ie(){return{type:"REQUEST_POST_UPDATE_FINISH",options:arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}}}function Ae(e){return{type:"UPDATE_POST",edits:e}}function Le(e){return{type:"SETUP_EDITOR_STATE",post:e}}function Re(e,t){var n,r,o;return x.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,Object(m.select)(H,"getCurrentPost");case 2:return n=i.sent,r=n.id,o=n.type,i.next=7,Object(m.dispatch)("core","editEntityRecord","postType",o,r,e,t);case 7:case"end":return i.stop()}}),fe)}function Ne(e){return Object(f.a)({},Ae(e),{optimist:{id:W}})}function De(){var e,t,n,r,o,i,c,a=arguments;return x.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return e=a.length>0&&void 0!==a[0]?a[0]:{},s.next=3,Object(m.select)(H,"isEditedPostSaveable");case 3:if(s.sent){s.next=5;break}return s.abrupt("return");case 5:return s.next=7,Object(m.select)(H,"getEditedPostContent");case 7:if(s.t0=s.sent,t={content:s.t0},e.isAutosave){s.next=12;break}return s.next=12,Object(m.dispatch)(H,"editPost",t,{undoIgnore:!0});case 12:return s.next=14,Be(e);case 14:return s.next=16,Object(m.select)(H,"getCurrentPost");case 16:return n=s.sent,s.t1=f.a,s.t2={id:n.id},s.next=21,Object(m.select)("core","getEntityRecordNonTransientEdits","postType",n.type,n.id);case 21:return s.t3=s.sent,s.t4=t,t=(0,s.t1)(s.t2,s.t3,s.t4),s.next=26,Object(m.dispatch)("core","saveEntityRecord","postType",n.type,t,e);case 26:return s.next=28,Ie(e);case 28:return s.next=30,Object(m.select)("core","getLastEntitySaveError","postType",n.type,n.id);case 30:if(!(r=s.sent)){s.next=38;break}if(!(o=X({post:n,edits:t,error:r})).length){s.next=36;break}return s.next=36,m.dispatch.apply(void 0,["core/notices","createErrorNotice"].concat(Object(N.a)(o)));case 36:s.next=56;break;case 38:return s.next=40,Object(m.select)(H,"getCurrentPost");case 40:return i=s.sent,s.t5=Q,s.t6=n,s.t7=i,s.next=46,Object(m.select)("core","getPostType",i.type);case 46:if(s.t8=s.sent,s.t9=e,s.t10={previousPost:s.t6,post:s.t7,postType:s.t8,options:s.t9},!(c=(0,s.t5)(s.t10)).length){s.next=53;break}return s.next=53,m.dispatch.apply(void 0,["core/notices","createSuccessNotice"].concat(Object(N.a)(c)));case 53:if(e.isAutosave){s.next=56;break}return s.next=56,Object(m.dispatch)("core/block-editor","__unstableMarkLastChangeAsPersistent");case 56:case"end":return s.stop()}}),he)}function Ue(){var e,t,n,r;return x.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,Object(m.select)(H,"getCurrentPost");case 2:return e=o.sent,o.next=5,Object(m.select)(H,"getCurrentPostType");case 5:return t=o.sent,o.next=8,Object(m.select)("core","getPostType",t);case 8:return n=o.sent,o.next=11,Object(m.apiFetch)({path:"/wp/v2/".concat(n.rest_base,"/").concat(e.id)+"?context=edit&_timestamp=".concat(Date.now())});case 11:return r=o.sent,o.next=14,Object(m.dispatch)(H,"resetPost",r);case 14:case"end":return o.stop()}}),me)}function Fe(){var e,t,n;return x.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Object(m.select)(H,"getCurrentPostType");case 2:return e=r.sent,r.next=5,Object(m.select)("core","getPostType",e);case 5:return t=r.sent,r.next=8,Object(m.dispatch)("core/notices","removeNotice",K);case 8:return r.prev=8,r.next=11,Object(m.select)(H,"getCurrentPost");case 11:return n=r.sent,r.next=14,Object(m.apiFetch)({path:"/wp/v2/".concat(t.rest_base,"/").concat(n.id),method:"DELETE"});case 14:return r.next=16,Object(m.dispatch)(H,"savePost");case 16:r.next=22;break;case 18:return r.prev=18,r.t0=r.catch(8),r.next=22,m.dispatch.apply(void 0,["core/notices","createErrorNotice"].concat(Object(N.a)([(o={error:r.t0}).error.message&&"unknown_error"!==o.error.code?o.error.message:Object(L.__)("Trashing failed"),{id:K}])));case 22:case"end":return r.stop()}var o}),ve,null,[[8,18]])}function Me(e){return x.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(m.dispatch)(H,"savePost",Object(f.a)({isAutosave:!0},e));case 2:case"end":return t.stop()}}),Oe)}function Ve(){var e,t,n,r;return x.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,Object(m.select)(H,"getCurrentPost");case 2:return e=o.sent,o.next=5,Object(m.select)(H,"getEditedPostAttribute","title");case 5:return t=o.sent,o.next=8,Object(m.select)(H,"getEditedPostAttribute","content");case 8:return n=o.sent,o.next=11,Object(m.select)(H,"getEditedPostAttribute","excerpt");case 11:return r=o.sent,o.next=14,{type:"LOCAL_AUTOSAVE_SET",postId:e.id,title:t,content:n,excerpt:r};case 14:case"end":return o.stop()}}),ge)}function He(){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(m.dispatch)("core","redo");case 2:case"end":return e.stop()}}),je)}function We(){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(m.dispatch)("core","undo");case 2:case"end":return e.stop()}}),ye)}function ze(){return{type:"CREATE_UNDO_LEVEL"}}function Ke(e){return{type:"UPDATE_POST_LOCK",lock:e}}function Ge(e){return{type:"FETCH_REUSABLE_BLOCKS",id:e}}function qe(e){return{type:"RECEIVE_REUSABLE_BLOCKS",results:e}}function Ye(e){return{type:"SAVE_REUSABLE_BLOCK",id:e}}function Qe(e){return{type:"DELETE_REUSABLE_BLOCK",id:e}}function Xe(e,t){return{type:"UPDATE_REUSABLE_BLOCK",id:e,changes:t}}function $e(e){return{type:"CONVERT_BLOCK_TO_STATIC",clientId:e}}function Ze(e){return{type:"CONVERT_BLOCK_TO_REUSABLE",clientIds:Object(y.castArray)(e)}}function Je(){return{type:"ENABLE_PUBLISH_SIDEBAR"}}function et(){return{type:"DISABLE_PUBLISH_SIDEBAR"}}function tt(e){return{type:"LOCK_POST_SAVING",lockName:e}}function nt(e){return{type:"UNLOCK_POST_SAVING",lockName:e}}function rt(e){var t,n,r,i,c,a,s,u,l,d,p,b,f,h,v,O,g,j,y,_,k,E,w=arguments;return x.a.wrap((function(S){for(;;)switch(S.prev=S.next){case 0:return t=w.length>1&&void 0!==w[1]?w[1]:{},S.next=3,Object(m.select)("core/block-editor","__experimentalGetLastBlockAttributeChanges");case 3:if(!(n=S.sent)){S.next=36;break}r=new Set,i=new Set,c=0,a=Object.entries(n);case 8:if(!(c1)return!1;var n=t[0].name;if(n!==Object(l.getDefaultBlockName)()&&n!==Object(l.getFreeformContentHandlerName)())return!1}return!wn(e)}var pn=Object(h.createRegistrySelector)((function(e){return function(t){if(!ln(t))return!1;if(Un(t))return!1;var n=Qt(t),r=Xt(t),o=e("core").hasFetchedAutosaves(n,r),i=Object(y.get)(e("core").getCurrentUser(),["id"]),c=e("core").getAutosave(n,r,i);return!!o&&(!c||(!!Kt(t)||["title","excerpt"].some((function(e){return E(c[e])!==nn(t,e)}))))}})),bn=Object(h.createRegistrySelector)((function(e){return function(t){U()("`wp.data.select( 'core/editor' ).getAutosave()`",{alternative:"`wp.data.select( 'core' ).getAutosave( postType, postId, userId )`",plugin:"Gutenberg"});var n=Qt(t),r=Xt(t),o=Object(y.get)(e("core").getCurrentUser(),["id"]),i=e("core").getAutosave(n,r,o);return Object(y.mapValues)(Object(y.pick)(i,Y),E)}})),fn=Object(h.createRegistrySelector)((function(e){return function(t){U()("`wp.data.select( 'core/editor' ).hasAutosave()`",{alternative:"`!! wp.data.select( 'core' ).getAutosave( postType, postId, userId )`",plugin:"Gutenberg"});var n=Qt(t),r=Xt(t),o=Object(y.get)(e("core").getCurrentUser(),["id"]);return!!e("core").getAutosave(n,r,o)}}));function hn(e){var t=nn(e,"date"),n=new Date(Number(Object(Ut.getDate)(t))-q);return Object(Ut.isInTheFuture)(n)}function mn(e){var t=nn(e,"date"),n=nn(e,"modified"),r=nn(e,"status");return("draft"===r||"auto-draft"===r||"pending"===r)&&t===n}var vn=Object(h.createRegistrySelector)((function(e){return function(t){var n=Qt(t),r=Xt(t);return e("core").isSavingEntityRecord("postType",n,r)}})),On=Object(h.createRegistrySelector)((function(e){return function(t){var n=Qt(t),r=Xt(t);return!e("core").getLastEntitySaveError("postType",n,r)}})),gn=Object(h.createRegistrySelector)((function(e){return function(t){var n=Qt(t),r=Xt(t);return!!e("core").getLastEntitySaveError("postType",n,r)}}));function jn(e){return!!vn(e)&&!!Object(y.get)(e.saving,["options","isAutosave"])}function yn(e){return!!vn(e)&&!!e.saving.options.isPreview}function _n(e){if(!e.saving.pending&&!vn(e)){var t=rn(e,"preview_link");t||(t=nn(e,"link"))&&(t=Object(Ft.addQueryArgs)(t,{preview:!0}));var n=nn(e,"featured_media");return t&&n?Object(Ft.addQueryArgs)(t,{_thumbnail_id:n}):t}}function kn(e){var t,n=zn(e);switch(1===n.length&&(t=n[0].name),2===n.length&&"core/paragraph"===n[1].name&&(t=n[0].name),t){case"core/image":return"image";case"core/quote":case"core/pullquote":return"quote";case"core/gallery":return"gallery";case"core/video":case"core-embed/youtube":case"core-embed/vimeo":return"video";case"core/audio":case"core-embed/spotify":case"core-embed/soundcloud":return"audio"}return null}function En(e){U()("`core/editor` getBlocksForSerialization selector",{plugin:"Gutenberg",alternative:"getEditorBlocks",hint:"Blocks serialization pre-processing occurs at save time"});var t=e.editor.present.blocks.value;return 1===t.length&&Object(l.isUnmodifiedDefaultBlock)(t[0])?[]:t}var wn=Object(h.createRegistrySelector)((function(e){return function(t){var n=Xt(t),r=Qt(t),o=e("core").getEditedEntityRecord("postType",r,n);if(o){if("function"==typeof o.content)return o.content(o);if(o.blocks)return ee(o.blocks);if(o.content)return o.content}return""}})),Sn=Object(Dt.a)((function(e,t){var n=e.reusableBlocks.data[t];if(!n)return null;var r=isNaN(parseInt(t));return Object(f.a)({},n,{id:r?t:+t,isTemporary:r})}),(function(e,t){return[e.reusableBlocks.data[t]]}));function Pn(e,t){return e.reusableBlocks.isSaving[t]||!1}function Cn(e,t){return!!e.reusableBlocks.isFetching[t]}var Tn=Object(Dt.a)((function(e){return Object(y.map)(e.reusableBlocks.data,(function(t,n){return Sn(e,n)}))}),(function(e){return[e.reusableBlocks.data]}));function xn(e,t){var n=Object(y.find)(e.optimist,(function(e){return e.beforeState&&Object(y.get)(e.action,["optimist","id"])===t}));return n?n.beforeState:null}function Bn(e){if(!vn(e))return!1;if(!an(e))return!1;var t=xn(e,W);return!!t&&!an(null,t.currentPost)}function In(e){var t=nn(e,"permalink_template");return G.test(t)}function An(e){var t=Ln(e);if(!t)return null;var n=t.prefix,r=t.postName,o=t.suffix;return In(e)?n+r+o:n}function Ln(e){var t=nn(e,"permalink_template");if(!t)return null;var n=nn(e,"slug")||nn(e,"generated_slug"),r=t.split(G),o=Object(R.a)(r,2);return{prefix:o[0],postName:n,suffix:o[1]}}function Rn(e,t){var n=e.optimist;return!!n&&n.some((function(e){var n=e.beforeState;return n&&t(n)}))}function Nn(e){return e.postLock.isLocked}function Dn(e){return Object.keys(e.postSavingLock).length>0}function Un(e){return Object.keys(e.postAutosavingLock).length>0}function Fn(e){return e.postLock.isTakeover}function Mn(e){return e.postLock.user}function Vn(e){return e.postLock.activePostLock}function Hn(e){return Object(y.has)(Yt(e),["_links","wp:action-unfiltered-html"])}function Wn(e){return e.preferences.hasOwnProperty("isPublishSidebarEnabled")?e.preferences.isPublishSidebarEnabled:_.isPublishSidebarEnabled}function zn(e){return nn(e,"blocks")||Vt}function Kn(e){return e.isReady}function Gn(e){return e.editorSettings}function qn(e){return Object(h.createRegistrySelector)((function(t){return function(n){var r;U()("`wp.data.select( 'core/editor' )."+e+"`",{alternative:"`wp.data.select( 'core/block-editor' )."+e+"`"});for(var o=arguments.length,i=new Array(o>1?o-1:0),c=1;c0&&void 0!==arguments[0]?arguments[0]:{},t=e.getBlockInsertionParentClientId,n=void 0===t?to:t,r=e.getInserterItems,o=void 0===r?no:r,i=e.getSelectedBlockName,c=void 0===i?ro:i;return{name:"blocks",className:"editor-autocompleters__block",triggerPrefix:"/",options:function(){oo();var e=c();return o(n()).filter((function(t){return e!==t.name}))},getOptionKeywords:function(e){var t=e.title,n=e.keywords,r=void 0===n?[]:n;return[e.category].concat(Object(N.a)(r),[t])},getOptionLabel:function(e){var t=e.icon,n=e.title;return[Object(eo.createElement)(u.BlockIcon,{key:"icon",icon:t,showColors:!0}),n]},allowContext:function(e,t){return!(/\S/.test(e)||/\S/.test(t))},getOptionCompletion:function(e){var t=e.name,n=e.initialAttributes;return{action:"replace",value:Object(l.createBlock)(t,n)}},isOptionDisabled:function(e){return e.isDisabled}}}(),co={name:"users",className:"editor-autocompleters__user",triggerPrefix:"@",options:function(e){var t="";return e&&(t="?search="+encodeURIComponent(e)),A()({path:"/wp/v2/users"+t})},isDebounced:!0,getOptionKeywords:function(e){return[e.slug,e.name]},getOptionLabel:function(e){return[Object(eo.createElement)("img",{key:"avatar",className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls[24]}),Object(eo.createElement)("span",{key:"name",className:"editor-autocompleters__user-name"},e.name),Object(eo.createElement)("span",{key:"slug",className:"editor-autocompleters__user-slug"},e.slug)]},getOptionCompletion:function(e){return"@".concat(e.slug)}},ao=n(12),so=n(11),uo=n(13),lo=n(14),po=n(15),bo=n(8),fo=function(e){function t(){return Object(ao.a)(this,t),Object(uo.a)(this,Object(lo.a)(t).apply(this,arguments))}return Object(po.a)(t,e),Object(so.a)(t,[{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isDirty,r=t.editsReference,o=t.isAutosaveable,i=t.isAutosaving;r!==e.editsReference&&(this.didAutosaveForEditsReference=!1),!i&&e.isAutosaving&&(this.didAutosaveForEditsReference=!0),e.isDirty===n&&e.isAutosaveable===o&&e.editsReference===r||this.toggleTimer(n&&o&&!this.didAutosaveForEditsReference)}},{key:"componentWillUnmount",value:function(){this.toggleTimer(!1)}},{key:"toggleTimer",value:function(e){var t=this,n=this.props,r=n.interval,o=n.shouldThrottle,i=void 0!==o&&o;!i&&this.pendingSave&&(clearTimeout(this.pendingSave),delete this.pendingSave),!e||i&&this.pendingSave||(this.pendingSave=setTimeout((function(){t.props.autosave(),delete t.pendingSave}),1e3*r))}},{key:"render",value:function(){return null}}]),t}(eo.Component),ho=Object(bo.compose)([Object(h.withSelect)((function(e,t){var n=e("core").getReferenceByDistinctEdits,r=e("core/editor"),o=r.isEditedPostDirty,i=r.isEditedPostAutosaveable,c=r.isAutosavingPost,a=r.getEditorSettings,s=t.interval,u=void 0===s?a().autosaveInterval:s;return{isDirty:o(),isAutosaveable:i(),editsReference:n(),isAutosaving:c(),interval:u}})),Object(h.withDispatch)((function(e,t){return{autosave:function(){var n=t.autosave,r=void 0===n?e("core/editor").autosave:n;r()}}}))])(fo),mo=n(16),vo=n.n(mo),Oo=function(e){var t=e.children,n=e.isValid,r=e.level,o=e.path,i=void 0===o?[]:o,c=e.href,a=e.onSelect;return Object(eo.createElement)("li",{className:vo()("document-outline__item","is-".concat(r.toLowerCase()),{"is-invalid":!n})},Object(eo.createElement)("a",{href:c,className:"document-outline__button",onClick:a},Object(eo.createElement)("span",{className:"document-outline__emdash","aria-hidden":"true"}),i.map((function(e,t){var n=e.clientId;return Object(eo.createElement)("strong",{key:t,className:"document-outline__level"},Object(eo.createElement)(u.BlockTitle,{clientId:n}))})),Object(eo.createElement)("strong",{className:"document-outline__level"},r),Object(eo.createElement)("span",{className:"document-outline__item-content"},t)))},go=Object(eo.createElement)("em",null,Object(L.__)("(Empty heading)")),jo=[Object(eo.createElement)("br",{key:"incorrect-break"}),Object(eo.createElement)("em",{key:"incorrect-message"},Object(L.__)("(Incorrect heading level)"))],yo=[Object(eo.createElement)("br",{key:"incorrect-break-h1"}),Object(eo.createElement)("em",{key:"incorrect-message-h1"},Object(L.__)("(Your theme may already use a H1 for the post title)"))],_o=[Object(eo.createElement)("br",{key:"incorrect-break-multiple-h1"}),Object(eo.createElement)("em",{key:"incorrect-message-multiple-h1"},Object(L.__)("(Multiple H1 headings are not recommended)"))],ko=function(e){return!e.attributes.content||0===e.attributes.content.length},Eo=Object(bo.compose)(Object(h.withSelect)((function(e){var t=e("core/block-editor").getBlocks,n=e("core/editor").getEditedPostAttribute,r=(0,e("core").getPostType)(n("type"));return{title:n("title"),blocks:t(),isTitleSupported:Object(y.get)(r,["supports","title"],!1)}})))((function(e){var t=e.blocks,n=void 0===t?[]:t,r=e.title,o=e.onSelect,i=e.isTitleSupported,c=e.hasOutlineItemsDisabled,a=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object(y.flatMap)(t,(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return"core/heading"===t.name?Object(f.a)({},t,{path:n,level:t.attributes.level,isEmpty:ko(t)}):e(t.innerBlocks,[].concat(Object(N.a)(n),[t]))}))}(n);if(a.length<1)return null;var s=1,u=document.querySelector(".editor-post-title__input"),l=i&&r&&u,d=Object(y.countBy)(a,"level")[1]>1;return Object(eo.createElement)("div",{className:"document-outline"},Object(eo.createElement)("ul",null,l&&Object(eo.createElement)(Oo,{level:Object(L.__)("Title"),isValid:!0,onSelect:o,href:"#".concat(u.id),isDisabled:c},r),a.map((function(e,t){var n=e.level>s+1,r=!(e.isEmpty||n||!e.level||1===e.level&&(d||l));return s=e.level,Object(eo.createElement)(Oo,{key:t,level:"H".concat(e.level),isValid:r,path:e.path,isDisabled:c,href:"#block-".concat(e.clientId),onSelect:o},e.isEmpty?go:Object(p.getTextContent)(Object(p.create)({html:e.attributes.content})),n&&jo,1===e.level&&d&&_o,l&&1===e.level&&!d&&yo)}))))}));var wo=Object(h.withSelect)((function(e){return{blocks:e("core/block-editor").getBlocks()}}))((function(e){var t=e.blocks,n=e.children;return Object(y.filter)(t,(function(e){return"core/heading"===e.name})).length<1?null:n})),So=n(5),Po=n(3),Co=n(19);var To=Object(bo.compose)([Object(h.withSelect)((function(e){return{isDirty:(0,e("core/editor").isEditedPostDirty)()}})),Object(h.withDispatch)((function(e,t,n){var r=n.select,o=e("core/editor").savePost;return{onSave:function(){(0,r("core/editor").isEditedPostDirty)()&&o()}}}))])((function(e){var t=e.onSave;return Object(eo.createElement)(Po.KeyboardShortcuts,{bindGlobal:!0,shortcuts:Object(v.a)({},Co.rawShortcut.primary("s"),(function(e){e.preventDefault(),t()}))})})),xo=function(e){function t(){var e;return Object(ao.a)(this,t),(e=Object(uo.a)(this,Object(lo.a)(t).apply(this,arguments))).undoOrRedo=e.undoOrRedo.bind(Object(So.a)(e)),e}return Object(po.a)(t,e),Object(so.a)(t,[{key:"undoOrRedo",value:function(e){var t=this.props,n=t.onRedo,r=t.onUndo;e.shiftKey?n():r(),e.preventDefault()}},{key:"render",value:function(){var e;return Object(eo.createElement)(eo.Fragment,null,Object(eo.createElement)(u.BlockEditorKeyboardShortcuts,null),Object(eo.createElement)(Po.KeyboardShortcuts,{shortcuts:(e={},Object(v.a)(e,Co.rawShortcut.primary("z"),this.undoOrRedo),Object(v.a)(e,Co.rawShortcut.primaryShift("z"),this.undoOrRedo),e)}),Object(eo.createElement)(To,null))}}]),t}(eo.Component),Bo=Object(h.withDispatch)((function(e){var t=e("core/editor");return{onRedo:t.redo,onUndo:t.undo}}))(xo),Io=Bo;function Ao(){return U()("EditorGlobalKeyboardShortcuts",{alternative:"VisualEditorGlobalKeyboardShortcuts",plugin:"Gutenberg"}),Object(eo.createElement)(Bo,null)}function Lo(){return Object(eo.createElement)(To,null)}var Ro=Object(bo.compose)([Object(h.withSelect)((function(e){return{hasRedo:e("core/editor").hasEditorRedo()}})),Object(h.withDispatch)((function(e){return{redo:e("core/editor").redo}}))])((function(e){var t=e.hasRedo,n=e.redo;return Object(eo.createElement)(Po.IconButton,{icon:"redo",label:Object(L.__)("Redo"),shortcut:Co.displayShortcut.primaryShift("z"),"aria-disabled":!t,onClick:t?n:void 0,className:"editor-history__redo"})}));var No=Object(bo.compose)([Object(h.withSelect)((function(e){return{hasUndo:e("core/editor").hasEditorUndo()}})),Object(h.withDispatch)((function(e){return{undo:e("core/editor").undo}}))])((function(e){var t=e.hasUndo,n=e.undo;return Object(eo.createElement)(Po.IconButton,{icon:"undo",label:Object(L.__)("Undo"),shortcut:Co.displayShortcut.primary("z"),"aria-disabled":!t,onClick:t?n:void 0,className:"editor-history__undo"})})),Do=n(21);var Uo=Object(bo.compose)([Object(h.withSelect)((function(e){return{isValid:e("core/block-editor").isValidTemplate()}})),Object(h.withDispatch)((function(e){var t=e("core/block-editor"),n=t.setTemplateValidity;return{resetTemplateValidity:function(){return n(!0)},synchronizeTemplate:t.synchronizeTemplate}}))])((function(e){var t=e.isValid,n=Object(Do.a)(e,["isValid"]);return t?null:Object(eo.createElement)(Po.Notice,{className:"editor-template-validation-notice",isDismissible:!1,status:"warning"},Object(eo.createElement)("p",null,Object(L.__)("The content of your post doesn’t match the template assigned to your post type.")),Object(eo.createElement)("div",null,Object(eo.createElement)(Po.Button,{isDefault:!0,onClick:n.resetTemplateValidity},Object(L.__)("Keep it as is")),Object(eo.createElement)(Po.Button,{onClick:function(){window.confirm(Object(L.__)("Resetting the template may result in loss of content, do you want to continue?"))&&n.synchronizeTemplate()},isPrimary:!0},Object(L.__)("Reset the template"))))}));var Fo=Object(bo.compose)([Object(h.withSelect)((function(e){return{notices:e("core/notices").getNotices()}})),Object(h.withDispatch)((function(e){return{onRemove:e("core/notices").removeNotice}}))])((function(e){var t=e.notices,n=e.onRemove,r=Object(y.filter)(t,{isDismissible:!0,type:"default"}),o=Object(y.filter)(t,{isDismissible:!1,type:"default"}),i=Object(y.filter)(t,{type:"snackbar"});return Object(eo.createElement)(eo.Fragment,null,Object(eo.createElement)(Po.NoticeList,{notices:o,className:"components-editor-notices__pinned"}),Object(eo.createElement)(Po.NoticeList,{notices:r,className:"components-editor-notices__dismissible",onRemove:n},Object(eo.createElement)(Uo,null)),Object(eo.createElement)(Po.SnackbarList,{notices:i,className:"components-editor-notices__snackbar",onRemove:n}))})),Mo=function(e){function t(){var e;return Object(ao.a)(this,t),(e=Object(uo.a)(this,Object(lo.a)(t).apply(this,arguments))).reboot=e.reboot.bind(Object(So.a)(e)),e.getContent=e.getContent.bind(Object(So.a)(e)),e.state={error:null},e}return Object(po.a)(t,e),Object(so.a)(t,[{key:"componentDidCatch",value:function(e){this.setState({error:e})}},{key:"reboot",value:function(){this.props.onError()}},{key:"getContent",value:function(){try{return Object(h.select)("core/editor").getEditedPostContent()}catch(e){}}},{key:"render",value:function(){var e=this.state.error;return e?Object(eo.createElement)(u.Warning,{className:"editor-error-boundary",actions:[Object(eo.createElement)(Po.Button,{key:"recovery",onClick:this.reboot,isLarge:!0},Object(L.__)("Attempt Recovery")),Object(eo.createElement)(Po.ClipboardButton,{key:"copy-post",text:this.getContent,isLarge:!0},Object(L.__)("Copy Post Text")),Object(eo.createElement)(Po.ClipboardButton,{key:"copy-error",text:e.stack,isLarge:!0},Object(L.__)("Copy Error"))]},Object(L.__)("The editor has encountered an unexpected error.")):this.props.children}}]),t}(eo.Component),Vo=window.requestIdleCallback?window.requestIdleCallback:window.requestAnimationFrame,Ho=Object(y.once)((function(){try{return window.sessionStorage.setItem("__wpEditorTestSessionStorage",""),window.sessionStorage.removeItem("__wpEditorTestSessionStorage"),!0}catch(e){return!1}}));function Wo(){var e=Object(h.useSelect)((function(e){var t=e("core/editor").getCurrentPostId(),n=e("core/editor").getCurrentPostType(),r=e("core").getCurrentUser();return{postId:t,getEditedPostAttribute:e("core/editor").getEditedPostAttribute,remoteAutosave:e("core").getAutosave(n,t,r.id),hasFetchedAutosave:e("core").hasFetchedAutosaves(n,t)&&r.id}})),t=e.postId,n=e.getEditedPostAttribute,r=e.remoteAutosave,o=e.hasFetchedAutosave,i=Object(h.useDispatch)("core/notices"),c=i.createWarningNotice,a=i.removeNotice,s=Object(h.useDispatch)("core/editor"),u=s.editPost,d=s.resetEditorBlocks;Object(eo.useEffect)((function(){if(o){var e=function(e){return window.sessionStorage.getItem(te(e))}(t);if(e){try{e=JSON.parse(e)}catch(e){return}var i=e,s={title:i.post_title,content:i.content,excerpt:i.excerpt};if(Object.keys(s).some((function(e){return s[e]!==n(e)}))){if(!r){var p=Object(y.uniqueId)("wpEditorAutosaveRestore");c(Object(L.__)("The backup of this post in your browser is different from the version below."),{id:p,actions:[{label:Object(L.__)("Restore the backup"),onClick:function(){u(Object(y.omit)(s,["content"])),d(Object(l.parse)(s.content)),a(p)}}]})}}else ne(t)}}}),[t,o])}var zo=Object(bo.ifCondition)(Ho)((function(){var e,t,n,r,o,i,c,a=Object(h.useDispatch)("core/editor").__experimentalLocalAutosave,s=Object(eo.useCallback)((function(){Vo(a)}),[]);Wo(),e=Object(h.useSelect)((function(e){return{postId:e("core/editor").getCurrentPostId(),postType:e("core/editor").getCurrentPostType(),isDirty:e("core/editor").isEditedPostDirty(),isAutosaving:e("core/editor").isAutosavingPost(),didError:e("core/editor").didPostSaveRequestFail()}})),t=e.postId,n=e.isDirty,r=e.isAutosaving,o=e.didError,i=Object(eo.useRef)(n),c=Object(eo.useRef)(r),Object(eo.useEffect)((function(){!o&&(c.current&&!r||i.current&&!n)&&ne(t),i.current=n,c.current=r}),[n,r,o]);var u=Object(h.useSelect)((function(e){return{localAutosaveInterval:e("core/editor").getEditorSettings().__experimentalLocalAutosaveInterval}})).localAutosaveInterval;return Object(eo.createElement)(ho,{interval:u,autosave:s,shouldThrottle:!0})}));var Ko=Object(h.withSelect)((function(e){var t=e("core/editor"),n=t.getEditedPostAttribute,r=t.getEditorSettings,o=e("core").getPostType,i=r().availableTemplates;return{postType:o(n("type")),availableTemplates:i}}))((function(e){var t=e.availableTemplates,n=e.postType,r=e.children;return!Object(y.get)(n,["supports","page-attributes"],!1)&&Object(y.isEmpty)(t)?null:r}));var Go=Object(h.withSelect)((function(e){var t=e("core/editor").getEditedPostAttribute;return{postType:(0,e("core").getPostType)(t("type"))}}))((function(e){var t=e.postType,n=e.children,r=e.supportKeys,o=!0;return t&&(o=Object(y.some)(Object(y.castArray)(r),(function(e){return!!t.supports[e]}))),o?n:null})),qo=Object(bo.withState)({orderInput:null})((function(e){var t=e.onUpdateOrder,n=e.order,r=void 0===n?0:n,o=e.orderInput,i=e.setState,c=null===o?r:o;return Object(eo.createElement)(Po.TextControl,{className:"editor-page-attributes__order",type:"number",label:Object(L.__)("Order"),value:c,onChange:function(e){i({orderInput:e});var n=Number(e);Number.isInteger(n)&&""!==Object(y.invoke)(e,["trim"])&&t(Number(e))},size:6,onBlur:function(){i({orderInput:null})}})}));var Yo=Object(bo.compose)([Object(h.withSelect)((function(e){return{order:e("core/editor").getEditedPostAttribute("menu_order")}})),Object(h.withDispatch)((function(e){return{onUpdateOrder:function(t){e("core/editor").editPost({menu_order:t})}}}))])((function(e){return Object(eo.createElement)(Go,{supportKeys:"page-attributes"},Object(eo.createElement)(qo,e))}));function Qo(e){var t=e.map((function(e){return Object(f.a)({children:[],parent:null},e)})),n=Object(y.groupBy)(t,"parent");if(n.null&&n.null.length)return t;return function e(t){return t.map((function(t){var r=n[t.id];return Object(f.a)({},t,{children:r&&r.length?e(r):[]})}))}(n[0]||[])}var Xo=Object(h.withSelect)((function(e){var t=e("core"),n=t.getPostType,r=t.getEntityRecords,o=e("core/editor"),i=o.getCurrentPostId,c=o.getEditedPostAttribute,a=c("type"),s=n(a),u=i(),l=Object(y.get)(s,["hierarchical"],!1),d={per_page:-1,exclude:u,parent_exclude:u,orderby:"menu_order",order:"asc"};return{parent:c("parent"),items:l?r("postType",a,d):[],postType:s}})),$o=Object(h.withDispatch)((function(e){var t=e("core/editor").editPost;return{onUpdateParent:function(e){t({parent:e||0})}}})),Zo=Object(bo.compose)([Xo,$o])((function(e){var t=e.parent,n=e.postType,r=e.items,o=e.onUpdateParent,i=Object(y.get)(n,["hierarchical"],!1),c=Object(y.get)(n,["labels","parent_item_colon"]),a=r||[];if(!i||!c||!a.length)return null;var s=Qo(a.map((function(e){return{id:e.id,parent:e.parent,name:e.title.raw?e.title.raw:"#".concat(e.id," (").concat(Object(L.__)("no title"),")")}})));return Object(eo.createElement)(Po.TreeSelect,{className:"editor-page-attributes__parent",label:c,noOptionLabel:"(".concat(Object(L.__)("no parent"),")"),tree:s,selectedId:t,onChange:o})}));var Jo=Object(bo.compose)(Object(h.withSelect)((function(e){var t=e("core/editor"),n=t.getEditedPostAttribute,r=(0,t.getEditorSettings)().availableTemplates;return{selectedTemplate:n("template"),availableTemplates:r}})),Object(h.withDispatch)((function(e){return{onUpdate:function(t){e("core/editor").editPost({template:t||""})}}})))((function(e){var t=e.availableTemplates,n=e.selectedTemplate,r=e.onUpdate;return Object(y.isEmpty)(t)?null:Object(eo.createElement)(Po.SelectControl,{label:Object(L.__)("Template:"),value:n,onChange:r,className:"editor-page-attributes__template",options:Object(y.map)(t,(function(e,t){return{value:t,label:e}}))})})),ei=n(52);var ti=Object(bo.compose)([Object(h.withSelect)((function(e){var t=e("core/editor").getCurrentPost();return{hasAssignAuthorAction:Object(y.get)(t,["_links","wp:action-assign-author"],!1),postType:e("core/editor").getCurrentPostType(),authors:e("core").getAuthors()}})),bo.withInstanceId])((function(e){var t=e.hasAssignAuthorAction,n=e.authors,r=e.children;return!t||n.length<2?null:Object(eo.createElement)(Go,{supportKeys:"author"},r)})),ni=function(e){function t(){var e;return Object(ao.a)(this,t),(e=Object(uo.a)(this,Object(lo.a)(t).apply(this,arguments))).setAuthorId=e.setAuthorId.bind(Object(So.a)(e)),e}return Object(po.a)(t,e),Object(so.a)(t,[{key:"setAuthorId",value:function(e){var t=this.props.onUpdateAuthor,n=e.target.value;t(Number(n))}},{key:"render",value:function(){var e=this.props,t=e.postAuthor,n=e.instanceId,r=e.authors,o="post-author-selector-"+n;return Object(eo.createElement)(ti,null,Object(eo.createElement)("label",{htmlFor:o},Object(L.__)("Author")),Object(eo.createElement)("select",{id:o,value:t,onChange:this.setAuthorId,className:"editor-post-author__select"},r.map((function(e){return Object(eo.createElement)("option",{key:e.id,value:e.id},Object(ei.decodeEntities)(e.name))}))))}}]),t}(eo.Component),ri=Object(bo.compose)([Object(h.withSelect)((function(e){return{postAuthor:e("core/editor").getEditedPostAttribute("author"),authors:e("core").getAuthors()}})),Object(h.withDispatch)((function(e){return{onUpdateAuthor:function(t){e("core/editor").editPost({author:t})}}})),bo.withInstanceId])(ni);var oi=Object(bo.compose)([Object(h.withSelect)((function(e){return{commentStatus:e("core/editor").getEditedPostAttribute("comment_status")}})),Object(h.withDispatch)((function(e){return{editPost:e("core/editor").editPost}}))])((function(e){var t=e.commentStatus,n=void 0===t?"open":t,r=Object(Do.a)(e,["commentStatus"]);return Object(eo.createElement)(Po.CheckboxControl,{label:Object(L.__)("Allow Comments"),checked:"open"===n,onChange:function(){return r.editPost({comment_status:"open"===n?"closed":"open"})}})}));var ii=Object(bo.compose)([Object(h.withSelect)((function(e){return{excerpt:e("core/editor").getEditedPostAttribute("excerpt")}})),Object(h.withDispatch)((function(e){return{onUpdateExcerpt:function(t){e("core/editor").editPost({excerpt:t})}}}))])((function(e){var t=e.excerpt,n=e.onUpdateExcerpt;return Object(eo.createElement)("div",{className:"editor-post-excerpt"},Object(eo.createElement)(Po.TextareaControl,{label:Object(L.__)("Write an excerpt (optional)"),className:"editor-post-excerpt__textarea",onChange:function(e){return n(e)},value:t}),Object(eo.createElement)(Po.ExternalLink,{href:Object(L.__)("https://codex.wordpress.org/Excerpt")},Object(L.__)("Learn more about manual excerpts")))})),ci=n(18);var ai=function(e){return Object(eo.createElement)(Go,Object(ci.a)({},e,{supportKeys:"excerpt"}))};var si=Object(h.withSelect)((function(e){var t=e("core").getThemeSupports;return{postType:(0,e("core/editor").getEditedPostAttribute)("type"),themeSupports:t()}}))((function(e){var t=e.themeSupports,n=e.children,r=e.postType,o=e.supportKeys;return Object(y.some)(Object(y.castArray)(o),(function(e){var n=Object(y.get)(t,[e],!1);return"post-thumbnails"===e&&Object(y.isArray)(n)?Object(y.includes)(n,r):n}))?n:null}));var ui=function(e){return Object(eo.createElement)(si,{supportKeys:"post-thumbnails"},Object(eo.createElement)(Go,Object(ci.a)({},e,{supportKeys:"thumbnail"})))},li=["image"],di=Object(L.__)("Featured Image"),pi=Object(L.__)("Set Featured Image"),bi=Object(L.__)("Remove Image");var fi=Object(h.withSelect)((function(e){var t=e("core"),n=t.getMedia,r=t.getPostType,o=e("core/editor"),i=o.getCurrentPostId,c=o.getEditedPostAttribute,a=c("featured_media");return{media:a?n(a):null,currentPostId:i(),postType:r(c("type")),featuredImageId:a}})),hi=Object(h.withDispatch)((function(e){var t=e("core/editor").editPost;return{onUpdateImage:function(e){t({featured_media:e.id})},onRemoveImage:function(){t({featured_media:0})}}})),mi=Object(bo.compose)(fi,hi,Object(Po.withFilters)("editor.PostFeaturedImage"))((function(e){var t,n,r,o=e.currentPostId,i=e.featuredImageId,c=e.onUpdateImage,a=e.onRemoveImage,s=e.media,l=e.postType,d=Object(y.get)(l,["labels"],{}),p=Object(eo.createElement)("p",null,Object(L.__)("To edit the featured image, you need permission to upload media."));if(s){var b=Object(Jr.applyFilters)("editor.PostFeaturedImage.imageSize","post-thumbnail",s.id,o);Object(y.has)(s,["media_details","sizes",b])?(t=s.media_details.sizes[b].width,n=s.media_details.sizes[b].height,r=s.media_details.sizes[b].source_url):(t=s.media_details.width,n=s.media_details.height,r=s.source_url)}return Object(eo.createElement)(ui,null,Object(eo.createElement)("div",{className:"editor-post-featured-image"},Object(eo.createElement)(u.MediaUploadCheck,{fallback:p},Object(eo.createElement)(u.MediaUpload,{title:d.featured_image||di,onSelect:c,unstableFeaturedImageFlow:!0,allowedTypes:li,modalClass:"editor-post-featured-image__media-modal",render:function(e){var o=e.open;return Object(eo.createElement)(Po.Button,{className:i?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:o,"aria-label":i?Object(L.__)("Edit or update the image"):null},!!i&&s&&Object(eo.createElement)(Po.ResponsiveWrapper,{naturalWidth:t,naturalHeight:n,isInline:!0},Object(eo.createElement)("img",{src:r,alt:""})),!!i&&!s&&Object(eo.createElement)(Po.Spinner,null),!i&&(d.set_featured_image||pi))},value:i})),!!i&&s&&!s.isLoading&&Object(eo.createElement)(u.MediaUploadCheck,null,Object(eo.createElement)(u.MediaUpload,{title:d.featured_image||di,onSelect:c,unstableFeaturedImageFlow:!0,allowedTypes:li,modalClass:"editor-post-featured-image__media-modal",render:function(e){var t=e.open;return Object(eo.createElement)(Po.Button,{onClick:t,isDefault:!0,isLarge:!0},Object(L.__)("Replace Image"))}})),!!i&&Object(eo.createElement)(u.MediaUploadCheck,null,Object(eo.createElement)(Po.Button,{onClick:a,isLink:!0,isDestructive:!0},d.remove_featured_image||bi))))}));var vi=Object(h.withSelect)((function(e){return{disablePostFormats:e("core/editor").getEditorSettings().disablePostFormats}}))((function(e){var t=e.disablePostFormats,n=Object(Do.a)(e,["disablePostFormats"]);return!t&&Object(eo.createElement)(Go,Object(ci.a)({},n,{supportKeys:"post-formats"}))})),Oi=[{id:"aside",caption:Object(L.__)("Aside")},{id:"gallery",caption:Object(L.__)("Gallery")},{id:"link",caption:Object(L.__)("Link")},{id:"image",caption:Object(L.__)("Image")},{id:"quote",caption:Object(L.__)("Quote")},{id:"standard",caption:Object(L.__)("Standard")},{id:"status",caption:Object(L.__)("Status")},{id:"video",caption:Object(L.__)("Video")},{id:"audio",caption:Object(L.__)("Audio")},{id:"chat",caption:Object(L.__)("Chat")}];var gi=Object(bo.compose)([Object(h.withSelect)((function(e){var t=e("core/editor"),n=t.getEditedPostAttribute,r=t.getSuggestedPostFormat,o=n("format"),i=e("core").getThemeSupports();return{postFormat:o,supportedFormats:Object(y.union)([o],Object(y.get)(i,["formats"],[])),suggestedFormat:r()}})),Object(h.withDispatch)((function(e){return{onUpdatePostFormat:function(t){e("core/editor").editPost({format:t})}}})),bo.withInstanceId])((function(e){var t=e.onUpdatePostFormat,n=e.postFormat,r=void 0===n?"standard":n,o=e.supportedFormats,i=e.suggestedFormat,c="post-format-selector-"+e.instanceId,a=Oi.filter((function(e){return Object(y.includes)(o,e.id)})),s=Object(y.find)(a,(function(e){return e.id===i}));return Object(eo.createElement)(vi,null,Object(eo.createElement)("div",{className:"editor-post-format"},Object(eo.createElement)("div",{className:"editor-post-format__content"},Object(eo.createElement)("label",{htmlFor:c},Object(L.__)("Post Format")),Object(eo.createElement)(Po.SelectControl,{value:r,onChange:function(e){return t(e)},id:c,options:a.map((function(e){return{label:e.caption,value:e.id}}))})),s&&s.id!==r&&Object(eo.createElement)("div",{className:"editor-post-format__suggestion"},Object(L.__)("Suggestion:")," ",Object(eo.createElement)(Po.Button,{isLink:!0,onClick:function(){return t(s.id)}},s.caption))))}));var ji=Object(h.withSelect)((function(e){var t=e("core/editor"),n=t.getCurrentPostLastRevisionId,r=t.getCurrentPostRevisionsCount;return{lastRevisionId:n(),revisionsCount:r()}}))((function(e){var t=e.lastRevisionId,n=e.revisionsCount,r=e.children;return!t||n<2?null:Object(eo.createElement)(Go,{supportKeys:"revisions"},r)}));function yi(e,t){return Object(Ft.addQueryArgs)(e,t)}function _i(e){return e?Object(y.toLower)(Object(y.deburr)(Object(y.trim)(e.replace(/[\s\./_]+/g,"-"),"-"))):""}var ki=Object(h.withSelect)((function(e){var t=e("core/editor"),n=t.getCurrentPostLastRevisionId,r=t.getCurrentPostRevisionsCount;return{lastRevisionId:n(),revisionsCount:r()}}))((function(e){var t=e.lastRevisionId,n=e.revisionsCount;return Object(eo.createElement)(ji,null,Object(eo.createElement)(Po.IconButton,{href:yi("revision.php",{revision:t,gutenberg:!0}),className:"editor-post-last-revision__title",icon:"backup"},Object(L.sprintf)(Object(L._n)("%d Revision","%d Revisions",n),n)))}));var Ei=function(e){function t(){var e;return Object(ao.a)(this,t),(e=Object(uo.a)(this,Object(lo.a)(t).apply(this,arguments))).openPreviewWindow=e.openPreviewWindow.bind(Object(So.a)(e)),e}return Object(po.a)(t,e),Object(so.a)(t,[{key:"componentDidUpdate",value:function(e){var t=this.props.previewLink;t&&!e.previewLink&&this.setPreviewWindowLink(t)}},{key:"setPreviewWindowLink",value:function(e){var t=this.previewWindow;t&&!t.closed&&(t.location=e)}},{key:"getWindowTarget",value:function(){var e=this.props.postId;return"wp-preview-".concat(e)}},{key:"openPreviewWindow",value:function(e){var t,n;(e.preventDefault(),this.previewWindow&&!this.previewWindow.closed||(this.previewWindow=window.open("",this.getWindowTarget())),this.previewWindow.focus(),this.props.isAutosaveable)?(this.props.isDraft?this.props.savePost({isPreview:!0}):this.props.autosave({isPreview:!0}),t=this.previewWindow.document,n=Object(eo.renderToString)(Object(eo.createElement)("div",{className:"editor-post-preview-button__interstitial-message"},Object(eo.createElement)(Po.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 96 96"},Object(eo.createElement)(Po.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"}),Object(eo.createElement)(Po.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"})),Object(eo.createElement)("p",null,Object(L.__)("Generating preview…")))),n+='\n\t\t\n\t',n=Object(Jr.applyFilters)("editor.PostPreview.interstitialMarkup",n),t.write(n),t.title=Object(L.__)("Generating preview…"),t.close()):this.setPreviewWindowLink(e.target.href)}},{key:"render",value:function(){var e=this.props,t=e.previewLink,n=e.currentPostLink,r=e.isSaveable,o=t||n;return Object(eo.createElement)(Po.Button,{isLarge:!0,className:"editor-post-preview",href:o,target:this.getWindowTarget(),disabled:!r,onClick:this.openPreviewWindow},Object(L._x)("Preview","imperative verb"),Object(eo.createElement)("span",{className:"screen-reader-text"},Object(L.__)("(opens in a new tab)")),Object(eo.createElement)(d.DotTip,{tipId:"core/editor.preview"},Object(L.__)("Click “Preview” to load a preview of this page, so you can make sure you’re happy with your blocks.")))}}]),t}(eo.Component),wi=Object(bo.compose)([Object(h.withSelect)((function(e,t){var n=t.forcePreviewLink,r=t.forceIsAutosaveable,o=e("core/editor"),i=o.getCurrentPostId,c=o.getCurrentPostAttribute,a=o.getEditedPostAttribute,s=o.isEditedPostSaveable,u=o.isEditedPostAutosaveable,l=o.getEditedPostPreviewLink,d=e("core").getPostType,p=l(),b=d(a("type"));return{postId:i(),currentPostLink:c("link"),previewLink:void 0!==n?n:p,isSaveable:s(),isAutosaveable:r||u(),isViewable:Object(y.get)(b,["viewable"],!1),isDraft:-1!==["draft","auto-draft"].indexOf(a("status"))}})),Object(h.withDispatch)((function(e){return{autosave:e("core/editor").autosave,savePost:e("core/editor").savePost}})),Object(bo.ifCondition)((function(e){return e.isViewable}))])(Ei),Si=function(e){function t(){var e;return Object(ao.a)(this,t),(e=Object(uo.a)(this,Object(lo.a)(t).apply(this,arguments))).sendPostLock=e.sendPostLock.bind(Object(So.a)(e)),e.receivePostLock=e.receivePostLock.bind(Object(So.a)(e)),e.releasePostLock=e.releasePostLock.bind(Object(So.a)(e)),e}return Object(po.a)(t,e),Object(so.a)(t,[{key:"componentDidMount",value:function(){var e=this.getHookName();Object(Jr.addAction)("heartbeat.send",e,this.sendPostLock),Object(Jr.addAction)("heartbeat.tick",e,this.receivePostLock)}},{key:"componentWillUnmount",value:function(){var e=this.getHookName();Object(Jr.removeAction)("heartbeat.send",e),Object(Jr.removeAction)("heartbeat.tick",e)}},{key:"getHookName",value:function(){return"core/editor/post-locked-modal-"+this.props.instanceId}},{key:"sendPostLock",value:function(e){var t=this.props,n=t.isLocked,r=t.activePostLock,o=t.postId;n||(e["wp-refresh-post-lock"]={lock:r,post_id:o})}},{key:"receivePostLock",value:function(e){if(e["wp-refresh-post-lock"]){var t=this.props,n=t.autosave,r=t.updatePostLock,o=e["wp-refresh-post-lock"];o.lock_error?(n(),r({isLocked:!0,isTakeover:!0,user:{avatar:o.lock_error.avatar_src}})):o.new_lock&&r({isLocked:!1,activePostLock:o.new_lock})}}},{key:"releasePostLock",value:function(){var e=this.props,t=e.isLocked,n=e.activePostLock,r=e.postLockUtils,o=e.postId;if(!t&&n){var i=new window.FormData;if(i.append("action","wp-remove-post-lock"),i.append("_wpnonce",r.unlockNonce),i.append("post_ID",o),i.append("active_post_lock",n),window.navigator.sendBeacon)window.navigator.sendBeacon(r.ajaxUrl,i);else{var c=new window.XMLHttpRequest;c.open("POST",r.ajaxUrl,!1),c.send(i)}}}},{key:"render",value:function(){var e=this.props,t=e.user,n=e.postId,r=e.isLocked,o=e.isTakeover,i=e.postLockUtils,c=e.postType;if(!r)return null;var a=t.name,s=t.avatar,u=Object(Ft.addQueryArgs)("post.php",{"get-post-lock":"1",lockKey:!0,post:n,action:"edit",_wpnonce:i.nonce}),l=yi("edit.php",{post_type:Object(y.get)(c,["slug"])}),d=Object(L.__)("Exit the Editor");return Object(eo.createElement)(Po.Modal,{title:o?Object(L.__)("Someone else has taken over this post."):Object(L.__)("This post is already being edited."),focusOnMount:!0,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,isDismissable:!1,className:"editor-post-locked-modal"},!!s&&Object(eo.createElement)("img",{src:s,alt:Object(L.__)("Avatar"),className:"editor-post-locked-modal__avatar"}),!!o&&Object(eo.createElement)("div",null,Object(eo.createElement)("div",null,a?Object(L.sprintf)(Object(L.__)("%s now has editing control of this post. Don’t worry, your changes up to this moment have been saved."),a):Object(L.__)("Another user now has editing control of this post. Don’t worry, your changes up to this moment have been saved.")),Object(eo.createElement)("div",{className:"editor-post-locked-modal__buttons"},Object(eo.createElement)(Po.Button,{isPrimary:!0,isLarge:!0,href:l},d))),!o&&Object(eo.createElement)("div",null,Object(eo.createElement)("div",null,a?Object(L.sprintf)(Object(L.__)("%s is currently working on this post, which means you cannot make changes, unless you take over."),a):Object(L.__)("Another user is currently working on this post, which means you cannot make changes, unless you take over.")),Object(eo.createElement)("div",{className:"editor-post-locked-modal__buttons"},Object(eo.createElement)(Po.Button,{isDefault:!0,isLarge:!0,href:l},d),Object(eo.createElement)(wi,null),Object(eo.createElement)(Po.Button,{isPrimary:!0,isLarge:!0,href:u},Object(L.__)("Take Over")))))}}]),t}(eo.Component),Pi=Object(bo.compose)(Object(h.withSelect)((function(e){var t=e("core/editor"),n=t.isPostLocked,r=t.isPostLockTakeover,o=t.getPostLockUser,i=t.getCurrentPostId,c=t.getActivePostLock,a=t.getEditedPostAttribute,s=t.getEditorSettings,u=e("core").getPostType;return{isLocked:n(),isTakeover:r(),user:o(),postId:i(),postLockUtils:s().postLockUtils,activePostLock:c(),postType:u(a("type"))}})),Object(h.withDispatch)((function(e){var t=e("core/editor");return{autosave:t.autosave,updatePostLock:t.updatePostLock}})),bo.withInstanceId,Object(bo.withGlobalEvents)({beforeunload:"releasePostLock"}))(Si);var Ci=Object(bo.compose)(Object(h.withSelect)((function(e){var t=e("core/editor"),n=t.isCurrentPostPublished,r=t.getCurrentPostType,o=t.getCurrentPost;return{hasPublishAction:Object(y.get)(o(),["_links","wp:action-publish"],!1),isPublished:n(),postType:r()}})))((function(e){var t=e.hasPublishAction,n=e.isPublished,r=e.children;return n||!t?null:r}));var Ti=Object(bo.compose)(Object(h.withSelect)((function(e){return{status:e("core/editor").getEditedPostAttribute("status")}})),Object(h.withDispatch)((function(e){return{onUpdateStatus:function(t){e("core/editor").editPost({status:t})}}})))((function(e){var t=e.status,n=e.onUpdateStatus;return Object(eo.createElement)(Ci,null,Object(eo.createElement)(Po.CheckboxControl,{label:Object(L.__)("Pending Review"),checked:"pending"===t,onChange:function(){n("pending"===t?"draft":"pending")}}))}));var xi=Object(bo.compose)([Object(h.withSelect)((function(e){return{pingStatus:e("core/editor").getEditedPostAttribute("ping_status")}})),Object(h.withDispatch)((function(e){return{editPost:e("core/editor").editPost}}))])((function(e){var t=e.pingStatus,n=void 0===t?"open":t,r=Object(Do.a)(e,["pingStatus"]);return Object(eo.createElement)(Po.CheckboxControl,{label:Object(L.__)("Allow Pingbacks & Trackbacks"),checked:"open"===n,onChange:function(){return r.editPost({ping_status:"open"===n?"closed":"open"})}})}));var Bi=Object(bo.compose)([Object(h.withSelect)((function(e,t){var n=t.forceIsSaving,r=e("core/editor"),o=r.isCurrentPostPublished,i=r.isEditedPostBeingScheduled,c=r.isSavingPost,a=r.isPublishingPost,s=r.getCurrentPost,u=r.getCurrentPostType,l=r.isAutosavingPost;return{isPublished:o(),isBeingScheduled:i(),isSaving:n||c(),isPublishing:a(),hasPublishAction:Object(y.get)(s(),["_links","wp:action-publish"],!1),postType:u(),isAutosaving:l()}}))])((function(e){var t=e.isPublished,n=e.isBeingScheduled,r=e.isSaving,o=e.isPublishing,i=e.hasPublishAction,c=e.isAutosaving;return o?Object(L.__)("Publishing…"):t&&r&&!c?Object(L.__)("Updating…"):n&&r&&!c?Object(L.__)("Scheduling…"):i?t?Object(L.__)("Update"):n?Object(L.__)("Schedule"):Object(L.__)("Publish"):Object(L.__)("Submit for Review")})),Ii=function(e){function t(e){var n;return Object(ao.a)(this,t),(n=Object(uo.a)(this,Object(lo.a)(t).call(this,e))).buttonNode=Object(eo.createRef)(),n}return Object(po.a)(t,e),Object(so.a)(t,[{key:"componentDidMount",value:function(){this.props.focusOnMount&&this.buttonNode.current.focus()}},{key:"render",value:function(){var e,t=this.props,n=t.forceIsDirty,r=t.forceIsSaving,o=t.hasPublishAction,i=t.isBeingScheduled,c=t.isOpen,a=t.isPostSavingLocked,s=t.isPublishable,u=t.isPublished,l=t.isSaveable,p=t.isSaving,b=t.isToggle,f=t.onSave,h=t.onStatusChange,m=t.onSubmit,v=void 0===m?y.noop:m,O=t.onToggle,g=t.visibility,j=p||r||!l||a||!s&&!n,_=u||p||r||!l||!s&&!n;e=o?i?"future":"private"===g?"private":"publish":"pending";var k={"aria-disabled":j,className:"editor-post-publish-button",isBusy:p&&u,isPrimary:!0,onClick:function(){j||(v(),h(e),f())}},E={"aria-disabled":_,"aria-expanded":c,className:"editor-post-publish-panel__toggle",isBusy:p&&u,isPrimary:!0,onClick:function(){_||O()}},w=i?Object(L.__)("Schedule…"):Object(L.__)("Publish…"),S=Object(eo.createElement)(Bi,{forceIsSaving:r}),P=b?E:k,C=b?w:S;return Object(eo.createElement)("div",null,Object(eo.createElement)(Po.Button,Object(ci.a)({ref:this.buttonNode},P),C),Object(eo.createElement)(d.DotTip,{tipId:"core/editor.publish"},Object(L.__)("Finished writing? That’s great, let’s get this published right now. Just click “Publish” and you’re good to go.")))}}]),t}(eo.Component),Ai=Object(bo.compose)([Object(h.withSelect)((function(e){var t=e("core/editor"),n=t.isSavingPost,r=t.isEditedPostBeingScheduled,o=t.getEditedPostVisibility,i=t.isCurrentPostPublished,c=t.isEditedPostSaveable,a=t.isEditedPostPublishable,s=t.isPostSavingLocked,u=t.getCurrentPost,l=t.getCurrentPostType;return{isSaving:n(),isBeingScheduled:r(),visibility:o(),isSaveable:c(),isPostSavingLocked:s(),isPublishable:a(),isPublished:i(),hasPublishAction:Object(y.get)(u(),["_links","wp:action-publish"],!1),postType:l()}})),Object(h.withDispatch)((function(e){var t=e("core/editor"),n=t.editPost;return{onStatusChange:function(e){return n({status:e},{undoIgnore:!0})},onSave:t.savePost}}))])(Ii),Li=[{value:"public",label:Object(L.__)("Public"),info:Object(L.__)("Visible to everyone.")},{value:"private",label:Object(L.__)("Private"),info:Object(L.__)("Only visible to site admins and editors.")},{value:"password",label:Object(L.__)("Password Protected"),info:Object(L.__)("Protected with a password you choose. Only those with the password can view this post.")}],Ri=function(e){function t(e){var n;return Object(ao.a)(this,t),(n=Object(uo.a)(this,Object(lo.a)(t).apply(this,arguments))).setPublic=n.setPublic.bind(Object(So.a)(n)),n.setPrivate=n.setPrivate.bind(Object(So.a)(n)),n.setPasswordProtected=n.setPasswordProtected.bind(Object(So.a)(n)),n.updatePassword=n.updatePassword.bind(Object(So.a)(n)),n.state={hasPassword:!!e.password},n}return Object(po.a)(t,e),Object(so.a)(t,[{key:"setPublic",value:function(){var e=this.props,t=e.visibility,n=e.onUpdateVisibility,r=e.status;n("private"===t?"draft":r),this.setState({hasPassword:!1})}},{key:"setPrivate",value:function(){if(window.confirm(Object(L.__)("Would you like to privately publish this post now?"))){var e=this.props,t=e.onUpdateVisibility,n=e.onSave;t("private"),this.setState({hasPassword:!1}),n()}}},{key:"setPasswordProtected",value:function(){var e=this.props,t=e.visibility,n=e.onUpdateVisibility,r=e.status;n("private"===t?"draft":r,e.password||""),this.setState({hasPassword:!0})}},{key:"updatePassword",value:function(e){var t=this.props,n=t.status;(0,t.onUpdateVisibility)(n,e.target.value)}},{key:"render",value:function(){var e=this.props,t=e.visibility,n=e.password,r=e.instanceId,o={public:{onSelect:this.setPublic,checked:"public"===t&&!this.state.hasPassword},private:{onSelect:this.setPrivate,checked:"private"===t},password:{onSelect:this.setPasswordProtected,checked:this.state.hasPassword}};return[Object(eo.createElement)("fieldset",{key:"visibility-selector",className:"editor-post-visibility__dialog-fieldset"},Object(eo.createElement)("legend",{className:"editor-post-visibility__dialog-legend"},Object(L.__)("Post Visibility")),Li.map((function(e){var t=e.value,n=e.label,i=e.info;return Object(eo.createElement)("div",{key:t,className:"editor-post-visibility__choice"},Object(eo.createElement)("input",{type:"radio",name:"editor-post-visibility__setting-".concat(r),value:t,onChange:o[t].onSelect,checked:o[t].checked,id:"editor-post-".concat(t,"-").concat(r),"aria-describedby":"editor-post-".concat(t,"-").concat(r,"-description"),className:"editor-post-visibility__dialog-radio"}),Object(eo.createElement)("label",{htmlFor:"editor-post-".concat(t,"-").concat(r),className:"editor-post-visibility__dialog-label"},n),Object(eo.createElement)("p",{id:"editor-post-".concat(t,"-").concat(r,"-description"),className:"editor-post-visibility__dialog-info"},i))}))),this.state.hasPassword&&Object(eo.createElement)("div",{className:"editor-post-visibility__dialog-password",key:"password-selector"},Object(eo.createElement)("label",{htmlFor:"editor-post-visibility__dialog-password-input-".concat(r),className:"screen-reader-text"},Object(L.__)("Create password")),Object(eo.createElement)("input",{className:"editor-post-visibility__dialog-password-input",id:"editor-post-visibility__dialog-password-input-".concat(r),type:"text",onChange:this.updatePassword,value:n,placeholder:Object(L.__)("Use a secure password")}))]}}]),t}(eo.Component),Ni=Object(bo.compose)([Object(h.withSelect)((function(e){var t=e("core/editor"),n=t.getEditedPostAttribute,r=t.getEditedPostVisibility;return{status:n("status"),visibility:r(),password:n("password")}})),Object(h.withDispatch)((function(e){var t=e("core/editor"),n=t.savePost,r=t.editPost;return{onSave:n,onUpdateVisibility:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";r({status:e,password:t})}}})),bo.withInstanceId])(Ri);var Di=Object(h.withSelect)((function(e){return{visibility:e("core/editor").getEditedPostVisibility()}}))((function(e){var t=e.visibility;return Object(y.find)(Li,{value:t}).label}));var Ui=Object(bo.compose)([Object(h.withSelect)((function(e){return{date:e("core/editor").getEditedPostAttribute("date")}})),Object(h.withDispatch)((function(e){return{onUpdateDate:function(t){e("core/editor").editPost({date:t})}}}))])((function(e){var t=e.date,n=e.onUpdateDate,r=Object(Ut.__experimentalGetSettings)(),o=/a(?!\\)/i.test(r.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return Object(eo.createElement)(Po.DateTimePicker,{key:"date-time-picker",currentDate:t,onChange:n,is12Hour:o})}));var Fi=Object(h.withSelect)((function(e){return{date:e("core/editor").getEditedPostAttribute("date"),isFloating:e("core/editor").isEditedPostDateFloating()}}))((function(e){var t=e.date,n=e.isFloating,r=Object(Ut.__experimentalGetSettings)();return t&&!n?Object(Ut.dateI18n)("".concat(r.formats.date," ").concat(r.formats.time),t):Object(L.__)("Immediately")})),Mi={per_page:-1,orderby:"count",order:"desc",_fields:"id,name"},Vi=function(e,t){return e.toLowerCase()===t.toLowerCase()},Hi=function(e){return Object(f.a)({},e,{name:Object(y.unescape)(e.name)})},Wi=function(e){return Object(y.map)(e,Hi)},zi=function(e){function t(){var e;return Object(ao.a)(this,t),(e=Object(uo.a)(this,Object(lo.a)(t).apply(this,arguments))).onChange=e.onChange.bind(Object(So.a)(e)),e.searchTerms=Object(y.throttle)(e.searchTerms.bind(Object(So.a)(e)),500),e.findOrCreateTerm=e.findOrCreateTerm.bind(Object(So.a)(e)),e.state={loading:!Object(y.isEmpty)(e.props.terms),availableTerms:[],selectedTerms:[]},e}return Object(po.a)(t,e),Object(so.a)(t,[{key:"componentDidMount",value:function(){var e=this;Object(y.isEmpty)(this.props.terms)||(this.initRequest=this.fetchTerms({include:this.props.terms.join(","),per_page:-1}),this.initRequest.then((function(){e.setState({loading:!1})}),(function(t){"abort"!==t.statusText&&e.setState({loading:!1})})))}},{key:"componentWillUnmount",value:function(){Object(y.invoke)(this.initRequest,["abort"]),Object(y.invoke)(this.searchRequest,["abort"])}},{key:"componentDidUpdate",value:function(e){e.terms!==this.props.terms&&this.updateSelectedTerms(this.props.terms)}},{key:"fetchTerms",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.props.taxonomy,r=Object(f.a)({},Mi,t),o=A()({path:Object(Ft.addQueryArgs)("/wp/v2/".concat(n.rest_base),r)});return o.then(Wi).then((function(t){e.setState((function(e){return{availableTerms:e.availableTerms.concat(t.filter((function(t){return!Object(y.find)(e.availableTerms,(function(e){return e.id===t.id}))})))}})),e.updateSelectedTerms(e.props.terms)})),o}},{key:"updateSelectedTerms",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=t.reduce((function(t,n){var r=Object(y.find)(e.state.availableTerms,(function(e){return e.id===n}));return r&&t.push(r.name),t}),[]);this.setState({selectedTerms:n})}},{key:"findOrCreateTerm",value:function(e){var t=this,n=this.props.taxonomy,r=Object(y.escape)(e);return A()({path:"/wp/v2/".concat(n.rest_base),method:"POST",data:{name:r}}).catch((function(o){return"term_exists"===o.code?(t.addRequest=A()({path:Object(Ft.addQueryArgs)("/wp/v2/".concat(n.rest_base),Object(f.a)({},Mi,{search:r}))}).then(Wi),t.addRequest.then((function(t){return Object(y.find)(t,(function(t){return Vi(t.name,e)}))}))):Promise.reject(o)})).then(Hi)}},{key:"onChange",value:function(e){var t=this,n=Object(y.uniqBy)(e,(function(e){return e.toLowerCase()}));this.setState({selectedTerms:n});var r=n.filter((function(e){return!Object(y.find)(t.state.availableTerms,(function(t){return Vi(t.name,e)}))})),o=function(e,t){return e.map((function(e){return Object(y.find)(t,(function(t){return Vi(t.name,e)})).id}))};if(0===r.length)return this.props.onUpdateTerms(o(n,this.state.availableTerms),this.props.taxonomy.rest_base);Promise.all(r.map(this.findOrCreateTerm)).then((function(e){var r=t.state.availableTerms.concat(e);return t.setState({availableTerms:r}),t.props.onUpdateTerms(o(n,r),t.props.taxonomy.rest_base)}))}},{key:"searchTerms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";Object(y.invoke)(this.searchRequest,["abort"]),this.searchRequest=this.fetchTerms({search:e})}},{key:"render",value:function(){var e=this.props,t=e.slug,n=e.taxonomy;if(!e.hasAssignAction)return null;var r=this.state,o=r.loading,i=r.availableTerms,c=r.selectedTerms,a=i.map((function(e){return e.name})),s=Object(y.get)(n,["labels","add_new_item"],"post_tag"===t?Object(L.__)("Add New Tag"):Object(L.__)("Add New Term")),u=Object(y.get)(n,["labels","singular_name"],"post_tag"===t?Object(L.__)("Tag"):Object(L.__)("Term")),l=Object(L.sprintf)(Object(L._x)("%s added","term"),u),d=Object(L.sprintf)(Object(L._x)("%s removed","term"),u),p=Object(L.sprintf)(Object(L._x)("Remove %s","term"),u);return Object(eo.createElement)(Po.FormTokenField,{value:c,suggestions:a,onChange:this.onChange,onInputChange:this.searchTerms,maxSuggestions:20,disabled:o,label:s,messages:{added:l,removed:d,remove:p}})}}]),t}(eo.Component),Ki=Object(bo.compose)(Object(h.withSelect)((function(e,t){var n=t.slug,r=e("core/editor").getCurrentPost,o=(0,e("core").getTaxonomy)(n);return{hasCreateAction:!!o&&Object(y.get)(r(),["_links","wp:action-create-"+o.rest_base],!1),hasAssignAction:!!o&&Object(y.get)(r(),["_links","wp:action-assign-"+o.rest_base],!1),terms:o?e("core/editor").getEditedPostAttribute(o.rest_base):[],taxonomy:o}})),Object(h.withDispatch)((function(e){return{onUpdateTerms:function(t,n){e("core/editor").editPost(Object(v.a)({},n,t))}}})),Object(Po.withFilters)("editor.PostTaxonomyType"))(zi),Gi=function(){var e=[Object(L.__)("Suggestion:"),Object(eo.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},Object(L.__)("Add tags"))];return Object(eo.createElement)(Po.PanelBody,{initialOpen:!1,title:e},Object(eo.createElement)("p",null,Object(L.__)("Tags help users and search engines navigate your site and find your content. Add a few keywords to describe your post.")),Object(eo.createElement)(Ki,{slug:"post_tag"}))},qi=function(e){function t(e){var n;return Object(ao.a)(this,t),(n=Object(uo.a)(this,Object(lo.a)(t).call(this,e))).state={hadTagsWhenOpeningThePanel:e.hasTags},n}return Object(po.a)(t,e),Object(so.a)(t,[{key:"render",value:function(){return this.state.hadTagsWhenOpeningThePanel?null:Object(eo.createElement)(Gi,null)}}]),t}(eo.Component),Yi=Object(bo.compose)(Object(h.withSelect)((function(e){var t=e("core/editor").getCurrentPostType(),n=e("core").getTaxonomy("post_tag"),r=n&&e("core/editor").getEditedPostAttribute(n.rest_base);return{areTagsFetched:void 0!==n,isPostTypeSupported:n&&Object(y.some)(n.types,(function(e){return e===t})),hasTags:r&&r.length}})),Object(bo.ifCondition)((function(e){var t=e.areTagsFetched;return e.isPostTypeSupported&&t})))(qi),Qi=function(e){var t=e.suggestedPostFormat,n=e.suggestionText,r=e.onUpdatePostFormat;return Object(eo.createElement)(Po.Button,{isLink:!0,onClick:function(){return r(t)}},n)},Xi=function(e,t){var n=Oi.filter((function(t){return Object(y.includes)(e,t.id)}));return Object(y.find)(n,(function(e){return e.id===t}))},$i=Object(bo.compose)(Object(h.withSelect)((function(e){var t=e("core/editor"),n=t.getEditedPostAttribute,r=t.getSuggestedPostFormat,o=Object(y.get)(e("core").getThemeSupports(),["formats"],[]);return{currentPostFormat:n("format"),suggestion:Xi(o,r())}})),Object(h.withDispatch)((function(e){return{onUpdatePostFormat:function(t){e("core/editor").editPost({format:t})}}})),Object(bo.ifCondition)((function(e){var t=e.suggestion,n=e.currentPostFormat;return t&&t.id!==n})))((function(e){var t=e.suggestion,n=e.onUpdatePostFormat,r=[Object(L.__)("Suggestion:"),Object(eo.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},Object(L.__)("Use a post format"))];return Object(eo.createElement)(Po.PanelBody,{initialOpen:!1,title:r},Object(eo.createElement)("p",null,Object(L.__)("Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.")),Object(eo.createElement)("p",null,Object(eo.createElement)(Qi,{onUpdatePostFormat:n,suggestedPostFormat:t.id,suggestionText:Object(L.sprintf)(Object(L.__)('Apply the "%1$s" format.'),t.caption)})))}));var Zi=Object(h.withSelect)((function(e){var t=e("core/editor"),n=t.getCurrentPost,r=t.isEditedPostBeingScheduled;return{hasPublishAction:Object(y.get)(n(),["_links","wp:action-publish"],!1),isBeingScheduled:r()}}))((function(e){var t,n,r=e.hasPublishAction,o=e.isBeingScheduled,i=e.children;return r?o?(t=Object(L.__)("Are you ready to schedule?"),n=Object(L.__)("Your work will be published at the specified date and time.")):(t=Object(L.__)("Are you ready to publish?"),n=Object(L.__)("Double-check your settings before publishing.")):(t=Object(L.__)("Are you ready to submit for review?"),n=Object(L.__)("When you’re ready, submit your work for review, and an Editor will be able to approve it for you.")),Object(eo.createElement)("div",{className:"editor-post-publish-panel__prepublish"},Object(eo.createElement)("div",null,Object(eo.createElement)("strong",null,t)),Object(eo.createElement)("p",null,n),r&&Object(eo.createElement)(eo.Fragment,null,Object(eo.createElement)(Po.PanelBody,{initialOpen:!1,title:[Object(L.__)("Visibility:"),Object(eo.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},Object(eo.createElement)(Di,null))]},Object(eo.createElement)(Ni,null)),Object(eo.createElement)(Po.PanelBody,{initialOpen:!1,title:[Object(L.__)("Publish:"),Object(eo.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},Object(eo.createElement)(Fi,null))]},Object(eo.createElement)(Ui,null))),Object(eo.createElement)($i,null),Object(eo.createElement)(Yi,null),i)})),Ji=function(e){function t(){var e;return Object(ao.a)(this,t),(e=Object(uo.a)(this,Object(lo.a)(t).apply(this,arguments))).state={showCopyConfirmation:!1},e.onCopy=e.onCopy.bind(Object(So.a)(e)),e.onSelectInput=e.onSelectInput.bind(Object(So.a)(e)),e.postLink=Object(eo.createRef)(),e}return Object(po.a)(t,e),Object(so.a)(t,[{key:"componentDidMount",value:function(){this.props.focusOnMount&&this.postLink.current.focus()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.dismissCopyConfirmation)}},{key:"onCopy",value:function(){var e=this;this.setState({showCopyConfirmation:!0}),clearTimeout(this.dismissCopyConfirmation),this.dismissCopyConfirmation=setTimeout((function(){e.setState({showCopyConfirmation:!1})}),4e3)}},{key:"onSelectInput",value:function(e){e.target.select()}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.isScheduled,r=e.post,o=e.postType,i=Object(y.get)(o,["labels","singular_name"]),c=Object(y.get)(o,["labels","view_item"]),a=n?Object(eo.createElement)(eo.Fragment,null,Object(L.__)("is now scheduled. It will go live on")," ",Object(eo.createElement)(Fi,null),"."):Object(L.__)("is now live.");return Object(eo.createElement)("div",{className:"post-publish-panel__postpublish"},Object(eo.createElement)(Po.PanelBody,{className:"post-publish-panel__postpublish-header"},Object(eo.createElement)("a",{ref:this.postLink,href:r.link},r.title||Object(L.__)("(no title)"))," ",a),Object(eo.createElement)(Po.PanelBody,null,Object(eo.createElement)("p",{className:"post-publish-panel__postpublish-subheader"},Object(eo.createElement)("strong",null,Object(L.__)("What’s next?"))),Object(eo.createElement)(Po.TextControl,{className:"post-publish-panel__postpublish-post-address",readOnly:!0,label:Object(L.sprintf)(Object(L.__)("%s address"),i),value:Object(Ft.safeDecodeURIComponent)(r.link),onFocus:this.onSelectInput}),Object(eo.createElement)("div",{className:"post-publish-panel__postpublish-buttons"},!n&&Object(eo.createElement)(Po.Button,{isDefault:!0,href:r.link},c),Object(eo.createElement)(Po.ClipboardButton,{isDefault:!0,text:r.link,onCopy:this.onCopy},this.state.showCopyConfirmation?Object(L.__)("Copied!"):Object(L.__)("Copy Link")))),t)}}]),t}(eo.Component),ec=Object(h.withSelect)((function(e){var t=e("core/editor"),n=t.getEditedPostAttribute,r=t.getCurrentPost,o=t.isCurrentPostScheduled,i=e("core").getPostType;return{post:r(),postType:i(n("type")),isScheduled:o()}}))(Ji),tc=function(e){function t(){var e;return Object(ao.a)(this,t),(e=Object(uo.a)(this,Object(lo.a)(t).apply(this,arguments))).onSubmit=e.onSubmit.bind(Object(So.a)(e)),e}return Object(po.a)(t,e),Object(so.a)(t,[{key:"componentDidUpdate",value:function(e){e.isPublished&&!this.props.isSaving&&this.props.isDirty&&this.props.onClose()}},{key:"onSubmit",value:function(){var e=this.props,t=e.onClose,n=e.hasPublishAction,r=e.isPostTypeViewable;n&&r||t()}},{key:"render",value:function(){var e=this.props,t=e.forceIsDirty,n=e.forceIsSaving,r=e.isBeingScheduled,o=e.isPublished,i=e.isPublishSidebarEnabled,c=e.isScheduled,a=e.isSaving,s=e.onClose,u=e.onTogglePublishSidebar,l=e.PostPublishExtension,d=e.PrePublishExtension,p=Object(Do.a)(e,["forceIsDirty","forceIsSaving","isBeingScheduled","isPublished","isPublishSidebarEnabled","isScheduled","isSaving","onClose","onTogglePublishSidebar","PostPublishExtension","PrePublishExtension"]),b=Object(y.omit)(p,["hasPublishAction","isDirty","isPostTypeViewable"]),f=o||c&&r,h=!f&&!a,m=f&&!a;return Object(eo.createElement)("div",Object(ci.a)({className:"editor-post-publish-panel"},b),Object(eo.createElement)("div",{className:"editor-post-publish-panel__header"},m?Object(eo.createElement)("div",{className:"editor-post-publish-panel__header-published"},c?Object(L.__)("Scheduled"):Object(L.__)("Published")):Object(eo.createElement)("div",{className:"editor-post-publish-panel__header-publish-button"},Object(eo.createElement)(Ai,{focusOnMount:!0,onSubmit:this.onSubmit,forceIsDirty:t,forceIsSaving:n}),Object(eo.createElement)("span",{className:"editor-post-publish-panel__spacer"})),Object(eo.createElement)(Po.IconButton,{"aria-expanded":!0,onClick:s,icon:"no-alt",label:Object(L.__)("Close panel")})),Object(eo.createElement)("div",{className:"editor-post-publish-panel__content"},h&&Object(eo.createElement)(Zi,null,d&&Object(eo.createElement)(d,null)),m&&Object(eo.createElement)(ec,{focusOnMount:!0},l&&Object(eo.createElement)(l,null)),a&&Object(eo.createElement)(Po.Spinner,null)),Object(eo.createElement)("div",{className:"editor-post-publish-panel__footer"},Object(eo.createElement)(Po.CheckboxControl,{label:Object(L.__)("Always show pre-publish checks."),checked:i,onChange:u})))}}]),t}(eo.Component),nc=Object(bo.compose)([Object(h.withSelect)((function(e){var t=e("core").getPostType,n=e("core/editor"),r=n.getCurrentPost,o=n.getEditedPostAttribute,i=n.isCurrentPostPublished,c=n.isCurrentPostScheduled,a=n.isEditedPostBeingScheduled,s=n.isEditedPostDirty,u=n.isSavingPost,l=e("core/editor").isPublishSidebarEnabled,d=t(o("type"));return{hasPublishAction:Object(y.get)(r(),["_links","wp:action-publish"],!1),isPostTypeViewable:Object(y.get)(d,["viewable"],!1),isBeingScheduled:a(),isDirty:s(),isPublished:i(),isPublishSidebarEnabled:l(),isSaving:u(),isScheduled:c()}})),Object(h.withDispatch)((function(e,t){var n=t.isPublishSidebarEnabled,r=e("core/editor"),o=r.disablePublishSidebar,i=r.enablePublishSidebar;return{onTogglePublishSidebar:function(){n?o():i()}}})),Po.withFocusReturn,Po.withConstrainedTabbing])(tc);var rc=Object(bo.compose)([Object(h.withSelect)((function(e){var t=e("core/editor"),n=t.isSavingPost,r=t.isCurrentPostPublished,o=t.isCurrentPostScheduled;return{isSaving:n(),isPublished:r(),isScheduled:o()}})),Object(h.withDispatch)((function(e){var t=e("core/editor"),n=t.editPost,r=t.savePost;return{onClick:function(){n({status:"draft"}),r()}}})),Object(b.withViewportMatch)({isMobileViewport:"< small"})])((function(e){var t=e.isSaving,n=e.isPublished,r=e.isScheduled,o=e.onClick,i=e.isMobileViewport;return n||r?Object(eo.createElement)(Po.Button,{className:"editor-post-switch-to-draft",onClick:function(){var e;n?e=Object(L.__)("Are you sure you want to unpublish this post?"):r&&(e=Object(L.__)("Are you sure you want to unschedule this post?")),window.confirm(e)&&o()},disabled:t,isTertiary:!0},i?Object(L.__)("Draft"):Object(L.__)("Switch to Draft")):null})),oc=function(e){function t(){var e;return Object(ao.a)(this,t),(e=Object(uo.a)(this,Object(lo.a)(t).apply(this,arguments))).state={forceSavedMessage:!1},e}return Object(po.a)(t,e),Object(so.a)(t,[{key:"componentDidUpdate",value:function(e){var t=this;e.isSaving&&!this.props.isSaving&&(this.setState({forceSavedMessage:!0}),this.props.setTimeout((function(){t.setState({forceSavedMessage:!1})}),1e3))}},{key:"render",value:function(){var e=this.props,t=e.post,n=e.isNew,r=e.isScheduled,o=e.isPublished,i=e.isDirty,c=e.isSaving,a=e.isSaveable,s=e.onSave,u=e.isAutosaving,l=e.isPending,d=e.isLargeViewport,p=this.state.forceSavedMessage;if(c){var b=vo()("editor-post-saved-state","is-saving",{"is-autosaving":u});return Object(eo.createElement)(Po.Animate,{type:"loading"},(function(e){var t=e.className;return Object(eo.createElement)("span",{className:vo()(b,t)},Object(eo.createElement)(Po.Dashicon,{icon:"cloud"}),u?Object(L.__)("Autosaving"):Object(L.__)("Saving"))}))}if(o||r)return Object(eo.createElement)(rc,null);if(!a)return null;if(p||!n&&!i)return Object(eo.createElement)("span",{className:"editor-post-saved-state is-saved"},Object(eo.createElement)(Po.Dashicon,{icon:"saved"}),Object(L.__)("Saved"));if(!Object(y.get)(t,["_links","wp:action-publish"],!1)&&l)return null;var f=l?Object(L.__)("Save as Pending"):Object(L.__)("Save Draft");return d?Object(eo.createElement)(Po.Button,{className:"editor-post-save-draft",onClick:function(){return s()},shortcut:Co.displayShortcut.primary("s"),isTertiary:!0},f):Object(eo.createElement)(Po.IconButton,{className:"editor-post-save-draft",label:f,onClick:function(){return s()},shortcut:Co.displayShortcut.primary("s"),icon:"cloud-upload"})}}]),t}(eo.Component),ic=Object(bo.compose)([Object(h.withSelect)((function(e,t){var n=t.forceIsDirty,r=t.forceIsSaving,o=e("core/editor"),i=o.isEditedPostNew,c=o.isCurrentPostPublished,a=o.isCurrentPostScheduled,s=o.isEditedPostDirty,u=o.isSavingPost,l=o.isEditedPostSaveable,d=o.getCurrentPost,p=o.isAutosavingPost,b=o.getEditedPostAttribute;return{post:d(),isNew:i(),isPublished:c(),isScheduled:a(),isDirty:n||s(),isSaving:r||u(),isSaveable:l(),isAutosaving:p(),isPending:"pending"===b("status")}})),Object(h.withDispatch)((function(e){return{onSave:e("core/editor").savePost}})),bo.withSafeTimeout,Object(b.withViewportMatch)({isLargeViewport:"small"})])(oc);var cc=Object(bo.compose)([Object(h.withSelect)((function(e){var t=e("core/editor"),n=t.getCurrentPost,r=t.getCurrentPostType;return{hasPublishAction:Object(y.get)(n(),["_links","wp:action-publish"],!1),postType:r()}}))])((function(e){var t=e.hasPublishAction,n=e.children;return t?n:null}));var ac=Object(bo.compose)([Object(h.withSelect)((function(e){var t=e("core/editor").getCurrentPost();return{hasStickyAction:Object(y.get)(t,["_links","wp:action-sticky"],!1),postType:e("core/editor").getCurrentPostType()}}))])((function(e){var t=e.hasStickyAction,n=e.postType,r=e.children;return"post"===n&&t?r:null}));var sc=Object(bo.compose)([Object(h.withSelect)((function(e){return{postSticky:e("core/editor").getEditedPostAttribute("sticky")}})),Object(h.withDispatch)((function(e){return{onUpdateSticky:function(t){e("core/editor").editPost({sticky:t})}}}))])((function(e){var t=e.onUpdateSticky,n=e.postSticky,r=void 0!==n&&n;return Object(eo.createElement)(ac,null,Object(eo.createElement)(Po.CheckboxControl,{label:Object(L.__)("Stick to the top of the blog"),checked:r,onChange:function(){return t(!r)}}))})),uc={per_page:-1,orderby:"name",order:"asc",_fields:"id,name,parent"},lc=function(e){function t(){var e;return Object(ao.a)(this,t),(e=Object(uo.a)(this,Object(lo.a)(t).apply(this,arguments))).findTerm=e.findTerm.bind(Object(So.a)(e)),e.onChange=e.onChange.bind(Object(So.a)(e)),e.onChangeFormName=e.onChangeFormName.bind(Object(So.a)(e)),e.onChangeFormParent=e.onChangeFormParent.bind(Object(So.a)(e)),e.onAddTerm=e.onAddTerm.bind(Object(So.a)(e)),e.onToggleForm=e.onToggleForm.bind(Object(So.a)(e)),e.setFilterValue=e.setFilterValue.bind(Object(So.a)(e)),e.sortBySelected=e.sortBySelected.bind(Object(So.a)(e)),e.state={loading:!0,availableTermsTree:[],availableTerms:[],adding:!1,formName:"",formParent:"",showForm:!1,filterValue:"",filteredTermsTree:[]},e}return Object(po.a)(t,e),Object(so.a)(t,[{key:"onChange",value:function(e){var t=this.props,n=t.onUpdateTerms,r=t.terms,o=void 0===r?[]:r,i=t.taxonomy;n(-1!==o.indexOf(e)?Object(y.without)(o,e):[].concat(Object(N.a)(o),[e]),i.rest_base)}},{key:"onChangeFormName",value:function(e){var t=""===e.target.value.trim()?"":e.target.value;this.setState({formName:t})}},{key:"onChangeFormParent",value:function(e){this.setState({formParent:e})}},{key:"onToggleForm",value:function(){this.setState((function(e){return{showForm:!e.showForm}}))}},{key:"findTerm",value:function(e,t,n){return Object(y.find)(e,(function(e){return(!e.parent&&!t||parseInt(e.parent)===parseInt(t))&&e.name.toLowerCase()===n.toLowerCase()}))}},{key:"onAddTerm",value:function(e){var t=this;e.preventDefault();var n=this.props,r=n.onUpdateTerms,o=n.taxonomy,i=n.terms,c=n.slug,a=this.state,s=a.formName,u=a.formParent,l=a.adding,d=a.availableTerms;if(""!==s&&!l){var p=this.findTerm(d,u,s);if(p)return Object(y.some)(i,(function(e){return e===p.id}))||r([].concat(Object(N.a)(i),[p.id]),o.rest_base),void this.setState({formName:"",formParent:""});this.setState({adding:!0}),this.addRequest=A()({path:"/wp/v2/".concat(o.rest_base),method:"POST",data:{name:s,parent:u||void 0}}),this.addRequest.catch((function(e){return"term_exists"===e.code?(t.addRequest=A()({path:Object(Ft.addQueryArgs)("/wp/v2/".concat(o.rest_base),Object(f.a)({},uc,{parent:u||0,search:s}))}),t.addRequest.then((function(e){return t.findTerm(e,u,s)}))):Promise.reject(e)})).then((function(e){var n=!!Object(y.find)(t.state.availableTerms,(function(t){return t.id===e.id}))?t.state.availableTerms:[e].concat(Object(N.a)(t.state.availableTerms)),a=Object(L.sprintf)(Object(L._x)("%s added","term"),Object(y.get)(t.props.taxonomy,["labels","singular_name"],"category"===c?Object(L.__)("Category"):Object(L.__)("Term")));t.props.speak(a,"assertive"),t.addRequest=null,t.setState({adding:!1,formName:"",formParent:"",availableTerms:n,availableTermsTree:t.sortBySelected(Qo(n))}),r([].concat(Object(N.a)(i),[e.id]),o.rest_base)}),(function(e){"abort"!==e.statusText&&(t.addRequest=null,t.setState({adding:!1}))}))}}},{key:"componentDidMount",value:function(){this.fetchTerms()}},{key:"componentWillUnmount",value:function(){Object(y.invoke)(this.fetchRequest,["abort"]),Object(y.invoke)(this.addRequest,["abort"])}},{key:"componentDidUpdate",value:function(e){this.props.taxonomy!==e.taxonomy&&this.fetchTerms()}},{key:"fetchTerms",value:function(){var e=this,t=this.props.taxonomy;t&&(this.fetchRequest=A()({path:Object(Ft.addQueryArgs)("/wp/v2/".concat(t.rest_base),uc)}),this.fetchRequest.then((function(t){var n=e.sortBySelected(Qo(t));e.fetchRequest=null,e.setState({loading:!1,availableTermsTree:n,availableTerms:t})}),(function(t){"abort"!==t.statusText&&(e.fetchRequest=null,e.setState({loading:!1}))})))}},{key:"sortBySelected",value:function(e){var t=this.props.terms,n=function e(n){return-1!==t.indexOf(n.id)||void 0!==n.children&&!!(n.children.map(e).filter((function(e){return e})).length>0)};return e.sort((function(e,t){var r=n(e),o=n(t);return r===o?0:r&&!o?-1:!r&&o?1:0})),e}},{key:"setFilterValue",value:function(e){var t=this.state.availableTermsTree,n=e.target.value,r=t.map(this.getFilterMatcher(n)).filter((function(e){return e}));this.setState({filterValue:n,filteredTermsTree:r});var o=function e(t){for(var n=0,r=0;r0&&(r.children=r.children.map(t).filter((function(e){return e}))),(-1!==r.name.toLowerCase().indexOf(e.toLowerCase())||r.children.length>0)&&r}}},{key:"renderTerms",value:function(e){var t=this,n=this.props.terms,r=void 0===n?[]:n;return e.map((function(e){return Object(eo.createElement)("div",{key:e.id,className:"editor-post-taxonomies__hierarchical-terms-choice"},Object(eo.createElement)(Po.CheckboxControl,{checked:-1!==r.indexOf(e.id),onChange:function(){var n=parseInt(e.id,10);t.onChange(n)},label:Object(y.unescape)(e.name)}),!!e.children.length&&Object(eo.createElement)("div",{className:"editor-post-taxonomies__hierarchical-terms-subchoices"},t.renderTerms(e.children)))}))}},{key:"render",value:function(){var e=this.props,t=e.slug,n=e.taxonomy,r=e.instanceId,o=e.hasCreateAction;if(!e.hasAssignAction)return null;var i=this.state,c=i.availableTermsTree,a=i.availableTerms,s=i.filteredTermsTree,u=i.formName,l=i.formParent,d=i.loading,p=i.showForm,b=i.filterValue,f=function(e,r,o){return Object(y.get)(n,["labels",e],"category"===t?r:o)},h=f("add_new_item",Object(L.__)("Add new category"),Object(L.__)("Add new term")),m=f("new_item_name",Object(L.__)("Add new category"),Object(L.__)("Add new term")),v=f("parent_item",Object(L.__)("Parent Category"),Object(L.__)("Parent Term")),O="— ".concat(v," —"),g=h,j="editor-post-taxonomies__hierarchical-terms-input-".concat(r),_="editor-post-taxonomies__hierarchical-terms-filter-".concat(r),k=Object(y.get)(this.props.taxonomy,["labels","search_items"],Object(L.__)("Search Terms")),E=Object(y.get)(this.props.taxonomy,["name"],Object(L.__)("Terms")),w=a.length>=8;return[w&&Object(eo.createElement)("label",{key:"filter-label",htmlFor:_},k),w&&Object(eo.createElement)("input",{type:"search",id:_,value:b,onChange:this.setFilterValue,className:"editor-post-taxonomies__hierarchical-terms-filter",key:"term-filter-input"}),Object(eo.createElement)("div",{className:"editor-post-taxonomies__hierarchical-terms-list",key:"term-list",tabIndex:"0",role:"group","aria-label":E},this.renderTerms(""!==b?s:c)),!d&&o&&Object(eo.createElement)(Po.Button,{key:"term-add-button",onClick:this.onToggleForm,className:"editor-post-taxonomies__hierarchical-terms-add","aria-expanded":p,isLink:!0},h),p&&Object(eo.createElement)("form",{onSubmit:this.onAddTerm,key:"hierarchical-terms-form"},Object(eo.createElement)("label",{htmlFor:j,className:"editor-post-taxonomies__hierarchical-terms-label"},m),Object(eo.createElement)("input",{type:"text",id:j,className:"editor-post-taxonomies__hierarchical-terms-input",value:u,onChange:this.onChangeFormName,required:!0}),!!a.length&&Object(eo.createElement)(Po.TreeSelect,{label:v,noOptionLabel:O,onChange:this.onChangeFormParent,selectedId:l,tree:c}),Object(eo.createElement)(Po.Button,{isDefault:!0,type:"submit",className:"editor-post-taxonomies__hierarchical-terms-submit"},g))]}}]),t}(eo.Component),dc=Object(bo.compose)([Object(h.withSelect)((function(e,t){var n=t.slug,r=e("core/editor").getCurrentPost,o=(0,e("core").getTaxonomy)(n);return{hasCreateAction:!!o&&Object(y.get)(r(),["_links","wp:action-create-"+o.rest_base],!1),hasAssignAction:!!o&&Object(y.get)(r(),["_links","wp:action-assign-"+o.rest_base],!1),terms:o?e("core/editor").getEditedPostAttribute(o.rest_base):[],taxonomy:o}})),Object(h.withDispatch)((function(e){return{onUpdateTerms:function(t,n){e("core/editor").editPost(Object(v.a)({},n,t))}}})),Po.withSpokenMessages,bo.withInstanceId,Object(Po.withFilters)("editor.PostTaxonomyType")])(lc);var pc=Object(bo.compose)([Object(h.withSelect)((function(e){return{postType:e("core/editor").getCurrentPostType(),taxonomies:e("core").getTaxonomies({per_page:-1})}}))])((function(e){var t=e.postType,n=e.taxonomies,r=e.taxonomyWrapper,o=void 0===r?y.identity:r,i=Object(y.filter)(n,(function(e){return Object(y.includes)(e.types,t)}));return Object(y.filter)(i,(function(e){return e.visibility.show_ui})).map((function(e){var t=e.hierarchical?dc:Ki;return Object(eo.createElement)(eo.Fragment,{key:"taxonomy-".concat(e.slug)},o(Object(eo.createElement)(t,{slug:e.slug}),e))}))}));var bc=Object(bo.compose)([Object(h.withSelect)((function(e){return{postType:e("core/editor").getCurrentPostType(),taxonomies:e("core").getTaxonomies({per_page:-1})}}))])((function(e){var t=e.postType,n=e.taxonomies,r=e.children;return Object(y.some)(n,(function(e){return Object(y.includes)(e.types,t)}))?r:null})),fc=n(62),hc=n.n(fc),mc=function(e){function t(){var e;return Object(ao.a)(this,t),(e=Object(uo.a)(this,Object(lo.a)(t).apply(this,arguments))).edit=e.edit.bind(Object(So.a)(e)),e.stopEditing=e.stopEditing.bind(Object(So.a)(e)),e.state={},e}return Object(po.a)(t,e),Object(so.a)(t,[{key:"edit",value:function(e){var t=e.target.value;this.props.onChange(t),this.setState({value:t,isDirty:!0})}},{key:"stopEditing",value:function(){this.state.isDirty&&(this.props.onPersist(this.state.value),this.setState({isDirty:!1}))}},{key:"render",value:function(){var e=this.state.value,t=this.props.instanceId;return Object(eo.createElement)(eo.Fragment,null,Object(eo.createElement)("label",{htmlFor:"post-content-".concat(t),className:"screen-reader-text"},Object(L.__)("Type text or HTML")),Object(eo.createElement)(hc.a,{autoComplete:"off",dir:"auto",value:e,onChange:this.edit,onBlur:this.stopEditing,className:"editor-post-text-editor",id:"post-content-".concat(t),placeholder:Object(L.__)("Start writing with text or HTML")}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return t.isDirty?null:{value:e.value,isDirty:!1}}}]),t}(eo.Component),vc=Object(bo.compose)([Object(h.withSelect)((function(e){return{value:(0,e("core/editor").getEditedPostContent)()}})),Object(h.withDispatch)((function(e){var t=e("core/editor"),n=t.editPost,r=t.resetEditorBlocks;return{onChange:function(e){n({content:e})},onPersist:function(e){var t=Object(l.parse)(e);r(t)}}})),bo.withInstanceId])(mc),Oc=function(e){function t(e){var n,r=e.permalinkParts,o=e.slug;return Object(ao.a)(this,t),(n=Object(uo.a)(this,Object(lo.a)(t).apply(this,arguments))).state={editedPostName:o||r.postName},n.onSavePermalink=n.onSavePermalink.bind(Object(So.a)(n)),n}return Object(po.a)(t,e),Object(so.a)(t,[{key:"onSavePermalink",value:function(e){var t=_i(this.state.editedPostName);e.preventDefault(),this.props.onSave(),t!==this.props.postName&&(this.props.editPost({slug:t}),this.setState({editedPostName:t}))}},{key:"render",value:function(){var e=this,t=this.props.permalinkParts,n=t.prefix,r=t.suffix,o=this.state.editedPostName;return Object(eo.createElement)("form",{className:"editor-post-permalink-editor",onSubmit:this.onSavePermalink},Object(eo.createElement)("span",{className:"editor-post-permalink__editor-container"},Object(eo.createElement)("span",{className:"editor-post-permalink-editor__prefix"},n),Object(eo.createElement)("input",{className:"editor-post-permalink-editor__edit","aria-label":Object(L.__)("Edit post permalink"),value:o,onChange:function(t){return e.setState({editedPostName:t.target.value})},type:"text",autoFocus:!0}),Object(eo.createElement)("span",{className:"editor-post-permalink-editor__suffix"},r),"‎"),Object(eo.createElement)(Po.Button,{className:"editor-post-permalink-editor__save",isLarge:!0,onClick:this.onSavePermalink},Object(L.__)("Save")))}}]),t}(eo.Component),gc=Object(bo.compose)([Object(h.withSelect)((function(e){return{permalinkParts:(0,e("core/editor").getPermalinkParts)()}})),Object(h.withDispatch)((function(e){return{editPost:e("core/editor").editPost}}))])(Oc),jc=function(e){function t(){var e;return Object(ao.a)(this,t),(e=Object(uo.a)(this,Object(lo.a)(t).apply(this,arguments))).addVisibilityCheck=e.addVisibilityCheck.bind(Object(So.a)(e)),e.onVisibilityChange=e.onVisibilityChange.bind(Object(So.a)(e)),e.state={isCopied:!1,isEditingPermalink:!1},e}return Object(po.a)(t,e),Object(so.a)(t,[{key:"addVisibilityCheck",value:function(){window.addEventListener("visibilitychange",this.onVisibilityChange)}},{key:"onVisibilityChange",value:function(){var e=this.props,t=e.isEditable,n=e.refreshPost;t||"visible"!==document.visibilityState||n()}},{key:"componentDidUpdate",value:function(e,t){t.isEditingPermalink&&!this.state.isEditingPermalink&&this.linkElement.focus()}},{key:"componentWillUnmount",value:function(){window.removeEventListener("visibilitychange",this.addVisibilityCheck)}},{key:"render",value:function(){var e=this,t=this.props,n=t.isEditable,r=t.isNew,o=t.isPublished,i=t.isViewable,c=t.permalinkParts,a=t.postLink,s=t.postSlug,u=t.postID,l=t.postTitle;if(r||!i||!c||!a)return null;var d=this.state,p=d.isCopied,b=d.isEditingPermalink,f=p?Object(L.__)("Permalink copied"):Object(L.__)("Copy the permalink"),h=c.prefix,m=c.suffix,v=Object(Ft.safeDecodeURIComponent)(s)||_i(l)||u,O=n?h+v+m:h;return Object(eo.createElement)("div",{className:"editor-post-permalink"},Object(eo.createElement)(Po.ClipboardButton,{className:vo()("editor-post-permalink__copy",{"is-copied":p}),text:O,label:f,onCopy:function(){return e.setState({isCopied:!0})},"aria-disabled":p,icon:"admin-links"}),Object(eo.createElement)("span",{className:"editor-post-permalink__label"},Object(L.__)("Permalink:")),!b&&Object(eo.createElement)(Po.ExternalLink,{className:"editor-post-permalink__link",href:o?O:a,target:"_blank",ref:function(t){return e.linkElement=t}},Object(Ft.safeDecodeURI)(O),"‎"),b&&Object(eo.createElement)(gc,{slug:v,onSave:function(){return e.setState({isEditingPermalink:!1})}}),n&&!b&&Object(eo.createElement)(Po.Button,{className:"editor-post-permalink__edit",isLarge:!0,onClick:function(){return e.setState({isEditingPermalink:!0})}},Object(L.__)("Edit")))}}]),t}(eo.Component),yc=Object(bo.compose)([Object(h.withSelect)((function(e){var t=e("core/editor"),n=t.isEditedPostNew,r=t.isPermalinkEditable,o=t.getCurrentPost,i=t.getPermalinkParts,c=t.getEditedPostAttribute,a=t.isCurrentPostPublished,s=e("core").getPostType,u=o(),l=u.id,d=u.link,p=s(c("type"));return{isNew:n(),postLink:d,permalinkParts:i(),postSlug:c("slug"),isEditable:r(),isPublished:a(),postTitle:c("title"),postID:l,isViewable:Object(y.get)(p,["viewable"],!1)}})),Object(h.withDispatch)((function(e){return{refreshPost:e("core/editor").refreshPost}}))])(jc),_c=/[\r\n]+/g,kc=function(e){function t(){var e;return Object(ao.a)(this,t),(e=Object(uo.a)(this,Object(lo.a)(t).apply(this,arguments))).onChange=e.onChange.bind(Object(So.a)(e)),e.onSelect=e.onSelect.bind(Object(So.a)(e)),e.onUnselect=e.onUnselect.bind(Object(So.a)(e)),e.onKeyDown=e.onKeyDown.bind(Object(So.a)(e)),e.redirectHistory=e.redirectHistory.bind(Object(So.a)(e)),e.state={isSelected:!1},e}return Object(po.a)(t,e),Object(so.a)(t,[{key:"handleFocusOutside",value:function(){this.onUnselect()}},{key:"onSelect",value:function(){this.setState({isSelected:!0}),this.props.clearSelectedBlock()}},{key:"onUnselect",value:function(){this.setState({isSelected:!1})}},{key:"onChange",value:function(e){var t=e.target.value.replace(_c," ");this.props.onUpdate(t)}},{key:"onKeyDown",value:function(e){e.keyCode===Co.ENTER&&(e.preventDefault(),this.props.onEnterPress())}},{key:"redirectHistory",value:function(e){e.shiftKey?this.props.onRedo():this.props.onUndo(),e.preventDefault()}},{key:"render",value:function(){var e=this.props,t=e.hasFixedToolbar,n=e.isCleanNewPost,r=e.isFocusMode,o=e.isPostTypeViewable,i=e.instanceId,c=e.placeholder,a=e.title,s=this.state.isSelected,u=vo()("wp-block editor-post-title__block",{"is-selected":s,"is-focus-mode":r,"has-fixed-toolbar":t}),l=Object(ei.decodeEntities)(c);return Object(eo.createElement)(Go,{supportKeys:"title"},Object(eo.createElement)("div",{className:"editor-post-title"},Object(eo.createElement)("div",{className:u},Object(eo.createElement)(Po.KeyboardShortcuts,{shortcuts:{"mod+z":this.redirectHistory,"mod+shift+z":this.redirectHistory}},Object(eo.createElement)("label",{htmlFor:"post-title-".concat(i),className:"screen-reader-text"},l||Object(L.__)("Add title")),Object(eo.createElement)(hc.a,{id:"post-title-".concat(i),className:"editor-post-title__input",value:a,onChange:this.onChange,placeholder:l||Object(L.__)("Add title"),onFocus:this.onSelect,onKeyDown:this.onKeyDown,onKeyPress:this.onUnselect,autoFocus:document.body===document.activeElement&&n})),s&&o&&Object(eo.createElement)(yc,null))))}}]),t}(eo.Component),Ec=Object(h.withSelect)((function(e){var t=e("core/editor"),n=t.getEditedPostAttribute,r=t.isCleanNewPost,o=e("core/block-editor").getSettings,i=(0,e("core").getPostType)(n("type")),c=o(),a=c.titlePlaceholder,s=c.focusMode,u=c.hasFixedToolbar;return{isCleanNewPost:r(),title:n("title"),isPostTypeViewable:Object(y.get)(i,["viewable"],!1),placeholder:a,isFocusMode:s,hasFixedToolbar:u}})),wc=Object(h.withDispatch)((function(e){var t=e("core/block-editor"),n=t.insertDefaultBlock,r=t.clearSelectedBlock,o=e("core/editor"),i=o.editPost;return{onEnterPress:function(){n(void 0,void 0,0)},onUpdate:function(e){i({title:e})},onUndo:o.undo,onRedo:o.redo,clearSelectedBlock:r}})),Sc=Object(bo.compose)(Ec,wc,bo.withInstanceId,Po.withFocusOutside)(kc);var Pc=Object(bo.compose)([Object(h.withSelect)((function(e){var t=e("core/editor"),n=t.isEditedPostNew,r=t.getCurrentPostId,o=t.getCurrentPostType;return{isNew:n(),postId:r(),postType:o()}})),Object(h.withDispatch)((function(e){return{trashPost:e("core/editor").trashPost}}))])((function(e){var t=e.isNew,n=e.postId,r=e.postType,o=Object(Do.a)(e,["isNew","postId","postType"]);return t||!n?null:Object(eo.createElement)(Po.Button,{className:"editor-post-trash button-link-delete",onClick:function(){return o.trashPost(n,r)},isDefault:!0,isLarge:!0},Object(L.__)("Move to Trash"))}));var Cc=Object(h.withSelect)((function(e){var t=e("core/editor"),n=t.isEditedPostNew,r=t.getCurrentPostId;return{isNew:n(),postId:r()}}))((function(e){var t=e.isNew,n=e.postId,r=e.children;return t||!n?null:r}));var Tc=Object(bo.compose)([Object(h.withSelect)((function(e){var t=e("core/editor"),n=t.getCurrentPost,r=t.getCurrentPostType;return{hasPublishAction:Object(y.get)(n(),["_links","wp:action-publish"],!1),postType:r()}}))])((function(e){var t=e.hasPublishAction;return(0,e.render)({canEdit:t})})),xc=n(97);var Bc=Object(h.withSelect)((function(e){return{content:e("core/editor").getEditedPostAttribute("content")}}))((function(e){var t=e.content,n=Object(L._x)("words","Word count type. Do not translate!");return Object(eo.createElement)("span",{className:"word-count"},Object(xc.count)(t,n))}));var Ic=Object(h.withSelect)((function(e){var t=e("core/block-editor").getGlobalBlockCount;return{headingCount:t("core/heading"),paragraphCount:t("core/paragraph"),numberOfBlocks:t()}}))((function(e){var t=e.headingCount,n=e.paragraphCount,r=e.numberOfBlocks,o=e.hasOutlineItemsDisabled,i=e.onRequestClose;return(Object(eo.createElement)(eo.Fragment,null,Object(eo.createElement)("div",{className:"table-of-contents__wrapper",role:"note","aria-label":Object(L.__)("Document Statistics"),tabIndex:"0"},Object(eo.createElement)("ul",{role:"list",className:"table-of-contents__counts"},Object(eo.createElement)("li",{className:"table-of-contents__count"},Object(L.__)("Words"),Object(eo.createElement)(Bc,null)),Object(eo.createElement)("li",{className:"table-of-contents__count"},Object(L.__)("Headings"),Object(eo.createElement)("span",{className:"table-of-contents__number"},t)),Object(eo.createElement)("li",{className:"table-of-contents__count"},Object(L.__)("Paragraphs"),Object(eo.createElement)("span",{className:"table-of-contents__number"},n)),Object(eo.createElement)("li",{className:"table-of-contents__count"},Object(L.__)("Blocks"),Object(eo.createElement)("span",{className:"table-of-contents__number"},r)))),t>0&&Object(eo.createElement)(eo.Fragment,null,Object(eo.createElement)("hr",null),Object(eo.createElement)("h2",{className:"table-of-contents__title"},Object(L.__)("Document Outline")),Object(eo.createElement)(Eo,{onSelect:i,hasOutlineItemsDisabled:o}))))}));var Ac=Object(h.withSelect)((function(e){return{hasBlocks:!!e("core/block-editor").getBlockCount()}}))((function(e){var t=e.hasBlocks,n=e.hasOutlineItemsDisabled;return Object(eo.createElement)(Po.Dropdown,{position:"bottom",className:"table-of-contents",contentClassName:"table-of-contents__popover",renderToggle:function(e){var n=e.isOpen,r=e.onToggle;return Object(eo.createElement)(Po.IconButton,{onClick:t?r:void 0,icon:"info-outline","aria-expanded":n,label:Object(L.__)("Content structure"),labelPosition:"bottom","aria-disabled":!t})},renderContent:function(e){var t=e.onClose;return Object(eo.createElement)(Ic,{onRequestClose:t,hasOutlineItemsDisabled:n})}})})),Lc=function(e){function t(){var e;return Object(ao.a)(this,t),(e=Object(uo.a)(this,Object(lo.a)(t).apply(this,arguments))).warnIfUnsavedChanges=e.warnIfUnsavedChanges.bind(Object(So.a)(e)),e}return Object(po.a)(t,e),Object(so.a)(t,[{key:"componentDidMount",value:function(){window.addEventListener("beforeunload",this.warnIfUnsavedChanges)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("beforeunload",this.warnIfUnsavedChanges)}},{key:"warnIfUnsavedChanges",value:function(e){if(this.props.isDirty)return e.returnValue=Object(L.__)("You have unsaved changes. If you proceed, they will be lost."),e.returnValue}},{key:"render",value:function(){return null}}]),t}(eo.Component),Rc=Object(h.withSelect)((function(e){return{isDirty:e("core/editor").isEditedPostDirty()}}))(Lc),Nc=Object(bo.createHigherOrderComponent)((function(e){return Object(h.withRegistry)((function(t){var n=t.useSubRegistry,r=void 0===n||n,o=t.registry,i=Object(Do.a)(t,["useSubRegistry","registry"]);if(!r)return Object(eo.createElement)(e,i);var c=Object(eo.useState)(null),a=Object(R.a)(c,2),s=a[0],l=a[1];return Object(eo.useEffect)((function(){var e=Object(h.createRegistry)({"core/block-editor":u.storeConfig},o),t=e.registerStore("core/editor",$r);Xr(t),l(e)}),[o]),s?Object(eo.createElement)(h.RegistryProvider,{value:s},Object(eo.createElement)(e,i)):null}))}),"withRegistryProvider"),Dc=n(99),Uc=function(e){var t=e.additionalData,n=void 0===t?{}:t,r=e.allowedTypes,o=e.filesList,i=e.maxUploadFileSize,c=e.onError,a=void 0===c?y.noop:c,s=e.onFileChange,u=Object(h.select)("core/editor"),l=u.getCurrentPostId,d=u.getEditorSettings,p=d().allowedMimeTypes;i=i||d().maxUploadFileSize,Object(Dc.uploadMedia)({allowedTypes:r,filesList:o,onFileChange:s,additionalData:Object(f.a)({post:l()},n),maxUploadFileSize:i,onError:function(e){var t=e.message;return a(t)},wpAllowedMimeTypes:p})};var Fc=Object(bo.compose)([Object(h.withSelect)((function(e,t){var n=t.clientIds,r=e("core/block-editor"),o=r.getBlocksByClientId,i=r.canInsertBlockType,c=e("core/editor").__experimentalGetReusableBlock,a=e("core").canUser,s=o(n),u=1===s.length&&s[0]&&Object(l.isReusableBlock)(s[0])&&!!c(s[0].attributes.ref);return{isReusable:u,isVisible:u||i("core/block")&&Object(y.every)(s,(function(e){return!!e&&e.isValid&&Object(l.hasBlockSupport)(e.name,"reusable",!0)}))&&!!a("create","blocks")}})),Object(h.withDispatch)((function(e,t){var n=t.clientIds,r=t.onToggle,o=void 0===r?y.noop:r,i=e("core/editor"),c=i.__experimentalConvertBlockToReusable,a=i.__experimentalConvertBlockToStatic;return{onConvertToStatic:function(){1===n.length&&(a(n[0]),o())},onConvertToReusable:function(){c(n),o()}}}))])((function(e){var t=e.isVisible,n=e.isReusable,r=e.onConvertToStatic,o=e.onConvertToReusable;return t?Object(eo.createElement)(eo.Fragment,null,!n&&Object(eo.createElement)(Po.MenuItem,{className:"editor-block-settings-menu__control block-editor-block-settings-menu__control",icon:"controls-repeat",onClick:o},Object(L.__)("Add to Reusable Blocks")),n&&Object(eo.createElement)(Po.MenuItem,{className:"editor-block-settings-menu__control block-editor-block-settings-menu__control",icon:"controls-repeat",onClick:r},Object(L.__)("Convert to Regular Block"))):null}));var Mc=Object(bo.compose)([Object(h.withSelect)((function(e,t){var n=t.clientId,r=e("core/block-editor").getBlock,o=e("core").canUser,i=e("core/editor").__experimentalGetReusableBlock,c=r(n),a=c&&Object(l.isReusableBlock)(c)?i(c.attributes.ref):null;return{isVisible:!!a&&!!o("delete","blocks",a.id),isDisabled:a&&a.isTemporary}})),Object(h.withDispatch)((function(e,t,n){var r=t.clientId,o=t.onToggle,i=void 0===o?y.noop:o,c=n.select,a=e("core/editor").__experimentalDeleteReusableBlock,s=c("core/block-editor").getBlock;return{onDelete:function(){if(window.confirm(Object(L.__)("Are you sure you want to delete this Reusable Block?\n\nIt will be permanently removed from all posts and pages that use it."))){var e=s(r);a(e.attributes.ref),i()}}}}))])((function(e){var t=e.isVisible,n=e.isDisabled,r=e.onDelete;return t?Object(eo.createElement)(Po.MenuItem,{className:"editor-block-settings-menu__control block-editor-block-settings-menu__control",icon:"no",disabled:n,onClick:function(){return r()}},Object(L.__)("Remove from Reusable Blocks")):null}));var Vc=Object(h.withSelect)((function(e){return{clientIds:(0,e("core/block-editor").getSelectedBlockClientIds)()}}))((function(e){var t=e.clientIds;return Object(eo.createElement)(u.__experimentalBlockSettingsMenuPluginsExtension,null,(function(e){var n=e.onClose;return Object(eo.createElement)(eo.Fragment,null,Object(eo.createElement)(Fc,{clientIds:t,onToggle:n}),1===t.length&&Object(eo.createElement)(Mc,{clientId:t[0],onToggle:n}))}))})),Hc=Object(eo.createElement)(Po.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(eo.createElement)(Po.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M8 5a1 1 0 0 0-1 1v3H6a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-3h1a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1H8zm3 6H7v2h4v-2zM9 9V7h4v2H9z"}),Object(eo.createElement)(Po.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M1 3a2 2 0 0 0 1 1.732v10.536A2 2 0 1 0 4.732 18h10.536A2 2 0 1 0 18 15.268V4.732A2 2 0 1 0 15.268 2H4.732A2 2 0 0 0 1 3zm14.268 1H4.732A2.01 2.01 0 0 1 4 4.732v10.536c.304.175.557.428.732.732h10.536a2.01 2.01 0 0 1 .732-.732V4.732A2.01 2.01 0 0 1 15.268 4z"})),Wc=Object(eo.createElement)(Po.Icon,{icon:Hc}),zc=Object(eo.createElement)(Po.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(eo.createElement)(Po.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M9 2H15C16.1 2 17 2.9 17 4V7C17 8.1 16.1 9 15 9H9C7.9 9 7 8.1 7 7V4C7 2.9 7.9 2 9 2ZM9 7H15V4H9V7Z"}),Object(eo.createElement)(Po.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5 11H11C12.1 11 13 11.9 13 13V16C13 17.1 12.1 18 11 18H5C3.9 18 3 17.1 3 16V13C3 11.9 3.9 11 5 11ZM5 16H11V13H5V16Z"})),Kc=Object(eo.createElement)(Po.Icon,{icon:zc});var Gc=Object(bo.compose)([Object(h.withSelect)((function(e,t){var n=t.clientIds,r=e("core/block-editor"),o=r.getBlockRootClientId,i=r.getBlocksByClientId,c=r.canInsertBlockType,a=(0,e("core/blocks").getGroupingBlockName)(),s=c(a,n&&n.length>0?o(n[0]):void 0),u=i(n),l=1===u.length&&u[0]&&u[0].name===a;return{isGroupable:s&&u.length&&!l,isUngroupable:l&&!!u[0].innerBlocks.length,blocksSelection:u,groupingBlockName:a}})),Object(h.withDispatch)((function(e,t){var n=t.clientIds,r=t.onToggle,o=void 0===r?y.noop:r,i=t.blocksSelection,c=void 0===i?[]:i,a=t.groupingBlockName,s=e("core/block-editor").replaceBlocks;return{onConvertToGroup:function(){if(c.length){var e=Object(l.switchToBlockType)(c,a);e&&s(n,e),o()}},onConvertFromGroup:function(){if(c.length){var e=c[0].innerBlocks;e.length&&(s(n,e),o())}}}}))])((function(e){var t=e.onConvertToGroup,n=e.onConvertFromGroup,r=e.isGroupable,o=void 0!==r&&r,i=e.isUngroupable,c=void 0!==i&&i;return Object(eo.createElement)(eo.Fragment,null,o&&Object(eo.createElement)(Po.MenuItem,{className:"editor-block-settings-menu__control block-editor-block-settings-menu__control",icon:Wc,onClick:t},Object(L._x)("Group","verb")),c&&Object(eo.createElement)(Po.MenuItem,{className:"editor-block-settings-menu__control block-editor-block-settings-menu__control",icon:Kc,onClick:n},Object(L._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor ")))}));var qc=Object(h.withSelect)((function(e){return{clientIds:(0,e("core/block-editor").getSelectedBlockClientIds)()}}))((function(e){var t=e.clientIds;return Object(eo.createElement)(u.__experimentalBlockSettingsMenuPluginsExtension,null,(function(e){var n=e.onClose;return Object(eo.createElement)(eo.Fragment,null,Object(eo.createElement)(Gc,{clientIds:t,onToggle:n}))}))})),Yc=Object(h.combineReducers)({downloadableBlocks:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{results:{},hasPermission:!0,filterValue:void 0,isRequestingDownloadableBlocks:!0,installedBlockTypes:[]},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"FETCH_DOWNLOADABLE_BLOCKS":return Object(f.a)({},e,{isRequestingDownloadableBlocks:!0});case"RECEIVE_DOWNLOADABLE_BLOCKS":return Object(f.a)({},e,{results:Object.assign({},e.results,Object(v.a)({},t.filterValue,t.downloadableBlocks)),hasPermission:!0,isRequestingDownloadableBlocks:!1});case"SET_INSTALL_BLOCKS_PERMISSION":return Object(f.a)({},e,{items:t.hasPermission?e.items:[],hasPermission:t.hasPermission});case"ADD_INSTALLED_BLOCK_TYPE":return Object(f.a)({},e,{installedBlockTypes:[].concat(Object(N.a)(e.installedBlockTypes),[t.item])});case"REMOVE_INSTALLED_BLOCK_TYPE":return Object(f.a)({},e,{installedBlockTypes:e.installedBlockTypes.filter((function(e){return e.name!==t.item.name}))})}return e}});function Qc(e){return e.downloadableBlocks.isRequestingDownloadableBlocks}function Xc(e,t){return e.downloadableBlocks.results[t]?e.downloadableBlocks.results[t]:[]}function $c(e){return e.downloadableBlocks.hasPermission}function Zc(e){return Object(y.get)(e,["downloadableBlocks","installedBlockTypes"],[])}var Jc=x.a.mark(ra);function ea(e){return{type:"API_FETCH",request:e}}var ta=function(e,t,n){if(e){var r=document.querySelector('script[src="'.concat(e.src,'"]'));r&&r.parentNode.removeChild(r);var o=document.createElement("script");o.src="string"==typeof e?e:e.src,o.onload=t,o.onerror=n,document.body.appendChild(o)}},na=function(e){if(e){var t=document.createElement("link");t.rel="stylesheet",t.href="string"==typeof e?e:e.src,document.body.appendChild(t)}};function ra(e){return x.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{type:"LOAD_ASSETS",assets:e});case 1:case"end":return t.stop()}}),Jc)}var oa={SELECT:Object(h.createRegistryControl)((function(e){return function(t){var n,r=t.storeName,o=t.selectorName,i=t.args;return(n=e.select(r))[o].apply(n,Object(N.a)(i))}})),DISPATCH:Object(h.createRegistryControl)((function(e){return function(t){var n,r=t.storeName,o=t.dispatcherName,i=t.args;return(n=e.dispatch(r))[o].apply(n,Object(N.a)(i))}})),API_FETCH:function(e){var t=e.request;return A()(Object(f.a)({},t))},LOAD_ASSETS:function(e){var t=e.assets;return new Promise((function(e,n){if(Array.isArray(t)){var r=0;Object(y.forEach)(t,(function(t){null!==t.match(/\.js$/)?(r++,ta(t,(function(){if(0===--r)return e(r)}),n)):na(t)}))}else ta(t.editor_script,(function(){return e(0)}),n),na(t.style)}))}},ia=x.a.mark(da),ca=x.a.mark(pa),aa=x.a.mark(ba);function sa(){return{type:"FETCH_DOWNLOADABLE_BLOCKS"}}function ua(e,t){return{type:"RECEIVE_DOWNLOADABLE_BLOCKS",downloadableBlocks:e,filterValue:t}}function la(e){return{type:"SET_INSTALL_BLOCKS_PERMISSION",hasPermission:e}}function da(e,t,n){return x.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,e.assets.length){r.next=3;break}throw new Error("Block has no assets");case 3:return r.next=5,ra(e.assets);case 5:if(!Object(l.getBlockTypes)().length){r.next=10;break}t(e),r.next=11;break;case 10:throw new Error("Unable to get block types");case 11:r.next=17;break;case 13:return r.prev=13,r.t0=r.catch(0),r.next=17,n(r.t0);case 17:case"end":return r.stop()}}),ia,null,[[0,13]])}function pa(e,t,n){var r,o,i;return x.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return r=e.id,o=e.name,c.prev=1,c.next=4,ea({path:"__experimental/block-directory/install",data:{slug:r},method:"POST"});case 4:if(!1!==(i=c.sent).success){c.next=7;break}throw new Error(i.errorMessage);case 7:return c.next=9,fa({id:r,name:o});case 9:t(),c.next=15;break;case 12:c.prev=12,c.t0=c.catch(1),n(c.t0);case 15:case"end":return c.stop()}}),ca,null,[[1,12]])}function ba(e,t,n){var r,o,i;return x.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return r=e.id,o=e.name,c.prev=1,c.next=4,ea({path:"__experimental/block-directory/uninstall",data:{slug:r},method:"DELETE"});case 4:if(!1!==(i=c.sent).success){c.next=7;break}throw new Error(i.errorMessage);case 7:return c.next=9,ha({id:r,name:o});case 9:t(),c.next=15;break;case 12:c.prev=12,c.t0=c.catch(1),n(c.t0);case 15:case"end":return c.stop()}}),aa,null,[[1,12]])}function fa(e){return{type:"ADD_INSTALLED_BLOCK_TYPE",item:e}}function ha(e){return{type:"REMOVE_INSTALLED_BLOCK_TYPE",item:e}}var ma={reducer:Yc,selectors:a,actions:s,controls:oa,resolvers:{getDownloadableBlocks:x.a.mark((function e(t){var n,r;return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,{type:"FETCH_DOWNLOADABLE_BLOCKS"};case 5:return e.next=7,ea({path:"__experimental/block-directory/search?term=".concat(t)});case 7:return n=e.sent,r=n.map((function(e){return Object(y.mapKeys)(e,(function(e,t){return Object(y.camelCase)(t)}))})),e.next=11,ua(r,t);case 11:e.next=18;break;case 13:if(e.prev=13,e.t0=e.catch(2),"rest_user_cannot_view"!==e.t0.code){e.next=18;break}return e.next=18,la(!1);case 18:case"end":return e.stop()}}),e,null,[[2,13]])})),hasInstallBlocksPermission:x.a.mark((function e(){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ea({path:"__experimental/block-directory/search?term="});case 3:return e.next=5,la(!0);case 5:e.next=12;break;case 7:if(e.prev=7,e.t0=e.catch(0),"rest_user_cannot_view"!==e.t0.code){e.next=12;break}return e.next=12,la(!1);case 12:case"end":return e.stop()}}),e,null,[[0,7]])}))}};Object(h.registerStore)("core/block-directory",ma);var va=function(e){var t=e.rating,n=.5*Math.round(t/.5),r=Math.floor(t),o=Math.ceil(t-r),i=5-(r+o);return Object(eo.createElement)("div",{"aria-label":Object(L.sprintf)(Object(L.__)("%s out of 5 stars"),n)},Object(y.times)(r,(function(e){return Object(eo.createElement)(Po.Icon,{key:"full_stars_".concat(e),icon:"star-filled",size:16})})),Object(y.times)(o,(function(e){return Object(eo.createElement)(Po.Icon,{key:"half_stars_".concat(e),icon:"star-half",size:16})})),Object(y.times)(i,(function(e){return Object(eo.createElement)(Po.Icon,{key:"empty_stars_".concat(e),icon:"star-empty",size:16})})))},Oa=function(e){var t=e.rating,n=e.ratingCount;return Object(eo.createElement)("div",{className:"block-directory-block-ratings"},Object(eo.createElement)(va,{rating:t}),Object(eo.createElement)("span",{className:"block-directory-block-ratings__rating-count","aria-label":Object(L.sprintf)(Object(L._n)("%d total rating","%d total ratings",n),n)},"(",n,")"))};var ga=function(e){var t=e.icon,n=e.title,r=e.rating,o=e.ratingCount,i=e.onClick;return Object(eo.createElement)("div",{className:"block-directory-downloadable-block-header__row"},null!==t.match(/\.(jpeg|jpg|gif|png)$/)?Object(eo.createElement)("img",{src:t,alt:"block icon"}):Object(eo.createElement)("span",null,Object(eo.createElement)(u.BlockIcon,{icon:t,showColors:!0})),Object(eo.createElement)("div",{className:"block-directory-downloadable-block-header__column"},Object(eo.createElement)("span",{role:"heading",className:"block-directory-downloadable-block-header__title"},n),Object(eo.createElement)(Oa,{rating:r,ratingCount:o})),Object(eo.createElement)(Po.Button,{isDefault:!0,onClick:function(e){e.preventDefault(),i()}},Object(L.__)("Add")))};var ja=function(e){var t=e.author,n=e.authorBlockCount,r=e.authorBlockRating;return Object(eo.createElement)(eo.Fragment,null,Object(eo.createElement)("span",{className:"block-directory-downloadable-block-author-info__content-author"},Object(L.sprintf)(Object(L.__)("Authored by %s"),t)),Object(eo.createElement)("span",{className:"block-directory-downloadable-block-author-info__content"},Object(L.sprintf)(Object(L._n)("This author has %d block, with an average rating of %d.","This author has %d blocks, with an average rating of %d.",n),n,r)))};var ya=function(e){var t=e.description,n=e.activeInstalls,r=e.humanizedUpdated;return Object(eo.createElement)(eo.Fragment,null,Object(eo.createElement)("p",{className:"block-directory-downloadable-block-info__content"},t),Object(eo.createElement)("div",{className:"block-directory-downloadable-block-info__row"},Object(eo.createElement)("div",{className:"block-directory-downloadable-block-info__column"},Object(eo.createElement)(Po.Icon,{icon:"chart-line"}),Object(L.sprintf)(Object(L._n)("%d active installation","%d active installations",n),n)),Object(eo.createElement)("div",{className:"block-directory-downloadable-block-info__column"},Object(eo.createElement)(Po.Icon,{icon:"update"}),Object(eo.createElement)("span",{"aria-label":Object(L.sprintf)(Object(L.__)("Updated %s"),r)},r))))};var _a=function(e){var t=e.item,n=e.onClick,r=t.icon,o=t.title,i=t.description,c=t.rating,a=t.activeInstalls,s=t.ratingCount,u=t.author,l=t.humanizedUpdated,d=t.authorBlockCount,p=t.authorBlockRating;return Object(eo.createElement)("li",{className:"block-directory-downloadable-block-list-item"},Object(eo.createElement)("article",{className:"block-directory-downloadable-block-list-item__panel"},Object(eo.createElement)("header",{className:"block-directory-downloadable-block-list-item__header"},Object(eo.createElement)(ga,{icon:r,onClick:n,title:o,rating:c,ratingCount:s})),Object(eo.createElement)("section",{className:"block-directory-downloadable-block-list-item__body"},Object(eo.createElement)(ya,{activeInstalls:a,description:i,humanizedUpdated:l})),Object(eo.createElement)("footer",{className:"block-directory-downloadable-block-list-item__footer"},Object(eo.createElement)(ja,{author:u,authorBlockCount:d,authorBlockRating:p}))))};var ka=Object(bo.compose)(Object(h.withDispatch)((function(e,t){var n=e("core/block-directory"),r=n.installBlock,o=n.downloadBlock,i=e("core/notices"),c=i.createErrorNotice,a=i.removeNotice,s=e("core/block-editor").removeBlocks,u=t.onSelect;return{downloadAndInstallBlock:function(e){var t=function(){var t=u(e);r(e,y.noop,(function n(){c(Object(L.__)("Block previews can't install."),{id:"block-install-error",actions:[{label:Object(L.__)("Retry"),onClick:function(){a("block-install-error"),r(e,y.noop,n)}},{label:Object(L.__)("Remove"),onClick:function(){a("block-install-error"),s(t.clientId),Object(l.unregisterBlockType)(e.name)}}]})}))};o(e,t,(function n(){c(Object(L.__)("Block previews can’t load."),{id:"block-download-error",actions:[{label:Object(L.__)("Retry"),onClick:function(){a("block-download-error"),o(e,t,n)}}]})}))}}})))((function(e){var t=e.items,n=e.onHover,r=void 0===n?y.noop:n,o=e.children,i=e.downloadAndInstallBlock;return(Object(eo.createElement)("ul",{role:"list",className:"block-directory-downloadable-blocks-list"},t&&t.map((function(e){return Object(eo.createElement)(_a,{key:e.id,className:Object(l.getBlockMenuDefaultClassName)(e.id),icons:e.icons,onClick:function(){i(e),r(null)},onFocus:function(){return r(e)},onMouseEnter:function(){return r(e)},onMouseLeave:function(){return r(null)},onBlur:function(){return r(null)},item:e})})),o))}));var Ea=Object(bo.compose)([Po.withSpokenMessages,Object(h.withSelect)((function(e,t){var n=t.filterValue,r=e("core/block-directory"),o=r.getDownloadableBlocks,i=r.hasInstallBlocksPermission,c=r.isRequestingDownloadableBlocks,a=i();return{downloadableItems:a?o(n):[],hasPermission:a,isLoading:c()}}))])((function(e){var t=e.downloadableItems,n=e.onSelect,r=e.onHover,o=e.hasPermission,i=e.isLoading,c=e.isWaiting,a=e.debouncedSpeak;return o?i||c?Object(eo.createElement)("p",{className:"block-directory-downloadable-blocks-panel__description has-no-results"},Object(eo.createElement)(Po.Spinner,null)):t.length?(a(Object(L.sprintf)(Object(L._n)("No blocks found in your library. We did find %d block available for download.","No blocks found in your library. We did find %d blocks available for download.",t.length),t.length)),Object(eo.createElement)(eo.Fragment,null,Object(eo.createElement)("p",{className:"block-directory-downloadable-blocks-panel__description"},Object(L.__)("No blocks found in your library. These blocks can be downloaded and installed:")),Object(eo.createElement)(ka,{items:t,onSelect:n,onHover:r}))):Object(eo.createElement)("p",{className:"block-directory-downloadable-blocks-panel__description has-no-results"},Object(L.__)("No blocks found in your library.")):(a(Object(L.__)("No blocks found in your library. Please contact your site administrator to install new blocks.")),Object(eo.createElement)("p",{className:"block-directory-downloadable-blocks-panel__description has-no-results"},Object(L.__)("No blocks found in your library."),Object(eo.createElement)("br",null),Object(L.__)("Please contact your site administrator to install new blocks.")))}));var wa=function(){var e=Object(eo.useState)(""),t=Object(R.a)(e,2),n=t[0],r=t[1],o=Object(y.debounce)(r,400);return Object(eo.createElement)(u.__experimentalInserterMenuExtension,null,(function(e){var t=e.onSelect,r=e.onHover,i=e.filterValue;return e.hasItems||!i?null:(n!==i&&o(i),Object(eo.createElement)(Ea,{onSelect:t,onHover:r,filterValue:n,isWaiting:i!==n}))}))},Sa=function(){var e=Object(B.a)(x.a.mark((function e(t){var n;return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,A()({path:Object(Ft.addQueryArgs)("/wp/v2/search",{search:t,per_page:20,type:"post"})});case 2:return n=e.sent,e.abrupt("return",Object(y.map)(n,(function(e){return{id:e.id,url:e.url,title:Object(ei.decodeEntities)(e.title)||Object(L.__)("(no title)")}})));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Pa=function(e){function t(e){var n;return Object(ao.a)(this,t),(n=Object(uo.a)(this,Object(lo.a)(t).apply(this,arguments))).getBlockEditorSettings=Z()(n.getBlockEditorSettings,{maxSize:1}),e.recovery?Object(uo.a)(n):(e.updatePostLock(e.settings.postLock),e.setupEditor(e.post,e.initialEdits,e.settings.template),e.settings.autosave&&e.createWarningNotice(Object(L.__)("There is an autosave of this post that is more recent than the version below."),{id:"autosave-exists",actions:[{label:Object(L.__)("View the autosave"),url:e.settings.autosave.editLink}]}),n)}return Object(po.a)(t,e),Object(so.a)(t,[{key:"getBlockEditorSettings",value:function(e,t,n,r){return Object(f.a)({},Object(y.pick)(e,["alignWide","allowedBlockTypes","__experimentalPreferredStyleVariations","availableLegacyWidgets","bodyPlaceholder","codeEditingEnabled","colors","disableCustomColors","disableCustomFontSizes","focusMode","fontSizes","hasFixedToolbar","hasPermissionsToManageWidgets","imageSizes","isRTL","maxWidth","styles","template","templateLock","titlePlaceholder","onUpdateDefaultBlockStyles","__experimentalEnableLegacyWidgetBlock","__experimentalEnableMenuBlock","__experimentalBlockDirectory","showInserterHelpPanel"]),{__experimentalReusableBlocks:t,__experimentalMediaUpload:n?Uc:void 0,__experimentalFetchLinkSuggestions:Sa,__experimentalCanUserUseUnfilteredHTML:r})}},{key:"componentDidMount",value:function(){if(this.props.updateEditorSettings(this.props.settings),this.props.settings.styles){var e=Object(u.transformStyles)(this.props.settings.styles,".editor-styles-wrapper");Object(y.map)(e,(function(e){if(e){var t=document.createElement("style");t.innerHTML=e,document.body.appendChild(t)}}))}}},{key:"componentDidUpdate",value:function(e){var t=this;this.props.settings!==e.settings&&this.props.updateEditorSettings(this.props.settings),Object(y.isEqual)(this.props.downloadableBlocksToUninstall,e.downloadableBlocksToUninstall)||this.props.downloadableBlocksToUninstall.forEach((function(e){t.props.uninstallBlock(e,y.noop,(function(){t.props.createWarningNotice(Object(L.__)("Block previews can't uninstall."),{id:"block-uninstall-error"})})),Object(l.unregisterBlockType)(e.name)}))}},{key:"componentWillUnmount",value:function(){this.props.tearDownEditor()}},{key:"render",value:function(){var e=this.props,t=e.canUserUseUnfilteredHTML,n=e.children,r=e.blocks,o=e.resetEditorBlocks,i=e.isReady,c=e.settings,a=e.reusableBlocks,s=e.resetEditorBlocksWithoutUndoLevel,l=e.hasUploadPermissions;if(!i)return null;var d=this.getBlockEditorSettings(c,a,l,t);return Object(eo.createElement)(u.BlockEditorProvider,{value:r,onInput:s,onChange:o,settings:d,useSubRegistry:!1},n,Object(eo.createElement)(Vc,null),Object(eo.createElement)(qc,null),d.__experimentalBlockDirectory&&Object(eo.createElement)(wa,null))}}]),t}(eo.Component),Ca=Object(bo.compose)([Nc,Object(h.withSelect)((function(e){var t=e("core/editor"),n=t.canUserUseUnfilteredHTML,r=t.__unstableIsEditorReady,o=t.getEditorBlocks,i=t.__experimentalGetReusableBlocks,c=e("core").canUser,a=e("core/block-directory").getInstalledBlockTypes,s=e("core/block-editor").getBlocks,u=Object(y.differenceBy)(a(),s(),"name");return{canUserUseUnfilteredHTML:n(),isReady:r(),blocks:o(),reusableBlocks:i(),hasUploadPermissions:Object(y.defaultTo)(c("create","media"),!0),downloadableBlocksToUninstall:u}})),Object(h.withDispatch)((function(e){var t=e("core/editor"),n=t.setupEditor,r=t.updatePostLock,o=t.resetEditorBlocks,i=t.updateEditorSettings,c=t.__experimentalTearDownEditor,a=e("core/notices").createWarningNotice,s=e("core/block-directory").uninstallBlock;return{setupEditor:n,updatePostLock:r,createWarningNotice:a,resetEditorBlocks:o,updateEditorSettings:i,resetEditorBlocksWithoutUndoLevel:function(e){o(e,{__unstableShouldCreateUndoLevel:!1})},tearDownEditor:c,uninstallBlock:s}}))])(Pa),Ta=n(58),xa=n.n(Ta);function Ba(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=Object(eo.forwardRef)((function(n,r){return U()("wp.editor."+e,{alternative:"wp.blockEditor."+e}),Object(eo.createElement)(t,Object(ci.a)({ref:r},n))}));return n.forEach((function(n){r[n]=Ba(e+"."+n,t[n])})),r}function Ia(e,t){return function(){return U()("wp.editor."+e,{alternative:"wp.blockEditor."+e}),t.apply(void 0,arguments)}}var Aa=Ba("RichText",u.RichText,["Content"]);Aa.isEmpty=Ia("RichText.isEmpty",u.RichText.isEmpty);var La=Ba("Autocomplete",u.Autocomplete),Ra=Ba("AlignmentToolbar",u.AlignmentToolbar),Na=Ba("BlockAlignmentToolbar",u.BlockAlignmentToolbar),Da=Ba("BlockControls",u.BlockControls,["Slot"]),Ua=Ba("BlockEdit",u.BlockEdit),Fa=Ba("BlockEditorKeyboardShortcuts",u.BlockEditorKeyboardShortcuts),Ma=Ba("BlockFormatControls",u.BlockFormatControls,["Slot"]),Va=Ba("BlockIcon",u.BlockIcon),Ha=Ba("BlockInspector",u.BlockInspector),Wa=Ba("BlockList",u.BlockList),za=Ba("BlockMover",u.BlockMover),Ka=Ba("BlockNavigationDropdown",u.BlockNavigationDropdown),Ga=Ba("BlockSelectionClearer",u.BlockSelectionClearer),qa=Ba("BlockSettingsMenu",u.BlockSettingsMenu),Ya=Ba("BlockTitle",u.BlockTitle),Qa=Ba("BlockToolbar",u.BlockToolbar),Xa=Ba("ColorPalette",u.ColorPalette),$a=Ba("ContrastChecker",u.ContrastChecker),Za=Ba("CopyHandler",u.CopyHandler),Ja=Ba("DefaultBlockAppender",u.DefaultBlockAppender),es=Ba("FontSizePicker",u.FontSizePicker),ts=Ba("Inserter",u.Inserter),ns=Ba("InnerBlocks",u.InnerBlocks,["ButtonBlockAppender","DefaultBlockAppender","Content"]),rs=Ba("InspectorAdvancedControls",u.InspectorAdvancedControls,["Slot"]),os=Ba("InspectorControls",u.InspectorControls,["Slot"]),is=Ba("PanelColorSettings",u.PanelColorSettings),cs=Ba("PlainText",u.PlainText),as=Ba("RichTextShortcut",u.RichTextShortcut),ss=Ba("RichTextToolbarButton",u.RichTextToolbarButton),us=Ba("__unstableRichTextInputEvent",u.__unstableRichTextInputEvent),ls=Ba("MediaPlaceholder",u.MediaPlaceholder),ds=Ba("MediaUpload",u.MediaUpload),ps=Ba("MediaUploadCheck",u.MediaUploadCheck),bs=Ba("MultiBlocksSwitcher",u.MultiBlocksSwitcher),fs=Ba("MultiSelectScrollIntoView",u.MultiSelectScrollIntoView),hs=Ba("NavigableToolbar",u.NavigableToolbar),ms=Ba("ObserveTyping",u.ObserveTyping),vs=Ba("PreserveScrollInReorder",u.PreserveScrollInReorder),Os=Ba("SkipToSelectedBlock",u.SkipToSelectedBlock),gs=Ba("URLInput",u.URLInput),js=Ba("URLInputButton",u.URLInputButton),ys=Ba("URLPopover",u.URLPopover),_s=Ba("Warning",u.Warning),ks=Ba("WritingFlow",u.WritingFlow),Es=Ia("createCustomColorsHOC",u.createCustomColorsHOC),ws=Ia("getColorClassName",u.getColorClassName),Ss=Ia("getColorObjectByAttributeValues",u.getColorObjectByAttributeValues),Ps=Ia("getColorObjectByColorValue",u.getColorObjectByColorValue),Cs=Ia("getFontSize",u.getFontSize),Ts=Ia("getFontSizeClass",u.getFontSizeClass),xs=Ia("withColorContext",u.withColorContext),Bs=Ia("withColors",u.withColors),Is=Ia("withFontSizes",u.withFontSizes);Object(Jr.addFilter)("editor.Autocomplete.completers","editor/autocompleters/set-default-completers",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return e.push(Object(y.clone)(co)),t===Object(l.getDefaultBlockName)()&&e.push(Object(y.clone)(io)),e})),n.d(t,"AutosaveMonitor",(function(){return ho})),n.d(t,"DocumentOutline",(function(){return Eo})),n.d(t,"DocumentOutlineCheck",(function(){return wo})),n.d(t,"VisualEditorGlobalKeyboardShortcuts",(function(){return Io})),n.d(t,"EditorGlobalKeyboardShortcuts",(function(){return Ao})),n.d(t,"TextEditorGlobalKeyboardShortcuts",(function(){return Lo})),n.d(t,"EditorHistoryRedo",(function(){return Ro})),n.d(t,"EditorHistoryUndo",(function(){return No})),n.d(t,"EditorNotices",(function(){return Fo})),n.d(t,"ErrorBoundary",(function(){return Mo})),n.d(t,"LocalAutosaveMonitor",(function(){return zo})),n.d(t,"PageAttributesCheck",(function(){return Ko})),n.d(t,"PageAttributesOrder",(function(){return Yo})),n.d(t,"PageAttributesParent",(function(){return Zo})),n.d(t,"PageTemplate",(function(){return Jo})),n.d(t,"PostAuthor",(function(){return ri})),n.d(t,"PostAuthorCheck",(function(){return ti})),n.d(t,"PostComments",(function(){return oi})),n.d(t,"PostExcerpt",(function(){return ii})),n.d(t,"PostExcerptCheck",(function(){return ai})),n.d(t,"PostFeaturedImage",(function(){return mi})),n.d(t,"PostFeaturedImageCheck",(function(){return ui})),n.d(t,"PostFormat",(function(){return gi})),n.d(t,"PostFormatCheck",(function(){return vi})),n.d(t,"PostLastRevision",(function(){return ki})),n.d(t,"PostLastRevisionCheck",(function(){return ji})),n.d(t,"PostLockedModal",(function(){return Pi})),n.d(t,"PostPendingStatus",(function(){return Ti})),n.d(t,"PostPendingStatusCheck",(function(){return Ci})),n.d(t,"PostPingbacks",(function(){return xi})),n.d(t,"PostPreviewButton",(function(){return wi})),n.d(t,"PostPublishButton",(function(){return Ai})),n.d(t,"PostPublishButtonLabel",(function(){return Bi})),n.d(t,"PostPublishPanel",(function(){return nc})),n.d(t,"PostSavedState",(function(){return ic})),n.d(t,"PostSchedule",(function(){return Ui})),n.d(t,"PostScheduleCheck",(function(){return cc})),n.d(t,"PostScheduleLabel",(function(){return Fi})),n.d(t,"PostSticky",(function(){return sc})),n.d(t,"PostStickyCheck",(function(){return ac})),n.d(t,"PostSwitchToDraftButton",(function(){return rc})),n.d(t,"PostTaxonomies",(function(){return pc})),n.d(t,"PostTaxonomiesCheck",(function(){return bc})),n.d(t,"PostTextEditor",(function(){return vc})),n.d(t,"PostTitle",(function(){return Sc})),n.d(t,"PostTrash",(function(){return Pc})),n.d(t,"PostTrashCheck",(function(){return Cc})),n.d(t,"PostTypeSupportCheck",(function(){return Go})),n.d(t,"PostVisibility",(function(){return Ni})),n.d(t,"PostVisibilityLabel",(function(){return Di})),n.d(t,"PostVisibilityCheck",(function(){return Tc})),n.d(t,"TableOfContents",(function(){return Ac})),n.d(t,"UnsavedChangesWarning",(function(){return Rc})),n.d(t,"WordCount",(function(){return Bc})),n.d(t,"EditorProvider",(function(){return Ca})),n.d(t,"blockAutocompleter",(function(){return io})),n.d(t,"userAutocompleter",(function(){return co})),n.d(t,"ServerSideRender",(function(){return xa.a})),n.d(t,"RichText",(function(){return Aa})),n.d(t,"Autocomplete",(function(){return La})),n.d(t,"AlignmentToolbar",(function(){return Ra})),n.d(t,"BlockAlignmentToolbar",(function(){return Na})),n.d(t,"BlockControls",(function(){return Da})),n.d(t,"BlockEdit",(function(){return Ua})),n.d(t,"BlockEditorKeyboardShortcuts",(function(){return Fa})),n.d(t,"BlockFormatControls",(function(){return Ma})),n.d(t,"BlockIcon",(function(){return Va})),n.d(t,"BlockInspector",(function(){return Ha})),n.d(t,"BlockList",(function(){return Wa})),n.d(t,"BlockMover",(function(){return za})),n.d(t,"BlockNavigationDropdown",(function(){return Ka})),n.d(t,"BlockSelectionClearer",(function(){return Ga})),n.d(t,"BlockSettingsMenu",(function(){return qa})),n.d(t,"BlockTitle",(function(){return Ya})),n.d(t,"BlockToolbar",(function(){return Qa})),n.d(t,"ColorPalette",(function(){return Xa})),n.d(t,"ContrastChecker",(function(){return $a})),n.d(t,"CopyHandler",(function(){return Za})),n.d(t,"DefaultBlockAppender",(function(){return Ja})),n.d(t,"FontSizePicker",(function(){return es})),n.d(t,"Inserter",(function(){return ts})),n.d(t,"InnerBlocks",(function(){return ns})),n.d(t,"InspectorAdvancedControls",(function(){return rs})),n.d(t,"InspectorControls",(function(){return os})),n.d(t,"PanelColorSettings",(function(){return is})),n.d(t,"PlainText",(function(){return cs})),n.d(t,"RichTextShortcut",(function(){return as})),n.d(t,"RichTextToolbarButton",(function(){return ss})),n.d(t,"__unstableRichTextInputEvent",(function(){return us})),n.d(t,"MediaPlaceholder",(function(){return ls})),n.d(t,"MediaUpload",(function(){return ds})),n.d(t,"MediaUploadCheck",(function(){return ps})),n.d(t,"MultiBlocksSwitcher",(function(){return bs})),n.d(t,"MultiSelectScrollIntoView",(function(){return fs})),n.d(t,"NavigableToolbar",(function(){return hs})),n.d(t,"ObserveTyping",(function(){return ms})),n.d(t,"PreserveScrollInReorder",(function(){return vs})),n.d(t,"SkipToSelectedBlock",(function(){return Os})),n.d(t,"URLInput",(function(){return gs})),n.d(t,"URLInputButton",(function(){return js})),n.d(t,"URLPopover",(function(){return ys})),n.d(t,"Warning",(function(){return _s})),n.d(t,"WritingFlow",(function(){return ks})),n.d(t,"createCustomColorsHOC",(function(){return Es})),n.d(t,"getColorClassName",(function(){return ws})),n.d(t,"getColorObjectByAttributeValues",(function(){return Ss})),n.d(t,"getColorObjectByColorValue",(function(){return Ps})),n.d(t,"getFontSize",(function(){return Cs})),n.d(t,"getFontSizeClass",(function(){return Ts})),n.d(t,"withColorContext",(function(){return xs})),n.d(t,"withColors",(function(){return Bs})),n.d(t,"withFontSizes",(function(){return Is})),n.d(t,"mediaUpload",(function(){return Uc})),n.d(t,"cleanForSlug",(function(){return _i})),n.d(t,"storeConfig",(function(){return $r})),n.d(t,"transformStyles",(function(){return u.transformStyles}))},36:function(e,t,n){"use strict";var r,o;function i(e){return[e]}function c(){var e={clear:function(){e.head=null}};return e}function a(e,t,n){var r;if(e.length!==t.length)return!1;for(r=n;r=0;--i){var c=this.tryEntries[i],a=c.completion;if("root"===c.tryLoc)return o("end");if(c.tryLoc<=this.prev){var s=r.call(c,"catchLoc"),u=r.call(c,"finallyLoc");if(s&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;S(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),f}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},5:function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},52:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},53:function(e,t){!function(){e.exports=this.wp.date}()},58:function(e,t){!function(){e.exports=this.wp.serverSideRender}()},6:function(e,t){!function(){e.exports=this.wp.blockEditor}()},61:function(e,t){!function(){e.exports=this.wp.nux}()},62:function(e,t,n){"use strict";t.__esModule=!0;var r=n(115);t.default=r.default},69:function(e,t){!function(){e.exports=this.wp.autop}()},7:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(10);function o(e){for(var t=1;t