CoreFiles by mySites.guru
core-data.min.js2 lines, 130,910 bytes, from wordpress-6.9-beta1.zip
Raw History Compare with 6.8-beta3
md5
053c871ea3ae4a12eeef3d45b4a39a76
sha1
0192c35fff8537d49ec7ba7edd72d8e7dec6e658
sha256
3d07d1269e2daaa268fbe4c3ab0d095a8e92230ad2a7033fdfad9924a27f2e02
/*! This file is auto-generated */
(()=>{var t={287:(t,e,n)=>{"use strict";n.d(e,{fL:()=>o,l3:()=>i});var r=n(1635),s=n(2226);function i(t,e){var n=t.charAt(0),r=t.substr(1).toLowerCase();return e>0&&n>="0"&&n<="9"?"_"+n+r:""+n.toUpperCase()+r}function o(t,e){return void 0===e&&(e={}),(0,s.W)(t,(0,r.Cl)({delimiter:"",transform:i},e))}},533:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});var r=function(t){return"string"==typeof t?t.split(","):Array.isArray(t)?t:null}},644:(t,e,n)=>{"use strict";n.d(e,{qh:()=>d,bM:()=>h.bM,_:()=>m,hg:()=>P,mV:()=>v,S$:()=>L,MA:()=>u,$u:()=>h.Ay,qs:()=>E});var r=n(7143),s=n(4040),i=n.n(s),o=n(6087),c=n(7541),a=n(4565);const l={};function u(t,e,n,s={enabled:!0}){const{editEntityRecord:i,saveEditedEntityRecord:u}=(0,r.useDispatch)(a.store),d=(0,o.useMemo)((()=>({edit:(r,s={})=>i(t,e,n,r,s),save:(r={})=>u(t,e,n,{throwOnError:!0,...r})})),[i,t,e,n,u]),{editedRecord:h,hasEdits:g,edits:f}=(0,r.useSelect)((r=>s.enabled?{editedRecord:r(a.store).getEditedEntityRecord(t,e,n),hasEdits:r(a.store).hasEditsForEntityRecord(t,e,n),edits:r(a.store).getEntityRecordNonTransientEdits(t,e,n)}:{editedRecord:l,hasEdits:!1,edits:l}),[t,e,n,s.enabled]),{data:p,...y}=(0,c.A)((r=>s.enabled?r(a.store).getEntityRecord(t,e,n):{data:null}),[t,e,n,s.enabled]);return{record:p,editedRecord:h,hasEdits:g,edits:f,...y,...d}}function d(t,e,n,r){return i()("wp.data.__experimentalUseEntityRecord",{alternative:"wp.data.useEntityRecord",since:"6.1"}),u(t,e,n,r)}var h=n(7078);const g=window.wp.warning;var f=n.n(g),p=n(2859);function y(t,e){const n="object"==typeof t,r=n?JSON.stringify(t):t;return n&&void 0!==e&&f()("When 'resource' is an entity object, passing 'id' as a separate argument isn't supported."),(0,c.A)((r=>{const s=n?!!t.id:!!e,{canUser:i}=r(a.store),o=i("create",n?{kind:t.kind,name:t.name}:t);if(!s){const e=i("read",t),n=o.isResolving||e.isResolving,r=o.hasResolved&&e.hasResolved;let s=p.n.Idle;return n?s=p.n.Resolving:r&&(s=p.n.Success),{status:s,isResolving:n,hasResolved:r,canCreate:o.hasResolved&&o.data,canRead:e.hasResolved&&e.data}}const c=i("read",t,e),l=i("update",t,e),u=i("delete",t,e),d=c.isResolving||o.isResolving||l.isResolving||u.isResolving,h=c.hasResolved&&o.hasResolved&&l.hasResolved&&u.hasResolved;let g=p.n.Idle;return d?g=p.n.Resolving:h&&(g=p.n.Success),{status:g,isResolving:d,hasResolved:h,canRead:h&&c.data,canCreate:h&&o.data,canUpdate:h&&l.data,canDelete:h&&u.data}}),[r,e])}var E=y;function m(t,e){return i()("wp.data.__experimentalUseResourcePermissions",{alternative:"wp.data.useResourcePermissions",since:"6.1"}),y(t,e)}var _=n(4997),b=n(2278),w=n(8843);function v(t,e){const n=(0,o.useContext)(w.D);return n?.[t]?.[e]}var R=n(876);const k=window.wp.blockEditor;var S=n(6378);let A;const C=new WeakMap;const I=new WeakMap;function T(t){if(!I.has(t)){const e=[];for(const n of function(t){if(A||(A=(0,S.T)(k.privateApis)),!C.has(t)){const e=A.getRichTextValues([t]);C.set(t,e)}return C.get(t)}(t))n&&n.replacements.forEach((({type:t,attributes:n})=>{"core/footnote"===t&&e.push(n["data-fn"])}));I.set(t,e)}return I.get(t)}let O={};function x(t,e){const n={blocks:t};if(!e)return n;if(void 0===e.footnotes)return n;const r=function(t){return t.flatMap(T)}(t),s=e.footnotes?JSON.parse(e.footnotes):[];if(s.map((t=>t.id)).join("")===r.join(""))return n;const i=r.map((t=>s.find((e=>e.id===t))||O[t]||{id:t,content:""}));function o(t){if(!t||Array.isArray(t)||"object"!=typeof t)return t;t={...t};for(const e in t){const n=t[e];if(Array.isArray(n)){t[e]=n.map(o);continue}if("string"!=typeof n&&!(n instanceof R.RichTextData))continue;const s="string"==typeof n?R.RichTextData.fromHTMLString(n):new R.RichTextData(n);let i=!1;s.replacements.forEach((t=>{if("core/footnote"===t.type){const e=t.attributes["data-fn"],n=r.indexOf(e),s=(0,R.create)({html:t.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])),t.innerHTML=(0,R.toHTMLString)({value:s}),i=!0}})),i&&(t[e]="string"==typeof n?s.toHTMLString():s)}return t}const c=function t(e){return e.map((e=>({...e,attributes:o(e.attributes),innerBlocks:t(e.innerBlocks)})))}(t);return O={...O,...s.reduce(((t,e)=>(r.includes(e.id)||(t[e.id]=e),t)),{})},{meta:{...e,footnotes:JSON.stringify(i)},blocks:c}}const U=[],M=new WeakMap;function P(t,e,{id:n}={}){const s=v(t,e),i=n??s,{getEntityRecord:c,getEntityRecordEdits:a}=(0,r.useSelect)(b.E),{content:l,editedBlocks:u,meta:d}=(0,r.useSelect)((n=>{if(!i)return{};const{getEditedEntityRecord:r}=n(b.E),s=r(t,e,i);return{editedBlocks:s.blocks,content:s.content,meta:s.meta}}),[t,e,i]),{__unstableCreateUndoLevel:h,editEntityRecord:g}=(0,r.useDispatch)(b.E),f=(0,o.useMemo)((()=>{if(!i)return;if(u)return u;if(!l||"string"!=typeof l)return U;const n=a(t,e,i),r=!n||!Object.keys(n).length?c(t,e,i):n;let s=M.get(r);return s||(s=(0,_.parse)(l),M.set(r,s)),s}),[t,e,i,u,l,c,a]),p=(0,o.useCallback)(((n,r)=>{if(f===n)return h(t,e,i);const{selection:s,...o}=r,c={selection:s,content:({blocks:t=[]})=>(0,_.__unstableSerializeAndClean)(t),...x(n,d)};g(t,e,i,c,{isCached:!1,...o})}),[t,e,i,f,d,h,g]),y=(0,o.useCallback)(((n,r)=>{const{selection:s,...o}=r,c={selection:s,...x(n,d)};g(t,e,i,c,{isCached:!0,...o})}),[t,e,i,d,g]);return[f,y,p]}function L(t,e,n,s){const i=v(t,e),c=s??i,{value:a,fullValue:l}=(0,r.useSelect)((r=>{const{getEntityRecord:s,getEditedEntityRecord:i}=r(b.E),o=s(t,e,c),a=i(t,e,c);return o&&a?{value:a[n],fullValue:o[n]}:{}}),[t,e,c,n]),{editEntityRecord:u}=(0,r.useDispatch)(b.E);return[a,(0,o.useCallback)((r=>{u(t,e,c,{[n]:r})}),[u,t,e,c,n]),l]}},876:t=>{"use strict";t.exports=window.wp.richText},1455:t=>{"use strict";t.exports=window.wp.apiFetch},1569:(t,e,n)=>{"use strict";n.d(e,{A:()=>l});const r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let s;const i=new Uint8Array(16);function o(){if(!s&&(s="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!s))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return s(i)}const c=[];for(let t=0;t<256;++t)c.push((t+256).toString(16).slice(1));function a(t,e=0){return c[t[e+0]]+c[t[e+1]]+c[t[e+2]]+c[t[e+3]]+"-"+c[t[e+4]]+c[t[e+5]]+"-"+c[t[e+6]]+c[t[e+7]]+"-"+c[t[e+8]]+c[t[e+9]]+"-"+c[t[e+10]]+c[t[e+11]]+c[t[e+12]]+c[t[e+13]]+c[t[e+14]]+c[t[e+15]]}const l=function(t,e,n){if(r.randomUUID&&!e&&!t)return r.randomUUID();const s=(t=t||{}).random||(t.rng||o)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=s[t];return e}return a(s)}},1635:(t,e,n)=>{"use strict";n.d(e,{Cl:()=>r});var r=function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},r.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError},2226:(t,e,n)=>{"use strict";n.d(e,{W:()=>o});var r=n(7314),s=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],i=/[^A-Z0-9]+/gi;function o(t,e){void 0===e&&(e={});for(var n=e.splitRegexp,o=void 0===n?s:n,a=e.stripRegexp,l=void 0===a?i:a,u=e.transform,d=void 0===u?r.g:u,h=e.delimiter,g=void 0===h?" ":h,f=c(c(t,o,"$1\0$2"),l,"\0"),p=0,y=f.length;"\0"===f.charAt(p);)p++;for(;"\0"===f.charAt(y-1);)y--;return f.slice(p,y).split("\0").map(d).join(g)}function c(t,e,n){return e instanceof RegExp?t.replace(e,n):e.reduce((function(t,e){return t.replace(e,n)}),t)}},2239:(t,e,n)=>{"use strict";function r(t,e){const n={...t};let r=n;for(const t of e)r.children={...r.children,[t]:{locks:[],children:{},...r.children[t]}},r=r.children[t];return n}function s(t,e){let n=t;for(const t of e){const e=n.children[t];if(!e)return null;n=e}return n}function i({exclusive:t},e){return!(!t||!e.length)||!(t||!e.filter((t=>t.exclusive)).length)}n.d(e,{A:()=>u});const o={requests:[],tree:{locks:[],children:{}}};function c(t=o,e){switch(e.type){case"ENQUEUE_LOCK_REQUEST":{const{request:n}=e;return{...t,requests:[n,...t.requests]}}case"GRANT_LOCK_REQUEST":{const{lock:n,request:i}=e,{store:o,path:c}=i,a=[o,...c],l=r(t.tree,a),u=s(l,a);return u.locks=[...u.locks,n],{...t,requests:t.requests.filter((t=>t!==i)),tree:l}}case"RELEASE_LOCK":{const{lock:n}=e,i=[n.store,...n.path],o=r(t.tree,i),c=s(o,i);return c.locks=c.locks.filter((t=>t!==n)),{...t,tree:o}}}return t}function a(t,e,n,{exclusive:r}){const o=[e,...n],c=t.tree;for(const t of function*(t,e){let n=t;yield n;for(const t of e){const e=n.children[t];if(!e)break;yield e,n=e}}(c,o))if(i({exclusive:r},t.locks))return!1;const a=s(c,o);if(!a)return!0;for(const t of function*(t){const e=Object.values(t.children);for(;e.length;){const t=e.pop();yield t,e.push(...Object.values(t.children))}}(a))if(i({exclusive:r},t.locks))return!1;return!0}function l(){let t=c(void 0,{type:"@@INIT"});function e(){for(const e of function(t){return t.requests}(t)){const{store:n,path:r,exclusive:s,notifyAcquired:i}=e;if(a(t,n,r,{exclusive:s})){const o={store:n,path:r,exclusive:s};t=c(t,{type:"GRANT_LOCK_REQUEST",lock:o,request:e}),i(o)}}}return{acquire:function(n,r,s){return new Promise((i=>{t=c(t,{type:"ENQUEUE_LOCK_REQUEST",request:{store:n,path:r,exclusive:s,notifyAcquired:i}}),e()}))},release:function(n){t=c(t,{type:"RELEASE_LOCK",lock:n}),e()}}}function u(){const t=l();return{__unstableAcquireStoreLock:function(e,n,{exclusive:r}){return()=>t.acquire(e,n,r)},__unstableReleaseStoreLock:function(e){return()=>t.release(e)}}}},2278:(t,e,n)=>{"use strict";n.d(e,{E:()=>r});const r="core"},2577:(t,e,n)=>{"use strict";n.d(e,{CO:()=>r,kC:()=>i,qY:()=>s});const r=["create","read","update","delete"];function s(t){const e={};if(!t)return e;const n={create:"POST",read:"GET",update:"PUT",delete:"DELETE"};for(const[r,s]of Object.entries(n))e[r]=t.includes(s);return e}function i(t,e,n){return("object"==typeof e?[t,e.kind,e.name,e.id]:[t,e,n]).filter(Boolean).join("/")}},2859:(t,e,n)=>{"use strict";n.d(e,{n:()=>r});var r=(t=>(t.Idle="IDLE",t.Resolving="RESOLVING",t.Error="ERROR",t.Success="SUCCESS",t))(r||{})},3213:(t,e,n)=>{"use strict";n.r(e),n.d(e,{__experimentalBatch:()=>j,__experimentalReceiveCurrentGlobalStylesId:()=>A,__experimentalReceiveThemeBaseGlobalStyles:()=>C,__experimentalReceiveThemeGlobalStyleVariations:()=>I,__experimentalSaveSpecifiedEntityEdits:()=>B,__unstableCreateUndoLevel:()=>D,addEntities:()=>R,deleteEntityRecord:()=>U,editEntityRecord:()=>M,receiveAutosaves:()=>G,receiveCurrentTheme:()=>S,receiveCurrentUser:()=>v,receiveDefaultTemplateId:()=>z,receiveEmbedPreview:()=>x,receiveEntityRecords:()=>k,receiveNavigationFallbackId:()=>Y,receiveRevisions:()=>W,receiveThemeGlobalStyleRevisions:()=>O,receiveThemeSupports:()=>T,receiveUploadPermissions:()=>$,receiveUserPermission:()=>F,receiveUserPermissions:()=>q,receiveUserQuery:()=>w,redo:()=>L,saveEditedEntityRecord:()=>V,saveEntityRecord:()=>N,undo:()=>P});var r=n(7734),s=n.n(r),i=n(1569),o=n(1455),c=n.n(o),a=n(3832),l=n(4040),u=n.n(l),d=n(5003);function h(t,e,n){if(!t||"object"!=typeof t||"string"!=typeof e&&!Array.isArray(e))return t;const r=Array.isArray(e)?e:e.split(".");let s=t;return r.forEach((t=>{s=s?.[t]})),void 0!==s?s:n}function g(t,e,n){return{type:"RECEIVE_ITEMS",items:Array.isArray(t)?t:[t],persistedEdits:e,meta:n}}var f=n(4767);let p=null;async function y(t){if(null===p){const t=await c()({path:"/batch/v1",method:"OPTIONS"});p=t.endpoints[0].args.requests.maxItems}const e=[];for(const n of function(t,e){const n=[...t],r=[];for(;n.length;)r.push(n.splice(0,e));return r}(t,p)){const t=await c()({path:"/batch/v1",method:"POST",data:{validation:"require-all-validate",requests:n.map((t=>({path:t.path,body:t.data,method:t.method,headers:t.headers})))}});let r;r=t.failed?t.responses.map((t=>({error:t?.body}))):t.responses.map((t=>{const e={};return t.status>=200&&t.status<300?e.output=t.body:e.error=t.body,e})),e.push(...r)}return e}function E(t=y){let e=0,n=[];const r=new m;return{add(t){const s=++e;r.add(s);const i=t=>new Promise(((e,i)=>{n.push({input:t,resolve:e,reject:i}),r.delete(s)}));return"function"==typeof t?Promise.resolve(t(i)).finally((()=>{r.delete(s)})):i(t)},async run(){let e;r.size&&await new Promise((t=>{const e=r.subscribe((()=>{r.size||(e(),t(void 0))}))}));try{if(e=await t(n.map((({input:t})=>t))),e.length!==n.length)throw new Error("run: Array returned by processor must be same size as input array.")}catch(t){for(const{reject:e}of n)e(t);throw t}let s=!0;return e.forEach(((t,e)=>{const r=n[e];t?.error?(r?.reject(t.error),s=!1):r?.resolve(t?.output??t)})),n=[],s}}}class m{constructor(...t){this.set=new Set(...t),this.subscribers=new Set}get size(){return this.set.size}add(t){return this.set.add(t),this.subscribers.forEach((t=>t())),this}delete(t){const e=this.set.delete(t);return this.subscribers.forEach((t=>t())),e}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}}var _=n(2278),b=n(9410);function w(t,e){return{type:"RECEIVE_USER_QUERY",users:Array.isArray(e)?e:[e],queryID:t}}function v(t){return{type:"RECEIVE_CURRENT_USER",currentUser:t}}function R(t){return{type:"ADD_ENTITIES",entities:t}}function k(t,e,n,r,s=!1,i,o){let c;return"postType"===t&&(n=(Array.isArray(n)?n:[n]).map((t=>"auto-draft"===t.status?{...t,title:""}:t))),c=r?function(t,e={},n,r){return{...g(t,n,r),query:e}}(n,r,i,o):g(n,i,o),{...c,kind:t,name:e,invalidateCache:s}}function S(t){return{type:"RECEIVE_CURRENT_THEME",currentTheme:t}}function A(t){return{type:"RECEIVE_CURRENT_GLOBAL_STYLES_ID",id:t}}function C(t,e){return{type:"RECEIVE_THEME_GLOBAL_STYLES",stylesheet:t,globalStyles:e}}function I(t,e){return{type:"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS",stylesheet:t,variations:e}}function T(){return u()("wp.data.dispatch( 'core' ).receiveThemeSupports",{since:"5.9"}),{type:"DO_NOTHING"}}function O(t,e){return u()("wp.data.dispatch( 'core' ).receiveThemeGlobalStyleRevisions()",{since:"6.5.0",alternative:"wp.data.dispatch( 'core' ).receiveRevisions"}),{type:"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS",currentId:t,revisions:e}}function x(t,e){return{type:"RECEIVE_EMBED_PREVIEW",url:t,preview:e}}const U=(t,e,n,r,{__unstableFetch:s=c(),throwOnError:i=!1}={})=>async({dispatch:o,resolveSelect:c})=>{(0,b.A)(t,e,"deleteEntityRecord");const l=(await c.getEntitiesConfig(t)).find((n=>n.kind===t&&n.name===e));let u,d=!1;if(!l)return;const h=await o.__unstableAcquireStoreLock(_.E,["entities","records",t,e,n],{exclusive:!0});try{o({type:"DELETE_ENTITY_RECORD_START",kind:t,name:e,recordId:n});let c=!1,{baseURL:h}=l;"postType"===t&&"wp_template"===e&&n&&"string"==typeof n&&!/^\d+$/.test(n)&&(h=h.slice(0,h.lastIndexOf("/"))+"/templates");try{let i=`${h}/${n}`;r&&(i=(0,a.addQueryArgs)(i,r)),d=await s({path:i,method:"DELETE"}),await o(function(t,e,n,r=!1){return{type:"REMOVE_ITEMS",itemIds:Array.isArray(n)?n:[n],kind:t,name:e,invalidateCache:r}}(t,e,n,!0))}catch(t){c=!0,u=t}if(o({type:"DELETE_ENTITY_RECORD_FINISH",kind:t,name:e,recordId:n,error:u}),c&&i)throw u;return d}finally{o.__unstableReleaseStoreLock(h)}},M=(t,e,n,r,i={})=>({select:o,dispatch:c})=>{(0,b.A)(t,e,"editEntityRecord");const a=o.getEntityConfig(t,e);if(!a)throw new Error(`The entity being edited (${t}, ${e}) does not have a loaded config.`);const{mergedEdits:l={}}=a,u=o.getRawEntityRecord(t,e,n),d=o.getEditedEntityRecord(t,e,n),h={kind:t,name:e,recordId:n,edits:Object.keys(r).reduce(((t,e)=>{const n=u[e],i=d[e],o=l[e]?{...i,...r[e]}:r[e];return t[e]=s()(n,o)?void 0:o,t}),{})};window.__experimentalEnableSync&&a.syncConfig,i.undoIgnore||o.getUndoManager().addRecord([{id:{kind:t,name:e,recordId:n},changes:Object.keys(r).reduce(((t,e)=>(t[e]={from:d[e],to:r[e]},t)),{})}],i.isCached),c({type:"EDIT_ENTITY_RECORD",...h})},P=()=>({select:t,dispatch:e})=>{const n=t.getUndoManager().undo();n&&e({type:"UNDO",record:n})},L=()=>({select:t,dispatch:e})=>{const n=t.getUndoManager().redo();n&&e({type:"REDO",record:n})},D=()=>({select:t})=>{t.getUndoManager().addRecord()},N=(t,e,n,{isAutosave:r=!1,__unstableFetch:s=c(),throwOnError:o=!1}={})=>async({select:c,resolveSelect:a,dispatch:l})=>{(0,b.A)(t,e,"saveEntityRecord");const u=(await a.getEntitiesConfig(t)).find((n=>n.kind===t&&n.name===e));if(!u)return;const d=u.key||f.C_,h=n[d],g=await l.__unstableAcquireStoreLock(_.E,["entities","records",t,e,h||(0,i.A)()],{exclusive:!0});try{for(const[r,s]of Object.entries(n))if("function"==typeof s){const i=s(c.getEditedEntityRecord(t,e,h));l.editEntityRecord(t,e,h,{[r]:i},{undoIgnore:!0}),n[r]=i}let i,d;l({type:"SAVE_ENTITY_RECORD_START",kind:t,name:e,recordId:h,isAutosave:r});let g=!1,{baseURL:f}=u;"postType"===t&&"wp_template"===e&&h&&"string"==typeof h&&!/^\d+$/.test(h)&&(f=f.slice(0,f.lastIndexOf("/"))+"/templates");try{const o=`${f}${h?"/"+h:""}`,d=c.getRawEntityRecord(t,e,h);if(r){const r=c.getCurrentUser(),u=r?r.id:void 0,h=await a.getAutosave(d.type,d.id,u);let g={...d,...h,...n};if(g=Object.keys(g).reduce(((t,e)=>(["title","excerpt","content","meta"].includes(e)&&(t[e]=g[e]),t)),{status:"auto-draft"===g.status?"draft":void 0}),i=await s({path:`${o}/autosaves`,method:"POST",data:g}),d.id===i.id){let n={...d,...g,...i};n=Object.keys(n).reduce(((t,e)=>(["title","excerpt","content"].includes(e)?t[e]=n[e]:t[e]="status"===e?"auto-draft"===d.status&&"draft"===n.status?n.status:d.status:d[e],t)),{}),l.receiveEntityRecords(t,e,n,void 0,!0)}else l.receiveAutosaves(d.id,i)}else{let r=n;u.__unstablePrePersist&&(r={...r,...u.__unstablePrePersist(d,r)}),i=await s({path:o,method:h?"PUT":"POST",data:r}),l.receiveEntityRecords(t,e,i,void 0,!0,r)}}catch(t){g=!0,d=t}if(l({type:"SAVE_ENTITY_RECORD_FINISH",kind:t,name:e,recordId:h,error:d,isAutosave:r}),g&&o)throw d;return i}finally{l.__unstableReleaseStoreLock(g)}},j=t=>async({dispatch:e})=>{const n=E(),r={saveEntityRecord:(t,r,s,i)=>n.add((n=>e.saveEntityRecord(t,r,s,{...i,__unstableFetch:n}))),saveEditedEntityRecord:(t,r,s,i)=>n.add((n=>e.saveEditedEntityRecord(t,r,s,{...i,__unstableFetch:n}))),deleteEntityRecord:(t,r,s,i,o)=>n.add((n=>e.deleteEntityRecord(t,r,s,i,{...o,__unstableFetch:n})))},s=t.map((t=>t(r))),[,...i]=await Promise.all([n.run(),...s]);return i},V=(t,e,n,r)=>async({select:s,dispatch:i,resolveSelect:o})=>{if((0,b.A)(t,e,"saveEditedEntityRecord"),!s.hasEditsForEntityRecord(t,e,n))return;const c=(await o.getEntitiesConfig(t)).find((n=>n.kind===t&&n.name===e));if(!c)return;const a=c.key||f.C_,l=s.getEntityRecordNonTransientEdits(t,e,n),u={[a]:n,...l};return await i.saveEntityRecord(t,e,u,r)},B=(t,e,n,r,s)=>async({select:i,dispatch:o,resolveSelect:c})=>{if((0,b.A)(t,e,"__experimentalSaveSpecifiedEntityEdits"),!i.hasEditsForEntityRecord(t,e,n))return;const a=i.getEntityRecordNonTransientEdits(t,e,n),l={};for(const t of r)(0,d.A)(l,t,h(a,t));const u=(await c.getEntitiesConfig(t)).find((n=>n.kind===t&&n.name===e)),g=u?.key||f.C_;return n&&(l[g]=n),await o.saveEntityRecord(t,e,l,s)};function $(t){return u()("wp.data.dispatch( 'core' ).receiveUploadPermissions",{since:"5.9",alternative:"receiveUserPermission"}),F("create/media",t)}function F(t,e){return{type:"RECEIVE_USER_PERMISSION",key:t,isAllowed:e}}function q(t){return{type:"RECEIVE_USER_PERMISSIONS",permissions:t}}function G(t,e){return{type:"RECEIVE_AUTOSAVES",postId:t,autosaves:Array.isArray(e)?e:[e]}}function Y(t){return{type:"RECEIVE_NAVIGATION_FALLBACK_ID",fallbackId:t}}function z(t,e){return{type:"RECEIVE_DEFAULT_TEMPLATE",query:t,templateId:e}}const W=(t,e,n,r,s,i=!1,o)=>async({dispatch:c,resolveSelect:a})=>{(0,b.A)(t,e,"receiveRevisions");const l=(await a.getEntitiesConfig(t)).find((n=>n.kind===t&&n.name===e));c({type:"RECEIVE_ITEM_REVISIONS",key:l&&l?.revisionKey?l.revisionKey:f.C_,items:Array.isArray(r)?r:[r],recordKey:n,meta:o,query:s,kind:t,name:e,invalidateCache:i})}},3249:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function r(t,e){var n=t._map,r=t._arrayTreeMap,s=t._objectTreeMap;if(n.has(e))return n.get(e);for(var i=Object.keys(e).sort(),o=Array.isArray(e)?r:s,c=0;c<i.length;c++){var a=i[c];if(void 0===(o=o.get(a)))return;var l=e[a];if(void 0===(o=o.get(l)))return}var u=o.get("_ekm_value");return u?(n.delete(u[0]),u[0]=e,o.set("_ekm_value",u),n.set(e,u),u):void 0}var s=function(){function t(e){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.clear(),e instanceof t){var n=[];e.forEach((function(t,e){n.push([e,t])})),e=n}if(null!=e)for(var r=0;r<e.length;r++)this.set(e[r][0],e[r][1])}var s,i,o;return s=t,i=[{key:"set",value:function(n,r){if(null===n||"object"!==e(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,c=0;c<s.length;c++){var a=s[c];o.has(a)||o.set(a,new t),o=o.get(a);var l=n[a];o.has(l)||o.set(l,new t),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(t){if(null===t||"object"!==e(t))return this._map.get(t);var n=r(this,t);return n?n[1]:void 0}},{key:"has",value:function(t){return null===t||"object"!==e(t)?this._map.has(t):void 0!==r(this,t)}},{key:"delete",value:function(t){return!!this.has(t)&&(this.set(t,void 0),!0)}},{key:"forEach",value:function(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this;this._map.forEach((function(s,i){null!==i&&"object"===e(i)&&(s=s[1]),t.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),t}();t.exports=s},3377:()=>{},3832:t=>{"use strict";t.exports=window.wp.url},4027:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(3832),s=n(533);var i=function(t){const e=new WeakMap;return n=>{let r;return e.has(n)?r=e.get(n):(r=t(n),null!==n&&"object"==typeof n&&e.set(n,r)),r}}((function(t){const e={stableKey:"",page:1,perPage:10,fields:null,include:null,context:"default"},n=Object.keys(t).sort();for(let i=0;i<n.length;i++){const o=n[i];let c=t[o];switch(o){case"page":e[o]=Number(c);break;case"per_page":e.perPage=Number(c);break;case"context":e.context=c;break;default:"_fields"===o&&(e.fields=(0,s.A)(c)??[],c=e.fields.join()),"include"===o&&("number"==typeof c&&(c=c.toString()),e.include=((0,s.A)(c)??[]).map(Number),c=e.include.join()),e.stableKey+=(e.stableKey?"&":"")+(0,r.addQueryArgs)("",{[o]:c}).slice(1)}}return e}))},4040:t=>{"use strict";t.exports=window.wp.deprecated},4460:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});const r=window.ReactJSXRuntime;var s=n(6087),i=n(8843);function o({kind:t,type:e,id:n,children:o}){const c=(0,s.useContext)(i.D),a=(0,s.useMemo)((()=>({...c,[t]:{...c?.[t],[e]:n}})),[c,t,e,n]);return(0,r.jsx)(i.D.Provider,{value:a,children:o})}},4565:(t,e,n)=>{"use strict";n.r(e),n.d(e,{EntityProvider:()=>y.A,__experimentalFetchLinkSuggestions:()=>_.Y3,__experimentalFetchUrlData:()=>_.gr,__experimentalUseEntityRecord:()=>b.qh,__experimentalUseEntityRecords:()=>b.bM,__experimentalUseResourcePermissions:()=>b._,fetchBlockPatterns:()=>_.l$,privateApis:()=>w.j,store:()=>A,useEntityBlockEditor:()=>b.hg,useEntityId:()=>b.mV,useEntityProp:()=>b.S$,useEntityRecord:()=>b.MA,useEntityRecords:()=>b.$u,useResourcePermissions:()=>b.qs});var r=n(7143),s=n(5469),i=n(8368),o=n(8741),c=n(3213),a=n(9424),l=n(6384),u=n(2239),d=n(4767),h=n(2278),g=n(6378),f=n(8582),p=n(9410),y=n(4460),E=n(3377),m={};for(const t in E)["default","EntityProvider","store"].indexOf(t)<0&&(m[t]=()=>E[t]);n.d(e,m);var _=n(7006),b=n(644),w=n(7826);const v=[...d.Mr,...d.L2.filter((t=>!!t.name))],R=v.reduce(((t,e)=>{const{kind:n,name:r,plural:s}=e,o=(0,d.zD)(n,r);if(t[o]=(t,e,s)=>((0,p.A)(n,r,o,{isShorthandSelector:!0,alternativeFunctionName:"getEntityRecord"}),i.getEntityRecord(t,n,r,e,s)),s){const e=(0,d.zD)(n,s,"get");t[e]=(t,s)=>((0,p.A)(n,r,e,{isShorthandSelector:!0,alternativeFunctionName:"getEntityRecords"}),i.getEntityRecords(t,n,r,s))}return t}),{}),k=v.reduce(((t,e)=>{const{kind:n,name:r,plural:s}=e,i=(0,d.zD)(n,r);if(t[i]=(t,e)=>((0,p.A)(n,r,i,{isShorthandSelector:!0,alternativeFunctionName:"getEntityRecord"}),l.getEntityRecord(n,r,t,e)),s){const e=(0,d.zD)(n,s,"get");t[e]=(...t)=>((0,p.A)(n,s,e,{isShorthandSelector:!0,alternativeFunctionName:"getEntityRecords"}),l.getEntityRecords(n,r,...t)),t[e].shouldInvalidate=t=>l.getEntityRecords.shouldInvalidate(t,n,r)}return t}),{}),S=v.reduce(((t,e)=>{const{kind:n,name:r}=e,s=(0,d.zD)(n,r,"save");t[s]=(t,e)=>((0,p.A)(n,r,s,{isShorthandSelector:!0,alternativeFunctionName:"saveEntityRecord"}),c.saveEntityRecord(n,r,t,e));const i=(0,d.zD)(n,r,"delete");return t[i]=(t,e,s)=>((0,p.A)(n,r,i,{isShorthandSelector:!0,alternativeFunctionName:"deleteEntityRecord"}),c.deleteEntityRecord(n,r,t,e,s)),t}),{}),A=(0,r.createReduxStore)(h.E,{reducer:s.Ay,actions:{...f.B,...c,...S,...(0,u.A)()},selectors:{...f.A,...i,...R},resolvers:{...l,...k}});(0,g.T)(A).registerPrivateSelectors(o),(0,g.T)(A).registerPrivateActions(a),(0,r.register)(A)},4767:(t,e,n)=>{"use strict";n.d(e,{C_:()=>xr,L2:()=>Dr,TK:()=>Lr,zD:()=>jr,Mr:()=>Pr});var r=n(1635),s=n(2226);function i(t){return function(t){return t.charAt(0).toUpperCase()+t.substr(1)}(t.toLowerCase())}var o=n(287),c=n(1455),a=n.n(c),l=n(4997),u=n(7723),d=n(7734),h=n.n(d);const g=()=>new Map,f=t=>{const e=g();return t.forEach(((t,n)=>{e.set(n,t)})),e},p=(t,e,n)=>{let r=t.get(e);return void 0===r&&t.set(e,r=n()),r},y=()=>new Set,E=t=>t[t.length-1],m=Array.from,_=Array.isArray;class b{constructor(){this._observers=g()}on(t,e){return p(this._observers,t,y).add(e),e}once(t,e){const n=(...r)=>{this.off(t,n),e(...r)};this.on(t,n)}off(t,e){const n=this._observers.get(t);void 0!==n&&(n.delete(e),0===n.size&&this._observers.delete(t))}emit(t,e){return m((this._observers.get(t)||g()).values()).forEach((t=>t(...e)))}destroy(){this._observers=g()}}const w=Math.floor,v=(Math.ceil,Math.abs),R=(Math.imul,Math.round,Math.log10,Math.log2,Math.log,Math.sqrt,(t,e)=>t<e?t:e),k=(t,e)=>t>e?t:e,S=(Number.isNaN,Math.pow,Math.sign,t=>0!==t?t<0:1/t<0),A=128,C=127,I=2147483647,T=(Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.isInteger||(t=>"number"==typeof t&&isFinite(t)&&w(t)===t)),O=(Number.isNaN,Number.parseInt,String.fromCharCode),x=(String.fromCodePoint,O(65535),/^\s*/g),U=/([A-Z])/g,M=(t,e)=>(t=>t.replace(x,""))(t.replace(U,(t=>`${e}${(t=>t.toLowerCase())(t)}`))),P="undefined"!=typeof TextEncoder?new TextEncoder:null,L=P?t=>P.encode(t):t=>{const e=unescape(encodeURIComponent(t)),n=e.length,r=new Uint8Array(n);for(let t=0;t<n;t++)r[t]=e.codePointAt(t);return r};let D="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});D&&1===D.decode(new Uint8Array).length&&(D=null);class N{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const j=()=>new N,V=t=>{const e=new Uint8Array((t=>{let e=t.cpos;for(let n=0;n<t.bufs.length;n++)e+=t.bufs[n].length;return e})(t));let n=0;for(let r=0;r<t.bufs.length;r++){const s=t.bufs[r];e.set(s,n),n+=s.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),n),e},B=(t,e)=>{const n=t.cbuf.length;t.cpos===n&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(2*n),t.cpos=0),t.cbuf[t.cpos++]=e},$=B,F=(t,e)=>{for(;e>C;)B(t,A|C&e),e=w(e/128);B(t,C&e)},q=(t,e)=>{const n=S(e);for(n&&(e=-e),B(t,(e>63?A:0)|(n?64:0)|63&e),e=w(e/64);e>0;)B(t,(e>C?A:0)|C&e),e=w(e/128)},G=new Uint8Array(3e4),Y=G.length/3,z=P&&P.encodeInto?(t,e)=>{if(e.length<Y){const n=P.encodeInto(e,G).written||0;F(t,n);for(let e=0;e<n;e++)B(t,G[e])}else K(t,L(e))}:(t,e)=>{const n=unescape(encodeURIComponent(e)),r=n.length;F(t,r);for(let e=0;e<r;e++)B(t,n.codePointAt(e))},W=(t,e)=>{const n=t.cbuf.length,r=t.cpos,s=R(n-r,e.length),i=e.length-s;t.cbuf.set(e.subarray(0,s),r),t.cpos+=s,i>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(k(2*n,i)),t.cbuf.set(e.subarray(s)),t.cpos=i)},K=(t,e)=>{F(t,e.byteLength),W(t,e)},H=(t,e)=>{((t,e)=>{const n=t.cbuf.length;n-t.cpos<e&&(t.bufs.push(new Uint8Array(t.cbuf.buffer,0,t.cpos)),t.cbuf=new Uint8Array(2*k(n,e)),t.cpos=0)})(t,e);const n=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,n},Q=new DataView(new ArrayBuffer(4)),J=(t,e)=>{switch(typeof e){case"string":B(t,119),z(t,e);break;case"number":T(e)&&v(e)<=I?(B(t,125),q(t,e)):(n=e,Q.setFloat32(0,n),Q.getFloat32(0)===n?(B(t,124),((t,e)=>{H(t,4).setFloat32(0,e,!1)})(t,e)):(B(t,123),((t,e)=>{H(t,8).setFloat64(0,e,!1)})(t,e)));break;case"bigint":B(t,122),((t,e)=>{H(t,8).setBigInt64(0,e,!1)})(t,e);break;case"object":if(null===e)B(t,126);else if(_(e)){B(t,117),F(t,e.length);for(let n=0;n<e.length;n++)J(t,e[n])}else if(e instanceof Uint8Array)B(t,116),K(t,e);else{B(t,118);const n=Object.keys(e);F(t,n.length);for(let r=0;r<n.length;r++){const s=n[r];z(t,s),J(t,e[s])}}break;case"boolean":B(t,e?120:121);break;default:B(t,127)}var n};class X extends N{constructor(t){super(),this.w=t,this.s=null,this.count=0}write(t){this.s===t?this.count++:(this.count>0&&F(this,this.count-1),this.count=1,this.w(this,t),this.s=t)}}const Z=t=>{t.count>0&&(q(t.encoder,1===t.count?t.s:-t.s),t.count>1&&F(t.encoder,t.count-2))};class tt{constructor(){this.encoder=new N,this.s=0,this.count=0}write(t){this.s===t?this.count++:(Z(this),this.count=1,this.s=t)}toUint8Array(){return Z(this),V(this.encoder)}}const et=t=>{if(t.count>0){const e=2*t.diff+(1===t.count?0:1);q(t.encoder,e),t.count>1&&F(t.encoder,t.count-2)}};class nt{constructor(){this.encoder=new N,this.s=0,this.count=0,this.diff=0}write(t){this.diff===t-this.s?(this.s=t,this.count++):(et(this),this.count=1,this.diff=t-this.s,this.s=t)}toUint8Array(){return et(this),V(this.encoder)}}class rt{constructor(){this.sarr=[],this.s="",this.lensE=new tt}write(t){this.s+=t,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(t.length)}toUint8Array(){const t=new N;return this.sarr.push(this.s),this.s="",z(t,this.sarr.join("")),W(t,this.lensE.toUint8Array()),V(t)}}const st=t=>new Error(t),it=()=>{throw st("Method unimplemented")},ot=()=>{throw st("Unexpected case")};st("Unexpected end of array"),st("Integer out of Range");crypto.subtle;const ct=crypto.getRandomValues.bind(crypto),at=(Math.random,()=>ct(new Uint32Array(1))[0]),lt=[1e7]+-1e3+-4e3+-8e3+-1e11,ut=()=>lt.replace(/[018]/g,(t=>(t^at()&15>>t/4).toString(16))),dt=t=>new Promise(t),ht=(Promise.all.bind(Promise),(t,e,n=0)=>{try{for(;n<t.length;n++)t[n](...e)}finally{n<t.length&&ht(t,e,n+1)}}),gt=t=>void 0===t?null:t;let ft=new class{constructor(){this.map=new Map}setItem(t,e){this.map.set(t,e)}getItem(t){return this.map.get(t)}},pt=!0;try{"undefined"!=typeof localStorage&&localStorage&&(ft=localStorage,pt=!1)}catch(t){}const yt=ft,Et="undefined"!=typeof process&&process.release&&/node|io\.js/.test(process.release.name)&&"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);"undefined"!=typeof navigator&&/Mac/.test(navigator.platform);let mt;const _t=[],bt=()=>{if(void 0===mt)if(Et){mt=g();const t=process.argv;let e=null;for(let n=0;n<t.length;n++){const r=t[n];"-"===r[0]?(null!==e&&mt.set(e,""),e=r):null!==e?(mt.set(e,r),e=null):_t.push(r)}null!==e&&mt.set(e,"")}else"object"==typeof location?(mt=g(),(location.search||"?").slice(1).split("&").forEach((t=>{if(0!==t.length){const[e,n]=t.split("=");mt.set(`--${M(e,"-")}`,n),mt.set(`-${M(e,"-")}`,n)}}))):mt=g();return mt},wt=t=>bt().has(t),vt=t=>gt(Et?process.env[t.toUpperCase().replaceAll("-","_")]:yt.getItem(t)),Rt=t=>wt("--"+t)||null!==vt(t);Rt("production");var kt;const St=Et&&(kt=process.env.FORCE_COLOR,["true","1","2"].includes(kt))||!wt("--no-colors")&&!Rt("no-color")&&(!Et||process.stdout.isTTY)&&(!Et||wt("--color")||null!==vt("COLORTERM")||(vt("TERM")||"").includes("color"));class At{constructor(t,e){this.left=t,this.right=e}}const Ct=(t,e)=>new At(t,e),It="undefined"!=typeof document?document:{},Tt=("undefined"!=typeof DOMParser&&new DOMParser,It.ELEMENT_NODE,It.TEXT_NODE,It.CDATA_SECTION_NODE,It.COMMENT_NODE,It.DOCUMENT_NODE,It.DOCUMENT_TYPE_NODE,It.DOCUMENT_FRAGMENT_NODE,Symbol),Ot=Date.now,xt=Tt(),Ut=Tt(),Mt=Tt(),Pt=Tt(),Lt=Tt(),Dt=Tt(),Nt=Tt(),jt=Tt(),Vt=Tt();Ot();const Bt={[xt]:Ct("font-weight","bold"),[Ut]:Ct("font-weight","normal"),[Mt]:Ct("color","blue"),[Lt]:Ct("color","green"),[Pt]:Ct("color","grey"),[Dt]:Ct("color","red"),[Nt]:Ct("color","purple"),[jt]:Ct("color","orange"),[Vt]:Ct("color","black")},$t=St?t=>{1===t.length&&t[0]?.constructor===Function&&(t=t[0]());const e=[],n=[],r=g();let s=[],i=0;for(;i<t.length;i++){const s=t[i],o=Bt[s];if(void 0!==o)r.set(o.left,o.right);else{if(void 0===s)break;if(s.constructor!==String&&s.constructor!==Number)break;{const t=((t,e)=>{const n=[];for(const[r,s]of t)n.push(e(s,r));return n})(r,((t,e)=>`${e}:${t};`)).join("");i>0||t.length>0?(e.push("%c"+s),n.push(t)):e.push(s)}}}for(i>0&&(s=n,s.unshift(e.join("")));i<t.length;i++){const e=t[i];e instanceof Symbol||s.push(e)}return s}:t=>{1===t.length&&t[0]?.constructor===Function&&(t=t[0]());const e=[],n=[];let r=0;for(;r<t.length;r++){const n=t[r];if(void 0===n)break;if(n.constructor===String||n.constructor===Number)e.push(n);else if(n.constructor===Object)break}for(r>0&&n.push(e.join(""));r<t.length;r++){const e=t[r];e instanceof Symbol||n.push(e)}return n},Ft=(...t)=>{console.log(...$t(t)),Gt.forEach((e=>e.print(t)))},qt=(...t)=>{console.warn(...$t(t)),t.unshift(jt),Gt.forEach((e=>e.print(t)))},Gt=y();const Yt=t=>({[Symbol.iterator](){return this},next:t}),zt=(t,e)=>Yt((()=>{const{done:n,value:r}=t.next();return{done:n,value:n?void 0:e(r)}})),Wt=Object.assign,Kt=Object.keys,Ht=(Object.values,t=>Kt(t).length),Qt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Jt=Object.freeze,Xt=t=>{for(const e in t){const n=t[e];"object"!=typeof n&&"function"!=typeof n||Xt(t[e])}return Jt(t)};class Zt{constructor(t,e){this.clock=t,this.len=e}}class te{constructor(){this.clients=new Map}}const ee=(t,e,n)=>e.clients.forEach(((e,r)=>{const s=t.doc.store.clients.get(r);if(null!=s){const r=s[s.length-1],i=r.id.clock+r.length;for(let r=0,o=e[r];r<e.length&&o.clock<i;o=e[++r])De(t,s,o.clock,o.len,n)}})),ne=(t,e)=>{const n=t.clients.get(e.client);return void 0!==n&&null!==((t,e)=>{let n=0,r=t.length-1;for(;n<=r;){const s=w((n+r)/2),i=t[s],o=i.clock;if(o<=e){if(e<o+i.len)return s;n=s+1}else r=s-1}return null})(n,e.clock)},re=t=>{t.clients.forEach((t=>{let e,n;for(t.sort(((t,e)=>t.clock-e.clock)),e=1,n=1;e<t.length;e++){const r=t[n-1],s=t[e];r.clock+r.len>=s.clock?r.len=k(r.len,s.clock+s.len-r.clock):(n<e&&(t[n]=s),n++)}t.length=n}))},se=(t,e,n,r)=>{p(t.clients,e,(()=>[])).push(new Zt(n,r))},ie=()=>new te,oe=(t,e)=>{F(t.restEncoder,e.clients.size),m(e.clients.entries()).sort(((t,e)=>e[0]-t[0])).forEach((([e,n])=>{t.resetDsCurVal(),F(t.restEncoder,e);const r=n.length;F(t.restEncoder,r);for(let e=0;e<r;e++){const r=n[e];t.writeDsClock(r.clock),t.writeDsLen(r.len)}}))},ce=at;class ae extends b{constructor({guid:t=ut(),collectionid:e=null,gc:n=!0,gcFilter:r=()=>!0,meta:s=null,autoLoad:i=!1,shouldLoad:o=!0}={}){super(),this.gc=n,this.gcFilter=r,this.clientID=ce(),this.guid=t,this.collectionid=e,this.share=new Map,this.store=new Ce,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=o,this.autoLoad=i,this.meta=s,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=dt((t=>{this.on("load",(()=>{this.isLoaded=!0,t(this)}))}));const c=()=>dt((t=>{const e=n=>{void 0!==n&&!0!==n||(this.off("sync",e),t())};this.on("sync",e)}));this.on("sync",(t=>{!1===t&&this.isSynced&&(this.whenSynced=c()),this.isSynced=void 0===t||!0===t,this.isSynced&&!this.isLoaded&&this.emit("load",[this])})),this.whenSynced=c()}load(){const t=this._item;null===t||this.shouldLoad||Ge(t.parent.doc,(t=>{t.subdocsLoaded.add(this)}),null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(m(this.subdocs).map((t=>t.guid)))}transact(t,e=null){return Ge(this,t,e)}get(t,e=en){const n=p(this.share,t,(()=>{const t=new e;return t._integrate(this,null),t})),r=n.constructor;if(e!==en&&r!==e){if(r===en){const r=new e;r._map=n._map,n._map.forEach((t=>{for(;null!==t;t=t.left)t.parent=r})),r._start=n._start;for(let t=r._start;null!==t;t=t.right)t.parent=r;return r._length=n._length,this.share.set(t,r),r._integrate(this,null),r}throw new Error(`Type with the name ${t} has already been defined with a different constructor`)}return n}getArray(t=""){return this.get(t,bn)}getText(t=""){return this.get(t,jn)}getMap(t=""){return this.get(t,vn)}getXmlElement(t=""){return this.get(t,$n)}getXmlFragment(t=""){return this.get(t,Bn)}toJSON(){const t={};return this.share.forEach(((e,n)=>{t[n]=e.toJSON()})),t}destroy(){this.isDestroyed=!0,m(this.subdocs).forEach((t=>t.destroy()));const t=this._item;if(null!==t){this._item=null;const e=t.content;e.doc=new ae({guid:this.guid,...e.opts,shouldLoad:!1}),e.doc._item=t,Ge(t.parent.doc,(n=>{const r=e.doc;t.deleted||n.subdocsAdded.add(r),n.subdocsRemoved.add(this)}),null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class le{constructor(){this.restEncoder=j()}toUint8Array(){return V(this.restEncoder)}resetDsCurVal(){}writeDsClock(t){F(this.restEncoder,t)}writeDsLen(t){F(this.restEncoder,t)}}class ue extends le{writeLeftID(t){F(this.restEncoder,t.client),F(this.restEncoder,t.clock)}writeRightID(t){F(this.restEncoder,t.client),F(this.restEncoder,t.clock)}writeClient(t){F(this.restEncoder,t)}writeInfo(t){$(this.restEncoder,t)}writeString(t){z(this.restEncoder,t)}writeParentInfo(t){F(this.restEncoder,t?1:0)}writeTypeRef(t){F(this.restEncoder,t)}writeLen(t){F(this.restEncoder,t)}writeAny(t){J(this.restEncoder,t)}writeBuf(t){K(this.restEncoder,t)}writeJSON(t){z(this.restEncoder,JSON.stringify(t))}writeKey(t){z(this.restEncoder,t)}}class de{constructor(){this.restEncoder=j(),this.dsCurrVal=0}toUint8Array(){return V(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(t){const e=t-this.dsCurrVal;this.dsCurrVal=t,F(this.restEncoder,e)}writeDsLen(t){0===t&&ot(),F(this.restEncoder,t-1),this.dsCurrVal+=t}}class he extends de{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new nt,this.clientEncoder=new tt,this.leftClockEncoder=new nt,this.rightClockEncoder=new nt,this.infoEncoder=new X($),this.stringEncoder=new rt,this.parentInfoEncoder=new X($),this.typeRefEncoder=new tt,this.lenEncoder=new tt}toUint8Array(){const t=j();return F(t,0),K(t,this.keyClockEncoder.toUint8Array()),K(t,this.clientEncoder.toUint8Array()),K(t,this.leftClockEncoder.toUint8Array()),K(t,this.rightClockEncoder.toUint8Array()),K(t,V(this.infoEncoder)),K(t,this.stringEncoder.toUint8Array()),K(t,V(this.parentInfoEncoder)),K(t,this.typeRefEncoder.toUint8Array()),K(t,this.lenEncoder.toUint8Array()),W(t,V(this.restEncoder)),V(t)}writeLeftID(t){this.clientEncoder.write(t.client),this.leftClockEncoder.write(t.clock)}writeRightID(t){this.clientEncoder.write(t.client),this.rightClockEncoder.write(t.clock)}writeClient(t){this.clientEncoder.write(t)}writeInfo(t){this.infoEncoder.write(t)}writeString(t){this.stringEncoder.write(t)}writeParentInfo(t){this.parentInfoEncoder.write(t?1:0)}writeTypeRef(t){this.typeRefEncoder.write(t)}writeLen(t){this.lenEncoder.write(t)}writeAny(t){J(this.restEncoder,t)}writeBuf(t){K(this.restEncoder,t)}writeJSON(t){J(this.restEncoder,t)}writeKey(t){const e=this.keyMap.get(t);void 0===e?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(t)):this.keyClockEncoder.write(e)}}const ge=(t,e,n)=>{const r=new Map;n.forEach(((t,n)=>{Te(e,n)>t&&r.set(n,t)})),Ie(e).forEach(((t,e)=>{n.has(e)||r.set(e,0)})),F(t.restEncoder,r.size),m(r.entries()).sort(((t,e)=>e[0]-t[0])).forEach((([n,r])=>{((t,e,n,r)=>{r=k(r,e[0].id.clock);const s=xe(e,r);F(t.restEncoder,e.length-s),t.writeClient(n),F(t.restEncoder,r);const i=e[s];i.write(t,r-i.id.clock);for(let n=s+1;n<e.length;n++)e[n].write(t,0)})(t,e.clients.get(n),n,r)}))};class fe{constructor(){this.l=[]}}const pe=()=>new fe,ye=(t,e)=>t.l.push(e),Ee=(t,e)=>{const n=t.l,r=n.length;t.l=n.filter((t=>e!==t)),r===t.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},me=(t,e,n)=>ht(t.l,[e,n]);class _e{constructor(t,e){this.client=t,this.clock=e}}const be=(t,e)=>t===e||null!==t&&null!==e&&t.client===e.client&&t.clock===e.clock,we=(t,e)=>new _e(t,e),ve=t=>{for(const[e,n]of t.doc.share.entries())if(n===t)return e;throw ot()};class Re{constructor(t,e){this.ds=t,this.sv=e}}const ke=(t,e)=>new Re(t,e),Se=(ke(ie(),new Map),(t,e)=>void 0===e?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!ne(e.ds,t.id)),Ae=(t,e)=>{const n=p(t.meta,Ae,y),r=t.doc.store;n.has(e)||(e.sv.forEach(((e,n)=>{e<Te(r,n)&&Pe(t,we(n,e))})),ee(t,e.ds,(t=>{})),n.add(e))};class Ce{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const Ie=t=>{const e=new Map;return t.clients.forEach(((t,n)=>{const r=t[t.length-1];e.set(n,r.id.clock+r.length)})),e},Te=(t,e)=>{const n=t.clients.get(e);if(void 0===n)return 0;const r=n[n.length-1];return r.id.clock+r.length},Oe=(t,e)=>{let n=t.clients.get(e.id.client);if(void 0===n)n=[],t.clients.set(e.id.client,n);else{const t=n[n.length-1];if(t.id.clock+t.length!==e.id.clock)throw ot()}n.push(e)},xe=(t,e)=>{let n=0,r=t.length-1,s=t[r],i=s.id.clock;if(i===e)return r;let o=w(e/(i+s.length-1)*r);for(;n<=r;){if(s=t[o],i=s.id.clock,i<=e){if(e<i+s.length)return o;n=o+1}else r=o-1;o=w((n+r)/2)}throw ot()},Ue=(t,e)=>{const n=t.clients.get(e.client);return n[xe(n,e.clock)]},Me=(t,e,n)=>{const r=xe(e,n),s=e[r];return s.id.clock<n&&s instanceof cr?(e.splice(r+1,0,or(t,s,n-s.id.clock)),r+1):r},Pe=(t,e)=>{const n=t.doc.store.clients.get(e.client);return n[Me(t,n,e.clock)]},Le=(t,e,n)=>{const r=e.clients.get(n.client),s=xe(r,n.clock),i=r[s];return n.clock!==i.id.clock+i.length-1&&i.constructor!==Gn&&r.splice(s+1,0,or(t,i,n.clock-i.id.clock+1)),i},De=(t,e,n,r,s)=>{if(0===r)return;const i=n+r;let o,c=Me(t,e,n);do{o=e[c++],i<o.id.clock+o.length&&Me(t,e,i),s(o)}while(c<e.length&&e[c].id.clock<i)};class Ne{constructor(t,e,n){this.doc=t,this.deleteSet=new te,this.beforeState=Ie(t.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=e,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const je=(t,e)=>!(0===e.deleteSet.clients.size&&!((t,e)=>{for(const[n,r]of t)if(e(r,n))return!0;return!1})(e.afterState,((t,n)=>e.beforeState.get(n)!==t)))&&(re(e.deleteSet),((t,e)=>{ge(t,e.doc.store,e.beforeState)})(t,e),oe(t,e.deleteSet),!0),Ve=(t,e,n)=>{const r=e._item;(null===r||r.id.clock<(t.beforeState.get(r.id.client)||0)&&!r.deleted)&&p(t.changed,e,y).add(n)},Be=(t,e)=>{let n=t[e],r=t[e-1],s=e;for(;s>0&&(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n));n=r,r=t[--s-1])n instanceof cr&&null!==n.parentSub&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);const i=e-s;return i&&t.splice(e+1-i,i),i},$e=(t,e,n)=>{for(const[r,s]of t.clients.entries()){const t=e.clients.get(r);for(let r=s.length-1;r>=0;r--){const i=s[r],o=i.clock+i.len;for(let r=xe(t,i.clock),s=t[r];r<t.length&&s.id.clock<o;s=t[++r]){const s=t[r];if(i.clock+i.len<=s.id.clock)break;s instanceof cr&&s.deleted&&!s.keep&&n(s)&&s.gc(e,!1)}}}},Fe=(t,e)=>{t.clients.forEach(((t,n)=>{const r=e.clients.get(n);for(let e=t.length-1;e>=0;e--){const n=t[e];for(let t=R(r.length-1,1+xe(r,n.clock+n.len-1)),e=r[t];t>0&&e.id.clock>=n.clock;e=r[t])t-=1+Be(r,t)}}))},qe=(t,e)=>{if(e<t.length){const n=t[e],r=n.doc,s=r.store,i=n.deleteSet,o=n._mergeStructs;try{re(i),n.afterState=Ie(n.doc.store),r.emit("beforeObserverCalls",[n,r]);const t=[];n.changed.forEach(((e,r)=>t.push((()=>{null!==r._item&&r._item.deleted||r._callObserver(n,e)})))),t.push((()=>{n.changedParentTypes.forEach(((t,e)=>{e._dEH.l.length>0&&(null===e._item||!e._item.deleted)&&((t=t.filter((t=>null===t.target._item||!t.target._item.deleted))).forEach((t=>{t.currentTarget=e,t._path=null})),t.sort(((t,e)=>t.path.length-e.path.length)),me(e._dEH,t,n))}))})),t.push((()=>r.emit("afterTransaction",[n,r]))),ht(t,[]),n._needFormattingCleanup&&Ln(n)}finally{r.gc&&$e(i,s,r.gcFilter),Fe(i,s),n.afterState.forEach(((t,e)=>{const r=n.beforeState.get(e)||0;if(r!==t){const t=s.clients.get(e),n=k(xe(t,r),1);for(let e=t.length-1;e>=n;)e-=1+Be(t,e)}}));for(let t=o.length-1;t>=0;t--){const{client:e,clock:n}=o[t].id,r=s.clients.get(e),i=xe(r,n);i+1<r.length&&Be(r,i+1)>1||i>0&&Be(r,i)}if(n.local||n.afterState.get(r.clientID)===n.beforeState.get(r.clientID)||(Ft(jt,xt,"[yjs] ",Ut,Dt,"Changed the client-id because another client seems to be using it."),r.clientID=ce()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const t=new ue;je(t,n)&&r.emit("update",[t.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const t=new he;je(t,n)&&r.emit("updateV2",[t.toUint8Array(),n.origin,r,n])}const{subdocsAdded:c,subdocsLoaded:a,subdocsRemoved:l}=n;(c.size>0||l.size>0||a.size>0)&&(c.forEach((t=>{t.clientID=r.clientID,null==t.collectionid&&(t.collectionid=r.collectionid),r.subdocs.add(t)})),l.forEach((t=>r.subdocs.delete(t))),r.emit("subdocs",[{loaded:a,added:c,removed:l},r,n]),l.forEach((t=>t.destroy()))),t.length<=e+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,t])):qe(t,e+1)}}},Ge=(t,e,n=null,r=!0)=>{const s=t._transactionCleanups;let i=!1,o=null;null===t._transaction&&(i=!0,t._transaction=new Ne(t,n,r),s.push(t._transaction),1===s.length&&t.emit("beforeAllTransactions",[t]),t.emit("beforeTransaction",[t._transaction,t]));try{o=e(t._transaction)}finally{if(i){const e=t._transaction===s[0];t._transaction=null,e&&qe(s,0)}}return o};const Ye="You must not compute changes after the event-handler fired.";class ze{constructor(t,e){this.target=t,this.currentTarget=t,this.transaction=e,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=We(this.currentTarget,this.target))}deletes(t){return ne(this.transaction.deleteSet,t.id)}get keys(){if(null===this._keys){if(0===this.transaction.doc._transactionCleanups.length)throw st(Ye);const t=new Map,e=this.target;this.transaction.changed.get(e).forEach((n=>{if(null!==n){const r=e._map.get(n);let s,i;if(this.adds(r)){let t=r.left;for(;null!==t&&this.adds(t);)t=t.left;if(this.deletes(r)){if(null===t||!this.deletes(t))return;s="delete",i=E(t.content.getContent())}else null!==t&&this.deletes(t)?(s="update",i=E(t.content.getContent())):(s="add",i=void 0)}else{if(!this.deletes(r))return;s="delete",i=E(r.content.getContent())}t.set(n,{action:s,oldValue:i})}})),this._keys=t}return this._keys}get delta(){return this.changes.delta}adds(t){return t.id.clock>=(this.transaction.beforeState.get(t.id.client)||0)}get changes(){let t=this._changes;if(null===t){if(0===this.transaction.doc._transactionCleanups.length)throw st(Ye);const e=this.target,n=y(),r=y(),s=[];t={added:n,deleted:r,delta:s,keys:this.keys};if(this.transaction.changed.get(e).has(null)){let t=null;const i=()=>{t&&s.push(t)};for(let s=e._start;null!==s;s=s.right)s.deleted?this.deletes(s)&&!this.adds(s)&&(null!==t&&void 0!==t.delete||(i(),t={delete:0}),t.delete+=s.length,r.add(s)):this.adds(s)?(null!==t&&void 0!==t.insert||(i(),t={insert:[]}),t.insert=t.insert.concat(s.content.getContent()),n.add(s)):(null!==t&&void 0!==t.retain||(i(),t={retain:0}),t.retain+=s.length);null!==t&&void 0===t.retain&&i()}this._changes=t}return t}}const We=(t,e)=>{const n=[];for(;null!==e._item&&e!==t;){if(null!==e._item.parentSub)n.unshift(e._item.parentSub);else{let t=0,r=e._item.parent._start;for(;r!==e._item&&null!==r;)!r.deleted&&r.countable&&(t+=r.length),r=r.right;n.unshift(t)}e=e._item.parent}return n},Ke=()=>{qt("Invalid access: Add Yjs type to a document before reading data.")};let He=0;class Qe{constructor(t,e){t.marker=!0,this.p=t,this.index=e,this.timestamp=He++}}const Je=(t,e,n)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=n,t.timestamp=He++},Xe=(t,e)=>{if(null===t._start||0===e||null===t._searchMarker)return null;const n=0===t._searchMarker.length?null:t._searchMarker.reduce(((t,n)=>v(e-t.index)<v(e-n.index)?t:n));let r=t._start,s=0;for(null!==n&&(r=n.p,s=n.index,(t=>{t.timestamp=He++})(n));null!==r.right&&s<e;){if(!r.deleted&&r.countable){if(e<s+r.length)break;s+=r.length}r=r.right}for(;null!==r.left&&s>e;)r=r.left,!r.deleted&&r.countable&&(s-=r.length);for(;null!==r.left&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(s-=r.length);return null!==n&&v(n.index-s)<r.parent.length/80?(Je(n,r,s),n):((t,e,n)=>{if(t.length>=80){const r=t.reduce(((t,e)=>t.timestamp<e.timestamp?t:e));return Je(r,e,n),r}{const r=new Qe(e,n);return t.push(r),r}})(t._searchMarker,r,s)},Ze=(t,e,n)=>{for(let r=t.length-1;r>=0;r--){const s=t[r];if(n>0){let e=s.p;for(e.marker=!1;e&&(e.deleted||!e.countable);)e=e.left,e&&!e.deleted&&e.countable&&(s.index-=e.length);if(null===e||!0===e.marker){t.splice(r,1);continue}s.p=e,e.marker=!0}(e<s.index||n>0&&e===s.index)&&(s.index=k(e,s.index+n))}},tn=(t,e,n)=>{const r=t,s=e.changedParentTypes;for(;p(s,t,(()=>[])).push(n),null!==t._item;)t=t._item.parent;me(r._eH,n,e)};class en{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=pe(),this._dEH=pe(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(t,e){this.doc=t,this._item=e}_copy(){throw it()}clone(){throw it()}_write(t){}get _first(){let t=this._start;for(;null!==t&&t.deleted;)t=t.right;return t}_callObserver(t,e){!t.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(t){ye(this._eH,t)}observeDeep(t){ye(this._dEH,t)}unobserve(t){Ee(this._eH,t)}unobserveDeep(t){Ee(this._dEH,t)}toJSON(){}}const nn=(t,e,n)=>{t.doc??Ke(),e<0&&(e=t._length+e),n<0&&(n=t._length+n);let r=n-e;const s=[];let i=t._start;for(;null!==i&&r>0;){if(i.countable&&!i.deleted){const t=i.content.getContent();if(t.length<=e)e-=t.length;else{for(let n=e;n<t.length&&r>0;n++)s.push(t[n]),r--;e=0}}i=i.right}return s},rn=t=>{t.doc??Ke();const e=[];let n=t._start;for(;null!==n;){if(n.countable&&!n.deleted){const t=n.content.getContent();for(let n=0;n<t.length;n++)e.push(t[n])}n=n.right}return e},sn=(t,e)=>{let n=0,r=t._start;for(t.doc??Ke();null!==r;){if(r.countable&&!r.deleted){const s=r.content.getContent();for(let r=0;r<s.length;r++)e(s[r],n++,t)}r=r.right}},on=(t,e)=>{const n=[];return sn(t,((r,s)=>{n.push(e(r,s,t))})),n},cn=t=>{let e=t._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(null===n){for(;null!==e&&e.deleted;)e=e.right;if(null===e)return{done:!0,value:void 0};n=e.content.getContent(),r=0,e=e.right}const t=n[r++];return n.length<=r&&(n=null),{done:!1,value:t}}}},an=(t,e)=>{t.doc??Ke();const n=Xe(t,e);let r=t._start;for(null!==n&&(r=n.p,e-=n.index);null!==r;r=r.right)if(!r.deleted&&r.countable){if(e<r.length)return r.content.getContent()[e];e-=r.length}},ln=(t,e,n,r)=>{let s=n;const i=t.doc,o=i.clientID,c=i.store,a=null===n?e._start:n.right;let l=[];const u=()=>{l.length>0&&(s=new cr(we(o,Te(c,o)),s,s&&s.lastId,a,a&&a.id,e,null,new Xn(l)),s.integrate(t,0),l=[])};r.forEach((n=>{if(null===n)l.push(n);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:l.push(n);break;default:switch(u(),n.constructor){case Uint8Array:case ArrayBuffer:s=new cr(we(o,Te(c,o)),s,s&&s.lastId,a,a&&a.id,e,null,new Yn(new Uint8Array(n))),s.integrate(t,0);break;case ae:s=new cr(we(o,Te(c,o)),s,s&&s.lastId,a,a&&a.id,e,null,new Kn(n)),s.integrate(t,0);break;default:if(!(n instanceof en))throw new Error("Unexpected content type in insert operation");s=new cr(we(o,Te(c,o)),s,s&&s.lastId,a,a&&a.id,e,null,new ir(n)),s.integrate(t,0)}}})),u()},un=()=>st("Length exceeded!"),dn=(t,e,n,r)=>{if(n>e._length)throw un();if(0===n)return e._searchMarker&&Ze(e._searchMarker,n,r.length),ln(t,e,null,r);const s=n,i=Xe(e,n);let o=e._start;for(null!==i&&(o=i.p,0===(n-=i.index)&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));null!==o;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n<o.length&&Pe(t,we(o.id.client,o.id.clock+n));break}n-=o.length}return e._searchMarker&&Ze(e._searchMarker,s,r.length),ln(t,e,o,r)},hn=(t,e,n,r)=>{if(0===r)return;const s=n,i=r,o=Xe(e,n);let c=e._start;for(null!==o&&(c=o.p,n-=o.index);null!==c&&n>0;c=c.right)!c.deleted&&c.countable&&(n<c.length&&Pe(t,we(c.id.client,c.id.clock+n)),n-=c.length);for(;r>0&&null!==c;)c.deleted||(r<c.length&&Pe(t,we(c.id.client,c.id.clock+r)),c.delete(t),r-=c.length),c=c.right;if(r>0)throw un();e._searchMarker&&Ze(e._searchMarker,s,-i+r)},gn=(t,e,n)=>{const r=e._map.get(n);void 0!==r&&r.delete(t)},fn=(t,e,n,r)=>{const s=e._map.get(n)||null,i=t.doc,o=i.clientID;let c;if(null==r)c=new Xn([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:c=new Xn([r]);break;case Uint8Array:c=new Yn(r);break;case ae:c=new Kn(r);break;default:if(!(r instanceof en))throw new Error("Unexpected content type");c=new ir(r)}new cr(we(o,Te(i.store,o)),s,s&&s.lastId,null,null,e,n,c).integrate(t,0)},pn=(t,e)=>{t.doc??Ke();const n=t._map.get(e);return void 0===n||n.deleted?void 0:n.content.getContent()[n.length-1]},yn=t=>{const e={};return t.doc??Ke(),t._map.forEach(((t,n)=>{t.deleted||(e[n]=t.content.getContent()[t.length-1])})),e},En=(t,e)=>{t.doc??Ke();const n=t._map.get(e);return void 0!==n&&!n.deleted},mn=t=>{return t.doc??Ke(),e=t._map.entries(),n=t=>!t[1].deleted,Yt((()=>{let t;do{t=e.next()}while(!t.done&&!n(t.value));return t}));var e,n};class _n extends ze{}class bn extends en{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){const e=new bn;return e.push(t),e}_integrate(t,e){super._integrate(t,e),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new bn}clone(){const t=new bn;return t.insert(0,this.toArray().map((t=>t instanceof en?t.clone():t))),t}get length(){return this.doc??Ke(),this._length}_callObserver(t,e){super._callObserver(t,e),tn(this,t,new _n(this,t))}insert(t,e){null!==this.doc?Ge(this.doc,(n=>{dn(n,this,t,e)})):this._prelimContent.splice(t,0,...e)}push(t){null!==this.doc?Ge(this.doc,(e=>{((t,e,n)=>{let r=(e._searchMarker||[]).reduce(((t,e)=>e.index>t.index?e:t),{index:0,p:e._start}).p;if(r)for(;r.right;)r=r.right;ln(t,e,r,n)})(e,this,t)})):this._prelimContent.push(...t)}unshift(t){this.insert(0,t)}delete(t,e=1){null!==this.doc?Ge(this.doc,(n=>{hn(n,this,t,e)})):this._prelimContent.splice(t,e)}get(t){return an(this,t)}toArray(){return rn(this)}slice(t=0,e=this.length){return nn(this,t,e)}toJSON(){return this.map((t=>t instanceof en?t.toJSON():t))}map(t){return on(this,t)}forEach(t){sn(this,t)}[Symbol.iterator](){return cn(this)}_write(t){t.writeTypeRef(tr)}}class wn extends ze{constructor(t,e,n){super(t,e),this.keysChanged=n}}class vn extends en{constructor(t){super(),this._prelimContent=null,this._prelimContent=void 0===t?new Map:new Map(t)}_integrate(t,e){super._integrate(t,e),this._prelimContent.forEach(((t,e)=>{this.set(e,t)})),this._prelimContent=null}_copy(){return new vn}clone(){const t=new vn;return this.forEach(((e,n)=>{t.set(n,e instanceof en?e.clone():e)})),t}_callObserver(t,e){tn(this,t,new wn(this,t,e))}toJSON(){this.doc??Ke();const t={};return this._map.forEach(((e,n)=>{if(!e.deleted){const r=e.content.getContent()[e.length-1];t[n]=r instanceof en?r.toJSON():r}})),t}get size(){return[...mn(this)].length}keys(){return zt(mn(this),(t=>t[0]))}values(){return zt(mn(this),(t=>t[1].content.getContent()[t[1].length-1]))}entries(){return zt(mn(this),(t=>[t[0],t[1].content.getContent()[t[1].length-1]]))}forEach(t){this.doc??Ke(),this._map.forEach(((e,n)=>{e.deleted||t(e.content.getContent()[e.length-1],n,this)}))}[Symbol.iterator](){return this.entries()}delete(t){null!==this.doc?Ge(this.doc,(e=>{gn(e,this,t)})):this._prelimContent.delete(t)}set(t,e){return null!==this.doc?Ge(this.doc,(n=>{fn(n,this,t,e)})):this._prelimContent.set(t,e),e}get(t){return pn(this,t)}has(t){return En(this,t)}clear(){null!==this.doc?Ge(this.doc,(t=>{this.forEach((function(e,n,r){gn(t,r,n)}))})):this._prelimContent.clear()}_write(t){t.writeTypeRef(er)}}const Rn=(t,e)=>t===e||"object"==typeof t&&"object"==typeof e&&t&&e&&((t,e)=>t===e||Ht(t)===Ht(e)&&((t,e)=>{for(const n in t)if(!e(t[n],n))return!1;return!0})(t,((t,n)=>(void 0!==t||Qt(e,n))&&e[n]===t)))(t,e);class kn{constructor(t,e,n,r){this.left=t,this.right=e,this.index=n,this.currentAttributes=r}forward(){if(null===this.right&&ot(),this.right.content.constructor===Qn)this.right.deleted||In(this.currentAttributes,this.right.content);else this.right.deleted||(this.index+=this.right.length);this.left=this.right,this.right=this.right.right}}const Sn=(t,e,n)=>{for(;null!==e.right&&n>0;){if(e.right.content.constructor===Qn)e.right.deleted||In(e.currentAttributes,e.right.content);else e.right.deleted||(n<e.right.length&&Pe(t,we(e.right.id.client,e.right.id.clock+n)),e.index+=e.right.length,n-=e.right.length);e.left=e.right,e.right=e.right.right}return e},An=(t,e,n,r)=>{const s=new Map,i=r?Xe(e,n):null;if(i){const e=new kn(i.p.left,i.p,i.index,s);return Sn(t,e,n-i.index)}{const r=new kn(null,e._start,0,s);return Sn(t,r,n)}},Cn=(t,e,n,r)=>{for(;null!==n.right&&(!0===n.right.deleted||n.right.content.constructor===Qn&&Rn(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();const s=t.doc,i=s.clientID;r.forEach(((r,o)=>{const c=n.left,a=n.right,l=new cr(we(i,Te(s.store,i)),c,c&&c.lastId,a,a&&a.id,e,null,new Qn(o,r));l.integrate(t,0),n.right=l,n.forward()}))},In=(t,e)=>{const{key:n,value:r}=e;null===r?t.delete(n):t.set(n,r)},Tn=(t,e)=>{for(;null!==t.right&&(t.right.deleted||t.right.content.constructor===Qn&&Rn(e[t.right.content.key]??null,t.right.content.value));)t.forward()},On=(t,e,n,r)=>{const s=t.doc,i=s.clientID,o=new Map;for(const c in r){const a=r[c],l=n.currentAttributes.get(c)??null;if(!Rn(l,a)){o.set(c,l);const{left:r,right:u}=n;n.right=new cr(we(i,Te(s.store,i)),r,r&&r.lastId,u,u&&u.id,e,null,new Qn(c,a)),n.right.integrate(t,0),n.forward()}}return o},xn=(t,e,n,r,s)=>{n.currentAttributes.forEach(((t,e)=>{void 0===s[e]&&(s[e]=null)}));const i=t.doc,o=i.clientID;Tn(n,s);const c=On(t,e,n,s),a=r.constructor===String?new Zn(r):r instanceof en?new ir(r):new Hn(r);let{left:l,right:u,index:d}=n;e._searchMarker&&Ze(e._searchMarker,n.index,a.getLength()),u=new cr(we(o,Te(i.store,o)),l,l&&l.lastId,u,u&&u.id,e,null,a),u.integrate(t,0),n.right=u,n.index=d,n.forward(),Cn(t,e,n,c)},Un=(t,e,n,r,s)=>{const i=t.doc,o=i.clientID;Tn(n,s);const c=On(t,e,n,s);t:for(;null!==n.right&&(r>0||c.size>0&&(n.right.deleted||n.right.content.constructor===Qn));){if(!n.right.deleted)switch(n.right.content.constructor){case Qn:{const{key:e,value:i}=n.right.content,o=s[e];if(void 0!==o){if(Rn(o,i))c.delete(e);else{if(0===r)break t;c.set(e,i)}n.right.delete(t)}else n.currentAttributes.set(e,i);break}default:r<n.right.length&&Pe(t,we(n.right.id.client,n.right.id.clock+r)),r-=n.right.length}n.forward()}if(r>0){let s="";for(;r>0;r--)s+="\n";n.right=new cr(we(o,Te(i.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,e,null,new Zn(s)),n.right.integrate(t,0),n.forward()}Cn(t,e,n,c)},Mn=(t,e,n,r,s)=>{let i=e;const o=g();for(;i&&(!i.countable||i.deleted);){if(!i.deleted&&i.content.constructor===Qn){const t=i.content;o.set(t.key,t)}i=i.right}let c=0,a=!1;for(;e!==i;){if(n===e&&(a=!0),!e.deleted){const n=e.content;switch(n.constructor){case Qn:{const{key:i,value:l}=n,u=r.get(i)??null;o.get(i)===n&&u!==l||(e.delete(t),c++,a||(s.get(i)??null)!==l||u===l||(null===u?s.delete(i):s.set(i,u))),a||e.deleted||In(s,n);break}}}e=e.right}return c},Pn=t=>{let e=0;return Ge(t.doc,(n=>{let r=t._start,s=t._start,i=g();const o=f(i);for(;s;){if(!1===s.deleted)if(s.content.constructor===Qn)In(o,s.content);else e+=Mn(n,r,s,i,o),i=f(o),r=s;s=s.right}})),e},Ln=t=>{const e=new Set,n=t.doc;for(const[r,s]of t.afterState.entries()){const i=t.beforeState.get(r)||0;s!==i&&De(t,n.store.clients.get(r),i,s,(t=>{t.deleted||t.content.constructor!==Qn||t.constructor===Gn||e.add(t.parent)}))}Ge(n,(n=>{ee(t,t.deleteSet,(t=>{if(t instanceof Gn||!t.parent._hasFormatting||e.has(t.parent))return;const r=t.parent;t.content.constructor===Qn?e.add(r):((t,e)=>{for(;e&&e.right&&(e.right.deleted||!e.right.countable);)e=e.right;const n=new Set;for(;e&&(e.deleted||!e.countable);){if(!e.deleted&&e.content.constructor===Qn){const r=e.content.key;n.has(r)?e.delete(t):n.add(r)}e=e.left}})(n,t)}));for(const t of e)Pn(t)}))},Dn=(t,e,n)=>{const r=n,s=f(e.currentAttributes),i=e.right;for(;n>0&&null!==e.right;){if(!1===e.right.deleted)switch(e.right.content.constructor){case ir:case Hn:case Zn:n<e.right.length&&Pe(t,we(e.right.id.client,e.right.id.clock+n)),n-=e.right.length,e.right.delete(t)}e.forward()}i&&Mn(t,i,e.right,s,e.currentAttributes);const o=(e.left||e.right).parent;return o._searchMarker&&Ze(o._searchMarker,e.index,-r+n),e};class Nn extends ze{constructor(t,e,n){super(t,e),this.childListChanged=!1,this.keysChanged=new Set,n.forEach((t=>{null===t?this.childListChanged=!0:this.keysChanged.add(t)}))}get changes(){if(null===this._changes){const t={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=t}return this._changes}get delta(){if(null===this._delta){const t=this.target.doc,e=[];Ge(t,(t=>{const n=new Map,r=new Map;let s=this.target._start,i=null;const o={};let c="",a=0,l=0;const u=()=>{if(null!==i){let t=null;switch(i){case"delete":l>0&&(t={delete:l}),l=0;break;case"insert":("object"==typeof c||c.length>0)&&(t={insert:c},n.size>0&&(t.attributes={},n.forEach(((e,n)=>{null!==e&&(t.attributes[n]=e)})))),c="";break;case"retain":a>0&&(t={retain:a},(t=>{for(const e in t)return!1;return!0})(o)||(t.attributes=Wt({},o))),a=0}t&&e.push(t),i=null}};for(;null!==s;){switch(s.content.constructor){case ir:case Hn:this.adds(s)?this.deletes(s)||(u(),i="insert",c=s.content.getContent()[0],u()):this.deletes(s)?("delete"!==i&&(u(),i="delete"),l+=1):s.deleted||("retain"!==i&&(u(),i="retain"),a+=1);break;case Zn:this.adds(s)?this.deletes(s)||("insert"!==i&&(u(),i="insert"),c+=s.content.str):this.deletes(s)?("delete"!==i&&(u(),i="delete"),l+=s.length):s.deleted||("retain"!==i&&(u(),i="retain"),a+=s.length);break;case Qn:{const{key:e,value:c}=s.content;if(this.adds(s)){if(!this.deletes(s)){const a=n.get(e)??null;Rn(a,c)?null!==c&&s.delete(t):("retain"===i&&u(),Rn(c,r.get(e)??null)?delete o[e]:o[e]=c)}}else if(this.deletes(s)){r.set(e,c);const t=n.get(e)??null;Rn(t,c)||("retain"===i&&u(),o[e]=t)}else if(!s.deleted){r.set(e,c);const n=o[e];void 0!==n&&(Rn(n,c)?null!==n&&s.delete(t):("retain"===i&&u(),null===c?delete o[e]:o[e]=c))}s.deleted||("insert"===i&&u(),In(n,s.content));break}}s=s.right}for(u();e.length>0;){const t=e[e.length-1];if(void 0===t.retain||void 0!==t.attributes)break;e.pop()}})),this._delta=e}return this._delta}}class jn extends en{constructor(t){super(),this._pending=void 0!==t?[()=>this.insert(0,t)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??Ke(),this._length}_integrate(t,e){super._integrate(t,e);try{this._pending.forEach((t=>t()))}catch(t){console.error(t)}this._pending=null}_copy(){return new jn}clone(){const t=new jn;return t.applyDelta(this.toDelta()),t}_callObserver(t,e){super._callObserver(t,e);const n=new Nn(this,t,e);tn(this,t,n),!t.local&&this._hasFormatting&&(t._needFormattingCleanup=!0)}toString(){this.doc??Ke();let t="",e=this._start;for(;null!==e;)!e.deleted&&e.countable&&e.content.constructor===Zn&&(t+=e.content.str),e=e.right;return t}toJSON(){return this.toString()}applyDelta(t,{sanitize:e=!0}={}){null!==this.doc?Ge(this.doc,(n=>{const r=new kn(null,this._start,0,new Map);for(let s=0;s<t.length;s++){const i=t[s];if(void 0!==i.insert){const o=e||"string"!=typeof i.insert||s!==t.length-1||null!==r.right||"\n"!==i.insert.slice(-1)?i.insert:i.insert.slice(0,-1);("string"!=typeof o||o.length>0)&&xn(n,this,r,o,i.attributes||{})}else void 0!==i.retain?Un(n,this,r,i.retain,i.attributes||{}):void 0!==i.delete&&Dn(n,r,i.delete)}})):this._pending.push((()=>this.applyDelta(t)))}toDelta(t,e,n){this.doc??Ke();const r=[],s=new Map,i=this.doc;let o="",c=this._start;function a(){if(o.length>0){const t={};let e=!1;s.forEach(((n,r)=>{e=!0,t[r]=n}));const n={insert:o};e&&(n.attributes=t),r.push(n),o=""}}const l=()=>{for(;null!==c;){if(Se(c,t)||void 0!==e&&Se(c,e))switch(c.content.constructor){case Zn:{const r=s.get("ychange");void 0===t||Se(c,t)?void 0===e||Se(c,e)?void 0!==r&&(a(),s.delete("ychange")):void 0!==r&&r.user===c.id.client&&"added"===r.type||(a(),s.set("ychange",n?n("added",c.id):{type:"added"})):void 0!==r&&r.user===c.id.client&&"removed"===r.type||(a(),s.set("ychange",n?n("removed",c.id):{type:"removed"})),o+=c.content.str;break}case ir:case Hn:{a();const t={insert:c.content.getContent()[0]};if(s.size>0){const e={};t.attributes=e,s.forEach(((t,n)=>{e[n]=t}))}r.push(t);break}case Qn:Se(c,t)&&(a(),In(s,c.content))}c=c.right}a()};return t||e?Ge(i,(n=>{t&&Ae(n,t),e&&Ae(n,e),l()}),"cleanup"):l(),r}insert(t,e,n){if(e.length<=0)return;const r=this.doc;null!==r?Ge(r,(r=>{const s=An(r,this,t,!n);n||(n={},s.currentAttributes.forEach(((t,e)=>{n[e]=t}))),xn(r,this,s,e,n)})):this._pending.push((()=>this.insert(t,e,n)))}insertEmbed(t,e,n){const r=this.doc;null!==r?Ge(r,(r=>{const s=An(r,this,t,!n);xn(r,this,s,e,n||{})})):this._pending.push((()=>this.insertEmbed(t,e,n||{})))}delete(t,e){if(0===e)return;const n=this.doc;null!==n?Ge(n,(n=>{Dn(n,An(n,this,t,!0),e)})):this._pending.push((()=>this.delete(t,e)))}format(t,e,n){if(0===e)return;const r=this.doc;null!==r?Ge(r,(r=>{const s=An(r,this,t,!1);null!==s.right&&Un(r,this,s,e,n)})):this._pending.push((()=>this.format(t,e,n)))}removeAttribute(t){null!==this.doc?Ge(this.doc,(e=>{gn(e,this,t)})):this._pending.push((()=>this.removeAttribute(t)))}setAttribute(t,e){null!==this.doc?Ge(this.doc,(n=>{fn(n,this,t,e)})):this._pending.push((()=>this.setAttribute(t,e)))}getAttribute(t){return pn(this,t)}getAttributes(){return yn(this)}_write(t){t.writeTypeRef(nr)}}class Vn{constructor(t,e=()=>!0){this._filter=e,this._root=t,this._currentNode=t._start,this._firstCall=!0,t.doc??Ke()}[Symbol.iterator](){return this}next(){let t=this._currentNode,e=t&&t.content&&t.content.type;if(null!==t&&(!this._firstCall||t.deleted||!this._filter(e)))do{if(e=t.content.type,t.deleted||e.constructor!==$n&&e.constructor!==Bn||null===e._start)for(;null!==t;){const e=t.next;if(null!==e){t=e;break}t=t.parent===this._root?null:t.parent._item}else t=e._start}while(null!==t&&(t.deleted||!this._filter(t.content.type)));return this._firstCall=!1,null===t?{value:void 0,done:!0}:(this._currentNode=t,{value:t.content.type,done:!1})}}class Bn extends en{constructor(){super(),this._prelimContent=[]}get firstChild(){const t=this._first;return t?t.content.getContent()[0]:null}_integrate(t,e){super._integrate(t,e),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Bn}clone(){const t=new Bn;return t.insert(0,this.toArray().map((t=>t instanceof en?t.clone():t))),t}get length(){return this.doc??Ke(),null===this._prelimContent?this._length:this._prelimContent.length}createTreeWalker(t){return new Vn(this,t)}querySelector(t){t=t.toUpperCase();const e=new Vn(this,(e=>e.nodeName&&e.nodeName.toUpperCase()===t)).next();return e.done?null:e.value}querySelectorAll(t){return t=t.toUpperCase(),m(new Vn(this,(e=>e.nodeName&&e.nodeName.toUpperCase()===t)))}_callObserver(t,e){tn(this,t,new Fn(this,e,t))}toString(){return on(this,(t=>t.toString())).join("")}toJSON(){return this.toString()}toDOM(t=document,e={},n){const r=t.createDocumentFragment();return void 0!==n&&n._createAssociation(r,this),sn(this,(s=>{r.insertBefore(s.toDOM(t,e,n),null)})),r}insert(t,e){null!==this.doc?Ge(this.doc,(n=>{dn(n,this,t,e)})):this._prelimContent.splice(t,0,...e)}insertAfter(t,e){if(null!==this.doc)Ge(this.doc,(n=>{const r=t&&t instanceof en?t._item:t;ln(n,this,r,e)}));else{const n=this._prelimContent,r=null===t?0:n.findIndex((e=>e===t))+1;if(0===r&&null!==t)throw st("Reference item not found");n.splice(r,0,...e)}}delete(t,e=1){null!==this.doc?Ge(this.doc,(n=>{hn(n,this,t,e)})):this._prelimContent.splice(t,e)}toArray(){return rn(this)}push(t){this.insert(this.length,t)}unshift(t){this.insert(0,t)}get(t){return an(this,t)}slice(t=0,e=this.length){return nn(this,t,e)}forEach(t){sn(this,t)}_write(t){t.writeTypeRef(sr)}}class $n extends Bn{constructor(t="UNDEFINED"){super(),this.nodeName=t,this._prelimAttrs=new Map}get nextSibling(){const t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){const t=this._item?this._item.prev:null;return t?t.content.type:null}_integrate(t,e){super._integrate(t,e),this._prelimAttrs.forEach(((t,e)=>{this.setAttribute(e,t)})),this._prelimAttrs=null}_copy(){return new $n(this.nodeName)}clone(){const t=new $n(this.nodeName);return((t,e)=>{for(const n in t)e(t[n],n)})(this.getAttributes(),((e,n)=>{"string"==typeof e&&t.setAttribute(n,e)})),t.insert(0,this.toArray().map((t=>t instanceof en?t.clone():t))),t}toString(){const t=this.getAttributes(),e=[],n=[];for(const e in t)n.push(e);n.sort();const r=n.length;for(let s=0;s<r;s++){const r=n[s];e.push(r+'="'+t[r]+'"')}const s=this.nodeName.toLocaleLowerCase();return`<${s}${e.length>0?" "+e.join(" "):""}>${super.toString()}</${s}>`}removeAttribute(t){null!==this.doc?Ge(this.doc,(e=>{gn(e,this,t)})):this._prelimAttrs.delete(t)}setAttribute(t,e){null!==this.doc?Ge(this.doc,(n=>{fn(n,this,t,e)})):this._prelimAttrs.set(t,e)}getAttribute(t){return pn(this,t)}hasAttribute(t){return En(this,t)}getAttributes(t){return t?((t,e)=>{const n={};return t._map.forEach(((t,r)=>{let s=t;for(;null!==s&&(!e.sv.has(s.id.client)||s.id.clock>=(e.sv.get(s.id.client)||0));)s=s.left;null!==s&&Se(s,e)&&(n[r]=s.content.getContent()[s.length-1])})),n})(this,t):yn(this)}toDOM(t=document,e={},n){const r=t.createElement(this.nodeName),s=this.getAttributes();for(const t in s){const e=s[t];"string"==typeof e&&r.setAttribute(t,e)}return sn(this,(s=>{r.appendChild(s.toDOM(t,e,n))})),void 0!==n&&n._createAssociation(r,this),r}_write(t){t.writeTypeRef(rr),t.writeKey(this.nodeName)}}class Fn extends ze{constructor(t,e,n){super(t,n),this.childListChanged=!1,this.attributesChanged=new Set,e.forEach((t=>{null===t?this.childListChanged=!0:this.attributesChanged.add(t)}))}}class qn{constructor(t,e){this.id=t,this.length=e}get deleted(){throw it()}mergeWith(t){return!1}write(t,e,n){throw it()}integrate(t,e){throw it()}}class Gn extends qn{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor===t.constructor&&(this.length+=t.length,!0)}integrate(t,e){e>0&&(this.id.clock+=e,this.length-=e),Oe(t.doc.store,this)}write(t,e){t.writeInfo(0),t.writeLen(this.length-e)}getMissing(t,e){return null}}class Yn{constructor(t){this.content=t}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Yn(this.content)}splice(t){throw it()}mergeWith(t){return!1}integrate(t,e){}delete(t){}gc(t){}write(t,e){t.writeBuf(this.content)}getRef(){return 3}}class zn{constructor(t){this.len=t}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new zn(this.len)}splice(t){const e=new zn(this.len-t);return this.len=t,e}mergeWith(t){return this.len+=t.len,!0}integrate(t,e){se(t.deleteSet,e.id.client,e.id.clock,this.len),e.markDeleted()}delete(t){}gc(t){}write(t,e){t.writeLen(this.len-e)}getRef(){return 1}}const Wn=(t,e)=>new ae({guid:t,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class Kn{constructor(t){t._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=t;const e={};this.opts=e,t.gc||(e.gc=!1),t.autoLoad&&(e.autoLoad=!0),null!==t.meta&&(e.meta=t.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new Kn(Wn(this.doc.guid,this.opts))}splice(t){throw it()}mergeWith(t){return!1}integrate(t,e){this.doc._item=e,t.subdocsAdded.add(this.doc),this.doc.shouldLoad&&t.subdocsLoaded.add(this.doc)}delete(t){t.subdocsAdded.has(this.doc)?t.subdocsAdded.delete(this.doc):t.subdocsRemoved.add(this.doc)}gc(t){}write(t,e){t.writeString(this.doc.guid),t.writeAny(this.opts)}getRef(){return 9}}class Hn{constructor(t){this.embed=t}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new Hn(this.embed)}splice(t){throw it()}mergeWith(t){return!1}integrate(t,e){}delete(t){}gc(t){}write(t,e){t.writeJSON(this.embed)}getRef(){return 5}}class Qn{constructor(t,e){this.key=t,this.value=e}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new Qn(this.key,this.value)}splice(t){throw it()}mergeWith(t){return!1}integrate(t,e){const n=e.parent;n._searchMarker=null,n._hasFormatting=!0}delete(t){}gc(t){}write(t,e){t.writeKey(this.key),t.writeJSON(this.value)}getRef(){return 6}}const Jn="development"===vt("node_env");class Xn{constructor(t){this.arr=t,Jn&&Xt(t)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Xn(this.arr)}splice(t){const e=new Xn(this.arr.slice(t));return this.arr=this.arr.slice(0,t),e}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,e){}delete(t){}gc(t){}write(t,e){const n=this.arr.length;t.writeLen(n-e);for(let r=e;r<n;r++){const e=this.arr[r];t.writeAny(e)}}getRef(){return 8}}class Zn{constructor(t){this.str=t}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new Zn(this.str)}splice(t){const e=new Zn(this.str.slice(t));this.str=this.str.slice(0,t);const n=this.str.charCodeAt(t-1);return n>=55296&&n<=56319&&(this.str=this.str.slice(0,t-1)+"",e.str=""+e.str.slice(1)),e}mergeWith(t){return this.str+=t.str,!0}integrate(t,e){}delete(t){}gc(t){}write(t,e){t.writeString(0===e?this.str:this.str.slice(e))}getRef(){return 4}}const tr=0,er=1,nr=2,rr=3,sr=4;class ir{constructor(t){this.type=t}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new ir(this.type._copy())}splice(t){throw it()}mergeWith(t){return!1}integrate(t,e){this.type._integrate(t.doc,e)}delete(t){let e=this.type._start;for(;null!==e;)e.deleted?e.id.clock<(t.beforeState.get(e.id.client)||0)&&t._mergeStructs.push(e):e.delete(t),e=e.right;this.type._map.forEach((e=>{e.deleted?e.id.clock<(t.beforeState.get(e.id.client)||0)&&t._mergeStructs.push(e):e.delete(t)})),t.changed.delete(this.type)}gc(t){let e=this.type._start;for(;null!==e;)e.gc(t,!0),e=e.right;this.type._start=null,this.type._map.forEach((e=>{for(;null!==e;)e.gc(t,!0),e=e.left})),this.type._map=new Map}write(t,e){this.type._write(t)}getRef(){return 7}}const or=(t,e,n)=>{const{client:r,clock:s}=e.id,i=new cr(we(r,s+n),e,we(r,s+n-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(n));return e.deleted&&i.markDeleted(),e.keep&&(i.keep=!0),null!==e.redone&&(i.redone=we(e.redone.client,e.redone.clock+n)),e.right=i,null!==i.right&&(i.right.left=i),t._mergeStructs.push(i),null!==i.parentSub&&null===i.right&&i.parent._map.set(i.parentSub,i),e.length=n,i};class cr extends qn{constructor(t,e,n,r,s,i,o,c){super(t,c.getLength()),this.origin=n,this.left=e,this.right=r,this.rightOrigin=s,this.parent=i,this.parentSub=o,this.redone=null,this.content=c,this.info=this.content.isCountable()?2:0}set marker(t){(8&this.info)>0!==t&&(this.info^=8)}get marker(){return(8&this.info)>0}get keep(){return(1&this.info)>0}set keep(t){this.keep!==t&&(this.info^=1)}get countable(){return(2&this.info)>0}get deleted(){return(4&this.info)>0}set deleted(t){this.deleted!==t&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(t,e){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=Te(e,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=Te(e,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===_e&&this.id.client!==this.parent.client&&this.parent.clock>=Te(e,this.parent.client))return this.parent.client;if(this.origin&&(this.left=Le(t,e,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=Pe(t,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===Gn||this.right&&this.right.constructor===Gn)this.parent=null;else if(this.parent){if(this.parent.constructor===_e){const t=Ue(e,this.parent);t.constructor===Gn?this.parent=null:this.parent=t.content.type}}else this.left&&this.left.constructor===cr?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===cr&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);return null}integrate(t,e){if(e>0&&(this.id.clock+=e,this.left=Le(t,t.doc.store,we(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(e),this.length-=e),this.parent){if(!this.left&&(!this.right||null!==this.right.left)||this.left&&this.left.right!==this.right){let e,n=this.left;if(null!==n)e=n.right;else if(null!==this.parentSub)for(e=this.parent._map.get(this.parentSub)||null;null!==e&&null!==e.left;)e=e.left;else e=this.parent._start;const r=new Set,s=new Set;for(;null!==e&&e!==this.right;){if(s.add(e),r.add(e),be(this.origin,e.origin)){if(e.id.client<this.id.client)n=e,r.clear();else if(be(this.rightOrigin,e.rightOrigin))break}else{if(null===e.origin||!s.has(Ue(t.doc.store,e.origin)))break;r.has(Ue(t.doc.store,e.origin))||(n=e,r.clear())}e=e.right}this.left=n}if(null!==this.left){const t=this.left.right;this.right=t,this.left.right=this}else{let t;if(null!==this.parentSub)for(t=this.parent._map.get(this.parentSub)||null;null!==t&&null!==t.left;)t=t.left;else t=this.parent._start,this.parent._start=this;this.right=t}null!==this.right?this.right.left=this:null!==this.parentSub&&(this.parent._map.set(this.parentSub,this),null!==this.left&&this.left.delete(t)),null===this.parentSub&&this.countable&&!this.deleted&&(this.parent._length+=this.length),Oe(t.doc.store,this),this.content.integrate(t,this),Ve(t,this.parent,this.parentSub),(null!==this.parent._item&&this.parent._item.deleted||null!==this.parentSub&&null!==this.right)&&this.delete(t)}else new Gn(this.id,this.length).integrate(t,0)}get next(){let t=this.right;for(;null!==t&&t.deleted;)t=t.right;return t}get prev(){let t=this.left;for(;null!==t&&t.deleted;)t=t.left;return t}get lastId(){return 1===this.length?this.id:we(this.id.client,this.id.clock+this.length-1)}mergeWith(t){if(this.constructor===t.constructor&&be(t.origin,this.lastId)&&this.right===t&&be(this.rightOrigin,t.rightOrigin)&&this.id.client===t.id.client&&this.id.clock+this.length===t.id.clock&&this.deleted===t.deleted&&null===this.redone&&null===t.redone&&this.content.constructor===t.content.constructor&&this.content.mergeWith(t.content)){const e=this.parent._searchMarker;return e&&e.forEach((e=>{e.p===t&&(e.p=this,!this.deleted&&this.countable&&(e.index-=this.length))})),t.keep&&(this.keep=!0),this.right=t.right,null!==this.right&&(this.right.left=this),this.length+=t.length,!0}return!1}delete(t){if(!this.deleted){const e=this.parent;this.countable&&null===this.parentSub&&(e._length-=this.length),this.markDeleted(),se(t.deleteSet,this.id.client,this.id.clock,this.length),Ve(t,e,this.parentSub),this.content.delete(t)}}gc(t,e){if(!this.deleted)throw ot();this.content.gc(t),e?((t,e,n)=>{const r=t.clients.get(e.id.client);r[xe(r,e.id.clock)]=n})(t,this,new Gn(this.id,this.length)):this.content=new zn(this.length)}write(t,e){const n=e>0?we(this.id.client,this.id.clock+e-1):this.origin,r=this.rightOrigin,s=this.parentSub,i=31&this.content.getRef()|(null===n?0:A)|(null===r?0:64)|(null===s?0:32);if(t.writeInfo(i),null!==n&&t.writeLeftID(n),null!==r&&t.writeRightID(r),null===n&&null===r){const e=this.parent;if(void 0!==e._item){const n=e._item;if(null===n){const n=ve(e);t.writeParentInfo(!0),t.writeString(n)}else t.writeParentInfo(!1),t.writeLeftID(n.id)}else e.constructor===String?(t.writeParentInfo(!0),t.writeString(e)):e.constructor===_e?(t.writeParentInfo(!1),t.writeLeftID(e)):ot();null!==s&&t.writeString(s)}this.content.write(t,e)}}const ar="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},lr="__ $YJS$ __";!0===ar[lr]&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"),ar[lr]=!0;var ur=n(1569),dr=n(876);const hr=new WeakMap;function gr(t){const e={...t};for(const[n,r]of Object.entries(t))r instanceof dr.RichTextData&&(e[n]=r.valueOf());return e}function fr(t){return t.map((t=>{const e=t instanceof vn?t.toJSON():t,{name:n,innerBlocks:r,attributes:s,...i}=e;return delete i.validationIssues,delete i.originalContent,{...i,name:n,attributes:gr(s),innerBlocks:fr(r)}}))}function pr(t,e){const n=e.toJSON(),r={innerBlocks:null,clientId:null},s=h()(Object.assign({},t,r),Object.assign({},n,r)),i=t.innerBlocks||[],o=e.get("innerBlocks");return s&&i.length===o.length&&i.every(((t,e)=>pr(t,o.get(e))))}function yr(t,e){return new vn(Object.entries(e).map((([e,n])=>[e,Er(t,e,n)])))}function Er(t,e,n){return wr(t,e)?new jn(n?.toString()??""):n}function mr(t){return new vn(Object.entries(t).map((([e,n])=>{switch(e){case"attributes":return[e,yr(t.name,n)];case"innerBlocks":{const t=new bn;return Array.isArray(n)?(t.insert(0,n.map((t=>mr(t)))),[e,t]):[e,t]}default:return[e,n]}})))}function _r(t,e,n){hr.has(e)||hr.set(e,fr(e));const r=(hr.get(e)??[]).filter((t=>function(t){if("core/gallery"===t.name)return!t.innerBlocks.some((t=>t.attributes&&t.attributes.blob));return!0}(t))),s=Math.min(r.length??0,t.length);let i=0,o=0;for(;i<s&&pr(r[i],t.get(i));i++);for(;o<s-i&&pr(r[r.length-o-1],t.get(t.length-o-1));o++);const c=s-i-o,a=Math.max(0,r.length-t.length),l=Math.max(0,t.length-r.length);for(let e=0;e<c;e++,i++){const e=r[i],s=t.get(i);Object.entries(e).forEach((([t,r])=>{switch(t){case"attributes":{const i=s.get(t);if(!i){s.set(t,yr(e.name,r));break}Object.entries(r).forEach((([t,r])=>{if(h()(i?.get(t),r))return;if(wr(e.name,t)&&"string"==typeof r){vr(i.get(t),r,n)}else i.set(t,Er(e.name,t,r))})),i.forEach(((t,e)=>{r.hasOwnProperty(e)||i.delete(e)}));break}case"innerBlocks":_r(s.get(t),r??[],n);break;default:h()(e[t],s.get(t))||s.set(t,r)}})),s.forEach(((t,n)=>{e.hasOwnProperty(n)||s.delete(n)}))}t.delete(i,l);for(let e=0;e<a;e++,i++){const e=[mr(r[i])];t.insert(i,e)}const u=new Set;for(let e=0;e<t.length;e++){const n=t.get(e);let r=n.get("clientId");u.has(r)&&(r=(0,ur.A)(),n.set("clientId",r)),u.add(r)}}let br;function wr(t,e){if(!br){br=new Map;for(const t of(0,l.getBlockTypes)()){const e=new Map;for(const[n,r]of Object.entries(t.attributes??{}))"rich-text"===r.type&&e.set(n,!0);br.set(t.name,e)}}return br.get(t)?.has(e)??!1}function vr(t,e,n){t.delete(0,t.toString().length),t.insert(0,e)}const Rr="document";let kr=null;const Sr=new Set(["author","blocks","comment_status","date","excerpt","featured_media","format","ping_status","slug","status","sticky","tags","template","title"]);function Ar(t,e){const n=t.getMap(Rr);Object.entries(e).forEach((([t,e])=>{if("function"!=typeof e){Or(n.get(t),e,(function(e){n.set(t,e)}))}}))}function Cr(t){return t.getMap(Rr).toJSON()}function Ir(t){return"string"==typeof t?t:t&&"object"==typeof t&&"raw"in t&&"string"==typeof t.raw?t.raw:void 0}function Tr(t,e){return!h()(t,e)}function Or(t,e,n){Tr(t,e)&&n(e)}const xr="id",Ur=["title","excerpt","content"],Mr={blocks:{read:t=>(0,l.parse)(t.content?.raw??""),write:t=>({content:(0,l.__unstableSerializeAndClean)(t.blocks)})}},Pr=[{label:(0,u.__)("Base"),kind:"root",name:"__unstableBase",baseURL:"/",baseURLParams:{_fields:["description","gmt_offset","home","name","site_icon","site_icon_url","site_logo","timezone_string","url","page_for_posts","page_on_front","show_on_front"].join(",")},plural:"__unstableBases"},{label:(0,u.__)("Post Type"),name:"postType",kind:"root",key:"slug",baseURL:"/wp/v2/types",baseURLParams:{context:"edit"},plural:"postTypes"},{name:"media",kind:"root",baseURL:"/wp/v2/media",baseURLParams:{context:"edit"},plural:"mediaItems",label:(0,u.__)("Media"),rawAttributes:["caption","title","description"],supportsPagination:!0},{name:"taxonomy",kind:"root",key:"slug",baseURL:"/wp/v2/taxonomies",baseURLParams:{context:"edit"},plural:"taxonomies",label:(0,u.__)("Taxonomy")},{name:"sidebar",kind:"root",baseURL:"/wp/v2/sidebars",baseURLParams:{context:"edit"},plural:"sidebars",transientEdits:{blocks:!0},label:(0,u.__)("Widget areas")},{name:"widget",kind:"root",baseURL:"/wp/v2/widgets",baseURLParams:{context:"edit"},plural:"widgets",transientEdits:{blocks:!0},label:(0,u.__)("Widgets")},{name:"widgetType",kind:"root",baseURL:"/wp/v2/widget-types",baseURLParams:{context:"edit"},plural:"widgetTypes",label:(0,u.__)("Widget types")},{label:(0,u.__)("User"),name:"user",kind:"root",baseURL:"/wp/v2/users",getTitle:t=>t?.name||t?.slug,baseURLParams:{context:"edit"},plural:"users",supportsPagination:!0},{name:"comment",kind:"root",baseURL:"/wp/v2/comments",baseURLParams:{context:"edit"},plural:"comments",label:(0,u.__)("Comment"),supportsPagination:!0},{name:"menu",kind:"root",baseURL:"/wp/v2/menus",baseURLParams:{context:"edit"},plural:"menus",label:(0,u.__)("Menu"),supportsPagination:!0},{name:"menuItem",kind:"root",baseURL:"/wp/v2/menu-items",baseURLParams:{context:"edit"},plural:"menuItems",label:(0,u.__)("Menu Item"),rawAttributes:["title"],supportsPagination:!0},{name:"menuLocation",kind:"root",baseURL:"/wp/v2/menu-locations",baseURLParams:{context:"edit"},plural:"menuLocations",label:(0,u.__)("Menu Location"),key:"name"},{label:(0,u.__)("Global Styles"),name:"globalStyles",kind:"root",baseURL:"/wp/v2/global-styles",baseURLParams:{context:"edit"},plural:"globalStylesVariations",getTitle:()=>(0,u.__)("Custom Styles"),getRevisionsUrl:(t,e)=>`/wp/v2/global-styles/${t}/revisions${e?"/"+e:""}`,supportsPagination:!0},{label:(0,u.__)("Themes"),name:"theme",kind:"root",baseURL:"/wp/v2/themes",baseURLParams:{context:"edit"},plural:"themes",key:"stylesheet"},{label:(0,u.__)("Plugins"),name:"plugin",kind:"root",baseURL:"/wp/v2/plugins",baseURLParams:{context:"edit"},plural:"plugins",key:"plugin"},{label:(0,u.__)("Status"),name:"status",kind:"root",baseURL:"/wp/v2/statuses",baseURLParams:{context:"edit"},plural:"statuses",key:"slug"}],Lr={root:{media:{since:"6.9",alternative:{kind:"postType",name:"attachment"}}}},Dr=[{kind:"postType",loadEntities:async function(){const t=await a()({path:"/wp/v2/types?context=view"});return Object.entries(t??{}).map((([t,e])=>{const n=["wp_template","wp_template_part"].includes(t),o=e?.rest_namespace??"wp/v2",c={applyChangesToCRDTDoc:(t,e)=>function(t,e){const n=t.getMap(Rr);Object.entries(e).forEach((([t,e])=>{if(Sr.has(t)&&"function"!=typeof e)switch(t){case"blocks":{let t=n.get("blocks");t instanceof bn||(t=new bn,r(t)),_r(t,e??[],kr);break}case"excerpt":Or(n.get("excerpt"),Ir(e),r);break;case"slug":if(!e)break;Or(n.get("slug"),e,r);break;case"title":{const t=n.get("title");let s=Ir(e);t||"Auto Draft"!==s||(s=""),Or(t,s,r);break}default:Or(n.get(t),e,r)}function r(e){n.set(t,e)}})),"selection"in e&&(kr=e.selection?.selectionStart??null)}(t,e),getChangesFromCRDTDoc:(t,e)=>function(t,e){const n=t.getMap(Rr);return Object.fromEntries(Object.entries(n.toJSON()).filter((([t,r])=>{if(!Sr.has(t))return!1;const s=e[t];switch(t){case"blocks":return!0;case"date":{const t=["draft","auto-draft","pending"].includes(n.get("status"))&&(null===s||e.modified===s);return!(!r&&t)&&Tr(s,r)}case"status":return"auto-draft"!==r&&Tr(s,r);case"excerpt":case"title":return Tr(Ir(s),r);default:return Tr(s,r)}})))}(t,e),supports:{}};return{kind:"postType",baseURL:`/${o}/${e.rest_base}`,baseURLParams:{context:"edit"},name:t,label:e.name,transientEdits:{...Mr,selection:!0},mergedEdits:{meta:!0},rawAttributes:Ur,getTitle:t=>t?.title?.rendered||t?.title||(n?function(t,e){return void 0===e&&(e={}),(0,s.W)(t,(0,r.Cl)({delimiter:" ",transform:i},e))}(t.slug??""):String(t.id)),__unstablePrePersist:n?void 0:Nr,__unstable_rest_base:e.rest_base,syncConfig:c,supportsPagination:!0,getRevisionsUrl:(t,n)=>`/${o}/${e.rest_base}/${t}/revisions${n?"/"+n:""}`,revisionKey:xr}}))}},{kind:"taxonomy",loadEntities:async function(){const t=await a()({path:"/wp/v2/taxonomies?context=view"});return Object.entries(t??{}).map((([t,e])=>({kind:"taxonomy",baseURL:`/${e?.rest_namespace??"wp/v2"}/${e.rest_base}`,baseURLParams:{context:"edit"},name:t,label:e.name,getTitle:t=>t?.name,supportsPagination:!0})))}},{kind:"root",name:"site",plural:"sites",loadEntities:async function(){const t={label:(0,u.__)("Site"),name:"site",kind:"root",baseURL:"/wp/v2/settings",syncConfig:{applyChangesToCRDTDoc:Ar,getChangesFromCRDTDoc:Cr},meta:{}},e=await a()({path:t.baseURL,method:"OPTIONS"}),n={};return Object.entries(e?.schema?.properties??{}).forEach((([t,e])=>{"object"==typeof e&&e.title&&(n[t]=e.title)})),[{...t,meta:{labels:n}}]}}],Nr=(t,e)=>{const n={};return"auto-draft"===t?.status&&(e.status||n.status||(n.status="draft"),e.title&&"Auto Draft"!==e.title||n.title||t?.title&&"Auto Draft"!==t?.title||(n.title="")),n};const jr=(t,e,n="get")=>`${n}${"root"===t?"":(0,o.fL)(t)}${(0,o.fL)(e)}`},4997:t=>{"use strict";t.exports=window.wp.blocks},5003:(t,e,n)=>{"use strict";function r(t,e,n){if(!t||"object"!=typeof t)return t;const r=Array.isArray(e)?e:e.split(".");return r.reduce(((t,e,s)=>(void 0===t[e]&&(Number.isInteger(r[s+1])?t[e]=[]:t[e]={}),s===r.length-1&&(t[e]=n),t[e])),t),t}n.d(e,{A:()=>r})},5101:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});const r=Symbol("RECEIVE_INTERMEDIATE_RESULTS")},5469:(t,e,n)=>{"use strict";n.d(e,{Ay:()=>k});var r=n(7734),s=n.n(r);const i=window.wp.compose;var o=n(7143);const c=window.wp.isShallowEqual;var a=n.n(c);function l(t,e){const n={...t};return Object.entries(e).forEach((([t,e])=>{n[t]?n[t]={...n[t],to:e.to}:n[t]=e})),n}const u=(t,e)=>{const n=t?.findIndex((({id:t})=>"string"==typeof t?t===e.id:a()(t,e.id))),r=[...t];return-1!==n?r[n]={id:e.id,changes:l(r[n].changes,e.changes)}:r.push(e),r};function d(){let t=[],e=[],n=0;const r=()=>{t=t.slice(0,n||void 0),n=0},s=()=>{const n=0===t.length?0:t.length-1;let r=t[n]??[];e.forEach((t=>{r=u(r,t)})),e=[],t[n]=r};return{addRecord(n,i=!1){const o=!n||(t=>!t.filter((({changes:t})=>Object.values(t).some((({from:t,to:e})=>"function"!=typeof t&&"function"!=typeof e&&!a()(t,e))))).length)(n);if(i){if(o)return;n.forEach((t=>{e=u(e,t)}))}else{if(r(),e.length&&s(),o)return;t.push(n)}},undo(){e.length&&(r(),s());const i=t[t.length-1+n];if(i)return n-=1,i},redo(){const e=t[t.length+n];if(e)return n+=1,e},hasUndo:()=>!!t[t.length-1+n],hasRedo:()=>!!t[t.length+n]}}var h=t=>e=>(n,r)=>void 0===n||t(r)?e(n,r):n;var g=t=>e=>(n,r)=>e(n,t(r));var f=t=>e=>(n={},r)=>{const s=r[t];if(void 0===s)return n;const i=e(n[s],r);return i===n[s]?n:{...n,[s]:i}},p=n(4767),y=n(4027);function E(t){const{query:e}=t;if(!e)return"default";return(0,y.A)(e).context}function m(t,e,n,r){if(1===n&&-1===r)return e;const s=(n-1)*r,i=Math.max(t?.length??0,s+e.length),o=new Array(i);for(let n=0;n<i;n++){const i=n>=s&&n<s+r;o[n]=i?e[n-s]:t?.[n]}return o}function _(t,e){return Object.fromEntries(Object.entries(t).filter((([t])=>!e.some((e=>Number.isInteger(e)?e===+t:e===t)))))}const b=(0,i.compose)([h((t=>"query"in t)),g((t=>t.query?{...t,...(0,y.A)(t.query)}:t)),f("context"),f("stableKey")])(((t={},e)=>{const{type:n,page:r,perPage:s,key:i=p.C_}=e;return"RECEIVE_ITEMS"!==n?t:{itemIds:m(t?.itemIds||[],e.items.map((t=>t?.[i])).filter(Boolean),r,s),meta:e.meta}}));var w=(0,o.combineReducers)({items:function(t={},e){switch(e.type){case"RECEIVE_ITEMS":{const n=E(e),r=e.key||p.C_;return{...t,[n]:{...t[n],...e.items.reduce(((e,i)=>{const o=i?.[r];return e[o]=function(t,e){if(!t)return e;let n=!1;const r={};for(const i in e)s()(t[i],e[i])?r[i]=t[i]:(n=!0,r[i]=e[i]);if(!n)return t;for(const e in t)r.hasOwnProperty(e)||(r[e]=t[e]);return r}(t?.[n]?.[o],i),e}),{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(t).map((([t,n])=>[t,_(n,e.itemIds)])))}return t},itemIsComplete:function(t={},e){switch(e.type){case"RECEIVE_ITEMS":{const n=E(e),{query:r,key:s=p.C_}=e,i=r?(0,y.A)(r):{},o=!r||!Array.isArray(i.fields);return{...t,[n]:{...t[n],...e.items.reduce(((e,r)=>{const i=r?.[s];return e[i]=t?.[n]?.[i]||o,e}),{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(t).map((([t,n])=>[t,_(n,e.itemIds)])))}return t},queries:(t={},e)=>{switch(e.type){case"RECEIVE_ITEMS":return b(t,e);case"REMOVE_ITEMS":const n=e.itemIds.reduce(((t,e)=>(t[e]=!0,t)),{});return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,Object.fromEntries(Object.entries(e).map((([t,e])=>[t,{...e,itemIds:e.itemIds.filter((t=>!n[t]))}])))])));default:return t}}});const v=t=>(e,n)=>{if("UNDO"===n.type||"REDO"===n.type){const{record:r}=n;let s=e;return r.forEach((({id:{kind:e,name:r,recordId:i},changes:o})=>{s=t(s,{type:"EDIT_ENTITY_RECORD",kind:e,name:r,recordId:i,edits:Object.entries(o).reduce(((t,[e,r])=>(t[e]="UNDO"===n.type?r.from:r.to,t)),{})})})),s}return t(e,n)};function R(t){return(0,i.compose)([v,h((e=>e.name&&e.kind&&e.name===t.name&&e.kind===t.kind)),g((e=>({key:t.key||p.C_,...e})))])((0,o.combineReducers)({queriedData:w,edits:(t={},e)=>{switch(e.type){case"RECEIVE_ITEMS":if("default"!==(e?.query?.context??"default"))return t;const n={...t};for(const t of e.items){const r=t?.[e.key],i=n[r];if(!i)continue;const o=Object.keys(i).reduce(((n,r)=>(s()(i[r],t[r]?.raw??t[r])||e.persistedEdits&&s()(i[r],e.persistedEdits[r])||(n[r]=i[r]),n)),{});Object.keys(o).length?n[r]=o:delete n[r]}return n;case"EDIT_ENTITY_RECORD":const r={...t[e.recordId],...e.edits};return Object.keys(r).forEach((t=>{void 0===r[t]&&delete r[t]})),{...t,[e.recordId]:r}}return t},saving:(t={},e)=>{switch(e.type){case"SAVE_ENTITY_RECORD_START":case"SAVE_ENTITY_RECORD_FINISH":return{...t,[e.recordId]:{pending:"SAVE_ENTITY_RECORD_START"===e.type,error:e.error,isAutosave:e.isAutosave}}}return t},deleting:(t={},e)=>{switch(e.type){case"DELETE_ENTITY_RECORD_START":case"DELETE_ENTITY_RECORD_FINISH":return{...t,[e.recordId]:{pending:"DELETE_ENTITY_RECORD_START"===e.type,error:e.error}}}return t},revisions:(t={},e)=>{if("RECEIVE_ITEM_REVISIONS"===e.type){const n=e.recordKey;delete e.recordKey;const r=w(t[n],{...e,type:"RECEIVE_ITEMS"});return{...t,[n]:r}}return"REMOVE_ITEMS"===e.type?Object.fromEntries(Object.entries(t).filter((([t])=>!e.itemIds.some((e=>Number.isInteger(e)?e===+t:e===t))))):t}}))}var k=(0,o.combineReducers)({users:function(t={byId:{},queries:{}},e){return"RECEIVE_USER_QUERY"===e.type?{byId:{...t.byId,...e.users.reduce(((t,e)=>({...t,[e.id]:e})),{})},queries:{...t.queries,[e.queryID]:e.users.map((t=>t.id))}}:t},currentTheme:function(t=void 0,e){return"RECEIVE_CURRENT_THEME"===e.type?e.currentTheme.stylesheet:t},currentGlobalStylesId:function(t=void 0,e){return"RECEIVE_CURRENT_GLOBAL_STYLES_ID"===e.type?e.id:t},currentUser:function(t={},e){return"RECEIVE_CURRENT_USER"===e.type?e.currentUser:t},themeGlobalStyleVariations:function(t={},e){return"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS"===e.type?{...t,[e.stylesheet]:e.variations}:t},themeBaseGlobalStyles:function(t={},e){return"RECEIVE_THEME_GLOBAL_STYLES"===e.type?{...t,[e.stylesheet]:e.globalStyles}:t},themeGlobalStyleRevisions:function(t={},e){return"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS"===e.type?{...t,[e.currentId]:e.revisions}:t},entities:(t={},e)=>{const n=function(t=p.Mr,e){return"ADD_ENTITIES"===e.type?[...t,...e.entities]:t}(t.config,e);let r=t.reducer;if(!r||n!==t.config){const t=n.reduce(((t,e)=>{const{kind:n}=e;return t[n]||(t[n]=[]),t[n].push(e),t}),{});r=(0,o.combineReducers)(Object.fromEntries(Object.entries(t).map((([t,e])=>[t,(0,o.combineReducers)(Object.fromEntries(e.map((t=>[t.name,R(t)]))))]))))}const s=r(t.records,e);return s===t.records&&n===t.config&&r===t.reducer?t:{reducer:r,records:s,config:n}},editsReference:function(t={},e){switch(e.type){case"EDIT_ENTITY_RECORD":case"UNDO":case"REDO":return{}}return t},undoManager:function(t=d()){return t},embedPreviews:function(t={},e){if("RECEIVE_EMBED_PREVIEW"===e.type){const{url:n,preview:r}=e;return{...t,[n]:r}}return t},userPermissions:function(t={},e){switch(e.type){case"RECEIVE_USER_PERMISSION":return{...t,[e.key]:e.isAllowed};case"RECEIVE_USER_PERMISSIONS":return{...t,...e.permissions}}return t},autosaves:function(t={},e){if("RECEIVE_AUTOSAVES"===e.type){const{postId:n,autosaves:r}=e;return{...t,[n]:r}}return t},blockPatterns:function(t=[],e){return"RECEIVE_BLOCK_PATTERNS"===e.type?e.patterns:t},blockPatternCategories:function(t=[],e){return"RECEIVE_BLOCK_PATTERN_CATEGORIES"===e.type?e.categories:t},userPatternCategories:function(t=[],e){return"RECEIVE_USER_PATTERN_CATEGORIES"===e.type?e.patternCategories:t},navigationFallbackId:function(t=null,e){return"RECEIVE_NAVIGATION_FALLBACK_ID"===e.type?e.fallbackId:t},defaultTemplates:function(t={},e){return"RECEIVE_DEFAULT_TEMPLATE"===e.type?{...t,[JSON.stringify(e.query)]:e.templateId}:t},registeredPostMeta:function(t={},e){return"RECEIVE_REGISTERED_POST_META"===e.type?{...t,[e.postType]:e.registeredPostMeta}:t}})},5663:(t,e,n)=>{"use strict";n.d(e,{xQ:()=>o});var r=n(1635),s=n(287);function i(t,e){return 0===e?t.toLowerCase():(0,s.l3)(t,e)}function o(t,e){return void 0===e&&(e={}),(0,s.fL)(t,(0,r.Cl)({transform:i},e))}},6087:t=>{"use strict";t.exports=window.wp.element},6378:(t,e,n)=>{"use strict";n.d(e,{s:()=>s,T:()=>i});const r=window.wp.privateApis,{lock:s,unlock:i}=(0,r.__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")},6384:(t,e,n)=>{"use strict";n.r(e),n.d(e,{__experimentalGetCurrentGlobalStylesId:()=>O,__experimentalGetCurrentThemeBaseGlobalStyles:()=>x,__experimentalGetCurrentThemeGlobalStylesVariations:()=>U,canUser:()=>A,canUserEditEntityRecord:()=>C,getAuthors:()=>p,getAutosave:()=>T,getAutosaves:()=>I,getBlockPatternCategories:()=>L,getBlockPatterns:()=>P,getCurrentTheme:()=>R,getCurrentThemeGlobalStylesRevisions:()=>M,getCurrentUser:()=>y,getDefaultTemplateId:()=>j,getEditedEntityRecord:()=>_,getEmbedPreview:()=>S,getEntitiesConfig:()=>F,getEntityRecord:()=>E,getEntityRecords:()=>b,getEntityRecordsTotalItems:()=>w,getEntityRecordsTotalPages:()=>v,getNavigationFallbackId:()=>N,getRawEntityRecord:()=>m,getRegisteredPostMeta:()=>$,getRevision:()=>B,getRevisions:()=>V,getThemeSupports:()=>k,getUserPatternCategories:()=>D});var r=n(5663),s=n(3832),i=n(8537),o=n(1455),c=n.n(o),a=n(2278),l=n(4767),u=n(533),d=n(2577);var h=t=>(...e)=>async({resolveSelect:n})=>{await n[t](...e)},g=n(5101),f=n(7006);const p=t=>async({dispatch:e})=>{const n=(0,s.addQueryArgs)("/wp/v2/users/?who=authors&per_page=100",t),r=await c()({path:n});e.receiveUserQuery(n,r)},y=()=>async({dispatch:t})=>{const e=await c()({path:"/wp/v2/users/me"});t.receiveCurrentUser(e)},E=(t,e,n="",r)=>async({select:i,dispatch:o,registry:h,resolveSelect:g})=>{const f=(await g.getEntitiesConfig(t)).find((n=>n.name===e&&n.kind===t));if(!f)return;const p=await o.__unstableAcquireStoreLock(a.E,["entities","records",t,e,n],{exclusive:!1});try{if(void 0!==r&&r._fields&&(r={...r,_fields:[...new Set([...(0,u.A)(r._fields)||[],f.key||l.C_])].join()}),void 0!==r&&r._fields){if(i.hasEntityRecord(t,e,n,r))return}let{baseURL:a}=f;"postType"===t&&"wp_template"===e&&n&&"string"==typeof n&&!/^\d+$/.test(n)&&(a=a.slice(0,a.lastIndexOf("/"))+"/templates");const g=(0,s.addQueryArgs)(a+(n?"/"+n:""),{...f.baseURLParams,...r}),p=await c()({path:g,parse:!1}),y=await p.json(),E=(0,d.qY)(p.headers?.get("allow")),m=[],_={};for(const r of d.CO)_[(0,d.kC)(r,{kind:t,name:e,id:n})]=E[r],m.push([r,{kind:t,name:e,id:n}]);window.__experimentalEnableSync&&f.syncConfig,h.batch((()=>{o.receiveEntityRecords(t,e,y,r),o.receiveUserPermissions(_),o.finishResolutions("canUser",m)}))}finally{o.__unstableReleaseStoreLock(p)}};E.shouldInvalidate=(t,e,n)=>"root"===e&&"site"===n&&("RECEIVE_ITEMS"===t.type&&t.persistedEdits&&"auto-draft"!==t.persistedEdits.status||"REMOVE_ITEMS"===t.type)&&"postType"===t.kind&&"wp_template"===t.name;const m=h("getEntityRecord"),_=h("getEntityRecord"),b=(t,e,n={})=>async({dispatch:r,registry:i,resolveSelect:o})=>{const h=(await o.getEntitiesConfig(t)).find((n=>n.name===e&&n.kind===t));if(!h)return;const f=await r.__unstableAcquireStoreLock(a.E,["entities","records",t,e],{exclusive:!1}),p={...n},y=h.key||l.C_;function E(n,r){const s=Object.fromEntries(Object.entries(r).filter((([t,e])=>["context","_fields"].includes(t)&&!!e)));return n.filter((t=>t?.[y])).map((n=>[t,e,n[y],Object.keys(s).length>0?s:void 0]))}try{n._fields&&(n={...n,_fields:[...new Set([...(0,u.A)(n._fields)||[],y])].join()});let{baseURL:o}=h;const{combinedTemplates:a=!0}=n;"postType"===t&&"wp_template"===e&&a&&(o=o.slice(0,o.lastIndexOf("/"))+"/templates");const l=(0,s.addQueryArgs)(o,{...h.baseURLParams,...n});let m,_=[];if(h.supportsPagination&&-1!==n.per_page){const t=await c()({path:l,parse:!1});_=Object.values(await t.json()),m={totalItems:parseInt(t.headers.get("X-WP-Total")),totalPages:parseInt(t.headers.get("X-WP-TotalPages"))}}else if(-1===n.per_page&&!0===n[g.Z]){let o,a=1;do{const u=await c()({path:(0,s.addQueryArgs)(l,{page:a,per_page:100}),parse:!1}),d=Object.values(await u.json());o=parseInt(u.headers.get("X-WP-TotalPages")),m||(m={totalItems:parseInt(u.headers.get("X-WP-Total")),totalPages:1}),_.push(...d),i.batch((()=>{r.receiveEntityRecords(t,e,_,n,!1,void 0,m),r.finishResolutions("getEntityRecord",E(d,p))})),a++}while(a<=o)}else _=Object.values(await c()({path:l})),m={totalItems:_.length,totalPages:1};n._fields&&(_=_.map((t=>(n._fields.split(",").forEach((e=>{t.hasOwnProperty(e)||(t[e]=void 0)})),t)))),i.batch((()=>{r.receiveEntityRecords(t,e,_,n,!1,void 0,m);const s=_.filter((t=>!!t?.[y]&&!!t?._links?.self?.[0]?.targetHints?.allow)).map((t=>({id:t[y],permissions:(0,d.qY)(t._links.self[0].targetHints.allow)}))),i=[],o={};for(const n of s)for(const r of d.CO)i.push([r,{kind:t,name:e,id:n.id}]),o[(0,d.kC)(r,{kind:t,name:e,id:n.id})]=n.permissions[r];s.length>0&&(r.receiveUserPermissions(o),r.finishResolutions("canUser",i)),r.finishResolutions("getEntityRecord",E(_,p)),r.__unstableReleaseStoreLock(f)}))}catch(t){r.__unstableReleaseStoreLock(f)}};b.shouldInvalidate=(t,e,n)=>("RECEIVE_ITEMS"===t.type||"REMOVE_ITEMS"===t.type)&&t.invalidateCache&&e===t.kind&&n===t.name;const w=h("getEntityRecords"),v=h("getEntityRecords"),R=()=>async({dispatch:t,resolveSelect:e})=>{const n=await e.getEntityRecords("root","theme",{status:"active"});t.receiveCurrentTheme(n[0])},k=h("getCurrentTheme"),S=t=>async({dispatch:e})=>{try{const n=await c()({path:(0,s.addQueryArgs)("/oembed/1.0/proxy",{url:t})});e.receiveEmbedPreview(t,n)}catch(n){e.receiveEmbedPreview(t,!1)}},A=(t,e,n)=>async({dispatch:r,registry:s,resolveSelect:i})=>{if(!d.CO.includes(t))throw new Error(`'${t}' is not a valid action.`);const{hasStartedResolution:o}=s.select(a.E);for(const r of d.CO){if(r===t)continue;if(o("canUser",[r,e,n]))return}let l,u=null;if("object"==typeof e){if(!e.kind||!e.name)throw new Error("The entity resource object is not valid.");const t=(await i.getEntitiesConfig(e.kind)).find((t=>t.name===e.name&&t.kind===e.kind));if(!t)return;u=t.baseURL+(e.id?"/"+e.id:"")}else u=`/wp/v2/${e}`+(n?"/"+n:"");try{l=await c()({path:u,method:"OPTIONS",parse:!1})}catch(t){return}const h=(0,d.qY)(l.headers?.get("allow"));s.batch((()=>{for(const s of d.CO){const i=(0,d.kC)(s,e,n);r.receiveUserPermission(i,h[s]),s!==t&&r.finishResolution("canUser",[s,e,n])}}))},C=(t,e,n)=>async({dispatch:r})=>{await r(A("update",{kind:t,name:e,id:n}))},I=(t,e)=>async({dispatch:n,resolveSelect:r})=>{const{rest_base:s,rest_namespace:i="wp/v2",supports:o}=await r.getPostType(t);if(!o?.autosave)return;const a=await c()({path:`/${i}/${s}/${e}/autosaves?context=edit`});a&&a.length&&n.receiveAutosaves(e,a)},T=(t,e)=>async({resolveSelect:n})=>{await n.getAutosaves(t,e)},O=()=>async({dispatch:t,resolveSelect:e})=>{const n=await e.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&&t.__experimentalReceiveCurrentGlobalStylesId(i)},x=()=>async({resolveSelect:t,dispatch:e})=>{const n=await t.getCurrentTheme(),r=await c()({path:`/wp/v2/global-styles/themes/${n.stylesheet}?context=view`});e.__experimentalReceiveThemeBaseGlobalStyles(n.stylesheet,r)},U=()=>async({resolveSelect:t,dispatch:e})=>{const n=await t.getCurrentTheme(),r=await c()({path:`/wp/v2/global-styles/themes/${n.stylesheet}/variations?context=view`});e.__experimentalReceiveThemeGlobalStyleVariations(n.stylesheet,r)},M=()=>async({resolveSelect:t,dispatch:e})=>{const n=await t.__experimentalGetCurrentGlobalStylesId(),s=n?await t.getEntityRecord("root","globalStyles",n):void 0,i=s?._links?.["version-history"]?.[0]?.href;if(i){const t=await c()({url:i}),s=t?.map((t=>Object.fromEntries(Object.entries(t).map((([t,e])=>[(0,r.xQ)(t),e])))));e.receiveThemeGlobalStyleRevisions(n,s)}};M.shouldInvalidate=t=>"SAVE_ENTITY_RECORD_FINISH"===t.type&&"root"===t.kind&&!t.error&&"globalStyles"===t.name;const P=()=>async({dispatch:t})=>{t({type:"RECEIVE_BLOCK_PATTERNS",patterns:await(0,f.l$)()})},L=()=>async({dispatch:t})=>{t({type:"RECEIVE_BLOCK_PATTERN_CATEGORIES",categories:await c()({path:"/wp/v2/block-patterns/categories"})})},D=()=>async({dispatch:t,resolveSelect:e})=>{const n=await e.getEntityRecords("taxonomy","wp_pattern_category",{per_page:-1,_fields:"id,name,description,slug",context:"view"});t({type:"RECEIVE_USER_PATTERN_CATEGORIES",patternCategories:n?.map((t=>({...t,label:(0,i.decodeEntities)(t.name),name:t.slug})))||[]})},N=()=>async({dispatch:t,select:e,registry:n})=>{const r=await c()({path:(0,s.addQueryArgs)("/wp-block-editor/v1/navigation-fallback",{_embed:!0})}),i=r?._embedded?.self;n.batch((()=>{if(t.receiveNavigationFallbackId(r?.id),!i)return;const n=!e.getEntityRecord("postType","wp_navigation",r.id);t.receiveEntityRecords("postType","wp_navigation",i,void 0,n),t.finishResolution("getEntityRecord",["postType","wp_navigation",r.id])}))},j=t=>async({dispatch:e,registry:n,resolveSelect:r})=>{const i=await c()({path:(0,s.addQueryArgs)("/wp/v2/templates/lookup",t)});await r.getEntitiesConfig("postType");const o=i?.wp_id||i?.id;o&&(i.id=o,i.type="string"==typeof o?"wp_registered_template":"wp_template",n.batch((()=>{e.receiveDefaultTemplateId(t,o),e.receiveEntityRecords("postType",i.type,[i]),e.finishResolution("getEntityRecord",["postType",i.type,o])})))};j.shouldInvalidate=t=>"RECEIVE_ITEMS"===t.type&&"root"===t.kind&&"site"===t.name;const V=(t,e,n,r={})=>async({dispatch:i,registry:o,resolveSelect:a})=>{const d=(await a.getEntitiesConfig(t)).find((n=>n.name===e&&n.kind===t));if(!d)return;r._fields&&(r={...r,_fields:[...new Set([...(0,u.A)(r._fields)||[],d.revisionKey||l.C_])].join()});const h=(0,s.addQueryArgs)(d.getRevisionsUrl(n),r);let g,f;const p={},y=d.supportsPagination&&-1!==r.per_page;try{f=await c()({path:h,parse:!y})}catch(t){return}f&&(y?(g=Object.values(await f.json()),p.totalItems=parseInt(f.headers.get("X-WP-Total"))):g=Object.values(f),r._fields&&(g=g.map((t=>(r._fields.split(",").forEach((e=>{t.hasOwnProperty(e)||(t[e]=void 0)})),t)))),o.batch((()=>{if(i.receiveRevisions(t,e,n,g,r,!1,p),!r?._fields&&!r.context){const r=d.key||l.C_,s=g.filter((t=>t[r])).map((s=>[t,e,n,s[r]]));i.finishResolutions("getRevision",s)}})))};V.shouldInvalidate=(t,e,n,r)=>"SAVE_ENTITY_RECORD_FINISH"===t.type&&n===t.name&&e===t.kind&&!t.error&&r===t.recordId;const B=(t,e,n,r,i)=>async({dispatch:o,resolveSelect:a})=>{const d=(await a.getEntitiesConfig(t)).find((n=>n.name===e&&n.kind===t));if(!d)return;void 0!==i&&i._fields&&(i={...i,_fields:[...new Set([...(0,u.A)(i._fields)||[],d.revisionKey||l.C_])].join()});const h=(0,s.addQueryArgs)(d.getRevisionsUrl(n,r),i);let g;try{g=await c()({path:h})}catch(t){return}g&&o.receiveRevisions(t,e,n,g,i)},$=t=>async({dispatch:e,resolveSelect:n})=>{let r;try{const{rest_namespace:e="wp/v2",rest_base:s}=await n.getPostType(t)||{};r=await c()({path:`${e}/${s}/?context=edit`,method:"OPTIONS"})}catch(t){return}r&&e.receiveRegisteredPostMeta(t,r?.schema?.properties?.meta?.properties)},F=t=>async({dispatch:e})=>{const n=l.L2.find((e=>e.kind===t));if(n)try{const t=await n.loadEntities();if(!t.length)return;e.addEntities(t)}catch{}}},7006:(t,e,n)=>{"use strict";n.d(e,{Y3:()=>l,gr:()=>h,l$:()=>g});var r=n(5663),s=n(1455),i=n.n(s),o=n(3832),c=n(8537),a=n(7723);async function l(t,e={},n={}){const r=e.isInitialSuggestions&&e.initialSuggestionsSearchOptions?{...e,...e.initialSuggestionsSearchOptions}:e,{type:s,subtype:l,page:d,perPage:h=(e.isInitialSuggestions?3:20)}=r,{disablePostFormats:g=!1}=n,f=[];s&&"post"!==s||f.push(i()({path:(0,o.addQueryArgs)("/wp/v2/search",{search:t,page:d,per_page:h,type:"post",subtype:l})}).then((t=>t.map((t=>({id:t.id,url:t.url,title:(0,c.decodeEntities)(t.title||"")||(0,a.__)("(no title)"),type:t.subtype||t.type,kind:"post-type"}))))).catch((()=>[]))),s&&"term"!==s||f.push(i()({path:(0,o.addQueryArgs)("/wp/v2/search",{search:t,page:d,per_page:h,type:"term",subtype:l})}).then((t=>t.map((t=>({id:t.id,url:t.url,title:(0,c.decodeEntities)(t.title||"")||(0,a.__)("(no title)"),type:t.subtype||t.type,kind:"taxonomy"}))))).catch((()=>[]))),g||s&&"post-format"!==s||f.push(i()({path:(0,o.addQueryArgs)("/wp/v2/search",{search:t,page:d,per_page:h,type:"post-format",subtype:l})}).then((t=>t.map((t=>({id:t.id,url:t.url,title:(0,c.decodeEntities)(t.title||"")||(0,a.__)("(no title)"),type:t.subtype||t.type,kind:"taxonomy"}))))).catch((()=>[]))),s&&"attachment"!==s||f.push(i()({path:(0,o.addQueryArgs)("/wp/v2/media",{search:t,page:d,per_page:h})}).then((t=>t.map((t=>({id:t.id,url:t.source_url,title:(0,c.decodeEntities)(t.title.rendered||"")||(0,a.__)("(no title)"),type:t.type,kind:"media"}))))).catch((()=>[])));let p=(await Promise.all(f)).flat();return p=p.filter((t=>!!t.id)),p=function(t,e){const n=u(e),r={};for(const e of t)if(e.title){const t=u(e.title),s=t.filter((t=>n.some((e=>t===e)))),i=t.filter((t=>n.some((e=>t!==e&&t.includes(e))))),o=s.length/t.length*10,c=i.length/t.length;r[e.id]=o+c}else r[e.id]=0;return t.sort(((t,e)=>r[e.id]-r[t.id]))}(p,t),p=p.slice(0,h),p}function u(t){return t.toLowerCase().match(/[\p{L}\p{N}]+/gu)||[]}const d=new Map;var h=async(t,e={})=>{const n={url:(0,o.prependHTTP)(t)};if(!(0,o.isURL)(t))return Promise.reject(`${t} is not a valid URL.`);const r=(0,o.getProtocol)(t);return r&&(0,o.isValidProtocol)(r)&&r.startsWith("http")&&/^https?:\/\/[^\/\s]/i.test(t)?d.has(t)?d.get(t):i()({path:(0,o.addQueryArgs)("/wp-block-editor/v1/url-details",n),...e}).then((e=>(d.set(t,e),e))):Promise.reject(`${t} does not have a valid protocol. URLs must be "http" based`)};async function g(){const t=await i()({path:"/wp/v2/block-patterns/patterns"});return t?t.map((t=>Object.fromEntries(Object.entries(t).map((([t,e])=>[(0,r.xQ)(t),e]))))):[]}},7078:(t,e,n)=>{"use strict";n.d(e,{Ay:()=>g,bM:()=>f,pU:()=>p});var r=n(3832),s=n(4040),i=n.n(s),o=n(7143),c=n(6087),a=n(7541),l=n(4565),u=n(6378),d=n(533);const h=[];function g(t,e,n={},s={enabled:!0}){const i=(0,r.addQueryArgs)("",n),{data:c,...u}=(0,a.A)((r=>s.enabled?r(l.store).getEntityRecords(t,e,n):{data:h}),[t,e,i,s.enabled]),{totalItems:d,totalPages:g}=(0,o.useSelect)((r=>s.enabled?{totalItems:r(l.store).getEntityRecordsTotalItems(t,e,n),totalPages:r(l.store).getEntityRecordsTotalPages(t,e,n)}:{totalItems:null,totalPages:null}),[t,e,i,s.enabled]);return{records:c,totalItems:d,totalPages:g,...u}}function f(t,e,n,r){return i()("wp.data.__experimentalUseEntityRecords",{alternative:"wp.data.useEntityRecords",since:"6.1"}),g(t,e,n,r)}function p(t,e,n={},r={enabled:!0}){const s=(0,o.useSelect)((n=>n(l.store).getEntityConfig(t,e)),[t,e]),{records:i,...a}=g(t,e,{...n,...n._fields?{_fields:[...new Set([...(0,d.A)(n._fields)||[],"_links"])].join()}:{}},r),h=(0,c.useMemo)((()=>i?.map((t=>t[s?.key??"id"]))??[]),[i,s?.key]),f=(0,o.useSelect)((n=>{const{getEntityRecordsPermissions:r}=(0,u.T)(n(l.store));return r(t,e,h)}),[h,t,e]);return{records:(0,c.useMemo)((()=>i?.map(((t,e)=>({...t,permissions:f[e]})))??[]),[i,f]),...a}}},7143:t=>{"use strict";t.exports=window.wp.data},7314:(t,e,n)=>{"use strict";n.d(e,{g:()=>r});function r(t){return t.toLowerCase()}},7541:(t,e,n)=>{"use strict";n.d(e,{A:()=>c});var r=n(7143);var s=function(t,e){var n,r,s=0;function i(){var i,o,c=n,a=arguments.length;t:for(;c;){if(c.args.length===arguments.length){for(o=0;o<a;o++)if(c.args[o]!==arguments[o]){c=c.next;continue t}return c!==n&&(c===r&&(r=c.prev),c.prev.next=c.next,c.next&&(c.next.prev=c.prev),c.next=n,c.prev=null,n.prev=c,n=c),c.val}c=c.next}for(i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return c={args:i,val:t.apply(null,i)},n?(n.prev=c,c.next=n):r=c,s===e.maxSize?(r=r.prev).next=null:s++,n=c,c.val}return e=e||{},i.clear=function(){n=null,r=null,s=0},i},i=n(2859);const o=["getIsResolving","hasStartedResolution","hasFinishedResolution","isResolving","getCachedResolvers"];function c(t,e){return(0,r.useSelect)(((e,n)=>t((t=>a(e(t))),n)),e)}const a=s((t=>{const e={};for(const n in t)o.includes(n)||Object.defineProperty(e,n,{get:()=>(...e)=>{const r=t[n](...e),s=t.getResolutionState(n,e)?.status;let o;switch(s){case"resolving":o=i.n.Resolving;break;case"finished":o=i.n.Success;break;case"error":o=i.n.Error;break;case void 0:o=i.n.Idle}return{data:r,status:o,isResolving:o===i.n.Resolving,hasStarted:o!==i.n.Idle,hasResolved:o===i.n.Success||o===i.n.Error}}});return e}))},7723:t=>{"use strict";t.exports=window.wp.i18n},7734:t=>{"use strict";t.exports=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==typeof e&&"object"==typeof n){if(e.constructor!==n.constructor)return!1;var r,s,i;if(Array.isArray(e)){if((r=e.length)!=n.length)return!1;for(s=r;0!=s--;)if(!t(e[s],n[s]))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(s of e.entries())if(!n.has(s[0]))return!1;for(s of e.entries())if(!t(s[1],n.get(s[0])))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(s of e.entries())if(!n.has(s[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if((r=e.length)!=n.length)return!1;for(s=r;0!=s--;)if(e[s]!==n[s])return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((r=(i=Object.keys(e)).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(!t(e[o],n[o]))return!1}return!0}return e!=e&&n!=n}},7826:(t,e,n)=>{"use strict";n.d(e,{j:()=>o});var r=n(7078),s=n(5101),i=n(6378);const o={};(0,i.s)(o,{useEntityRecordsWithPermissions:r.pU,RECEIVE_INTERMEDIATE_RESULTS:s.Z})},8368:(t,e,n)=>{"use strict";n.r(e),n.d(e,{__experimentalGetCurrentGlobalStylesId:()=>X,__experimentalGetCurrentThemeBaseGlobalStyles:()=>at,__experimentalGetCurrentThemeGlobalStylesVariations:()=>lt,__experimentalGetDirtyEntityRecords:()=>D,__experimentalGetEntitiesBeingSaved:()=>N,__experimentalGetEntityRecordNoResolver:()=>O,canUser:()=>nt,canUserEditEntityRecord:()=>rt,getAuthors:()=>w,getAutosave:()=>it,getAutosaves:()=>st,getBlockPatternCategories:()=>dt,getBlockPatterns:()=>ut,getCurrentTheme:()=>J,getCurrentThemeGlobalStylesRevisions:()=>gt,getCurrentUser:()=>v,getDefaultTemplateId:()=>ft,getEditedEntityRecord:()=>$,getEmbedPreview:()=>tt,getEntitiesByKind:()=>k,getEntitiesConfig:()=>S,getEntity:()=>A,getEntityConfig:()=>C,getEntityRecord:()=>I,getEntityRecordEdits:()=>j,getEntityRecordNonTransientEdits:()=>V,getEntityRecords:()=>M,getEntityRecordsTotalItems:()=>P,getEntityRecordsTotalPages:()=>L,getLastEntityDeleteError:()=>z,getLastEntitySaveError:()=>Y,getRawEntityRecord:()=>x,getRedoEdit:()=>K,getReferenceByDistinctEdits:()=>ct,getRevision:()=>yt,getRevisions:()=>pt,getThemeSupports:()=>Z,getUndoEdit:()=>W,getUserPatternCategories:()=>ht,getUserQueryResults:()=>R,hasEditsForEntityRecord:()=>B,hasEntityRecord:()=>T,hasEntityRecords:()=>U,hasFetchedAutosaves:()=>ot,hasRedo:()=>Q,hasUndo:()=>H,isAutosavingEntityRecord:()=>F,isDeletingEntityRecord:()=>G,isPreviewEmbedFallback:()=>et,isRequestingEmbedPreview:()=>b,isSavingEntityRecord:()=>q});var r=n(7143),s=n(3832),i=n(4040),o=n.n(i),c=n(2278),a=n(3249),l=n.n(a),u=n(4027),d=n(5003);const h=new WeakMap;const g=(0,r.createSelector)(((t,e={})=>{let n=h.get(t);if(n){const t=n.get(e);if(void 0!==t)return t}else n=new(l()),h.set(t,n);const r=function(t,e){const{stableKey:n,page:r,perPage:s,include:i,fields:o,context:c}=(0,u.A)(e);let a;if(t.queries?.[c]?.[n]&&(a=t.queries[c][n].itemIds),!a)return null;const l=-1===s?0:(r-1)*s,h=-1===s?a.length:Math.min(l+s,a.length),g=[];for(let e=l;e<h;e++){const n=a[e];if(Array.isArray(i)&&!i.includes(n))continue;if(void 0===n)continue;if(!t.items[c]?.hasOwnProperty(n))return null;const r=t.items[c][n];let s;if(Array.isArray(o)){s={};for(let t=0;t<o.length;t++){const e=o[t].split(".");let n=r;e.forEach((t=>{n=n?.[t]})),(0,d.A)(s,e,n)}}else{if(!t.itemIsComplete[c]?.[n])return null;s=r}g.push(s)}return g}(t,e);return n.set(e,r),r}));function f(t,e={}){const{stableKey:n,context:r}=(0,u.A)(e);return t.queries?.[r]?.[n]?.meta?.totalItems??null}var p=n(4767),y=n(533);var E=n(2577),m=n(9410);const _={},b=(0,r.createRegistrySelector)((t=>(e,n)=>t(c.E).isResolving("getEmbedPreview",[n])));function w(t,e){o()("select( 'core' ).getAuthors()",{since:"5.9",alternative:"select( 'core' ).getUsers({ who: 'authors' })"});const n=(0,s.addQueryArgs)("/wp/v2/users/?who=authors&per_page=100",e);return R(t,n)}function v(t){return t.currentUser}const R=(0,r.createSelector)(((t,e)=>(t.users.queries[e]??[]).map((e=>t.users.byId[e]))),((t,e)=>[t.users.queries[e],t.users.byId]));function k(t,e){return o()("wp.data.select( 'core' ).getEntitiesByKind()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntitiesConfig()"}),S(t,e)}const S=(0,r.createSelector)(((t,e)=>t.entities.config.filter((t=>t.kind===e))),((t,e)=>t.entities.config));function A(t,e,n){return o()("wp.data.select( 'core' ).getEntity()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntityConfig()"}),C(t,e,n)}function C(t,e,n){return(0,m.A)(e,n,"getEntityConfig"),t.entities.config?.find((t=>t.kind===e&&t.name===n))}const I=(0,r.createSelector)(((t,e,n,r,s)=>{(0,m.A)(e,n,"getEntityRecord");const i=t.entities.records?.[e]?.[n]?.queriedData;if(!i)return;const o=s?.context??"default";if(!s||!s._fields){if(!i.itemIsComplete[o]?.[r])return;return i.items[o][r]}const c=i.items[o]?.[r];if(!c)return c;const a={},l=(0,y.A)(s._fields)??[];for(let t=0;t<l.length;t++){const e=l[t].split(".");let n=c;e.forEach((t=>{n=n?.[t]})),(0,d.A)(a,e,n)}return a}),((t,e,n,r,s)=>{const i=s?.context??"default",o=t.entities.records?.[e]?.[n]?.queriedData;return[o?.items[i]?.[r],o?.itemIsComplete[i]?.[r]]}));function T(t,e,n,r,s){const i=t.entities.records?.[e]?.[n]?.queriedData;if(!i)return!1;const o=s?.context??"default";if(!s||!s._fields)return!!i.itemIsComplete[o]?.[r];const c=i.items[o]?.[r];if(!c)return!1;const a=(0,y.A)(s._fields)??[];for(let t=0;t<a.length;t++){const e=a[t].split(".");let n=c;for(let t=0;t<e.length;t++){const r=e[t];if(!n||!Object.hasOwn(n,r))return!1;n=n[r]}}return!0}function O(t,e,n,r){return I(t,e,n,r)}I.__unstableNormalizeArgs=t=>{const e=[...t],n=e?.[2];return e[2]=/^\s*\d+\s*$/.test(n)?Number(n):n,e};const x=(0,r.createSelector)(((t,e,n,r)=>{(0,m.A)(e,n,"getRawEntityRecord");const s=I(t,e,n,r);return s&&Object.keys(s).reduce(((r,i)=>{var o,c;return o=C(t,e,n),c=i,(o.rawAttributes||[]).includes(c)?r[i]=void 0!==s[i]?.raw?s[i]?.raw:s[i]:r[i]=s[i],r}),{})}),((t,e,n,r,s)=>{const i=s?.context??"default";return[t.entities.config,t.entities.records?.[e]?.[n]?.queriedData?.items[i]?.[r],t.entities.records?.[e]?.[n]?.queriedData?.itemIsComplete[i]?.[r]]}));function U(t,e,n,r){return(0,m.A)(e,n,"hasEntityRecords"),Array.isArray(M(t,e,n,r))}const M=(t,e,n,r)=>{(0,m.A)(e,n,"getEntityRecords");const s=t.entities.records?.[e]?.[n]?.queriedData;return s?g(s,r):null},P=(t,e,n,r)=>{(0,m.A)(e,n,"getEntityRecordsTotalItems");const s=t.entities.records?.[e]?.[n]?.queriedData;return s?f(s,r):null},L=(t,e,n,r)=>{(0,m.A)(e,n,"getEntityRecordsTotalPages");const s=t.entities.records?.[e]?.[n]?.queriedData;if(!s)return null;if(-1===r?.per_page)return 1;const i=f(s,r);return i?r?.per_page?Math.ceil(i/r.per_page):function(t,e={}){const{stableKey:n,context:r}=(0,u.A)(e);return t.queries?.[r]?.[n]?.meta?.totalPages??null}(s,r):i},D=(0,r.createSelector)((t=>{const{entities:{records:e}}=t,n=[];return Object.keys(e).forEach((r=>{Object.keys(e[r]).forEach((s=>{const i=Object.keys(e[r][s].edits).filter((e=>I(t,r,s,e)&&B(t,r,s,e)));if(i.length){const e=C(t,r,s);i.forEach((i=>{const o=$(t,r,s,i);n.push({key:o?o[e.key||p.C_]:void 0,title:e?.getTitle?.(o)||"",name:s,kind:r})}))}}))})),n}),(t=>[t.entities.records])),N=(0,r.createSelector)((t=>{const{entities:{records:e}}=t,n=[];return Object.keys(e).forEach((r=>{Object.keys(e[r]).forEach((s=>{const i=Object.keys(e[r][s].saving).filter((e=>q(t,r,s,e)));if(i.length){const e=C(t,r,s);i.forEach((i=>{const o=$(t,r,s,i);n.push({key:o?o[e.key||p.C_]:void 0,title:e?.getTitle?.(o)||"",name:s,kind:r})}))}}))})),n}),(t=>[t.entities.records]));function j(t,e,n,r){return(0,m.A)(e,n,"getEntityRecordEdits"),t.entities.records?.[e]?.[n]?.edits?.[r]}const V=(0,r.createSelector)(((t,e,n,r)=>{(0,m.A)(e,n,"getEntityRecordNonTransientEdits");const{transientEdits:s}=C(t,e,n)||{},i=j(t,e,n,r)||{};return s?Object.keys(i).reduce(((t,e)=>(s[e]||(t[e]=i[e]),t)),{}):i}),((t,e,n,r)=>[t.entities.config,t.entities.records?.[e]?.[n]?.edits?.[r]]));function B(t,e,n,r){return(0,m.A)(e,n,"hasEditsForEntityRecord"),q(t,e,n,r)||Object.keys(V(t,e,n,r)).length>0}const $=(0,r.createSelector)(((t,e,n,r)=>{(0,m.A)(e,n,"getEditedEntityRecord");const s=x(t,e,n,r),i=j(t,e,n,r);return!(!s&&!i)&&{...s,...i}}),((t,e,n,r,s)=>{const i=s?.context??"default";return[t.entities.config,t.entities.records?.[e]?.[n]?.queriedData.items[i]?.[r],t.entities.records?.[e]?.[n]?.queriedData.itemIsComplete[i]?.[r],t.entities.records?.[e]?.[n]?.edits?.[r]]}));function F(t,e,n,r){(0,m.A)(e,n,"isAutosavingEntityRecord");const{pending:s,isAutosave:i}=t.entities.records?.[e]?.[n]?.saving?.[r]??{};return Boolean(s&&i)}function q(t,e,n,r){return(0,m.A)(e,n,"isSavingEntityRecord"),t.entities.records?.[e]?.[n]?.saving?.[r]?.pending??!1}function G(t,e,n,r){return(0,m.A)(e,n,"isDeletingEntityRecord"),t.entities.records?.[e]?.[n]?.deleting?.[r]?.pending??!1}function Y(t,e,n,r){return(0,m.A)(e,n,"getLastEntitySaveError"),t.entities.records?.[e]?.[n]?.saving?.[r]?.error}function z(t,e,n,r){return(0,m.A)(e,n,"getLastEntityDeleteError"),t.entities.records?.[e]?.[n]?.deleting?.[r]?.error}function W(t){o()("select( 'core' ).getUndoEdit()",{since:"6.3"})}function K(t){o()("select( 'core' ).getRedoEdit()",{since:"6.3"})}function H(t){return t.undoManager.hasUndo()}function Q(t){return t.undoManager.hasRedo()}function J(t){return t.currentTheme?I(t,"root","theme",t.currentTheme):null}function X(t){return t.currentGlobalStylesId}function Z(t){return J(t)?.theme_supports??_}function tt(t,e){return t.embedPreviews[e]}function et(t,e){const n=t.embedPreviews[e],r='<a href="'+e+'">'+e+"</a>";return!!n&&n.html===r}function nt(t,e,n,r){const s="object"==typeof n;if(s&&(!n.kind||!n.name))return!1;s&&(0,m.A)(n.kind,n.name,"canUser");const i=(0,E.kC)(e,n,r);return t.userPermissions[i]}function rt(t,e,n,r){return o()("wp.data.select( 'core' ).canUserEditEntityRecord()",{since:"6.7",alternative:"wp.data.select( 'core' ).canUser( 'update', { kind, name, id } )"}),nt(t,"update",{kind:e,name:n,id:r})}function st(t,e,n){return t.autosaves[n]}function it(t,e,n,r){if(void 0===r)return;const s=t.autosaves[n];return s?.find((t=>t.author===r))}const ot=(0,r.createRegistrySelector)((t=>(e,n,r)=>t(c.E).hasFinishedResolution("getAutosaves",[n,r])));function ct(t){return t.editsReference}function at(t){const e=J(t);return e?t.themeBaseGlobalStyles[e.stylesheet]:null}function lt(t){const e=J(t);return e?t.themeGlobalStyleVariations[e.stylesheet]:null}function ut(t){return t.blockPatterns}function dt(t){return t.blockPatternCategories}function ht(t){return t.userPatternCategories}function gt(t){o()("select( 'core' ).getCurrentThemeGlobalStylesRevisions()",{since:"6.5.0",alternative:"select( 'core' ).getRevisions( 'root', 'globalStyles', ${ recordKey } )"});const e=X(t);return e?t.themeGlobalStyleRevisions[e]:null}function ft(t,e){return t.defaultTemplates[JSON.stringify(e)]}const pt=(t,e,n,r,s)=>{(0,m.A)(e,n,"getRevisions");const i=t.entities.records?.[e]?.[n]?.revisions?.[r];return i?g(i,s):null},yt=(0,r.createSelector)(((t,e,n,r,s,i)=>{(0,m.A)(e,n,"getRevision");const o=t.entities.records?.[e]?.[n]?.revisions?.[r];if(!o)return;const c=i?.context??"default";if(!i||!i._fields){if(!o.itemIsComplete[c]?.[s])return;return o.items[c][s]}const a=o.items[c]?.[s];if(!a)return a;const l={},u=(0,y.A)(i._fields)??[];for(let t=0;t<u.length;t++){const e=u[t].split(".");let n=a;e.forEach((t=>{n=n?.[t]})),(0,d.A)(l,e,n)}return l}),((t,e,n,r,s,i)=>{const o=i?.context??"default",c=t.entities.records?.[e]?.[n]?.revisions?.[r];return[c?.items?.[o]?.[s],c?.itemIsComplete?.[o]?.[s]]}))},8537:t=>{"use strict";t.exports=window.wp.htmlEntities},8582:(t,e,n)=>{"use strict";n.d(e,{A:()=>{},B:()=>{}})},8741:(t,e,n)=>{"use strict";n.r(e),n.d(e,{getBlockPatternsForPostType:()=>u,getEntityRecordPermissions:()=>h,getEntityRecordsPermissions:()=>d,getHomePage:()=>p,getNavigationFallbackId:()=>l,getPostsPageId:()=>y,getRegisteredPostMeta:()=>g,getTemplateId:()=>E,getUndoManager:()=>a});var r=n(7143),s=n(8368),i=n(2278),o=n(6378),c=n(9410);function a(t){return t.undoManager}function l(t){return t.navigationFallbackId}const u=(0,r.createRegistrySelector)((t=>(0,r.createSelector)(((e,n)=>t(i.E).getBlockPatterns().filter((({postTypes:t})=>!t||Array.isArray(t)&&t.includes(n)))),(()=>[t(i.E).getBlockPatterns()])))),d=(0,r.createRegistrySelector)((t=>(0,r.createSelector)(((e,n,r,s)=>(Array.isArray(s)?s:[s]).map((e=>({delete:t(i.E).canUser("delete",{kind:n,name:r,id:e}),update:t(i.E).canUser("update",{kind:n,name:r,id:e})})))),(t=>[t.userPermissions]))));function h(t,e,n,r){return(0,c.A)(e,n,"getEntityRecordPermissions"),d(t,e,n,r)[0]}function g(t,e){return t.registeredPostMeta?.[e]??{}}function f(t){return t&&["number","string"].includes(typeof t)?0===Number(t)?null:t.toString():null}const p=(0,r.createRegistrySelector)((t=>(0,r.createSelector)((()=>{const e=t(i.E).getEntityRecord("root","__unstableBase");if(!e)return null;const n="page"===e?.show_on_front?f(e.page_on_front):null;if(n)return{postType:"page",postId:n};const r=t(i.E).getDefaultTemplateId({slug:"front-page"});return r?{postType:"wp_template",postId:r}:null}),(t=>[(0,s.getEntityRecord)(t,"root","site"),(0,s.getEntityRecord)(t,"root","__unstableBase"),(0,s.getDefaultTemplateId)(t,{slug:"front-page"})])))),y=(0,r.createRegistrySelector)((t=>()=>{const e=t(i.E).getEntityRecord("root","__unstableBase");return"page"===e?.show_on_front?f(e.page_for_posts):null})),E=(0,r.createRegistrySelector)((t=>(e,n,r)=>{const s=(0,o.T)(t(i.E)).getHomePage();if(!s)return;if("page"===n&&n===s?.postType&&r.toString()===s?.postId){const e=t(i.E).getEntityRecords("postType","wp_template",{per_page:-1});if(!e)return;const n=e.find((({slug:t})=>"front-page"===t))?.id;if(n)return n}const c=t(i.E).getEditedEntityRecord("postType",n,r);if(!c)return;const a=(0,o.T)(t(i.E)).getPostsPageId();if("page"===n&&a===r.toString())return t(i.E).getDefaultTemplateId({slug:"home"});const l=c.template;if(l){const e=t(i.E).getEntityRecords("postType","wp_template",{per_page:-1});if(!e)return;const n=e.find((({slug:t})=>t===l));if(n)return n.id;const r=t(i.E).getEntityRecords("postType","wp_registered_template",{per_page:-1});if(!r)return;const s=r.find((({slug:t})=>t===l));if(s)return s.id}let u;return u=c.slug?"page"===n?`${n}-${c.slug}`:`single-${n}-${c.slug}`:"page"===n?"page":`single-${n}`,t(i.E).getDefaultTemplateId({slug:u})}))},8843:(t,e,n)=>{"use strict";n.d(e,{D:()=>s});var r=n(6087);const s=(0,r.createContext)({});s.displayName="EntityContext"},9410:(t,e,n)=>{"use strict";n.d(e,{A:()=>c});var r=n(4040),s=n.n(r),i=n(4767);let o=!1;function c(t,e,n,{alternativeFunctionName:r,isShorthandSelector:c=!1}={}){const a=i.TK[t]?.[e];if(a){if(!o){const{alternative:i}=a,o=c?`'${n}'`:`The '${t}', '${e}' entity (used via '${n}')`;let l=`the '${i.kind}', '${i.name}' entity`;r&&(l+=` via the '${r}' function`),s()(o,{...a,alternative:l})}o=!0,setTimeout((()=>{o=!1}),0)}}},9424:(t,e,n)=>{"use strict";n.r(e),n.d(e,{editMediaEntity:()=>c,receiveRegisteredPostMeta:()=>o});var r=n(1455),s=n.n(r),i=n(2278);function o(t,e){return{type:"RECEIVE_REGISTERED_POST_META",postType:t,registeredPostMeta:e}}const c=(t,e={},{__unstableFetch:n=s(),throwOnError:r=!1}={})=>async({dispatch:s,resolveSelect:o})=>{if(!t)return;const c="postType",a="attachment",l=(await o.getEntitiesConfig(c)).find((t=>t.kind===c&&t.name===a));if(!l)return;const u=await s.__unstableAcquireStoreLock(i.E,["entities","records",c,a,t],{exclusive:!0});let d,h,g=!1;try{s({type:"SAVE_ENTITY_RECORD_START",kind:c,name:a,recordId:t});try{const r=`${l.baseURL}/${t}/edit`,i=await n({path:r,method:"POST",data:{...e}});i&&(s.receiveEntityRecords(c,a,[i],void 0,!0,void 0,void 0),d=i)}catch(t){h=t,g=!0}if(s({type:"SAVE_ENTITY_RECORD_FINISH",kind:c,name:a,recordId:t,error:h}),g&&r)throw h;return d}finally{s.__unstableReleaseStoreLock(u)}}}},e={};function n(r){var s=e[r];if(void 0!==s)return s.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r=n(4565);(window.wp=window.wp||{}).coreData=r})();

No other release has this exact content. See every version of this file.