WordPress/wp-includes/js/dist/core-data.min.js

2 lines
63 KiB
JavaScript

/*! This file is auto-generated */
(()=>{"use strict";var e={6689:(e,t,n)=>{n.d(t,{createUndoManager:()=>a});var r=n(923),s=n.n(r);function i(e,t){const n={...e};return Object.entries(t).forEach((([e,t])=>{n[e]?n[e]={...n[e],to:t.to}:n[e]=t})),n}const o=(e,t)=>{const n=e?.findIndex((({id:e})=>"string"==typeof e?e===t.id:s()(e,t.id))),r=[...e];return-1!==n?r[n]={id:t.id,changes:i(r[n].changes,t.changes)}:r.push(t),r};function a(){let e=[],t=[],n=0;const r=()=>{e=e.slice(0,n||void 0),n=0},i=()=>{var n;const r=0===e.length?0:e.length-1;let s=null!==(n=e[r])&&void 0!==n?n:[];t.forEach((e=>{s=o(s,e)})),t=[],e[r]=s};return{addRecord(n,a=!1){const c=!n||(e=>!e.filter((({changes:e})=>Object.values(e).some((({from:e,to:t})=>"function"!=typeof e&&"function"!=typeof t&&!s()(e,t))))).length)(n);if(a){if(c)return;n.forEach((e=>{t=o(t,e)}))}else{if(r(),t.length&&i(),c)return;e.push(n)}},undo(){t.length&&(r(),i());const s=e[e.length-1+n];if(s)return n-=1,s},redo(){const t=e[e.length+n];if(t)return n+=1,t},hasUndo:()=>!!e[e.length-1+n],hasRedo:()=>!!e[e.length+n]}}},3249:e=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r(e,t){var n=e._map,r=e._arrayTreeMap,s=e._objectTreeMap;if(n.has(t))return n.get(t);for(var i=Object.keys(t).sort(),o=Array.isArray(t)?r:s,a=0;a<i.length;a++){var c=i[a];if(void 0===(o=o.get(c)))return;var l=t[c];if(void 0===(o=o.get(l)))return}var u=o.get("_ekm_value");return u?(n.delete(u[0]),u[0]=t,o.set("_ekm_value",u),n.set(t,u),u):void 0}var s=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.clear(),t instanceof e){var n=[];t.forEach((function(e,t){n.push([t,e])})),t=n}if(null!=t)for(var r=0;r<t.length;r++)this.set(t[r][0],t[r][1])}var s,i,o;return s=e,i=[{key:"set",value:function(n,r){if(null===n||"object"!==t(n))return this._map.set(n,r),this;for(var s=Object.keys(n).sort(),i=[n,r],o=Array.isArray(n)?this._arrayTreeMap:this._objectTreeMap,a=0;a<s.length;a++){var c=s[a];o.has(c)||o.set(c,new e),o=o.get(c);var l=n[c];o.has(l)||o.set(l,new e),o=o.get(l)}var u=o.get("_ekm_value");return u&&this._map.delete(u[0]),o.set("_ekm_value",i),this._map.set(n,i),this}},{key:"get",value:function(e){if(null===e||"object"!==t(e))return this._map.get(e);var n=r(this,e);return n?n[1]:void 0}},{key:"has",value:function(e){return null===e||"object"!==t(e)?this._map.has(e):void 0!==r(this,e)}},{key:"delete",value:function(e){return!!this.has(e)&&(this.set(e,void 0),!0)}},{key:"forEach",value:function(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this;this._map.forEach((function(s,i){null!==i&&"object"===t(i)&&(s=s[1]),e.call(r,s,i,n)}))}},{key:"clear",value:function(){this._map=new Map,this._arrayTreeMap=new Map,this._objectTreeMap=new Map}},{key:"size",get:function(){return this._map.size}}],i&&n(s.prototype,i),o&&n(s,o),e}();e.exports=s},7734:e=>{e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,s,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(s=r;0!=s--;)if(!e(t[s],n[s]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(s of t.entries())if(!n.has(s[0]))return!1;for(s of t.entries())if(!e(s[1],n.get(s[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(s of t.entries())if(!n.has(s[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((r=t.length)!=n.length)return!1;for(s=r;0!=s--;)if(t[s]!==n[s])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(s=r;0!=s--;)if(!Object.prototype.hasOwnProperty.call(n,i[s]))return!1;for(s=r;0!=s--;){var o=i[s];if(!e(t[o],n[o]))return!1}return!0}return t!=t&&n!=n}},923:e=>{e.exports=window.wp.isShallowEqual}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};n.r(r),n.d(r,{EntityProvider:()=>Jn,__experimentalFetchLinkSuggestions:()=>on,__experimentalFetchUrlData:()=>ln,__experimentalUseEntityRecord:()=>ir,__experimentalUseEntityRecords:()=>cr,__experimentalUseResourcePermissions:()=>dr,fetchBlockPatterns:()=>un,privateApis:()=>Tr,store:()=>Ar,useEntityBlockEditor:()=>wr,useEntityId:()=>fr,useEntityProp:()=>Sr,useEntityRecord:()=>sr,useEntityRecords:()=>ar,useResourcePermissions:()=>ur});var s={};n.r(s),n.d(s,{__experimentalBatch:()=>de,__experimentalReceiveCurrentGlobalStylesId:()=>Z,__experimentalReceiveThemeBaseGlobalStyles:()=>ee,__experimentalReceiveThemeGlobalStyleVariations:()=>te,__experimentalSaveSpecifiedEntityEdits:()=>fe,__unstableCreateUndoLevel:()=>le,addEntities:()=>W,deleteEntityRecord:()=>ie,editEntityRecord:()=>oe,receiveAutosaves:()=>ge,receiveCurrentTheme:()=>X,receiveCurrentUser:()=>z,receiveDefaultTemplateId:()=>ve,receiveEmbedPreview:()=>se,receiveEntityRecords:()=>J,receiveNavigationFallbackId:()=>he,receiveRevisions:()=>_e,receiveThemeGlobalStyleRevisions:()=>re,receiveThemeSupports:()=>ne,receiveUploadPermissions:()=>ye,receiveUserPermission:()=>Ee,receiveUserPermissions:()=>me,receiveUserQuery:()=>H,redo:()=>ce,saveEditedEntityRecord:()=>pe,saveEntityRecord:()=>ue,undo:()=>ae});var i={};n.r(i),n.d(i,{__experimentalGetCurrentGlobalStylesId:()=>Ot,__experimentalGetCurrentThemeBaseGlobalStyles:()=>Vt,__experimentalGetCurrentThemeGlobalStylesVariations:()=>Gt,__experimentalGetDirtyEntityRecords:()=>pt,__experimentalGetEntitiesBeingSaved:()=>ft,__experimentalGetEntityRecordNoResolver:()=>ot,__experimentalGetTemplateForLink:()=>Nt,canUser:()=>Ut,canUserEditEntityRecord:()=>xt,getAuthors:()=>Xe,getAutosave:()=>jt,getAutosaves:()=>Lt,getBlockPatternCategories:()=>Bt,getBlockPatterns:()=>qt,getCurrentTheme:()=>kt,getCurrentThemeGlobalStylesRevisions:()=>Ft,getCurrentUser:()=>Ze,getDefaultTemplateId:()=>Kt,getEditedEntityRecord:()=>gt,getEmbedPreview:()=>At,getEntitiesByKind:()=>tt,getEntitiesConfig:()=>nt,getEntity:()=>rt,getEntityConfig:()=>st,getEntityRecord:()=>it,getEntityRecordEdits:()=>yt,getEntityRecordNonTransientEdits:()=>Et,getEntityRecords:()=>lt,getEntityRecordsTotalItems:()=>ut,getEntityRecordsTotalPages:()=>dt,getLastEntityDeleteError:()=>bt,getLastEntitySaveError:()=>Rt,getRawEntityRecord:()=>at,getRedoEdit:()=>St,getReferenceByDistinctEdits:()=>Dt,getRevision:()=>Yt,getRevisions:()=>Qt,getThemeSupports:()=>Ct,getUndoEdit:()=>wt,getUserPatternCategories:()=>$t,getUserQueryResults:()=>et,hasEditsForEntityRecord:()=>mt,hasEntityRecords:()=>ct,hasFetchedAutosaves:()=>Mt,hasRedo:()=>It,hasUndo:()=>Tt,isAutosavingEntityRecord:()=>ht,isDeletingEntityRecord:()=>_t,isPreviewEmbedFallback:()=>Pt,isRequestingEmbedPreview:()=>Je,isSavingEntityRecord:()=>vt});var o={};n.r(o),n.d(o,{getBlockPatternsForPostType:()=>Wt,getEntityRecordPermissions:()=>Xt,getEntityRecordsPermissions:()=>Jt,getNavigationFallbackId:()=>zt,getRegisteredPostMeta:()=>Zt,getUndoManager:()=>Ht});var a={};n.r(a),n.d(a,{receiveRegisteredPostMeta:()=>en});var c={};n.r(c),n.d(c,{__experimentalGetCurrentGlobalStylesId:()=>Tn,__experimentalGetCurrentThemeBaseGlobalStyles:()=>In,__experimentalGetCurrentThemeGlobalStylesVariations:()=>kn,__experimentalGetTemplateForLink:()=>Sn,canUser:()=>_n,canUserEditEntityRecord:()=>Rn,getAuthors:()=>dn,getAutosave:()=>wn,getAutosaves:()=>bn,getBlockPatternCategories:()=>An,getBlockPatterns:()=>Cn,getCurrentTheme:()=>gn,getCurrentThemeGlobalStylesRevisions:()=>On,getCurrentUser:()=>pn,getDefaultTemplateId:()=>xn,getEditedEntityRecord:()=>En,getEmbedPreview:()=>vn,getEntityRecord:()=>fn,getEntityRecords:()=>mn,getNavigationFallbackId:()=>Un,getRawEntityRecord:()=>yn,getRegisteredPostMeta:()=>Mn,getRevision:()=>jn,getRevisions:()=>Ln,getThemeSupports:()=>hn,getUserPatternCategories:()=>Pn});const l=window.wp.data;var u=n(7734),d=n.n(u);const p=window.wp.compose;var f=n(6689);const y=e=>t=>(n,r)=>void 0===n||e(r)?t(n,r):n,E=e=>t=>(n,r)=>t(n,e(r));const m=e=>t=>(n={},r)=>{const s=r[e];if(void 0===s)return n;const i=t(n[s],r);return i===n[s]?n:{...n,[s]:i}};var g=function(){return g=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},g.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function h(e){return e.toLowerCase()}var v=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],_=/[^A-Z0-9]+/gi;function R(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,r=void 0===n?v:n,s=t.stripRegexp,i=void 0===s?_:s,o=t.transform,a=void 0===o?h:o,c=t.delimiter,l=void 0===c?" ":c,u=b(b(e,r,"$1\0$2"),i,"\0"),d=0,p=u.length;"\0"===u.charAt(d);)d++;for(;"\0"===u.charAt(p-1);)p--;return u.slice(d,p).split("\0").map(a).join(l)}function b(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}function w(e){return function(e){return e.charAt(0).toUpperCase()+e.substr(1)}(e.toLowerCase())}function S(e,t){var n=e.charAt(0),r=e.substr(1).toLowerCase();return t>0&&n>="0"&&n<="9"?"_"+n+r:""+n.toUpperCase()+r}function T(e,t){return void 0===t&&(t={}),R(e,g({delimiter:"",transform:S},t))}const I=window.wp.apiFetch;var k=n.n(I);const O=window.wp.i18n,C=window.wp.richText,A={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let P;const U=new Uint8Array(16);function x(){if(!P&&(P="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!P))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return P(U)}const L=[];for(let e=0;e<256;++e)L.push((e+256).toString(16).slice(1));function j(e,t=0){return L[e[t+0]]+L[e[t+1]]+L[e[t+2]]+L[e[t+3]]+"-"+L[e[t+4]]+L[e[t+5]]+"-"+L[e[t+6]]+L[e[t+7]]+"-"+L[e[t+8]]+L[e[t+9]]+"-"+L[e[t+10]]+L[e[t+11]]+L[e[t+12]]+L[e[t+13]]+L[e[t+14]]+L[e[t+15]]}const M=function(e,t,n){if(A.randomUUID&&!t&&!e)return A.randomUUID();const r=(e=e||{}).random||(e.rng||x)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return j(r)},D=window.wp.url,N=window.wp.deprecated;var V=n.n(N);function G(e,t,n){if(!e||"object"!=typeof e)return e;const r=Array.isArray(t)?t:t.split(".");return r.reduce(((e,t,s)=>(void 0===e[t]&&(Number.isInteger(r[s+1])?e[t]=[]:e[t]={}),s===r.length-1&&(e[t]=n),e[t])),e),e}function q(e,t,n){if(!e||"object"!=typeof e||"string"!=typeof t&&!Array.isArray(t))return e;const r=Array.isArray(t)?t:t.split(".");let s=e;return r.forEach((e=>{s=s?.[e]})),void 0!==s?s:n}function B(e,t,n){return{type:"RECEIVE_ITEMS",items:Array.isArray(e)?e:[e],persistedEdits:t,meta:n}}let $=null;async function F(e){if(null===$){const e=await k()({path:"/batch/v1",method:"OPTIONS"});$=e.endpoints[0].args.requests.maxItems}const t=[];for(const n of function(e,t){const n=[...e],r=[];for(;n.length;)r.push(n.splice(0,t));return r}(e,$)){const e=await k()({path:"/batch/v1",method:"POST",data:{validation:"require-all-validate",requests:n.map((e=>({path:e.path,body:e.data,method:e.method,headers:e.headers})))}});let r;r=e.failed?e.responses.map((e=>({error:e?.body}))):e.responses.map((e=>{const t={};return e.status>=200&&e.status<300?t.output=e.body:t.error=e.body,t})),t.push(...r)}return t}function K(e=F){let t=0,n=[];const r=new Q;return{add(e){const s=++t;r.add(s);const i=e=>new Promise(((t,i)=>{n.push({input:e,resolve:t,reject:i}),r.delete(s)}));return"function"==typeof e?Promise.resolve(e(i)).finally((()=>{r.delete(s)})):i(e)},async run(){let t;r.size&&await new Promise((e=>{const t=r.subscribe((()=>{r.size||(t(),e(void 0))}))}));try{if(t=await e(n.map((({input:e})=>e))),t.length!==n.length)throw new Error("run: Array returned by processor must be same size as input array.")}catch(e){for(const{reject:t}of n)t(e);throw e}let s=!0;return t.forEach(((e,t)=>{const r=n[t];var i;e?.error?(r?.reject(e.error),s=!1):r?.resolve(null!==(i=e?.output)&&void 0!==i?i:e)})),n=[],s}}}class Q{constructor(...e){this.set=new Set(...e),this.subscribers=new Set}get size(){return this.set.size}add(e){return this.set.add(e),this.subscribers.forEach((e=>e())),this}delete(e){const t=this.set.delete(e);return this.subscribers.forEach((e=>e())),t}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}}const Y="core";function H(e,t){return{type:"RECEIVE_USER_QUERY",users:Array.isArray(t)?t:[t],queryID:e}}function z(e){return{type:"RECEIVE_CURRENT_USER",currentUser:e}}function W(e){return{type:"ADD_ENTITIES",entities:e}}function J(e,t,n,r,s=!1,i,o){let a;return"postType"===e&&(n=(Array.isArray(n)?n:[n]).map((e=>"auto-draft"===e.status?{...e,title:""}:e))),a=r?function(e,t={},n,r){return{...B(e,n,r),query:t}}(n,r,i,o):B(n,i,o),{...a,kind:e,name:t,invalidateCache:s}}function X(e){return{type:"RECEIVE_CURRENT_THEME",currentTheme:e}}function Z(e){return{type:"RECEIVE_CURRENT_GLOBAL_STYLES_ID",id:e}}function ee(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLES",stylesheet:e,globalStyles:t}}function te(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS",stylesheet:e,variations:t}}function ne(){return V()("wp.data.dispatch( 'core' ).receiveThemeSupports",{since:"5.9"}),{type:"DO_NOTHING"}}function re(e,t){return V()("wp.data.dispatch( 'core' ).receiveThemeGlobalStyleRevisions()",{since:"6.5.0",alternative:"wp.data.dispatch( 'core' ).receiveRevisions"}),{type:"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS",currentId:e,revisions:t}}function se(e,t){return{type:"RECEIVE_EMBED_PREVIEW",url:e,preview:t}}const ie=(e,t,n,r,{__unstableFetch:s=k(),throwOnError:i=!1}={})=>async({dispatch:o})=>{const a=(await o(Ae(e,t))).find((n=>n.kind===e&&n.name===t));let c,l=!1;if(!a)return;const u=await o.__unstableAcquireStoreLock(Y,["entities","records",e,t,n],{exclusive:!0});try{o({type:"DELETE_ENTITY_RECORD_START",kind:e,name:t,recordId:n});let u=!1;try{let i=`${a.baseURL}/${n}`;r&&(i=(0,D.addQueryArgs)(i,r)),l=await s({path:i,method:"DELETE"}),await o(function(e,t,n,r=!1){return{type:"REMOVE_ITEMS",itemIds:Array.isArray(n)?n:[n],kind:e,name:t,invalidateCache:r}}(e,t,n,!0))}catch(e){u=!0,c=e}if(o({type:"DELETE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:n,error:c}),u&&i)throw c;return l}finally{o.__unstableReleaseStoreLock(u)}},oe=(e,t,n,r,s={})=>({select:i,dispatch:o})=>{const a=i.getEntityConfig(e,t);if(!a)throw new Error(`The entity being edited (${e}, ${t}) does not have a loaded config.`);const{mergedEdits:c={}}=a,l=i.getRawEntityRecord(e,t,n),u=i.getEditedEntityRecord(e,t,n),p={kind:e,name:t,recordId:n,edits:Object.keys(r).reduce(((e,t)=>{const n=l[t],s=u[t],i=c[t]?{...s,...r[t]}:r[t];return e[t]=d()(n,i)?void 0:i,e}),{})};window.__experimentalEnableSync&&a.syncConfig||(s.undoIgnore||i.getUndoManager().addRecord([{id:{kind:e,name:t,recordId:n},changes:Object.keys(r).reduce(((e,t)=>(e[t]={from:u[t],to:r[t]},e)),{})}],s.isCached),o({type:"EDIT_ENTITY_RECORD",...p}))},ae=()=>({select:e,dispatch:t})=>{const n=e.getUndoManager().undo();n&&t({type:"UNDO",record:n})},ce=()=>({select:e,dispatch:t})=>{const n=e.getUndoManager().redo();n&&t({type:"REDO",record:n})},le=()=>({select:e})=>{e.getUndoManager().addRecord()},ue=(e,t,n,{isAutosave:r=!1,__unstableFetch:s=k(),throwOnError:i=!1}={})=>async({select:o,resolveSelect:a,dispatch:c})=>{const l=(await c(Ae(e,t))).find((n=>n.kind===e&&n.name===t));if(!l)return;const u=l.key||Re,d=n[u],p=await c.__unstableAcquireStoreLock(Y,["entities","records",e,t,d||M()],{exclusive:!0});try{for(const[r,s]of Object.entries(n))if("function"==typeof s){const i=s(o.getEditedEntityRecord(e,t,d));c.editEntityRecord(e,t,d,{[r]:i},{undoIgnore:!0}),n[r]=i}let u,p;c({type:"SAVE_ENTITY_RECORD_START",kind:e,name:t,recordId:d,isAutosave:r});let f=!1;try{const i=`${l.baseURL}${d?"/"+d:""}`,p=o.getRawEntityRecord(e,t,d);if(r){const r=o.getCurrentUser(),l=r?r.id:void 0,d=await a.getAutosave(p.type,p.id,l);let f={...p,...d,...n};if(f=Object.keys(f).reduce(((e,t)=>(["title","excerpt","content","meta"].includes(t)&&(e[t]=f[t]),e)),{status:"auto-draft"===f.status?"draft":void 0}),u=await s({path:`${i}/autosaves`,method:"POST",data:f}),p.id===u.id){let n={...p,...f,...u};n=Object.keys(n).reduce(((e,t)=>(["title","excerpt","content"].includes(t)?e[t]=n[t]:e[t]="status"===t?"auto-draft"===p.status&&"draft"===n.status?n.status:p.status:p[t],e)),{}),c.receiveEntityRecords(e,t,n,void 0,!0)}else c.receiveAutosaves(p.id,u)}else{let r=n;l.__unstablePrePersist&&(r={...r,...l.__unstablePrePersist(p,r)}),u=await s({path:i,method:d?"PUT":"POST",data:r}),c.receiveEntityRecords(e,t,u,void 0,!0,r)}}catch(e){f=!0,p=e}if(c({type:"SAVE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:d,error:p,isAutosave:r}),f&&i)throw p;return u}finally{c.__unstableReleaseStoreLock(p)}},de=e=>async({dispatch:t})=>{const n=K(),r={saveEntityRecord:(e,r,s,i)=>n.add((n=>t.saveEntityRecord(e,r,s,{...i,__unstableFetch:n}))),saveEditedEntityRecord:(e,r,s,i)=>n.add((n=>t.saveEditedEntityRecord(e,r,s,{...i,__unstableFetch:n}))),deleteEntityRecord:(e,r,s,i,o)=>n.add((n=>t.deleteEntityRecord(e,r,s,i,{...o,__unstableFetch:n})))},s=e.map((e=>e(r))),[,...i]=await Promise.all([n.run(),...s]);return i},pe=(e,t,n,r)=>async({select:s,dispatch:i})=>{if(!s.hasEditsForEntityRecord(e,t,n))return;const o=(await i(Ae(e,t))).find((n=>n.kind===e&&n.name===t));if(!o)return;const a=o.key||Re,c=s.getEntityRecordNonTransientEdits(e,t,n),l={[a]:n,...c};return await i.saveEntityRecord(e,t,l,r)},fe=(e,t,n,r,s)=>async({select:i,dispatch:o})=>{if(!i.hasEditsForEntityRecord(e,t,n))return;const a=i.getEntityRecordNonTransientEdits(e,t,n),c={};for(const e of r)G(c,e,q(a,e));const l=(await o(Ae(e,t))).find((n=>n.kind===e&&n.name===t));return n&&(c[l?.key||Re]=n),await o.saveEntityRecord(e,t,c,s)};function ye(e){return V()("wp.data.dispatch( 'core' ).receiveUploadPermissions",{since:"5.9",alternative:"receiveUserPermission"}),Ee("create/media",e)}function Ee(e,t){return{type:"RECEIVE_USER_PERMISSION",key:e,isAllowed:t}}function me(e){return{type:"RECEIVE_USER_PERMISSIONS",permissions:e}}function ge(e,t){return{type:"RECEIVE_AUTOSAVES",postId:e,autosaves:Array.isArray(t)?t:[t]}}function he(e){return{type:"RECEIVE_NAVIGATION_FALLBACK_ID",fallbackId:e}}function ve(e,t){return{type:"RECEIVE_DEFAULT_TEMPLATE",query:e,templateId:t}}const _e=(e,t,n,r,s,i=!1,o)=>async({dispatch:a})=>{const c=(await a(Ae(e,t))).find((n=>n.kind===e&&n.name===t));a({type:"RECEIVE_ITEM_REVISIONS",key:c&&c?.revisionKey?c.revisionKey:Re,items:Array.isArray(r)?r:[r],recordKey:n,meta:o,query:s,kind:e,name:t,invalidateCache:i})},Re="id",be=["title","excerpt","content"],we=[{label:(0,O.__)("Base"),kind:"root",name:"__unstableBase",baseURL:"/",baseURLParams:{_fields:["description","gmt_offset","home","name","site_icon","site_icon_url","site_logo","timezone_string","url"].join(",")},plural:"__unstableBases",syncConfig:{fetch:async()=>k()({path:"/"}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach((([e,t])=>{n.get(e)!==t&&n.set(e,t)}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/base",getSyncObjectId:()=>"index"},{label:(0,O.__)("Post Type"),name:"postType",kind:"root",key:"slug",baseURL:"/wp/v2/types",baseURLParams:{context:"edit"},plural:"postTypes",syncConfig:{fetch:async e=>k()({path:`/wp/v2/types/${e}?context=edit`}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach((([e,t])=>{n.get(e)!==t&&n.set(e,t)}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/postType",getSyncObjectId:e=>e},{name:"media",kind:"root",baseURL:"/wp/v2/media",baseURLParams:{context:"edit"},plural:"mediaItems",label:(0,O.__)("Media"),rawAttributes:["caption","title","description"],supportsPagination:!0},{name:"taxonomy",kind:"root",key:"slug",baseURL:"/wp/v2/taxonomies",baseURLParams:{context:"edit"},plural:"taxonomies",label:(0,O.__)("Taxonomy")},{name:"sidebar",kind:"root",baseURL:"/wp/v2/sidebars",baseURLParams:{context:"edit"},plural:"sidebars",transientEdits:{blocks:!0},label:(0,O.__)("Widget areas")},{name:"widget",kind:"root",baseURL:"/wp/v2/widgets",baseURLParams:{context:"edit"},plural:"widgets",transientEdits:{blocks:!0},label:(0,O.__)("Widgets")},{name:"widgetType",kind:"root",baseURL:"/wp/v2/widget-types",baseURLParams:{context:"edit"},plural:"widgetTypes",label:(0,O.__)("Widget types")},{label:(0,O.__)("User"),name:"user",kind:"root",baseURL:"/wp/v2/users",baseURLParams:{context:"edit"},plural:"users"},{name:"comment",kind:"root",baseURL:"/wp/v2/comments",baseURLParams:{context:"edit"},plural:"comments",label:(0,O.__)("Comment")},{name:"menu",kind:"root",baseURL:"/wp/v2/menus",baseURLParams:{context:"edit"},plural:"menus",label:(0,O.__)("Menu")},{name:"menuItem",kind:"root",baseURL:"/wp/v2/menu-items",baseURLParams:{context:"edit"},plural:"menuItems",label:(0,O.__)("Menu Item"),rawAttributes:["title"]},{name:"menuLocation",kind:"root",baseURL:"/wp/v2/menu-locations",baseURLParams:{context:"edit"},plural:"menuLocations",label:(0,O.__)("Menu Location"),key:"name"},{label:(0,O.__)("Global Styles"),name:"globalStyles",kind:"root",baseURL:"/wp/v2/global-styles",baseURLParams:{context:"edit"},plural:"globalStylesVariations",getTitle:e=>e?.title?.rendered||e?.title,getRevisionsUrl:(e,t)=>`/wp/v2/global-styles/${e}/revisions${t?"/"+t:""}`,supportsPagination:!0},{label:(0,O.__)("Themes"),name:"theme",kind:"root",baseURL:"/wp/v2/themes",baseURLParams:{context:"edit"},plural:"themes",key:"stylesheet"},{label:(0,O.__)("Plugins"),name:"plugin",kind:"root",baseURL:"/wp/v2/plugins",baseURLParams:{context:"edit"},plural:"plugins",key:"plugin"},{label:(0,O.__)("Status"),name:"status",kind:"root",baseURL:"/wp/v2/statuses",baseURLParams:{context:"edit"},plural:"statuses",key:"slug"}],Se=[{kind:"postType",loadEntities:async function(){const e=await k()({path:"/wp/v2/types?context=view"});return Object.entries(null!=e?e:{}).map((([e,t])=>{var n;const r=["wp_template","wp_template_part"].includes(e),s=null!==(n=t?.rest_namespace)&&void 0!==n?n:"wp/v2";return{kind:"postType",baseURL:`/${s}/${t.rest_base}`,baseURLParams:{context:"edit"},name:e,label:t.name,transientEdits:{blocks:!0,selection:!0},mergedEdits:{meta:!0},rawAttributes:be,getTitle:e=>{var t,n,s;return e?.title?.rendered||e?.title||(r?(n=null!==(t=e.slug)&&void 0!==t?t:"",void 0===s&&(s={}),R(n,g({delimiter:" ",transform:w},s))):String(e.id))},__unstablePrePersist:r?void 0:Te,__unstable_rest_base:t.rest_base,syncConfig:{fetch:async e=>k()({path:`/${s}/${t.rest_base}/${e}?context=edit`}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach((([e,t])=>{"function"!=typeof t&&("blocks"===e&&(Ie.has(t)||Ie.set(t,Oe(t)),t=Ie.get(t)),n.get(e)!==t&&n.set(e,t))}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"postType/"+t.name,getSyncObjectId:e=>e,supportsPagination:!0,getRevisionsUrl:(e,n)=>`/${s}/${t.rest_base}/${e}/revisions${n?"/"+n:""}`,revisionKey:r?"wp_id":Re}}))}},{kind:"taxonomy",loadEntities:async function(){const e=await k()({path:"/wp/v2/taxonomies?context=view"});return Object.entries(null!=e?e:{}).map((([e,t])=>{var n;return{kind:"taxonomy",baseURL:`/${null!==(n=t?.rest_namespace)&&void 0!==n?n:"wp/v2"}/${t.rest_base}`,baseURLParams:{context:"edit"},name:e,label:t.name}}))}},{kind:"root",name:"site",plural:"sites",loadEntities:async function(){var e;const t={label:(0,O.__)("Site"),name:"site",kind:"root",baseURL:"/wp/v2/settings",syncConfig:{fetch:async()=>k()({path:"/wp/v2/settings"}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach((([e,t])=>{n.get(e)!==t&&n.set(e,t)}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/site",getSyncObjectId:()=>"index",meta:{}},n=await k()({path:t.baseURL,method:"OPTIONS"}),r={};return Object.entries(null!==(e=n?.schema?.properties)&&void 0!==e?e:{}).forEach((([e,t])=>{"object"==typeof t&&t.title&&(r[e]=t.title)})),[{...t,meta:{labels:r}}]}}],Te=(e,t)=>{const n={};return"auto-draft"===e?.status&&(t.status||n.status||(n.status="draft"),t.title&&"Auto Draft"!==t.title||n.title||e?.title&&"Auto Draft"!==e?.title||(n.title="")),n},Ie=new WeakMap;function ke(e){const t={...e};for(const[n,r]of Object.entries(e))r instanceof C.RichTextData&&(t[n]=r.valueOf());return t}function Oe(e){return e.map((e=>{const{innerBlocks:t,attributes:n,...r}=e;return{...r,attributes:ke(n),innerBlocks:Oe(t)}}))}const Ce=(e,t,n="get")=>`${n}${"root"===e?"":T(e)}${T(t)}`;const Ae=(e,t)=>async({select:n,dispatch:r})=>{let s=n.getEntitiesConfig(e);const i=!!n.getEntityConfig(e,t);if(s?.length>0&&i)return window.__experimentalEnableSync,s;const o=Se.find((n=>t&&n.name?n.kind===e&&n.name===t:n.kind===e));return o?(s=await o.loadEntities(),window.__experimentalEnableSync,r(W(s)),s):[]};const Pe=function(e){return"string"==typeof e?e.split(","):Array.isArray(e)?e:null};const Ue=function(e){const t=new WeakMap;return n=>{let r;return t.has(n)?r=t.get(n):(r=e(n),null!==n&&"object"==typeof n&&t.set(n,r)),r}};const xe=Ue((function(e){const t={stableKey:"",page:1,perPage:10,fields:null,include:null,context:"default"},n=Object.keys(e).sort();for(let i=0;i<n.length;i++){const o=n[i];let a=e[o];switch(o){case"page":t[o]=Number(a);break;case"per_page":t.perPage=Number(a);break;case"context":t.context=a;break;default:var r,s;if("_fields"===o)t.fields=null!==(r=Pe(a))&&void 0!==r?r:[],a=t.fields.join();if("include"===o)"number"==typeof a&&(a=a.toString()),t.include=(null!==(s=Pe(a))&&void 0!==s?s:[]).map(Number),a=t.include.join();t.stableKey+=(t.stableKey?"&":"")+(0,D.addQueryArgs)("",{[o]:a}).slice(1)}}return t}));function Le(e){const{query:t}=e;if(!t)return"default";return xe(t).context}function je(e,t,n,r){var s;if(1===n&&-1===r)return t;const i=(n-1)*r,o=Math.max(null!==(s=e?.length)&&void 0!==s?s:0,i+t.length),a=new Array(o);for(let n=0;n<o;n++){const s=n>=i&&n<i+r;a[n]=s?t[n-i]:e?.[n]}return a}function Me(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.some((t=>Number.isInteger(t)?t===+e:t===e)))))}const De=(0,p.compose)([y((e=>"query"in e)),E((e=>e.query?{...e,...xe(e.query)}:e)),m("context"),m("stableKey")])(((e={},t)=>{const{type:n,page:r,perPage:s,key:i=Re}=t;return"RECEIVE_ITEMS"!==n?e:{itemIds:je(e?.itemIds||[],t.items.map((e=>e?.[i])).filter(Boolean),r,s),meta:t.meta}})),Ne=(0,l.combineReducers)({items:function(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const n=Le(t),r=t.key||Re;return{...e,[n]:{...e[n],...t.items.reduce(((t,s)=>{const i=s?.[r];return t[i]=function(e,t){if(!e)return t;let n=!1;const r={};for(const s in t)d()(e[s],t[s])?r[s]=e[s]:(n=!0,r[s]=t[s]);if(!n)return e;for(const t in e)r.hasOwnProperty(t)||(r[t]=e[t]);return r}(e?.[n]?.[i],s),t}),{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map((([e,n])=>[e,Me(n,t.itemIds)])))}return e},itemIsComplete:function(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const n=Le(t),{query:r,key:s=Re}=t,i=r?xe(r):{},o=!r||!Array.isArray(i.fields);return{...e,[n]:{...e[n],...t.items.reduce(((t,r)=>{const i=r?.[s];return t[i]=e?.[n]?.[i]||o,t}),{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map((([e,n])=>[e,Me(n,t.itemIds)])))}return e},queries:(e={},t)=>{switch(t.type){case"RECEIVE_ITEMS":return De(e,t);case"REMOVE_ITEMS":const n=t.itemIds.reduce(((e,t)=>(e[t]=!0,e)),{});return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,Object.fromEntries(Object.entries(t).map((([e,t])=>[e,{...t,itemIds:t.itemIds.filter((e=>!n[e]))}])))])));default:return e}}});const Ve=e=>(t,n)=>{if("UNDO"===n.type||"REDO"===n.type){const{record:r}=n;let s=t;return r.forEach((({id:{kind:t,name:r,recordId:i},changes:o})=>{s=e(s,{type:"EDIT_ENTITY_RECORD",kind:t,name:r,recordId:i,edits:Object.entries(o).reduce(((e,[t,r])=>(e[t]="UNDO"===n.type?r.from:r.to,e)),{})})})),s}return e(t,n)};function Ge(e){return(0,p.compose)([Ve,y((t=>t.name&&t.kind&&t.name===e.name&&t.kind===e.kind)),E((t=>({key:e.key||Re,...t})))])((0,l.combineReducers)({queriedData:Ne,edits:(e={},t)=>{var n;switch(t.type){case"RECEIVE_ITEMS":if("default"!==(null!==(n=t?.query?.context)&&void 0!==n?n:"default"))return e;const r={...e};for(const e of t.items){const n=e?.[t.key],s=r[n];if(!s)continue;const i=Object.keys(s).reduce(((n,r)=>{var i;return d()(s[r],null!==(i=e[r]?.raw)&&void 0!==i?i:e[r])||t.persistedEdits&&d()(s[r],t.persistedEdits[r])||(n[r]=s[r]),n}),{});Object.keys(i).length?r[n]=i:delete r[n]}return r;case"EDIT_ENTITY_RECORD":const s={...e[t.recordId],...t.edits};return Object.keys(s).forEach((e=>{void 0===s[e]&&delete s[e]})),{...e,[t.recordId]:s}}return e},saving:(e={},t)=>{switch(t.type){case"SAVE_ENTITY_RECORD_START":case"SAVE_ENTITY_RECORD_FINISH":return{...e,[t.recordId]:{pending:"SAVE_ENTITY_RECORD_START"===t.type,error:t.error,isAutosave:t.isAutosave}}}return e},deleting:(e={},t)=>{switch(t.type){case"DELETE_ENTITY_RECORD_START":case"DELETE_ENTITY_RECORD_FINISH":return{...e,[t.recordId]:{pending:"DELETE_ENTITY_RECORD_START"===t.type,error:t.error}}}return e},revisions:(e={},t)=>{if("RECEIVE_ITEM_REVISIONS"===t.type){const n=t.recordKey;delete t.recordKey;const r=Ne(e[n],{...t,type:"RECEIVE_ITEMS"});return{...e,[n]:r}}return"REMOVE_ITEMS"===t.type?Object.fromEntries(Object.entries(e).filter((([e])=>!t.itemIds.some((t=>Number.isInteger(t)?t===+e:t===e))))):e}}))}const qe=(0,l.combineReducers)({terms:function(e={},t){return"RECEIVE_TERMS"===t.type?{...e,[t.taxonomy]:t.terms}:e},users:function(e={byId:{},queries:{}},t){return"RECEIVE_USER_QUERY"===t.type?{byId:{...e.byId,...t.users.reduce(((e,t)=>({...e,[t.id]:t})),{})},queries:{...e.queries,[t.queryID]:t.users.map((e=>e.id))}}:e},currentTheme:function(e=void 0,t){return"RECEIVE_CURRENT_THEME"===t.type?t.currentTheme.stylesheet:e},currentGlobalStylesId:function(e=void 0,t){return"RECEIVE_CURRENT_GLOBAL_STYLES_ID"===t.type?t.id:e},currentUser:function(e={},t){return"RECEIVE_CURRENT_USER"===t.type?t.currentUser:e},themeGlobalStyleVariations:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS"===t.type?{...e,[t.stylesheet]:t.variations}:e},themeBaseGlobalStyles:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLES"===t.type?{...e,[t.stylesheet]:t.globalStyles}:e},themeGlobalStyleRevisions:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS"===t.type?{...e,[t.currentId]:t.revisions}:e},taxonomies:function(e=[],t){return"RECEIVE_TAXONOMIES"===t.type?t.taxonomies:e},entities:(e={},t)=>{const n=function(e=we,t){return"ADD_ENTITIES"===t.type?[...e,...t.entities]:e}(e.config,t);let r=e.reducer;if(!r||n!==e.config){const e=n.reduce(((e,t)=>{const{kind:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e}),{});r=(0,l.combineReducers)(Object.entries(e).reduce(((e,[t,n])=>{const r=(0,l.combineReducers)(n.reduce(((e,t)=>({...e,[t.name]:Ge(t)})),{}));return e[t]=r,e}),{}))}const s=r(e.records,t);return s===e.records&&n===e.config&&r===e.reducer?e:{reducer:r,records:s,config:n}},editsReference:function(e={},t){switch(t.type){case"EDIT_ENTITY_RECORD":case"UNDO":case"REDO":return{}}return e},undoManager:function(e=(0,f.createUndoManager)()){return e},embedPreviews:function(e={},t){if("RECEIVE_EMBED_PREVIEW"===t.type){const{url:n,preview:r}=t;return{...e,[n]:r}}return e},userPermissions:function(e={},t){switch(t.type){case"RECEIVE_USER_PERMISSION":return{...e,[t.key]:t.isAllowed};case"RECEIVE_USER_PERMISSIONS":return{...e,...t.permissions}}return e},autosaves:function(e={},t){if("RECEIVE_AUTOSAVES"===t.type){const{postId:n,autosaves:r}=t;return{...e,[n]:r}}return e},blockPatterns:function(e=[],t){return"RECEIVE_BLOCK_PATTERNS"===t.type?t.patterns:e},blockPatternCategories:function(e=[],t){return"RECEIVE_BLOCK_PATTERN_CATEGORIES"===t.type?t.categories:e},userPatternCategories:function(e=[],t){return"RECEIVE_USER_PATTERN_CATEGORIES"===t.type?t.patternCategories:e},navigationFallbackId:function(e=null,t){return"RECEIVE_NAVIGATION_FALLBACK_ID"===t.type?t.fallbackId:e},defaultTemplates:function(e={},t){return"RECEIVE_DEFAULT_TEMPLATE"===t.type?{...e,[JSON.stringify(t.query)]:t.templateId}:e},registeredPostMeta:function(e={},t){return"RECEIVE_REGISTERED_POST_META"===t.type?{...e,[t.postType]:t.registeredPostMeta}:e}});var Be=n(3249),$e=n.n(Be);const Fe=new WeakMap;const Ke=(0,l.createSelector)(((e,t={})=>{let n=Fe.get(e);if(n){const e=n.get(t);if(void 0!==e)return e}else n=new($e()),Fe.set(e,n);const r=function(e,t){const{stableKey:n,page:r,perPage:s,include:i,fields:o,context:a}=xe(t);let c;if(e.queries?.[a]?.[n]&&(c=e.queries[a][n].itemIds),!c)return null;const l=-1===s?0:(r-1)*s,u=-1===s?c.length:Math.min(l+s,c.length),d=[];for(let t=l;t<u;t++){const n=c[t];if(Array.isArray(i)&&!i.includes(n))continue;if(void 0===n)continue;if(!e.items[a]?.hasOwnProperty(n))return null;const r=e.items[a][n];let s;if(Array.isArray(o)){s={};for(let e=0;e<o.length;e++){const t=o[e].split(".");let n=r;t.forEach((e=>{n=n?.[e]})),G(s,t,n)}}else{if(!e.itemIsComplete[a]?.[n])return null;s=r}d.push(s)}return d}(e,t);return n.set(t,r),r}));function Qe(e,t={}){var n;const{stableKey:r,context:s}=xe(t);return null!==(n=e.queries?.[s]?.[r]?.meta?.totalItems)&&void 0!==n?n:null}const Ye=["create","read","update","delete"];function He(e){const t={};if(!e)return t;const n={create:"POST",read:"GET",update:"PUT",delete:"DELETE"};for(const[r,s]of Object.entries(n))t[r]=e.includes(s);return t}function ze(e,t,n){return("object"==typeof t?[e,t.kind,t.name,t.id]:[e,t,n]).filter(Boolean).join("/")}const We={},Je=(0,l.createRegistrySelector)((e=>(t,n)=>e(Y).isResolving("getEmbedPreview",[n])));function Xe(e,t){V()("select( 'core' ).getAuthors()",{since:"5.9",alternative:"select( 'core' ).getUsers({ who: 'authors' })"});const n=(0,D.addQueryArgs)("/wp/v2/users/?who=authors&per_page=100",t);return et(e,n)}function Ze(e){return e.currentUser}const et=(0,l.createSelector)(((e,t)=>{var n;return(null!==(n=e.users.queries[t])&&void 0!==n?n:[]).map((t=>e.users.byId[t]))}),((e,t)=>[e.users.queries[t],e.users.byId]));function tt(e,t){return V()("wp.data.select( 'core' ).getEntitiesByKind()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntitiesConfig()"}),nt(e,t)}const nt=(0,l.createSelector)(((e,t)=>e.entities.config.filter((e=>e.kind===t))),((e,t)=>e.entities.config));function rt(e,t,n){return V()("wp.data.select( 'core' ).getEntity()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntityConfig()"}),st(e,t,n)}function st(e,t,n){return e.entities.config?.find((e=>e.kind===t&&e.name===n))}const it=(0,l.createSelector)(((e,t,n,r,s)=>{var i;const o=e.entities.records?.[t]?.[n]?.queriedData;if(!o)return;const a=null!==(i=s?.context)&&void 0!==i?i:"default";if(void 0===s){if(!o.itemIsComplete[a]?.[r])return;return o.items[a][r]}const c=o.items[a]?.[r];if(c&&s._fields){var l;const e={},t=null!==(l=Pe(s._fields))&&void 0!==l?l:[];for(let n=0;n<t.length;n++){const r=t[n].split(".");let s=c;r.forEach((e=>{s=s?.[e]})),G(e,r,s)}return e}return c}),((e,t,n,r,s)=>{var i;const o=null!==(i=s?.context)&&void 0!==i?i:"default";return[e.entities.records?.[t]?.[n]?.queriedData?.items[o]?.[r],e.entities.records?.[t]?.[n]?.queriedData?.itemIsComplete[o]?.[r]]}));function ot(e,t,n,r){return it(e,t,n,r)}it.__unstableNormalizeArgs=e=>{const t=[...e],n=t?.[2];return t[2]=/^\s*\d+\s*$/.test(n)?Number(n):n,t};const at=(0,l.createSelector)(((e,t,n,r)=>{const s=it(e,t,n,r);return s&&Object.keys(s).reduce(((r,i)=>{var o;(function(e,t){return(e.rawAttributes||[]).includes(t)})(st(e,t,n),i)?r[i]=null!==(o=s[i]?.raw)&&void 0!==o?o:s[i]:r[i]=s[i];return r}),{})}),((e,t,n,r,s)=>{var i;const o=null!==(i=s?.context)&&void 0!==i?i:"default";return[e.entities.config,e.entities.records?.[t]?.[n]?.queriedData?.items[o]?.[r],e.entities.records?.[t]?.[n]?.queriedData?.itemIsComplete[o]?.[r]]}));function ct(e,t,n,r){return Array.isArray(lt(e,t,n,r))}const lt=(e,t,n,r)=>{const s=e.entities.records?.[t]?.[n]?.queriedData;return s?Ke(s,r):null},ut=(e,t,n,r)=>{const s=e.entities.records?.[t]?.[n]?.queriedData;return s?Qe(s,r):null},dt=(e,t,n,r)=>{const s=e.entities.records?.[t]?.[n]?.queriedData;if(!s)return null;if(-1===r.per_page)return 1;const i=Qe(s,r);return i?r.per_page?Math.ceil(i/r.per_page):function(e,t={}){var n;const{stableKey:r,context:s}=xe(t);return null!==(n=e.queries?.[s]?.[r]?.meta?.totalPages)&&void 0!==n?n:null}(s,r):i},pt=(0,l.createSelector)((e=>{const{entities:{records:t}}=e,n=[];return Object.keys(t).forEach((r=>{Object.keys(t[r]).forEach((s=>{const i=Object.keys(t[r][s].edits).filter((t=>it(e,r,s,t)&&mt(e,r,s,t)));if(i.length){const t=st(e,r,s);i.forEach((i=>{const o=gt(e,r,s,i);n.push({key:o?o[t.key||Re]:void 0,title:t?.getTitle?.(o)||"",name:s,kind:r})}))}}))})),n}),(e=>[e.entities.records])),ft=(0,l.createSelector)((e=>{const{entities:{records:t}}=e,n=[];return Object.keys(t).forEach((r=>{Object.keys(t[r]).forEach((s=>{const i=Object.keys(t[r][s].saving).filter((t=>vt(e,r,s,t)));if(i.length){const t=st(e,r,s);i.forEach((i=>{const o=gt(e,r,s,i);n.push({key:o?o[t.key||Re]:void 0,title:t?.getTitle?.(o)||"",name:s,kind:r})}))}}))})),n}),(e=>[e.entities.records]));function yt(e,t,n,r){return e.entities.records?.[t]?.[n]?.edits?.[r]}const Et=(0,l.createSelector)(((e,t,n,r)=>{const{transientEdits:s}=st(e,t,n)||{},i=yt(e,t,n,r)||{};return s?Object.keys(i).reduce(((e,t)=>(s[t]||(e[t]=i[t]),e)),{}):i}),((e,t,n,r)=>[e.entities.config,e.entities.records?.[t]?.[n]?.edits?.[r]]));function mt(e,t,n,r){return vt(e,t,n,r)||Object.keys(Et(e,t,n,r)).length>0}const gt=(0,l.createSelector)(((e,t,n,r)=>{const s=at(e,t,n,r),i=yt(e,t,n,r);return!(!s&&!i)&&{...s,...i}}),((e,t,n,r,s)=>{var i;const o=null!==(i=s?.context)&&void 0!==i?i:"default";return[e.entities.config,e.entities.records?.[t]?.[n]?.queriedData.items[o]?.[r],e.entities.records?.[t]?.[n]?.queriedData.itemIsComplete[o]?.[r],e.entities.records?.[t]?.[n]?.edits?.[r]]}));function ht(e,t,n,r){var s;const{pending:i,isAutosave:o}=null!==(s=e.entities.records?.[t]?.[n]?.saving?.[r])&&void 0!==s?s:{};return Boolean(i&&o)}function vt(e,t,n,r){var s;return null!==(s=e.entities.records?.[t]?.[n]?.saving?.[r]?.pending)&&void 0!==s&&s}function _t(e,t,n,r){var s;return null!==(s=e.entities.records?.[t]?.[n]?.deleting?.[r]?.pending)&&void 0!==s&&s}function Rt(e,t,n,r){return e.entities.records?.[t]?.[n]?.saving?.[r]?.error}function bt(e,t,n,r){return e.entities.records?.[t]?.[n]?.deleting?.[r]?.error}function wt(e){V()("select( 'core' ).getUndoEdit()",{since:"6.3"})}function St(e){V()("select( 'core' ).getRedoEdit()",{since:"6.3"})}function Tt(e){return e.undoManager.hasUndo()}function It(e){return e.undoManager.hasRedo()}function kt(e){return e.currentTheme?it(e,"root","theme",e.currentTheme):null}function Ot(e){return e.currentGlobalStylesId}function Ct(e){var t;return null!==(t=kt(e)?.theme_supports)&&void 0!==t?t:We}function At(e,t){return e.embedPreviews[t]}function Pt(e,t){const n=e.embedPreviews[t],r='<a href="'+t+'">'+t+"</a>";return!!n&&n.html===r}function Ut(e,t,n,r){if("object"==typeof n&&(!n.kind||!n.name))return!1;const s=ze(t,n,r);return e.userPermissions[s]}function xt(e,t,n,r){return V()("wp.data.select( 'core' ).canUserEditEntityRecord()",{since:"6.7",alternative:"wp.data.select( 'core' ).canUser( 'update', { kind, name, id } )"}),Ut(e,"update",{kind:t,name:n,id:r})}function Lt(e,t,n){return e.autosaves[n]}function jt(e,t,n,r){if(void 0===r)return;const s=e.autosaves[n];return s?.find((e=>e.author===r))}const Mt=(0,l.createRegistrySelector)((e=>(t,n,r)=>e(Y).hasFinishedResolution("getAutosaves",[n,r])));function Dt(e){return e.editsReference}function Nt(e,t){const n=lt(e,"postType","wp_template",{"find-template":t});return n?.length?gt(e,"postType","wp_template",n[0].id):null}function Vt(e){const t=kt(e);return t?e.themeBaseGlobalStyles[t.stylesheet]:null}function Gt(e){const t=kt(e);return t?e.themeGlobalStyleVariations[t.stylesheet]:null}function qt(e){return e.blockPatterns}function Bt(e){return e.blockPatternCategories}function $t(e){return e.userPatternCategories}function Ft(e){V()("select( 'core' ).getCurrentThemeGlobalStylesRevisions()",{since:"6.5.0",alternative:"select( 'core' ).getRevisions( 'root', 'globalStyles', ${ recordKey } )"});const t=Ot(e);return t?e.themeGlobalStyleRevisions[t]:null}function Kt(e,t){return e.defaultTemplates[JSON.stringify(t)]}const Qt=(e,t,n,r,s)=>{const i=e.entities.records?.[t]?.[n]?.revisions?.[r];return i?Ke(i,s):null},Yt=(0,l.createSelector)(((e,t,n,r,s,i)=>{var o;const a=e.entities.records?.[t]?.[n]?.revisions?.[r];if(!a)return;const c=null!==(o=i?.context)&&void 0!==o?o:"default";if(void 0===i){if(!a.itemIsComplete[c]?.[s])return;return a.items[c][s]}const l=a.items[c]?.[s];if(l&&i._fields){var u;const e={},t=null!==(u=Pe(i._fields))&&void 0!==u?u:[];for(let n=0;n<t.length;n++){const r=t[n].split(".");let s=l;r.forEach((e=>{s=s?.[e]})),G(e,r,s)}return e}return l}),((e,t,n,r,s,i)=>{var o;const a=null!==(o=i?.context)&&void 0!==o?o:"default";return[e.entities.records?.[t]?.[n]?.revisions?.[r]?.items?.[a]?.[s],e.entities.records?.[t]?.[n]?.revisions?.[r]?.itemIsComplete?.[a]?.[s]]}));function Ht(e){return e.undoManager}function zt(e){return e.navigationFallbackId}const Wt=(0,l.createRegistrySelector)((e=>(0,l.createSelector)(((t,n)=>e(Y).getBlockPatterns().filter((({postTypes:e})=>!e||Array.isArray(e)&&e.includes(n)))),(()=>[e(Y).getBlockPatterns()])))),Jt=(0,l.createRegistrySelector)((e=>(0,l.createSelector)(((t,n,r,s)=>(Array.isArray(s)?s:[s]).map((t=>({delete:e(Y).canUser("delete",{kind:n,name:r,id:t}),update:e(Y).canUser("update",{kind:n,name:r,id:t})})))),(e=>[e.userPermissions]))));function Xt(e,t,n,r){return Jt(e,t,n,r)[0]}function Zt(e,t){var n;return null!==(n=e.registeredPostMeta?.[t])&&void 0!==n?n:{}}function en(e,t){return{type:"RECEIVE_REGISTERED_POST_META",postType:e,registeredPostMeta:t}}function tn(e,t){return 0===t?e.toLowerCase():S(e,t)}function nn(e,t){return void 0===t&&(t={}),T(e,g({transform:tn},t))}const rn=window.wp.htmlEntities,sn=e=>(...t)=>async({resolveSelect:n})=>{await n[e](...t)};async function on(e,t={},n={}){const r=t.isInitialSuggestions&&t.initialSuggestionsSearchOptions?{...t,...t.initialSuggestionsSearchOptions}:t,{type:s,subtype:i,page:o,perPage:a=(t.isInitialSuggestions?3:20)}=r,{disablePostFormats:c=!1}=n,l=[];s&&"post"!==s||l.push(k()({path:(0,D.addQueryArgs)("/wp/v2/search",{search:e,page:o,per_page:a,type:"post",subtype:i})}).then((e=>e.map((e=>({id:e.id,url:e.url,title:(0,rn.decodeEntities)(e.title||"")||(0,O.__)("(no title)"),type:e.subtype||e.type,kind:"post-type"}))))).catch((()=>[]))),s&&"term"!==s||l.push(k()({path:(0,D.addQueryArgs)("/wp/v2/search",{search:e,page:o,per_page:a,type:"term",subtype:i})}).then((e=>e.map((e=>({id:e.id,url:e.url,title:(0,rn.decodeEntities)(e.title||"")||(0,O.__)("(no title)"),type:e.subtype||e.type,kind:"taxonomy"}))))).catch((()=>[]))),c||s&&"post-format"!==s||l.push(k()({path:(0,D.addQueryArgs)("/wp/v2/search",{search:e,page:o,per_page:a,type:"post-format",subtype:i})}).then((e=>e.map((e=>({id:e.id,url:e.url,title:(0,rn.decodeEntities)(e.title||"")||(0,O.__)("(no title)"),type:e.subtype||e.type,kind:"taxonomy"}))))).catch((()=>[]))),s&&"attachment"!==s||l.push(k()({path:(0,D.addQueryArgs)("/wp/v2/media",{search:e,page:o,per_page:a})}).then((e=>e.map((e=>({id:e.id,url:e.source_url,title:(0,rn.decodeEntities)(e.title.rendered||"")||(0,O.__)("(no title)"),type:e.type,kind:"media"}))))).catch((()=>[])));let u=(await Promise.all(l)).flat();return u=u.filter((e=>!!e.id)),u=function(e,t){const n=an(t),r={};for(const t of e)if(t.title){const e=an(t.title),s=e.filter((e=>n.some((t=>e.includes(t)))));r[t.id]=s.length/e.length}else r[t.id]=0;return e.sort(((e,t)=>r[t.id]-r[e.id]))}(u,e),u=u.slice(0,a),u}function an(e){return e.toLowerCase().match(/[\p{L}\p{N}]+/gu)||[]}const cn=new Map,ln=async(e,t={})=>{const n={url:(0,D.prependHTTP)(e)};if(!(0,D.isURL)(e))return Promise.reject(`${e} is not a valid URL.`);const r=(0,D.getProtocol)(e);return r&&(0,D.isValidProtocol)(r)&&r.startsWith("http")&&/^https?:\/\/[^\/\s]/i.test(e)?cn.has(e)?cn.get(e):k()({path:(0,D.addQueryArgs)("/wp-block-editor/v1/url-details",n),...t}).then((t=>(cn.set(e,t),t))):Promise.reject(`${e} does not have a valid protocol. URLs must be "http" based`)};async function un(){const e=await k()({path:"/wp/v2/block-patterns/patterns"});return e?e.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[nn(e),t]))))):[]}const dn=e=>async({dispatch:t})=>{const n=(0,D.addQueryArgs)("/wp/v2/users/?who=authors&per_page=100",e),r=await k()({path:n});t.receiveUserQuery(n,r)},pn=()=>async({dispatch:e})=>{const t=await k()({path:"/wp/v2/users/me"});e.receiveCurrentUser(t)},fn=(e,t,n="",r)=>async({select:s,dispatch:i,registry:o})=>{const a=(await i(Ae(e,t))).find((n=>n.name===t&&n.kind===e));if(!a)return;const c=await i.__unstableAcquireStoreLock(Y,["entities","records",e,t,n],{exclusive:!1});try{if(window.__experimentalEnableSync&&a.syncConfig&&!r)0;else{void 0!==r&&r._fields&&(r={...r,_fields:[...new Set([...Pe(r._fields)||[],a.key||Re])].join()});const c=(0,D.addQueryArgs)(a.baseURL+(n?"/"+n:""),{...a.baseURLParams,...r});if(void 0!==r&&r._fields){r={...r,include:[n]};if(s.hasEntityRecords(e,t,r))return}const l=await k()({path:c,parse:!1}),u=await l.json(),d=He(l.headers?.get("allow")),p=[],f={};for(const r of Ye)f[ze(r,{kind:e,name:t,id:n})]=d[r],p.push([r,{kind:e,name:t,id:n}]);o.batch((()=>{i.receiveEntityRecords(e,t,u,r),i.receiveUserPermissions(f),i.finishResolutions("canUser",p)}))}}finally{i.__unstableReleaseStoreLock(c)}},yn=sn("getEntityRecord"),En=sn("getEntityRecord"),mn=(e,t,n={})=>async({dispatch:r,registry:s})=>{const i=(await r(Ae(e,t))).find((n=>n.name===t&&n.kind===e));if(!i)return;const o=await r.__unstableAcquireStoreLock(Y,["entities","records",e,t],{exclusive:!1});try{n._fields&&(n={...n,_fields:[...new Set([...Pe(n._fields)||[],i.key||Re])].join()});const a=(0,D.addQueryArgs)(i.baseURL,{...i.baseURLParams,...n});let c,l;if(i.supportsPagination&&-1!==n.per_page){const e=await k()({path:a,parse:!1});c=Object.values(await e.json()),l={totalItems:parseInt(e.headers.get("X-WP-Total")),totalPages:parseInt(e.headers.get("X-WP-TotalPages"))}}else c=Object.values(await k()({path:a})),l={totalItems:c.length,totalPages:1};n._fields&&(c=c.map((e=>(n._fields.split(",").forEach((t=>{e.hasOwnProperty(t)||(e[t]=void 0)})),e)))),s.batch((()=>{if(r.receiveEntityRecords(e,t,c,n,!1,void 0,l),!n?._fields&&!n.context){const n=i.key||Re,s=c.filter((e=>e?.[n])).map((r=>[e,t,r[n]])),o=c.filter((e=>e?.[n])).map((e=>({id:e[n],permissions:He(e?._links?.self?.[0].targetHints.allow)}))),a=[],l={};for(const n of o)for(const r of Ye)a.push([r,{kind:e,name:t,id:n.id}]),l[ze(r,{kind:e,name:t,id:n.id})]=n.permissions[r];r.receiveUserPermissions(l),r.finishResolutions("getEntityRecord",s),r.finishResolutions("canUser",a)}r.__unstableReleaseStoreLock(o)}))}catch(e){r.__unstableReleaseStoreLock(o)}};mn.shouldInvalidate=(e,t,n)=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&t===e.kind&&n===e.name;const gn=()=>async({dispatch:e,resolveSelect:t})=>{const n=await t.getEntityRecords("root","theme",{status:"active"});e.receiveCurrentTheme(n[0])},hn=sn("getCurrentTheme"),vn=e=>async({dispatch:t})=>{try{const n=await k()({path:(0,D.addQueryArgs)("/oembed/1.0/proxy",{url:e})});t.receiveEmbedPreview(e,n)}catch(n){t.receiveEmbedPreview(e,!1)}},_n=(e,t,n)=>async({dispatch:r,registry:s})=>{if(!Ye.includes(e))throw new Error(`'${e}' is not a valid action.`);let i=null;if("object"==typeof t){if(!t.kind||!t.name)throw new Error("The entity resource object is not valid.");const e=(await r(Ae(t.kind,t.name))).find((e=>e.name===t.name&&e.kind===t.kind));if(!e)return;i=e.baseURL+(t.id?"/"+t.id:"")}else i=`/wp/v2/${t}`+(n?"/"+n:"");const{hasStartedResolution:o}=s.select(Y);for(const r of Ye){if(r===e)continue;if(o("canUser",[r,t,n]))return}let a;try{a=await k()({path:i,method:"OPTIONS",parse:!1})}catch(e){return}const c=He(a.headers?.get("allow"));s.batch((()=>{for(const s of Ye){const i=ze(s,t,n);r.receiveUserPermission(i,c[s]),s!==e&&r.finishResolution("canUser",[s,t,n])}}))},Rn=(e,t,n)=>async({dispatch:r})=>{await r(_n("update",{kind:e,name:t,id:n}))},bn=(e,t)=>async({dispatch:n,resolveSelect:r})=>{const{rest_base:s,rest_namespace:i="wp/v2"}=await r.getPostType(e),o=await k()({path:`/${i}/${s}/${t}/autosaves?context=edit`});o&&o.length&&n.receiveAutosaves(t,o)},wn=(e,t)=>async({resolveSelect:n})=>{await n.getAutosaves(e,t)},Sn=e=>async({dispatch:t,resolveSelect:n})=>{let r;try{r=await k()({url:(0,D.addQueryArgs)(e,{"_wp-find-template":!0})}).then((({data:e})=>e))}catch(e){}if(!r)return;const s=await n.getEntityRecord("postType","wp_template",r.id);s&&t.receiveEntityRecords("postType","wp_template",[s],{"find-template":e})};Sn.shouldInvalidate=e=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&"postType"===e.kind&&"wp_template"===e.name;const Tn=()=>async({dispatch:e,resolveSelect:t})=>{const n=await t.getEntityRecords("root","theme",{status:"active"}),r=n?.[0]?._links?.["wp:user-global-styles"]?.[0]?.href;if(!r)return;const s=r.match(/\/(\d+)(?:\?|$)/),i=s?Number(s[1]):null;i&&e.__experimentalReceiveCurrentGlobalStylesId(i)},In=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.getCurrentTheme(),r=await k()({path:`/wp/v2/global-styles/themes/${n.stylesheet}?context=view`});t.__experimentalReceiveThemeBaseGlobalStyles(n.stylesheet,r)},kn=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.getCurrentTheme(),r=await k()({path:`/wp/v2/global-styles/themes/${n.stylesheet}/variations?context=view`});t.__experimentalReceiveThemeGlobalStyleVariations(n.stylesheet,r)},On=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.__experimentalGetCurrentGlobalStylesId(),r=n?await e.getEntityRecord("root","globalStyles",n):void 0,s=r?._links?.["version-history"]?.[0]?.href;if(s){const e=await k()({url:s}),r=e?.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[nn(e),t])))));t.receiveThemeGlobalStyleRevisions(n,r)}};On.shouldInvalidate=e=>"SAVE_ENTITY_RECORD_FINISH"===e.type&&"root"===e.kind&&!e.error&&"globalStyles"===e.name;const Cn=()=>async({dispatch:e})=>{e({type:"RECEIVE_BLOCK_PATTERNS",patterns:await un()})},An=()=>async({dispatch:e})=>{e({type:"RECEIVE_BLOCK_PATTERN_CATEGORIES",categories:await k()({path:"/wp/v2/block-patterns/categories"})})},Pn=()=>async({dispatch:e,resolveSelect:t})=>{const n=await t.getEntityRecords("taxonomy","wp_pattern_category",{per_page:-1,_fields:"id,name,description,slug",context:"view"});e({type:"RECEIVE_USER_PATTERN_CATEGORIES",patternCategories:n?.map((e=>({...e,label:(0,rn.decodeEntities)(e.name),name:e.slug})))||[]})},Un=()=>async({dispatch:e,select:t,registry:n})=>{const r=await k()({path:(0,D.addQueryArgs)("/wp-block-editor/v1/navigation-fallback",{_embed:!0})}),s=r?._embedded?.self;n.batch((()=>{if(e.receiveNavigationFallbackId(r?.id),!s)return;const n=!t.getEntityRecord("postType","wp_navigation",r.id);e.receiveEntityRecords("postType","wp_navigation",s,void 0,n),e.finishResolution("getEntityRecord",["postType","wp_navigation",r.id])}))},xn=e=>async({dispatch:t})=>{const n=await k()({path:(0,D.addQueryArgs)("/wp/v2/templates/lookup",e)});n?.id&&t.receiveDefaultTemplateId(e,n.id)},Ln=(e,t,n,r={})=>async({dispatch:s,registry:i})=>{const o=(await s(Ae(e,t))).find((n=>n.name===t&&n.kind===e));if(!o)return;r._fields&&(r={...r,_fields:[...new Set([...Pe(r._fields)||[],o.revisionKey||Re])].join()});const a=(0,D.addQueryArgs)(o.getRevisionsUrl(n),r);let c,l;const u={},d=o.supportsPagination&&-1!==r.per_page;try{l=await k()({path:a,parse:!d})}catch(e){return}l&&(d?(c=Object.values(await l.json()),u.totalItems=parseInt(l.headers.get("X-WP-Total"))):c=Object.values(l),r._fields&&(c=c.map((e=>(r._fields.split(",").forEach((t=>{e.hasOwnProperty(t)||(e[t]=void 0)})),e)))),i.batch((()=>{if(s.receiveRevisions(e,t,n,c,r,!1,u),!r?._fields&&!r.context){const r=o.key||Re,i=c.filter((e=>e[r])).map((s=>[e,t,n,s[r]]));s.finishResolutions("getRevision",i)}})))};Ln.shouldInvalidate=(e,t,n,r)=>"SAVE_ENTITY_RECORD_FINISH"===e.type&&n===e.name&&t===e.kind&&!e.error&&r===e.recordId;const jn=(e,t,n,r,s)=>async({dispatch:i})=>{const o=(await i(Ae(e,t))).find((n=>n.name===t&&n.kind===e));if(!o)return;void 0!==s&&s._fields&&(s={...s,_fields:[...new Set([...Pe(s._fields)||[],o.revisionKey||Re])].join()});const a=(0,D.addQueryArgs)(o.getRevisionsUrl(n,r),s);let c;try{c=await k()({path:a})}catch(e){return}c&&i.receiveRevisions(e,t,n,c,s)},Mn=e=>async({dispatch:t,resolveSelect:n})=>{let r;try{const{rest_namespace:t="wp/v2",rest_base:s}=await n.getPostType(e)||{};r=await k()({path:`${t}/${s}/?context=edit`,method:"OPTIONS"})}catch(e){return}r&&t.receiveRegisteredPostMeta(e,r?.schema?.properties?.meta?.properties)};function Dn(e,t){const n={...e};let r=n;for(const e of t)r.children={...r.children,[e]:{locks:[],children:{},...r.children[e]}},r=r.children[e];return n}function Nn(e,t){let n=e;for(const e of t){const t=n.children[e];if(!t)return null;n=t}return n}function Vn({exclusive:e},t){return!(!e||!t.length)||!(e||!t.filter((e=>e.exclusive)).length)}const Gn={requests:[],tree:{locks:[],children:{}}};function qn(e=Gn,t){switch(t.type){case"ENQUEUE_LOCK_REQUEST":{const{request:n}=t;return{...e,requests:[n,...e.requests]}}case"GRANT_LOCK_REQUEST":{const{lock:n,request:r}=t,{store:s,path:i}=r,o=[s,...i],a=Dn(e.tree,o),c=Nn(a,o);return c.locks=[...c.locks,n],{...e,requests:e.requests.filter((e=>e!==r)),tree:a}}case"RELEASE_LOCK":{const{lock:n}=t,r=[n.store,...n.path],s=Dn(e.tree,r),i=Nn(s,r);return i.locks=i.locks.filter((e=>e!==n)),{...e,tree:s}}}return e}function Bn(e,t,n,{exclusive:r}){const s=[t,...n],i=e.tree;for(const e of function*(e,t){let n=e;yield n;for(const e of t){const t=n.children[e];if(!t)break;yield t,n=t}}(i,s))if(Vn({exclusive:r},e.locks))return!1;const o=Nn(i,s);if(!o)return!0;for(const e of function*(e){const t=Object.values(e.children);for(;t.length;){const e=t.pop();yield e,t.push(...Object.values(e.children))}}(o))if(Vn({exclusive:r},e.locks))return!1;return!0}function $n(){let e=qn(void 0,{type:"@@INIT"});function t(){for(const t of function(e){return e.requests}(e)){const{store:n,path:r,exclusive:s,notifyAcquired:i}=t;if(Bn(e,n,r,{exclusive:s})){const o={store:n,path:r,exclusive:s};e=qn(e,{type:"GRANT_LOCK_REQUEST",lock:o,request:t}),i(o)}}}return{acquire:function(n,r,s){return new Promise((i=>{e=qn(e,{type:"ENQUEUE_LOCK_REQUEST",request:{store:n,path:r,exclusive:s,notifyAcquired:i}}),t()}))},release:function(n){e=qn(e,{type:"RELEASE_LOCK",lock:n}),t()}}}function Fn(){const e=$n();return{__unstableAcquireStoreLock:function(t,n,{exclusive:r}){return()=>e.acquire(t,n,r)},__unstableReleaseStoreLock:function(t){return()=>e.release(t)}}}const Kn=window.wp.privateApis,{lock:Qn,unlock:Yn}=(0,Kn.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/core-data"),Hn=window.wp.element,zn=(0,Hn.createContext)({}),Wn=window.ReactJSXRuntime;function Jn({kind:e,type:t,id:n,children:r}){const s=(0,Hn.useContext)(zn),i=(0,Hn.useMemo)((()=>({...s,[e]:{...s?.[e],[t]:n}})),[s,e,t,n]);return(0,Wn.jsx)(zn.Provider,{value:i,children:r})}const Xn=function(e,t){var n,r,s=0;function i(){var i,o,a=n,c=arguments.length;e:for(;a;){if(a.args.length===arguments.length){for(o=0;o<c;o++)if(a.args[o]!==arguments[o]){a=a.next;continue e}return a!==n&&(a===r&&(r=a.prev),a.prev.next=a.next,a.next&&(a.next.prev=a.prev),a.next=n,a.prev=null,n.prev=a,n=a),a.val}a=a.next}for(i=new Array(c),o=0;o<c;o++)i[o]=arguments[o];return a={args:i,val:e.apply(null,i)},n?(n.prev=a,a.next=n):r=a,s===t.maxSize?(r=r.prev).next=null:s++,n=a,a.val}return t=t||{},i.clear=function(){n=null,r=null,s=0},i};let Zn=function(e){return e.Idle="IDLE",e.Resolving="RESOLVING",e.Error="ERROR",e.Success="SUCCESS",e}({});const er=["getIsResolving","hasStartedResolution","hasFinishedResolution","isResolving","getCachedResolvers"];function tr(e,t){return(0,l.useSelect)(((t,n)=>e((e=>nr(t(e))),n)),t)}const nr=Xn((e=>{const t={};for(const n in e)er.includes(n)||Object.defineProperty(t,n,{get:()=>(...t)=>{const r=e[n](...t),s=e.getResolutionState(n,t)?.status;let i;switch(s){case"resolving":i=Zn.Resolving;break;case"finished":i=Zn.Success;break;case"error":i=Zn.Error;break;case void 0:i=Zn.Idle}return{data:r,status:i,isResolving:i===Zn.Resolving,hasStarted:i!==Zn.Idle,hasResolved:i===Zn.Success||i===Zn.Error}}});return t})),rr={};function sr(e,t,n,r={enabled:!0}){const{editEntityRecord:s,saveEditedEntityRecord:i}=(0,l.useDispatch)(Ar),o=(0,Hn.useMemo)((()=>({edit:(r,i={})=>s(e,t,n,r,i),save:(r={})=>i(e,t,n,{throwOnError:!0,...r})})),[s,e,t,n,i]),{editedRecord:a,hasEdits:c,edits:u}=(0,l.useSelect)((s=>r.enabled?{editedRecord:s(Ar).getEditedEntityRecord(e,t,n),hasEdits:s(Ar).hasEditsForEntityRecord(e,t,n),edits:s(Ar).getEntityRecordNonTransientEdits(e,t,n)}:{editedRecord:rr,hasEdits:!1,edits:rr}),[e,t,n,r.enabled]),{data:d,...p}=tr((s=>r.enabled?s(Ar).getEntityRecord(e,t,n):{data:null}),[e,t,n,r.enabled]);return{record:d,editedRecord:a,hasEdits:c,edits:u,...p,...o}}function ir(e,t,n,r){return V()("wp.data.__experimentalUseEntityRecord",{alternative:"wp.data.useEntityRecord",since:"6.1"}),sr(e,t,n,r)}const or=[];function ar(e,t,n={},r={enabled:!0}){const s=(0,D.addQueryArgs)("",n),{data:i,...o}=tr((s=>r.enabled?s(Ar).getEntityRecords(e,t,n):{data:or}),[e,t,s,r.enabled]),{totalItems:a,totalPages:c}=(0,l.useSelect)((s=>r.enabled?{totalItems:s(Ar).getEntityRecordsTotalItems(e,t,n),totalPages:s(Ar).getEntityRecordsTotalPages(e,t,n)}:{totalItems:null,totalPages:null}),[e,t,s,r.enabled]);return{records:i,totalItems:a,totalPages:c,...o}}function cr(e,t,n,r){return V()("wp.data.__experimentalUseEntityRecords",{alternative:"wp.data.useEntityRecords",since:"6.1"}),ar(e,t,n,r)}window.wp.warning;function lr(e,t){const n="object"==typeof e;return tr((r=>{const s=n?!!e.id:!!t,{canUser:i}=r(Ar),o=i("create",n?{kind:e.kind,name:e.name}:e);if(!s){const t=i("read",e),n=o.isResolving||t.isResolving,r=o.hasResolved&&t.hasResolved;let s=Zn.Idle;return n?s=Zn.Resolving:r&&(s=Zn.Success),{status:s,isResolving:n,hasResolved:r,canCreate:o.hasResolved&&o.data,canRead:t.hasResolved&&t.data}}const a=i("read",e,t),c=i("update",e,t),l=i("delete",e,t),u=a.isResolving||o.isResolving||c.isResolving||l.isResolving,d=a.hasResolved&&o.hasResolved&&c.hasResolved&&l.hasResolved;let p=Zn.Idle;return u?p=Zn.Resolving:d&&(p=Zn.Success),{status:p,isResolving:u,hasResolved:d,canRead:d&&a.data,canCreate:d&&o.data,canUpdate:d&&c.data,canDelete:d&&l.data}}),[n?JSON.stringify(e):e,t])}const ur=lr;function dr(e,t){return V()("wp.data.__experimentalUseResourcePermissions",{alternative:"wp.data.useResourcePermissions",since:"6.1"}),lr(e,t)}const pr=window.wp.blocks;function fr(e,t){const n=(0,Hn.useContext)(zn);return n?.[e]?.[t]}const yr=window.wp.blockEditor;let Er;const mr=new WeakMap;const gr=new WeakMap;function hr(e){if(!gr.has(e)){const t=[];for(const n of function(e){if(Er||(Er=Yn(yr.privateApis)),!mr.has(e)){const t=Er.getRichTextValues([e]);mr.set(e,t)}return mr.get(e)}(e))n&&n.replacements.forEach((({type:e,attributes:n})=>{"core/footnote"===e&&t.push(n["data-fn"])}));gr.set(e,t)}return gr.get(e)}let vr={};function _r(e,t){const n={blocks:e};if(!t)return n;if(void 0===t.footnotes)return n;const r=function(e){return e.flatMap(hr)}(e),s=t.footnotes?JSON.parse(t.footnotes):[];if(s.map((e=>e.id)).join("")===r.join(""))return n;const i=r.map((e=>s.find((t=>t.id===e))||vr[e]||{id:e,content:""}));function o(e){if(!e||Array.isArray(e)||"object"!=typeof e)return e;e={...e};for(const t in e){const n=e[t];if(Array.isArray(n)){e[t]=n.map(o);continue}if("string"!=typeof n&&!(n instanceof C.RichTextData))continue;const s="string"==typeof n?C.RichTextData.fromHTMLString(n):new C.RichTextData(n);let i=!1;s.replacements.forEach((e=>{if("core/footnote"===e.type){const t=e.attributes["data-fn"],n=r.indexOf(t),s=(0,C.create)({html:e.innerHTML});s.text=String(n+1),s.formats=Array.from({length:s.text.length},(()=>s.formats[0])),s.replacements=Array.from({length:s.text.length},(()=>s.replacements[0])),e.innerHTML=(0,C.toHTMLString)({value:s}),i=!0}})),i&&(e[t]="string"==typeof n?s.toHTMLString():s)}return e}const a=function e(t){return t.map((t=>({...t,attributes:o(t.attributes),innerBlocks:e(t.innerBlocks)})))}(e);return vr={...vr,...s.reduce(((e,t)=>(r.includes(t.id)||(e[t.id]=t),e)),{})},{meta:{...t,footnotes:JSON.stringify(i)},blocks:a}}const Rr=[],br=new WeakMap;function wr(e,t,{id:n}={}){const r=fr(e,t),s=null!=n?n:r,{getEntityRecord:i,getEntityRecordEdits:o}=(0,l.useSelect)(Y),{content:a,editedBlocks:c,meta:u}=(0,l.useSelect)((n=>{if(!s)return{};const{getEditedEntityRecord:r}=n(Y),i=r(e,t,s);return{editedBlocks:i.blocks,content:i.content,meta:i.meta}}),[e,t,s]),{__unstableCreateUndoLevel:d,editEntityRecord:p}=(0,l.useDispatch)(Y),f=(0,Hn.useMemo)((()=>{if(!s)return;if(c)return c;if(!a||"string"!=typeof a)return Rr;const n=o(e,t,s),r=!n||!Object.keys(n).length?i(e,t,s):n;let l=br.get(r);return l||(l=(0,pr.parse)(a),br.set(r,l)),l}),[e,t,s,c,a,i,o]),y=(0,Hn.useCallback)((e=>_r(e,u)),[u]),E=(0,Hn.useCallback)(((n,r)=>{if(f===n)return d(e,t,s);const{selection:i,...o}=r,a={selection:i,content:({blocks:e=[]})=>(0,pr.__unstableSerializeAndClean)(e),...y(n)};p(e,t,s,a,{isCached:!1,...o})}),[e,t,s,f,y,d,p]),m=(0,Hn.useCallback)(((n,r)=>{const{selection:i,...o}=r,a={selection:i,...y(n)};p(e,t,s,a,{isCached:!0,...o})}),[e,t,s,y,p]);return[f,m,E]}function Sr(e,t,n,r){const s=fr(e,t),i=null!=r?r:s,{value:o,fullValue:a}=(0,l.useSelect)((r=>{const{getEntityRecord:s,getEditedEntityRecord:o}=r(Y),a=s(e,t,i),c=o(e,t,i);return a&&c?{value:c[n],fullValue:a[n]}:{}}),[e,t,i,n]),{editEntityRecord:c}=(0,l.useDispatch)(Y);return[o,(0,Hn.useCallback)((r=>{c(e,t,i,{[n]:r})}),[c,e,t,i,n]),a]}const Tr={};Qn(Tr,{useEntityRecordsWithPermissions:function(e,t,n={},r={enabled:!0}){const s=(0,l.useSelect)((n=>n(Ar).getEntityConfig(e,t)),[e,t]),{records:i,...o}=ar(e,t,n,r),a=(0,Hn.useMemo)((()=>{var e;return null!==(e=i?.map((e=>{var t;return e[null!==(t=s?.key)&&void 0!==t?t:"id"]})))&&void 0!==e?e:[]}),[i,s?.key]),c=(0,l.useSelect)((n=>{const{getEntityRecordsPermissions:r}=Yn(n(Ar));return r(e,t,a)}),[a,e,t]);return{records:(0,Hn.useMemo)((()=>{var e;return null!==(e=i?.map(((e,t)=>({...e,permissions:c[t]}))))&&void 0!==e?e:[]}),[i,c]),...o}}});const Ir=[...we,...Se.filter((e=>!!e.name))],kr=Ir.reduce(((e,t)=>{const{kind:n,name:r,plural:s}=t;return e[Ce(n,r)]=(e,t,s)=>it(e,n,r,t,s),s&&(e[Ce(n,s,"get")]=(e,t)=>lt(e,n,r,t)),e}),{}),Or=Ir.reduce(((e,t)=>{const{kind:n,name:r,plural:s}=t;if(e[Ce(n,r)]=(e,t)=>fn(n,r,e,t),s){const t=Ce(n,s,"get");e[t]=(...e)=>mn(n,r,...e),e[t].shouldInvalidate=e=>mn.shouldInvalidate(e,n,r)}return e}),{}),Cr=Ir.reduce(((e,t)=>{const{kind:n,name:r}=t;return e[Ce(n,r,"save")]=(e,t)=>ue(n,r,e,t),e[Ce(n,r,"delete")]=(e,t,s)=>ie(n,r,e,t,s),e}),{}),Ar=(0,l.createReduxStore)(Y,{reducer:qe,actions:{...s,...Cr,...Fn()},selectors:{...i,...kr},resolvers:{...c,...Or}});Yn(Ar).registerPrivateSelectors(o),Yn(Ar).registerPrivateActions(a),(0,l.register)(Ar),(window.wp=window.wp||{}).coreData=r})();