HEX
Server: Apache
System: Linux outside 5.4.8_Algonet_ZeroMAC_0.9.4.8 #6 SMP Mon Feb 3 20:36:07 CET 2020 x86_64
User: server (1002)
PHP: 8.3.20
Disabled: exec,passthru,shell_exec,system,proc_open,popen,curl_multi_exec,parse_ini_file,show_source
Upload Files
File: /home/muoapartman/www/wp-content/plugins/gutenberg/build/edit-site/index.min.js
!function(){var e={9367:function(e,t){var n,r;void 0===(r="function"==typeof(n=function(e,t){"use strict";var n,r,a="function"==typeof Map?new Map:(n=[],r=[],{has:function(e){return n.indexOf(e)>-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))}}),l=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){l=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function o(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!a.has(e)){var t=null,n=null,r=null,o=function(){e.clientWidth!==n&&m()},i=function(t){window.removeEventListener("resize",o,!1),e.removeEventListener("input",m,!1),e.removeEventListener("keyup",m,!1),e.removeEventListener("autosize:destroy",i,!1),e.removeEventListener("autosize:update",m,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),a.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",i,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",m,!1),window.addEventListener("resize",o,!1),e.addEventListener("input",m,!1),e.addEventListener("autosize:update",m,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",a.set(e,{destroy:i,update:m}),"vertical"===(s=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===s.resize&&(e.style.resize="horizontal"),t="content-box"===s.boxSizing?-(parseFloat(s.paddingTop)+parseFloat(s.paddingBottom)):parseFloat(s.borderTopWidth)+parseFloat(s.borderBottomWidth),isNaN(t)&&(t=0),m()}var s;function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(){if(0!==e.scrollHeight){var r=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),a=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,r.forEach((function(e){e.node.scrollTop=e.scrollTop})),a&&(document.documentElement.scrollTop=a)}}function m(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),a="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(a<t?"hidden"===n.overflowY&&(c("scroll"),u(),a="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),a="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),r!==a){r=a;var o=l("autosize:resized");try{e.dispatchEvent(o)}catch(e){}}}}function i(e){var t=a.get(e);t&&t.destroy()}function s(e){var t=a.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return o(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),e}),t.default=c,e.exports=t.default})?n.apply(t,[e,t]):n)||(e.exports=r)},4184:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var l=typeof n;if("string"===l||"number"===l)e.push(n);else if(Array.isArray(n)){if(n.length){var o=a.apply(null,n);o&&e.push(o)}}else if("object"===l)if(n.toString===Object.prototype.toString)for(var i in n)r.call(n,i)&&n[i]&&e.push(i);else e.push(n.toString())}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()},1934:function(e){e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},3729:function(e,t){var n,r;void 0===(r="function"==typeof(n=function(){return function e(t,n,r){var a,l,o=window,i="application/octet-stream",s=r||i,c=t,u=!n&&!r&&c,m=document.createElement("a"),d=function(e){return String(e)},p=o.Blob||o.MozBlob||o.WebKitBlob||d,_=n||"download";if(p=p.call?p.bind(o):Blob,"true"===String(this)&&(s=(c=[c,s])[0],c=c[1]),u&&u.length<2048&&(_=u.split("/").pop().split("?")[0],m.href=u,-1!==m.href.indexOf(u))){var g=new XMLHttpRequest;return g.open("GET",u,!0),g.responseType="blob",g.onload=function(t){e(t.target.response,_,i)},setTimeout((function(){g.send()}),0),g}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(c)){if(!(c.length>2096103.424&&p!==d))return navigator.msSaveBlob?navigator.msSaveBlob(y(c),_):v(c);s=(c=y(c)).type||i}else if(/([\x80-\xff])/.test(c)){for(var h=0,f=new Uint8Array(c.length),E=f.length;h<E;++h)f[h]=c.charCodeAt(h);c=new p([f],{type:s})}function y(e){for(var t=e.split(/[:;,]/),n=t[1],r=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),a=r.length,l=0,o=new Uint8Array(a);l<a;++l)o[l]=r.charCodeAt(l);return new p([o],{type:n})}function v(e,t){if("download"in m)return m.href=e,m.setAttribute("download",_),m.className="download-js-link",m.innerHTML="downloading...",m.style.display="none",document.body.appendChild(m),setTimeout((function(){m.click(),document.body.removeChild(m),!0===t&&setTimeout((function(){o.URL.revokeObjectURL(m.href)}),250)}),66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,i)),window.open(e)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=e),!0;var n=document.createElement("iframe");document.body.appendChild(n),!t&&/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,i)),n.src=e,setTimeout((function(){document.body.removeChild(n)}),333)}if(a=c instanceof p?c:new p([c],{type:s}),navigator.msSaveBlob)return navigator.msSaveBlob(a,_);if(o.URL)v(o.URL.createObjectURL(a),!0);else{if("string"==typeof a||a.constructor===d)try{return v("data:"+s+";base64,"+o.btoa(a))}catch(e){return v("data:"+s+","+encodeURIComponent(a))}(l=new FileReader).onload=function(e){v(this.result)},l.readAsDataURL(a)}return!0}})?n.apply(t,[]):n)||(e.exports=r)},8303:function(e,t,n){var r=n(1934);e.exports=function(e){var t=r(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var a=e.style.lineHeight;e.style.lineHeight=t+"em",t=r(e,"line-height"),n=parseFloat(t,10),a?e.style.lineHeight=a:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var l=e.nodeName,o=document.createElement(l);o.innerHTML="&nbsp;","TEXTAREA"===l.toUpperCase()&&o.setAttribute("rows","1");var i=r(e,"font-size");o.style.fontSize=i,o.style.padding="0px",o.style.border="0px";var s=document.body;s.appendChild(o),n=o.offsetHeight,s.removeChild(o)}return n}},2703:function(e,t,n){"use strict";var r=n(414);function a(){}function l(){}l.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,l,o){if(o!==r){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:a};return n.PropTypes=n,n}},5697:function(e,t,n){e.exports=n(2703)()},414:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4857:function(e,t,n){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),l=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&(n[r[a]]=e[r[a]])}return n};t.__esModule=!0;var i=n(9196),s=n(5697),c=n(9367),u=n(8303),m="autosize:resized",d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return a(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,r=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||r?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(m,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(m,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),r=(t.onChange,t.style),a=(t.innerRef,t.children),s=o(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return i.createElement("textarea",l({},s,{onChange:this.onChange,style:u?l({},r,{maxHeight:u}):r,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),a)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:s.number,maxRows:s.number,onResize:s.func,innerRef:s.any,async:s.bool},t}(i.Component);t.TextareaAutosize=i.forwardRef((function(e,t){return i.createElement(d,l({},e,{innerRef:t}))}))},4042:function(e,t,n){"use strict";var r=n(4857);t.Z=r.TextareaAutosize},9196:function(e){"use strict";e.exports=window.React}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var l=t[r]={exports:{}};return e[r].call(l.exports,l,l.exports,n),l.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};!function(){"use strict";n.r(r),n.d(r,{PluginMoreMenuItem:function(){return Fl},PluginSidebar:function(){return Ol},PluginSidebarMoreMenuItem:function(){return Dl},__experimentalMainDashboardButton:function(){return va},__experimentalNavigationToggle:function(){return ka},initializeEditor:function(){return Vl},reinitializeEditor:function(){return zl}});var e={};n.r(e),n.d(e,{disableComplementaryArea:function(){return X},enableComplementaryArea:function(){return q},pinItem:function(){return Q},setFeatureDefaults:function(){return te},setFeatureValue:function(){return ee},toggleFeature:function(){return J},unpinItem:function(){return Z}});var t={};n.r(t),n.d(t,{getActiveComplementaryArea:function(){return ne},isFeatureActive:function(){return ae},isItemPinned:function(){return re}});var a={};n.r(a),n.d(a,{__experimentalSetPreviewDeviceType:function(){return Ie},addTemplate:function(){return Pe},closeGeneralSidebar:function(){return Ue},openGeneralSidebar:function(){return He},openNavigationPanelToMenu:function(){return Oe},removeTemplate:function(){return Me},revertTemplate:function(){return Ge},setHomeTemplateId:function(){return Ae},setIsInserterOpened:function(){return Fe},setIsListViewOpened:function(){return Ve},setIsNavigationPanelOpened:function(){return De},setNavigationPanelActiveMenu:function(){return Be},setPage:function(){return Le},setTemplate:function(){return Ne},setTemplatePart:function(){return Re},switchEditorMode:function(){return We},toggleFeature:function(){return Ce},updateSettings:function(){return ze}});var l={};n.r(l),n.d(l,{__experimentalGetInsertionPoint:function(){return ct},__experimentalGetPreviewDeviceType:function(){return Ke},getCanUserCreateMedia:function(){return Qe},getCurrentTemplateNavigationPanelSubMenu:function(){return ot},getCurrentTemplateTemplateParts:function(){return mt},getEditedPostId:function(){return rt},getEditedPostType:function(){return nt},getEditorMode:function(){return dt},getHomeTemplateId:function(){return et},getNavigationPanelActiveMenu:function(){return lt},getPage:function(){return at},getReusableBlocks:function(){return Ze},getSettings:function(){return Je},isFeatureActive:function(){return Xe},isInserterOpened:function(){return st},isListViewOpened:function(){return ut},isNavigationOpened:function(){return it}});var o=window.wp.element,i=window.wp.blocks,s=window.wp.blockLibrary,c=window.wp.data,u=window.wp.coreData,m=window.wp.editor,d=window.wp.viewport,p=window.wp.url,_=window.wp.hooks,g=window.wp.mediaUtils;(0,_.addFilter)("editor.MediaUpload","core/edit-site/components/media-upload",(()=>g.MediaUpload));var h=window.wp.dataControls;const f={features:{welcomeGuide:!0,welcomeGuideStyles:!0},editorMode:"visual"};var E=window.wp.i18n;const y="core/edit-site",v="uncategorized",b=["index","singular","archive","single","page","home","404","search","author","category","taxonomy","date","tag","attachment","single-post","front-page"],w=["page-home"],S=["post-","author-","single-post-","tag-"],x=["page-"],k={singular:["single","page"],index:["archive","404","search","singular","home"],home:["front-page"]},T="root",C="templates",I="templates-general",N=[{area:"header",menu:"template-parts-headers",title:(0,E.__)("headers")},{area:"footer",menu:"template-parts-footers",title:(0,E.__)("footers")},{area:"sidebar",menu:"template-parts-sidebars",title:(0,E.__)("sidebars")},{area:v,menu:"template-parts-general",title:(0,E.__)("general")}],P=(0,c.combineReducers)({features(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f.features,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"TOGGLE_FEATURE":return{...e,[t.feature]:!e[t.feature]};default:return e}},editorMode(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f.editorMode,t=arguments.length>1?arguments[1]:void 0;return"SWITCH_MODE"===t.type?t.mode:e}});var M=(0,c.combineReducers)({preferences:P,deviceType:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Desktop",t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_PREVIEW_DEVICE_TYPE":return t.deviceType}return e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_SETTINGS":return{...e,...t.settings}}return e},editedPost:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_TEMPLATE":case"SET_PAGE":return{type:"wp_template",id:t.templateId,page:t.page};case"SET_TEMPLATE_PART":return{type:"wp_template_part",id:t.templatePartId}}return e},homeTemplateId:function(e,t){switch(t.type){case"SET_HOME_TEMPLATE":return t.homeTemplateId}return e},navigationPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{menu:T,isOpen:!1},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_NAVIGATION_PANEL_ACTIVE_MENU":return{...e,menu:t.menu};case"OPEN_NAVIGATION_PANEL_TO_MENU":return{...e,isOpen:!0,menu:t.menu};case"SET_IS_NAVIGATION_PANEL_OPENED":return{...e,menu:t.isOpen?e.menu:T,isOpen:t.isOpen};case"SET_IS_LIST_VIEW_OPENED":return{...e,menu:e.isOpen&&t.isOpen?T:e.menu,isOpen:!t.isOpen&&e.isOpen};case"SET_IS_INSERTER_OPENED":return{...e,menu:e.isOpen&&t.value?T:e.menu,isOpen:!t.value&&e.isOpen}}return e},blockInserterPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_NAVIGATION_PANEL_TO_MENU":return!1;case"SET_IS_NAVIGATION_PANEL_OPENED":case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value}return e},listViewPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_NAVIGATION_PANEL_TO_MENU":return!1;case"SET_IS_NAVIGATION_PANEL_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e}}),R=window.wp.notices;function A(){return(A=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var L=n(4184),B=n.n(L),O=window.wp.components,D=window.wp.primitives,F=(0,o.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(D.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),z=(0,o.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(D.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"})),V=(0,o.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(D.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"})),G=(0,o.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(D.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})),H=window.lodash;const U=(0,c.combineReducers)({features(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("SET_FEATURE_DEFAULTS"===t.type){const{scope:n,defaults:r}=t;return{...e,[n]:{...e[n],...r}}}return e}}),W=(0,c.combineReducers)({features(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("SET_FEATURE_VALUE"===t.type){const{scope:n,featureName:r,value:a}=t;return{...e,[n]:{...e[n],[r]:a}}}return e}}),$=(0,c.combineReducers)({singleEnableItems:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,itemType:n,scope:r,item:a}=arguments.length>1?arguments[1]:void 0;return"SET_SINGLE_ENABLE_ITEM"===t&&n&&r?{...e,[n]:{...e[n],[r]:a||null}}:e},multipleEnableItems:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,itemType:n,scope:r,item:a,isEnable:l}=arguments.length>1?arguments[1]:void 0;if("SET_MULTIPLE_ENABLE_ITEM"!==t||!n||!r||!a||(0,H.get)(e,[n,r,a])===l)return e;const o=e[n]||{},i=o[r]||{};return{...e,[n]:{...o,[r]:{...i,[a]:l||!1}}}}});var j=(0,c.combineReducers)({enableItems:$,preferenceDefaults:U,preferences:W});function Y(e,t,n){return{type:"SET_SINGLE_ENABLE_ITEM",itemType:e,scope:t,item:n}}function q(e,t){return Y("complementaryArea",e,t)}function X(e){return Y("complementaryArea",e,void 0)}function K(e,t,n,r){return{type:"SET_MULTIPLE_ENABLE_ITEM",itemType:e,scope:t,item:n,isEnable:r}}function Q(e,t){return K("pinnedItems",e,t,!0)}function Z(e,t){return K("pinnedItems",e,t,!1)}function J(e,t){return function(n){let{select:r,dispatch:a}=n;const l=r.isFeatureActive(e,t);a.setFeatureValue(e,t,!l)}}function ee(e,t,n){return{type:"SET_FEATURE_VALUE",scope:e,featureName:t,value:!!n}}function te(e,t){return{type:"SET_FEATURE_DEFAULTS",scope:e,defaults:t}}function ne(e,t){return function(e,t,n){return(0,H.get)(e.enableItems.singleEnableItems,["complementaryArea",n])}(e,0,t)}function re(e,t,n){return!1!==function(e,t,n,r){return(0,H.get)(e.enableItems.multipleEnableItems,["pinnedItems",n,r])}(e,0,t,n)}function ae(e,t,n){var r,a;const l=null===(r=e.preferences.features[t])||void 0===r?void 0:r[n];return!!(void 0!==l?l:null===(a=e.preferenceDefaults.features[t])||void 0===a?void 0:a[n])}const le="core/interface",oe=(0,c.createReduxStore)(le,{reducer:j,actions:e,selectors:t,persist:["enableItems","preferences"],__experimentalUseThunks:!0});(0,c.registerStore)(le,{reducer:j,actions:e,selectors:t,persist:["enableItems","preferences"],__experimentalUseThunks:!0});var ie=window.wp.plugins,se=(0,ie.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`}))),ce=se((function(e){let{as:t=O.Button,scope:n,identifier:r,icon:a,selectedIcon:l,...i}=e;const s=t,u=(0,c.useSelect)((e=>e(oe).getActiveComplementaryArea(n)===r),[r]),{enableComplementaryArea:m,disableComplementaryArea:d}=(0,c.useDispatch)(oe);return(0,o.createElement)(s,A({icon:l&&u?l:a,onClick:()=>{u?d(n):m(n,r)}},(0,H.omit)(i,["name"])))})),ue=e=>{let{smallScreenTitle:t,children:n,className:r,toggleButtonProps:a}=e;const l=(0,o.createElement)(ce,A({icon:G},a));return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},t&&(0,o.createElement)("span",{className:"interface-complementary-area-header__small-title"},t),l),(0,o.createElement)("div",{className:B()("components-panel__header","interface-complementary-area-header",r),tabIndex:-1},n,l))};function me(e){let{name:t,as:n=O.Button,onClick:r,...a}=e;return(0,o.createElement)(O.Fill,{name:t},(e=>{let{onClick:t}=e;return(0,o.createElement)(n,A({onClick:r||t?function(){(r||H.noop)(...arguments),(t||H.noop)(...arguments)}:void 0},a))}))}me.Slot=function(e){let{name:t,as:n=O.ButtonGroup,fillProps:r={},bubblesVirtually:a,...l}=e;return(0,o.createElement)(O.Slot,{name:t,bubblesVirtually:a,fillProps:r},(e=>{if((0,H.isEmpty)(o.Children.toArray(e)))return null;const t=[];o.Children.forEach(e,(e=>{let{props:{__unstableExplicitMenuItem:n,__unstableTarget:r}}=e;r&&n&&t.push(r)}));const r=o.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&t.includes(e.props.__unstableTarget)?null:e));return(0,o.createElement)(n,l,r)}))};var de=me;const pe=e=>(0,o.createElement)(O.MenuItem,(0,H.omit)(e,["__unstableExplicitMenuItem","__unstableTarget"]));function _e(e){let{scope:t,target:n,__unstableExplicitMenuItem:r,...a}=e;return(0,o.createElement)(ce,A({as:e=>(0,o.createElement)(de,A({__unstableExplicitMenuItem:r,__unstableTarget:`${t}/${n}`,as:pe,name:`${t}/plugin-more-menu`},e)),role:"menuitemcheckbox",selectedIcon:F,name:n,scope:t},a))}function ge(e){let{scope:t,...n}=e;return(0,o.createElement)(O.Fill,A({name:`PinnedItems/${t}`},n))}ge.Slot=function(e){let{scope:t,className:n,...r}=e;return(0,o.createElement)(O.Slot,A({name:`PinnedItems/${t}`},r),(e=>!(0,H.isEmpty)(e)&&(0,o.createElement)("div",{className:B()(n,"interface-pinned-items")},e)))};var he=ge;function fe(e){let{scope:t,children:n,className:r}=e;return(0,o.createElement)(O.Fill,{name:`ComplementaryArea/${t}`},(0,o.createElement)("div",{className:r},n))}const Ee=se((function(e){let{children:t,className:n,closeLabel:r=(0,E.__)("Close plugin"),identifier:a,header:l,headerClassName:i,icon:s,isPinnable:u=!0,panelClassName:m,scope:p,name:_,smallScreenTitle:g,title:h,toggleShortcut:f,isActiveByDefault:y,showIconLabels:v=!1}=e;const{isActive:b,isPinned:w,activeArea:S,isSmall:x,isLarge:k}=(0,c.useSelect)((e=>{const{getActiveComplementaryArea:t,isItemPinned:n}=e(oe),r=t(p);return{isActive:r===a,isPinned:n(p,a),activeArea:r,isSmall:e(d.store).isViewportMatch("< medium"),isLarge:e(d.store).isViewportMatch("large")}}),[a,p]);!function(e,t,n,r,a){const l=(0,o.useRef)(!1),i=(0,o.useRef)(!1),{enableComplementaryArea:s,disableComplementaryArea:u}=(0,c.useDispatch)(oe);(0,o.useEffect)((()=>{r&&a&&!l.current?(u(e),i.current=!0):i.current&&!a&&l.current?(i.current=!1,s(e,t)):i.current&&n&&n!==t&&(i.current=!1),a!==l.current&&(l.current=a)}),[r,a,e,t,n])}(p,a,S,b,x);const{enableComplementaryArea:T,disableComplementaryArea:C,pinItem:I,unpinItem:N}=(0,c.useDispatch)(oe);return(0,o.useEffect)((()=>{y&&void 0===S&&!x&&T(p,a)}),[S,y,p,a,x]),(0,o.createElement)(o.Fragment,null,u&&(0,o.createElement)(he,{scope:p},w&&(0,o.createElement)(ce,{scope:p,identifier:a,isPressed:b&&(!v||k),"aria-expanded":b,label:h,icon:v?F:s,showTooltip:!v,variant:v?"tertiary":void 0})),_&&u&&(0,o.createElement)(_e,{target:_,scope:p,icon:s},h),b&&(0,o.createElement)(fe,{className:B()("interface-complementary-area",n),scope:p},(0,o.createElement)(ue,{className:i,closeLabel:r,onClose:()=>C(p),smallScreenTitle:g,toggleButtonProps:{label:r,shortcut:f,scope:p,identifier:a}},l||(0,o.createElement)(o.Fragment,null,(0,o.createElement)("strong",null,h),u&&(0,o.createElement)(O.Button,{className:"interface-complementary-area__pin-unpin-item",icon:w?z:V,label:w?(0,E.__)("Unpin from toolbar"):(0,E.__)("Pin to toolbar"),onClick:()=>(w?N:I)(p,a),isPressed:w,"aria-expanded":w}))),(0,o.createElement)(O.Panel,{className:m},t)))}));Ee.Slot=function(e){let{scope:t,...n}=e;return(0,o.createElement)(O.Slot,A({name:`ComplementaryArea/${t}`},n))};var ye,ve,be=Ee,we=window.wp.compose,Se=(0,o.forwardRef)((function(e,t){let{footer:n,header:r,sidebar:a,secondarySidebar:l,notices:i,content:s,drawer:c,actions:u,labels:m,className:d,shortcuts:p}=e;const _=(0,O.__unstableUseNavigateRegions)(p);!function(e){(0,o.useEffect)((()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}}),[e])}("interface-interface-skeleton__html-container");const g={
/* translators: accessibility text for the nav bar landmark region. */
drawer:(0,E.__)("Drawer"),
/* translators: accessibility text for the top bar landmark region. */
header:(0,E.__)("Header"),
/* translators: accessibility text for the content landmark region. */
body:(0,E.__)("Content"),
/* translators: accessibility text for the secondary sidebar landmark region. */
secondarySidebar:(0,E.__)("Block Library"),
/* translators: accessibility text for the settings landmark region. */
sidebar:(0,E.__)("Settings"),
/* translators: accessibility text for the publish landmark region. */
actions:(0,E.__)("Publish"),
/* translators: accessibility text for the footer landmark region. */
footer:(0,E.__)("Footer"),...m};return(0,o.createElement)("div",A({},_,{ref:(0,we.useMergeRefs)([t,_.ref]),className:B()(d,"interface-interface-skeleton",_.className,!!n&&"has-footer")}),!!c&&(0,o.createElement)("div",{className:"interface-interface-skeleton__drawer",role:"region","aria-label":g.drawer,tabIndex:"-1"},c),(0,o.createElement)("div",{className:"interface-interface-skeleton__editor"},!!r&&(0,o.createElement)("div",{className:"interface-interface-skeleton__header",role:"region","aria-label":g.header,tabIndex:"-1"},r),(0,o.createElement)("div",{className:"interface-interface-skeleton__body"},!!l&&(0,o.createElement)("div",{className:"interface-interface-skeleton__secondary-sidebar",role:"region","aria-label":g.secondarySidebar,tabIndex:"-1"},l),!!i&&(0,o.createElement)("div",{className:"interface-interface-skeleton__notices"},i),(0,o.createElement)("div",{className:"interface-interface-skeleton__content",role:"region","aria-label":g.body,tabIndex:"-1"},s),!!a&&(0,o.createElement)("div",{className:"interface-interface-skeleton__sidebar",role:"region","aria-label":g.sidebar,tabIndex:"-1"},a),!!u&&(0,o.createElement)("div",{className:"interface-interface-skeleton__actions",role:"region","aria-label":g.actions,tabIndex:"-1"},u))),!!n&&(0,o.createElement)("div",{className:"interface-interface-skeleton__footer",role:"region","aria-label":g.footer,tabIndex:"-1"},n))})),xe=window.wp.blockEditor,ke=window.wp.a11y;function Te(e){return!!e&&"custom"===(null==e?void 0:e.source)&&(null==e?void 0:e.has_theme_file)}function Ce(e){return{type:"TOGGLE_FEATURE",feature:e}}function Ie(e){return{type:"SET_PREVIEW_DEVICE_TYPE",deviceType:e}}function*Ne(e,t){const n={templateSlug:t};if(!t){const t=yield c.controls.resolveSelect(u.store,"getEntityRecord","postType","wp_template",e);n.templateSlug=null==t?void 0:t.slug}return{type:"SET_TEMPLATE",templateId:e,page:{context:n}}}function*Pe(e){const t=yield c.controls.dispatch(u.store,"saveEntityRecord","postType","wp_template",e);return e.content&&(yield c.controls.dispatch(u.store,"editEntityRecord","postType","wp_template",t.id,{blocks:(0,i.parse)(e.content)},{undoIgnore:!0})),{type:"SET_TEMPLATE",templateId:t.id,page:{context:{templateSlug:t.slug}}}}function*Me(e){try{yield c.controls.dispatch(u.store,"deleteEntityRecord","postType",e.type,e.id,{force:!0});const t=yield c.controls.select(u.store,"getLastEntityDeleteError","postType",e.type,e.id);if(t)throw t;yield c.controls.dispatch(R.store,"createSuccessNotice",(0,E.sprintf)(
/* translators: The template/part's name. */
(0,E.__)('"%s" deleted.'),e.title.rendered),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,E.__)("An error occurred while deleting the template.");yield c.controls.dispatch(R.store,"createErrorNotice",t,{type:"snackbar"})}}function Re(e){return{type:"SET_TEMPLATE_PART",templatePartId:e}}function Ae(e){return{type:"SET_HOME_TEMPLATE",homeTemplateId:e}}function*Le(e){var t;if(!e.path&&null!==(t=e.context)&&void 0!==t&&t.postId){const t=yield c.controls.resolveSelect(u.store,"getEntityRecord","postType",e.context.postType||"post",e.context.postId);e.path=(0,p.getPathAndQueryString)(null==t?void 0:t.link)}const{id:n,slug:r}=yield c.controls.resolveSelect(u.store,"__experimentalGetTemplateForLink",e.path);return yield{type:"SET_PAGE",page:r?{...e,context:{...e.context,templateSlug:r}}:e,templateId:n},n}function Be(e){return{type:"SET_NAVIGATION_PANEL_ACTIVE_MENU",menu:e}}function Oe(e){return{type:"OPEN_NAVIGATION_PANEL_TO_MENU",menu:e}}function De(e){return{type:"SET_IS_NAVIGATION_PANEL_OPENED",isOpen:e}}function Fe(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function ze(e){return{type:"UPDATE_SETTINGS",settings:e}}function Ve(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}function*Ge(e){let{allowUndo:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Te(e))try{var n;const r=yield c.controls.select(u.store,"getEntity","postType",e.type);if(!r)return void(yield c.controls.dispatch(R.store,"createErrorNotice",(0,E.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"}));const a=(0,p.addQueryArgs)(`${r.baseURL}/${e.id}`,{context:"edit",source:"theme"}),l=yield(0,h.apiFetch)({path:a});if(!l)return void(yield c.controls.dispatch(R.store,"createErrorNotice",(0,E.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"}));const o=e=>{let{blocks:t=[]}=e;return(0,i.__unstableSerializeAndClean)(t)},s=yield c.controls.select(u.store,"getEditedEntityRecord","postType",e.type,e.id);yield c.controls.dispatch(u.store,"editEntityRecord","postType",e.type,e.id,{content:o,blocks:s.blocks,source:"custom"},{undoIgnore:!0});const m=(0,i.parse)(null==l||null===(n=l.content)||void 0===n?void 0:n.raw);if(yield c.controls.dispatch(u.store,"editEntityRecord","postType",e.type,l.id,{content:o,blocks:m,source:"theme"}),t){const t=async()=>{await(0,c.dispatch)(u.store).editEntityRecord("postType",e.type,s.id,{content:o,blocks:s.blocks,source:"custom"})};yield c.controls.dispatch(R.store,"createSuccessNotice",(0,E.__)("Template reverted."),{type:"snackbar",actions:[{label:(0,E.__)("Undo"),onClick:t}]})}else yield c.controls.dispatch(R.store,"createSuccessNotice",(0,E.__)("Template reverted."))}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,E.__)("Template revert failed. Please reload.");yield c.controls.dispatch(R.store,"createErrorNotice",t,{type:"snackbar"})}else yield c.controls.dispatch(R.store,"createErrorNotice",(0,E.__)("This template is not revertable."),{type:"snackbar"})}function*He(e){yield c.controls.dispatch(oe,"enableComplementaryArea",y,e)}function*Ue(){yield c.controls.dispatch(oe,"disableComplementaryArea",y)}function*We(e){yield{type:"SWITCH_MODE",mode:e},"visual"!==e&&(yield c.controls.dispatch(xe.store.name,"clearSelectedBlock"));const t={visual:(0,E.__)("Visual editor selected"),mosaic:(0,E.__)("Mosaic view selected")};t[e]&&(0,ke.speak)(t[e],"assertive")}function $e(e){return[e]}function je(){var e={clear:function(){e.head=null}};return e}function Ye(e,t,n){var r;if(e.length!==t.length)return!1;for(r=n;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function qe(e,t,n){return!!k[e]&&("home"===e&&"posts"!==n||k[e].every((e=>t.includes(e)||qe(e,t,n))))}function Xe(e,t){return(0,H.get)(e.preferences.features,[t],!1)}function Ke(e){return e.deviceType}ye={},ve="undefined"!=typeof WeakMap;const Qe=(0,c.createRegistrySelector)((e=>()=>e(u.store).canUser("create","media"))),Ze=(0,c.createRegistrySelector)((e=>()=>"web"===o.Platform.OS?e(u.store).getEntityRecords("postType","wp_block",{per_page:-1}):[])),Je=function(e,t){var n,r;function a(){n=ve?new WeakMap:je()}function l(){var n,a,l,o,i,s=arguments.length;for(o=new Array(s),l=0;l<s;l++)o[l]=arguments[l];for(i=t.apply(null,o),(n=r(i)).isUniqueByDependants||(n.lastDependants&&!Ye(i,n.lastDependants,0)&&n.clear(),n.lastDependants=i),a=n.head;a;){if(Ye(a.args,o,1))return a!==n.head&&(a.prev.next=a.next,a.next&&(a.next.prev=a.prev),a.next=n.head,a.prev=null,n.head.prev=a,n.head=a),a.val;a=a.next}return a={val:e.apply(null,o)},o[0]=null,a.args=o,n.head&&(n.head.prev=a,a.next=n.head),n.head=a,a.val}return t||(t=$e),r=ve?function(e){var t,r,a,l,o,i=n,s=!0;for(t=0;t<e.length;t++){if(!(o=r=e[t])||"object"!=typeof o){s=!1;break}i.has(r)?i=i.get(r):(a=new WeakMap,i.set(r,a),i=a)}return i.has(ye)||((l=je()).isUniqueByDependants=s,i.set(ye,l)),i.get(ye)}:function(){return n},l.getDependants=t,l.clear=a,a(),l}(((e,t)=>{const n={...e.settings,outlineMode:!0,focusMode:Xe(e,"focusMode"),hasFixedToolbar:Xe(e,"fixedToolbar"),__experimentalSetIsInserterOpened:t,__experimentalReusableBlocks:Ze(e)};return Qe(e)?(n.mediaUpload=t=>{let{onError:n,...r}=t;(0,g.uploadMedia)({wpAllowedMimeTypes:e.settings.allowedMimeTypes,onError:e=>{let{message:t}=e;return n(t)},...r})},n):n}),(e=>[Qe(e),e.settings,Xe(e,"focusMode"),Xe(e,"fixedToolbar"),Ze(e)]));function et(e){return e.homeTemplateId}function tt(e){return e.editedPost}function nt(e){return tt(e).type}function rt(e){return tt(e).id}function at(e){return tt(e).page}function lt(e){return e.navigationPanel.menu}const ot=(0,c.createRegistrySelector)((e=>t=>{const n=nt(t),r=rt(t),a=r?e(u.store).getEntityRecord("postType",n,r):null;if(!a)return T;var l;if("wp_template_part"===n)return(null===(l=N.find((e=>e.area===(null==a?void 0:a.area))))||void 0===l?void 0:l.menu)||"template-parts";const o=e(u.store).getEntityRecords("postType","wp_template"),i=e(u.store).getEditedEntityRecord("root","site").show_on_front;return qe(a.slug,(0,H.map)(o,"slug"),i)?"templates-unused":(s=a.slug,b.includes(s)?C:w.includes(s)?I:S.some((e=>s.startsWith(e)))?"templates-posts":x.some((e=>s.startsWith(e)))?"templates-pages":I);var s}));function it(e){return e.navigationPanel.isOpen}function st(e){return!!e.blockInserterPanel}function ct(e){const{rootClientId:t,insertionIndex:n,filterValue:r}=e.blockInserterPanel;return{rootClientId:t,insertionIndex:n,filterValue:r}}function ut(e){return e.listViewPanel}const mt=(0,c.createRegistrySelector)((e=>t=>{var n;const r=nt(t),a=rt(t),l=e(u.store).getEditedEntityRecord("postType",r,a),o=e(u.store).getEntityRecords("postType","wp_template_part",{per_page:-1}),s=(0,H.keyBy)(o,(e=>e.id));return(null!==(n=l.blocks)&&void 0!==n?n:[]).filter((e=>(0,i.isTemplatePart)(e))).map((e=>{const{attributes:{theme:t,slug:n}}=e;return{templatePart:s[`${t}//${n}`],block:e}})).filter((e=>{let{templatePart:t}=e;return!!t}))}));function dt(e){return e.preferences.editorMode||"visual"}const pt={reducer:M,actions:a,selectors:l,controls:h.controls,persist:["preferences"]},_t=(0,c.createReduxStore)(y,pt);(0,c.registerStore)(y,pt);var gt,ht=gt||(gt={});ht.Pop="POP",ht.Push="PUSH",ht.Replace="REPLACE";function ft(e){e.preventDefault(),e.returnValue=""}function Et(){var e=[];return{get length(){return e.length},push:function(t){return e.push(t),function(){e=e.filter((function(e){return e!==t}))}},call:function(t){e.forEach((function(e){return e&&e(t)}))}}}const yt=function(e){function t(){var e=o.location,t=i.state||{};return[t.idx,{pathname:e.pathname,search:e.search,hash:e.hash,state:t.usr||null,key:t.key||"default"}]}function n(e){return"string"==typeof e?e:function(e){var t=e.pathname,n=e.search;return(void 0===t?"/":t)+(void 0===n?"":n)+(void 0===(e=e.hash)?"":e)}(e)}function r(e,t){return void 0===t&&(t=null),A({pathname:m.pathname,hash:"",search:""},"string"==typeof e?function(e){var t={};if(e){var n=e.indexOf("#");0<=n&&(t.hash=e.substr(n),e=e.substr(0,n)),0<=(n=e.indexOf("?"))&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}(e):e,{state:t,key:Math.random().toString(36).substr(2,8)})}function a(e){c=e,e=t(),u=e[0],m=e[1],d.call({action:c,location:m})}function l(e){i.go(e)}void 0===e&&(e={});var o=void 0===(e=e.window)?document.defaultView:e,i=o.history,s=null;o.addEventListener("popstate",(function(){if(s)p.call(s),s=null;else{var e=gt.Pop,n=t(),r=n[0];if(n=n[1],p.length){if(null!=r){var o=u-r;o&&(s={action:e,location:n,retry:function(){l(-1*o)}},l(o))}}else a(e)}}));var c=gt.Pop,u=(e=t())[0],m=e[1],d=Et(),p=Et();return null==u&&(u=0,i.replaceState(A({},i.state,{idx:u}),"")),{get action(){return c},get location(){return m},createHref:n,push:function e(t,l){var s=gt.Push,c=r(t,l);if(!p.length||(p.call({action:s,location:c,retry:function(){e(t,l)}}),0)){var m=[{usr:c.state,key:c.key,idx:u+1},n(c)];c=m[0],m=m[1];try{i.pushState(c,"",m)}catch(e){o.location.assign(m)}a(s)}},replace:function e(t,l){var o=gt.Replace,s=r(t,l);p.length&&(p.call({action:o,location:s,retry:function(){e(t,l)}}),1)||(s=[{usr:s.state,key:s.key,idx:u},n(s)],i.replaceState(s[0],"",s[1]),a(o))},go:l,back:function(){l(-1)},forward:function(){l(1)},listen:function(e){return d.push(e)},block:function(e){var t=p.push(e);return 1===p.length&&o.addEventListener("beforeunload",ft),function(){t(),p.length||o.removeEventListener("beforeunload",ft)}}}}(),vt=yt.push,bt=yt.replace;yt.push=function(e,t){return vt.call(yt,(0,p.addQueryArgs)(window.location.href,e),t)},yt.replace=function(e,t){return bt.call(yt,(0,p.addQueryArgs)(window.location.href,e),t)};var wt=yt;const St=(0,o.createContext)(),xt=(0,o.createContext)();function kt(){return(0,o.useContext)(St)}function Tt(){return(0,o.useContext)(xt)}function Ct(e){const t=new URLSearchParams(e.search);return{...e,params:Object.fromEntries(t.entries())}}function It(e){let{children:t}=e;const[n,r]=(0,o.useState)((()=>Ct(wt.location)));return(0,o.useEffect)((()=>wt.listen((e=>{let{location:t}=e;r(Ct(t))}))),[]),(0,o.createElement)(xt.Provider,{value:wt},(0,o.createElement)(St.Provider,{value:n},t(n)))}var Nt=window.wp.keyboardShortcuts,Pt=(0,o.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(D.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"})),Mt=(0,o.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(D.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"})),Rt=window.wp.keycodes,At=(0,o.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(D.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),Lt=(0,o.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(D.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"}));const Bt=[{keyCombination:{modifier:"primary",character:"b"},description:(0,E.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,E.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,E.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,E.__)("Remove a link.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,E.__)("Underline the selected text.")}];function Ot(e){let{keyCombination:t,forceAriaLabel:n}=e;const r=t.modifier?Rt.displayShortcutList[t.modifier](t.character):t.character,a=t.modifier?Rt.shortcutAriaLabel[t.modifier](t.character):t.character;return(0,o.createElement)("kbd",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":n||a},(0,H.castArray)(r).map(((e,t)=>"+"===e?(0,o.createElement)(o.Fragment,{key:t},e):(0,o.createElement)("kbd",{key:t,className:"edit-site-keyboard-shortcut-help-modal__shortcut-key"},e))))}function Dt(e){let{description:t,keyCombination:n,aliases:r=[],ariaLabel:a}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-description"},t),(0,o.createElement)("div",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-term"},(0,o.createElement)(Ot,{keyCombination:n,forceAriaLabel:a}),r.map(((e,t)=>(0,o.createElement)(Ot,{keyCombination:e,forceAriaLabel:a,key:t})))))}function Ft(e){let{name:t}=e;const{keyCombination:n,description:r,aliases:a}=(0,c.useSelect)((e=>{const{getShortcutKeyCombination:n,getShortcutDescription:r,getShortcutAliases:a}=e(Nt.store);return{keyCombination:n(t),aliases:a(t),description:r(t)}}),[t]);return n?(0,o.createElement)(Dt,{keyCombination:n,description:r,aliases:a}):null}const zt=e=>{let{shortcuts:t}=e;return(0,o.createElement)("ul",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-list",role:"list"},t.map(((e,t)=>(0,o.createElement)("li",{className:"edit-site-keyboard-shortcut-help-modal__shortcut",key:t},(0,H.isString)(e)?(0,o.createElement)(Ft,{name:e}):(0,o.createElement)(Dt,e)))))},Vt=e=>{let{title:t,shortcuts:n,className:r}=e;return(0,o.createElement)("section",{className:B()("edit-site-keyboard-shortcut-help-modal__section",r)},!!t&&(0,o.createElement)("h2",{className:"edit-site-keyboard-shortcut-help-modal__section-title"},t),(0,o.createElement)(zt,{shortcuts:n}))},Gt=e=>{let{title:t,categoryName:n,additionalShortcuts:r=[]}=e;const a=(0,c.useSelect)((e=>e(Nt.store).getCategoryShortcuts(n)),[n]);return(0,o.createElement)(Vt,{title:t,shortcuts:a.concat(r)})};function Ht(e){let{isModalActive:t,toggleModal:n}=e;return t?(0,o.createElement)(O.Modal,{className:"edit-site-keyboard-shortcut-help-modal",title:(0,E.__)("Keyboard shortcuts"),closeLabel:(0,E.__)("Close"),onRequestClose:n},(0,o.createElement)(Vt,{className:"edit-site-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-site/keyboard-shortcuts"]}),(0,o.createElement)(Gt,{title:(0,E.__)("Global shortcuts"),categoryName:"global"}),(0,o.createElement)(Gt,{title:(0,E.__)("Selection shortcuts"),categoryName:"selection"}),(0,o.createElement)(Gt,{title:(0,E.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,E.__)("Change the block type after adding a new paragraph."),
/* translators: The forward-slash character. e.g. '/'. */
ariaLabel:(0,E.__)("Forward-slash")}]}),(0,o.createElement)(Vt,{title:(0,E.__)("Text formatting"),shortcuts:Bt})):null}function Ut(e){let{feature:t,label:n,info:r,messageActivated:a,messageDeactivated:l}=e;const i=(0,c.useSelect)((e=>e(_t).isFeatureActive(t)),[]),{toggleFeature:s}=(0,c.useDispatch)(_t);return(0,o.createElement)(O.MenuItem,{icon:i&&F,isSelected:i,onClick:(0,H.flow)(s.bind(null,t),(()=>{i?(0,ke.speak)(l||(0,E.__)("Feature deactivated")):(0,ke.speak)(a||(0,E.__)("Feature activated"))})),role:"menuitemcheckbox",info:r},n)}const{Fill:Wt,Slot:$t}=(0,O.createSlotFill)("EditSiteToolsMoreMenuGroup");Wt.Slot=e=>{let{fillProps:t}=e;return(0,o.createElement)($t,{fillProps:t},(e=>!(0,H.isEmpty)(e)&&e))};var jt=Wt,Yt=n(3729),qt=n.n(Yt),Xt=window.wp.apiFetch,Kt=n.n(Xt),Qt=(0,o.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(D.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"}));function Zt(){const{createErrorNotice:e}=(0,c.useDispatch)(R.store);return(0,o.createElement)(O.MenuItem,{role:"menuitem",icon:Qt,onClick:async function(){try{const e=await Kt()({path:"/wp-block-editor/v1/export",parse:!1}),t=await e.blob();qt()(t,"edit-site-export.zip","application/zip")}catch(t){let n={};try{n=await t.json()}catch(e){}const r=n.message&&"unknown_error"!==n.code?n.message:(0,E.__)("An error occurred while creating the site export.");e(r,{type:"snackbar"})}},info:(0,E.__)("Download your templates and template parts.")},(0,E._x)("Export","site exporter menu item"))}function Jt(){const{toggleFeature:e}=(0,c.useDispatch)(_t);return(0,o.createElement)(O.MenuItem,{onClick:()=>e("welcomeGuide")},(0,E.__)("Welcome Guide"))}function en(){const{createNotice:e}=(0,c.useDispatch)(R.store),t=(0,c.useSelect)((e=>()=>{const{getEditedPostId:t,getEditedPostType:n}=e(_t),{getEditedEntityRecord:r}=e(u.store),a=r("postType",n(),t());if(a){if("function"==typeof a.content)return a.content(a);if(a.blocks)return(0,i.__unstableSerializeAndClean)(a.blocks);if(a.content)return a.content}return""}),[]),n=(0,we.useCopyToClipboard)(t,(function(){e("info",(0,E.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,o.createElement)(O.MenuItem,{ref:n},(0,E.__)("Copy all content"))}const tn=[{value:"visual",label:(0,E.__)("Visual editor")},{value:"text",label:(0,E.__)("Code editor")}];var nn=function(){const{shortcut:e,mode:t}=(0,c.useSelect)((e=>({shortcut:e(Nt.store).getShortcutRepresentation("core/edit-site/toggle-mode"),isRichEditingEnabled:e(_t).getSettings().richEditingEnabled,isCodeEditingEnabled:e(_t).getSettings().codeEditingEnabled,mode:e(_t).getEditorMode()})),[]),{switchEditorMode:n}=(0,c.useDispatch)(_t),r=tn.map((n=>n.value!==t?{...n,shortcut:e}:n));return(0,o.createElement)(O.MenuGroup,{label:(0,E.__)("Editor")},(0,o.createElement)(O.MenuItemsChoice,{choices:r,value:t,onSelect:n}))};const rn={className:"edit-site-more-menu__content",position:"bottom left"},an={tooltipPosition:"bottom"};function ln(){const[e,t]=(0,o.useReducer)((e=>!e),!1);return(0,Nt.useShortcut)("core/edit-site/keyboard-shortcuts",t),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(O.DropdownMenu,{className:"edit-site-more-menu",icon:At,label:(0,E.__)("More tools & options"),popoverProps:rn,toggleProps:an},(e=>{let{onClose:n}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(O.MenuGroup,{label:(0,E._x)("View","noun")},(0,o.createElement)(Ut,{feature:"fixedToolbar",label:(0,E.__)("Top toolbar"),info:(0,E.__)("Access all block and document tools in a single place"),messageActivated:(0,E.__)("Top toolbar activated"),messageDeactivated:(0,E.__)("Top toolbar deactivated")}),(0,o.createElement)(Ut,{feature:"focusMode",label:(0,E.__)("Spotlight mode"),info:(0,E.__)("Focus on one block at a time"),messageActivated:(0,E.__)("Spotlight mode activated"),messageDeactivated:(0,E.__)("Spotlight mode deactivated")}),(0,o.createElement)(nn,null),(0,o.createElement)(de.Slot,{name:"core/edit-site/plugin-more-menu",label:(0,E.__)("Plugins"),as:O.MenuGroup,fillProps:{onClick:n}})),(0,o.createElement)(O.MenuGroup,{label:(0,E.__)("Tools")},(0,o.createElement)(Zt,null),(0,o.createElement)(O.MenuItem,{onClick:t,shortcut:Rt.displayShortcut.access("h")},(0,E.__)("Keyboard shortcuts")),(0,o.createElement)(Jt,null),(0,o.createElement)(en,null),(0,o.createElement)(O.MenuItem,{icon:Lt,role:"menuitem",href:(0,E.__)("https://wordpress.org/support/article/site-editor/"),target:"_blank",rel:"noopener noreferrer"},(0,E.__)("Help"),(0,o.createElement)(O.VisuallyHidden,{as:"span"},
/* translators: accessibility text */
(0,E.__)("(opens in a new tab)"))),(0,o.createElement)(jt.Slot,{fillProps:{onClose:n}})))})),(0,o.createElement)(Ht,{isModalActive:e,toggleModal:t}))}function on(e){let{openEntitiesSavedStates:t,isEntitiesSavedStatesOpen:n}=e;const{isDirty:r,isSaving:a}=(0,c.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,isSavingEntityRecord:n}=e(u.store),r=t();return{isDirty:r.length>0,isSaving:(0,H.some)(r,(e=>n(e.kind,e.name,e.key)))}}),[]),l=!r||a;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(O.Button,{variant:"primary",className:"edit-site-save-button__button","aria-disabled":l,"aria-expanded":n,disabled:l,isBusy:a,onClick:l?void 0:t},(0,E.__)("Save")))}var sn=(0,o.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(D.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"})),cn=(0,o.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(D.Path,{d:"M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"}));function un(){const e=(0,c.useSelect)((e=>e(u.store).hasUndo()),[]),{undo:t}=(0,c.useDispatch)(u.store);return(0,o.createElement)(O.Button,{icon:(0,E.isRTL)()?cn:sn,label:(0,E.__)("Undo"),shortcut:Rt.displayShortcut.primary("z"),"aria-disabled":!e,onClick:e?t:void 0})}function mn(){const e=(0,c.useSelect)((e=>e(u.store).hasRedo()),[]),{redo:t}=(0,c.useDispatch)(u.store);return(0,o.createElement)(O.Button,{icon:(0,E.isRTL)()?sn:cn,label:(0,E.__)("Redo"),shortcut:Rt.displayShortcut.primaryShift("z"),"aria-disabled":!e,onClick:e?t:void 0})}var dn=(0,o.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(D.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));function pn(e){if(e){const t=(0,i.getBlockType)(e.name);return t?(0,i.__experimentalGetBlockLabel)(t,e.attributes):null}return null}function gn(e){let{entityTitle:t,entityLabel:n,isLoaded:r,children:a}=e;const{label:l}=function(){const{getBlock:e}=(0,c.useSelect)(xe.store),t=(0,c.useSelect)((e=>e(xe.store).__experimentalGetActiveBlockIdByBlockNames(["core/template-part"])),[]);return t?{label:pn(e(t)),isActive:!0}:{}}(),i=(0,o.useRef)();return r?t?(0,o.createElement)("div",{className:B()("edit-site-document-actions",{"has-secondary-label":!!l})},(0,o.createElement)("div",{ref:i,className:"edit-site-document-actions__title-wrapper"},(0,o.createElement)(O.__experimentalText,{size:"body",className:"edit-site-document-actions__title",as:"h1"},(0,o.createElement)(O.VisuallyHidden,{as:"span"},(0,E.sprintf)(
/* translators: %s: the entity being edited, like "template"*/
(0,E.__)("Editing %s: "),n)),t),(0,o.createElement)(O.__experimentalText,{size:"body",className:"edit-site-document-actions__secondary-item"},null!=l?l:""),a&&(0,o.createElement)(O.Dropdown,{popoverProps:{anchorRef:i.current},position:"bottom center",renderToggle:e=>{let{isOpen:t,onToggle:r}=e;return(0,o.createElement)(O.Button,{className:"edit-site-document-actions__get-info",icon:dn,"aria-expanded":t,"aria-haspopup":"true",onClick:r,label:(0,E.sprintf)(
/* translators: %s: the entity to see details about, like "template"*/
(0,E.__)("Show %s details"),n)})},contentClassName:"edit-site-document-actions__info-dropdown",renderContent:a}))):(0,o.createElement)("div",{className:"edit-site-document-actions"},(0,E.__)("Template not found")):(0,o.createElement)("div",{className:"edit-site-document-actions"},(0,E.__)("Loading…"))}function hn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=Tt();function a(a){a.preventDefault(),n?r.replace(e,t):r.push(e,t)}return{href:(0,p.addQueryArgs)(window.location.href,e),onClick:a}}function fn(e){let{params:t={},state:n,replace:r=!1,children:a,...l}=e;const{href:i,onClick:s}=hn(t,n,r);return(0,o.createElement)("a",A({href:i,onClick:s},l),a)}function En(e){var t;let{onClose:n,templatePart:r,closeTemplateDetailsDropdown:a}=e;const{revertTemplate:l}=(0,c.useDispatch)(_t),{params:i}=kt(),s=hn({postId:r.id,postType:r.type},{fromTemplateId:i.postId});return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(O.MenuGroup,null,(0,o.createElement)(O.MenuItem,A({},s,{onClick:function(e){s.onClick(e),n(),a()}}),(0,E.sprintf)(
/* translators: %s: template part title */
(0,E.__)("Edit %s"),null===(t=r.title)||void 0===t?void 0:t.rendered))),Te(r)&&(0,o.createElement)(O.MenuGroup,null,(0,o.createElement)(O.MenuItem,{info:(0,E.__)("Restore template to default state"),onClick:function(){l(r),n(),a()}},(0,E.__)("Clear customizations"))))}function yn(e){let{templatePart:t,clientId:n,closeTemplateDetailsDropdown:r}=e;const{selectBlock:a,toggleBlockHighlight:l}=(0,c.useDispatch)(xe.store),i=(0,c.useSelect)((e=>e(m.store).__experimentalGetDefaultTemplatePartAreas().find((e=>e.area===t.area))),[t.area]),s=()=>l(n,!0),u=()=>l(n,!1);return(0,o.createElement)("div",{role:"menuitem",className:"edit-site-template-details__template-areas-item"},(0,o.createElement)(O.MenuItem,{role:"button",icon:null==i?void 0:i.icon,iconPosition:"left",onClick:()=>{a(n)},onMouseOver:s,onMouseLeave:u,onFocus:s,onBlur:u},null==i?void 0:i.label),(0,o.createElement)(O.DropdownMenu,{icon:At,label:(0,E.__)("More options"),className:"edit-site-template-details__template-areas-item-more"},(e=>{let{onClose:n}=e;return(0,o.createElement)(En,{onClose:n,templatePart:t,closeTemplateDetailsDropdown:r})})))}function vn(e){let{closeTemplateDetailsDropdown:t}=e;const n=(0,c.useSelect)((e=>e(_t).getCurrentTemplateTemplateParts()),[]);return n.length?(0,o.createElement)(O.MenuGroup,{label:(0,E.__)("Areas"),className:"edit-site-template-details__group edit-site-template-details__template-areas"},n.map((e=>{let{templatePart:n,block:r}=e;return(0,o.createElement)(yn,{key:n.slug,clientId:r.clientId,templatePart:n,closeTemplateDetailsDropdown:t})}))):null}function bn(e){let{template:t}=e;const[n,r]=(0,u.useEntityProp)("postType",t.type,"title",t.id);return(0,o.createElement)(O.TextControl,{label:(0,E.__)("Title"),value:n,help:(0,E.__)('Give the template a title that indicates its purpose, e.g. "Full Width".'),onChange:e=>{r(e||t.slug)}})}function wn(e){let{template:t,onClose:n}=e;const{title:r,description:a}=(0,c.useSelect)((e=>e(m.store).__experimentalGetTemplateInfo(t)),[]),{revertTemplate:l}=(0,c.useDispatch)(_t),i=(0,o.useMemo)((()=>"wp_template"===(null==t?void 0:t.type)?{title:(0,E.__)("templates"),menu:C}:N.find((e=>{let{area:n}=e;return n===(null==t?void 0:t.area)}))),[t]),s=hn({postType:t.type,postId:void 0});return t?(0,o.createElement)("div",{className:"edit-site-template-details"},(0,o.createElement)("div",{className:"edit-site-template-details__group"},t.is_custom?(0,o.createElement)(bn,{template:t}):(0,o.createElement)(O.__experimentalHeading,{level:4,weight:600,className:"edit-site-template-details__title"},r),a&&(0,o.createElement)(O.__experimentalText,{size:"body",className:"edit-site-template-details__description",as:"p"},a)),(0,o.createElement)(vn,{closeTemplateDetailsDropdown:n}),Te(t)&&(0,o.createElement)(O.MenuGroup,{className:"edit-site-template-details__group edit-site-template-details__revert"},(0,o.createElement)(O.MenuItem,{className:"edit-site-template-details__revert-button",info:(0,E.__)("Restore template to default state"),onClick:()=>{l(t),n()}},(0,E.__)("Clear customizations"))),(0,o.createElement)(O.Button,A({className:"edit-site-template-details__show-all-button"},s),(0,E.sprintf)(
/* translators: the template part's area name ("Headers", "Sidebars") or "templates". */
(0,E.__)("Browse all %s"),i.title))):null}const Sn=e=>{e.preventDefault()};function xn(e){let{openEntitiesSavedStates:t,isEntitiesSavedStatesOpen:n}=e;const r=(0,o.useRef)(),{deviceType:a,entityTitle:l,template:i,templateType:s,isInserterOpen:d,isListViewOpen:p,listViewShortcut:_,isLoaded:g,isVisualMode:h}=(0,c.useSelect)((e=>{const{__experimentalGetPreviewDeviceType:t,getEditedPostType:n,getEditedPostId:r,isInserterOpened:a,isListViewOpened:l,getEditorMode:o}=e(_t),{getEditedEntityRecord:i}=e(u.store),{__experimentalGetTemplateInfo:s}=e(m.store),{getShortcutRepresentation:c}=e(Nt.store),d=n(),p=r(),_=i("postType",d,p),g=!!p;return{deviceType:t(),entityTitle:s(_).title,isLoaded:g,template:_,templateType:d,isInserterOpen:a(),isListViewOpen:l(),listViewShortcut:c("core/edit-site/toggle-list-view"),isVisualMode:"visual"===o()}}),[]),{__experimentalSetPreviewDeviceType:f,setIsInserterOpened:y,setIsListViewOpened:v}=(0,c.useDispatch)(_t),b=(0,we.useViewportMatch)("medium"),w=(0,o.useCallback)((()=>{d?r.current.focus():y(!0)}),[d,y]),S=(0,o.useCallback)((()=>v(!p)),[v,p]),x="wp_template_part"===s;return(0,o.createElement)("div",{className:"edit-site-header"},(0,o.createElement)("div",{className:"edit-site-header_start"},(0,o.createElement)("div",{className:"edit-site-header__toolbar"},(0,o.createElement)(O.Button,{ref:r,variant:"primary",isPressed:d,className:"edit-site-header-toolbar__inserter-toggle",disabled:!h,onMouseDown:Sn,onClick:w,icon:Pt,label:(0,E._x)("Toggle block inserter","Generic label for block inserter button")}),b&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(O.ToolbarItem,{as:xe.ToolSelector,disabled:!h}),(0,o.createElement)(un,null),(0,o.createElement)(mn,null),(0,o.createElement)(O.Button,{className:"edit-site-header-toolbar__list-view-toggle",disabled:!h,icon:Mt,isPressed:p
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,E.__)("List View"),onClick:S,shortcut:_})))),(0,o.createElement)("div",{className:"edit-site-header_center"},(0,o.createElement)(gn,{entityTitle:l,entityLabel:"wp_template_part"===s?"template part":"template",isLoaded:g},(e=>{let{onClose:t}=e;return(0,o.createElement)(wn,{template:i,onClose:t})}))),(0,o.createElement)("div",{className:"edit-site-header_end"},(0,o.createElement)("div",{className:"edit-site-header__actions"},!x&&(0,o.createElement)(xe.__experimentalPreviewOptions,{deviceType:a,setDeviceType:f}),(0,o.createElement)(on,{openEntitiesSavedStates:t,isEntitiesSavedStatesOpen:n}),(0,o.createElement)(he.Slot,{scope:"core/edit-site"}),(0,o.createElement)(ln,null))))}var kn=(0,o.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(D.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"}));function Tn(e){let{className:t,identifier:n,title:r,icon:a,children:l,closeLabel:i,header:s,headerClassName:c,panelClassName:u}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(be,{className:t,scope:"core/edit-site",identifier:n,title:r,icon:a,closeLabel:i,header:s,headerClassName:c,panelClassName:u},l),(0,o.createElement)(_e,{scope:"core/edit-site",identifier:n,icon:a},r))}var Cn=(0,o.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(D.Path,{d:"M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z"})),In=function(e){let{icon:t,size:n=24,...r}=e;return(0,o.cloneElement)(t,{width:n,height:n,...r})},Nn=(0,o.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(D.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),Pn=(0,o.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(D.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));function Mn(e){let{icon:t,children:n,...r}=e;return(0,o.createElement)(O.__experimentalItem,r,t&&(0,o.createElement)(O.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(O.FlexItem,null,(0,o.createElement)(In,{icon:t,size:24})),(0,o.createElement)(O.FlexItem,null,n)),!t&&n)}function Rn(e){let{path:t,...n}=e;const{goTo:r}=(0,O.__experimentalUseNavigator)(),a="data-navigator-focusable-id",l=`[${a}="${t}"]`,i={...n,[a]:t};return(0,o.createElement)(Mn,A({onClick:()=>r(t,{focusTargetSelector:l})},i))}function An(e){let{...t}=e;const{goBack:n}=(0,O.__experimentalUseNavigator)();return(0,o.createElement)(Mn,A({onClick:n},t))}var Ln=(0,o.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(D.Path,{d:"M6.9 7L3 17.8h1.7l1-2.8h4.1l1 2.8h1.7L8.6 7H6.9zm-.7 6.6l1.5-4.3 1.5 4.3h-3zM21.6 17c-.1.1-.2.2-.3.2-.1.1-.2.1-.4.1s-.3-.1-.4-.2c-.1-.1-.1-.3-.1-.6V12c0-.5 0-1-.1-1.4-.1-.4-.3-.7-.5-1-.2-.2-.5-.4-.9-.5-.4 0-.8-.1-1.3-.1s-1 .1-1.4.2c-.4.1-.7.3-1 .4-.2.2-.4.3-.6.5-.1.2-.2.4-.2.7 0 .3.1.5.2.8.2.2.4.3.8.3.3 0 .6-.1.8-.3.2-.2.3-.4.3-.7 0-.3-.1-.5-.2-.7-.2-.2-.4-.3-.6-.4.2-.2.4-.3.7-.4.3-.1.6-.1.8-.1.3 0 .6 0 .8.1.2.1.4.3.5.5.1.2.2.5.2.9v1.1c0 .3-.1.5-.3.6-.2.2-.5.3-.9.4-.3.1-.7.3-1.1.4-.4.1-.8.3-1.1.5-.3.2-.6.4-.8.7-.2.3-.3.7-.3 1.2 0 .6.2 1.1.5 1.4.3.4.9.5 1.6.5.5 0 1-.1 1.4-.3.4-.2.8-.6 1.1-1.1 0 .4.1.7.3 1 .2.3.6.4 1.2.4.4 0 .7-.1.9-.2.2-.1.5-.3.7-.4h-.3zm-3-.9c-.2.4-.5.7-.8.8-.3.2-.6.2-.8.2-.4 0-.6-.1-.9-.3-.2-.2-.3-.6-.3-1.1 0-.5.1-.9.3-1.2s.5-.5.8-.7c.3-.2.7-.3 1-.5.3-.1.6-.3.7-.6v3.4z"})),Bn=(0,o.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(D.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"})),On=(0,o.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(D.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"}));const Dn="body",Fn=[{path:["color","palette"],valueKey:"color",cssVarInfix:"color",classes:[{classSuffix:"color",propertyName:"color"},{classSuffix:"background-color",propertyName:"background-color"},{classSuffix:"border-color",propertyName:"border-color"}]},{path:["color","gradients"],valueKey:"gradient",cssVarInfix:"gradient",classes:[{classSuffix:"gradient-background",propertyName:"background"}]},{path:["typography","fontSizes"],valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]}],zn={"color.background":"color","color.text":"color","elements.link.color.text":"color","color.gradient":"gradient","typography.fontSize":"font-size","typography.fontFamily":"font-family"};function Vn(e,t,n,r,a){const l=[(0,H.get)(e,["blocks",t,...n]),(0,H.get)(e,n)];for(const o of l)if(o){const l=["custom","theme","default"];for(const i of l){const l=o[i];if(l){const o=(0,H.find)(l,(e=>e[r]===a));if(o)return"slug"===r||Vn(e,t,n,"slug",o.slug)[r]===o[r]?o:void 0}}}}function Gn(e,t,n,r){if(!r)return r;const a=zn[n],l=(0,H.find)(Fn,["cssVarInfix",a]);if(!l)return r;const{valueKey:o,path:i}=l,s=Vn(e,t,i,o,r);return s?`var:preset|${a}|${s.slug}`:r}function Hn(e,t,n){if(!n||!(0,H.isString)(n))return n;const r="var:",a="var(--wp--";let l;if(n.startsWith(r))l=n.slice(r.length).split("|");else{if(!n.startsWith(a)||!n.endsWith(")"))return n;l=n.slice(a.length,-")".length).split("--")}const[o,...i]=l;return"preset"===o?function(e,t,n,r){let[a,l]=r;const o=(0,H.find)(Fn,["cssVarInfix",a]);if(!o)return n;const i=Vn(e,t,o.path,"slug",l);if(i){const{valueKey:n}=o;return Hn(e,t,i[n])}return n}(e,t,n,i):"custom"===o?function(e,t,n,r){var a;const l=null!==(a=(0,H.get)(e,["blocks",t,"custom",...r]))&&void 0!==a?a:(0,H.get)(e,["custom",...r]);return l?Hn(e,t,l):n}(e,t,n,i):n}const Un=(0,o.createContext)({user:{},base:{},merged:{},setUserConfig:()=>{}}),Wn={isGlobalStylesUserThemeJSON:!0,version:1};function $n(e,t){var n;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all";const{merged:a,base:l,user:s,setUserConfig:c}=(0,o.useContext)(Un),u=t?`settings.blocks.${t}.${e}`:`settings.${e}`,m=t=>{c((n=>{const r=(0,H.cloneDeep)(n),a=i.__EXPERIMENTAL_PATHS_WITH_MERGE[e]?u+".custom":u;return(0,H.set)(r,a,t),r}))},d=t=>{const n=t?`settings.blocks.${t}.${e}`:`settings.${e}`,o=t=>{const r=(0,H.get)(t,n);var a,l;return i.__EXPERIMENTAL_PATHS_WITH_MERGE[e]?null!==(a=null!==(l=null==r?void 0:r.custom)&&void 0!==l?l:null==r?void 0:r.theme)&&void 0!==a?a:null==r?void 0:r.default:r};let c;switch(r){case"all":c=o(a);break;case"user":c=o(s);break;case"base":c=o(l);break;default:throw"Unsupported source"}return c},p=null!==(n=d(t))&&void 0!==n?n:d();return[p,m]}function jn(e,t){var n;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all";const{merged:a,base:l,user:i,setUserConfig:s}=(0,o.useContext)(Un),c=t?`styles.blocks.${t}.${e}`:`styles.${e}`,u=n=>{s((r=>{const l=(0,H.cloneDeep)(r);return(0,H.set)(l,c,Gn(a.settings,t,e,n)),l}))};let m;switch(r){case"all":m=Hn(a.settings,t,null!==(n=(0,H.get)(i,c))&&void 0!==n?n:(0,H.get)(l,c));break;case"user":m=Hn(a.settings,t,(0,H.get)(i,c));break;case"base":m=Hn(l.settings,t,(0,H.get)(l,c));break;default:throw"Unsupported source"}return[m,u]}const Yn=["background","backgroundColor","color","linkColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","textDecoration","textTransform","padding"];function qn(e){if(!e)return Yn;const t=(0,i.getBlockType)(e);if(!t)return[];const n=[];return Object.keys(i.__EXPERIMENTAL_STYLE_PROPERTY).forEach((e=>{if(i.__EXPERIMENTAL_STYLE_PROPERTY[e].support)return i.__EXPERIMENTAL_STYLE_PROPERTY[e].requiresOptOut&&(0,H.has)(t.supports,i.__EXPERIMENTAL_STYLE_PROPERTY[e].support[0])&&!1!==(0,H.get)(t.supports,i.__EXPERIMENTAL_STYLE_PROPERTY[e].support)||(0,H.get)(t.supports,i.__EXPERIMENTAL_STYLE_PROPERTY[e].support,!1)?n.push(e):void 0})),n}function Xn(e){const[t]=$n("color.palette.custom",e),[n]=$n("color.palette.theme",e),[r]=$n("color.palette.default",e),[a]=$n("color.defaultPalette");return(0,o.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,E._x)("Theme","Indicates this palette comes from the theme."),colors:n}),a&&r&&r.length&&e.push({name:(0,E._x)("Default","Indicates this palette comes from WordPress."),colors:r}),t&&t.length&&e.push({name:(0,E._x)("Custom","Indicates this palette is created by the user."),colors:t}),e}),[t,n,r])}const Kn=[];function Qn(e){return[Zn(e),Jn(e),er(e),tr(e)].some(Boolean)}function Zn(e){const t=qn(e);return $n("border.color",e)[0]&&t.includes("borderColor")}function Jn(e){const t=qn(e);return $n("border.radius",e)[0]&&t.includes("borderRadius")}function er(e){const t=qn(e);return $n("border.style",e)[0]&&t.includes("borderStyle")}function tr(e){const t=qn(e);return $n("border.width",e)[0]&&t.includes("borderWidth")}function nr(e){let{name:t}=e;const[n]=jn("border",t,"user"),r=e=>()=>!(null==n||!n[e]),a=e=>()=>e(void 0),l=e=>t=>{e(t||void 0)},i=(0,O.__experimentalUseCustomUnits)({availableUnits:$n("spacing.units")[0]||["px","em","rem"]}),s=tr(t),[c,u]=jn("border.width",t),m=er(t),[d,p]=jn("border.style",t),_=Zn(t),[g,h]=jn("border.color",t),[f=Kn]=$n("color.palette"),y=!$n("color.custom")[0],v=!$n("color.customGradient")[0],b=Jn(t),[w,S]=jn("border.radius",t),x=e=>t=>{t&&!d&&p("solid"),e(t||void 0)};return(0,o.createElement)(O.__experimentalToolsPanel,{label:(0,E.__)("Border"),resetAll:()=>{h(void 0),S(void 0),p(void 0),u(void 0)}},s&&(0,o.createElement)(O.__experimentalToolsPanelItem,{className:"single-column",hasValue:r("width"),label:(0,E.__)("Width"),onDeselect:a(u),isShownByDefault:!0},(0,o.createElement)(O.__experimentalUnitControl,{value:c,label:(0,E.__)("Width"),min:0,onChange:x(u),units:i})),m&&(0,o.createElement)(O.__experimentalToolsPanelItem,{className:"single-column",hasValue:r("style"),label:(0,E.__)("Style"),onDeselect:a(p),isShownByDefault:!0},(0,o.createElement)(xe.__experimentalBorderStyleControl,{value:d,onChange:l(p)})),_&&(0,o.createElement)(O.__experimentalToolsPanelItem,{hasValue:r("color"),label:(0,E.__)("Color"),onDeselect:a(h),isShownByDefault:!0},(0,o.createElement)(xe.__experimentalColorGradientControl,{label:(0,E.__)("Color"),colorValue:g,colors:f,gradients:void 0,disableCustomColors:y,disableCustomGradients:v,onColorChange:x(h),clearable:!1})),b&&(0,o.createElement)(O.__experimentalToolsPanelItem,{hasValue:()=>{const e=null==n?void 0:n.radius;return"object"==typeof e?Object.entries(e).some(Boolean):!!e},label:(0,E.__)("Radius"),onDeselect:a(S),isShownByDefault:!0},(0,o.createElement)(xe.__experimentalBorderRadiusControl,{values:w,onChange:l(S)})))}function rr(e){const t=qn(e);return t.includes("color")||t.includes("backgroundColor")||t.includes("background")||t.includes("linkColor")}const ar=["horizontal","vertical"];function lr(e){const t=or(e),n=ir(e),r=sr(e);return t||n||r}function or(e){const t=qn(e),[n]=$n("spacing.padding",e);return n&&t.includes("padding")}function ir(e){const t=qn(e),[n]=$n("spacing.margin",e);return n&&t.includes("margin")}function sr(e){const t=qn(e),[n]=$n("spacing.blockGap",e);return n&&t.includes("--wp--style--block-gap")}function cr(e,t){if(!t)return e;const n={};return t.forEach((t=>{"vertical"===t&&(n.top=e.top,n.bottom=e.bottom),"horizontal"===t&&(n.left=e.left,n.right=e.right),n[t]=e[t]})),n}function ur(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function mr(e){let{name:t}=e;const n=or(t),r=ir(t),a=sr(t),l=(0,O.__experimentalUseCustomUnits)({availableUnits:$n("spacing.units",t)[0]||["%","px","em","rem","vw"]}),[i,s]=jn("spacing.padding",t),c=ur(i),u=(0,xe.__experimentalUseCustomSides)(t,"padding"),m=u&&u.some((e=>ar.includes(e))),d=e=>{const t=cr(e,u);s(t)},p=()=>d({}),[_,g]=jn("spacing.margin",t),h=ur(_),f=(0,xe.__experimentalUseCustomSides)(t,"margin"),y=f&&f.some((e=>ar.includes(e))),v=e=>{const t=cr(e,f);g(t)},b=()=>v({}),[w,S]=jn("spacing.blockGap",t),x=()=>S(void 0);return(0,o.createElement)(O.__experimentalToolsPanel,{label:(0,E.__)("Dimensions"),resetAll:()=>{p(),b(),x()}},n&&(0,o.createElement)(O.__experimentalToolsPanelItem,{hasValue:()=>!!c&&Object.keys(c).length,label:(0,E.__)("Padding"),onDeselect:p,isShownByDefault:!0},(0,o.createElement)(O.__experimentalBoxControl,{values:c,onChange:d,label:(0,E.__)("Padding"),sides:u,units:l,allowReset:!1,splitOnAxis:m})),r&&(0,o.createElement)(O.__experimentalToolsPanelItem,{hasValue:()=>!!h&&Object.keys(h).length,label:(0,E.__)("Margin"),onDeselect:b,isShownByDefault:!0},(0,o.createElement)(O.__experimentalBoxControl,{values:h,onChange:v,label:(0,E.__)("Margin"),sides:f,units:l,allowReset:!1,splitOnAxis:y})),a&&(0,o.createElement)(O.__experimentalToolsPanelItem,{hasValue:()=>!!w,label:(0,E.__)("Block spacing"),onDeselect:x,isShownByDefault:!0},(0,o.createElement)(O.__experimentalUnitControl,{label:(0,E.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:S,units:l,value:w})))}function dr(e){const t=pr(e),n=_r(e),r=gr(e),a=qn(e);return t||n||r||a.includes("fontSize")}function pr(e){const t=qn(e);return $n("typography.lineHeight",e)[0]&&t.includes("lineHeight")}function _r(e){const t=qn(e),n=$n("typography.fontStyle",e)[0]&&t.includes("fontStyle"),r=$n("typography.fontWeight",e)[0]&&t.includes("fontWeight");return n||r}function gr(e){const t=qn(e);return $n("typography.letterSpacing",e)[0]&&t.includes("letterSpacing")}function hr(e){let{name:t,element:n}=e;const r=qn(t),a="text"!==n&&n?`elements.${n}.`:"",[l]=$n("typography.fontSizes",t),i=!$n("typography.customFontSize",t)[0],[s]=$n("typography.fontFamilies",t),c=$n("typography.fontStyle",t)[0]&&r.includes("fontStyle"),u=$n("typography.fontWeight",t)[0]&&r.includes("fontWeight"),m=pr(t),d=_r(t),p=gr(t),[_,g]=jn(a+"typography.fontFamily",t),[h,f]=jn(a+"typography.fontSize",t),[E,y]=jn(a+"typography.fontStyle",t),[v,b]=jn(a+"typography.fontWeight",t),[w,S]=jn(a+"typography.lineHeight",t),[x,k]=jn(a+"typography.letterSpacing",t),[T]=jn(a+"color.background",t),[C]=jn(a+"color.gradient",t),[I]=jn(a+"color.text",t),N="link"===n?{textDecoration:"underline"}:{};return(0,o.createElement)(O.PanelBody,{className:"edit-site-typography-panel",initialOpen:!0},(0,o.createElement)("div",{className:"edit-site-typography-panel__preview",style:{fontFamily:null!=_?_:"serif",background:null!=C?C:T,color:I,fontSize:h,fontStyle:E,fontWeight:v,letterSpacing:x,...N}},"Aa"),r.includes("fontFamily")&&(0,o.createElement)(xe.__experimentalFontFamilyControl,{fontFamilies:s,value:_,onChange:g}),r.includes("fontSize")&&(0,o.createElement)(O.FontSizePicker,{value:h,onChange:f,fontSizes:l,disableCustomFontSizes:i}),m&&(0,o.createElement)(xe.LineHeightControl,{value:w,onChange:S}),d&&(0,o.createElement)(xe.__experimentalFontAppearanceControl,{value:{fontStyle:E,fontWeight:v},onChange:e=>{let{fontStyle:t,fontWeight:n}=e;y(t),b(n)},hasFontStyles:c,hasFontWeights:u}),p&&(0,o.createElement)(xe.__experimentalLetterSpacingControl,{value:x,onChange:k}))}var fr=function(e){let{name:t,parentMenu:n=""}=e;const r=dr(t),a=rr(t),l=Qn(t),i=lr(t),s=l||i;return(0,o.createElement)(O.__experimentalItemGroup,null,r&&(0,o.createElement)(Rn,{icon:Ln,path:n+"/typography"},(0,E.__)("Typography")),a&&(0,o.createElement)(Rn,{icon:Bn,path:n+"/colors"},(0,E.__)("Colors")),s&&(0,o.createElement)(Rn,{icon:On,path:n+"/layout"},(0,E.__)("Layout")))};function Er(e){const t="var:";return(0,H.startsWith)(e,t)?`var(--wp--${e.slice(t.length).split("|").join("--")})`:e}function yr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=[];return Object.keys(e).forEach((a=>{const l=t+(0,H.kebabCase)(a.replace("/","-")),o=e[a];if(o instanceof Object){const e=l+n;r=[...r,...yr(o,e,n)]}else r.push(`${l}: ${o}`)})),r}const vr=(e,t)=>{var n,r;const a=[];if(null==e||!e.settings)return a;const l=e=>{const t={};return Fn.forEach((n=>{let{path:r}=n;const a=(0,H.get)(e,r,!1);!1!==a&&(0,H.set)(t,r,a)})),t},o=l(e.settings),i=null===(n=e.settings)||void 0===n?void 0:n.custom;return(0,H.isEmpty)(o)&&!i||a.push({presets:o,custom:i,selector:Dn}),(0,H.forEach)(null===(r=e.settings)||void 0===r?void 0:r.blocks,((e,n)=>{const r=l(e),o=e.custom;(0,H.isEmpty)(r)&&!o||a.push({presets:r,custom:o,selector:t[n].selector})})),a},br=(e,t)=>{const n=vr(e,t);let r="";return n.forEach((e=>{let{presets:t,custom:n,selector:a}=e;const l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,H.reduce)(Fn,((t,n)=>{let{path:r,valueKey:a,cssVarInfix:l}=n;const o=(0,H.get)(e,r,[]);return["default","theme","custom"].forEach((e=>{o[e]&&o[e].forEach((e=>{t.push(`--wp--preset--${l}--${(0,H.kebabCase)(e.slug)}: ${e[a]}`)}))})),t}),[])}(t),o=yr(n,"--wp--custom--","--");o.length>0&&l.push(...o),l.length>0&&(r+=`${a}{${l.join(";")};}`)})),r};function wr(){const[e,t]=(0,o.useState)([]),[n,r]=(0,o.useState)({}),{merged:a}=(0,o.useContext)(Un);return(0,o.useEffect)((()=>{if(null==a||!a.styles||null==a||!a.settings)return;const e=(e=>{const t={};return e.forEach((e=>{var n,r;const a=e.name,l=null!==(n=null==e||null===(r=e.supports)||void 0===r?void 0:r.__experimentalSelector)&&void 0!==n?n:".wp-block-"+a.replace("core/","").replace("/","-");t[a]={name:a,selector:l}})),t})((0,i.getBlockTypes)()),n=br(a,e),l=((e,t)=>{const n=((e,t)=>{var n,r;const a=[];if(null==e||!e.styles)return a;const l=e=>(0,H.pickBy)(e,((e,t)=>["border","color","spacing","typography"].includes(t))),o=l(e.styles);return o&&a.push({styles:o,selector:Dn}),(0,H.forEach)(null===(n=e.styles)||void 0===n?void 0:n.elements,((e,t)=>{e&&i.__EXPERIMENTAL_ELEMENTS[t]&&a.push({styles:e,selector:i.__EXPERIMENTAL_ELEMENTS[t]})})),(0,H.forEach)(null===(r=e.styles)||void 0===r?void 0:r.blocks,((e,n)=>{var r;const o=l(e);o&&null!=t&&null!==(r=t[n])&&void 0!==r&&r.selector&&a.push({styles:o,selector:t[n].selector}),(0,H.forEach)(null==e?void 0:e.elements,((e,r)=>{e&&null!=t&&t[n]&&null!==i.__EXPERIMENTAL_ELEMENTS&&void 0!==i.__EXPERIMENTAL_ELEMENTS&&i.__EXPERIMENTAL_ELEMENTS[r]&&a.push({styles:e,selector:t[n].selector.split(",").map((e=>e+" "+i.__EXPERIMENTAL_ELEMENTS[r])).join(",")})}))})),a})(e,t),r=vr(e,t);let a=".wp-site-blocks > * { margin-top: 0; margin-bottom: 0; }.wp-site-blocks > * + * { margin-top: var( --wp--style--block-gap ); }";return n.forEach((e=>{let{selector:t,styles:n}=e;const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,H.reduce)(i.__EXPERIMENTAL_STYLE_PROPERTY,((t,n,r)=>{let{value:a,properties:l}=n;const o=a;if("elements"===(0,H.first)(o))return t;const i=(0,H.get)(e,o);if(l&&!(0,H.isString)(i))Object.entries(l).forEach((e=>{const[n,r]=e;if(!(0,H.get)(i,[r],!1))return;const a=(0,H.kebabCase)(n);t.push(`${a}: ${Er((0,H.get)(i,[r]))}`)}));else if((0,H.get)(e,o,!1)){const n=r.startsWith("--")?r:(0,H.kebabCase)(r);t.push(`${n}: ${Er((0,H.get)(e,o))}`)}return t}),[])}(n);0!==r.length&&(a+=`${t}{${r.join(";")};}`)})),r.forEach((e=>{let{selector:t,presets:n}=e;Dn===t&&(t="");const r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,H.reduce)(Fn,((n,r)=>{let{path:a,cssVarInfix:l,classes:o}=r;if(!o)return n;const i=(0,H.get)(t,a,[]);return["default","theme","custom"].forEach((t=>{i[t]&&i[t].forEach((t=>{let{slug:r}=t;o.forEach((t=>{let{classSuffix:a,propertyName:o}=t;const i=`.has-${(0,H.kebabCase)(r)}-${a}`,s=e.split(",").map((e=>`${e}${i}`)).join(","),c=`var(--wp--preset--${l}--${(0,H.kebabCase)(r)})`;n+=`${s}{${o}: ${c} !important;}`}))}))})),n}),"")}(t,n);(0,H.isEmpty)(r)||(a+=r)})),a})(a,e);t([{css:n,isGlobalStyles:!0},{css:l,isGlobalStyles:!0}]),r(a.settings)}),[a]),[e,n]}var Sr=e=>{let{height:t=150}=e;const[n="serif"]=jn("typography.fontFamily"),[r="black"]=jn("color.text"),[a="blue"]=jn("elements.link.color.text"),[l="white"]=jn("color.background"),[i]=jn("color.gradient"),[s]=wr();return(0,o.createElement)(xe.__unstableIframe,{className:"edit-site-global-styles-preview__iframe",head:(0,o.createElement)(xe.__unstableEditorStyles,{styles:s}),style:{height:t}},(0,o.createElement)("div",{style:{display:"flex",gap:20,alignItems:"center",justifyContent:"center",height:"100%",transform:`scale(${t/150})`,background:null!=i?i:l,cursor:"pointer"}},(0,o.createElement)("div",{style:{fontFamily:n,fontSize:"80px"}},"Aa"),(0,o.createElement)("div",{style:{display:"flex",gap:20,flexDirection:"column"}},(0,o.createElement)("div",{style:{height:40,width:40,background:r,borderRadius:20}})," ",(0,o.createElement)("div",{style:{height:40,width:40,background:a,borderRadius:20}}))))},xr=function(){const{variations:e}=(0,c.useSelect)((e=>({variations:e(u.store).__experimentalGetCurrentThemeGlobalStylesVariations()})),[]);return(0,o.createElement)(O.Card,{size:"small"},(0,o.createElement)(O.CardBody,null,(0,o.createElement)(O.__experimentalVStack,{spacing:2},(0,o.createElement)(O.Card,null,(0,o.createElement)(Sr,null)),!(null==e||!e.length)&&(0,o.createElement)(Rn,{path:"/variations"},(0,o.createElement)(O.__experimentalHStack,{justify:"space-between"},(0,o.createElement)(O.FlexItem,null,(0,E.__)("Other styles")),(0,o.createElement)(O.FlexItem,null,(0,o.createElement)(In,{icon:(0,E.isRTL)()?Nn:Pn})))))),(0,o.createElement)(O.CardBody,null,(0,o.createElement)(fr,null)),(0,o.createElement)(O.CardDivider,null),(0,o.createElement)(O.CardBody,null,(0,o.createElement)(O.__experimentalItemGroup,null,(0,o.createElement)(O.__experimentalItem,null,(0,E.__)("Customize the appearance of specific blocks for the whole site.")),(0,o.createElement)(Rn,{path:"/blocks"},(0,o.createElement)(O.__experimentalHStack,{justify:"space-between"},(0,o.createElement)(O.FlexItem,null,(0,E.__)("Blocks")),(0,o.createElement)(O.FlexItem,null,(0,o.createElement)(In,{icon:(0,E.isRTL)()?Nn:Pn})))))))},kr=function(e){let{title:t,description:n}=e;return(0,o.createElement)(O.__experimentalVStack,{spacing:2},(0,o.createElement)(O.__experimentalHStack,{spacing:2},(0,o.createElement)(O.__experimentalView,null,(0,o.createElement)(An,{icon:(0,o.createElement)(In,{icon:(0,E.isRTL)()?Pn:Nn,variant:"muted"}),size:"small","aria-label":(0,E.__)("Navigate to the previous view")})),(0,o.createElement)(O.__experimentalSpacer,null,(0,o.createElement)(O.__experimentalHeading,{level:5},t))),n&&(0,o.createElement)("p",{className:"edit-site-global-styles-header__description"},n))};function Tr(e){let{block:t}=e;const n=dr(t.name),r=rr(t.name),a=Qn(t.name),l=lr(t.name);return n||r||a||l?(0,o.createElement)(Rn,{path:"/blocks/"+t.name},(0,o.createElement)(O.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(O.FlexItem,null,(0,o.createElement)(xe.BlockIcon,{icon:t.icon})),(0,o.createElement)(O.FlexItem,null,t.title))):null}var Cr=function(){return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(kr,{title:(0,E.__)("Blocks"),description:(0,E.__)("Customize the appearance of specific blocks and for the whole site.")}),(0,i.getBlockTypes)().map((e=>(0,o.createElement)(Tr,{block:e,key:"menu-itemblock-"+e.name}))))},Ir=function(e){let{name:t}=e;const n=(0,i.getBlockType)(t);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(kr,{title:n.title}),(0,o.createElement)(fr,{parentMenu:"/blocks/"+t,name:t}))},Nr=function(e){let{children:t}=e;return(0,o.createElement)(O.__experimentalHeading,{className:"edit-site-global-styles-subtitle",level:2},t)};function Pr(e){let{name:t,parentMenu:n,element:r,label:a}=e;const l=!t,i="text"!==r&&r?`elements.${r}.`:"",s="link"===r?{textDecoration:"underline"}:{},[c]=jn(i+"typography.fontFamily",t),[u]=jn(i+"typography.fontStyle",t),[m]=jn(i+"typography.fontWeight",t),[d]=jn(i+"typography.letterSpacing",t),[p]=jn(i+"color.background",t),[_]=jn(i+"color.gradient",t),[g]=jn(i+"color.text",t);return l?(0,o.createElement)(Rn,{path:n+"/typography/"+r},(0,o.createElement)(O.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(O.FlexItem,{className:"edit-site-global-styles-screen-typography__indicator",style:{fontFamily:null!=c?c:"serif",background:null!=_?_:p,color:g,fontStyle:u,fontWeight:m,letterSpacing:d,...s}},(0,E.__)("Aa")),(0,o.createElement)(O.FlexItem,null,a))):null}var Mr=function(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(kr,{title:(0,E.__)("Typography"),description:(0,E.__)("Manage the typography settings for different elements.")}),!t&&(0,o.createElement)("div",{className:"edit-site-global-styles-screen-typography"},(0,o.createElement)(O.__experimentalVStack,{spacing:3},(0,o.createElement)(Nr,null,(0,E.__)("Elements")),(0,o.createElement)(O.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,o.createElement)(Pr,{name:t,parentMenu:n,element:"text",label:(0,E.__)("Text")}),(0,o.createElement)(Pr,{name:t,parentMenu:n,element:"link",label:(0,E.__)("Links")})))),!!t&&(0,o.createElement)(hr,{name:t,element:"text"}))};const Rr={text:{description:(0,E.__)("Manage the fonts used on the site."),title:(0,E.__)("Text")},link:{description:(0,E.__)("Manage the fonts and typography used on the links."),title:(0,E.__)("Links")}};var Ar=function(e){let{name:t,element:n}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(kr,{title:Rr[n].title,description:Rr[n].description}),(0,o.createElement)(hr,{name:t,element:n}))};const Lr=[];var Br=function(e){let{name:t}=e;const[n]=$n("color.palette.custom"),[r]=$n("color.palette.theme"),[a]=$n("color.palette.default"),[l]=$n("color.defaultPalette",t),i=(0,o.useMemo)((()=>[...n||Lr,...r||Lr,...a&&l?a:Lr]),[n,r,a,l]),s=t?"/blocks/"+t+"/colors/palette":"/colors/palette",c=i.length>0?(0,E.sprintf)(// Translators: %d: Number of palette colors.
(0,E._n)("%d color","%d colors",i.length),i.length):(0,E.__)("Add custom colors");return(0,o.createElement)(O.__experimentalVStack,{spacing:3},(0,o.createElement)(Nr,null,(0,E.__)("Palette")),(0,o.createElement)(O.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,o.createElement)(Rn,{path:s},(0,o.createElement)(O.__experimentalHStack,{direction:0===i.length?"row-reverse":"row"},(0,o.createElement)(O.FlexBlock,null,(0,o.createElement)(O.__experimentalZStack,{isLayered:!1,offset:-8},i.slice(0,5).map((e=>{let{color:t}=e;return(0,o.createElement)(O.ColorIndicator,{key:t,colorValue:t})})))),(0,o.createElement)(O.FlexItem,null,c)))))};function Or(e){let{name:t,parentMenu:n}=e;const r=qn(t),a=r.includes("backgroundColor")||r.includes("background"),[l]=jn("color.background",t),[i]=jn("color.gradient",t);return a?(0,o.createElement)(Rn,{path:n+"/colors/background"},(0,o.createElement)(O.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(O.FlexItem,null,(0,o.createElement)(O.ColorIndicator,{colorValue:null!=i?i:l})),(0,o.createElement)(O.FlexItem,null,(0,E.__)("Background")))):null}function Dr(e){let{name:t,parentMenu:n}=e;const r=qn(t).includes("color"),[a]=jn("color.text",t);return r?(0,o.createElement)(Rn,{path:n+"/colors/text"},(0,o.createElement)(O.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(O.FlexItem,null,(0,o.createElement)(O.ColorIndicator,{colorValue:a})),(0,o.createElement)(O.FlexItem,null,(0,E.__)("Text")))):null}function Fr(e){let{name:t,parentMenu:n}=e;const r=qn(t).includes("linkColor"),[a]=jn("elements.link.color.text",t);return r?(0,o.createElement)(Rn,{path:n+"/colors/link"},(0,o.createElement)(O.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(O.FlexItem,null,(0,o.createElement)(O.ColorIndicator,{colorValue:a})),(0,o.createElement)(O.FlexItem,null,(0,E.__)("Links")))):null}var zr=function(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(kr,{title:(0,E.__)("Colors"),description:(0,E.__)("Manage palettes and the default color of different global elements on the site.")}),(0,o.createElement)("div",{className:"edit-site-global-styles-screen-colors"},(0,o.createElement)(O.__experimentalVStack,{spacing:10},(0,o.createElement)(Br,{name:t}),(0,o.createElement)(O.__experimentalVStack,{spacing:3},(0,o.createElement)(Nr,null,(0,E.__)("Elements")),(0,o.createElement)(O.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,o.createElement)(Or,{name:t,parentMenu:n}),(0,o.createElement)(Dr,{name:t,parentMenu:n}),(0,o.createElement)(Fr,{name:t,parentMenu:n}))))))};function Vr(e){let{name:t}=e;const[n,r]=$n("color.palette.theme",t),[a]=$n("color.palette.theme",t,"base"),[l,i]=$n("color.palette.default",t),[s]=$n("color.palette.default",t,"base"),[c,u]=$n("color.palette.custom",t),[m]=$n("color.defaultPalette",t);return(0,o.createElement)(O.__experimentalVStack,{className:"edit-site-global-styles-color-palette-panel",spacing:10},!!n&&!!n.length&&(0,o.createElement)(O.__experimentalPaletteEdit,{canReset:n!==a,canOnlyChangeValues:!0,colors:n,onChange:r,paletteLabel:(0,E.__)("Theme")}),!!l&&!!l.length&&!!m&&(0,o.createElement)(O.__experimentalPaletteEdit,{canReset:l!==s,canOnlyChangeValues:!0,colors:l,onChange:i,paletteLabel:(0,E.__)("Default")}),(0,o.createElement)(O.__experimentalPaletteEdit,{colors:c,onChange:u,paletteLabel:(0,E.__)("Custom"),emptyMessage:(0,E.__)("Custom colors are empty! Add some colors to create your own color palette."),slugPrefix:"custom-"}))}function Gr(e){let{name:t}=e;const[n,r]=$n("color.gradients.theme",t),[a]=$n("color.gradients.theme",t,"base"),[l,i]=$n("color.gradients.default",t),[s]=$n("color.gradients.default",t,"base"),[c,u]=$n("color.gradients.custom",t),[m]=$n("color.defaultGradients",t),[d]=$n("color.duotone")||[];return(0,o.createElement)(O.__experimentalVStack,{className:"edit-site-global-styles-gradient-palette-panel",spacing:10},!!n&&!!n.length&&(0,o.createElement)(O.__experimentalPaletteEdit,{canReset:n!==a,canOnlyChangeValues:!0,gradients:n,onChange:r,paletteLabel:(0,E.__)("Theme")}),!!l&&!!l.length&&!!m&&(0,o.createElement)(O.__experimentalPaletteEdit,{canReset:l!==s,canOnlyChangeValues:!0,gradients:l,onChange:i,paletteLabel:(0,E.__)("Default")}),(0,o.createElement)(O.__experimentalPaletteEdit,{gradients:c,onChange:u,paletteLabel:(0,E.__)("Custom"),emptyMessage:(0,E.__)("Custom gradients are empty! Add some gradients to create your own palette."),slugPrefix:"custom-"}),(0,o.createElement)("div",null,(0,o.createElement)(Nr,null,(0,E.__)("Duotone")),(0,o.createElement)(O.__experimentalSpacer,{margin:3}),(0,o.createElement)(O.DuotonePicker,{duotonePalette:d,disableCustomDuotone:!0,disableCustomColors:!0,clearable:!1,onChange:H.noop})))}var Hr=function(e){let{name:t}=e;const[n,r]=(0,o.useState)("solid");return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(kr,{title:(0,E.__)("Palette"),description:(0,E.__)("Palettes are used to provide default color options for blocks and various design tools. Here you can edit the colors with their labels.")}),(0,o.createElement)(O.__experimentalToggleGroupControl,{className:"edit-site-screen-color-palette-toggle",value:n,onChange:r,label:(0,E.__)("Select palette type"),hideLabelFromVision:!0,isBlock:!0},(0,o.createElement)(O.__experimentalToggleGroupControlOption,{value:"solid",label:(0,E.__)("Solid")}),(0,o.createElement)(O.__experimentalToggleGroupControlOption,{value:"gradient",label:(0,E.__)("Gradient")})),"solid"===n&&(0,o.createElement)(Vr,{name:t}),"gradient"===n&&(0,o.createElement)(Gr,{name:t}))},Ur=function(e){let{name:t}=e;const n=qn(t),[r]=$n("color.palette",t),[a]=$n("color.gradients",t),[l]=$n("color.custom",t),[i]=$n("color.customGradient",t),s=Xn(t),c=function(e){const[t]=$n("color.gradients.custom",e),[n]=$n("color.gradients.theme",e),[r]=$n("color.gradients.default",e),[a]=$n("color.defaultGradients");return(0,o.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,E._x)("Theme","Indicates this palette comes from the theme."),gradients:n}),a&&r&&r.length&&e.push({name:(0,E._x)("Default","Indicates this palette comes from WordPress."),gradients:r}),t&&t.length&&e.push({name:(0,E._x)("Custom","Indicates this palette is created by the user."),gradients:t}),e}),[t,n,r])}(t),[u]=$n("color.background",t),m=n.includes("backgroundColor")&&u&&(r.length>0||l),d=n.includes("background")&&(a.length>0||i),[p,_]=jn("color.background",t),[g]=jn("color.background",t,"user"),[h,f]=jn("color.gradient",t),[y]=jn("color.gradient",t,"user");if(!m&&!d)return null;let v={};m&&(v={colorValue:p,onColorChange:_},p&&(v.clearable=p===g));let b={};d&&(b={gradientValue:h,onGradientChange:f},h&&(b.clearable=h===y));const w={...v,...b};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(kr,{title:(0,E.__)("Background"),description:(0,E.__)("Set a background color or gradient for the whole site.")}),(0,o.createElement)(xe.__experimentalColorGradientControl,A({className:"edit-site-screen-background-color__control",colors:s,gradients:c,disableCustomColors:!l,disableCustomGradients:!i,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0},w)))},Wr=function(e){let{name:t}=e;const n=qn(t),[r]=$n("color.palette",t),[a]=$n("color.custom",t),[l]=$n("color.text",t),i=Xn(t),s=n.includes("color")&&l&&(r.length>0||a),[c,u]=jn("color.text",t),[m]=jn("color.text",t,"user");return s?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(kr,{title:(0,E.__)("Text"),description:(0,E.__)("Set the default color used for text across the site.")}),(0,o.createElement)(xe.__experimentalColorGradientControl,{className:"edit-site-screen-text-color__control",colors:i,disableCustomColors:!a,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:c,onColorChange:u,clearable:c===m})):null},$r=function(e){let{name:t}=e;const n=qn(t),[r]=$n("color.palette",t),[a]=$n("color.custom",t),l=Xn(t),[i]=$n("color.link",t),s=n.includes("linkColor")&&i&&(r.length>0||a),[c,u]=jn("elements.link.color.text",t),[m]=jn("elements.link.color.text",t,"user");return s?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(kr,{title:(0,E.__)("Links"),description:(0,E.__)("Set the default color used for links across the site.")}),(0,o.createElement)(xe.__experimentalColorGradientControl,{className:"edit-site-screen-link-color__control",colors:l,disableCustomColors:!a,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:c,onColorChange:u,clearable:c===m})):null},jr=function(e){let{name:t}=e;const n=Qn(t),r=lr(t);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(kr,{title:(0,E.__)("Layout")}),r&&(0,o.createElement)(mr,{name:t}),n&&(0,o.createElement)(nr,{name:t}))};function Yr(e,t){if(Array.isArray(t))return t}function qr(e,t){return(0,H.mergeWith)({},e,t,Yr)}const Xr=e=>{if(!(0,H.isObject)(e)||Array.isArray(e))return e;const t=(0,H.pickBy)((0,H.mapValues)(e,Xr),H.identity);return(0,H.isEmpty)(t)?void 0:t};function Kr(e){let{children:t}=e;const n=function(){const[e,t,n]=function(){const{globalStylesId:e,settings:t,styles:n}=(0,c.useSelect)((e=>{const t=e(u.store).__experimentalGetCurrentGlobalStylesId(),n=t?e(u.store).getEditedEntityRecord("root","globalStyles",t):void 0;return{globalStylesId:t,settings:null==n?void 0:n.settings,styles:null==n?void 0:n.styles}}),[]),{getEditedEntityRecord:r}=(0,c.useSelect)(u.store),{editEntityRecord:a}=(0,c.useDispatch)(u.store),l=(0,o.useMemo)((()=>({settings:null!=t?t:{},styles:null!=n?n:{}})),[t,n]),i=(0,o.useCallback)((t=>{var n,l;const o=r("root","globalStyles",e),i=t({styles:null!==(n=null==o?void 0:o.styles)&&void 0!==n?n:{},settings:null!==(l=null==o?void 0:o.settings)&&void 0!==l?l:{}});a("root","globalStyles",e,{styles:Xr(i.styles)||{},settings:Xr(i.settings)||{}})}),[e]);return[!!t||!!n,l,i]}(),[r,a]=function(){const e=(0,c.useSelect)((e=>e(u.store).__experimentalGetCurrentThemeBaseGlobalStyles()),[]);return[!!e,e]}(),l=(0,o.useMemo)((()=>a&&t?qr(a,t):{}),[t,a]);return(0,o.useMemo)((()=>({isReady:e&&r,user:t,base:a,merged:l,setUserConfig:n})),[l,t,a,n,e,r])}();return n.isReady?(0,o.createElement)(Un.Provider,{value:n},t):null}function Qr(e){let{variation:t}=e;const{base:n,user:r,setUserConfig:a}=(0,o.useContext)(Un),l=(0,o.useMemo)((()=>{var e,r;return{user:{settings:null!==(e=t.settings)&&void 0!==e?e:{},styles:null!==(r=t.styles)&&void 0!==r?r:{}},base:n,merged:qr(n,t),setUserConfig:()=>{}}}),[t,n]),i=()=>{a((()=>({settings:t.settings,styles:t.styles})))},s=(0,o.useMemo)((()=>{return e=r,n=t,(0,H.isEqual)(e.styles,n.styles)&&(0,H.isEqual)(e.settings,n.settings);var e,n}),[r,t]);return(0,o.createElement)(Un.Provider,{value:l},(0,o.createElement)("div",{className:B()("edit-site-global-styles-variations_item",{"is-active":s}),role:"button",onClick:i,onKeyDown:e=>{e.keyCode===Rt.ENTER&&(e.preventDefault(),i())},tabIndex:"0"},(0,o.createElement)(Sr,{height:100})))}var Zr=function(){const{variations:e}=(0,c.useSelect)((e=>({variations:e(u.store).__experimentalGetCurrentThemeGlobalStylesVariations()})),[]),t=(0,o.useMemo)((()=>[{name:(0,E.__)("Default"),settings:{},styles:{}},...e]),[e]);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(kr,{back:"/",title:(0,E.__)("Other styles"),description:(0,E.__)("Choose a different style combination for the theme styles")}),(0,o.createElement)(O.Card,{size:"small",isBorderless:!0},(0,o.createElement)(O.CardBody,null,(0,o.createElement)(O.__experimentalGrid,{columns:2},null==t?void 0:t.map(((e,t)=>(0,o.createElement)(Qr,{key:t,variation:e})))))))};function Jr(e){let{className:t,...n}=e;return(0,o.createElement)(O.__experimentalNavigatorScreen,A({className:["edit-site-global-styles-sidebar__navigator-screen",t].filter(Boolean).join(" ")},n))}function ea(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Jr,{path:n+"/typography"},(0,o.createElement)(Mr,{name:t})),(0,o.createElement)(Jr,{path:n+"/typography/text"},(0,o.createElement)(Ar,{name:t,element:"text"})),(0,o.createElement)(Jr,{path:n+"/typography/link"},(0,o.createElement)(Ar,{name:t,element:"link"})),(0,o.createElement)(Jr,{path:n+"/colors"},(0,o.createElement)(zr,{name:t})),(0,o.createElement)(Jr,{path:n+"/colors/palette"},(0,o.createElement)(Hr,{name:t})),(0,o.createElement)(Jr,{path:n+"/colors/background"},(0,o.createElement)(Ur,{name:t})),(0,o.createElement)(Jr,{path:n+"/colors/text"},(0,o.createElement)(Wr,{name:t})),(0,o.createElement)(Jr,{path:n+"/colors/link"},(0,o.createElement)($r,{name:t})),(0,o.createElement)(Jr,{path:n+"/layout"},(0,o.createElement)(jr,{name:t})))}var ta=function(){const e=(0,i.getBlockTypes)();return(0,o.createElement)(O.__experimentalNavigatorProvider,{className:"edit-site-global-styles-sidebar__navigator-provider",initialPath:"/"},(0,o.createElement)(Jr,{path:"/"},(0,o.createElement)(xr,null)),(0,o.createElement)(Jr,{path:"/variations"},(0,o.createElement)(Zr,null)),(0,o.createElement)(Jr,{path:"/blocks"},(0,o.createElement)(Cr,null)),e.map((e=>(0,o.createElement)(Jr,{key:"menu-block-"+e.name,path:"/blocks/"+e.name},(0,o.createElement)(Ir,{name:e.name})))),(0,o.createElement)(ea,null),e.map((e=>(0,o.createElement)(ea,{key:"screens-block-"+e.name,name:e.name}))))};function na(){const[e,t]=(()=>{const{user:e,setUserConfig:t}=(0,o.useContext)(Un);return[!!e&&!(0,H.isEqual)(e,Wn),(0,o.useCallback)((()=>t((()=>Wn))),[t])]})(),{toggleFeature:n}=(0,c.useDispatch)(_t);return(0,o.createElement)(Tn,{className:"edit-site-global-styles-sidebar",identifier:"edit-site/global-styles",title:(0,E.__)("Styles"),icon:Cn,closeLabel:(0,E.__)("Close global styles sidebar"),panelClassName:"edit-site-global-styles-sidebar__panel",header:(0,o.createElement)(O.Flex,null,(0,o.createElement)(O.FlexBlock,null,(0,o.createElement)("strong",null,(0,E.__)("Styles")),(0,o.createElement)("span",{className:"edit-site-global-styles-sidebar__beta"},(0,E.__)("Beta"))),(0,o.createElement)(O.FlexItem,null,(0,o.createElement)(O.DropdownMenu,{icon:At,label:(0,E.__)("More Global Styles Actions"),toggleProps:{disabled:!e},controls:[{title:(0,E.__)("Reset to defaults"),onClick:t},{title:(0,E.__)("Welcome Guide"),onClick:()=>n("welcomeGuideStyles")}]})))},(0,o.createElement)(ta,null))}const ra="edit-site/template",aa="edit-site/block-inspector";var la=e=>{let{sidebarName:t}=e;const{enableComplementaryArea:n}=(0,c.useDispatch)(oe),[r,a]=t===ra?// translators: ARIA label for the Template sidebar tab, selected.
[(0,E.__)("Template (selected)"),"is-active"]:// translators: ARIA label for the Template Settings Sidebar tab, not selected.
[(0,E.__)("Template"),""],[l,i]=t===aa?// translators: ARIA label for the Block Settings Sidebar tab, selected.
[(0,E.__)("Block (selected)"),"is-active"]:// translators: ARIA label for the Block Settings Sidebar tab, not selected.
[(0,E.__)("Block"),""];return(0,o.createElement)("ul",null,(0,o.createElement)("li",null,(0,o.createElement)(O.Button,{onClick:()=>n(y,ra),className:`edit-site-sidebar__panel-tab ${a}`,"aria-label":r,"data-label":(0,E.__)("Template")},// translators: Text label for the Template Settings Sidebar tab.
(0,E.__)("Template"))),(0,o.createElement)("li",null,(0,o.createElement)(O.Button,{onClick:()=>n(y,aa),className:`edit-site-sidebar__panel-tab ${i}`,"aria-label":l,"data-label":(0,E.__)("Block")},// translators: Text label for the Block Settings Sidebar tab.
(0,E.__)("Block"))))};function oa(e){let{area:t,clientId:n}=e;const{selectBlock:r,toggleBlockHighlight:a}=(0,c.useDispatch)(xe.store),l=(0,c.useSelect)((e=>e(m.store).__experimentalGetDefaultTemplatePartAreas().find((e=>e.area===t))),[t]),i=()=>a(n,!0),s=()=>a(n,!1);return(0,o.createElement)(O.Button,{className:"edit-site-template-card__template-areas-item",icon:null==l?void 0:l.icon,onMouseOver:i,onMouseLeave:s,onFocus:i,onBlur:s,onClick:()=>{r(n)}},null==l?void 0:l.label)}function ia(){const e=(0,c.useSelect)((e=>e(_t).getCurrentTemplateTemplateParts()),[]);return e.length?(0,o.createElement)("section",{className:"edit-site-template-card__template-areas"},(0,o.createElement)(O.__experimentalHeading,{level:3,className:"edit-site-template-card__template-areas-title"},(0,E.__)("Areas")),(0,o.createElement)("ul",{className:"edit-site-template-card__template-areas-list"},e.map((e=>{let{templatePart:t,block:n}=e;return(0,o.createElement)("li",{key:t.slug},(0,o.createElement)(oa,{area:t.area,clientId:n.clientId}))})))):null}function sa(){const{title:e,description:t,icon:n}=(0,c.useSelect)((e=>{const{getEditedPostType:t,getEditedPostId:n}=e(_t),{getEntityRecord:r}=e(u.store),{__experimentalGetTemplateInfo:a}=e(m.store),l=r("postType",t(),n());return l?a(l):{}}),[]);return e||t?(0,o.createElement)("div",{className:"edit-site-template-card"},(0,o.createElement)(O.Icon,{className:"edit-site-template-card__icon",icon:n}),(0,o.createElement)("div",{className:"edit-site-template-card__content"},(0,o.createElement)("h2",{className:"edit-site-template-card__title"},e),(0,o.createElement)("div",{className:"edit-site-template-card__description"},t),(0,o.createElement)(ia,null))):null}const{Slot:ca,Fill:ua}=(0,O.createSlotFill)("EditSiteSidebarInspector"),ma=ua;function da(){const{sidebar:e,isEditorSidebarOpened:t,hasBlockSelection:n}=(0,c.useSelect)((e=>{const t=e(oe).getActiveComplementaryArea(y);return{sidebar:t,isEditorSidebarOpened:[aa,ra].includes(t),hasBlockSelection:!!e(xe.store).getBlockSelectionStart()}}),[]),{enableComplementaryArea:r}=(0,c.useDispatch)(oe);(0,o.useEffect)((()=>{t&&r(y,n?aa:ra)}),[n,t]);let a=e;return t||(a=n?aa:ra),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Tn,{identifier:a,title:(0,E.__)("Settings"),icon:kn,closeLabel:(0,E.__)("Close settings sidebar"),header:(0,o.createElement)(la,{sidebarName:a}),headerClassName:"edit-site-sidebar__panel-tabs"},a===ra&&(0,o.createElement)(O.PanelBody,null,(0,o.createElement)(sa,null)),a===aa&&(0,o.createElement)(ca,{bubblesVirtually:!0})),(0,o.createElement)(na,null))}var pa=window.wp.htmlEntities,_a=(0,o.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(D.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})),ga=(0,o.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(D.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"}));const ha="__experimentalMainDashboardButton",{Fill:fa,Slot:Ea}=(0,O.createSlotFill)(ha),ya=fa;ya.Slot=e=>{let{children:t}=e;const n=(0,O.__experimentalUseSlot)(ha);return Boolean(n.fills&&n.fills.length)?(0,o.createElement)(Ea,{bubblesVirtually:!0}):t};var va=ya;const ba="site-editor";function wa(e){let{params:t,replace:n,...r}=e;const a=hn(t,n);return(0,o.createElement)(O.__experimentalNavigationItem,A({},a,r))}var Sa=e=>{let{activeItem:t=ba}=e;const{isNavigationOpen:n,siteTitle:r}=(0,c.useSelect)((e=>{const{getEntityRecord:t}=e(u.store);return{siteTitle:(t("root","__unstableBase",void 0)||{}).name,isNavigationOpen:e(_t).isNavigationOpened()}}),[]),{setIsNavigationPanelOpened:a}=(0,c.useDispatch)(_t);return(0,o.createElement)("div",{className:B()("edit-site-navigation-panel",{"is-open":n}),onKeyDown:e=>{e.keyCode!==Rt.ESCAPE||e.defaultPrevented||(e.preventDefault(),a(!1))}},(0,o.createElement)("div",{className:"edit-site-navigation-panel__inner"},(0,o.createElement)("div",{className:"edit-site-navigation-panel__site-title-container"},(0,o.createElement)("div",{className:"edit-site-navigation-panel__site-title"},(0,pa.decodeEntities)(r))),(0,o.createElement)("div",{className:"edit-site-navigation-panel__scroll-container"},(0,o.createElement)(O.__experimentalNavigation,{activeItem:t},(0,o.createElement)(va.Slot,null,(0,o.createElement)(O.__experimentalNavigationBackButton,{backButtonLabel:(0,E.__)("Dashboard"),className:"edit-site-navigation-panel__back-to-dashboard",href:"index.php"})),(0,o.createElement)(O.__experimentalNavigationMenu,null,(0,o.createElement)(O.__experimentalNavigationGroup,{title:(0,E.__)("Editor")},(0,o.createElement)(wa,{icon:_a,title:(0,E.__)("Site"),item:ba,params:{postId:void 0,postType:void 0}}),(0,o.createElement)(wa,{icon:On,title:(0,E.__)("Templates"),item:"wp_template",params:{postId:void 0,postType:"wp_template"}}),(0,o.createElement)(wa,{icon:ga,title:(0,E.__)("Template Parts"),item:"wp_template_part",params:{postId:void 0,postType:"wp_template_part"}})))))))},xa=(0,o.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,o.createElement)(D.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"})),ka=function(e){let{icon:t}=e;const{isNavigationOpen:n,isRequestingSiteIcon:r,siteIconUrl:a}=(0,c.useSelect)((e=>{const{getEntityRecord:t,isResolving:n}=e(u.store),r=t("root","__unstableBase",void 0)||{};return{isNavigationOpen:e(_t).isNavigationOpened(),isRequestingSiteIcon:n("core","getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:r.site_icon_url}}),[]),{setIsNavigationPanelOpened:l}=(0,c.useDispatch)(_t),i=(0,we.useReducedMotion)(),s=(0,o.useRef)();(0,o.useEffect)((()=>{n||s.current.focus()}),[n]);let m=(0,o.createElement)(O.Icon,{size:"36px",icon:xa});return a?m=(0,o.createElement)(O.__unstableMotion.img,{variants:!i&&{expand:{scale:1.7,borderRadius:0,transition:{type:"tween",duration:"0.2"}}},alt:(0,E.__)("Site Icon"),className:"edit-site-navigation-toggle__site-icon",src:a}):r?m=null:t&&(m=(0,o.createElement)(O.Icon,{size:"36px",icon:t})),(0,o.createElement)(O.__unstableMotion.div,{className:"edit-site-navigation-toggle"+(n?" is-open":""),whileHover:"expand"},(0,o.createElement)(O.Button,{className:"edit-site-navigation-toggle__button has-icon",label:(0,E.__)("Toggle navigation"),ref:s,"aria-pressed":n,onClick:()=>l(!n),showTooltip:!0},m))};const{Fill:Ta,Slot:Ca}=(0,O.createSlotFill)("EditSiteNavigationPanelPreview"),{Fill:Ia,Slot:Na}=(0,O.createSlotFill)("EditSiteNavigationSidebar");function Pa(e){let{isDefaultOpen:t=!1,activeTemplateType:n}=e;const r=(0,we.useViewportMatch)("medium"),{setIsNavigationPanelOpened:a}=(0,c.useDispatch)(_t);return(0,o.useEffect)((function(){a(t&&r)}),[t,r,a]),(0,o.createElement)(Ia,null,(0,o.createElement)(ka,null),(0,o.createElement)(Sa,{activeItem:n}),(0,o.createElement)(Ca,null))}Pa.Slot=Na;var Ma=Pa,Ra=window.wp.reusableBlocks;function Aa(e){let{clientId:t}=e;const{getBlocks:n}=(0,c.useSelect)(xe.store),{replaceBlocks:r}=(0,c.useDispatch)(xe.store);return(0,o.createElement)(xe.BlockSettingsMenuControls,null,(e=>{let{onClose:a}=e;return(0,o.createElement)(O.MenuItem,{onClick:()=>{r(t,n(t)),a()}},(0,E.__)("Detach blocks from template part"))}))}function La(e){let{closeModal:t,onCreate:n}=e;const[r,a]=(0,o.useState)(""),[l,i]=(0,o.useState)(v),[s,u]=(0,o.useState)(!1),d=(0,we.useInstanceId)(La),p=(0,c.useSelect)((e=>e(m.store).__experimentalGetDefaultTemplatePartAreas()),[]);return(0,o.createElement)(O.Modal,{title:(0,E.__)("Create a template part"),closeLabel:(0,E.__)("Close"),onRequestClose:t,overlayClassName:"edit-site-create-template-part-modal"},(0,o.createElement)("form",{onSubmit:async e=>{e.preventDefault(),r&&(u(!0),await n({title:r,area:l}))}},(0,o.createElement)(O.TextControl,{label:(0,E.__)("Name"),value:r,onChange:a,required:!0}),(0,o.createElement)(O.BaseControl,{label:(0,E.__)("Area"),id:`edit-site-create-template-part-modal__area-selection-${d}`,className:"edit-site-create-template-part-modal__area-base-control"},(0,o.createElement)(O.__experimentalRadioGroup,{label:(0,E.__)("Area"),className:"edit-site-create-template-part-modal__area-radio-group",id:`edit-site-create-template-part-modal__area-selection-${d}`,onChange:i,checked:l},p.map((e=>{let{icon:t,label:n,area:r,description:a}=e;return(0,o.createElement)(O.__experimentalRadio,{key:n,value:r,className:"edit-site-create-template-part-modal__area-radio"},(0,o.createElement)(O.Flex,{align:"start",justify:"start"},(0,o.createElement)(O.FlexItem,null,(0,o.createElement)(O.Icon,{icon:t})),(0,o.createElement)(O.FlexBlock,{className:"edit-site-create-template-part-modal__option-label"},n,(0,o.createElement)("div",null,a)),(0,o.createElement)(O.FlexItem,{className:"edit-site-create-template-part-modal__checkbox"},l===r&&(0,o.createElement)(O.Icon,{icon:F}))))})))),(0,o.createElement)(O.Flex,{className:"edit-site-create-template-part-modal__modal-actions",justify:"flex-end"},(0,o.createElement)(O.FlexItem,null,(0,o.createElement)(O.Button,{variant:"secondary",onClick:()=>{t()}},(0,E.__)("Cancel"))),(0,o.createElement)(O.FlexItem,null,(0,o.createElement)(O.Button,{variant:"primary",type:"submit",disabled:!r,isBusy:s},(0,E.__)("Create"))))))}function Ba(e){let{clientIds:t,blocks:n}=e;const[r,a]=(0,o.useState)(!1),{replaceBlocks:l}=(0,c.useDispatch)(xe.store),{saveEntityRecord:s}=(0,c.useDispatch)(u.store),{createSuccessNotice:m}=(0,c.useDispatch)(R.store);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(xe.BlockSettingsMenuControls,null,(()=>(0,o.createElement)(O.MenuItem,{onClick:()=>{a(!0)}},(0,E.__)("Make template part")))),r&&(0,o.createElement)(La,{closeModal:()=>{a(!1)},onCreate:async e=>{let{title:r,area:a}=e;const o=await s("postType","wp_template_part",{slug:(0,H.kebabCase)(r),title:r,content:(0,i.serialize)(n),area:a});l(t,(0,i.createBlock)("core/template-part",{slug:o.slug,theme:o.theme})),m((0,E.__)("Template part created."),{type:"snackbar"})}}))}function Oa(){var e;const{clientIds:t,blocks:n}=(0,c.useSelect)((e=>{const{getSelectedBlockClientIds:t,getBlocksByClientId:n}=e(xe.store),r=t();return{clientIds:r,blocks:n(r)}}),[]);return 1===n.length&&"core/template-part"===(null===(e=n[0])||void 0===e?void 0:e.name)?(0,o.createElement)(Aa,{clientId:t[0]}):(0,o.createElement)(Ba,{clientIds:t,blocks:n})}var Da=(0,o.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(D.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"}));function Fa(e){let{type:t,id:n,activePage:r,onActivePageChange:a}=e;const l=(0,c.useSelect)((e=>t&&n&&"URL"!==t&&e(u.store).getEntityRecord("postType",t,n)),[t,n]),i=(0,o.useMemo)((()=>{if(null==l||!l.link)return null;const e=(0,p.getPathAndQueryString)(l.link);return e===(null==r?void 0:r.path)?null:()=>a({type:t,slug:l.slug,path:e,context:{postType:l.type,postId:l.id}})}),[l,null==r?void 0:r.path,a]);return i&&(0,o.createElement)(O.Button,{icon:Da,label:(0,E.__)("Edit Page Template"),onClick:i})}function za(e){let{onClick:t=(()=>{})}=e;const{shortcut:n,isBlockInspectorOpen:r}=(0,c.useSelect)((e=>({shortcut:e(Nt.store).getShortcutRepresentation("core/edit-site/toggle-block-settings-sidebar"),isBlockInspectorOpen:e(oe).getActiveComplementaryArea(_t.name)===aa})),[]),{enableComplementaryArea:a,disableComplementaryArea:l}=(0,c.useDispatch)(oe),i=r?(0,E.__)("Hide more settings"):(0,E.__)("Show more settings");return(0,o.createElement)(O.MenuItem,{onClick:()=>{r?(l(y),(0,ke.speak)((0,E.__)("Block settings closed"))):(a(y,aa),(0,ke.speak)((0,E.__)("Additional settings are now available in the Editor block settings sidebar"))),t()},shortcut:n},i)}function Va(){return(0,o.createElement)(xe.BlockSettingsMenuControls,null,(e=>{let{selectedClientIds:t,onClose:n}=e;return(0,o.createElement)(Ga,{selectedClientId:t[0],onClose:n})}))}function Ga(e){let{selectedClientId:t,onClose:n}=e;const{params:r}=kt(),a=(0,c.useSelect)((e=>{const n=e(xe.store).getBlock(t);if(n&&(0,i.isTemplatePart)(n)){const{theme:t,slug:r}=n.attributes;return e(u.store).getEntityRecord("postType","wp_template_part",`${t}//${r}`)}}),[t]),l=hn({postId:null==a?void 0:a.id,postType:null==a?void 0:a.type},{fromTemplateId:r.postId});return a?(0,o.createElement)(O.MenuItem,A({},l,{onClick:e=>{l.onClick(e),n()}}),
/* translators: %s: template part title */
(0,E.sprintf)((0,E.__)("Edit %s"),a.slug)):null}var Ha=(0,o.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(D.Path,{d:"M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"})),Ua=function(){var e;const t=kt(),n=Tt(),r="wp_template_part"===t.params.postType,a=null===(e=t.state)||void 0===e?void 0:e.fromTemplateId;return r&&a?(0,o.createElement)(O.Button,{className:"edit-site-visual-editor__back-button",icon:Ha,onClick:()=>{n.back()}},(0,E.__)("Back")):null};function Wa(e){let{direction:t,resizeWidthBy:n}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("button",{className:`resizable-editor__drag-handle is-${t}`,"aria-label":(0,E.__)("Drag to resize"),"aria-describedby":`resizable-editor__resize-help-${t}`,onKeyDown:function(e){const{keyCode:r}=e;"left"===t&&r===Rt.LEFT||"right"===t&&r===Rt.RIGHT?n(20):("left"===t&&r===Rt.RIGHT||"right"===t&&r===Rt.LEFT)&&n(-20)}}),(0,o.createElement)(O.VisuallyHidden,{id:`resizable-editor__resize-help-${t}`},(0,E.__)("Use left and right arrow keys to resize the canvas.")))}const $a={position:void 0,userSelect:void 0,cursor:void 0,width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0};var ja=function(e){let{enableResizing:t,settings:n,...r}=e;const a=(0,c.useSelect)((e=>e(_t).__experimentalGetPreviewDeviceType()),[]),l=(0,xe.__experimentalUseResizeCanvas)(a),[i,s]=(0,o.useState)("100%"),[u,m]=(0,o.useState)("100%"),d=(0,o.useRef)(),p=(0,xe.__unstableUseMouseMoveTypingReset)(),_=(0,we.useMergeRefs)([d,p]);(0,o.useEffect)((function(){const e=d.current;if(!e||!t)return;let n,r=null;function a(){r||(r=e.contentWindow.requestAnimationFrame((()=>{m(e.contentDocument.documentElement.scrollHeight),r=null})))}function l(){var t;null===(t=n)||void 0===t||t.disconnect(),n=new e.contentWindow.ResizeObserver(a),n.observe(e.contentDocument.documentElement),a()}return e.addEventListener("load",l),l(),()=>{var t,a;null===(t=e.contentWindow)||void 0===t||t.cancelAnimationFrame(r),null===(a=n)||void 0===a||a.disconnect(),e.removeEventListener("load",l)}}),[t]);const g=(0,o.useCallback)((e=>{d.current&&s(d.current.offsetWidth+e)}),[]);return(0,o.createElement)(O.ResizableBox,{size:{width:i,height:u},onResizeStop:(e,t,n)=>{s(n.style.width)},minWidth:300,maxWidth:"100%",maxHeight:"100%",enable:{right:t,left:t},showHandle:t,resizeRatio:2,handleComponent:{left:(0,o.createElement)(Wa,{direction:"left",resizeWidthBy:g}),right:(0,o.createElement)(Wa,{direction:"right",resizeWidthBy:g})},handleClasses:void 0,handleStyles:{left:$a,right:$a}},(0,o.createElement)(xe.__unstableIframe,A({style:t?void 0:l,head:(0,o.createElement)(o.Fragment,null,(0,o.createElement)(xe.__unstableEditorStyles,{styles:n.styles}),(0,o.createElement)("style",null,".is-root-container { display: flow-root; }"),t&&(0,o.createElement)("style",null,"html, body { height: -moz-fit-content !important; height: fit-content !important; min-height: 0 !important; }",".is-root-container { min-height: 0 !important; }")),assets:n.__unstableResolvedAssets,ref:_,name:"editor-canvas",className:"edit-site-visual-editor__editor-canvas"},r)))};const Ya={type:"default",alignments:[]};function qa(e){let{setIsInserterOpen:t}=e;const{settings:n,templateType:r,templateId:a,page:l}=(0,c.useSelect)((e=>{const{getSettings:n,getEditedPostType:r,getEditedPostId:a,getPage:l}=e(_t);return{settings:n(t),templateType:r(),templateId:a(),page:l()}}),[t]),[i,s,m]=(0,u.useEntityBlockEditor)("postType",r),{setPage:d}=(0,c.useDispatch)(_t),p=(0,o.useRef)(),_=(0,we.useMergeRefs)([p,(0,xe.__unstableUseTypingObserver)()]),g=(0,we.useViewportMatch)("small","<"),{clearSelectedBlock:h}=(0,c.useDispatch)(xe.store),f="wp_template_part"===r;return(0,o.createElement)(xe.BlockEditorProvider,{settings:n,value:i,onInput:s,onChange:m,useSubRegistry:!1},(0,o.createElement)(Va,null),(0,o.createElement)(Oa,null),(0,o.createElement)(xe.__experimentalLinkControl.ViewerFill,null,(0,o.useCallback)((e=>(0,o.createElement)(Fa,A({},e,{activePage:l,onActivePageChange:d}))),[l])),(0,o.createElement)(ma,null,(0,o.createElement)(xe.BlockInspector,null)),(0,o.createElement)(xe.BlockTools,{className:B()("edit-site-visual-editor",{"is-focus-mode":f}),__unstableContentRef:p,onClick:e=>{e.target===e.currentTarget&&h()}},(0,o.createElement)(xe.BlockEditorKeyboardShortcuts.Register,null),(0,o.createElement)(Ua,null),(0,o.createElement)(ja,{key:a,enableResizing:f&&!g,settings:n,contentRef:_},(0,o.createElement)(xe.BlockList,{className:"edit-site-block-editor__block-list wp-site-blocks",__experimentalLayout:Ya,renderAppender:!f&&void 0})),(0,o.createElement)(xe.__unstableBlockSettingsMenuFirstItem,null,(e=>{let{onClose:t}=e;return(0,o.createElement)(za,{onClick:t})}))),(0,o.createElement)(Ra.ReusableBlocksMenuItems,null))}var Xa=n(4042);function Ka(e){let{value:t,onChange:n,onInput:r}=e;const[a,l]=(0,o.useState)(t),[i,s]=(0,o.useState)(!1),c=(0,we.useInstanceId)(Ka);return i||a===t||l(t),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(O.VisuallyHidden,{as:"label",htmlFor:`code-editor-text-area-${c}`},(0,E.__)("Type text or HTML")),(0,o.createElement)(Xa.Z,{autoComplete:"off",dir:"auto",value:a,onChange:e=>{const t=e.target.value;r(t),l(t),s(!0)},onBlur:()=>{i&&(n(a),s(!1))},className:"edit-site-code-editor-text-area",id:`code-editor-text-area-${c}`,placeholder:(0,E.__)("Start writing with text or HTML")}))}function Qa(){const{templateType:e,shortcut:t}=(0,c.useSelect)((e=>{const{getEditedPostType:t}=e(_t),{getShortcutRepresentation:n}=e(Nt.store);return{templateType:t(),shortcut:n("core/edit-site/toggle-mode")}}),[]),[n,r]=(0,u.useEntityProp)("postType",e,"content"),[a,,l]=(0,u.useEntityBlockEditor)("postType",e),s=n instanceof Function?n({blocks:a}):n,{switchEditorMode:m}=(0,c.useDispatch)(_t);return(0,o.createElement)("div",{className:"edit-site-code-editor"},(0,o.createElement)("div",{className:"edit-site-code-editor__toolbar"},(0,o.createElement)("h2",null,(0,E.__)("Editing code")),(0,o.createElement)(O.Button,{variant:"tertiary",onClick:()=>m("visual"),shortcut:t},(0,E.__)("Exit code editor"))),(0,o.createElement)("div",{className:"edit-site-code-editor__body"},(0,o.createElement)(Ka,{value:s,onChange:e=>{l((0,i.parse)(e),{selection:void 0})},onInput:r})))}function Za(e){let{openEntitiesSavedStates:t}=e;const{__experimentalGetDirtyEntityRecords:n,isSavingEntityRecord:r}=(0,c.useSelect)(u.store),{getEditorMode:a}=(0,c.useSelect)(_t),l=(0,c.useSelect)((e=>e(_t).isListViewOpened()),[]),o=(0,c.useSelect)((e=>e(oe).getActiveComplementaryArea(_t.name)===aa),[]),{redo:i,undo:s}=(0,c.useDispatch)(u.store),{setIsListViewOpened:m,switchEditorMode:d}=(0,c.useDispatch)(_t),{enableComplementaryArea:p,disableComplementaryArea:_}=(0,c.useDispatch)(oe);return(0,Nt.useShortcut)("core/edit-site/save",(e=>{e.preventDefault();const a=n(),l=!!a.length;!a.some((e=>r(e.kind,e.name,e.key)))&&l&&t()})),(0,Nt.useShortcut)("core/edit-site/undo",(e=>{s(),e.preventDefault()})),(0,Nt.useShortcut)("core/edit-site/redo",(e=>{i(),e.preventDefault()})),(0,Nt.useShortcut)("core/edit-site/toggle-list-view",(()=>{m(!l)})),(0,Nt.useShortcut)("core/edit-site/toggle-block-settings-sidebar",(e=>{e.preventDefault(),o?_(y):p(y,aa)})),(0,Nt.useShortcut)("core/edit-site/toggle-mode",(()=>{d("visual"===a()?"text":"visual")})),null}Za.Register=function(){const{registerShortcut:e}=(0,c.useDispatch)(Nt.store);return(0,o.useEffect)((()=>{e({name:"core/edit-site/save",category:"global",description:(0,E.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/edit-site/undo",category:"global",description:(0,E.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/edit-site/redo",category:"global",description:(0,E.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"}}),e({name:"core/edit-site/toggle-list-view",category:"global",description:(0,E.__)("Open the block list view."),keyCombination:{modifier:"access",character:"o"}}),e({name:"core/edit-site/toggle-block-settings-sidebar",category:"global",description:(0,E.__)("Show or hide the block settings sidebar."),keyCombination:{modifier:"primaryShift",character:","}}),e({name:"core/edit-site/keyboard-shortcuts",category:"main",description:(0,E.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/edit-site/next-region",category:"global",description:(0,E.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/edit-site/previous-region",category:"global",description:(0,E.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"}]}),e({name:"core/edit-site/toggle-mode",category:"global",description:(0,E.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}})}),[e]),null};var Ja=Za;function el(){const{setTemplate:e,setTemplatePart:t,setPage:n}=(0,c.useDispatch)(_t),{params:{postId:r,postType:a}}=kt();return(0,o.useEffect)((()=>{"page"===a||"post"===a?n({context:{postType:a,postId:r}}):"wp_template"===a?e(r):"wp_template_part"===a&&t(r)}),[r,a]),null}var tl=(0,o.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(D.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));function nl(){const{setIsInserterOpened:e}=(0,c.useDispatch)(_t),t=(0,c.useSelect)((e=>e(_t).__experimentalGetInsertionPoint()),[]),n=(0,we.useViewportMatch)("medium","<"),r=n?"div":O.VisuallyHidden,[a,l]=(0,we.__experimentalUseDialog)({onClose:()=>e(!1),focusOnMount:null}),i=(0,o.useRef)();return(0,o.useEffect)((()=>{i.current.focusSearch()}),[]),(0,o.createElement)("div",A({ref:a},l,{className:"edit-site-editor__inserter-panel"}),(0,o.createElement)(r,{className:"edit-site-editor__inserter-panel-header"},(0,o.createElement)(O.Button,{icon:tl,label:(0,E.__)("Close block inserter"),onClick:()=>e(!1)})),(0,o.createElement)("div",{className:"edit-site-editor__inserter-panel-content"},(0,o.createElement)(xe.__experimentalLibrary,{showInserterHelpPanel:!0,shouldFocusBlock:n,rootClientId:t.rootClientId,__experimentalInsertionIndex:t.insertionIndex,__experimentalFilterValue:t.filterValue,ref:i})))}function rl(){const{setIsListViewOpened:e}=(0,c.useDispatch)(_t),{clearSelectedBlock:t,selectBlock:n}=(0,c.useDispatch)(xe.store),r=(0,we.useFocusOnMount)("firstElement"),a=(0,we.useFocusReturn)(),l=(0,we.useFocusReturn)(),i=`edit-site-editor__list-view-panel-label-${(0,we.useInstanceId)(rl)}`;return(0,o.createElement)("div",{"aria-labelledby":i,className:"edit-site-editor__list-view-panel",onKeyDown:function(t){t.keyCode!==Rt.ESCAPE||t.defaultPrevented||e(!1)}},(0,o.createElement)("div",{className:"edit-site-editor__list-view-panel-header",ref:a},(0,o.createElement)("strong",{id:i},(0,E.__)("List View")),(0,o.createElement)(O.Button,{icon:G,label:(0,E.__)("Close List View Sidebar"),onClick:()=>e(!1)})),(0,o.createElement)("div",{className:"edit-site-editor__list-view-panel-content",ref:(0,we.useMergeRefs)([l,r])},(0,o.createElement)(xe.__experimentalListView,{onSelect:async function(e){await t(),n(e,-1)},showNestedBlocks:!0,__experimentalFeatures:!0,__experimentalPersistentListViewFeatures:!0})))}function al(e){let{text:t,children:n}=e;const r=(0,we.useCopyToClipboard)(t);return(0,o.createElement)(O.Button,{variant:"secondary",ref:r},n)}class ll extends o.Component{constructor(){super(...arguments),this.reboot=this.reboot.bind(this),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}reboot(){this.props.onError()}render(){const{error:e}=this.state;return e?(0,o.createElement)(xe.Warning,{className:"editor-error-boundary",actions:[(0,o.createElement)(O.Button,{key:"recovery",onClick:this.reboot,variant:"secondary"},(0,E.__)("Attempt Recovery")),(0,o.createElement)(al,{key:"copy-error",text:e.stack},(0,E.__)("Copy Error"))]},(0,E.__)("The editor has encountered an unexpected error.")):this.props.children}}function ol(e){let{nonAnimatedSrc:t,animatedSrc:n}=e;return(0,o.createElement)("picture",{className:"edit-site-welcome-guide__image"},(0,o.createElement)("source",{srcSet:t,media:"(prefers-reduced-motion: reduce)"}),(0,o.createElement)("img",{src:n,width:"312",height:"240",alt:""}))}function il(){const{toggleFeature:e}=(0,c.useDispatch)(_t);return(0,c.useSelect)((e=>e(_t).isFeatureActive("welcomeGuide")),[])?(0,o.createElement)(O.Guide,{className:"edit-site-welcome-guide",contentLabel:(0,E.__)("Welcome to the site editor"),finishButtonText:(0,E.__)("Get Started"),onFinish:()=>e("welcomeGuide"),pages:[{image:(0,o.createElement)(ol,{nonAnimatedSrc:"https://s.w.org/images/block-editor/edit-your-site.svg?1",animatedSrc:"https://s.w.org/images/block-editor/edit-your-site.gif?1"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,E.__)("Edit your site")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,E.__)("Design everything on your site — from the header right down to the footer — using blocks.")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,o.createInterpolateElement)((0,E.__)("Click <StylesIconImage /> to start designing your blocks, and choose your typography, layout, and colors."),{StylesIconImage:(0,o.createElement)("img",{alt:(0,E.__)("styles"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z' fill='%231E1E1E'/%3E%3C/svg%3E%0A"})})))}]}):null}function sl(){const{toggleFeature:e}=(0,c.useDispatch)(_t),{isActive:t,isStylesOpen:n}=(0,c.useSelect)((e=>{const t=e(oe).getActiveComplementaryArea(_t.name);return{isActive:e(_t).isFeatureActive("welcomeGuideStyles"),isStylesOpen:"edit-site/global-styles"===t}}),[]);return t&&n?(0,o.createElement)(O.Guide,{className:"edit-site-welcome-guide",contentLabel:(0,E.__)("Welcome to styles"),finishButtonText:(0,E.__)("Get Started"),onFinish:()=>e("welcomeGuideStyles"),pages:[{image:(0,o.createElement)(ol,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-to-styles.svg?1",animatedSrc:"https://s.w.org/images/block-editor/welcome-to-styles.gif?1"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,E.__)("Welcome to Styles")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,E.__)("Tweak your site, or give it a whole new look! Get creative — how about a new color palette for your buttons, or choosing a new font? Take a look at what you can do here.")))},{image:(0,o.createElement)(ol,{nonAnimatedSrc:"https://s.w.org/images/block-editor/set-the-design.svg?1",animatedSrc:"https://s.w.org/images/block-editor/set-the-design.gif?1"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,E.__)("Set the design")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,E.__)("You can customize your site as much as you like with different colors, typography, and layouts. Or if you prefer, just leave it up to your theme to handle! ")))},{image:(0,o.createElement)(ol,{nonAnimatedSrc:"https://s.w.org/images/block-editor/personalize-blocks.svg?1",animatedSrc:"https://s.w.org/images/block-editor/personalize-blocks.gif?1"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,E.__)("Personalize blocks")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,E.__)("You can adjust your blocks to ensure a cohesive experience across your site — add your unique colors to a branded Button block, or adjust the Heading block to your preferred size.")))},{image:(0,o.createElement)(ol,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,E.__)("Learn more")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,E.__)("New to block themes and styling your site? "),(0,o.createElement)(O.ExternalLink,{href:(0,E.__)("https://wordpress.org/support/article/styles-overview/")},(0,E.__)("Here’s a detailed guide to learn how to make the most of it."))))}]}):null}function cl(){return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(il,null),(0,o.createElement)(sl,null))}function ul(){return function(){const[e,t]=wr(),{getSettings:n}=(0,c.useSelect)(_t),{updateSettings:r}=(0,c.useDispatch)(_t);(0,o.useEffect)((()=>{var a;if(!e||!t)return;const l=n(),o=null==l||null===(a=l.styles)||void 0===a?void 0:a.filter((e=>!e.isGlobalStyles));r({...l,styles:[...o,...e],__experimentalFeatures:t})}),[e,t])}(),null}function ml(e){const t=kt(),n=(0,c.useSelect)((e=>{var t;return null===(t=e(u.store).getEntityRecord("root","site"))||void 0===t?void 0:t.title}),[]),r=(0,o.useRef)(!0);(0,o.useEffect)((()=>{r.current=!1}),[t]),(0,o.useEffect)((()=>{if(!r.current&&e&&n){const t=(0,E.sprintf)(
/* translators: Admin screen title. 1: Admin screen name, 2: Network or site name. */
(0,E.__)("%1$s ‹ %2$s — WordPress"),e,n);document.title=t,(0,ke.speak)((0,E.sprintf)(
/* translators: The page title that is currently displaying. */
(0,E.__)("Now displaying: %s"),document.title),"assertive")}}),[e,n,t])}const dl={secondarySidebar:(0,E.__)("Block Library"),drawer:(0,E.__)("Navigation Sidebar")};var pl=function(e){let{onError:t}=e;const{isInserterOpen:n,isListViewOpen:r,sidebarIsOpened:a,settings:l,entityId:i,templateType:s,page:d,template:p,templateResolved:_,isNavigationOpen:g,previousShortcut:h,nextShortcut:f,editorMode:y}=(0,c.useSelect)((e=>{const{isInserterOpened:t,isListViewOpened:n,getSettings:r,getEditedPostType:a,getEditedPostId:l,getPage:o,isNavigationOpened:i,getEditorMode:s}=e(_t),{hasFinishedResolution:c,getEntityRecord:m}=e(u.store),d=a(),p=l();return{isInserterOpen:t(),isListViewOpen:n(),sidebarIsOpened:!!e(oe).getActiveComplementaryArea(_t.name),settings:r(),templateType:d,page:o(),template:p?m("postType",d,p):null,templateResolved:!!p&&c("getEntityRecord",["postType",d,p]),entityId:p,isNavigationOpen:i(),previousShortcut:e(Nt.store).getAllShortcutKeyCombinations("core/edit-site/previous-region"),nextShortcut:e(Nt.store).getAllShortcutKeyCombinations("core/edit-site/next-region"),editorMode:s()}}),[]),{setPage:v,setIsInserterOpened:b}=(0,c.useDispatch)(_t),{enableComplementaryArea:w}=(0,c.useDispatch)(oe),{createErrorNotice:S}=(0,c.useDispatch)(R.store),[x,k]=(0,o.useState)(!1),T=(0,o.useCallback)((()=>k(!0)),[]),C=(0,o.useCallback)((()=>{k(!1)}),[]),I=(0,o.useMemo)((()=>({...null==d?void 0:d.context,queryContext:[(null==d?void 0:d.context.queryContext)||{page:1},e=>v({...d,context:{...null==d?void 0:d.context,queryContext:{...null==d?void 0:d.context.queryContext,...e}}})]})),[null==d?void 0:d.context]);(0,o.useEffect)((()=>{g?document.body.classList.add("is-navigation-sidebar-open"):document.body.classList.remove("is-navigation-sidebar-open")}),[g]),(0,o.useEffect)((function(){"open"===new URLSearchParams(window.location.search).get("styles")&&w("core/edit-site","edit-site/global-styles")}),[w]);const N=(null==l?void 0:l.siteUrl)&&void 0!==s&&void 0!==i;return ml(N&&(0,E.__)("Editor (beta)")),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(el,null),N&&(0,o.createElement)(Nt.ShortcutProvider,null,(0,o.createElement)(u.EntityProvider,{kind:"root",type:"site"},(0,o.createElement)(u.EntityProvider,{kind:"postType",type:s,id:i},(0,o.createElement)(Kr,null,(0,o.createElement)(xe.BlockContextProvider,{value:I},(0,o.createElement)(ul,null),(0,o.createElement)(ll,{onError:t},(0,o.createElement)(Ja.Register,null),(0,o.createElement)(da,null),(0,o.createElement)(Se,{labels:dl,secondarySidebar:n?(0,o.createElement)(nl,null):r?(0,o.createElement)(rl,null):null,sidebar:a&&(0,o.createElement)(be.Slot,{scope:"core/edit-site"}),drawer:(0,o.createElement)(Ma.Slot,null),header:(0,o.createElement)(xn,{openEntitiesSavedStates:T}),notices:(0,o.createElement)(m.EditorSnackbars,null),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)(m.EditorNotices,null),"visual"===y&&p&&(0,o.createElement)(qa,{setIsInserterOpen:b}),"text"===y&&p&&(0,o.createElement)(Qa,null),_&&!p&&(null==l?void 0:l.siteUrl)&&i&&(0,o.createElement)(O.Notice,{status:"warning",isDismissible:!1},(0,E.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")),(0,o.createElement)(Ja,{openEntitiesSavedStates:T})),actions:(0,o.createElement)(o.Fragment,null,x?(0,o.createElement)(m.EntitiesSavedStates,{close:C}):(0,o.createElement)("div",{className:"edit-site-editor__toggle-save-panel"},(0,o.createElement)(O.Button,{variant:"secondary",className:"edit-site-editor__toggle-save-panel-button",onClick:T,"aria-expanded":!1},(0,E.__)("Open save panel")))),footer:(0,o.createElement)(xe.BlockBreadcrumb,{rootLabelText:(0,E.__)("Template")}),shortcuts:{previous:h,next:f}}),(0,o.createElement)(cl,null),(0,o.createElement)(O.Popover.Slot,null),(0,o.createElement)(ie.PluginArea,{onError:function(e){S((0,E.sprintf)(
/* translators: %s: plugin name */
(0,E.__)('The "%s" plugin has encountered an error and cannot be rendered.'),e))}}))))))))};const _l=["front-page","single-post","page","archive","search","404","index"];function gl(e){let{postType:t}=e;const n=Tt(),{templates:r,defaultTemplateTypes:a}=(0,c.useSelect)((e=>({templates:e(u.store).getEntityRecords("postType","wp_template",{per_page:-1}),defaultTemplateTypes:e(m.store).__experimentalGetDefaultTemplateTypes()})),[]),{saveEntityRecord:l}=(0,c.useDispatch)(u.store),{createErrorNotice:i}=(0,c.useDispatch)(R.store),{getLastEntitySaveError:s}=(0,c.useSelect)(u.store),d=(0,H.map)(r,"slug"),p=(0,H.filter)(a,(e=>(0,H.includes)(_l,e.slug)&&!(0,H.includes)(d,e.slug)));return p.length?(0,o.createElement)(O.DropdownMenu,{className:"edit-site-new-template-dropdown",icon:null,text:t.labels.add_new,label:t.labels.add_new_item,popoverProps:{noArrow:!1},toggleProps:{variant:"primary"}},(()=>(0,o.createElement)(O.NavigableMenu,{className:"edit-site-new-template-dropdown__popover"},(0,o.createElement)(O.MenuGroup,{label:t.labels.add_new_item},(0,H.map)(p,(e=>{let{title:t,description:r,slug:c}=e;return(0,o.createElement)(O.MenuItem,{info:r,key:c,onClick:()=>{!async function(e){let{slug:t}=e;try{const{title:e,description:r}=(0,H.find)(a,{slug:t}),o=await l("postType","wp_template",{excerpt:r,slug:t.toString(),status:"publish",title:e}),i=s("postType","wp_template",o.id);if(i)throw i;n.push({postId:o.id,postType:o.type})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,E.__)("An error occurred while creating the template.");i(t,{type:"snackbar"})}}({slug:c})}},t)})))))):null}function hl(e){let{postType:t}=e;const n=Tt(),[r,a]=(0,o.useState)(!1),{createErrorNotice:l}=(0,c.useDispatch)(R.store),{saveEntityRecord:i}=(0,c.useDispatch)(u.store),{getLastEntitySaveError:s}=(0,c.useSelect)(u.store);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(O.Button,{variant:"primary",onClick:()=>{a(!0)}},t.labels.add_new),r&&(0,o.createElement)(La,{closeModal:()=>a(!1),onCreate:async function(e){let{title:t,area:r}=e;if(t)try{const e=await i("postType","wp_template_part",{slug:(0,H.kebabCase)(t),title:t,content:"",area:r}),l=s("postType","wp_template_part",e.id);if(l)throw l;a(!1),n.push({postId:e.id,postType:e.type})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,E.__)("An error occurred while creating the template part.");l(t,{type:"snackbar"}),a(!1)}else l((0,E.__)("Title is not defined."),{type:"snackbar"})}}))}function fl(e){let{templateType:t="wp_template"}=e;const n=(0,c.useSelect)((e=>e(u.store).getPostType(t)),[t]);return n?"wp_template"===t?(0,o.createElement)(gl,{postType:n}):"wp_template_part"===t?(0,o.createElement)(hl,{postType:n}):null:null}function El(e){var t;let{templateType:n}=e;const r=(0,c.useSelect)((e=>e(u.store).getPostType(n)),[n]);return r?(0,o.createElement)("header",{className:"edit-site-list-header"},(0,o.createElement)(O.__experimentalHeading,{level:1,className:"edit-site-list-header__title"},null===(t=r.labels)||void 0===t?void 0:t.name),(0,o.createElement)("div",{className:"edit-site-list-header__right"},(0,o.createElement)(fl,{templateType:n}))):null}function yl(e){let{template:t,onClose:n}=e;const[r,a]=(0,o.useState)((()=>t.title.rendered)),[l,i]=(0,o.useState)(!1),{getLastEntitySaveError:s}=(0,c.useSelect)(u.store),{editEntityRecord:m,saveEditedEntityRecord:d}=(0,c.useDispatch)(u.store),{createSuccessNotice:p,createErrorNotice:_}=(0,c.useDispatch)(R.store);return t.is_custom?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(O.MenuItem,{onClick:()=>{i(!0),a(t.title.rendered)}},(0,E.__)("Rename")),l&&(0,o.createElement)(O.Modal,{title:(0,E.__)("Rename"),closeLabel:(0,E.__)("Close"),onRequestClose:()=>{i(!1)},overlayClassName:"edit-site-list__rename-modal"},(0,o.createElement)("form",{onSubmit:async function(e){e.preventDefault();try{await m("postType",t.type,t.id,{title:r}),a(""),i(!1),n(),await d("postType",t.type,t.id);const e=s("postType",t.type,t.id);if(e)throw e;p((0,E.__)("Entity renamed."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,E.__)("An error occurred while renaming the entity.");_(t,{type:"snackbar"})}}},(0,o.createElement)(O.Flex,{align:"flex-start",gap:8},(0,o.createElement)(O.FlexItem,null,(0,o.createElement)(O.TextControl,{label:(0,E.__)("Name"),value:r,onChange:a,required:!0}))),(0,o.createElement)(O.Flex,{className:"edit-site-list__rename-modal-actions",justify:"flex-end",expanded:!1},(0,o.createElement)(O.FlexItem,null,(0,o.createElement)(O.Button,{variant:"tertiary",onClick:()=>{i(!1)}},(0,E.__)("Cancel"))),(0,o.createElement)(O.FlexItem,null,(0,o.createElement)(O.Button,{variant:"primary",type:"submit"},(0,E.__)("Save"))))))):null}function vl(e){let{template:t}=e;const{removeTemplate:n,revertTemplate:r}=(0,c.useDispatch)(_t),{saveEditedEntityRecord:a}=(0,c.useDispatch)(u.store),{createSuccessNotice:l,createErrorNotice:i}=(0,c.useDispatch)(R.store),s=function(e){return!!e&&"custom"===e.source&&!e.has_theme_file}(t),m=Te(t);return s||m?(0,o.createElement)(O.DropdownMenu,{icon:At,label:(0,E.__)("Actions"),className:"edit-site-list-table__actions"},(e=>{let{onClose:c}=e;return(0,o.createElement)(O.MenuGroup,null,s&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(yl,{template:t,onClose:c}),(0,o.createElement)(O.MenuItem,{isDestructive:!0,isTertiary:!0,onClick:()=>{n(t),c()}},(0,E.__)("Delete"))),m&&(0,o.createElement)(O.MenuItem,{info:(0,E.__)("Restore to default state"),onClick:()=>{!async function(){try{await r(t,{allowUndo:!1}),await a("postType",t.type,t.id),l((0,E.__)("Entity reverted."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,E.__)("An error occurred while reverting the entity.");i(t,{type:"snackbar"})}}(),c()}},(0,E.__)("Clear customizations")))})):null}var bl=(0,o.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(D.Path,{d:"M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z"})),wl=(0,o.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(D.Path,{fillRule:"evenodd",d:"M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",clipRule:"evenodd"})),Sl=(0,o.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(D.Path,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"}));const xl=["wp_template","wp_template_part"];function kl(e){let{isCustomized:t,children:n}=e;return t?(0,o.createElement)(O.Tooltip,{text:(0,E.__)("This template has been customized")},n):n}function Tl(e){let{text:t,icon:n,imageUrl:r,isCustomized:a}=e;const[l,i]=(0,o.useState)(!1);return(0,o.createElement)(O.__experimentalHStack,{alignment:"left"},(0,o.createElement)(kl,{isCustomized:a},r?(0,o.createElement)("div",{className:B()("edit-site-list-added-by__avatar",{"is-loaded":l})},(0,o.createElement)("img",{onLoad:()=>i(!0),alt:"",src:r})):(0,o.createElement)("div",{className:B()("edit-site-list-added-by__icon",{"is-customized":a})},(0,o.createElement)(O.Icon,{icon:n}))),(0,o.createElement)("span",null,t))}function Cl(e){var t;let{slug:n,isCustomized:r}=e;const a=(0,c.useSelect)((e=>e(u.store).getTheme(n)),[n]);return(0,o.createElement)(Tl,{icon:On,text:(null==a||null===(t=a.name)||void 0===t?void 0:t.rendered)||n,isCustomized:r})}function Il(e){let{slug:t,isCustomized:n}=e;const r=(0,c.useSelect)((e=>e(u.store).getPlugin(t)),[t]);return(0,o.createElement)(Tl,{icon:bl,text:(null==r?void 0:r.name)||t,isCustomized:n})}function Nl(e){var t;let{id:n}=e;const r=(0,c.useSelect)((e=>e(u.store).getUser(n)),[n]);return(0,o.createElement)(Tl,{icon:wl,imageUrl:null==r||null===(t=r.avatar_urls)||void 0===t?void 0:t[48],text:null==r?void 0:r.nickname})}function Pl(){const{name:e,logoURL:t}=(0,c.useSelect)((e=>{var t;const{getEntityRecord:n,getMedia:r}=e(u.store),a=n("root","__unstableBase");return{name:null==a?void 0:a.name,logoURL:null!=a&&a.site_logo?null===(t=r(a.site_logo))||void 0===t?void 0:t.source_url:void 0}}),[]);return(0,o.createElement)(Tl,{icon:Sl,imageUrl:t,text:e})}function Ml(e){let{templateType:t,template:n}=e;if(n){if(xl.includes(t)){if(n.has_theme_file&&("theme"===n.origin||!n.origin&&["theme","custom"].includes(n.source)))return(0,o.createElement)(Cl,{slug:n.theme,isCustomized:"custom"===n.source});if(n.has_theme_file&&"plugin"===n.origin)return(0,o.createElement)(Il,{slug:n.theme,isCustomized:"custom"===n.source});if(!n.has_theme_file&&"custom"===n.source&&!n.author)return(0,o.createElement)(Pl,null)}return(0,o.createElement)(Nl,{id:n.author})}}function Rl(e){let{templateType:t}=e;const{templates:n,isLoading:r,postType:a}=(0,c.useSelect)((e=>{const{getEntityRecords:n,hasFinishedResolution:r,getPostType:a}=e(u.store);return{templates:n("postType",t,{per_page:-1}),isLoading:!r("getEntityRecords",["postType",t,{per_page:-1}]),postType:a(t)}}),[t]);return!n||r?null:n.length?(0,o.createElement)("table",{className:"edit-site-list-table",role:"table"},(0,o.createElement)("thead",null,(0,o.createElement)("tr",{className:"edit-site-list-table-head",role:"row"},(0,o.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,E.__)("Template")),(0,o.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,E.__)("Added by")),(0,o.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,o.createElement)(O.VisuallyHidden,null,(0,E.__)("Actions"))))),(0,o.createElement)("tbody",null,n.map((e=>{var n;return(0,o.createElement)("tr",{key:e.id,className:"edit-site-list-table-row",role:"row"},(0,o.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,o.createElement)(O.__experimentalHeading,{level:4},(0,o.createElement)(fn,{params:{postId:e.id,postType:e.type}},(null===(n=e.title)||void 0===n?void 0:n.rendered)||e.slug)),e.description),(0,o.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,o.createElement)(Ml,{templateType:t,template:e})),(0,o.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,o.createElement)(vl,{template:e})))})))):(0,o.createElement)("div",null,(0,E.sprintf)(// translators: The template type name, should be either "templates" or "template parts".
(0,E.__)("No %s found."),null==a||null===(l=a.labels)||void 0===l||null===(i=l.name)||void 0===i?void 0:i.toLowerCase()));var l,i}function Al(){var e,t;const{params:{postType:n}}=kt();!function(){const{registerShortcut:e}=(0,c.useDispatch)(Nt.store);(0,o.useEffect)((()=>{e({name:"core/edit-site/next-region",category:"global",description:(0,E.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/edit-site/previous-region",category:"global",description:(0,E.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"}]})}),[])}();const{previousShortcut:r,nextShortcut:a,isNavigationOpen:l}=(0,c.useSelect)((e=>({previousShortcut:e(Nt.store).getAllShortcutKeyCombinations("core/edit-site/previous-region"),nextShortcut:e(Nt.store).getAllShortcutKeyCombinations("core/edit-site/next-region"),isNavigationOpen:e(_t).isNavigationOpened()})),[]),i=(0,c.useSelect)((e=>e(u.store).getPostType(n)),[n]);ml(null==i||null===(e=i.labels)||void 0===e?void 0:e.name);const s=null==i||null===(t=i.labels)||void 0===t?void 0:t.items_list,d=i?{header:(0,E.sprintf)(// translators: %s - the name of the page, 'Header' as in the header area of that page.
(0,E.__)("%s - Header"),s),body:(0,E.sprintf)(// translators: %s - the name of the page, 'Content' as in the content area of that page.
(0,E.__)("%s - Content"),s)}:void 0;return(0,o.createElement)(Se,{className:B()("edit-site-list",{"is-navigation-open":l}),labels:{drawer:(0,E.__)("Navigation Sidebar"),...d},header:(0,o.createElement)(El,{templateType:n}),drawer:(0,o.createElement)(Ma.Slot,null),notices:(0,o.createElement)(m.EditorSnackbars,null),content:(0,o.createElement)(Rl,{templateType:n}),shortcuts:{previous:r,next:a}})}function Ll(e){let{postId:t,postType:n}=e;return!(t||!n)}function Bl(e){let{reboot:t}=e;return(0,o.createElement)(O.SlotFillProvider,null,(0,o.createElement)(m.UnsavedChangesWarning,null),(0,o.createElement)(It,null,(e=>{let{params:n}=e;const r=Ll(n);return(0,o.createElement)(o.Fragment,null,r?(0,o.createElement)(Al,null):(0,o.createElement)(pl,{onError:t}),(0,o.createElement)(Ma,{isDefaultOpen:!!r,activeTemplateType:r?n.postType:void 0}))})))}function Ol(e){let{className:t,...n}=e;return(0,o.createElement)(be,A({panelClassName:t,className:"edit-site-sidebar",scope:"core/edit-site"},n))}function Dl(e){return(0,o.createElement)(_e,A({__unstableExplicitMenuItem:!0,scope:"core/edit-site"},e))}var Fl=(0,we.compose)((0,ie.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,name:"core/edit-site/plugin-more-menu"}))))(de);async function zl(e,t){await async function(e){const t=new URLSearchParams(wt.location.search);if(function(e){const{postType:t}=e;return!Ll(e)&&!["post","page","wp_template","wp_template_part"].includes(t)}(Object.fromEntries(t.entries()))){const t=await async function(e){const t=await Kt()({path:"/wp/v2/settings"});if(!t)return;const{show_on_front:n,page_on_front:r}=t;if("page"===n)return{postType:"page",postId:r};const a=await window.fetch((0,p.addQueryArgs)(e,{"_wp-find-template":!0})).then((e=>e.json())).then((e=>{let{data:t}=e;return t}));return null!=a&&a.id?{postType:"wp_template",postId:a.id}:void 0}(e);t&&wt.replace(t)}}(t.siteUrl),(0,o.unmountComponentAtNode)(e);const n=zl.bind(null,e,t);(0,c.dispatch)(_t).updateSettings(t),(0,c.dispatch)(m.store).updateEditorSettings({defaultTemplateTypes:t.defaultTemplateTypes,defaultTemplatePartAreas:t.defaultTemplatePartAreas}),Ll((0,p.getQueryArgs)(window.location.href))&&(0,c.dispatch)(_t).setIsNavigationPanelOpened((0,c.select)(d.store).isViewportMatch("medium")),(0,o.render)((0,o.createElement)(Bl,{reboot:n}),e)}function Vl(e,t){t.__experimentalFetchLinkSuggestions=(e,n)=>(0,u.__experimentalFetchLinkSuggestions)(e,n,t),t.__experimentalFetchRichUrlData=u.__experimentalFetchUrlData,t.__experimentalSpotlightEntityBlocks=["core/template-part"];const n=document.getElementById(e);(0,c.dispatch)(i.store).__experimentalReapplyBlockTypeFilters(),(0,s.registerCoreBlocks)(),(0,s.__experimentalRegisterExperimentalCoreBlocks)({enableFSEBlocks:!0}),zl(n,t)}}(),(window.wp=window.wp||{}).editSite=r}();