(()=>{"use strict";var e,t={201(e,t,n){n.d(t,{A:()=>i});var a=n(4467);function i(e){for(var t=1;ti});var a=n(7800);function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,i,r,o,s=[],l=!0,c=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(a=r.call(n)).done)&&(s.push(a.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(e,t)||(0,a.A)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},816(e,t,n){n.d(t,{A:()=>i});var a=n(2284);function i(e){var t=function(e){if("object"!=(0,a.A)(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=(0,a.A)(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==(0,a.A)(t)?t:t+""}},857(e,t,n){n.d(t,{Gh:()=>C,KR:()=>_,T:()=>g,getPosts:()=>m,gy:()=>x,iK:()=>h,kn:()=>p});var a,i=n(1455),r=n.n(i),o=n(7143),s=n(8158);function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function c(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n0&&e.forEach(function(e){var t={};Object.keys(e).forEach(function(n){t[n]=e[n]}),a=[].concat(c(a),[t])}),a},function(e){console.log("error",e)})},p=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=[],n="per_page=5";return e&&e.length>2&&(n="search=".concat(e,"&per_page=10")),r()({path:"/wp/v2/users?".concat(n)}).then(function(e){return null!=e&&e.length>0&&e.forEach(function(e){var n={},a=["id","link","name","slug"];Object.keys(e).forEach(function(t){a.includes(t)&&(n[t]=e[t])}),t=[].concat(c(t),[n])}),t},function(e){console.log("error",e)})},g=function(e){var t=e.source?e.source:"post",n="taxonomies_".concat(t),a=d(n);return a?Promise.resolve(a):r()({path:"/wp/v2/types/".concat(t,"?context=edit")}).then(function(e){var a=e.taxonomies||[];if(0===a.length)return[];var i=a.map(function(e){return r()({path:"/wp/v2/taxonomies/".concat(e)}).then(function(e){return{name:e.name,slug:e.slug,rest_base:e.rest_base,rest_namespace:e.rest_namespace||"wp/v2",types:e.types||[t]}}).catch(function(t){return console.warn("Failed to load taxonomy ".concat(e,":"),t),null})});return Promise.all(i).then(function(e){var t=e.filter(function(e){return null!==e});return y(n,t),t})},function(n){return console.warn("Failed to get post type data for ".concat(t,", falling back to legacy method:"),n),v(e)})},v=function(e){var t=e.source?e.source:"post",n="taxonomies_fallback_".concat(t),a=d(n);return a?Promise.resolve(a):r()({path:"/wp/v2/taxonomies?type=".concat(t,"&per_page=-1")}).then(function(e){var a=[];return null!=e&&Object.keys(e).length>0&&Object.keys(e).forEach(function(n){var i=e[n];i.types&&Array.isArray(i.types)&&i.types.includes(t)&&a.push({name:i.name,slug:i.slug,rest_base:i.rest_base,rest_namespace:i.rest_namespace||"wp/v2",types:i.types})}),y(n,a),a},function(e){return console.error("Fallback method also failed:",e),[]})},h=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[],a="per_page=5";t&&t.length>=2&&(a="search=".concat(t,"&per_page=10"));var i="taxonomy_terms_".concat(e,"_").concat(a);if(!t){var o=d(i);if(o)return Promise.resolve(o)}return r()({path:"/wp/v2/".concat(e,"?").concat(a)}).then(function(e){return null!=e&&Object.keys(e).length>0&&Object.keys(e).forEach(function(t){var a={};Object.keys(e[t]).forEach(function(n){"name"===n&&(a.label=e[t][n]),"id"===n&&(a.value=e[t][n])}),n.push(a)}),t||y(i,n),n},function(e){console.log("error",e)})},x=function(e){var t=e.rest_namespace?e.rest_namespace:"wp/v2",n=[];return r()({path:"/".concat(t,"/").concat(e.rest_base?e.rest_base:"posts","/?per_page=5")}).then(function(e){return null!=e&&e.length>0&&e.forEach(function(e){var t={},a=["id","title"];Object.keys(e).forEach(function(n){a.includes(n)&&(t[n]=e[n])}),n=[].concat(c(n),[t])}),n},function(e){console.log("error",e)})},_=function(e,t){var n=[],a=t.rest_namespace?t.rest_namespace:"wp/v2";return r()({path:"/".concat(a,"/search/?search=").concat(e,"&type=post&subtype=").concat(t.source?t.source:"post")}).then(function(e){return null!=e&&e.length>0&&e.forEach(function(e){var t={},a=["id","title"];Object.keys(e).forEach(function(n){a.includes(n)&&(t[n]=e[n])}),n=[].concat(c(n),[t])}),n},function(e){console.log("error",e)})},C=function(e){var t=j(e),n=e.rest_namespace?e.rest_namespace:"wp/v2";return r()({path:"/".concat(n,"/").concat(e.rest_base?e.rest_base:"posts","?").concat(t),parse:!1}).then(function(e){return e.headers.get("X-WP-Total")},function(e){console.log("error",e)})},j=function(e){var t={};return Object.keys(e).forEach(function(n){if(["source","sourceIndex","author","taxonomies","per_page","offset","orderby","order","include","exclude","category","tag","exclude_current","ignore_sticky_posts"].includes(n)){if("taxonomies"===n){var a=e[n];"object"===l(a)&&Object.keys(a).length>0&&Object.keys(a).map(function(e){if((0,s.VJ)(a[e].value)){var n=JSON.parse(a[e].value);if(n.length>0){var i=[];"object"===l(n)&&Object.keys(n).map(function(e){i.push(n[e].value)}),t[a[e].rest_base]=i.join(",")}}if((0,s.VJ)(a[e].exclude)){var r=JSON.parse(a[e].exclude);if(r.length>0){var o=[];"object"===l(r)&&Object.keys(r).map(function(e){o.push(r[e].value)}),t[a[e].rest_base+"_exclude"]=o.join(",")}}})}if(void 0!==e[n]&&null!==e[n]&&""!==e[n])if("number"==typeof e[n])t[n]=e[n];else if("string"==typeof e[n])if((0,s.VJ)(e[n])){var i=JSON.parse(e[n]),r=[];i.length>0&&(i.forEach(function(e){"object"===l(e)&&r.push(e.value)}),t[n]=r.join(","))}else"0"!==e[n]&&e[n].length>0&&(t[n]=e[n]);else"boolean"==typeof e[n]?t[n]=e[n]:Array.isArray(e[n])&&e[n].length>0&&(t[n]=e[n].join(","));if("exclude_current"===n&&e.exclude_current){var c,u=null===(c=(0,o.select)("core/editor"))||void 0===c?void 0:c.getCurrentPostId();if("number"==typeof u)if(t.exclude){var f=t.exclude.split(",");-1===f.indexOf(u.toString())&&f.push(u.toString()),t.exclude=f.join(",")}else t.exclude=u.toString()}"ignore_sticky_posts"===n&&e.ignore_sticky_posts&&(t.sticky=!e.ignore_sticky_posts)}}),Object.keys(t).map(function(e){return e+"="+t[e]}).join("&")}},1455(e){e.exports=window.wp.apiFetch},1609(e){e.exports=window.React},2279(e,t,n){function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,i,r,o,s=[],l=!0,c=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(a=r.call(n)).done)&&(s.push(a.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);no,p9:()=>s});var o={sanitize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";if(null==e)return null;var n=String(e).trim();if(!n)return"url"===t?null:"";switch(t){case"url":return this.sanitizeURL(n);case"attribute":return this.sanitizeAttribute(n);case"html":return this.sanitizeHTML(n);default:return this.sanitizeText(n)}},sanitizeURL:function(e){if(!e||"string"!=typeof e)return null;var t=e.replace(/javascript:/gi,"").replace(/data:/gi,"").replace(/vbscript:/gi,"").replace(/on\w+=/gi,"").replace(/