(()=>{"use strict";vare={d:(r,t)=>{for(varnint)e.o(t,n)&&!e.o(r,n)&&Object.defineProperty(r,n,{enumerable:!0,get:t[n]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r)},r={};e.d(r,{default:()=>b});constt=window.wp.i18n;varn=function(e){constr=(e,t)=>{const{headers:n={}}=e;for(constainn)if("x-wp-nonce"===a.toLowerCase()&&n[a]===r.nonce)returnt(e);returnt({...e,headers:{...n,"X-WP-Nonce":r.nonce}})};returnr.nonce=e,r};vara=(e,r)=>{lett,n,a=e.path;return"string"==typeofe.namespace&&"string"==typeofe.endpoint&&(t=e.namespace.replace(/^\/|\/$/g,""),n=e.endpoint.replace(/^\//,""),a=n?t+"/"+n:t),deletee.namespace,deletee.endpoint,r({...e,path:a})};varo=e=>(r,t)=>a(r,(r=>{letn,a=r.url,o=r.path;return"string"==typeofo&&(n=e,-1!==e.indexOf("?")&&(o=o.replace("?","&")),o=o.replace(/^\//,""),"string"==typeofn&&-1!==n.indexOf("?")&&(o=o.replace("?","&")),a=n+o),t({...r,url:a})}));consts=window.wp.url;functioni(e,r){if(r)returnPromise.resolve(e.body);try{returnPromise.resolve(newwindow.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}catch{returnObject.entries(e.headers).forEach((([r,t])=>{"link"===r.toLowerCase()&&(e.headers[r]=t.replace(/<([^>]+)>/,((e,r)=>`<${encodeURI(r)}>`)))})),Promise.resolve(r?e.body:newwindow.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}}varc=function(e){constr=Object.fromEntries(Object.entries(e).map((([e,r])=>[(0,s.normalizePath)(e),r])));return(e,t)=>{const{parse:n=!0}=e;leta=e.path;if(!a&&e.url){const{rest_route:r,...t}=(0,s.getQueryArgs)(e.url);"string"==typeofr&&(a=(0,s.addQueryArgs)(r,t))}if("string"!=typeofa)returnt(e);consto=e.method||"GET",c=(0,s.normalizePath)(a);if("GET"===o&&r[c]){conste=r[c];returndeleter[c],i(e,!!n)}if("OPTIONS"===o&&r[o]&&r[o][c]){conste=r[o][c];returndeleter[o][c],i(e,!!n)}returnt(e)}};constd=({path:e,url:r,...t},n)=>({...t,url:r&&(0,s.addQueryArgs)(r,n),path:e&&(0,s.addQueryArgs)(e,n)}),p=e=>e.json?e.json():Promise.reject(e),l=e=>{const{next:r}=(e=>{if(!e)return{};constr=e.match(/<([^>]+)>; rel="next"/);returnr?{next:r[1]}:{}})(e.headers.get("link"));returnr};varu=async(e,r)=>{if(!1===e.parse)returnr(e);if(!(e=>{constr=!!e.path&&-1!==e.path.indexOf("per_page=-1"),t=!!e.url&&-1!==e.url.indexOf("per_page=-1");returnr||t})(e))returnr(e);constt=awaitb({...d(e,{per_page:100}),parse:!1}),n=awaitp(t);if(!Array.isArray(n))returnn;leta=l(t);if(!a)returnn;leto=[].concat(n);for(;a;){constr=awaitb({...e,path:void0,url:a,parse:!1}),t=awaitp(r);o=o.concat(t),a=l(r)}returno};consth=newSet(["PATCH","PUT","DELETE"]),f="GET";asyncfunctionw(e){try{returnawaite.json()}catch{throw{code:"invalid_json",message:(0,t.__)("The response is not a valid JSON response.")}}}asyncfunctiong(e,r=!0){returnr?204===e.status?null:awaitw(e):e}asyncfunctionm(e,r=!0){if(!r)throwe;throwawaitw(e)}vary=(e,r)=>{if(!function(e){constr=!!e.method&&"POST"===e.method;return(!!e.path&&-1!==e.path.indexOf("/wp/v2/media")||!!e.url&&-1!==e.url.indexOf("/wp/v2/media"))&&r}(e))returnr(e);letn=0;consta=e=>(n++,r({path:`/wp/v2/media/${e}/post-process`,method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch((()=>n<5?a(e):(r({path:`/wp/v2/media/${e}?force=true`,method:"DELETE"}),Promise.reject()))));returnr({...e,parse:!1}).catch((r=>{if(!(rinstanceofglobalThis.Response))returnPromise.reject(r);constn=r.headers.get("x-wp-upload-attachment-id");returnr.status>=500&&r.status<600&&n?a(n).catch((()=>!1!==e.parse?Promise.reject({code:"post_process",message:(0,t.__)("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(r))):m(r,e.parse)})).then((r=>g(r,e.parse)))};varv=e=>(r,t)=>{if("string"==typeofr.url){constt=(0,s.getQueryArg)(r.url,"wp_theme_preview");void0===t?r.url=(0,s.addQueryArgs)(r.url,{wp_theme_preview:e}):""===t&&(r.url=(0,s.removeQueryArgs)(r.url,"wp_theme_preview"))}if("string"==typeofr.path){constt=(0,s.getQueryArg)(r.path,"wp_theme_preview");void0===t?r.path=(0,s.addQueryArgs)(r.pat