From a9845767f32b92ce2465067ae8ac2b39d8eed6bf Mon Sep 17 00:00:00 2001 From: Alex Cicovic <23142906+acicovic@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:07:04 +0200 Subject: [PATCH] Fix erroneous return value --- build/content-helper/dashboard-page.asset.php | 2 +- build/content-helper/dashboard-page.js | 2 +- .../dashboard-page/pages/dashboard/page-component.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/content-helper/dashboard-page.asset.php b/build/content-helper/dashboard-page.asset.php index 002971a57..ca0d7efbe 100644 --- a/build/content-helper/dashboard-page.asset.php +++ b/build/content-helper/dashboard-page.asset.php @@ -1 +1 @@ - array('react', 'react-dom', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '5c06e018ad4ed7b787e4'); + array('react', 'react-dom', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '801d6f5bef2f27842da3'); diff --git a/build/content-helper/dashboard-page.js b/build/content-helper/dashboard-page.js index cb80fcfcd..909bda539 100644 --- a/build/content-helper/dashboard-page.js +++ b/build/content-helper/dashboard-page.js @@ -1 +1 @@ -!function(){"use strict";var e={20:function(e,t,r){var n=r(609),a=Symbol.for("react.element"),o=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,r){var n,o={},u=null,c=null;for(n in void 0!==r&&(u=""+r),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(c=t.ref),t)i.call(t,n)&&!s.hasOwnProperty(n)&&(o[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===o[n]&&(o[n]=t[n]);return{$$typeof:a,type:e,key:u,ref:c,props:o,_owner:l.current}}t.Fragment=o,t.jsx=u,t.jsxs=u},848:function(e,t,r){e.exports=r(20)},609:function(e){e.exports=window.React}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e,t=r(848),n=r(609),a=window.ReactDOM;function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}var h;function f(e,t,r){return void 0===r&&(r="/"),function(e,t,r,n){let a=C(("string"==typeof t?d(t):t).pathname||"/",r);if(null==a)return null;let o=v(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every(((e,r)=>e===t[r]))?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let i=null;for(let e=0;null==i&&e{let i={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};i.relativePath.startsWith("/")&&(l(i.relativePath.startsWith(n),'Absolute route path "'+i.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(n.length));let s=O([n,i.relativePath]),u=r.concat(i);e.children&&e.children.length>0&&(l(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),v(e.children,t,u,s)),(null!=e.path||e.index)&&t.push({path:s,score:P(s,e.index),routesMeta:u})};return e.forEach(((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let r of m(e.path))a(e,t,r);else a(e,t)})),t}function m(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(0===n.length)return a?[o,""]:[o];let i=m(n.join("/")),l=[];return l.push(...i.map((e=>""===e?o:[o,e].join("/")))),a&&l.push(...i),l.map((t=>e.startsWith("/")&&""===t?"/":t))}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(h||(h={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const g=/^:[\w-]+$/,y=3,w=2,S=1,x=10,b=-2,E=e=>"*"===e;function P(e,t){let r=e.split("/"),n=r.length;return r.some(E)&&(n+=b),t&&(n+=w),r.filter((e=>!E(e))).reduce(((e,t)=>e+(g.test(t)?y:""===t?S:x)),n)}function _(e,t,r){void 0===r&&(r=!1);let{routesMeta:n}=e,a={},o="/",i=[];for(let e=0;e(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)")));return e.endsWith("*")?(n.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce(((e,t,r)=>{let{paramName:n,isOptional:a}=t;if("*"===n){let e=l[r]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const s=l[r];return e[n]=a&&!s?void 0:(s||"").replace(/%2F/g,"/"),e}),{}),pathname:o,pathnameBase:i,pattern:e}}function j(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return s(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function C(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}const O=e=>e.join("/").replace(/\/\/+/g,"/"),T=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/");Error;const U=["post","put","patch","delete"],F=(new Set(U),["get",...U]);function L(){return L=Object.assign?Object.assign.bind():function(e){for(var t=1;t0))return null;e=r.matches}}let s=e,u=null==(o=r)?void 0:o.errors;if(null!=u){let e=s.findIndex((e=>e.route.id&&void 0!==(null==u?void 0:u[e.route.id])));e>=0||l(!1),s=s.slice(0,Math.min(s.length,e+1))}let c=!1,p=-1;if(r&&a&&a.v7_partialHydration)for(let e=0;e=0?s.slice(0,p+1):[s[0]];break}}}return s.reduceRight(((e,a,o)=>{let i,l=!1,d=null,h=null;var f;r&&(i=u&&a.route.id?u[a.route.id]:void 0,d=a.route.errorElement||z,c&&(p<0&&0===o?(G[f="route-fallback"]||(G[f]=!0),l=!0,h=null):p===o&&(l=!0,h=a.route.hydrateFallbackElement||null)));let v=t.concat(s.slice(0,o+1)),m=()=>{let t;return t=i?d:l?h:a.route.Component?n.createElement(a.route.Component,null):a.route.element?a.route.element:e,n.createElement(V,{match:a,routeContext:{outlet:e,matches:v,isDataRoute:null!=r},children:t})};return r&&(a.route.ErrorBoundary||a.route.errorElement||0===o)?n.createElement(J,{location:r.location,revalidation:r.revalidation,component:d,error:i,children:m(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):m()}),null)}(w&&w.map((e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:O([p,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?p:O([p,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),s,a,o);return r&&S?n.createElement(I.Provider,{value:{location:L({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:e.Pop}},S):S}function H(){let e=function(){var e;let t=n.useContext(M),r=function(){let e=n.useContext(N);return e||l(!1),e}(q.UseRouteError),a=function(){let e=function(){let e=n.useContext(A);return e||l(!1),e}(),t=e.matches[e.matches.length-1];return t.route.id||l(!1),t.route.id}(q.UseRouteError);return void 0!==t?t:null==(e=r.errors)?void 0:e[a]}(),t=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return n.createElement(n.Fragment,null,n.createElement("h2",null,"Unexpected Application Error!"),n.createElement("h3",{style:{fontStyle:"italic"}},t),r?n.createElement("pre",{style:a},r):null,null)}const z=n.createElement(H,null);class J extends n.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?n.createElement(A.Provider,{value:this.props.routeContext},n.createElement(M.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function V(e){let{routeContext:t,match:r,children:a}=e,o=n.useContext(k);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),n.createElement(A.Provider,{value:t},a)}var q=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(q||{});const G={},Y={},K=(e,t,r)=>{var n;Y[n="⚠️ React Router Future Flag Warning: "+t+". You can use the `"+e+"` future flag to opt-in early. For more information, see "+r+"."]||(Y[n]=!0,console.warn(n))};function Q(e){l(!1)}function X(t){let{basename:r="/",children:a=null,location:o,navigationType:i=e.Pop,navigator:s,static:u=!1,future:c}=t;D()&&l(!1);let p=r.replace(/^\/*/,"/"),h=n.useMemo((()=>({basename:p,navigator:s,static:u,future:L({v7_relativeSplatPath:!1},c)})),[p,c,s,u]);"string"==typeof o&&(o=d(o));let{pathname:f="/",search:v="",hash:m="",state:g=null,key:y="default"}=o,w=n.useMemo((()=>{let e=C(f,p);return null==e?null:{location:{pathname:e,search:v,hash:m,state:g,key:y},navigationType:i}}),[p,f,v,m,g,y,i]);return null==w?null:n.createElement(B.Provider,{value:h},n.createElement(I.Provider,{children:a,value:w}))}function Z(e){let{children:t,location:r}=e;return W(ee(t),r)}function ee(e,t){void 0===t&&(t=[]);let r=[];return n.Children.forEach(e,((e,a)=>{if(!n.isValidElement(e))return;let o=[...t,a];if(e.type===n.Fragment)return void r.push.apply(r,ee(e.props.children,o));e.type!==Q&&l(!1),e.props.index&&e.props.children&&l(!1);let i={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(i.children=ee(e.props.children,o)),r.push(i)})),r}n.startTransition,new Promise((()=>{})),n.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);try{window.__reactRouterVersion="6"}catch(e){}new Map;const te=n.startTransition;function re(t){let{basename:r,children:a,future:h,window:f}=t,v=n.useRef();var m;null==v.current&&(v.current=(void 0===(m={window:f,v5Compat:!0})&&(m={}),function(t,r,n,a){void 0===a&&(a={});let{window:s=document.defaultView,v5Compat:d=!1}=a,h=s.history,f=e.Pop,v=null,m=g();function g(){return(h.state||{idx:null}).idx}function y(){f=e.Pop;let t=g(),r=null==t?null:t-m;m=t,v&&v({action:f,location:S.location,delta:r})}function w(e){let t="null"!==s.location.origin?s.location.origin:s.location.href,r="string"==typeof e?e:p(e);return r=r.replace(/ $/,"%20"),l(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==m&&(m=0,h.replaceState(o({},h.state,{idx:m}),""));let S={get action(){return f},get location(){return t(s,h)},listen(e){if(v)throw new Error("A history only accepts one active listener");return s.addEventListener(i,y),v=e,()=>{s.removeEventListener(i,y),v=null}},createHref(e){return r(s,e)},createURL:w,encodeLocation(e){let t=w(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(t,r){f=e.Push;let a=c(S.location,t,r);n&&n(a,t),m=g()+1;let o=u(a,m),i=S.createHref(a);try{h.pushState(o,"",i)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;s.location.assign(i)}d&&v&&v({action:f,location:S.location,delta:1})},replace:function(t,r){f=e.Replace;let a=c(S.location,t,r);n&&n(a,t),m=g();let o=u(a,m),i=S.createHref(a);h.replaceState(o,"",i),d&&v&&v({action:f,location:S.location,delta:0})},go(e){return h.go(e)}};return S}((function(e,t){let{pathname:r="/",search:n="",hash:a=""}=d(e.location.hash.substr(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),c("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let r=e.document.querySelector("base"),n="";if(r&&r.getAttribute("href")){let t=e.location.href,r=t.indexOf("#");n=-1===r?t:t.slice(0,r)}return n+"#"+("string"==typeof t?t:p(t))}),(function(e,t){s("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),m)));let g=v.current,[y,w]=n.useState({action:g.action,location:g.location}),{v7_startTransition:S}=h||{},x=n.useCallback((e=>{S&&te?te((()=>w(e))):w(e)}),[w,S]);return n.useLayoutEffect((()=>g.listen(x)),[g,x]),n.useEffect((()=>{return null!=(e=h)&&e.v7_startTransition||K("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),null!=e&&e.v7_relativeSplatPath||t&&t.v7_relativeSplatPath||K("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath"),void(t&&(t.v7_fetcherPersist||K("v7_fetcherPersist","The persistence behavior of fetchers is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"),t.v7_normalizeFormMethod||K("v7_normalizeFormMethod","Casing of `formMethod` fields is being normalized to uppercase in v7","https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"),t.v7_partialHydration||K("v7_partialHydration","`RouterProvider` hydration behavior is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_partialhydration"),t.v7_skipActionErrorRevalidation||K("v7_skipActionErrorRevalidation","The revalidation behavior after 4xx/5xx `action` responses is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation")));var e,t}),[h]),n.createElement(X,{basename:r,children:a,location:y.location,navigationType:y.action,navigator:g,future:h})}var ne,ae,oe;a.flushSync,n.useId,"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement,(oe=ne||(ne={})).UseScrollRestoration="useScrollRestoration",oe.UseSubmit="useSubmit",oe.UseSubmitFetcher="useSubmitFetcher",oe.UseFetcher="useFetcher",oe.useViewTransitionState="useViewTransitionState",function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(ae||(ae={}));var ie=window.wp.domReady,le=r.n(ie),se=window.wp.element,ue=window.wp.data,ce=function(){return ce=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}var h;function f(e,t,r){return void 0===r&&(r="/"),function(e,t,r,n){let a=C(("string"==typeof t?d(t):t).pathname||"/",r);if(null==a)return null;let o=v(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every(((e,r)=>e===t[r]))?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let i=null;for(let e=0;null==i&&e{let i={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};i.relativePath.startsWith("/")&&(l(i.relativePath.startsWith(n),'Absolute route path "'+i.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(n.length));let s=O([n,i.relativePath]),u=r.concat(i);e.children&&e.children.length>0&&(l(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),v(e.children,t,u,s)),(null!=e.path||e.index)&&t.push({path:s,score:P(s,e.index),routesMeta:u})};return e.forEach(((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let r of m(e.path))a(e,t,r);else a(e,t)})),t}function m(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(0===n.length)return a?[o,""]:[o];let i=m(n.join("/")),l=[];return l.push(...i.map((e=>""===e?o:[o,e].join("/")))),a&&l.push(...i),l.map((t=>e.startsWith("/")&&""===t?"/":t))}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(h||(h={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const g=/^:[\w-]+$/,y=3,w=2,S=1,x=10,b=-2,E=e=>"*"===e;function P(e,t){let r=e.split("/"),n=r.length;return r.some(E)&&(n+=b),t&&(n+=w),r.filter((e=>!E(e))).reduce(((e,t)=>e+(g.test(t)?y:""===t?S:x)),n)}function _(e,t,r){void 0===r&&(r=!1);let{routesMeta:n}=e,a={},o="/",i=[];for(let e=0;e(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)")));return e.endsWith("*")?(n.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce(((e,t,r)=>{let{paramName:n,isOptional:a}=t;if("*"===n){let e=l[r]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const s=l[r];return e[n]=a&&!s?void 0:(s||"").replace(/%2F/g,"/"),e}),{}),pathname:o,pathnameBase:i,pattern:e}}function j(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return s(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function C(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}const O=e=>e.join("/").replace(/\/\/+/g,"/"),T=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/");Error;const U=["post","put","patch","delete"],F=(new Set(U),["get",...U]);function L(){return L=Object.assign?Object.assign.bind():function(e){for(var t=1;t0))return null;e=r.matches}}let s=e,u=null==(o=r)?void 0:o.errors;if(null!=u){let e=s.findIndex((e=>e.route.id&&void 0!==(null==u?void 0:u[e.route.id])));e>=0||l(!1),s=s.slice(0,Math.min(s.length,e+1))}let c=!1,p=-1;if(r&&a&&a.v7_partialHydration)for(let e=0;e=0?s.slice(0,p+1):[s[0]];break}}}return s.reduceRight(((e,a,o)=>{let i,l=!1,d=null,h=null;var f;r&&(i=u&&a.route.id?u[a.route.id]:void 0,d=a.route.errorElement||z,c&&(p<0&&0===o?(G[f="route-fallback"]||(G[f]=!0),l=!0,h=null):p===o&&(l=!0,h=a.route.hydrateFallbackElement||null)));let v=t.concat(s.slice(0,o+1)),m=()=>{let t;return t=i?d:l?h:a.route.Component?n.createElement(a.route.Component,null):a.route.element?a.route.element:e,n.createElement(V,{match:a,routeContext:{outlet:e,matches:v,isDataRoute:null!=r},children:t})};return r&&(a.route.ErrorBoundary||a.route.errorElement||0===o)?n.createElement(J,{location:r.location,revalidation:r.revalidation,component:d,error:i,children:m(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):m()}),null)}(w&&w.map((e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:O([p,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?p:O([p,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),s,a,o);return r&&S?n.createElement(I.Provider,{value:{location:L({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:e.Pop}},S):S}function H(){let e=function(){var e;let t=n.useContext(M),r=function(){let e=n.useContext(N);return e||l(!1),e}(q.UseRouteError),a=function(){let e=function(){let e=n.useContext(A);return e||l(!1),e}(),t=e.matches[e.matches.length-1];return t.route.id||l(!1),t.route.id}(q.UseRouteError);return void 0!==t?t:null==(e=r.errors)?void 0:e[a]}(),t=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return n.createElement(n.Fragment,null,n.createElement("h2",null,"Unexpected Application Error!"),n.createElement("h3",{style:{fontStyle:"italic"}},t),r?n.createElement("pre",{style:a},r):null,null)}const z=n.createElement(H,null);class J extends n.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?n.createElement(A.Provider,{value:this.props.routeContext},n.createElement(M.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function V(e){let{routeContext:t,match:r,children:a}=e,o=n.useContext(k);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),n.createElement(A.Provider,{value:t},a)}var q=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(q||{});const G={},Y={},K=(e,t,r)=>{var n;Y[n="⚠️ React Router Future Flag Warning: "+t+". You can use the `"+e+"` future flag to opt-in early. For more information, see "+r+"."]||(Y[n]=!0,console.warn(n))};function Q(e){l(!1)}function X(t){let{basename:r="/",children:a=null,location:o,navigationType:i=e.Pop,navigator:s,static:u=!1,future:c}=t;D()&&l(!1);let p=r.replace(/^\/*/,"/"),h=n.useMemo((()=>({basename:p,navigator:s,static:u,future:L({v7_relativeSplatPath:!1},c)})),[p,c,s,u]);"string"==typeof o&&(o=d(o));let{pathname:f="/",search:v="",hash:m="",state:g=null,key:y="default"}=o,w=n.useMemo((()=>{let e=C(f,p);return null==e?null:{location:{pathname:e,search:v,hash:m,state:g,key:y},navigationType:i}}),[p,f,v,m,g,y,i]);return null==w?null:n.createElement(B.Provider,{value:h},n.createElement(I.Provider,{children:a,value:w}))}function Z(e){let{children:t,location:r}=e;return W(ee(t),r)}function ee(e,t){void 0===t&&(t=[]);let r=[];return n.Children.forEach(e,((e,a)=>{if(!n.isValidElement(e))return;let o=[...t,a];if(e.type===n.Fragment)return void r.push.apply(r,ee(e.props.children,o));e.type!==Q&&l(!1),e.props.index&&e.props.children&&l(!1);let i={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(i.children=ee(e.props.children,o)),r.push(i)})),r}n.startTransition,new Promise((()=>{})),n.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);try{window.__reactRouterVersion="6"}catch(e){}new Map;const te=n.startTransition;function re(t){let{basename:r,children:a,future:h,window:f}=t,v=n.useRef();var m;null==v.current&&(v.current=(void 0===(m={window:f,v5Compat:!0})&&(m={}),function(t,r,n,a){void 0===a&&(a={});let{window:s=document.defaultView,v5Compat:d=!1}=a,h=s.history,f=e.Pop,v=null,m=g();function g(){return(h.state||{idx:null}).idx}function y(){f=e.Pop;let t=g(),r=null==t?null:t-m;m=t,v&&v({action:f,location:S.location,delta:r})}function w(e){let t="null"!==s.location.origin?s.location.origin:s.location.href,r="string"==typeof e?e:p(e);return r=r.replace(/ $/,"%20"),l(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==m&&(m=0,h.replaceState(o({},h.state,{idx:m}),""));let S={get action(){return f},get location(){return t(s,h)},listen(e){if(v)throw new Error("A history only accepts one active listener");return s.addEventListener(i,y),v=e,()=>{s.removeEventListener(i,y),v=null}},createHref(e){return r(s,e)},createURL:w,encodeLocation(e){let t=w(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(t,r){f=e.Push;let a=c(S.location,t,r);n&&n(a,t),m=g()+1;let o=u(a,m),i=S.createHref(a);try{h.pushState(o,"",i)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;s.location.assign(i)}d&&v&&v({action:f,location:S.location,delta:1})},replace:function(t,r){f=e.Replace;let a=c(S.location,t,r);n&&n(a,t),m=g();let o=u(a,m),i=S.createHref(a);h.replaceState(o,"",i),d&&v&&v({action:f,location:S.location,delta:0})},go(e){return h.go(e)}};return S}((function(e,t){let{pathname:r="/",search:n="",hash:a=""}=d(e.location.hash.substr(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),c("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let r=e.document.querySelector("base"),n="";if(r&&r.getAttribute("href")){let t=e.location.href,r=t.indexOf("#");n=-1===r?t:t.slice(0,r)}return n+"#"+("string"==typeof t?t:p(t))}),(function(e,t){s("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),m)));let g=v.current,[y,w]=n.useState({action:g.action,location:g.location}),{v7_startTransition:S}=h||{},x=n.useCallback((e=>{S&&te?te((()=>w(e))):w(e)}),[w,S]);return n.useLayoutEffect((()=>g.listen(x)),[g,x]),n.useEffect((()=>{return null!=(e=h)&&e.v7_startTransition||K("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),null!=e&&e.v7_relativeSplatPath||t&&t.v7_relativeSplatPath||K("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath"),void(t&&(t.v7_fetcherPersist||K("v7_fetcherPersist","The persistence behavior of fetchers is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"),t.v7_normalizeFormMethod||K("v7_normalizeFormMethod","Casing of `formMethod` fields is being normalized to uppercase in v7","https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"),t.v7_partialHydration||K("v7_partialHydration","`RouterProvider` hydration behavior is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_partialhydration"),t.v7_skipActionErrorRevalidation||K("v7_skipActionErrorRevalidation","The revalidation behavior after 4xx/5xx `action` responses is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation")));var e,t}),[h]),n.createElement(X,{basename:r,children:a,location:y.location,navigationType:y.action,navigator:g,future:h})}var ne,ae,oe;a.flushSync,n.useId,"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement,(oe=ne||(ne={})).UseScrollRestoration="useScrollRestoration",oe.UseSubmit="useSubmit",oe.UseSubmitFetcher="useSubmitFetcher",oe.UseFetcher="useFetcher",oe.useViewTransitionState="useViewTransitionState",function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(ae||(ae={}));var ie=window.wp.domReady,le=r.n(ie),se=window.wp.element,ue=window.wp.data,ce=function(){return ce=Object.assign||function(e){for(var t,r=1,n=arguments.length;r { mergedSettings.Setting1 = defaultSettings.Setting1; } - return parsedSettings; + return mergedSettings; }; /**