From 908f634b5799cc7b79142ef503eca9ab8874bea5 Mon Sep 17 00:00:00 2001 From: jaywcjlove Date: Mon, 13 Nov 2023 08:45:45 +0000 Subject: [PATCH] v2.0.2 released v2.0.1 (#128) e4bccb28afff41f7cd46c0bcdb709a5865e2031d --- asset-manifest.json | 6 +++--- coverage/lcov-report/color-alpha/src/Pointer.tsx.html | 2 +- coverage/lcov-report/color-alpha/src/index.html | 2 +- coverage/lcov-report/color-alpha/src/index.tsx.html | 2 +- coverage/lcov-report/color-block/src/index.html | 2 +- coverage/lcov-report/color-block/src/index.tsx.html | 2 +- coverage/lcov-report/color-chrome/src/Arrow.tsx.html | 2 +- coverage/lcov-report/color-chrome/src/index.html | 2 +- coverage/lcov-report/color-chrome/src/index.tsx.html | 2 +- coverage/lcov-report/color-circle/src/Point.tsx.html | 2 +- coverage/lcov-report/color-circle/src/index.html | 2 +- coverage/lcov-report/color-circle/src/index.tsx.html | 2 +- coverage/lcov-report/color-colorful/src/index.html | 2 +- coverage/lcov-report/color-colorful/src/index.tsx.html | 2 +- coverage/lcov-report/color-compact/src/index.html | 2 +- coverage/lcov-report/color-compact/src/index.tsx.html | 2 +- .../color-convert/src/getContrastingColor.ts.html | 2 +- coverage/lcov-report/color-convert/src/index.html | 2 +- coverage/lcov-report/color-convert/src/index.ts.html | 2 +- coverage/lcov-report/color-convert/src/utils.ts.html | 2 +- .../lcov-report/color-editable-input-hsla/src/index.html | 2 +- .../color-editable-input-hsla/src/index.tsx.html | 2 +- .../lcov-report/color-editable-input-rgba/src/index.html | 2 +- .../color-editable-input-rgba/src/index.tsx.html | 2 +- coverage/lcov-report/color-editable-input/src/index.html | 2 +- .../lcov-report/color-editable-input/src/index.tsx.html | 2 +- coverage/lcov-report/color-github/src/Point.tsx.html | 2 +- coverage/lcov-report/color-github/src/index.html | 2 +- coverage/lcov-report/color-github/src/index.tsx.html | 2 +- coverage/lcov-report/color-hue/src/index.html | 2 +- coverage/lcov-report/color-hue/src/index.tsx.html | 2 +- coverage/lcov-report/color-material/src/index.html | 2 +- coverage/lcov-report/color-material/src/index.tsx.html | 2 +- coverage/lcov-report/color-name/src/index.html | 2 +- coverage/lcov-report/color-name/src/index.tsx.html | 2 +- coverage/lcov-report/color-saturation/src/Pointer.tsx.html | 2 +- coverage/lcov-report/color-saturation/src/index.html | 2 +- coverage/lcov-report/color-saturation/src/index.tsx.html | 2 +- coverage/lcov-report/color-shade-slider/src/index.html | 2 +- coverage/lcov-report/color-shade-slider/src/index.tsx.html | 2 +- coverage/lcov-report/color-sketch/src/index.html | 2 +- coverage/lcov-report/color-sketch/src/index.tsx.html | 2 +- coverage/lcov-report/color-slider/src/index.html | 2 +- coverage/lcov-report/color-slider/src/index.tsx.html | 2 +- coverage/lcov-report/color-swatch/src/index.html | 2 +- coverage/lcov-report/color-swatch/src/index.tsx.html | 2 +- coverage/lcov-report/color-wheel/src/Pointer.tsx.html | 2 +- coverage/lcov-report/color-wheel/src/index.html | 2 +- coverage/lcov-report/color-wheel/src/index.tsx.html | 2 +- coverage/lcov-report/color-wheel/src/utils.ts.html | 2 +- coverage/lcov-report/color/src/index.html | 2 +- coverage/lcov-report/color/src/index.tsx.html | 2 +- coverage/lcov-report/drag-event-interactive/src/index.html | 2 +- .../lcov-report/drag-event-interactive/src/index.tsx.html | 2 +- .../lcov-report/drag-event-interactive/src/utils.ts.html | 2 +- coverage/lcov-report/index.html | 2 +- index.html | 2 +- static/js/{main.98420307.js => main.b083e6eb.js} | 6 +++--- ...98420307.js.LICENSE.txt => main.b083e6eb.js.LICENSE.txt} | 0 static/js/{main.98420307.js.map => main.b083e6eb.js.map} | 2 +- 60 files changed, 63 insertions(+), 63 deletions(-) rename static/js/{main.98420307.js => main.b083e6eb.js} (99%) rename static/js/{main.98420307.js.LICENSE.txt => main.b083e6eb.js.LICENSE.txt} (100%) rename static/js/{main.98420307.js.map => main.b083e6eb.js.map} (99%) diff --git a/asset-manifest.json b/asset-manifest.json index 0866e1f81..8f9e3ad8a 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,7 +1,7 @@ { "files": { "main.css": "/static/css/main.6ef0c5a4.css", - "main.js": "/static/js/main.98420307.js", + "main.js": "/static/js/main.b083e6eb.js", "static/css/281.c7b2c18c.chunk.css": "/static/css/281.c7b2c18c.chunk.css", "static/js/281.7701c91b.chunk.js": "/static/js/281.7701c91b.chunk.js", "static/js/113.81fe9207.chunk.js": "/static/js/113.81fe9207.chunk.js", @@ -55,7 +55,7 @@ "index.html": "/index.html", "static/media/home.svg": "/static/media/home.7d51f25c64fe597ec540c3e724748f4e.svg", "main.6ef0c5a4.css.map": "/static/css/main.6ef0c5a4.css.map", - "main.98420307.js.map": "/static/js/main.98420307.js.map", + "main.b083e6eb.js.map": "/static/js/main.b083e6eb.js.map", "281.c7b2c18c.chunk.css.map": "/static/css/281.c7b2c18c.chunk.css.map", "281.7701c91b.chunk.js.map": "/static/js/281.7701c91b.chunk.js.map", "113.81fe9207.chunk.js.map": "/static/js/113.81fe9207.chunk.js.map", @@ -110,6 +110,6 @@ "entrypoints": [ "static/js/react-vendor.eefbee93.js", "static/css/main.6ef0c5a4.css", - "static/js/main.98420307.js" + "static/js/main.b083e6eb.js" ] } \ No newline at end of file diff --git a/coverage/lcov-report/color-alpha/src/Pointer.tsx.html b/coverage/lcov-report/color-alpha/src/Pointer.tsx.html index b1a70f743..a8e1a6189 100644 --- a/coverage/lcov-report/color-alpha/src/Pointer.tsx.html +++ b/coverage/lcov-report/color-alpha/src/Pointer.tsx.html @@ -163,7 +163,7 @@

All files / color-alpha/
\ No newline at end of file +Color picker component for React.
\ No newline at end of file diff --git a/static/js/main.98420307.js b/static/js/main.b083e6eb.js similarity index 99% rename from static/js/main.98420307.js rename to static/js/main.b083e6eb.js index 5a8072d0e..c9f843215 100644 --- a/static/js/main.98420307.js +++ b/static/js/main.b083e6eb.js @@ -1,3 +1,3 @@ -/*! For license information please see main.98420307.js.LICENSE.txt */ -(()=>{var e={7905:(e,t,r)=>{"use strict";r.d(t,{I6:()=>i,Of:()=>o,_y:()=>a});var n=r(8573);const o={hsva:{h:214,s:43,v:90,a:1}},a=n.createContext(o);function i(e,t){return{...e,...t}}},7261:(e,t,r)=>{"use strict";var n=r(8650),o=r(669),a=r(5773),i=r(808),s=r(8573),l=r.t(s,2);const c=document.createElement("template");c.innerHTML='\n\n\n';class u extends HTMLElement{static get observedAttributes(){return["style","z-index","target","height","width","href","color","fill","position","top","left","right","bottom","transform"]}constructor(){super(),this.right="0",this.shadow=this.attachShadow({mode:"open"}),this.shadow.appendChild(this.ownerDocument.importNode(c.content,!0)),this.update()}setAttr(e,t){const r=this.shadow.querySelector("svg");/(href)/.test(e.toLocaleLowerCase())?r.lastElementChild.setAttribute("xlink:href",t):/(color|fill)/.test(e.toLocaleLowerCase())?r.firstElementChild.style[e]=t:/(z-index|position|top|left|right|bottom|transform)/.test(e.toLocaleLowerCase())?r.style[e]=t:r.setAttribute(e,t)}update(){[...this.getAttributeNames(),"right"].forEach((e=>{const t=this.getAttribute(e)||this[e]||"";this.setAttr(e,t)}))}attributeChangedCallback(e,t,r){t!==r&&this.setAttr(e,r)}}customElements.define("github-corners",u);var d=r(4760),h=["size","fixed","bottom","zIndex","className","style","bgColor","color","position"];function f(e){var{size:t=80,fixed:r=!1,bottom:n,zIndex:o,style:s,bgColor:l="#151513",color:c="#fff",position:u="right"}=e,f=(0,i.Z)(e,h),p="left"===u?{left:0,right:"initial",transform:"scale(-1, 1)"}:{right:0,left:"initial",transform:"scale(1, 1)"};return n?(p.bottom=0,p.top="initial",p.transform="left"===u?"scale(-1, -1)":"scale(1, -1)"):(p.bottom="initial",p.top=0),(0,d.jsx)("github-corners",(0,a.Z)({target:"__blank",width:t,height:t,href:e.href,position:r?"fixed":"absolute","z-index":o,style:s,fill:l,color:c},p,f))}var p,m=r(7240);function v(){return v=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}function E(e,t,r,n){void 0===n&&(n={});let{window:o=document.defaultView,v5Compat:a=!1}=n,i=o.history,s=p.Pop,l=null,c=u();function u(){return(i.state||{idx:null}).idx}function d(){s=p.Pop;let e=u(),t=null==e?null:e-c;c=e,l&&l({action:s,location:f.location,delta:t})}function h(e){let t="null"!==o.location.origin?o.location.origin:o.location.href,r="string"===typeof e?e:S(e);return b(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==c&&(c=0,i.replaceState(v({},i.state,{idx:c}),""));let f={get action(){return s},get location(){return e(o,i)},listen(e){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(g,d),l=e,()=>{o.removeEventListener(g,d),l=null}},createHref:e=>t(o,e),createURL:h,encodeLocation(e){let t=h(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){s=p.Push;let n=w(f.location,e,t);r&&r(n,e),c=u()+1;let d=x(n,c),h=f.createHref(n);try{i.pushState(d,"",h)}catch(m){if(m instanceof DOMException&&"DataCloneError"===m.name)throw m;o.location.assign(h)}a&&l&&l({action:s,location:f.location,delta:1})},replace:function(e,t){s=p.Replace;let n=w(f.location,e,t);r&&r(n,e),c=u();let o=x(n,c),d=f.createHref(n);i.replaceState(o,"",d),a&&l&&l({action:s,location:f.location,delta:0})},go:e=>i.go(e)};return f}var R;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(R||(R={}));const k=new Set(["lazy","caseSensitive","path","id","index","children"]);function T(e,t,r,n){return void 0===r&&(r=[]),void 0===n&&(n={}),e.map(((e,o)=>{let a=[...r,o],i="string"===typeof e.id?e.id:a.join("-");if(b(!0!==e.index||!e.children,"Cannot specify children on an index route"),b(!n[i],'Found a route id collision on id "'+i+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){let r=v({},e,t(e),{id:i});return n[i]=r,r}{let r=v({},e,t(e),{id:i,children:void 0});return n[i]=r,e.children&&(r.children=T(e.children,t,a,n)),r}}))}function P(e,t,r){void 0===r&&(r="/");let n=F(("string"===typeof t?C(t):t).pathname||"/",r);if(null==n)return null;let o=_(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let r=e.length===t.length&&e.slice(0,-1).every(((e,r)=>e===t[r]));return r?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let a=null;for(let i=0;null==a&&i{let i={relativePath:void 0===a?e.path||"":a,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};i.relativePath.startsWith("/")&&(b(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=K([n,i.relativePath]),l=r.concat(i);e.children&&e.children.length>0&&(b(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),_(e.children,t,l,s)),(null!=e.path||e.index)&&t.push({path:s,score:B(s,e.index),routesMeta:l})};return e.forEach(((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let n of A(e.path))o(e,t,n);else o(e,t)})),t}function A(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,o=r.endsWith("?"),a=r.replace(/\?$/,"");if(0===n.length)return o?[a,""]:[a];let i=A(n.join("/")),s=[];return s.push(...i.map((e=>""===e?a:[a,e].join("/")))),o&&s.push(...i),s.map((t=>e.startsWith("/")&&""===t?"/":t))}const j=/^:\w+$/,O=3,D=2,N=1,L=10,I=-2,M=e=>"*"===e;function B(e,t){let r=e.split("/"),n=r.length;return r.some(M)&&(n+=I),t&&(n+=D),r.filter((e=>!M(e))).reduce(((e,t)=>e+(j.test(t)?O:""===t?N:L)),n)}function U(e,t){let{routesMeta:r}=e,n={},o="/",a=[];for(let i=0;i(n.push(t),"/([^\\/]+)")));e.endsWith("*")?(n.push("*"),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))");let a=new RegExp(o,t?void 0:"i");return[a,n]}(e.path,e.caseSensitive,e.end),o=t.match(r);if(!o)return null;let a=o[0],i=a.replace(/(.)\/+$/,"$1"),s=o.slice(1);return{params:n.reduce(((e,t,r)=>{if("*"===t){let e=s[r]||"";i=a.slice(0,a.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(r){return y(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+r+")."),e}}(s[r]||"",t),e}),{}),pathname:a,pathnameBase:i,pattern:e}}function z(e){try{return decodeURI(e)}catch(t){return y(!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 F(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)||"/"}function Z(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function W(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function $(e,t,r,n){let o;void 0===n&&(n=!1),"string"===typeof e?o=C(e):(o=v({},e),b(!o.pathname||!o.pathname.includes("?"),Z("?","pathname","search",o)),b(!o.pathname||!o.pathname.includes("#"),Z("#","pathname","hash",o)),b(!o.search||!o.search.includes("#"),Z("#","search","hash",o)));let a,i=""===e||""===o.pathname,s=i?"/":o.pathname;if(n||null==s)a=r;else{let e=t.length-1;if(s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}a=e>=0?t[e]:"/"}let l=function(e,t){void 0===t&&(t="/");let{pathname:r,search:n="",hash:o=""}="string"===typeof e?C(e):e,a=r?r.startsWith("/")?r:function(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)})),r.length>1?r.join("/"):"/"}(r,t):t;return{pathname:a,search:Y(n),hash:q(o)}}(o,a),c=s&&"/"!==s&&s.endsWith("/"),u=(i||"."===s)&&r.endsWith("/");return l.pathname.endsWith("/")||!c&&!u||(l.pathname+="/"),l}const K=e=>e.join("/").replace(/\/\/+/g,"/"),G=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Y=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",q=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;class V{constructor(e,t,r,n){void 0===n&&(n=!1),this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function J(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}const X=["post","put","patch","delete"],Q=new Set(X),ee=["get",...X],te=new Set(ee),re=new Set([301,302,303,307,308]),ne=new Set([307,308]),oe={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ae={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ie={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},se=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,le=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)});function ce(e){const t=e.window?e.window:"undefined"!==typeof window?window:void 0,r="undefined"!==typeof t&&"undefined"!==typeof t.document&&"undefined"!==typeof t.document.createElement,n=!r;let o;if(b(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;o=e=>({hasErrorBoundary:t(e)})}else o=le;let a,i={},s=T(e.routes,o,void 0,i),l=e.basename||"/",c=v({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),u=null,d=new Set,h=null,f=null,m=null,g=null!=e.hydrationData,x=P(s,e.history.location,l),S=null;if(null==x){let t=ke(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=Re(s);x=r,S={[n.id]:t}}let C,E,k=!x.some((e=>e.route.lazy))&&(!x.some((e=>e.route.loader))||null!=e.hydrationData),_={historyAction:e.history.action,location:e.history.location,matches:x,initialized:k,navigation:oe,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||S,fetchers:new Map,blockers:new Map},A=p.Pop,j=!1,O=!1,D=!1,N=[],L=[],I=new Map,M=0,B=-1,U=new Map,H=new Set,z=new Map,Z=new Map,W=new Map,$=!1;function K(e){_=v({},_,e),d.forEach((e=>e(_)))}function G(t,r){var n,o;let i,l=null!=_.actionData&&null!=_.navigation.formMethod&&Ne(_.navigation.formMethod)&&"loading"===_.navigation.state&&!0!==(null==(n=t.state)?void 0:n._isRedirect);i=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:l?_.actionData:null;let c=r.loaderData?Ce(_.loaderData,r.loaderData,r.matches||[],r.errors):_.loaderData,u=_.blockers;u.size>0&&(u=new Map(u),u.forEach(((e,t)=>u.set(t,ie))));let d=!0===j||null!=_.navigation.formMethod&&Ne(_.navigation.formMethod)&&!0!==(null==(o=t.state)?void 0:o._isRedirect);a&&(s=a,a=void 0),O||A===p.Pop||(A===p.Push?e.history.push(t,t.state):A===p.Replace&&e.history.replace(t,t.state)),K(v({},r,{actionData:i,loaderData:c,historyAction:A,location:t,initialized:!0,navigation:oe,revalidation:"idle",restoreScrollPosition:we(t,r.matches||_.matches),preventScrollReset:d,blockers:u})),A=p.Pop,j=!1,O=!1,D=!1,N=[],L=[]}async function Y(t,r,n){E&&E.abort(),E=null,A=t,O=!0===(n&&n.startUninterruptedRevalidation),function(e,t){if(h&&m){let r=xe(e,t);h[r]=m()}}(_.location,_.matches),j=!0===(n&&n.preventScrollReset);let c=a||s,u=n&&n.overrideNavigation,d=P(c,r,l);if(!d){let e=ke(404,{pathname:r.pathname}),{matches:t,route:n}=Re(c);return ye(),void G(r,{matches:t,loaderData:{},errors:{[n.id]:e}})}if(_.initialized&&!D&&function(e,t){if(e.pathname!==t.pathname||e.search!==t.search)return!1;if(""===e.hash)return""!==t.hash;if(e.hash===t.hash)return!0;if(""!==t.hash)return!0;return!1}(_.location,r)&&!(n&&n.submission&&Ne(n.submission.formMethod)))return void G(r,{matches:d});E=new AbortController;let f,g,b=be(e.history,r,E.signal,n&&n.submission);if(n&&n.pendingError)g={[Ee(d).route.id]:n.pendingError};else if(n&&n.submission&&Ne(n.submission.formMethod)){let e=await async function(e,t,r,n,a){void 0===a&&(a={});X();let s,c=function(e,t){let r={state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text};return r}(t,r);K({navigation:c});let u=Be(n,t);if(u.route.action||u.route.lazy){if(s=await ge("action",e,u,n,i,o,l),e.signal.aborted)return{shortCircuited:!0}}else s={type:R.error,error:ke(405,{method:e.method,pathname:t.pathname,routeId:u.route.id})};if(je(s)){let e;return e=a&&null!=a.replace?a.replace:s.location===_.location.pathname+_.location.search,await V(_,s,{submission:r,replace:e}),{shortCircuited:!0}}if(Ae(s)){let e=Ee(n,u.route.id);return!0!==(a&&a.replace)&&(A=p.Push),{pendingActionData:{},pendingActionError:{[e.route.id]:s.error}}}if(_e(s))throw ke(400,{type:"defer-action"});return{pendingActionData:{[u.route.id]:s.data}}}(b,r,n.submission,d,{replace:n.replace});if(e.shortCircuited)return;f=e.pendingActionData,g=e.pendingActionError,u=He(r,n.submission),b=new Request(b.url,{signal:b.signal})}let{shortCircuited:y,loaderData:x,errors:w}=await async function(t,r,n,o,i,c,u,d,h){let f=o||He(r,i),p=i||c||Ue(f),m=a||s,[g,b]=fe(e.history,_,n,p,r,D,N,L,z,H,m,l,d,h);if(ye((e=>!(n&&n.some((t=>t.route.id===e)))||g&&g.some((t=>t.route.id===e)))),B=++M,0===g.length&&0===b.length){let e=ce();return G(r,v({matches:n,loaderData:{},errors:h||null},d?{actionData:d}:{},e?{fetchers:new Map(_.fetchers)}:{})),{shortCircuited:!0}}if(!O){b.forEach((e=>{let t=_.fetchers.get(e.key),r=ze(void 0,t?t.data:void 0);_.fetchers.set(e.key,r)}));let e=d||_.actionData;K(v({navigation:f},e?0===Object.keys(e).length?{actionData:null}:{actionData:e}:{},b.length>0?{fetchers:new Map(_.fetchers)}:{}))}b.forEach((e=>{I.has(e.key)&&te(e.key),e.controller&&I.set(e.key,e.controller)}));let y=()=>b.forEach((e=>te(e.key)));E&&E.signal.addEventListener("abort",y);let{results:x,loaderResults:w,fetcherResults:S}=await J(_.matches,n,g,b,t);if(t.signal.aborted)return{shortCircuited:!0};E&&E.signal.removeEventListener("abort",y);b.forEach((e=>I.delete(e.key)));let C=Te(x);if(C){if(C.idx>=g.length){let e=b[C.idx-g.length].key;H.add(e)}return await V(_,C.result,{replace:u}),{shortCircuited:!0}}let{loaderData:R,errors:k}=Se(_,n,g,w,h,b,S,Z);Z.forEach(((e,t)=>{e.subscribe((r=>{(r||e.done)&&Z.delete(t)}))}));let T=ce(),P=he(B),A=T||P||b.length>0;return v({loaderData:R,errors:k},A?{fetchers:new Map(_.fetchers)}:{})}(b,r,d,u,n&&n.submission,n&&n.fetcherSubmission,n&&n.replace,f,g);y||(E=null,G(r,v({matches:d},f?{actionData:f}:{},{loaderData:x,errors:w})))}function q(e){return _.fetchers.get(e)||ae}async function V(n,o,a){let{submission:i,replace:s,isFetchActionRedirect:c}=void 0===a?{}:a;o.revalidate&&(D=!0);let u=w(n.location,o.location,v({_isRedirect:!0},c?{_isFetchActionRedirect:!0}:{}));if(b(u,"Expected a location on the redirect navigation"),se.test(o.location)&&r){let r=e.history.createURL(o.location),n=null==F(r.pathname,l);if(t.location.origin!==r.origin||n)return void(s?t.location.replace(o.location):t.location.assign(o.location))}E=null;let d=!0===s?p.Replace:p.Push,h=i||Ue(n.navigation);if(ne.has(o.status)&&h&&Ne(h.formMethod))await Y(d,u,{submission:v({},h,{formAction:o.location}),preventScrollReset:j});else if(c)await Y(d,u,{overrideNavigation:He(u),fetcherSubmission:h,preventScrollReset:j});else{let e=He(u,h);await Y(d,u,{overrideNavigation:e,preventScrollReset:j})}}async function J(t,r,n,a,s){let c=await Promise.all([...n.map((e=>ge("loader",s,e,r,i,o,l))),...a.map((t=>{if(t.matches&&t.match&&t.controller)return ge("loader",be(e.history,t.path,t.controller.signal),t.match,t.matches,i,o,l);return{type:R.error,error:ke(404,{pathname:t.path})}}))]),u=c.slice(0,n.length),d=c.slice(n.length);return await Promise.all([Le(t,n,u,u.map((()=>s.signal)),!1,_.loaderData),Le(t,a.map((e=>e.match)),d,a.map((e=>e.controller?e.controller.signal:null)),!0)]),{results:c,loaderResults:u,fetcherResults:d}}function X(){D=!0,N.push(...ye()),z.forEach(((e,t)=>{I.has(t)&&(L.push(t),te(t))}))}function Q(e,t,r){let n=Ee(_.matches,t);ee(e),K({errors:{[n.route.id]:r},fetchers:new Map(_.fetchers)})}function ee(e){let t=_.fetchers.get(e);!I.has(e)||t&&"loading"===t.state&&U.has(e)||te(e),z.delete(e),U.delete(e),H.delete(e),_.fetchers.delete(e)}function te(e){let t=I.get(e);b(t,"Expected fetch controller: "+e),t.abort(),I.delete(e)}function re(e){for(let t of e){let e=Fe(q(t).data);_.fetchers.set(t,e)}}function ce(){let e=[],t=!1;for(let r of H){let n=_.fetchers.get(r);b(n,"Expected fetcher: "+r),"loading"===n.state&&(H.delete(r),e.push(r),t=!0)}return re(e),t}function he(e){let t=[];for(let[r,n]of U)if(n0}function pe(e){_.blockers.delete(e),W.delete(e)}function me(e,t){let r=_.blockers.get(e)||ie;b("unblocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"proceeding"===t.state||"blocked"===r.state&&"unblocked"===t.state||"proceeding"===r.state&&"unblocked"===t.state,"Invalid blocker state transition: "+r.state+" -> "+t.state);let n=new Map(_.blockers);n.set(e,t),K({blockers:n})}function ve(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===W.size)return;W.size>1&&y(!1,"A router only supports one blocker at a time");let o=Array.from(W.entries()),[a,i]=o[o.length-1],s=_.blockers.get(a);return s&&"proceeding"===s.state?void 0:i({currentLocation:t,nextLocation:r,historyAction:n})?a:void 0}function ye(e){let t=[];return Z.forEach(((r,n)=>{e&&!e(n)||(r.cancel(),t.push(n),Z.delete(n))})),t}function xe(e,t){if(f){return f(e,t.map((e=>function(e,t){let{route:r,pathname:n,params:o}=e;return{id:r.id,pathname:n,params:o,data:t[r.id],handle:r.handle}}(e,_.loaderData))))||e.key}return e.key}function we(e,t){if(h){let r=xe(e,t),n=h[r];if("number"===typeof n)return n}return null}return C={get basename(){return l},get state(){return _},get routes(){return s},initialize:function(){return u=e.history.listen((t=>{let{action:r,location:n,delta:o}=t;if($)return void($=!1);y(0===W.size||null!=o,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let a=ve({currentLocation:_.location,nextLocation:n,historyAction:r});return a&&null!=o?($=!0,e.history.go(-1*o),void me(a,{state:"blocked",location:n,proceed(){me(a,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(o)},reset(){let e=new Map(_.blockers);e.set(a,ie),K({blockers:e})}})):Y(r,n)})),_.initialized||Y(p.Pop,_.location),C},subscribe:function(e){return d.add(e),()=>d.delete(e)},enableScrollRestoration:function(e,t,r){if(h=e,m=t,f=r||null,!g&&_.navigation===oe){g=!0;let e=we(_.location,_.matches);null!=e&&K({restoreScrollPosition:e})}return()=>{h=null,m=null,f=null}},navigate:async function t(r,n){if("number"===typeof r)return void e.history.go(r);let o=ue(_.location,_.matches,l,c.v7_prependBasename,r,null==n?void 0:n.fromRouteId,null==n?void 0:n.relative),{path:a,submission:i,error:s}=de(c.v7_normalizeFormMethod,!1,o,n),u=_.location,d=w(_.location,a,n&&n.state);d=v({},d,e.history.encodeLocation(d));let h=n&&null!=n.replace?n.replace:void 0,f=p.Push;!0===h?f=p.Replace:!1===h||null!=i&&Ne(i.formMethod)&&i.formAction===_.location.pathname+_.location.search&&(f=p.Replace);let m=n&&"preventScrollReset"in n?!0===n.preventScrollReset:void 0,g=ve({currentLocation:u,nextLocation:d,historyAction:f});if(!g)return await Y(f,d,{submission:i,pendingError:s,preventScrollReset:m,replace:n&&n.replace});me(g,{state:"blocked",location:d,proceed(){me(g,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),t(r,n)},reset(){let e=new Map(_.blockers);e.set(g,ie),K({blockers:e})}})},fetch:function(t,r,u,d){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");I.has(t)&&te(t);let h=a||s,f=ue(_.location,_.matches,l,c.v7_prependBasename,u,r,null==d?void 0:d.relative),p=P(h,f,l);if(!p)return void Q(t,r,ke(404,{pathname:f}));let{path:m,submission:g,error:y}=de(c.v7_normalizeFormMethod,!0,f,d);if(y)return void Q(t,r,y);let x=Be(p,m);j=!0===(d&&d.preventScrollReset),g&&Ne(g.formMethod)?async function(t,r,n,c,u,d){if(X(),z.delete(t),!c.route.action&&!c.route.lazy){let e=ke(405,{method:d.formMethod,pathname:n,routeId:r});return void Q(t,r,e)}let h=_.fetchers.get(t),f=function(e,t){let r={state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0," _hasFetcherDoneAnything ":!0};return r}(d,h);_.fetchers.set(t,f),K({fetchers:new Map(_.fetchers)});let p=new AbortController,m=be(e.history,n,p.signal,d);I.set(t,p);let g=M,y=await ge("action",m,c,u,i,o,l);if(m.signal.aborted)return void(I.get(t)===p&&I.delete(t));if(je(y)){if(I.delete(t),B>g){let e=Fe(void 0);return _.fetchers.set(t,e),void K({fetchers:new Map(_.fetchers)})}{H.add(t);let e=ze(d);return _.fetchers.set(t,e),K({fetchers:new Map(_.fetchers)}),V(_,y,{submission:d,isFetchActionRedirect:!0})}}if(Ae(y))return void Q(t,r,y.error);if(_e(y))throw ke(400,{type:"defer-action"});let x=_.navigation.location||_.location,w=be(e.history,x,p.signal),S=a||s,C="idle"!==_.navigation.state?P(S,_.navigation.location,l):_.matches;b(C,"Didn't find any matches after fetcher action");let R=++M;U.set(t,R);let k=ze(d,y.data);_.fetchers.set(t,k);let[T,j]=fe(e.history,_,C,d,x,D,N,L,z,H,S,l,{[c.route.id]:y.data},void 0);j.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,r=_.fetchers.get(t),n=ze(void 0,r?r.data:void 0);_.fetchers.set(t,n),I.has(t)&&te(t),e.controller&&I.set(t,e.controller)})),K({fetchers:new Map(_.fetchers)});let O=()=>j.forEach((e=>te(e.key)));p.signal.addEventListener("abort",O);let{results:F,loaderResults:W,fetcherResults:$}=await J(_.matches,C,T,j,w);if(p.signal.aborted)return;p.signal.removeEventListener("abort",O),U.delete(t),I.delete(t),j.forEach((e=>I.delete(e.key)));let Y=Te(F);if(Y){if(Y.idx>=T.length){let e=j[Y.idx-T.length].key;H.add(e)}return V(_,Y.result)}let{loaderData:q,errors:ee}=Se(_,_.matches,T,W,void 0,j,$,Z);if(_.fetchers.has(t)){let e=Fe(y.data);_.fetchers.set(t,e)}let re=he(R);"loading"===_.navigation.state&&R>B?(b(A,"Expected pending action"),E&&E.abort(),G(_.navigation.location,{matches:C,loaderData:q,errors:ee,fetchers:new Map(_.fetchers)})):(K(v({errors:ee,loaderData:Ce(_.loaderData,q,C,ee)},re||j.length>0?{fetchers:new Map(_.fetchers)}:{})),D=!1)}(t,r,m,x,p,g):(z.set(t,{routeId:r,path:m}),async function(t,r,n,a,s,c){let u=_.fetchers.get(t),d=ze(c,u?u.data:void 0);_.fetchers.set(t,d),K({fetchers:new Map(_.fetchers)});let h=new AbortController,f=be(e.history,n,h.signal);I.set(t,h);let p=M,m=await ge("loader",f,a,s,i,o,l);_e(m)&&(m=await Ie(m,f.signal,!0)||m);I.get(t)===h&&I.delete(t);if(f.signal.aborted)return;if(je(m)){if(B>p){let e=Fe(void 0);return _.fetchers.set(t,e),void K({fetchers:new Map(_.fetchers)})}return H.add(t),void await V(_,m)}if(Ae(m)){let e=Ee(_.matches,r);return _.fetchers.delete(t),void K({fetchers:new Map(_.fetchers),errors:{[e.route.id]:m.error}})}b(!_e(m),"Unhandled fetcher deferred data");let v=Fe(m.data);_.fetchers.set(t,v),K({fetchers:new Map(_.fetchers)})}(t,r,m,x,p,g))},revalidate:function(){X(),K({revalidation:"loading"}),"submitting"!==_.navigation.state&&("idle"!==_.navigation.state?Y(A||_.historyAction,_.navigation.location,{overrideNavigation:_.navigation}):Y(_.historyAction,_.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:q,deleteFetcher:ee,dispose:function(){u&&u(),d.clear(),E&&E.abort(),_.fetchers.forEach(((e,t)=>ee(t))),_.blockers.forEach(((e,t)=>pe(t)))},getBlocker:function(e,t){let r=_.blockers.get(e)||ie;return W.get(e)!==t&&W.set(e,t),r},deleteBlocker:pe,_internalFetchControllers:I,_internalActiveDeferreds:Z,_internalSetRoutes:function(e){i={},a=T(e,o,void 0,i)}},C}Symbol("deferred");function ue(e,t,r,n,o,a,i){let s,l;if(null!=a&&"path"!==i){s=[];for(let e of t)if(s.push(e),e.route.id===a){l=e;break}}else s=t,l=t[t.length-1];let c=$(o||".",W(s).map((e=>e.pathnameBase)),F(e.pathname,r)||e.pathname,"path"===i);return null==o&&(c.search=e.search,c.hash=e.hash),null!=o&&""!==o&&"."!==o||!l||!l.route.index||Me(c.search)||(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(c.pathname="/"===c.pathname?r:K([r,c.pathname])),S(c)}function de(e,t,r,n){if(!n||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(n))return{path:r};if(n.formMethod&&!De(n.formMethod))return{path:r,error:ke(405,{method:n.formMethod})};let o,a,i=()=>({path:r,error:ke(400,{type:"invalid-body"})}),s=n.formMethod||"get",l=e?s.toUpperCase():s.toLowerCase(),c=Pe(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!Ne(l))return i();let e="string"===typeof n.body?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce(((e,t)=>{let[r,n]=t;return""+e+r+"="+n+"\n"}),""):String(n.body);return{path:r,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===n.formEncType){if(!Ne(l))return i();try{let e="string"===typeof n.body?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch(h){return i()}}}if(b("function"===typeof FormData,"FormData is not available in this environment"),n.formData)o=ye(n.formData),a=n.formData;else if(n.body instanceof FormData)o=ye(n.body),a=n.body;else if(n.body instanceof URLSearchParams)o=n.body,a=xe(o);else if(null==n.body)o=new URLSearchParams,a=new FormData;else try{o=new URLSearchParams(n.body),a=xe(o)}catch(h){return i()}let u={formMethod:l,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:a,json:void 0,text:void 0};if(Ne(u.formMethod))return{path:r,submission:u};let d=C(r);return t&&d.search&&Me(d.search)&&o.append("index",""),d.search="?"+o,{path:S(d),submission:u}}function he(e,t){let r=e;if(t){let n=e.findIndex((e=>e.route.id===t));n>=0&&(r=e.slice(0,n))}return r}function fe(e,t,r,n,o,a,i,s,l,c,u,d,h,f){let p=f?Object.values(f)[0]:h?Object.values(h)[0]:void 0,m=e.createURL(t.location),g=e.createURL(o),b=f?Object.keys(f)[0]:void 0,y=he(r,b).filter(((e,r)=>{if(e.route.lazy)return!0;if(null==e.route.loader)return!1;if(function(e,t,r){let n=!t||r.route.id!==t.route.id,o=void 0===e[r.route.id];return n||o}(t.loaderData,t.matches[r],e)||i.some((t=>t===e.route.id)))return!0;let o=t.matches[r],s=e;return me(e,v({currentUrl:m,currentParams:o.params,nextUrl:g,nextParams:s.params},n,{actionResult:p,defaultShouldRevalidate:a||m.pathname+m.search===g.pathname+g.search||m.search!==g.search||pe(o,s)}))})),x=[];return l.forEach(((e,o)=>{if(!r.some((t=>t.route.id===e.routeId)))return;let i=P(u,e.path,d);if(!i)return void x.push({key:o,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let l=t.fetchers.get(o),h=Be(i,e.path),f=!1;f=!c.has(o)&&(!!s.includes(o)||(l&&"idle"!==l.state&&void 0===l.data?a:me(h,v({currentUrl:m,currentParams:t.matches[t.matches.length-1].params,nextUrl:g,nextParams:r[r.length-1].params},n,{actionResult:p,defaultShouldRevalidate:a})))),f&&x.push({key:o,routeId:e.routeId,path:e.path,matches:i,match:h,controller:new AbortController})})),[y,x]}function pe(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function me(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"===typeof r)return r}return t.defaultShouldRevalidate}async function ve(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let o=r[e.id];b(o,"No route found in manifest");let a={};for(let i in n){let e=void 0!==o[i]&&"hasErrorBoundary"!==i;y(!e,'Route "'+o.id+'" has a static property "'+i+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+i+'" will be ignored.'),e||k.has(i)||(a[i]=n[i])}Object.assign(o,a),Object.assign(o,v({},t(o),{lazy:void 0}))}async function ge(e,t,r,n,o,a,i,s){let l,c,u;void 0===s&&(s={});let d=e=>{let n,o=new Promise(((e,t)=>n=t));return u=()=>n(),t.signal.addEventListener("abort",u),Promise.race([e({request:t,params:r.params,context:s.requestContext}),o])};try{let n=r.route[e];if(r.route.lazy)if(n){c=(await Promise.all([d(n),ve(r.route,a,o)]))[0]}else{if(await ve(r.route,a,o),n=r.route[e],!n){if("action"===e){let e=new URL(t.url),n=e.pathname+e.search;throw ke(405,{method:t.method,pathname:n,routeId:r.route.id})}return{type:R.data,data:void 0}}c=await d(n)}else{if(!n){let e=new URL(t.url);throw ke(404,{pathname:e.pathname+e.search})}c=await d(n)}b(void 0!==c,"You defined "+("action"===e?"an action":"a loader")+' for route "'+r.route.id+"\" but didn't return anything from your `"+e+"` function. Please return a value or `null`.")}catch(p){l=R.error,c=p}finally{u&&t.signal.removeEventListener("abort",u)}if(Oe(c)){let e,o=c.status;if(re.has(o)){let e=c.headers.get("Location");if(b(e,"Redirects returned/thrown from loaders/actions must have a Location header"),se.test(e)){if(!s.isStaticRequest){let r=new URL(t.url),n=e.startsWith("//")?new URL(r.protocol+e):new URL(e),o=null!=F(n.pathname,i);n.origin===r.origin&&o&&(e=n.pathname+n.search+n.hash)}}else e=ue(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,e);if(s.isStaticRequest)throw c.headers.set("Location",e),c;return{type:R.redirect,status:o,location:e,revalidate:null!==c.headers.get("X-Remix-Revalidate")}}if(s.isRouteRequest)throw{type:l||R.data,response:c};let a=c.headers.get("Content-Type");return e=a&&/\bapplication\/json\b/.test(a)?await c.json():await c.text(),l===R.error?{type:l,error:new V(o,c.statusText,e),headers:c.headers}:{type:R.data,data:e,statusCode:c.status,headers:c.headers}}return l===R.error?{type:l,error:c}:function(e){let t=e;return t&&"object"===typeof t&&"object"===typeof t.data&&"function"===typeof t.subscribe&&"function"===typeof t.cancel&&"function"===typeof t.resolveData}(c)?{type:R.deferred,deferredData:c,statusCode:null==(h=c.init)?void 0:h.status,headers:(null==(f=c.init)?void 0:f.headers)&&new Headers(c.init.headers)}:{type:R.data,data:c};var h,f}function be(e,t,r,n){let o=e.createURL(Pe(t)).toString(),a={signal:r};if(n&&Ne(n.formMethod)){let{formMethod:e,formEncType:t}=n;a.method=e.toUpperCase(),"application/json"===t?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(n.json)):"text/plain"===t?a.body=n.text:"application/x-www-form-urlencoded"===t&&n.formData?a.body=ye(n.formData):a.body=n.formData}return new Request(o,a)}function ye(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"===typeof n?n:n.name);return t}function xe(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function we(e,t,r,n,o){let a,i={},s=null,l=!1,c={};return r.forEach(((r,u)=>{let d=t[u].route.id;if(b(!je(r),"Cannot handle redirect results in processLoaderData"),Ae(r)){let t=Ee(e,d),o=r.error;n&&(o=Object.values(n)[0],n=void 0),s=s||{},null==s[t.route.id]&&(s[t.route.id]=o),i[d]=void 0,l||(l=!0,a=J(r.error)?r.error.status:500),r.headers&&(c[d]=r.headers)}else _e(r)?(o.set(d,r.deferredData),i[d]=r.deferredData.data):i[d]=r.data,null==r.statusCode||200===r.statusCode||l||(a=r.statusCode),r.headers&&(c[d]=r.headers)})),n&&(s=n,i[Object.keys(n)[0]]=void 0),{loaderData:i,errors:s,statusCode:a||200,loaderHeaders:c}}function Se(e,t,r,n,o,a,i,s){let{loaderData:l,errors:c}=we(t,r,n,o,s);for(let u=0;ue.route.id===t))+1):[...e]).reverse().find((e=>!0===e.route.hasErrorBoundary))||e[0]}function Re(e){let t=e.find((e=>e.index||!e.path||"/"===e.path))||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function ke(e,t){let{pathname:r,routeId:n,method:o,type:a}=void 0===t?{}:t,i="Unknown Server Error",s="Unknown @remix-run/router error";return 400===e?(i="Bad Request",o&&r&&n?s="You made a "+o+' request to "'+r+'" but did not provide a `loader` for route "'+n+'", so there is no way to handle the request.':"defer-action"===a?s="defer() is not supported in actions":"invalid-body"===a&&(s="Unable to encode submission body")):403===e?(i="Forbidden",s='Route "'+n+'" does not match URL "'+r+'"'):404===e?(i="Not Found",s='No route matches URL "'+r+'"'):405===e&&(i="Method Not Allowed",o&&r&&n?s="You made a "+o.toUpperCase()+' request to "'+r+'" but did not provide an `action` for route "'+n+'", so there is no way to handle the request.':o&&(s='Invalid request method "'+o.toUpperCase()+'"')),new V(e||500,i,new Error(s),!0)}function Te(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(je(r))return{result:r,idx:t}}}function Pe(e){return S(v({},"string"===typeof e?C(e):e,{hash:""}))}function _e(e){return e.type===R.deferred}function Ae(e){return e.type===R.error}function je(e){return(e&&e.type)===R.redirect}function Oe(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"object"===typeof e.headers&&"undefined"!==typeof e.body}function De(e){return te.has(e.toLowerCase())}function Ne(e){return Q.has(e.toLowerCase())}async function Le(e,t,r,n,o,a){for(let i=0;ie.route.id===l.route.id)),u=null!=c&&!pe(c,l)&&void 0!==(a&&a[l.route.id]);if(_e(s)&&(o||u)){let e=n[i];b(e,"Expected an AbortSignal for revalidating fetcher deferred result"),await Ie(s,e,o).then((e=>{e&&(r[i]=e||r[i])}))}}}async function Ie(e,t,r){if(void 0===r&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:R.data,data:e.deferredData.unwrappedData}}catch(n){return{type:R.error,error:n}}return{type:R.data,data:e.deferredData.data}}}function Me(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function Be(e,t){let r="string"===typeof t?C(t).search:t.search;if(e[e.length-1].route.index&&Me(r||""))return e[e.length-1];let n=W(e);return n[n.length-1]}function Ue(e){let{formMethod:t,formAction:r,formEncType:n,text:o,formData:a,json:i}=e;if(t&&r&&n)return null!=o?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:o}:null!=a?{formMethod:t,formAction:r,formEncType:n,formData:a,json:void 0,text:void 0}:void 0!==i?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}:void 0}function He(e,t){if(t){return{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}return{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function ze(e,t){if(e){return{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t," _hasFetcherDoneAnything ":!0}}return{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t," _hasFetcherDoneAnything ":!0}}function Fe(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e," _hasFetcherDoneAnything ":!0}}function Ze(){return Ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t{r.current=!0})),s.useCallback((function(n,o){void 0===o&&(o={}),r.current&&("number"===typeof n?e.navigate(n):e.navigate(n,Ze({fromRouteId:t},o)))}),[e,t])}():function(){Ve()||b(!1);let e=s.useContext(We),{basename:t,navigator:r}=s.useContext(Ke),{matches:n}=s.useContext(Ye),{pathname:o}=Je(),a=JSON.stringify(W(n).map((e=>e.pathnameBase))),i=s.useRef(!1);return Xe((()=>{i.current=!0})),s.useCallback((function(n,s){if(void 0===s&&(s={}),!i.current)return;if("number"===typeof n)return void r.go(n);let l=$(n,JSON.parse(a),o,"path"===s.relative);null==e&&"/"!==t&&(l.pathname="/"===l.pathname?t:K([t,l.pathname])),(s.replace?r.replace:r.push)(l,s.state,s)}),[t,r,a,o,e])}()}const et=s.createContext(null);function tt(e,t){let{relative:r}=void 0===t?{}:t,{matches:n}=s.useContext(Ye),{pathname:o}=Je(),a=JSON.stringify(W(n).map((e=>e.pathnameBase)));return s.useMemo((()=>$(e,JSON.parse(a),o,"path"===r)),[e,a,o,r])}function rt(e,t,r){Ve()||b(!1);let{navigator:n}=s.useContext(Ke),{matches:o}=s.useContext(Ye),a=o[o.length-1],i=a?a.params:{},l=(a&&a.pathname,a?a.pathnameBase:"/");a&&a.route;let c,u=Je();if(t){var d;let e="string"===typeof t?C(t):t;"/"===l||(null==(d=e.pathname)?void 0:d.startsWith(l))||b(!1),c=e}else c=u;let h=c.pathname||"/",f=P(e,{pathname:"/"===l?h:h.slice(l.length)||"/"});let m=st(f&&f.map((e=>Object.assign({},e,{params:Object.assign({},i,e.params),pathname:K([l,n.encodeLocation?n.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?l:K([l,n.encodeLocation?n.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),o,r);return t&&m?s.createElement(Ge.Provider,{value:{location:Ze({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:p.Pop}},m):m}function nt(){let e=ft(),t=J(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:n};return s.createElement(s.Fragment,null,s.createElement("h2",null,"Unexpected Application Error!"),s.createElement("h3",{style:{fontStyle:"italic"}},t),r?s.createElement("pre",{style:o},r):null,null)}const ot=s.createElement(nt,null);class at extends s.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: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 this.state.error?s.createElement(Ye.Provider,{value:this.props.routeContext},s.createElement(qe.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function it(e){let{routeContext:t,match:r,children:n}=e,o=s.useContext(We);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),s.createElement(Ye.Provider,{value:t},n)}function st(e,t,r){var n;if(void 0===t&&(t=[]),void 0===r&&(r=null),null==e){var o;if(null==(o=r)||!o.errors)return null;e=r.matches}let a=e,i=null==(n=r)?void 0:n.errors;if(null!=i){let e=a.findIndex((e=>e.route.id&&(null==i?void 0:i[e.route.id])));e>=0||b(!1),a=a.slice(0,Math.min(a.length,e+1))}return a.reduceRight(((e,n,o)=>{let l=n.route.id?null==i?void 0:i[n.route.id]:null,c=null;r&&(c=n.route.errorElement||ot);let u=t.concat(a.slice(0,o+1)),d=()=>{let t;return t=l?c:n.route.Component?s.createElement(n.route.Component,null):n.route.element?n.route.element:e,s.createElement(it,{match:n,routeContext:{outlet:e,matches:u,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===o)?s.createElement(at,{location:r.location,revalidation:r.revalidation,component:c,error:l,children:d(),routeContext:{outlet:null,matches:u,isDataRoute:!0}}):d()}),null)}var lt,ct;function ut(e){let t=s.useContext(We);return t||b(!1),t}function dt(e){let t=s.useContext($e);return t||b(!1),t}function ht(e){let t=function(e){let t=s.useContext(Ye);return t||b(!1),t}(),r=t.matches[t.matches.length-1];return r.route.id||b(!1),r.route.id}function ft(){var e;let t=s.useContext(qe),r=dt(ct.UseRouteError),n=ht(ct.UseRouteError);return t||(null==(e=r.errors)?void 0:e[n])}!function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"}(lt||(lt={})),function(e){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"}(ct||(ct={}));const pt=l.startTransition;function mt(e){let{fallbackElement:t,router:r,future:n}=e,[o,a]=s.useState(r.state),{v7_startTransition:i}=n||{},l=s.useCallback((e=>{i&&pt?pt((()=>a(e))):a(e)}),[a,i]);s.useLayoutEffect((()=>r.subscribe(l)),[r,l]);let c=s.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:null==n?void 0:n.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})})),[r]),u=r.basename||"/",d=s.useMemo((()=>({router:r,navigator:c,static:!1,basename:u})),[r,c,u]);return s.createElement(s.Fragment,null,s.createElement(We.Provider,{value:d},s.createElement($e.Provider,{value:o},s.createElement(bt,{basename:u,location:o.location,navigationType:o.historyAction,navigator:c},o.initialized?s.createElement(vt,{routes:r.routes,state:o}):t))),null)}function vt(e){let{routes:t,state:r}=e;return rt(t,void 0,r)}function gt(e){return function(e){let t=s.useContext(Ye).outlet;return t?s.createElement(et.Provider,{value:e},t):t}(e.context)}function bt(e){let{basename:t="/",children:r=null,location:n,navigationType:o=p.Pop,navigator:a,static:i=!1}=e;Ve()&&b(!1);let l=t.replace(/^\/*/,"/"),c=s.useMemo((()=>({basename:l,navigator:a,static:i})),[l,a,i]);"string"===typeof n&&(n=C(n));let{pathname:u="/",search:d="",hash:h="",state:f=null,key:m="default"}=n,v=s.useMemo((()=>{let e=F(u,l);return null==e?null:{location:{pathname:e,search:d,hash:h,state:f,key:m},navigationType:o}}),[l,u,d,h,f,m,o]);return null==v?null:s.createElement(Ke.Provider,{value:c},s.createElement(Ge.Provider,{children:r,value:v}))}var yt;!function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"}(yt||(yt={}));new Promise((()=>{}));s.Component;function xt(e){let t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:s.createElement(e.Component),Component:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:s.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function wt(){return wt=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[r]=e[r]);return o}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const Ct=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],Et=["aria-current","caseSensitive","className","end","style","to","children"];function Rt(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=wt({},t,{errors:kt(t.errors)})),t}function kt(e){if(!e)return null;let t=Object.entries(e),r={};for(let[o,a]of t)if(a&&"RouteErrorResponse"===a.__type)r[o]=new V(a.status,a.statusText,a.data,!0===a.internal);else if(a&&"Error"===a.__type){if(a.__subType){let e=window[a.__subType];if("function"===typeof e)try{let t=new e(a.message);t.stack="",r[o]=t}catch(n){}}if(null==r[o]){let e=new Error(a.message);e.stack="",r[o]=e}}else r[o]=a;return r}l.startTransition;const Tt="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement,Pt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_t=s.forwardRef((function(e,t){let r,{onClick:n,relative:o,reloadDocument:a,replace:i,state:l,target:c,to:u,preventScrollReset:d}=e,h=St(e,Ct),{basename:f}=s.useContext(Ke),p=!1;if("string"===typeof u&&Pt.test(u)&&(r=u,Tt))try{let e=new URL(window.location.href),t=u.startsWith("//")?new URL(e.protocol+u):new URL(u),r=F(t.pathname,f);t.origin===e.origin&&null!=r?u=r+t.search+t.hash:p=!0}catch(g){}let m=function(e,t){let{relative:r}=void 0===t?{}:t;Ve()||b(!1);let{basename:n,navigator:o}=s.useContext(Ke),{hash:a,pathname:i,search:l}=tt(e,{relative:r}),c=i;return"/"!==n&&(c="/"===i?n:K([n,i])),o.createHref({pathname:c,search:l,hash:a})}(u,{relative:o}),v=function(e,t){let{target:r,replace:n,state:o,preventScrollReset:a,relative:i}=void 0===t?{}:t,l=Qe(),c=Je(),u=tt(e,{relative:i});return s.useCallback((t=>{if(function(e,t){return 0===e.button&&(!t||"_self"===t)&&!function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)}(t,r)){t.preventDefault();let r=void 0!==n?n:S(c)===S(u);l(e,{replace:r,state:o,preventScrollReset:a,relative:i})}}),[c,l,u,n,o,r,e,a,i])}(u,{replace:i,state:l,target:c,preventScrollReset:d,relative:o});return s.createElement("a",wt({},h,{href:r||m,onClick:p||a?n:function(e){n&&n(e),e.defaultPrevented||v(e)},ref:t,target:c}))}));const At=s.forwardRef((function(e,t){let{"aria-current":r="page",caseSensitive:n=!1,className:o="",end:a=!1,style:i,to:l,children:c}=e,u=St(e,Et),d=tt(l,{relative:u.relative}),h=Je(),f=s.useContext($e),{navigator:p}=s.useContext(Ke),m=p.encodeLocation?p.encodeLocation(d).pathname:d.pathname,v=h.pathname,g=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;n||(v=v.toLowerCase(),g=g?g.toLowerCase():null,m=m.toLowerCase());let b,y=v===m||!a&&v.startsWith(m)&&"/"===v.charAt(m.length),x=null!=g&&(g===m||!a&&g.startsWith(m)&&"/"===g.charAt(m.length)),w=y?r:void 0;b="function"===typeof o?o({isActive:y,isPending:x}):[o,y?"active":null,x?"pending":null].filter(Boolean).join(" ");let S="function"===typeof i?i({isActive:y,isPending:x}):i;return s.createElement(_t,wt({},u,{"aria-current":w,className:b,ref:t,style:S,to:l}),"function"===typeof c?c({isActive:y,isPending:x}):c)}));function jt(e){let{getKey:t,storageKey:r}=e;return function(e){let{getKey:t,storageKey:r}=void 0===e?{}:e,{router:n}=Nt(Ot.UseScrollRestoration),{restoreScrollPosition:o,preventScrollReset:a}=Lt(Dt.UseScrollRestoration),{basename:i}=s.useContext(Ke),l=Je(),c=function(){let{matches:e,loaderData:t}=dt(ct.UseMatches);return s.useMemo((()=>e.map((e=>{let{pathname:r,params:n}=e;return{id:e.route.id,pathname:r,params:n,data:t[e.route.id],handle:e.route.handle}}))),[e,t])}(),u=dt(ct.UseNavigation).navigation;s.useEffect((()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"})),[]),function(e,t){let{capture:r}=t||{};s.useEffect((()=>{let t=null!=r?{capture:r}:void 0;return window.addEventListener("pagehide",e,t),()=>{window.removeEventListener("pagehide",e,t)}}),[e,r])}(s.useCallback((()=>{if("idle"===u.state){let e=(t?t(l,c):null)||l.key;Mt[e]=window.scrollY}sessionStorage.setItem(r||It,JSON.stringify(Mt)),window.history.scrollRestoration="auto"}),[r,t,u.state,l,c])),"undefined"!==typeof document&&(s.useLayoutEffect((()=>{try{let e=sessionStorage.getItem(r||It);e&&(Mt=JSON.parse(e))}catch(e){}}),[r]),s.useLayoutEffect((()=>{let e=t&&"/"!==i?(e,r)=>t(wt({},e,{pathname:F(e.pathname,i)||e.pathname}),r):t,r=null==n?void 0:n.enableScrollRestoration(Mt,(()=>window.scrollY),e);return()=>r&&r()}),[n,i,t]),s.useLayoutEffect((()=>{if(!1!==o)if("number"!==typeof o){if(l.hash){let e=document.getElementById(decodeURIComponent(l.hash.slice(1)));if(e)return void e.scrollIntoView()}!0!==a&&window.scrollTo(0,0)}else window.scrollTo(0,o)}),[l,o,a]))}({getKey:t,storageKey:r}),null}var Ot,Dt;function Nt(e){let t=s.useContext(We);return t||b(!1),t}function Lt(e){let t=s.useContext($e);return t||b(!1),t}(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"})(Ot||(Ot={})),function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(Dt||(Dt={}));const It="react-router-scroll-positions";let Mt={};var Bt,Ut=r(6493),Ht=(r(6155),r(645)),zt=r(7905),Ft=r(1507);function Zt(){return Zt=Object.assign?Object.assign.bind():function(e){for(var t=1;t span {\n background-color: var(--color-theme-bg);\n padding: 0 5px;\n }\n"]))),Vt=Ht.ZP.div(Gt||(Gt=(0,o.Z)(["\n text-align: center;\n font-size: 124px;\n padding: 100px 0 32px 0;\n"]))),Jt=Ht.ZP.header(Yt||(Yt=(0,o.Z)(["\n max-width: 860px;\n margin: 0 auto;\n padding: 21px 0;\n align-items: center;\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n a {\n margin: 6px 10px;\n padding: 5px 10px;\n background-color: #e6e6e6;\n box-shadow: rgb(0 0 0 / 15%) 0px 3px 12px;\n border-radius: 5px;\n text-decoration: none;\n display: flex;\n align-items: center;\n color: #333;\n transition: background-color 0.3s;\n &.comps {\n background: #10b316;\n color: white !important;\n }\n &.active {\n color: white;\n background: #333 !important;\n }\n svg {\n margin-right: 5px;\n }\n }\n"]))),Xt=()=>{const{hsva:e,dispatch:t}=(0,s.useContext)(zt._y);return(0,d.jsx)(Ft.default,{color:e,style:{margin:"20px auto 0 auto"},onChange:r=>{t({hsva:{...e,...r.hsva}})}})};function Qt(e){const{menus:t}=e;return(0,d.jsxs)("div",{children:[(0,d.jsx)(Vt,{children:"\ud83c\udfa8"}),(0,d.jsxs)(qt,{children:[(0,d.jsxs)("span",{children:[(0,d.jsx)("b",{children:"react-color"})," is a tiny color picker widget component for react apps. These components can be installed and used separately."]}),(0,d.jsx)(Xt,{})]}),(0,d.jsx)(Jt,{children:t.map(((e,t)=>e.path?(0,d.jsxs)(At,{to:e.path,className:e.isComp?"comps":"",children:["/"===e.path&&(0,d.jsx)($t,{}),(0,d.jsx)("span",{children:e.label})]},t):null))})]})}var er,tr;const rr=Ht.ZP.div(er||(er=(0,o.Z)(["\n transition: background-color 0.3s ease 0s;\n min-height: 100vh;\n dark-mode {\n font-size: 18px;\n position: fixed;\n top: 10px;\n left: 10px;\n }\n"]))),nr=Ht.ZP.div(tr||(tr=(0,o.Z)(["\n position: fixed;\n left: 88px;\n top: 12px;\n background: var(--color-theme-bg);\n border-radius: 3px;\n padding: 0px 6px;\n"])));const or={path:"/",Component:function(){const[e,t]=(0,s.useReducer)(zt.I6,zt.Of);(0,s.useEffect)((()=>{document.body.style.background="url(".concat(m.BACKGROUND_IMG,") left center"),document.body.style.backgroundAttachment="fixed"}),[]);const r=e.hsva;return(0,s.useEffect)((()=>{document.documentElement.style.backgroundColor=(0,Ut.hsvaToHslaString)(r)}),[r]),(0,d.jsx)(zt._y.Provider,{value:{...e,dispatch:t},children:(0,d.jsxs)(rr,{style:{backgroundColor:(0,Ut.hsvaToHslaString)(e.hsva)},children:[(0,d.jsx)("dark-mode",{permanent:!0,light:"Dark",dark:"Light"}),(0,d.jsxs)(nr,{children:["v","2.0.1"]}),(0,d.jsx)(f,{fixed:!0,zIndex:99,size:60,target:"__blank",href:"https://github.com/uiwjs/react-color"}),(0,d.jsx)(Qt,{menus:or.children||[]}),(0,d.jsx)(gt,{}),(0,d.jsx)(jt,{})]})})},ErrorBoundary:(0,s.forwardRef)(((e,t)=>{let{children:r,...n}=e;const o=ft();return(0,d.jsxs)("div",{id:"error-page",...n,ref:t,children:[(0,d.jsx)("h1",{children:"Oops!"}),(0,d.jsx)("p",{children:"\u62b1\u6b49\uff0c\u53d1\u751f\u4e86\u610f\u5916\u9519\u8bef\u3002"}),(0,d.jsxs)("p",{children:[(null===o||void 0===o?void 0:o.status)&&(0,d.jsx)("em",{children:null===o||void 0===o?void 0:o.status}),(null===o||void 0===o?void 0:o.statusText)&&(0,d.jsx)("i",{children:decodeURI((null===o||void 0===o?void 0:o.statusText)||"")})]})]})})),children:[{path:"/",label:"Home",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(31),r.e(281)]).then(r.bind(r,1281))},{path:"/colorful",label:"Colorful",isComp:!0,lazy:()=>Promise.all([r.e(269),r.e(616),r.e(113)]).then(r.bind(r,5782))},{path:"/sketch",label:"Sketch",isComp:!0,lazy:()=>Promise.all([r.e(269),r.e(616),r.e(308)]).then(r.bind(r,7711))},{path:"/block",label:"Block",isComp:!0,lazy:()=>Promise.all([r.e(269),r.e(616),r.e(494)]).then(r.bind(r,5545))},{path:"/circle",label:"Circle",isComp:!0,lazy:()=>Promise.all([r.e(269),r.e(616),r.e(785)]).then(r.bind(r,308))},{path:"/compact",label:"Compact",isComp:!0,lazy:()=>Promise.all([r.e(269),r.e(616),r.e(952)]).then(r.bind(r,7216))},{path:"/wheel",label:"Wheel",isComp:!0,lazy:()=>Promise.all([r.e(269),r.e(616),r.e(919)]).then(r.bind(r,9014))},{path:"/github",label:"Github",isComp:!0,lazy:()=>Promise.all([r.e(269),r.e(616),r.e(781)]).then(r.bind(r,1956))},{path:"/material",label:"Material",isComp:!0,lazy:()=>Promise.all([r.e(269),r.e(616),r.e(955)]).then(r.bind(r,3100))},{path:"/chrome",label:"Chrome",isComp:!0,lazy:()=>Promise.all([r.e(269),r.e(616),r.e(31),r.e(446)]).then(r.bind(r,9446))},{path:"/alpha",label:"Alpha",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(546)]).then(r.bind(r,9522))},{path:"/editable-input",label:"EditableInput",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(756)]).then(r.bind(r,737))},{path:"/editable-input-hsla",label:"EditableInputHsla",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(569)]).then(r.bind(r,6419))},{path:"/editable-input-rgba",label:"EditableInputRgba",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(309)]).then(r.bind(r,2943))},{path:"/hue",label:"Hue",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(297)]).then(r.bind(r,1144))},{path:"/name",label:"Name",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(466)]).then(r.bind(r,8982))},{path:"/saturation",label:"Saturation",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(649)]).then(r.bind(r,710))},{path:"/shade-slider",label:"ShadeSlider",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(620)]).then(r.bind(r,3743))},{path:"/slider",label:"Slider",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(875)]).then(r.bind(r,1983))},{path:"/swatch",label:"Swatch",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(118)]).then(r.bind(r,8865))},{path:"/drag-event-interactive",label:"Interactive",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(94)]).then(r.bind(r,5991))},{path:"/convert",label:"Convert",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(721)]).then(r.bind(r,704))}]},ar={display:"flex",alignItems:"center",justifyContent:"center",gap:"1rem",left:0,right:0,top:0,bottom:0,position:"absolute",zIndex:9999},ir=e=>{let{children:t,style:r,...n}=e;return(0,d.jsxs)("div",{...n,style:{...ar,...r},children:[(0,d.jsxs)("svg",{width:"25",height:"30",viewBox:"0 0 135 140",fill:"currentColor",children:[(0,d.jsxs)("rect",{y:"10",width:"15",height:"120",rx:"6",children:[(0,d.jsx)("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),(0,d.jsx)("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]}),(0,d.jsxs)("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6",children:[(0,d.jsx)("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),(0,d.jsx)("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]}),(0,d.jsxs)("rect",{x:"60",width:"15",height:"140",rx:"6",children:[(0,d.jsx)("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),(0,d.jsx)("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]}),(0,d.jsxs)("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6",children:[(0,d.jsx)("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),(0,d.jsx)("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]}),(0,d.jsxs)("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6",children:[(0,d.jsx)("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),(0,d.jsx)("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]})]}),(0,d.jsx)("div",{children:t||"Loading..."})]})},sr=document.getElementById("root");(0,n.s)(sr).render((0,d.jsx)(mt,{router:function(e,t){return ce({basename:null==t?void 0:t.basename,future:wt({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:(r={window:null==t?void 0:t.window},void 0===r&&(r={}),E((function(e,t){let{pathname:r="/",search:n="",hash:o=""}=C(e.location.hash.substr(1));return w("",{pathname:r,search:n,hash:o},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:S(t))}),(function(e,t){y("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),r)),hydrationData:(null==t?void 0:t.hydrationData)||Rt(),routes:e,mapRouteProperties:xt}).initialize();var r}([or]),fallbackElement:(0,d.jsx)(ir,{})}))},6155:(e,t,r)=>{var n=r(3231).default;const o=document,a="_dark_mode_theme_",i="permanent",s="colorschemechange",l="light",c="dark",u=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;Object.defineProperty(e,r,{enumerable:!0,get(){const e=this.getAttribute(t);return null===e?"":e},set(e){this.setAttribute(t,e)}})};class d extends HTMLElement{static get observedAttributes(){return["mode",l,c,i]}constructor(){super(),n(this,"LOCAL_NANE",a),this.t()}connectedCallback(){u(this,"mode"),u(this,c),u(this,l),function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;Object.defineProperty(e,r,{enumerable:!0,get(){return this.hasAttribute(t)},set(e){e?this.setAttribute(t,""):this.removeAttribute(t)}})}(this,i);const e=localStorage.getItem(a);e&&[l,c].includes(e)&&(this.mode=e,this.permanent=!0),this.permanent&&!e&&localStorage.setItem(a,this.mode);const t=[l,c].includes(e);this.permanent&&e?this.o():(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches&&(this.mode=c,this.o()),window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches&&(this.mode=l,this.o())),this.permanent||t||(window.matchMedia("(prefers-color-scheme: light)").onchange=e=>{this.mode=e.matches?l:c,this.o()},window.matchMedia("(prefers-color-scheme: dark)").onchange=e=>{this.mode=e.matches?c:l,this.o()});new MutationObserver(((e,r)=>{this.mode=o.documentElement.dataset.colorMode,this.permanent&&t&&(localStorage.setItem(a,this.mode),this.i("permanentcolorscheme",{permanent:this.permanent})),this.h(),this.i(s,{colorScheme:this.mode})})).observe(o.documentElement,{attributes:!0}),this.i(s,{colorScheme:this.mode}),this.h()}attributeChangedCallback(e,t,r){if("mode"===e&&t!==r&&[l,c].includes(r)){const e=localStorage.getItem(a);this.mode===e?(this.mode=r,this.h(),this.o()):this.mode&&this.mode!==e&&(this.h(),this.o())}else e!==l&&e!==c||t===r||this.h();"permanent"===e&&"boolean"===typeof this.permanent&&(this.permanent?localStorage.setItem(a,this.mode):localStorage.removeItem(a))}o(){o.documentElement.setAttribute("data-color-mode",this.mode)}h(){this.icon.textContent=this.mode===l?"\ud83c\udf12":"\ud83c\udf1e",this.text.textContent=this.mode===l?this.getAttribute(c):this.getAttribute(l),!this.text.textContent&&this.text.parentElement&&this.text&&this.text.parentElement.removeChild(this.text)}t(){var e=this.attachShadow({mode:"open"});this.label=o.createElement("span"),this.label.setAttribute("class","wrapper"),this.label.onclick=()=>{this.mode=this.mode===l?c:l,this.permanent&&localStorage.setItem(a,this.mode),this.o(),this.h()},e.appendChild(this.label),this.icon=o.createElement("span"),this.label.appendChild(this.icon),this.text=o.createElement("span"),this.label.appendChild(this.text);const t="_dark_mode_style_";if(!o.getElementById(t)){var r=o.createElement("style");r.id=t,r.textContent="\n[data-color-mode*='dark'], [data-color-mode*='dark'] body {\n color-scheme: dark;\n --color-theme-bg: #0d1117;\n --color-theme-text: #c9d1d9;\n background-color: var(--color-theme-bg);\n color: var(--color-theme-text);\n}\n\n[data-color-mode*='light'], [data-color-mode*='light'] body {\n color-scheme: light;\n --color-theme-bg: #fff;\n --color-theme-text: #24292f;\n background-color: var(--color-theme-bg);\n color: var(--color-theme-text);\n}",o.head.appendChild(r)}var n=o.createElement("style");n.textContent="\n .wrapper { cursor: pointer; user-select: none; position: relative; }\n .wrapper > span + span { margin-left: .4rem; }\n ",e.appendChild(n)}i(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))}}customElements.define("dark-mode",d)},1713:e=>{var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"===typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"===typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,l=[],c=!1,u=-1;function d(){c&&s&&(c=!1,s.length?l=s.concat(l):u=-1,l.length&&h())}function h(){if(!c){var e=i(d);c=!0;for(var t=l.length;t;){for(s=l,l=[];++u1)for(var r=1;r{"use strict";function r(e,t){var r=e.length;e.push(t);e:for(;0>>1,o=e[n];if(!(0>>1;na(l,r))ca(u,l)?(e[n]=u,e[c]=r,n=c):(e[n]=l,e[s]=r,n=s);else{if(!(ca(u,r)))break e;e[n]=u,e[c]=r,n=c}}}return t}function a(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var i=performance;t.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}var c=[],u=[],d=1,h=null,f=3,p=!1,m=!1,v=!1,g="function"===typeof setTimeout?setTimeout:null,b="function"===typeof clearTimeout?clearTimeout:null,y="undefined"!==typeof setImmediate?setImmediate:null;function x(e){for(var t=n(u);null!==t;){if(null===t.callback)o(u);else{if(!(t.startTime<=e))break;o(u),t.sortIndex=t.expirationTime,r(c,t)}t=n(u)}}function w(e){if(v=!1,x(e),!m)if(null!==n(c))m=!0,D(S);else{var t=n(u);null!==t&&N(w,t.startTime-e)}}function S(e,r){m=!1,v&&(v=!1,b(k),k=-1),p=!0;var a=f;try{for(x(r),h=n(c);null!==h&&(!(h.expirationTime>r)||e&&!_());){var i=h.callback;if("function"===typeof i){h.callback=null,f=h.priorityLevel;var s=i(h.expirationTime<=r);r=t.unstable_now(),"function"===typeof s?h.callback=s:h===n(c)&&o(c),x(r)}else o(c);h=n(c)}if(null!==h)var l=!0;else{var d=n(u);null!==d&&N(w,d.startTime-r),l=!1}return l}finally{h=null,f=a,p=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var C,E=!1,R=null,k=-1,T=5,P=-1;function _(){return!(t.unstable_now()-Pe||125i?(e.sortIndex=a,r(u,e),null===n(c)&&e===n(u)&&(v?(b(k),k=-1):v=!0,N(w,a-i))):(e.sortIndex=s,r(c,e),m||p||(m=!0,D(S))),e},t.unstable_shouldYield=_,t.unstable_wrapCallback=function(e){var t=f;return function(){var r=f;f=t;try{return e.apply(this,arguments)}finally{f=r}}}},7029:(e,t,r)=>{"use strict";e.exports=r(4478)},1985:e=>{e.exports=function(e,t,r,n){var o=r?r.call(n,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!==typeof e||!e||"object"!==typeof t||!t)return!1;var a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l{"use strict";r.d(t,{ZP:()=>Ft});var n=function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0?E(L,--D):0,j--,10===N&&(j=1,A--),N}function H(){return N=D2||W(N)>3?"":" "}function q(e,t){for(;--t&&H()&&!(N<48||N>102||N>57&&N<65||N>70&&N<97););return Z(e,F()+(t<6&&32==z()&&32==H()))}function V(e){for(;H();)switch(N){case e:return D;case 34:case 39:34!==e&&39!==e&&V(N);break;case 40:41===e&&V(e);break;case 92:H()}return D}function J(e,t){for(;H()&&e+N!==57&&(e+N!==84||47!==z()););return"/*"+Z(t,D-1)+"*"+b(47===e?e:H())}function X(e){for(;!W(z());)H();return Z(e,D)}function Q(e,t){for(var r="",n=0;n6)switch(E(e,t+1)){case 109:if(45!==E(e,t+4))break;case 102:return S(e,/(.+:)(.+)-([^]+)/,"$1"+u+"$2-$3$1"+c+(108==E(e,t+3)?"$3":"$2-$3"))+e;case 115:return~C(e,"stretch")?te(S(e,"stretch","fill-available"),t,r)+e:e}break;case 5152:case 5920:return S(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,r,n,o,a,i,s){return l+r+":"+n+s+(o?l+r+"-span:"+(a?i:+i-+n)+s:"")+e}));case 4949:if(121===E(e,t+6))return S(e,":",":"+u)+e;break;case 6444:switch(E(e,45===E(e,14)?18:11)){case 120:return S(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+u+(45===E(e,14)?"inline-":"")+"box$3$1"+u+"$2$3$1"+l+"$2box$3")+e;case 100:return S(e,":",":"+l)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return S(e,"scroll-","scroll-snap-")+e}return e}function re(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case f:return void(e.return=te(e.value,e.length,r));case m:return Q([M(e,{value:S(e.value,"@","@"+u)})],n);case h:if(e.length)return function(e,t){return e.map(t).join("")}(r=e.props,(function(t){switch(w(t,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":B(M(e,{props:[S(t,/:(read-\w+)/,":"+c+"$1")]})),B(M(e,{props:[t]})),y(e,{props:_(r,n)});break;case"::placeholder":B(M(e,{props:[S(t,/:(plac\w+)/,":"+u+"input-$1")]})),B(M(e,{props:[S(t,/:(plac\w+)/,":"+c+"$1")]})),B(M(e,{props:[S(t,/:(plac\w+)/,l+"input-$1")]})),B(M(e,{props:[t]})),y(e,{props:_(r,n)})}return""}))}}function ne(e){return K(oe("",null,null,null,[""],e=$(e),0,[0],e))}function oe(e,t,r,n,o,a,i,s,l){for(var c=0,u=0,d=i,h=0,f=0,p=0,m=1,v=1,g=1,y=0,x="",w=o,R=a,T=n,_=x;v;)switch(p=y,y=H()){case 40:if(108!=p&&58==E(_,d-1)){-1!=C(_+=S(G(y),"&","&\f"),"&\f")&&(g=-1);break}case 34:case 39:case 91:_+=G(y);break;case 9:case 10:case 13:case 32:_+=Y(p);break;case 92:_+=q(F()-1,7);continue;case 47:switch(z()){case 42:case 47:P(ie(J(H(),F()),t,r,l),l);break;default:_+="/"}break;case 123*m:s[c++]=k(_)*g;case 125*m:case 59:case 0:switch(y){case 0:case 125:v=0;case 59+u:-1==g&&(_=S(_,/\f/g,"")),f>0&&k(_)-d&&P(f>32?se(_+";",n,r,d-1,l):se(S(_," ","")+";",n,r,d-2,l),l);break;case 59:_+=";";default:if(P(T=ae(_,t,r,c,u,o,s,x,w=[],R=[],d,a),a),123===y)if(0===u)oe(_,t,T,T,w,a,d,s,R);else switch(99===h&&110===E(_,3)?100:h){case 100:case 108:case 109:case 115:oe(e,T,T,n&&P(ae(e,T,T,0,0,o,s,x,o,w=[],d,R),R),o,R,d,s,n?w:R);break;default:oe(_,T,T,T,[""],R,0,s,R)}}c=u=f=0,m=g=1,x=_="",d=i;break;case 58:d=1+k(_),f=p;default:if(m<1)if(123==y)--m;else if(125==y&&0==m++&&125==U())continue;switch(_+=b(y),y*m){case 38:g=u>0?1:(_+="\f",-1);break;case 44:s[c++]=(k(_)-1)*g,g=1;break;case 64:45===z()&&(_+=G(H())),h=z(),u=d=k(x=_+=X(F())),y++;break;case 45:45===p&&2==k(_)&&(m=0)}}return a}function ae(e,t,r,n,o,a,i,s,l,c,u,d){for(var f=o-1,p=0===o?a:[""],m=T(p),v=0,b=0,y=0;v0?p[w]+" "+C:S(C,/&\f/g,p[w])))&&(l[y++]=E);return I(e,t,r,0===o?h:s,l,c,u,d)}function ie(e,t,r,n){return I(e,t,r,d,b(N),R(e,2,-2),0,n)}function se(e,t,r,n,o){return I(e,t,r,f,R(e,0,n),R(e,n+1,-1),n,o)}var le={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},ce=r(1713),ue="undefined"!=typeof ce&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}&&({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_ATTR||{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_ATTR)||"data-styled",de="undefined"!=typeof window&&"HTMLElement"in window,he=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof ce&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_DISABLE_SPEEDY&&""!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_DISABLE_SPEEDY?"false"!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_DISABLE_SPEEDY&&{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof ce&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_DISABLE_SPEEDY&&""!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_DISABLE_SPEEDY&&("false"!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_DISABLE_SPEEDY&&{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_DISABLE_SPEEDY)),fe=(new Set,Object.freeze([])),pe=Object.freeze({});function me(e,t,r){return void 0===r&&(r=pe),e.theme!==r.theme&&e.theme||t||r.theme}var ve=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),ge=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,be=/(^-|-$)/g;function ye(e){return e.replace(ge,"-").replace(be,"")}var xe=/(a)(d)/gi,we=function(e){return String.fromCharCode(e+(e>25?39:97))};function Se(e){var t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=we(t%52)+r;return(we(t%52)+r).replace(xe,"$1-$2")}var Ce,Ee=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},Re=function(e){return Ee(5381,e)};function ke(e){return Se(Re(e)>>>0)}function Te(e){return"string"==typeof e&&!0}var Pe="function"==typeof Symbol&&Symbol.for,_e=Pe?Symbol.for("react.memo"):60115,Ae=Pe?Symbol.for("react.forward_ref"):60112,je={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Oe={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},De={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Ne=((Ce={})[Ae]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Ce[_e]=De,Ce);function Le(e){return("type"in(t=e)&&t.type.$$typeof)===_e?De:"$$typeof"in e?Ne[e.$$typeof]:je;var t}var Ie=Object.defineProperty,Me=Object.getOwnPropertyNames,Be=Object.getOwnPropertySymbols,Ue=Object.getOwnPropertyDescriptor,He=Object.getPrototypeOf,ze=Object.prototype;function Fe(e,t,r){if("string"!=typeof t){if(ze){var n=He(t);n&&n!==ze&&Fe(e,n,r)}var o=Me(t);Be&&(o=o.concat(Be(t)));for(var a=Le(e),i=Le(t),s=0;s0?" Args: ".concat(t.join(", ")):""))}var Je=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,r=0;r=this.groupSizes.length){for(var r=this.groupSizes,n=r.length,o=n;e>=o;)if((o<<=1)<0)throw Ve(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(r),this.length=o;for(var a=n;a=this.length||0===this.groupSizes[e])return t;for(var r=this.groupSizes[e],n=this.indexOfGroup(e),o=n+r,a=n;a=0){var r=document.createTextNode(t);return this.element.insertBefore(r,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e0&&(l+="".concat(e,","))})),n+="".concat(i).concat(s,'{content:"').concat(l,'"}').concat("/*!sc*/\n")},a=0;a0?".".concat(t):e},u=l.slice();u.push((function(e){e.type===h&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(mt,r).replace(n,c))})),i.prefix&&u.push(re),u.push(ee);var d=function(e,o,a,s){void 0===o&&(o=""),void 0===a&&(a=""),void 0===s&&(s="&"),t=s,r=o,n=new RegExp("\\".concat(r,"\\b"),"g");var l=e.replace(vt,""),c=ne(a||o?"".concat(a," ").concat(o," { ").concat(l," }"):l);i.namespace&&(c=gt(c,i.namespace));var d,h=[];return Q(c,function(e){var t=T(e);return function(r,n,o,a){for(var i="",s=0;s="A"&&e<="Z"};function Tt(e){for(var t="",r=0;r>>0);if(!t.hasNameForId(this.componentId,a)){var i=r(o,".".concat(a),void 0,this.componentId);t.insertRules(this.componentId,a,i)}n=$e(n,a),this.staticRulesId=a}else{for(var s=Ee(this.baseHash,r.hash),l="",c=0;c>>0);t.hasNameForId(this.componentId,h)||t.insertRules(this.componentId,h,r(l,".".concat(h),void 0,this.componentId)),n=$e(n,h)}}return n},e}(),Nt=a.createContext(void 0);Nt.Consumer;var Lt={};new Set;function It(e,t,r){var o=We(e),i=e,s=!Te(e),l=t.attrs,c=void 0===l?fe:l,u=t.componentId,d=void 0===u?function(e,t){var r="string"!=typeof e?"sc":ye(e);Lt[r]=(Lt[r]||0)+1;var n="".concat(r,"-").concat(ke("6.0.8"+r+Lt[r]));return t?"".concat(t,"-").concat(n):n}(t.displayName,t.parentComponentId):u,h=t.displayName,f=(void 0===h&&function(e){Te(e)?"styled.".concat(e):"Styled(".concat(function(e){return e.displayName||e.name||"Component"}(e),")")}(e),t.displayName&&t.componentId?"".concat(ye(t.displayName),"-").concat(t.componentId):t.componentId||d),p=o&&i.attrs?i.attrs.concat(c).filter(Boolean):c,m=t.shouldForwardProp;if(o&&i.shouldForwardProp){var v=i.shouldForwardProp;if(t.shouldForwardProp){var g=t.shouldForwardProp;m=function(e,t){return v(e,t)&&g(e,t)}}else m=v}var b=new Dt(r,f,o?i.componentStyle:void 0);var y=a.forwardRef((function(e,t){return function(e,t,r){var o=e.attrs,i=e.componentStyle,s=e.defaultProps,l=e.foldedComponentIds,c=e.styledComponentId,u=e.target,d=a.useContext(Nt),h=Ct(),f=e.shouldForwardProp||h.shouldForwardProp,p=function(e,t,r){for(var o,a=n(n({},t),{className:void 0,theme:r}),i=0;i2&&pt.registerId(this.componentId+e),this.removeStyles(e,r),this.createStyles(e,t,r,n)}}();(function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString(),r=st(),n=Ke([r&&'nonce="'.concat(r,'"'),"".concat(ue,'="true"'),"".concat("data-styled-version",'="').concat("6.0.8",'"')].filter(Boolean)," ");return"")},this.getStyleTags=function(){if(e.sealed)throw Ve(2);return e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)throw Ve(2);var r=((t={})[ue]="",t["data-styled-version"]="6.0.8",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),o=st();return o&&(r.nonce=o),[a.createElement("style",n({},r,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new pt({isServer:!0}),this.sealed=!1}e.prototype.collectStyles=function(e){if(this.sealed)throw Ve(2);return a.createElement(Et,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){throw Ve(3)}})(),"__sc-".concat(ue,"__")},7240:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BACKGROUND_IMG:()=>h,Pointer:()=>u,default:()=>p});var n=r(5773),o=r(808),a=r(8573),i=r(6493),s=r(6813),l=r(4760),c=["className","prefixCls","left","top","style","fillProps"],u=e=>{var{className:t,prefixCls:r,left:a,top:i,style:s,fillProps:u}=e,d=(0,o.Z)(e,c),h=(0,n.Z)({},s,{position:"absolute",left:a,top:i}),f=(0,n.Z)({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},null==u?void 0:u.style,{transform:a?"translate(-9px, -1px)":"translate(-1px, -9px)"});return(0,l.jsx)("div",(0,n.Z)({className:r+"-pointer "+(t||""),style:h},d,{children:(0,l.jsx)("div",(0,n.Z)({className:r+"-fill"},u,{style:f}))}))},d=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],h="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",f=a.forwardRef(((e,t)=>{var{prefixCls:r="w-color-alpha",className:a,hsva:c,background:f,bgProps:p={},innerProps:m={},pointerProps:v={},radius:g=0,width:b,height:y=16,direction:x="horizontal",style:w,onChange:S,pointer:C}=e,E=(0,o.Z)(e,d),R=e=>{S&&S((0,n.Z)({},c,{a:"horizontal"===x?e.left:e.top}),e)},k=(0,i.hsvaToHslaString)(Object.assign({},c,{a:1})),T="linear-gradient(to "+("horizontal"===x?"right":"bottom")+", rgba(244, 67, 54, 0) 0%, "+k+" 100%)",P={};"horizontal"===x?P.left=100*c.a+"%":P.top=100*c.a+"%";var _=(0,n.Z)({"--alpha-background-color":"#fff","--alpha-pointer-background-color":"rgb(248, 248, 248)","--alpha-pointer-box-shadow":"rgb(0 0 0 / 37%) 0px 1px 4px 0px",borderRadius:g,background:"url("+h+") left center",backgroundColor:"var(--alpha-background-color)"},w,{position:"relative"},{width:b,height:y}),A=C&&"function"===typeof C?C((0,n.Z)({prefixCls:r},v,P)):(0,l.jsx)(u,(0,n.Z)({},v,{prefixCls:r},P));return(0,l.jsxs)("div",(0,n.Z)({},E,{className:[r,r+"-"+x,a||""].filter(Boolean).join(" "),style:_,ref:t,children:[(0,l.jsx)("div",(0,n.Z)({},p,{style:(0,n.Z)({inset:0,position:"absolute",background:f||T,borderRadius:g},p.style)})),(0,l.jsx)(s.default,(0,n.Z)({},m,{style:(0,n.Z)({},m.style,{inset:0,zIndex:1,position:"absolute"}),onMove:R,onDown:R,children:A}))]}))}));f.displayName="Alpha";const p=f},7961:(e,t,r)=>{"use strict";r.d(t,{Q:()=>o});var n=r(6493),o=e=>{if(!e)return"#ffffff";var t=(0,n.color)(e);return(299*t.rgb.r+587*t.rgb.g+114*t.rgb.b)/1e3>=128?"#000000":"#ffffff"}},6493:(e,t,r)=>{"use strict";r.r(t),r.d(t,{color:()=>I,equalColorObjects:()=>o.zl,equalColorString:()=>o.SJ,equalHex:()=>o.Gp,getContrastingColor:()=>a.Q,hexToHsva:()=>k,hexToRgba:()=>T,hslStringToHsla:()=>f,hslStringToHsva:()=>m,hslaStringToHsva:()=>p,hslaToHsl:()=>O,hslaToHsva:()=>v,hsvStringToHsva:()=>w,hsvaStringToHsva:()=>b,hsvaToHex:()=>D,hsvaToHexa:()=>N,hsvaToHslString:()=>c,hsvaToHsla:()=>g,hsvaToHslaString:()=>h,hsvaToHsv:()=>L,hsvaToHsvString:()=>u,hsvaToHsvaString:()=>d,hsvaToRgbString:()=>_,hsvaToRgba:()=>P,hsvaToRgbaString:()=>A,parseHue:()=>x,rgbStringToHsva:()=>C,rgbaStringToHsva:()=>S,rgbaToHex:()=>E,rgbaToHexa:()=>R,rgbaToHsva:()=>l,rgbaToRgb:()=>j,validHex:()=>o.Ff});var n=r(5773),o=r(5301),a=r(7961),i=255,s=100,l=e=>{var{r:t,g:r,b:n,a:o}=e,a=Math.max(t,r,n),l=a-Math.min(t,r,n),c=l?a===t?(r-n)/l:a===r?2+(n-t)/l:4+(t-r)/l:0;return{h:60*(c<0?c+6:c),s:a?l/a*s:0,v:a/i*s,a:o}},c=e=>{var{h:t,s:r,l:n}=g(e);return"hsl("+t+", "+Math.round(r)+"%, "+Math.round(n)+"%)"},u=e=>{var{h:t,s:r,v:n}=e;return"hsv("+t+", "+r+"%, "+n+"%)"},d=e=>{var{h:t,s:r,v:n,a:o}=e;return"hsva("+t+", "+r+"%, "+n+"%, "+o+")"},h=e=>{var{h:t,s:r,l:n,a:o}=g(e);return"hsla("+t+", "+r+"%, "+n+"%, "+o+")"},f=e=>{var[t,r,n,o]=(e.match(/\d+/g)||[]).map(Number);return{h:t,s:r,l:n,a:o}},p=e=>{var t=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?v({h:x(t[1],t[2]),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)}):{h:0,s:0,v:0,a:1}},m=p,v=e=>{var{h:t,s:r,l:n,a:o}=e;return{h:t,s:(r*=(n<50?n:s-n)/s)>0?2*r/(n+r)*s:0,v:n+r,a:o}},g=e=>{var{h:t,s:r,v:n,a:o}=e,a=(200-r)*n/s;return{h:t,s:a>0&&a<200?r*n/s/(a<=s?a:200-a)*s:0,l:a/2,a:o}},b=e=>{var t=/hsva?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?{h:x(t[1],t[2]),s:Number(t[3]),v:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?s:1)}:{h:0,s:0,v:0,a:1}},y={grad:.9,turn:360,rad:360/(2*Math.PI)},x=function(e,t){return void 0===t&&(t="deg"),Number(e)*(y[t]||1)},w=b,S=e=>{var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?l({r:Number(t[1])/(t[2]?s/i:1),g:Number(t[3])/(t[4]?s/i:1),b:Number(t[5])/(t[6]?s/i:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?s:1)}):{h:0,s:0,v:0,a:1}},C=S,E=e=>{var t,{r:r,g:n,b:o}=e;return"#"+(t=(r<<16|n<<8|o).toString(16),new Array(7-t.length).join("0")+t)},R=e=>{var{r:t,g:r,b:n,a:o}=e,a="number"===typeof o&&(255*o|256).toString(16).slice(1);return""+E({r:t,g:r,b:n,a:o})+(a||"")},k=e=>l(T(e)),T=e=>{var t=e.replace("#","");/^#?/.test(e)&&3===t.length&&(e="#"+t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));var r=new RegExp("[A-Za-z0-9]{2}","g"),[n,o,a=0,s]=e.match(r).map((e=>parseInt(e,16)));return{r:n,g:o,b:a,a:(null!=s?s:255)/i}},P=e=>{var{h:t,s:r,v:o,a:a}=e,l=t/60,c=r/s,u=o/s,d=Math.floor(l)%6,h=l-Math.floor(l),f=i*u*(1-c),p=i*u*(1-c*h),m=i*u*(1-c*(1-h));u*=i;var v={};switch(d){case 0:v.r=u,v.g=m,v.b=f;break;case 1:v.r=p,v.g=u,v.b=f;break;case 2:v.r=f,v.g=u,v.b=m;break;case 3:v.r=f,v.g=p,v.b=u;break;case 4:v.r=m,v.g=f,v.b=u;break;case 5:v.r=u,v.g=f,v.b=p}return v.r=Math.round(v.r),v.g=Math.round(v.g),v.b=Math.round(v.b),(0,n.Z)({},v,{a:a})},_=e=>{var{r:t,g:r,b:n}=P(e);return"rgb("+t+", "+r+", "+n+")"},A=e=>{var{r:t,g:r,b:n,a:o}=P(e);return"rgba("+t+", "+r+", "+n+", "+o+")"},j=e=>{var{r:t,g:r,b:n}=e;return{r:t,g:r,b:n}},O=e=>{var{h:t,s:r,l:n}=e;return{h:t,s:r,l:n}},D=e=>E(P(e)),N=e=>R(P(e)),L=e=>{var{h:t,s:r,v:n}=e;return{h:t,s:r,v:n}},I=e=>{var t,r,n,a,i,s,l,c;return"string"===typeof e&&(0,o.Ff)(e)?(s=k(e),l=e):"string"!==typeof e&&(s=e),s&&(n=L(s),i=g(s),a=P(s),c=R(a),l=D(s),r=O(i),t=j(a)),{rgb:t,hsl:r,hsv:n,rgba:a,hsla:i,hsva:s,hex:l,hexa:c}}},5301:(e,t,r)=>{"use strict";r.d(t,{Ff:()=>s,Gp:()=>i,SJ:()=>a,zl:()=>o});var n=r(6493),o=(e,t)=>{if(e===t)return!0;for(var r in e)if(e[r]!==t[r])return!1;return!0},a=(e,t)=>e.replace(/\s/g,"")===t.replace(/\s/g,""),i=(e,t)=>e.toLowerCase()===t.toLowerCase()||o((0,n.hexToRgba)(e),(0,n.hexToRgba)(t)),s=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e)},3789:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>d});var n=r(5773),o=r(808),a=r(8573),i=r(8702),s=r(6493),l=r(4760),c=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],u=a.forwardRef(((e,t)=>{var{prefixCls:r="w-color-editable-input-rgba",hsva:a,placement:u="bottom",rProps:d={},gProps:h={},bProps:f={},aProps:p={},className:m,style:v,onChange:g}=e,b=(0,o.Z)(e,c),y=a?(0,s.hsvaToRgba)(a):{};function x(e){var t=Number(e.target.value);t&&t>255&&(e.target.value="255"),t&&t<0&&(e.target.value="0")}var w=(e,t,r)=>{"number"===typeof e&&("a"===t&&(e<0&&(e=0),e>100&&(e=100),g&&g((0,s.color)((0,s.rgbaToHsva)((0,n.Z)({},y,{a:e/100}))))),e>255&&(e=255,r.target.value="255"),e<0&&(e=0,r.target.value="0"),"r"===t&&g&&g((0,s.color)((0,s.rgbaToHsva)((0,n.Z)({},y,{r:e})))),"g"===t&&g&&g((0,s.color)((0,s.rgbaToHsva)((0,n.Z)({},y,{g:e})))),"b"===t&&g&&g((0,s.color)((0,s.rgbaToHsva)((0,n.Z)({},y,{b:e})))))};return(0,l.jsxs)("div",(0,n.Z)({ref:t,className:[r,m||""].filter(Boolean).join(" ")},b,{style:(0,n.Z)({fontSize:11,display:"flex"},v),children:[(0,l.jsx)(i.default,(0,n.Z)({label:"R",value:y.r||0,onBlur:x,placement:u,onChange:(e,t)=>w(t,"r",e)},d,{style:(0,n.Z)({},d.style)})),(0,l.jsx)(i.default,(0,n.Z)({label:"G",value:y.g||0,onBlur:x,placement:u,onChange:(e,t)=>w(t,"g",e)},h,{style:(0,n.Z)({marginLeft:5},d.style)})),(0,l.jsx)(i.default,(0,n.Z)({label:"B",value:y.b||0,onBlur:x,placement:u,onChange:(e,t)=>w(t,"b",e)},f,{style:(0,n.Z)({marginLeft:5},f.style)})),p&&(0,l.jsx)(i.default,(0,n.Z)({label:"A",value:y.a?parseInt(String(100*y.a),10):0,onBlur:x,placement:u,onChange:(e,t)=>w(t,"a",e)},p,{style:(0,n.Z)({marginLeft:5},p.style)}))]}))}));u.displayName="EditableInputRGBA";const d=u},8702:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>c});var n=r(5773),o=r(808),a=r(8573),i=r(4760),s=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur"],l=a.forwardRef(((e,t)=>{var{prefixCls:r="w-color-editable-input",placement:l="bottom",label:c,value:u,className:d,style:h,labelStyle:f,inputStyle:p,onChange:m,onBlur:v}=e,g=(0,o.Z)(e,s),[b,y]=(0,a.useState)(u),x=(0,a.useRef)(!1);(0,a.useEffect)((()=>{e.value!==b&&(x.current||y(e.value))}),[e.value]);var w={};"bottom"===l&&(w.flexDirection="column"),"top"===l&&(w.flexDirection="column-reverse"),"left"===l&&(w.flexDirection="row-reverse");var S=(0,n.Z)({"--editable-input-label-color":"rgb(153, 153, 153)","--editable-input-box-shadow":"rgb(204 204 204) 0px 0px 0px 1px inset","--editable-input-color":"#666",position:"relative",alignItems:"center",display:"flex",fontSize:11},w,h),C=(0,n.Z)({width:"100%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,fontSize:11,background:"transparent",boxSizing:"border-box",border:"none",color:"var(--editable-input-color)",boxShadow:"var(--editable-input-box-shadow)"},p);return(0,i.jsxs)("div",{className:[r,d||""].filter(Boolean).join(" "),style:S,children:[(0,i.jsx)("input",(0,n.Z)({ref:t,value:b,onChange:function(e,t){var r=(t||e.target.value).trim().replace(/^#/,"");/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(r)&&m&&m(e,r);var n=(e=>Number(String(e).replace(/%/g,"")))(r);isNaN(n)||m&&m(e,n),y(r)},onBlur:function(t){x.current=!1,y(e.value),v&&v(t)},autoComplete:"off",onFocus:()=>x.current=!0},g,{style:C})),c&&(0,i.jsx)("span",{style:(0,n.Z)({color:"var(--editable-input-label-color)",textTransform:"capitalize"},f),children:c})]})}));l.displayName="EditableInput";const c=l},7864:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});var n=r(5773),o=r(808),a=r(8573),i=r(7240),s=r(4760),l=["prefixCls","className","hue","onChange","direction"],c=a.forwardRef(((e,t)=>{var{prefixCls:r="w-color-hue",className:a,hue:c=0,onChange:u,direction:d="horizontal"}=e,h=(0,o.Z)(e,l);return(0,s.jsx)(i.default,(0,n.Z)({ref:t,className:r+" "+(a||"")},h,{direction:d,background:"linear-gradient(to "+("horizontal"===d?"right":"bottom")+", rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)",hsva:{h:c,s:100,v:100,a:c/360},onChange:(e,t)=>{u&&u({h:"horizontal"===d?360*t.left:360*t.top})}}))}));c.displayName="Hue";const u=c},6319:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>h});var n=r(5773),o=r(808),a=r(8573),i=r(6493),s=r(6813),l=r(4760),c=e=>{var{className:t,color:r,left:n,top:o,prefixCls:i}=e,s={position:"absolute",top:o,left:n},c={"--saturation-pointer-box-shadow":"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",width:6,height:6,transform:"translate(-3px, -3px)",boxShadow:"var(--saturation-pointer-box-shadow)",borderRadius:"50%",backgroundColor:r};return(0,a.useMemo)((()=>(0,l.jsx)("div",{className:i+"-pointer "+(t||""),style:s,children:(0,l.jsx)("div",{className:i+"-fill",style:c})})),[o,n,r,t,i])},u=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],d=a.forwardRef(((e,t)=>{var r,{prefixCls:d="w-color-saturation",radius:h=0,pointer:f,className:p,hue:m=0,style:v,hsva:g,onChange:b}=e,y=(0,o.Z)(e,u),x=(0,n.Z)({width:200,height:200,borderRadius:h},v,{position:"relative"}),w=(e,t)=>{b&&g&&b({h:g.h,s:100*e.left,v:100*(1-e.top),a:g.a})},S=(0,a.useMemo)((()=>{if(!g)return null;var e={top:100-g.v+"%",left:g.s+"%",color:(0,i.hsvaToHslaString)(g)};return f&&"function"===typeof f?f((0,n.Z)({prefixCls:d},e)):(0,l.jsx)(c,(0,n.Z)({prefixCls:d},e))}),[g,f,d]);return(0,l.jsx)(s.default,(0,n.Z)({className:[d,p||""].filter(Boolean).join(" ")},y,{style:(0,n.Z)({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+(null!=(r=null==g?void 0:g.h)?r:m)+", 100%, 50%))"},x),ref:t,onMove:w,onDown:w,children:S}))}));d.displayName="Saturation";const h=d},1507:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var n=r(5773),o=r(808),a=r(8573),i=r(6319),s=r(7240),l=r(8702),c=r(3789),u=r(7864),d=r(5301),h=r(6493),f=r(9887),p=r(4760),m=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],v=["#D0021B","#F5A623","#f8e61b","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],g=e=>(0,p.jsx)("div",{style:{boxShadow:"rgb(0 0 0 / 60%) 0px 0px 2px",width:4,top:1,bottom:1,left:e.left,borderRadius:1,position:"absolute",backgroundColor:"#fff"}}),b=a.forwardRef(((e,t)=>{var{prefixCls:r="w-color-sketch",className:b,onChange:y,width:x=218,presetColors:w=v,color:S,editableDisable:C=!0,disableAlpha:E=!1,style:R}=e,k=(0,o.Z)(e,m),[T,P]=(0,a.useState)({h:209,s:36,v:90,a:1});(0,a.useEffect)((()=>{"string"===typeof S&&(0,d.Ff)(S)&&P((0,h.hexToHsva)(S)),"object"===typeof S&&P(S)}),[S]);var _=e=>{P(e),y&&y((0,h.color)(e))},A=(0,n.Z)({"--sketch-background":"rgb(255, 255, 255)","--sketch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px, rgb(0 0 0 / 15%) 0px 8px 16px","--sketch-swatch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset","--sketch-alpha-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset, rgb(0 0 0 / 25%) 0px 0px 4px inset","--sketch-swatch-border-top":"1px solid rgb(238, 238, 238)",background:"var(--sketch-background)",borderRadius:4,boxShadow:"var(--sketch-box-shadow)",width:x},R),j={borderRadius:2,background:(0,h.hsvaToRgbaString)(T),boxShadow:"var(--sketch-alpha-box-shadow)"};return(0,p.jsxs)("div",(0,n.Z)({},k,{className:r+" "+(b||""),ref:t,style:A,children:[(0,p.jsxs)("div",{style:{padding:"10px 10px 8px"},children:[(0,p.jsx)(i.default,{hsva:T,style:{width:"auto",height:150},onChange:e=>_((0,n.Z)({},T,e,{a:T.a}))}),(0,p.jsxs)("div",{style:{display:"flex",marginTop:4},children:[(0,p.jsxs)("div",{style:{flex:1},children:[(0,p.jsx)(u.default,{width:"auto",height:10,hue:T.h,pointer:g,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:e=>_((0,n.Z)({},T,e))}),!E&&(0,p.jsx)(s.default,{width:"auto",height:10,hsva:T,pointer:g,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:e=>_((0,n.Z)({},T,{a:e.a}))})]}),!E&&(0,p.jsx)(s.default,{width:24,height:24,hsva:T,radius:2,style:{marginLeft:4},bgProps:{style:{background:"transparent"}},innerProps:{style:j},pointer:()=>(0,p.jsx)(a.Fragment,{})})]})]}),C&&(0,p.jsxs)("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[(0,p.jsx)(l.default,{label:"Hex",value:(0,h.hsvaToHex)(T).replace(/^#/,"").toLocaleUpperCase(),onChange:(e,t)=>{var r;"string"===typeof(r=t)&&(0,d.Ff)(r)&&/(3|6)/.test(String(r.length))&&_((0,h.hexToHsva)(r))},style:{minWidth:58}}),(0,p.jsx)(c.default,{hsva:T,style:{marginLeft:6},aProps:!E&&{},onChange:e=>_(e.hsva)})]}),w&&w.length>0&&(0,p.jsx)(f.default,{style:{borderTop:"var(--sketch-swatch-border-top)",paddingTop:10,paddingLeft:10},colors:w,color:(0,h.hsvaToHex)(T),onChange:e=>_(e),rectProps:{style:{marginRight:10,marginBottom:10,borderRadius:3,boxShadow:"var(--sketch-swatch-box-shadow)"}}})]}))}));b.displayName="Sketch";const y=b},9887:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});var n=r(5773),o=r(808),a=r(8573),i=r(6493),s=r(4760),l=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],c=a.forwardRef(((e,t)=>{var{prefixCls:r="w-color-swatch",className:c,color:u,colors:d=[],style:h,rectProps:f={},onChange:p,addonAfter:m,addonBefore:v,rectRender:g}=e,b=(0,o.Z)(e,l),y=(0,n.Z)({"--swatch-background-color":"rgb(144, 19, 254)",background:"var(--swatch-background-color)",height:15,width:15,marginRight:5,marginBottom:5,cursor:"pointer",position:"relative",outline:"none",borderRadius:2},f.style),x=(e,t)=>{p&&p((0,i.hexToHsva)(e),(0,i.color)((0,i.hexToHsva)(e)),t)};return(0,s.jsxs)("div",(0,n.Z)({ref:t},b,{className:[r,c||""].filter(Boolean).join(" "),style:(0,n.Z)({display:"flex",flexWrap:"wrap",position:"relative"},h),children:[v&&a.isValidElement(v)&&v,d&&Array.isArray(d)&&d.map(((e,t)=>{var r="",o="";"string"===typeof e&&(r=e,o=e),"object"===typeof e&&e.color&&(r=e.title||e.color,o=e.color);var i=u&&u.toLocaleLowerCase()===o.toLocaleLowerCase(),l=g&&g({key:t,title:r,color:o,checked:!!i,style:(0,n.Z)({},y,{background:o}),onClick:e=>x(o,e)});if(l)return l;var c=f.children&&a.isValidElement(f.children)?a.cloneElement(f.children,{color:o,checked:i}):null;return(0,s.jsx)("div",(0,n.Z)({tabIndex:0,title:r,onClick:e=>x(o,e)},f,{children:c,style:(0,n.Z)({},y,{background:o})}),t)})),m&&a.isValidElement(m)&&m]}))}));c.displayName="Swatch";const u=c},6813:(e,t,r)=>{"use strict";r.r(t),r.d(t,{clamp:()=>c,default:()=>p,getRelativePosition:()=>u,isTouch:()=>s,preventDefaultMove:()=>l,useEventCallback:()=>i});var n=r(5773),o=r(808),a=r(8573);function i(e){var t=(0,a.useRef)(e);return(0,a.useEffect)((()=>{t.current=e})),(0,a.useCallback)(((e,r)=>t.current&&t.current(e,r)),[])}var s=e=>"touches"in e,l=e=>{!s(e)&&e.preventDefault&&e.preventDefault()},c=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e{var r=e.getBoundingClientRect(),n=s(t)?t.touches[0]:t;return{left:c((n.pageX-(r.left+window.pageXOffset))/r.width),top:c((n.pageY-(r.top+window.pageYOffset))/r.height),width:r.width,height:r.height,x:n.pageX-(r.left+window.pageXOffset),y:n.pageY-(r.top+window.pageYOffset)}},d=r(4760),h=["prefixCls","className","onMove","onDown"],f=a.forwardRef(((e,t)=>{var{prefixCls:r="w-color-interactive",className:c,onMove:f,onDown:p}=e,m=(0,o.Z)(e,h),v=(0,a.useRef)(null),g=(0,a.useRef)(!1),[b,y]=(0,a.useState)(!1),x=i(f),w=i(p),S=(0,a.useCallback)((e=>{l(e),(s(e)?e.touches.length>0:e.buttons>0)&&v.current?x&&x(u(v.current,e),e):y(!1)}),[x]),C=(0,a.useCallback)((()=>y(!1)),[]),E=(0,a.useCallback)((e=>{var t=e?window.addEventListener:window.removeEventListener;t(g.current?"touchmove":"mousemove",S),t(g.current?"touchend":"mouseup",C)}),[]);(0,a.useEffect)((()=>(E(b),()=>{b&&E(!1)})),[b,E]);var R=(0,a.useCallback)((e=>{l(e.nativeEvent),(e=>!(g.current&&!s(e))&&(g.current=s(e),!0))(e.nativeEvent)&&(w&&w(u(v.current,e.nativeEvent),e.nativeEvent),y(!0))}),[w]);return(0,d.jsx)("div",(0,n.Z)({},m,{className:[r,c||""].filter(Boolean).join(" "),style:(0,n.Z)({},m.style,{touchAction:"none"}),ref:v,tabIndex:0,onMouseDown:R,onTouchStart:R}))}));f.displayName="Interactive";const p=f},3231:(e,t,r)=>{var n=r(4040);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},6027:(e,t,r)=>{var n=r(7501).default;e.exports=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},4040:(e,t,r)=>{var n=r(7501).default,o=r(6027);e.exports=function(e){var t=o(e,"string");return"symbol"===n(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},7501:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},5773:(e,t,r)=>{"use strict";function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;tn})},808:(e,t,r)=>{"use strict";function n(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}r.d(t,{Z:()=>n})},669:(e,t,r)=>{"use strict";function n(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}r.d(t,{Z:()=>n})}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}r.m=e,(()=>{var e=[];r.O=(t,n,o,a)=>{if(!n){var i=1/0;for(u=0;u=a)&&Object.keys(r.O).every((e=>r.O[e](n[l])))?n.splice(l--,1):(s=!1,a0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[n,o,a]}})(),r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;r.t=function(n,o){if(1&o&&(n=this(n)),8&o)return n;if("object"===typeof n&&n){if(4&o&&n.__esModule)return n;if(16&o&&"function"===typeof n.then)return n}var a=Object.create(null);r.r(a);var i={};e=e||[null,t({}),t([]),t(t)];for(var s=2&o&&n;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((e=>i[e]=()=>n[e]));return i.default=()=>n,r.d(a,i),a}})(),r.d=(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.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>"static/js/"+(269===e?"refractor-vendor":e)+"."+{2:"e3b9569b",3:"e49a76e3",18:"54b953d4",31:"76c93261",66:"102649ab",94:"4a1e40b4",107:"f8ef98e9",113:"81fe9207",118:"a2829275",221:"898895f7",231:"2acf64c2",269:"764aade8",281:"7701c91b",297:"2999625e",299:"4d04e559",301:"6ef1b1ca",308:"9863b32d",309:"c65600e1",361:"4b34de40",426:"c76c99eb",446:"143df30c",458:"b8eac3d2",466:"3d56ca60",469:"52dcbe0e",494:"09a1ed39",536:"355f6fdb",546:"117e7600",569:"3a3267ac",616:"4b307a7d",620:"d3f8992d",624:"85d8dd56",632:"a2a0ae68",649:"267f3f39",652:"b0572e00",691:"609bb527",721:"33de9a18",756:"d4c97a8a",781:"94394555",785:"e66d3501",852:"dd0a0261",875:"d699f24c",919:"fd6405c6",952:"247c9658",955:"a7b0e6df",982:"a12d661f",995:"2c605ed7",996:"ad604e30"}[e]+".chunk.js",r.miniCssF=e=>"static/css/"+e+"."+{281:"c7b2c18c",616:"ec33dedb"}[e]+".chunk.css",r.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="website:";r.l=(n,o,a,i)=>{if(e[n])e[n].push(o);else{var s,l;if(void 0!==a)for(var c=document.getElementsByTagName("script"),u=0;u{s.onerror=s.onload=null,clearTimeout(f);var o=e[n];if(delete e[n],s.parentNode&&s.parentNode.removeChild(s),o&&o.forEach((e=>e(r))),t)return t(r)},f=setTimeout(h.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=h.bind(null,s.onerror),s.onload=h.bind(null,s.onload),l&&document.head.appendChild(s)}}})(),r.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="./",(()=>{if("undefined"!==typeof document){var e=e=>new Promise(((t,n)=>{var o=r.miniCssF(e),a=r.p+o;if(((e,t)=>{for(var r=document.getElementsByTagName("link"),n=0;n{var a=document.createElement("link");a.rel="stylesheet",a.type="text/css",a.onerror=a.onload=r=>{if(a.onerror=a.onload=null,"load"===r.type)n();else{var i=r&&("load"===r.type?"missing":r.type),s=r&&r.target&&r.target.href||t,l=new Error("Loading CSS chunk "+e+" failed.\n("+s+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=i,l.request=s,a.parentNode&&a.parentNode.removeChild(a),o(l)}},a.href=t,r?r.parentNode.insertBefore(a,r.nextSibling):document.head.appendChild(a)})(e,a,null,t,n)})),t={179:0};r.f.miniCss=(r,n)=>{t[r]?n.push(t[r]):0!==t[r]&&{281:1,616:1}[r]&&n.push(t[r]=e(r).then((()=>{t[r]=0}),(e=>{throw delete t[r],e})))}}})(),(()=>{var e={179:0};r.f.j=(t,n)=>{var o=r.o(e,t)?e[t]:void 0;if(0!==o)if(o)n.push(o[2]);else{var a=new Promise(((r,n)=>o=e[t]=[r,n]));n.push(o[2]=a);var i=r.p+r.u(t),s=new Error;r.l(i,(n=>{if(r.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var a=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+a+": "+i+")",s.name="ChunkLoadError",s.type=a,s.request=i,o[1](s)}}),"chunk-"+t,t)}},r.O.j=t=>0===e[t];var t=(t,n)=>{var o,a,i=n[0],s=n[1],l=n[2],c=0;if(i.some((t=>0!==e[t]))){for(o in s)r.o(s,o)&&(r.m[o]=s[o]);if(l)var u=l(r)}for(t&&t(n);cr(7261)));n=r.O(n)})(); -//# sourceMappingURL=main.98420307.js.map \ No newline at end of file +/*! For license information please see main.b083e6eb.js.LICENSE.txt */ +(()=>{var e={7905:(e,t,r)=>{"use strict";r.d(t,{I6:()=>i,Of:()=>o,_y:()=>a});var n=r(8573);const o={hsva:{h:214,s:43,v:90,a:1}},a=n.createContext(o);function i(e,t){return{...e,...t}}},7261:(e,t,r)=>{"use strict";var n=r(8650),o=r(669),a=r(5773),i=r(808),s=r(8573),l=r.t(s,2);const c=document.createElement("template");c.innerHTML='\n\n\n';class u extends HTMLElement{static get observedAttributes(){return["style","z-index","target","height","width","href","color","fill","position","top","left","right","bottom","transform"]}constructor(){super(),this.right="0",this.shadow=this.attachShadow({mode:"open"}),this.shadow.appendChild(this.ownerDocument.importNode(c.content,!0)),this.update()}setAttr(e,t){const r=this.shadow.querySelector("svg");/(href)/.test(e.toLocaleLowerCase())?r.lastElementChild.setAttribute("xlink:href",t):/(color|fill)/.test(e.toLocaleLowerCase())?r.firstElementChild.style[e]=t:/(z-index|position|top|left|right|bottom|transform)/.test(e.toLocaleLowerCase())?r.style[e]=t:r.setAttribute(e,t)}update(){[...this.getAttributeNames(),"right"].forEach((e=>{const t=this.getAttribute(e)||this[e]||"";this.setAttr(e,t)}))}attributeChangedCallback(e,t,r){t!==r&&this.setAttr(e,r)}}customElements.define("github-corners",u);var d=r(4760),h=["size","fixed","bottom","zIndex","className","style","bgColor","color","position"];function f(e){var{size:t=80,fixed:r=!1,bottom:n,zIndex:o,style:s,bgColor:l="#151513",color:c="#fff",position:u="right"}=e,f=(0,i.Z)(e,h),p="left"===u?{left:0,right:"initial",transform:"scale(-1, 1)"}:{right:0,left:"initial",transform:"scale(1, 1)"};return n?(p.bottom=0,p.top="initial",p.transform="left"===u?"scale(-1, -1)":"scale(1, -1)"):(p.bottom="initial",p.top=0),(0,d.jsx)("github-corners",(0,a.Z)({target:"__blank",width:t,height:t,href:e.href,position:r?"fixed":"absolute","z-index":o,style:s,fill:l,color:c},p,f))}var p,m=r(7240);function v(){return v=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}function E(e,t,r,n){void 0===n&&(n={});let{window:o=document.defaultView,v5Compat:a=!1}=n,i=o.history,s=p.Pop,l=null,c=u();function u(){return(i.state||{idx:null}).idx}function d(){s=p.Pop;let e=u(),t=null==e?null:e-c;c=e,l&&l({action:s,location:f.location,delta:t})}function h(e){let t="null"!==o.location.origin?o.location.origin:o.location.href,r="string"===typeof e?e:S(e);return b(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==c&&(c=0,i.replaceState(v({},i.state,{idx:c}),""));let f={get action(){return s},get location(){return e(o,i)},listen(e){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(g,d),l=e,()=>{o.removeEventListener(g,d),l=null}},createHref:e=>t(o,e),createURL:h,encodeLocation(e){let t=h(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){s=p.Push;let n=w(f.location,e,t);r&&r(n,e),c=u()+1;let d=x(n,c),h=f.createHref(n);try{i.pushState(d,"",h)}catch(m){if(m instanceof DOMException&&"DataCloneError"===m.name)throw m;o.location.assign(h)}a&&l&&l({action:s,location:f.location,delta:1})},replace:function(e,t){s=p.Replace;let n=w(f.location,e,t);r&&r(n,e),c=u();let o=x(n,c),d=f.createHref(n);i.replaceState(o,"",d),a&&l&&l({action:s,location:f.location,delta:0})},go:e=>i.go(e)};return f}var R;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(R||(R={}));const k=new Set(["lazy","caseSensitive","path","id","index","children"]);function T(e,t,r,n){return void 0===r&&(r=[]),void 0===n&&(n={}),e.map(((e,o)=>{let a=[...r,o],i="string"===typeof e.id?e.id:a.join("-");if(b(!0!==e.index||!e.children,"Cannot specify children on an index route"),b(!n[i],'Found a route id collision on id "'+i+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){let r=v({},e,t(e),{id:i});return n[i]=r,r}{let r=v({},e,t(e),{id:i,children:void 0});return n[i]=r,e.children&&(r.children=T(e.children,t,a,n)),r}}))}function P(e,t,r){void 0===r&&(r="/");let n=F(("string"===typeof t?C(t):t).pathname||"/",r);if(null==n)return null;let o=_(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let r=e.length===t.length&&e.slice(0,-1).every(((e,r)=>e===t[r]));return r?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let a=null;for(let i=0;null==a&&i{let i={relativePath:void 0===a?e.path||"":a,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};i.relativePath.startsWith("/")&&(b(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=K([n,i.relativePath]),l=r.concat(i);e.children&&e.children.length>0&&(b(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),_(e.children,t,l,s)),(null!=e.path||e.index)&&t.push({path:s,score:B(s,e.index),routesMeta:l})};return e.forEach(((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let n of A(e.path))o(e,t,n);else o(e,t)})),t}function A(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,o=r.endsWith("?"),a=r.replace(/\?$/,"");if(0===n.length)return o?[a,""]:[a];let i=A(n.join("/")),s=[];return s.push(...i.map((e=>""===e?a:[a,e].join("/")))),o&&s.push(...i),s.map((t=>e.startsWith("/")&&""===t?"/":t))}const j=/^:\w+$/,O=3,D=2,N=1,L=10,I=-2,M=e=>"*"===e;function B(e,t){let r=e.split("/"),n=r.length;return r.some(M)&&(n+=I),t&&(n+=D),r.filter((e=>!M(e))).reduce(((e,t)=>e+(j.test(t)?O:""===t?N:L)),n)}function U(e,t){let{routesMeta:r}=e,n={},o="/",a=[];for(let i=0;i(n.push(t),"/([^\\/]+)")));e.endsWith("*")?(n.push("*"),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))");let a=new RegExp(o,t?void 0:"i");return[a,n]}(e.path,e.caseSensitive,e.end),o=t.match(r);if(!o)return null;let a=o[0],i=a.replace(/(.)\/+$/,"$1"),s=o.slice(1);return{params:n.reduce(((e,t,r)=>{if("*"===t){let e=s[r]||"";i=a.slice(0,a.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(r){return y(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+r+")."),e}}(s[r]||"",t),e}),{}),pathname:a,pathnameBase:i,pattern:e}}function z(e){try{return decodeURI(e)}catch(t){return y(!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 F(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)||"/"}function Z(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function W(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function $(e,t,r,n){let o;void 0===n&&(n=!1),"string"===typeof e?o=C(e):(o=v({},e),b(!o.pathname||!o.pathname.includes("?"),Z("?","pathname","search",o)),b(!o.pathname||!o.pathname.includes("#"),Z("#","pathname","hash",o)),b(!o.search||!o.search.includes("#"),Z("#","search","hash",o)));let a,i=""===e||""===o.pathname,s=i?"/":o.pathname;if(n||null==s)a=r;else{let e=t.length-1;if(s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}a=e>=0?t[e]:"/"}let l=function(e,t){void 0===t&&(t="/");let{pathname:r,search:n="",hash:o=""}="string"===typeof e?C(e):e,a=r?r.startsWith("/")?r:function(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)})),r.length>1?r.join("/"):"/"}(r,t):t;return{pathname:a,search:Y(n),hash:q(o)}}(o,a),c=s&&"/"!==s&&s.endsWith("/"),u=(i||"."===s)&&r.endsWith("/");return l.pathname.endsWith("/")||!c&&!u||(l.pathname+="/"),l}const K=e=>e.join("/").replace(/\/\/+/g,"/"),G=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Y=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",q=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;class V{constructor(e,t,r,n){void 0===n&&(n=!1),this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function J(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}const X=["post","put","patch","delete"],Q=new Set(X),ee=["get",...X],te=new Set(ee),re=new Set([301,302,303,307,308]),ne=new Set([307,308]),oe={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ae={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ie={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},se=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,le=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)});function ce(e){const t=e.window?e.window:"undefined"!==typeof window?window:void 0,r="undefined"!==typeof t&&"undefined"!==typeof t.document&&"undefined"!==typeof t.document.createElement,n=!r;let o;if(b(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;o=e=>({hasErrorBoundary:t(e)})}else o=le;let a,i={},s=T(e.routes,o,void 0,i),l=e.basename||"/",c=v({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),u=null,d=new Set,h=null,f=null,m=null,g=null!=e.hydrationData,x=P(s,e.history.location,l),S=null;if(null==x){let t=ke(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=Re(s);x=r,S={[n.id]:t}}let C,E,k=!x.some((e=>e.route.lazy))&&(!x.some((e=>e.route.loader))||null!=e.hydrationData),_={historyAction:e.history.action,location:e.history.location,matches:x,initialized:k,navigation:oe,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||S,fetchers:new Map,blockers:new Map},A=p.Pop,j=!1,O=!1,D=!1,N=[],L=[],I=new Map,M=0,B=-1,U=new Map,H=new Set,z=new Map,Z=new Map,W=new Map,$=!1;function K(e){_=v({},_,e),d.forEach((e=>e(_)))}function G(t,r){var n,o;let i,l=null!=_.actionData&&null!=_.navigation.formMethod&&Ne(_.navigation.formMethod)&&"loading"===_.navigation.state&&!0!==(null==(n=t.state)?void 0:n._isRedirect);i=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:l?_.actionData:null;let c=r.loaderData?Ce(_.loaderData,r.loaderData,r.matches||[],r.errors):_.loaderData,u=_.blockers;u.size>0&&(u=new Map(u),u.forEach(((e,t)=>u.set(t,ie))));let d=!0===j||null!=_.navigation.formMethod&&Ne(_.navigation.formMethod)&&!0!==(null==(o=t.state)?void 0:o._isRedirect);a&&(s=a,a=void 0),O||A===p.Pop||(A===p.Push?e.history.push(t,t.state):A===p.Replace&&e.history.replace(t,t.state)),K(v({},r,{actionData:i,loaderData:c,historyAction:A,location:t,initialized:!0,navigation:oe,revalidation:"idle",restoreScrollPosition:we(t,r.matches||_.matches),preventScrollReset:d,blockers:u})),A=p.Pop,j=!1,O=!1,D=!1,N=[],L=[]}async function Y(t,r,n){E&&E.abort(),E=null,A=t,O=!0===(n&&n.startUninterruptedRevalidation),function(e,t){if(h&&m){let r=xe(e,t);h[r]=m()}}(_.location,_.matches),j=!0===(n&&n.preventScrollReset);let c=a||s,u=n&&n.overrideNavigation,d=P(c,r,l);if(!d){let e=ke(404,{pathname:r.pathname}),{matches:t,route:n}=Re(c);return ye(),void G(r,{matches:t,loaderData:{},errors:{[n.id]:e}})}if(_.initialized&&!D&&function(e,t){if(e.pathname!==t.pathname||e.search!==t.search)return!1;if(""===e.hash)return""!==t.hash;if(e.hash===t.hash)return!0;if(""!==t.hash)return!0;return!1}(_.location,r)&&!(n&&n.submission&&Ne(n.submission.formMethod)))return void G(r,{matches:d});E=new AbortController;let f,g,b=be(e.history,r,E.signal,n&&n.submission);if(n&&n.pendingError)g={[Ee(d).route.id]:n.pendingError};else if(n&&n.submission&&Ne(n.submission.formMethod)){let e=await async function(e,t,r,n,a){void 0===a&&(a={});X();let s,c=function(e,t){let r={state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text};return r}(t,r);K({navigation:c});let u=Be(n,t);if(u.route.action||u.route.lazy){if(s=await ge("action",e,u,n,i,o,l),e.signal.aborted)return{shortCircuited:!0}}else s={type:R.error,error:ke(405,{method:e.method,pathname:t.pathname,routeId:u.route.id})};if(je(s)){let e;return e=a&&null!=a.replace?a.replace:s.location===_.location.pathname+_.location.search,await V(_,s,{submission:r,replace:e}),{shortCircuited:!0}}if(Ae(s)){let e=Ee(n,u.route.id);return!0!==(a&&a.replace)&&(A=p.Push),{pendingActionData:{},pendingActionError:{[e.route.id]:s.error}}}if(_e(s))throw ke(400,{type:"defer-action"});return{pendingActionData:{[u.route.id]:s.data}}}(b,r,n.submission,d,{replace:n.replace});if(e.shortCircuited)return;f=e.pendingActionData,g=e.pendingActionError,u=He(r,n.submission),b=new Request(b.url,{signal:b.signal})}let{shortCircuited:y,loaderData:x,errors:w}=await async function(t,r,n,o,i,c,u,d,h){let f=o||He(r,i),p=i||c||Ue(f),m=a||s,[g,b]=fe(e.history,_,n,p,r,D,N,L,z,H,m,l,d,h);if(ye((e=>!(n&&n.some((t=>t.route.id===e)))||g&&g.some((t=>t.route.id===e)))),B=++M,0===g.length&&0===b.length){let e=ce();return G(r,v({matches:n,loaderData:{},errors:h||null},d?{actionData:d}:{},e?{fetchers:new Map(_.fetchers)}:{})),{shortCircuited:!0}}if(!O){b.forEach((e=>{let t=_.fetchers.get(e.key),r=ze(void 0,t?t.data:void 0);_.fetchers.set(e.key,r)}));let e=d||_.actionData;K(v({navigation:f},e?0===Object.keys(e).length?{actionData:null}:{actionData:e}:{},b.length>0?{fetchers:new Map(_.fetchers)}:{}))}b.forEach((e=>{I.has(e.key)&&te(e.key),e.controller&&I.set(e.key,e.controller)}));let y=()=>b.forEach((e=>te(e.key)));E&&E.signal.addEventListener("abort",y);let{results:x,loaderResults:w,fetcherResults:S}=await J(_.matches,n,g,b,t);if(t.signal.aborted)return{shortCircuited:!0};E&&E.signal.removeEventListener("abort",y);b.forEach((e=>I.delete(e.key)));let C=Te(x);if(C){if(C.idx>=g.length){let e=b[C.idx-g.length].key;H.add(e)}return await V(_,C.result,{replace:u}),{shortCircuited:!0}}let{loaderData:R,errors:k}=Se(_,n,g,w,h,b,S,Z);Z.forEach(((e,t)=>{e.subscribe((r=>{(r||e.done)&&Z.delete(t)}))}));let T=ce(),P=he(B),A=T||P||b.length>0;return v({loaderData:R,errors:k},A?{fetchers:new Map(_.fetchers)}:{})}(b,r,d,u,n&&n.submission,n&&n.fetcherSubmission,n&&n.replace,f,g);y||(E=null,G(r,v({matches:d},f?{actionData:f}:{},{loaderData:x,errors:w})))}function q(e){return _.fetchers.get(e)||ae}async function V(n,o,a){let{submission:i,replace:s,isFetchActionRedirect:c}=void 0===a?{}:a;o.revalidate&&(D=!0);let u=w(n.location,o.location,v({_isRedirect:!0},c?{_isFetchActionRedirect:!0}:{}));if(b(u,"Expected a location on the redirect navigation"),se.test(o.location)&&r){let r=e.history.createURL(o.location),n=null==F(r.pathname,l);if(t.location.origin!==r.origin||n)return void(s?t.location.replace(o.location):t.location.assign(o.location))}E=null;let d=!0===s?p.Replace:p.Push,h=i||Ue(n.navigation);if(ne.has(o.status)&&h&&Ne(h.formMethod))await Y(d,u,{submission:v({},h,{formAction:o.location}),preventScrollReset:j});else if(c)await Y(d,u,{overrideNavigation:He(u),fetcherSubmission:h,preventScrollReset:j});else{let e=He(u,h);await Y(d,u,{overrideNavigation:e,preventScrollReset:j})}}async function J(t,r,n,a,s){let c=await Promise.all([...n.map((e=>ge("loader",s,e,r,i,o,l))),...a.map((t=>{if(t.matches&&t.match&&t.controller)return ge("loader",be(e.history,t.path,t.controller.signal),t.match,t.matches,i,o,l);return{type:R.error,error:ke(404,{pathname:t.path})}}))]),u=c.slice(0,n.length),d=c.slice(n.length);return await Promise.all([Le(t,n,u,u.map((()=>s.signal)),!1,_.loaderData),Le(t,a.map((e=>e.match)),d,a.map((e=>e.controller?e.controller.signal:null)),!0)]),{results:c,loaderResults:u,fetcherResults:d}}function X(){D=!0,N.push(...ye()),z.forEach(((e,t)=>{I.has(t)&&(L.push(t),te(t))}))}function Q(e,t,r){let n=Ee(_.matches,t);ee(e),K({errors:{[n.route.id]:r},fetchers:new Map(_.fetchers)})}function ee(e){let t=_.fetchers.get(e);!I.has(e)||t&&"loading"===t.state&&U.has(e)||te(e),z.delete(e),U.delete(e),H.delete(e),_.fetchers.delete(e)}function te(e){let t=I.get(e);b(t,"Expected fetch controller: "+e),t.abort(),I.delete(e)}function re(e){for(let t of e){let e=Fe(q(t).data);_.fetchers.set(t,e)}}function ce(){let e=[],t=!1;for(let r of H){let n=_.fetchers.get(r);b(n,"Expected fetcher: "+r),"loading"===n.state&&(H.delete(r),e.push(r),t=!0)}return re(e),t}function he(e){let t=[];for(let[r,n]of U)if(n0}function pe(e){_.blockers.delete(e),W.delete(e)}function me(e,t){let r=_.blockers.get(e)||ie;b("unblocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"proceeding"===t.state||"blocked"===r.state&&"unblocked"===t.state||"proceeding"===r.state&&"unblocked"===t.state,"Invalid blocker state transition: "+r.state+" -> "+t.state);let n=new Map(_.blockers);n.set(e,t),K({blockers:n})}function ve(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===W.size)return;W.size>1&&y(!1,"A router only supports one blocker at a time");let o=Array.from(W.entries()),[a,i]=o[o.length-1],s=_.blockers.get(a);return s&&"proceeding"===s.state?void 0:i({currentLocation:t,nextLocation:r,historyAction:n})?a:void 0}function ye(e){let t=[];return Z.forEach(((r,n)=>{e&&!e(n)||(r.cancel(),t.push(n),Z.delete(n))})),t}function xe(e,t){if(f){return f(e,t.map((e=>function(e,t){let{route:r,pathname:n,params:o}=e;return{id:r.id,pathname:n,params:o,data:t[r.id],handle:r.handle}}(e,_.loaderData))))||e.key}return e.key}function we(e,t){if(h){let r=xe(e,t),n=h[r];if("number"===typeof n)return n}return null}return C={get basename(){return l},get state(){return _},get routes(){return s},initialize:function(){return u=e.history.listen((t=>{let{action:r,location:n,delta:o}=t;if($)return void($=!1);y(0===W.size||null!=o,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let a=ve({currentLocation:_.location,nextLocation:n,historyAction:r});return a&&null!=o?($=!0,e.history.go(-1*o),void me(a,{state:"blocked",location:n,proceed(){me(a,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(o)},reset(){let e=new Map(_.blockers);e.set(a,ie),K({blockers:e})}})):Y(r,n)})),_.initialized||Y(p.Pop,_.location),C},subscribe:function(e){return d.add(e),()=>d.delete(e)},enableScrollRestoration:function(e,t,r){if(h=e,m=t,f=r||null,!g&&_.navigation===oe){g=!0;let e=we(_.location,_.matches);null!=e&&K({restoreScrollPosition:e})}return()=>{h=null,m=null,f=null}},navigate:async function t(r,n){if("number"===typeof r)return void e.history.go(r);let o=ue(_.location,_.matches,l,c.v7_prependBasename,r,null==n?void 0:n.fromRouteId,null==n?void 0:n.relative),{path:a,submission:i,error:s}=de(c.v7_normalizeFormMethod,!1,o,n),u=_.location,d=w(_.location,a,n&&n.state);d=v({},d,e.history.encodeLocation(d));let h=n&&null!=n.replace?n.replace:void 0,f=p.Push;!0===h?f=p.Replace:!1===h||null!=i&&Ne(i.formMethod)&&i.formAction===_.location.pathname+_.location.search&&(f=p.Replace);let m=n&&"preventScrollReset"in n?!0===n.preventScrollReset:void 0,g=ve({currentLocation:u,nextLocation:d,historyAction:f});if(!g)return await Y(f,d,{submission:i,pendingError:s,preventScrollReset:m,replace:n&&n.replace});me(g,{state:"blocked",location:d,proceed(){me(g,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),t(r,n)},reset(){let e=new Map(_.blockers);e.set(g,ie),K({blockers:e})}})},fetch:function(t,r,u,d){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");I.has(t)&&te(t);let h=a||s,f=ue(_.location,_.matches,l,c.v7_prependBasename,u,r,null==d?void 0:d.relative),p=P(h,f,l);if(!p)return void Q(t,r,ke(404,{pathname:f}));let{path:m,submission:g,error:y}=de(c.v7_normalizeFormMethod,!0,f,d);if(y)return void Q(t,r,y);let x=Be(p,m);j=!0===(d&&d.preventScrollReset),g&&Ne(g.formMethod)?async function(t,r,n,c,u,d){if(X(),z.delete(t),!c.route.action&&!c.route.lazy){let e=ke(405,{method:d.formMethod,pathname:n,routeId:r});return void Q(t,r,e)}let h=_.fetchers.get(t),f=function(e,t){let r={state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0," _hasFetcherDoneAnything ":!0};return r}(d,h);_.fetchers.set(t,f),K({fetchers:new Map(_.fetchers)});let p=new AbortController,m=be(e.history,n,p.signal,d);I.set(t,p);let g=M,y=await ge("action",m,c,u,i,o,l);if(m.signal.aborted)return void(I.get(t)===p&&I.delete(t));if(je(y)){if(I.delete(t),B>g){let e=Fe(void 0);return _.fetchers.set(t,e),void K({fetchers:new Map(_.fetchers)})}{H.add(t);let e=ze(d);return _.fetchers.set(t,e),K({fetchers:new Map(_.fetchers)}),V(_,y,{submission:d,isFetchActionRedirect:!0})}}if(Ae(y))return void Q(t,r,y.error);if(_e(y))throw ke(400,{type:"defer-action"});let x=_.navigation.location||_.location,w=be(e.history,x,p.signal),S=a||s,C="idle"!==_.navigation.state?P(S,_.navigation.location,l):_.matches;b(C,"Didn't find any matches after fetcher action");let R=++M;U.set(t,R);let k=ze(d,y.data);_.fetchers.set(t,k);let[T,j]=fe(e.history,_,C,d,x,D,N,L,z,H,S,l,{[c.route.id]:y.data},void 0);j.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,r=_.fetchers.get(t),n=ze(void 0,r?r.data:void 0);_.fetchers.set(t,n),I.has(t)&&te(t),e.controller&&I.set(t,e.controller)})),K({fetchers:new Map(_.fetchers)});let O=()=>j.forEach((e=>te(e.key)));p.signal.addEventListener("abort",O);let{results:F,loaderResults:W,fetcherResults:$}=await J(_.matches,C,T,j,w);if(p.signal.aborted)return;p.signal.removeEventListener("abort",O),U.delete(t),I.delete(t),j.forEach((e=>I.delete(e.key)));let Y=Te(F);if(Y){if(Y.idx>=T.length){let e=j[Y.idx-T.length].key;H.add(e)}return V(_,Y.result)}let{loaderData:q,errors:ee}=Se(_,_.matches,T,W,void 0,j,$,Z);if(_.fetchers.has(t)){let e=Fe(y.data);_.fetchers.set(t,e)}let re=he(R);"loading"===_.navigation.state&&R>B?(b(A,"Expected pending action"),E&&E.abort(),G(_.navigation.location,{matches:C,loaderData:q,errors:ee,fetchers:new Map(_.fetchers)})):(K(v({errors:ee,loaderData:Ce(_.loaderData,q,C,ee)},re||j.length>0?{fetchers:new Map(_.fetchers)}:{})),D=!1)}(t,r,m,x,p,g):(z.set(t,{routeId:r,path:m}),async function(t,r,n,a,s,c){let u=_.fetchers.get(t),d=ze(c,u?u.data:void 0);_.fetchers.set(t,d),K({fetchers:new Map(_.fetchers)});let h=new AbortController,f=be(e.history,n,h.signal);I.set(t,h);let p=M,m=await ge("loader",f,a,s,i,o,l);_e(m)&&(m=await Ie(m,f.signal,!0)||m);I.get(t)===h&&I.delete(t);if(f.signal.aborted)return;if(je(m)){if(B>p){let e=Fe(void 0);return _.fetchers.set(t,e),void K({fetchers:new Map(_.fetchers)})}return H.add(t),void await V(_,m)}if(Ae(m)){let e=Ee(_.matches,r);return _.fetchers.delete(t),void K({fetchers:new Map(_.fetchers),errors:{[e.route.id]:m.error}})}b(!_e(m),"Unhandled fetcher deferred data");let v=Fe(m.data);_.fetchers.set(t,v),K({fetchers:new Map(_.fetchers)})}(t,r,m,x,p,g))},revalidate:function(){X(),K({revalidation:"loading"}),"submitting"!==_.navigation.state&&("idle"!==_.navigation.state?Y(A||_.historyAction,_.navigation.location,{overrideNavigation:_.navigation}):Y(_.historyAction,_.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:q,deleteFetcher:ee,dispose:function(){u&&u(),d.clear(),E&&E.abort(),_.fetchers.forEach(((e,t)=>ee(t))),_.blockers.forEach(((e,t)=>pe(t)))},getBlocker:function(e,t){let r=_.blockers.get(e)||ie;return W.get(e)!==t&&W.set(e,t),r},deleteBlocker:pe,_internalFetchControllers:I,_internalActiveDeferreds:Z,_internalSetRoutes:function(e){i={},a=T(e,o,void 0,i)}},C}Symbol("deferred");function ue(e,t,r,n,o,a,i){let s,l;if(null!=a&&"path"!==i){s=[];for(let e of t)if(s.push(e),e.route.id===a){l=e;break}}else s=t,l=t[t.length-1];let c=$(o||".",W(s).map((e=>e.pathnameBase)),F(e.pathname,r)||e.pathname,"path"===i);return null==o&&(c.search=e.search,c.hash=e.hash),null!=o&&""!==o&&"."!==o||!l||!l.route.index||Me(c.search)||(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(c.pathname="/"===c.pathname?r:K([r,c.pathname])),S(c)}function de(e,t,r,n){if(!n||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(n))return{path:r};if(n.formMethod&&!De(n.formMethod))return{path:r,error:ke(405,{method:n.formMethod})};let o,a,i=()=>({path:r,error:ke(400,{type:"invalid-body"})}),s=n.formMethod||"get",l=e?s.toUpperCase():s.toLowerCase(),c=Pe(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!Ne(l))return i();let e="string"===typeof n.body?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce(((e,t)=>{let[r,n]=t;return""+e+r+"="+n+"\n"}),""):String(n.body);return{path:r,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===n.formEncType){if(!Ne(l))return i();try{let e="string"===typeof n.body?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch(h){return i()}}}if(b("function"===typeof FormData,"FormData is not available in this environment"),n.formData)o=ye(n.formData),a=n.formData;else if(n.body instanceof FormData)o=ye(n.body),a=n.body;else if(n.body instanceof URLSearchParams)o=n.body,a=xe(o);else if(null==n.body)o=new URLSearchParams,a=new FormData;else try{o=new URLSearchParams(n.body),a=xe(o)}catch(h){return i()}let u={formMethod:l,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:a,json:void 0,text:void 0};if(Ne(u.formMethod))return{path:r,submission:u};let d=C(r);return t&&d.search&&Me(d.search)&&o.append("index",""),d.search="?"+o,{path:S(d),submission:u}}function he(e,t){let r=e;if(t){let n=e.findIndex((e=>e.route.id===t));n>=0&&(r=e.slice(0,n))}return r}function fe(e,t,r,n,o,a,i,s,l,c,u,d,h,f){let p=f?Object.values(f)[0]:h?Object.values(h)[0]:void 0,m=e.createURL(t.location),g=e.createURL(o),b=f?Object.keys(f)[0]:void 0,y=he(r,b).filter(((e,r)=>{if(e.route.lazy)return!0;if(null==e.route.loader)return!1;if(function(e,t,r){let n=!t||r.route.id!==t.route.id,o=void 0===e[r.route.id];return n||o}(t.loaderData,t.matches[r],e)||i.some((t=>t===e.route.id)))return!0;let o=t.matches[r],s=e;return me(e,v({currentUrl:m,currentParams:o.params,nextUrl:g,nextParams:s.params},n,{actionResult:p,defaultShouldRevalidate:a||m.pathname+m.search===g.pathname+g.search||m.search!==g.search||pe(o,s)}))})),x=[];return l.forEach(((e,o)=>{if(!r.some((t=>t.route.id===e.routeId)))return;let i=P(u,e.path,d);if(!i)return void x.push({key:o,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let l=t.fetchers.get(o),h=Be(i,e.path),f=!1;f=!c.has(o)&&(!!s.includes(o)||(l&&"idle"!==l.state&&void 0===l.data?a:me(h,v({currentUrl:m,currentParams:t.matches[t.matches.length-1].params,nextUrl:g,nextParams:r[r.length-1].params},n,{actionResult:p,defaultShouldRevalidate:a})))),f&&x.push({key:o,routeId:e.routeId,path:e.path,matches:i,match:h,controller:new AbortController})})),[y,x]}function pe(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function me(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"===typeof r)return r}return t.defaultShouldRevalidate}async function ve(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let o=r[e.id];b(o,"No route found in manifest");let a={};for(let i in n){let e=void 0!==o[i]&&"hasErrorBoundary"!==i;y(!e,'Route "'+o.id+'" has a static property "'+i+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+i+'" will be ignored.'),e||k.has(i)||(a[i]=n[i])}Object.assign(o,a),Object.assign(o,v({},t(o),{lazy:void 0}))}async function ge(e,t,r,n,o,a,i,s){let l,c,u;void 0===s&&(s={});let d=e=>{let n,o=new Promise(((e,t)=>n=t));return u=()=>n(),t.signal.addEventListener("abort",u),Promise.race([e({request:t,params:r.params,context:s.requestContext}),o])};try{let n=r.route[e];if(r.route.lazy)if(n){c=(await Promise.all([d(n),ve(r.route,a,o)]))[0]}else{if(await ve(r.route,a,o),n=r.route[e],!n){if("action"===e){let e=new URL(t.url),n=e.pathname+e.search;throw ke(405,{method:t.method,pathname:n,routeId:r.route.id})}return{type:R.data,data:void 0}}c=await d(n)}else{if(!n){let e=new URL(t.url);throw ke(404,{pathname:e.pathname+e.search})}c=await d(n)}b(void 0!==c,"You defined "+("action"===e?"an action":"a loader")+' for route "'+r.route.id+"\" but didn't return anything from your `"+e+"` function. Please return a value or `null`.")}catch(p){l=R.error,c=p}finally{u&&t.signal.removeEventListener("abort",u)}if(Oe(c)){let e,o=c.status;if(re.has(o)){let e=c.headers.get("Location");if(b(e,"Redirects returned/thrown from loaders/actions must have a Location header"),se.test(e)){if(!s.isStaticRequest){let r=new URL(t.url),n=e.startsWith("//")?new URL(r.protocol+e):new URL(e),o=null!=F(n.pathname,i);n.origin===r.origin&&o&&(e=n.pathname+n.search+n.hash)}}else e=ue(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,e);if(s.isStaticRequest)throw c.headers.set("Location",e),c;return{type:R.redirect,status:o,location:e,revalidate:null!==c.headers.get("X-Remix-Revalidate")}}if(s.isRouteRequest)throw{type:l||R.data,response:c};let a=c.headers.get("Content-Type");return e=a&&/\bapplication\/json\b/.test(a)?await c.json():await c.text(),l===R.error?{type:l,error:new V(o,c.statusText,e),headers:c.headers}:{type:R.data,data:e,statusCode:c.status,headers:c.headers}}return l===R.error?{type:l,error:c}:function(e){let t=e;return t&&"object"===typeof t&&"object"===typeof t.data&&"function"===typeof t.subscribe&&"function"===typeof t.cancel&&"function"===typeof t.resolveData}(c)?{type:R.deferred,deferredData:c,statusCode:null==(h=c.init)?void 0:h.status,headers:(null==(f=c.init)?void 0:f.headers)&&new Headers(c.init.headers)}:{type:R.data,data:c};var h,f}function be(e,t,r,n){let o=e.createURL(Pe(t)).toString(),a={signal:r};if(n&&Ne(n.formMethod)){let{formMethod:e,formEncType:t}=n;a.method=e.toUpperCase(),"application/json"===t?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(n.json)):"text/plain"===t?a.body=n.text:"application/x-www-form-urlencoded"===t&&n.formData?a.body=ye(n.formData):a.body=n.formData}return new Request(o,a)}function ye(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"===typeof n?n:n.name);return t}function xe(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function we(e,t,r,n,o){let a,i={},s=null,l=!1,c={};return r.forEach(((r,u)=>{let d=t[u].route.id;if(b(!je(r),"Cannot handle redirect results in processLoaderData"),Ae(r)){let t=Ee(e,d),o=r.error;n&&(o=Object.values(n)[0],n=void 0),s=s||{},null==s[t.route.id]&&(s[t.route.id]=o),i[d]=void 0,l||(l=!0,a=J(r.error)?r.error.status:500),r.headers&&(c[d]=r.headers)}else _e(r)?(o.set(d,r.deferredData),i[d]=r.deferredData.data):i[d]=r.data,null==r.statusCode||200===r.statusCode||l||(a=r.statusCode),r.headers&&(c[d]=r.headers)})),n&&(s=n,i[Object.keys(n)[0]]=void 0),{loaderData:i,errors:s,statusCode:a||200,loaderHeaders:c}}function Se(e,t,r,n,o,a,i,s){let{loaderData:l,errors:c}=we(t,r,n,o,s);for(let u=0;ue.route.id===t))+1):[...e]).reverse().find((e=>!0===e.route.hasErrorBoundary))||e[0]}function Re(e){let t=e.find((e=>e.index||!e.path||"/"===e.path))||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function ke(e,t){let{pathname:r,routeId:n,method:o,type:a}=void 0===t?{}:t,i="Unknown Server Error",s="Unknown @remix-run/router error";return 400===e?(i="Bad Request",o&&r&&n?s="You made a "+o+' request to "'+r+'" but did not provide a `loader` for route "'+n+'", so there is no way to handle the request.':"defer-action"===a?s="defer() is not supported in actions":"invalid-body"===a&&(s="Unable to encode submission body")):403===e?(i="Forbidden",s='Route "'+n+'" does not match URL "'+r+'"'):404===e?(i="Not Found",s='No route matches URL "'+r+'"'):405===e&&(i="Method Not Allowed",o&&r&&n?s="You made a "+o.toUpperCase()+' request to "'+r+'" but did not provide an `action` for route "'+n+'", so there is no way to handle the request.':o&&(s='Invalid request method "'+o.toUpperCase()+'"')),new V(e||500,i,new Error(s),!0)}function Te(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(je(r))return{result:r,idx:t}}}function Pe(e){return S(v({},"string"===typeof e?C(e):e,{hash:""}))}function _e(e){return e.type===R.deferred}function Ae(e){return e.type===R.error}function je(e){return(e&&e.type)===R.redirect}function Oe(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"object"===typeof e.headers&&"undefined"!==typeof e.body}function De(e){return te.has(e.toLowerCase())}function Ne(e){return Q.has(e.toLowerCase())}async function Le(e,t,r,n,o,a){for(let i=0;ie.route.id===l.route.id)),u=null!=c&&!pe(c,l)&&void 0!==(a&&a[l.route.id]);if(_e(s)&&(o||u)){let e=n[i];b(e,"Expected an AbortSignal for revalidating fetcher deferred result"),await Ie(s,e,o).then((e=>{e&&(r[i]=e||r[i])}))}}}async function Ie(e,t,r){if(void 0===r&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:R.data,data:e.deferredData.unwrappedData}}catch(n){return{type:R.error,error:n}}return{type:R.data,data:e.deferredData.data}}}function Me(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function Be(e,t){let r="string"===typeof t?C(t).search:t.search;if(e[e.length-1].route.index&&Me(r||""))return e[e.length-1];let n=W(e);return n[n.length-1]}function Ue(e){let{formMethod:t,formAction:r,formEncType:n,text:o,formData:a,json:i}=e;if(t&&r&&n)return null!=o?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:o}:null!=a?{formMethod:t,formAction:r,formEncType:n,formData:a,json:void 0,text:void 0}:void 0!==i?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}:void 0}function He(e,t){if(t){return{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}return{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function ze(e,t){if(e){return{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t," _hasFetcherDoneAnything ":!0}}return{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t," _hasFetcherDoneAnything ":!0}}function Fe(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e," _hasFetcherDoneAnything ":!0}}function Ze(){return Ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t{r.current=!0})),s.useCallback((function(n,o){void 0===o&&(o={}),r.current&&("number"===typeof n?e.navigate(n):e.navigate(n,Ze({fromRouteId:t},o)))}),[e,t])}():function(){Ve()||b(!1);let e=s.useContext(We),{basename:t,navigator:r}=s.useContext(Ke),{matches:n}=s.useContext(Ye),{pathname:o}=Je(),a=JSON.stringify(W(n).map((e=>e.pathnameBase))),i=s.useRef(!1);return Xe((()=>{i.current=!0})),s.useCallback((function(n,s){if(void 0===s&&(s={}),!i.current)return;if("number"===typeof n)return void r.go(n);let l=$(n,JSON.parse(a),o,"path"===s.relative);null==e&&"/"!==t&&(l.pathname="/"===l.pathname?t:K([t,l.pathname])),(s.replace?r.replace:r.push)(l,s.state,s)}),[t,r,a,o,e])}()}const et=s.createContext(null);function tt(e,t){let{relative:r}=void 0===t?{}:t,{matches:n}=s.useContext(Ye),{pathname:o}=Je(),a=JSON.stringify(W(n).map((e=>e.pathnameBase)));return s.useMemo((()=>$(e,JSON.parse(a),o,"path"===r)),[e,a,o,r])}function rt(e,t,r){Ve()||b(!1);let{navigator:n}=s.useContext(Ke),{matches:o}=s.useContext(Ye),a=o[o.length-1],i=a?a.params:{},l=(a&&a.pathname,a?a.pathnameBase:"/");a&&a.route;let c,u=Je();if(t){var d;let e="string"===typeof t?C(t):t;"/"===l||(null==(d=e.pathname)?void 0:d.startsWith(l))||b(!1),c=e}else c=u;let h=c.pathname||"/",f=P(e,{pathname:"/"===l?h:h.slice(l.length)||"/"});let m=st(f&&f.map((e=>Object.assign({},e,{params:Object.assign({},i,e.params),pathname:K([l,n.encodeLocation?n.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?l:K([l,n.encodeLocation?n.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),o,r);return t&&m?s.createElement(Ge.Provider,{value:{location:Ze({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:p.Pop}},m):m}function nt(){let e=ft(),t=J(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:n};return s.createElement(s.Fragment,null,s.createElement("h2",null,"Unexpected Application Error!"),s.createElement("h3",{style:{fontStyle:"italic"}},t),r?s.createElement("pre",{style:o},r):null,null)}const ot=s.createElement(nt,null);class at extends s.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: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 this.state.error?s.createElement(Ye.Provider,{value:this.props.routeContext},s.createElement(qe.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function it(e){let{routeContext:t,match:r,children:n}=e,o=s.useContext(We);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),s.createElement(Ye.Provider,{value:t},n)}function st(e,t,r){var n;if(void 0===t&&(t=[]),void 0===r&&(r=null),null==e){var o;if(null==(o=r)||!o.errors)return null;e=r.matches}let a=e,i=null==(n=r)?void 0:n.errors;if(null!=i){let e=a.findIndex((e=>e.route.id&&(null==i?void 0:i[e.route.id])));e>=0||b(!1),a=a.slice(0,Math.min(a.length,e+1))}return a.reduceRight(((e,n,o)=>{let l=n.route.id?null==i?void 0:i[n.route.id]:null,c=null;r&&(c=n.route.errorElement||ot);let u=t.concat(a.slice(0,o+1)),d=()=>{let t;return t=l?c:n.route.Component?s.createElement(n.route.Component,null):n.route.element?n.route.element:e,s.createElement(it,{match:n,routeContext:{outlet:e,matches:u,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===o)?s.createElement(at,{location:r.location,revalidation:r.revalidation,component:c,error:l,children:d(),routeContext:{outlet:null,matches:u,isDataRoute:!0}}):d()}),null)}var lt,ct;function ut(e){let t=s.useContext(We);return t||b(!1),t}function dt(e){let t=s.useContext($e);return t||b(!1),t}function ht(e){let t=function(e){let t=s.useContext(Ye);return t||b(!1),t}(),r=t.matches[t.matches.length-1];return r.route.id||b(!1),r.route.id}function ft(){var e;let t=s.useContext(qe),r=dt(ct.UseRouteError),n=ht(ct.UseRouteError);return t||(null==(e=r.errors)?void 0:e[n])}!function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"}(lt||(lt={})),function(e){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"}(ct||(ct={}));const pt=l.startTransition;function mt(e){let{fallbackElement:t,router:r,future:n}=e,[o,a]=s.useState(r.state),{v7_startTransition:i}=n||{},l=s.useCallback((e=>{i&&pt?pt((()=>a(e))):a(e)}),[a,i]);s.useLayoutEffect((()=>r.subscribe(l)),[r,l]);let c=s.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:null==n?void 0:n.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})})),[r]),u=r.basename||"/",d=s.useMemo((()=>({router:r,navigator:c,static:!1,basename:u})),[r,c,u]);return s.createElement(s.Fragment,null,s.createElement(We.Provider,{value:d},s.createElement($e.Provider,{value:o},s.createElement(bt,{basename:u,location:o.location,navigationType:o.historyAction,navigator:c},o.initialized?s.createElement(vt,{routes:r.routes,state:o}):t))),null)}function vt(e){let{routes:t,state:r}=e;return rt(t,void 0,r)}function gt(e){return function(e){let t=s.useContext(Ye).outlet;return t?s.createElement(et.Provider,{value:e},t):t}(e.context)}function bt(e){let{basename:t="/",children:r=null,location:n,navigationType:o=p.Pop,navigator:a,static:i=!1}=e;Ve()&&b(!1);let l=t.replace(/^\/*/,"/"),c=s.useMemo((()=>({basename:l,navigator:a,static:i})),[l,a,i]);"string"===typeof n&&(n=C(n));let{pathname:u="/",search:d="",hash:h="",state:f=null,key:m="default"}=n,v=s.useMemo((()=>{let e=F(u,l);return null==e?null:{location:{pathname:e,search:d,hash:h,state:f,key:m},navigationType:o}}),[l,u,d,h,f,m,o]);return null==v?null:s.createElement(Ke.Provider,{value:c},s.createElement(Ge.Provider,{children:r,value:v}))}var yt;!function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"}(yt||(yt={}));new Promise((()=>{}));s.Component;function xt(e){let t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:s.createElement(e.Component),Component:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:s.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function wt(){return wt=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[r]=e[r]);return o}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const Ct=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],Et=["aria-current","caseSensitive","className","end","style","to","children"];function Rt(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=wt({},t,{errors:kt(t.errors)})),t}function kt(e){if(!e)return null;let t=Object.entries(e),r={};for(let[o,a]of t)if(a&&"RouteErrorResponse"===a.__type)r[o]=new V(a.status,a.statusText,a.data,!0===a.internal);else if(a&&"Error"===a.__type){if(a.__subType){let e=window[a.__subType];if("function"===typeof e)try{let t=new e(a.message);t.stack="",r[o]=t}catch(n){}}if(null==r[o]){let e=new Error(a.message);e.stack="",r[o]=e}}else r[o]=a;return r}l.startTransition;const Tt="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement,Pt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_t=s.forwardRef((function(e,t){let r,{onClick:n,relative:o,reloadDocument:a,replace:i,state:l,target:c,to:u,preventScrollReset:d}=e,h=St(e,Ct),{basename:f}=s.useContext(Ke),p=!1;if("string"===typeof u&&Pt.test(u)&&(r=u,Tt))try{let e=new URL(window.location.href),t=u.startsWith("//")?new URL(e.protocol+u):new URL(u),r=F(t.pathname,f);t.origin===e.origin&&null!=r?u=r+t.search+t.hash:p=!0}catch(g){}let m=function(e,t){let{relative:r}=void 0===t?{}:t;Ve()||b(!1);let{basename:n,navigator:o}=s.useContext(Ke),{hash:a,pathname:i,search:l}=tt(e,{relative:r}),c=i;return"/"!==n&&(c="/"===i?n:K([n,i])),o.createHref({pathname:c,search:l,hash:a})}(u,{relative:o}),v=function(e,t){let{target:r,replace:n,state:o,preventScrollReset:a,relative:i}=void 0===t?{}:t,l=Qe(),c=Je(),u=tt(e,{relative:i});return s.useCallback((t=>{if(function(e,t){return 0===e.button&&(!t||"_self"===t)&&!function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)}(t,r)){t.preventDefault();let r=void 0!==n?n:S(c)===S(u);l(e,{replace:r,state:o,preventScrollReset:a,relative:i})}}),[c,l,u,n,o,r,e,a,i])}(u,{replace:i,state:l,target:c,preventScrollReset:d,relative:o});return s.createElement("a",wt({},h,{href:r||m,onClick:p||a?n:function(e){n&&n(e),e.defaultPrevented||v(e)},ref:t,target:c}))}));const At=s.forwardRef((function(e,t){let{"aria-current":r="page",caseSensitive:n=!1,className:o="",end:a=!1,style:i,to:l,children:c}=e,u=St(e,Et),d=tt(l,{relative:u.relative}),h=Je(),f=s.useContext($e),{navigator:p}=s.useContext(Ke),m=p.encodeLocation?p.encodeLocation(d).pathname:d.pathname,v=h.pathname,g=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;n||(v=v.toLowerCase(),g=g?g.toLowerCase():null,m=m.toLowerCase());let b,y=v===m||!a&&v.startsWith(m)&&"/"===v.charAt(m.length),x=null!=g&&(g===m||!a&&g.startsWith(m)&&"/"===g.charAt(m.length)),w=y?r:void 0;b="function"===typeof o?o({isActive:y,isPending:x}):[o,y?"active":null,x?"pending":null].filter(Boolean).join(" ");let S="function"===typeof i?i({isActive:y,isPending:x}):i;return s.createElement(_t,wt({},u,{"aria-current":w,className:b,ref:t,style:S,to:l}),"function"===typeof c?c({isActive:y,isPending:x}):c)}));function jt(e){let{getKey:t,storageKey:r}=e;return function(e){let{getKey:t,storageKey:r}=void 0===e?{}:e,{router:n}=Nt(Ot.UseScrollRestoration),{restoreScrollPosition:o,preventScrollReset:a}=Lt(Dt.UseScrollRestoration),{basename:i}=s.useContext(Ke),l=Je(),c=function(){let{matches:e,loaderData:t}=dt(ct.UseMatches);return s.useMemo((()=>e.map((e=>{let{pathname:r,params:n}=e;return{id:e.route.id,pathname:r,params:n,data:t[e.route.id],handle:e.route.handle}}))),[e,t])}(),u=dt(ct.UseNavigation).navigation;s.useEffect((()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"})),[]),function(e,t){let{capture:r}=t||{};s.useEffect((()=>{let t=null!=r?{capture:r}:void 0;return window.addEventListener("pagehide",e,t),()=>{window.removeEventListener("pagehide",e,t)}}),[e,r])}(s.useCallback((()=>{if("idle"===u.state){let e=(t?t(l,c):null)||l.key;Mt[e]=window.scrollY}sessionStorage.setItem(r||It,JSON.stringify(Mt)),window.history.scrollRestoration="auto"}),[r,t,u.state,l,c])),"undefined"!==typeof document&&(s.useLayoutEffect((()=>{try{let e=sessionStorage.getItem(r||It);e&&(Mt=JSON.parse(e))}catch(e){}}),[r]),s.useLayoutEffect((()=>{let e=t&&"/"!==i?(e,r)=>t(wt({},e,{pathname:F(e.pathname,i)||e.pathname}),r):t,r=null==n?void 0:n.enableScrollRestoration(Mt,(()=>window.scrollY),e);return()=>r&&r()}),[n,i,t]),s.useLayoutEffect((()=>{if(!1!==o)if("number"!==typeof o){if(l.hash){let e=document.getElementById(decodeURIComponent(l.hash.slice(1)));if(e)return void e.scrollIntoView()}!0!==a&&window.scrollTo(0,0)}else window.scrollTo(0,o)}),[l,o,a]))}({getKey:t,storageKey:r}),null}var Ot,Dt;function Nt(e){let t=s.useContext(We);return t||b(!1),t}function Lt(e){let t=s.useContext($e);return t||b(!1),t}(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"})(Ot||(Ot={})),function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(Dt||(Dt={}));const It="react-router-scroll-positions";let Mt={};var Bt,Ut=r(6493),Ht=(r(6155),r(645)),zt=r(7905),Ft=r(1507);function Zt(){return Zt=Object.assign?Object.assign.bind():function(e){for(var t=1;t span {\n background-color: var(--color-theme-bg);\n padding: 0 5px;\n }\n"]))),Vt=Ht.ZP.div(Gt||(Gt=(0,o.Z)(["\n text-align: center;\n font-size: 124px;\n padding: 100px 0 32px 0;\n"]))),Jt=Ht.ZP.header(Yt||(Yt=(0,o.Z)(["\n max-width: 860px;\n margin: 0 auto;\n padding: 21px 0;\n align-items: center;\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n a {\n margin: 6px 10px;\n padding: 5px 10px;\n background-color: #e6e6e6;\n box-shadow: rgb(0 0 0 / 15%) 0px 3px 12px;\n border-radius: 5px;\n text-decoration: none;\n display: flex;\n align-items: center;\n color: #333;\n transition: background-color 0.3s;\n &.comps {\n background: #10b316;\n color: white !important;\n }\n &.active {\n color: white;\n background: #333 !important;\n }\n svg {\n margin-right: 5px;\n }\n }\n"]))),Xt=()=>{const{hsva:e,dispatch:t}=(0,s.useContext)(zt._y);return(0,d.jsx)(Ft.default,{color:e,style:{margin:"20px auto 0 auto"},onChange:r=>{t({hsva:{...e,...r.hsva}})}})};function Qt(e){const{menus:t}=e;return(0,d.jsxs)("div",{children:[(0,d.jsx)(Vt,{children:"\ud83c\udfa8"}),(0,d.jsxs)(qt,{children:[(0,d.jsxs)("span",{children:[(0,d.jsx)("b",{children:"react-color"})," is a tiny color picker widget component for react apps. These components can be installed and used separately."]}),(0,d.jsx)(Xt,{})]}),(0,d.jsx)(Jt,{children:t.map(((e,t)=>e.path?(0,d.jsxs)(At,{to:e.path,className:e.isComp?"comps":"",children:["/"===e.path&&(0,d.jsx)($t,{}),(0,d.jsx)("span",{children:e.label})]},t):null))})]})}var er,tr;const rr=Ht.ZP.div(er||(er=(0,o.Z)(["\n transition: background-color 0.3s ease 0s;\n min-height: 100vh;\n dark-mode {\n font-size: 18px;\n position: fixed;\n top: 10px;\n left: 10px;\n }\n"]))),nr=Ht.ZP.div(tr||(tr=(0,o.Z)(["\n position: fixed;\n left: 88px;\n top: 12px;\n background: var(--color-theme-bg);\n border-radius: 3px;\n padding: 0px 6px;\n"])));const or={path:"/",Component:function(){const[e,t]=(0,s.useReducer)(zt.I6,zt.Of);(0,s.useEffect)((()=>{document.body.style.background="url(".concat(m.BACKGROUND_IMG,") left center"),document.body.style.backgroundAttachment="fixed"}),[]);const r=e.hsva;return(0,s.useEffect)((()=>{document.documentElement.style.backgroundColor=(0,Ut.hsvaToHslaString)(r)}),[r]),(0,d.jsx)(zt._y.Provider,{value:{...e,dispatch:t},children:(0,d.jsxs)(rr,{style:{backgroundColor:(0,Ut.hsvaToHslaString)(e.hsva)},children:[(0,d.jsx)("dark-mode",{permanent:!0,light:"Dark",dark:"Light"}),(0,d.jsxs)(nr,{children:["v","2.0.2"]}),(0,d.jsx)(f,{fixed:!0,zIndex:99,size:60,target:"__blank",href:"https://github.com/uiwjs/react-color"}),(0,d.jsx)(Qt,{menus:or.children||[]}),(0,d.jsx)(gt,{}),(0,d.jsx)(jt,{})]})})},ErrorBoundary:(0,s.forwardRef)(((e,t)=>{let{children:r,...n}=e;const o=ft();return(0,d.jsxs)("div",{id:"error-page",...n,ref:t,children:[(0,d.jsx)("h1",{children:"Oops!"}),(0,d.jsx)("p",{children:"\u62b1\u6b49\uff0c\u53d1\u751f\u4e86\u610f\u5916\u9519\u8bef\u3002"}),(0,d.jsxs)("p",{children:[(null===o||void 0===o?void 0:o.status)&&(0,d.jsx)("em",{children:null===o||void 0===o?void 0:o.status}),(null===o||void 0===o?void 0:o.statusText)&&(0,d.jsx)("i",{children:decodeURI((null===o||void 0===o?void 0:o.statusText)||"")})]})]})})),children:[{path:"/",label:"Home",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(31),r.e(281)]).then(r.bind(r,1281))},{path:"/colorful",label:"Colorful",isComp:!0,lazy:()=>Promise.all([r.e(269),r.e(616),r.e(113)]).then(r.bind(r,5782))},{path:"/sketch",label:"Sketch",isComp:!0,lazy:()=>Promise.all([r.e(269),r.e(616),r.e(308)]).then(r.bind(r,7711))},{path:"/block",label:"Block",isComp:!0,lazy:()=>Promise.all([r.e(269),r.e(616),r.e(494)]).then(r.bind(r,5545))},{path:"/circle",label:"Circle",isComp:!0,lazy:()=>Promise.all([r.e(269),r.e(616),r.e(785)]).then(r.bind(r,308))},{path:"/compact",label:"Compact",isComp:!0,lazy:()=>Promise.all([r.e(269),r.e(616),r.e(952)]).then(r.bind(r,7216))},{path:"/wheel",label:"Wheel",isComp:!0,lazy:()=>Promise.all([r.e(269),r.e(616),r.e(919)]).then(r.bind(r,9014))},{path:"/github",label:"Github",isComp:!0,lazy:()=>Promise.all([r.e(269),r.e(616),r.e(781)]).then(r.bind(r,1956))},{path:"/material",label:"Material",isComp:!0,lazy:()=>Promise.all([r.e(269),r.e(616),r.e(955)]).then(r.bind(r,3100))},{path:"/chrome",label:"Chrome",isComp:!0,lazy:()=>Promise.all([r.e(269),r.e(616),r.e(31),r.e(446)]).then(r.bind(r,9446))},{path:"/alpha",label:"Alpha",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(546)]).then(r.bind(r,9522))},{path:"/editable-input",label:"EditableInput",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(756)]).then(r.bind(r,737))},{path:"/editable-input-hsla",label:"EditableInputHsla",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(569)]).then(r.bind(r,6419))},{path:"/editable-input-rgba",label:"EditableInputRgba",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(309)]).then(r.bind(r,2943))},{path:"/hue",label:"Hue",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(297)]).then(r.bind(r,1144))},{path:"/name",label:"Name",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(466)]).then(r.bind(r,8982))},{path:"/saturation",label:"Saturation",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(649)]).then(r.bind(r,710))},{path:"/shade-slider",label:"ShadeSlider",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(620)]).then(r.bind(r,3743))},{path:"/slider",label:"Slider",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(875)]).then(r.bind(r,1983))},{path:"/swatch",label:"Swatch",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(118)]).then(r.bind(r,8865))},{path:"/drag-event-interactive",label:"Interactive",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(94)]).then(r.bind(r,5991))},{path:"/convert",label:"Convert",lazy:()=>Promise.all([r.e(269),r.e(616),r.e(721)]).then(r.bind(r,704))}]},ar={display:"flex",alignItems:"center",justifyContent:"center",gap:"1rem",left:0,right:0,top:0,bottom:0,position:"absolute",zIndex:9999},ir=e=>{let{children:t,style:r,...n}=e;return(0,d.jsxs)("div",{...n,style:{...ar,...r},children:[(0,d.jsxs)("svg",{width:"25",height:"30",viewBox:"0 0 135 140",fill:"currentColor",children:[(0,d.jsxs)("rect",{y:"10",width:"15",height:"120",rx:"6",children:[(0,d.jsx)("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),(0,d.jsx)("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]}),(0,d.jsxs)("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6",children:[(0,d.jsx)("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),(0,d.jsx)("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]}),(0,d.jsxs)("rect",{x:"60",width:"15",height:"140",rx:"6",children:[(0,d.jsx)("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),(0,d.jsx)("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]}),(0,d.jsxs)("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6",children:[(0,d.jsx)("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),(0,d.jsx)("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]}),(0,d.jsxs)("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6",children:[(0,d.jsx)("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),(0,d.jsx)("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]})]}),(0,d.jsx)("div",{children:t||"Loading..."})]})},sr=document.getElementById("root");(0,n.s)(sr).render((0,d.jsx)(mt,{router:function(e,t){return ce({basename:null==t?void 0:t.basename,future:wt({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:(r={window:null==t?void 0:t.window},void 0===r&&(r={}),E((function(e,t){let{pathname:r="/",search:n="",hash:o=""}=C(e.location.hash.substr(1));return w("",{pathname:r,search:n,hash:o},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:S(t))}),(function(e,t){y("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),r)),hydrationData:(null==t?void 0:t.hydrationData)||Rt(),routes:e,mapRouteProperties:xt}).initialize();var r}([or]),fallbackElement:(0,d.jsx)(ir,{})}))},6155:(e,t,r)=>{var n=r(3231).default;const o=document,a="_dark_mode_theme_",i="permanent",s="colorschemechange",l="light",c="dark",u=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;Object.defineProperty(e,r,{enumerable:!0,get(){const e=this.getAttribute(t);return null===e?"":e},set(e){this.setAttribute(t,e)}})};class d extends HTMLElement{static get observedAttributes(){return["mode",l,c,i]}constructor(){super(),n(this,"LOCAL_NANE",a),this.t()}connectedCallback(){u(this,"mode"),u(this,c),u(this,l),function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;Object.defineProperty(e,r,{enumerable:!0,get(){return this.hasAttribute(t)},set(e){e?this.setAttribute(t,""):this.removeAttribute(t)}})}(this,i);const e=localStorage.getItem(a);e&&[l,c].includes(e)&&(this.mode=e,this.permanent=!0),this.permanent&&!e&&localStorage.setItem(a,this.mode);const t=[l,c].includes(e);this.permanent&&e?this.o():(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches&&(this.mode=c,this.o()),window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches&&(this.mode=l,this.o())),this.permanent||t||(window.matchMedia("(prefers-color-scheme: light)").onchange=e=>{this.mode=e.matches?l:c,this.o()},window.matchMedia("(prefers-color-scheme: dark)").onchange=e=>{this.mode=e.matches?c:l,this.o()});new MutationObserver(((e,r)=>{this.mode=o.documentElement.dataset.colorMode,this.permanent&&t&&(localStorage.setItem(a,this.mode),this.i("permanentcolorscheme",{permanent:this.permanent})),this.h(),this.i(s,{colorScheme:this.mode})})).observe(o.documentElement,{attributes:!0}),this.i(s,{colorScheme:this.mode}),this.h()}attributeChangedCallback(e,t,r){if("mode"===e&&t!==r&&[l,c].includes(r)){const e=localStorage.getItem(a);this.mode===e?(this.mode=r,this.h(),this.o()):this.mode&&this.mode!==e&&(this.h(),this.o())}else e!==l&&e!==c||t===r||this.h();"permanent"===e&&"boolean"===typeof this.permanent&&(this.permanent?localStorage.setItem(a,this.mode):localStorage.removeItem(a))}o(){o.documentElement.setAttribute("data-color-mode",this.mode)}h(){this.icon.textContent=this.mode===l?"\ud83c\udf12":"\ud83c\udf1e",this.text.textContent=this.mode===l?this.getAttribute(c):this.getAttribute(l),!this.text.textContent&&this.text.parentElement&&this.text&&this.text.parentElement.removeChild(this.text)}t(){var e=this.attachShadow({mode:"open"});this.label=o.createElement("span"),this.label.setAttribute("class","wrapper"),this.label.onclick=()=>{this.mode=this.mode===l?c:l,this.permanent&&localStorage.setItem(a,this.mode),this.o(),this.h()},e.appendChild(this.label),this.icon=o.createElement("span"),this.label.appendChild(this.icon),this.text=o.createElement("span"),this.label.appendChild(this.text);const t="_dark_mode_style_";if(!o.getElementById(t)){var r=o.createElement("style");r.id=t,r.textContent="\n[data-color-mode*='dark'], [data-color-mode*='dark'] body {\n color-scheme: dark;\n --color-theme-bg: #0d1117;\n --color-theme-text: #c9d1d9;\n background-color: var(--color-theme-bg);\n color: var(--color-theme-text);\n}\n\n[data-color-mode*='light'], [data-color-mode*='light'] body {\n color-scheme: light;\n --color-theme-bg: #fff;\n --color-theme-text: #24292f;\n background-color: var(--color-theme-bg);\n color: var(--color-theme-text);\n}",o.head.appendChild(r)}var n=o.createElement("style");n.textContent="\n .wrapper { cursor: pointer; user-select: none; position: relative; }\n .wrapper > span + span { margin-left: .4rem; }\n ",e.appendChild(n)}i(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))}}customElements.define("dark-mode",d)},1713:e=>{var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"===typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"===typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,l=[],c=!1,u=-1;function d(){c&&s&&(c=!1,s.length?l=s.concat(l):u=-1,l.length&&h())}function h(){if(!c){var e=i(d);c=!0;for(var t=l.length;t;){for(s=l,l=[];++u1)for(var r=1;r{"use strict";function r(e,t){var r=e.length;e.push(t);e:for(;0>>1,o=e[n];if(!(0>>1;na(l,r))ca(u,l)?(e[n]=u,e[c]=r,n=c):(e[n]=l,e[s]=r,n=s);else{if(!(ca(u,r)))break e;e[n]=u,e[c]=r,n=c}}}return t}function a(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var i=performance;t.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}var c=[],u=[],d=1,h=null,f=3,p=!1,m=!1,v=!1,g="function"===typeof setTimeout?setTimeout:null,b="function"===typeof clearTimeout?clearTimeout:null,y="undefined"!==typeof setImmediate?setImmediate:null;function x(e){for(var t=n(u);null!==t;){if(null===t.callback)o(u);else{if(!(t.startTime<=e))break;o(u),t.sortIndex=t.expirationTime,r(c,t)}t=n(u)}}function w(e){if(v=!1,x(e),!m)if(null!==n(c))m=!0,D(S);else{var t=n(u);null!==t&&N(w,t.startTime-e)}}function S(e,r){m=!1,v&&(v=!1,b(k),k=-1),p=!0;var a=f;try{for(x(r),h=n(c);null!==h&&(!(h.expirationTime>r)||e&&!_());){var i=h.callback;if("function"===typeof i){h.callback=null,f=h.priorityLevel;var s=i(h.expirationTime<=r);r=t.unstable_now(),"function"===typeof s?h.callback=s:h===n(c)&&o(c),x(r)}else o(c);h=n(c)}if(null!==h)var l=!0;else{var d=n(u);null!==d&&N(w,d.startTime-r),l=!1}return l}finally{h=null,f=a,p=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var C,E=!1,R=null,k=-1,T=5,P=-1;function _(){return!(t.unstable_now()-Pe||125i?(e.sortIndex=a,r(u,e),null===n(c)&&e===n(u)&&(v?(b(k),k=-1):v=!0,N(w,a-i))):(e.sortIndex=s,r(c,e),m||p||(m=!0,D(S))),e},t.unstable_shouldYield=_,t.unstable_wrapCallback=function(e){var t=f;return function(){var r=f;f=t;try{return e.apply(this,arguments)}finally{f=r}}}},7029:(e,t,r)=>{"use strict";e.exports=r(4478)},1985:e=>{e.exports=function(e,t,r,n){var o=r?r.call(n,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!==typeof e||!e||"object"!==typeof t||!t)return!1;var a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l{"use strict";r.d(t,{ZP:()=>Ft});var n=function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0?E(L,--D):0,j--,10===N&&(j=1,A--),N}function H(){return N=D2||W(N)>3?"":" "}function q(e,t){for(;--t&&H()&&!(N<48||N>102||N>57&&N<65||N>70&&N<97););return Z(e,F()+(t<6&&32==z()&&32==H()))}function V(e){for(;H();)switch(N){case e:return D;case 34:case 39:34!==e&&39!==e&&V(N);break;case 40:41===e&&V(e);break;case 92:H()}return D}function J(e,t){for(;H()&&e+N!==57&&(e+N!==84||47!==z()););return"/*"+Z(t,D-1)+"*"+b(47===e?e:H())}function X(e){for(;!W(z());)H();return Z(e,D)}function Q(e,t){for(var r="",n=0;n6)switch(E(e,t+1)){case 109:if(45!==E(e,t+4))break;case 102:return S(e,/(.+:)(.+)-([^]+)/,"$1"+u+"$2-$3$1"+c+(108==E(e,t+3)?"$3":"$2-$3"))+e;case 115:return~C(e,"stretch")?te(S(e,"stretch","fill-available"),t,r)+e:e}break;case 5152:case 5920:return S(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,r,n,o,a,i,s){return l+r+":"+n+s+(o?l+r+"-span:"+(a?i:+i-+n)+s:"")+e}));case 4949:if(121===E(e,t+6))return S(e,":",":"+u)+e;break;case 6444:switch(E(e,45===E(e,14)?18:11)){case 120:return S(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+u+(45===E(e,14)?"inline-":"")+"box$3$1"+u+"$2$3$1"+l+"$2box$3")+e;case 100:return S(e,":",":"+l)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return S(e,"scroll-","scroll-snap-")+e}return e}function re(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case f:return void(e.return=te(e.value,e.length,r));case m:return Q([M(e,{value:S(e.value,"@","@"+u)})],n);case h:if(e.length)return function(e,t){return e.map(t).join("")}(r=e.props,(function(t){switch(w(t,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":B(M(e,{props:[S(t,/:(read-\w+)/,":"+c+"$1")]})),B(M(e,{props:[t]})),y(e,{props:_(r,n)});break;case"::placeholder":B(M(e,{props:[S(t,/:(plac\w+)/,":"+u+"input-$1")]})),B(M(e,{props:[S(t,/:(plac\w+)/,":"+c+"$1")]})),B(M(e,{props:[S(t,/:(plac\w+)/,l+"input-$1")]})),B(M(e,{props:[t]})),y(e,{props:_(r,n)})}return""}))}}function ne(e){return K(oe("",null,null,null,[""],e=$(e),0,[0],e))}function oe(e,t,r,n,o,a,i,s,l){for(var c=0,u=0,d=i,h=0,f=0,p=0,m=1,v=1,g=1,y=0,x="",w=o,R=a,T=n,_=x;v;)switch(p=y,y=H()){case 40:if(108!=p&&58==E(_,d-1)){-1!=C(_+=S(G(y),"&","&\f"),"&\f")&&(g=-1);break}case 34:case 39:case 91:_+=G(y);break;case 9:case 10:case 13:case 32:_+=Y(p);break;case 92:_+=q(F()-1,7);continue;case 47:switch(z()){case 42:case 47:P(ie(J(H(),F()),t,r,l),l);break;default:_+="/"}break;case 123*m:s[c++]=k(_)*g;case 125*m:case 59:case 0:switch(y){case 0:case 125:v=0;case 59+u:-1==g&&(_=S(_,/\f/g,"")),f>0&&k(_)-d&&P(f>32?se(_+";",n,r,d-1,l):se(S(_," ","")+";",n,r,d-2,l),l);break;case 59:_+=";";default:if(P(T=ae(_,t,r,c,u,o,s,x,w=[],R=[],d,a),a),123===y)if(0===u)oe(_,t,T,T,w,a,d,s,R);else switch(99===h&&110===E(_,3)?100:h){case 100:case 108:case 109:case 115:oe(e,T,T,n&&P(ae(e,T,T,0,0,o,s,x,o,w=[],d,R),R),o,R,d,s,n?w:R);break;default:oe(_,T,T,T,[""],R,0,s,R)}}c=u=f=0,m=g=1,x=_="",d=i;break;case 58:d=1+k(_),f=p;default:if(m<1)if(123==y)--m;else if(125==y&&0==m++&&125==U())continue;switch(_+=b(y),y*m){case 38:g=u>0?1:(_+="\f",-1);break;case 44:s[c++]=(k(_)-1)*g,g=1;break;case 64:45===z()&&(_+=G(H())),h=z(),u=d=k(x=_+=X(F())),y++;break;case 45:45===p&&2==k(_)&&(m=0)}}return a}function ae(e,t,r,n,o,a,i,s,l,c,u,d){for(var f=o-1,p=0===o?a:[""],m=T(p),v=0,b=0,y=0;v0?p[w]+" "+C:S(C,/&\f/g,p[w])))&&(l[y++]=E);return I(e,t,r,0===o?h:s,l,c,u,d)}function ie(e,t,r,n){return I(e,t,r,d,b(N),R(e,2,-2),0,n)}function se(e,t,r,n,o){return I(e,t,r,f,R(e,0,n),R(e,n+1,-1),n,o)}var le={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},ce=r(1713),ue="undefined"!=typeof ce&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}&&({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_ATTR||{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_ATTR)||"data-styled",de="undefined"!=typeof window&&"HTMLElement"in window,he=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof ce&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_DISABLE_SPEEDY&&""!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_DISABLE_SPEEDY?"false"!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_DISABLE_SPEEDY&&{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof ce&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_DISABLE_SPEEDY&&""!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_DISABLE_SPEEDY&&("false"!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_DISABLE_SPEEDY&&{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_DISABLE_SPEEDY)),fe=(new Set,Object.freeze([])),pe=Object.freeze({});function me(e,t,r){return void 0===r&&(r=pe),e.theme!==r.theme&&e.theme||t||r.theme}var ve=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),ge=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,be=/(^-|-$)/g;function ye(e){return e.replace(ge,"-").replace(be,"")}var xe=/(a)(d)/gi,we=function(e){return String.fromCharCode(e+(e>25?39:97))};function Se(e){var t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=we(t%52)+r;return(we(t%52)+r).replace(xe,"$1-$2")}var Ce,Ee=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},Re=function(e){return Ee(5381,e)};function ke(e){return Se(Re(e)>>>0)}function Te(e){return"string"==typeof e&&!0}var Pe="function"==typeof Symbol&&Symbol.for,_e=Pe?Symbol.for("react.memo"):60115,Ae=Pe?Symbol.for("react.forward_ref"):60112,je={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Oe={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},De={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Ne=((Ce={})[Ae]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Ce[_e]=De,Ce);function Le(e){return("type"in(t=e)&&t.type.$$typeof)===_e?De:"$$typeof"in e?Ne[e.$$typeof]:je;var t}var Ie=Object.defineProperty,Me=Object.getOwnPropertyNames,Be=Object.getOwnPropertySymbols,Ue=Object.getOwnPropertyDescriptor,He=Object.getPrototypeOf,ze=Object.prototype;function Fe(e,t,r){if("string"!=typeof t){if(ze){var n=He(t);n&&n!==ze&&Fe(e,n,r)}var o=Me(t);Be&&(o=o.concat(Be(t)));for(var a=Le(e),i=Le(t),s=0;s0?" Args: ".concat(t.join(", ")):""))}var Je=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,r=0;r=this.groupSizes.length){for(var r=this.groupSizes,n=r.length,o=n;e>=o;)if((o<<=1)<0)throw Ve(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(r),this.length=o;for(var a=n;a=this.length||0===this.groupSizes[e])return t;for(var r=this.groupSizes[e],n=this.indexOfGroup(e),o=n+r,a=n;a=0){var r=document.createTextNode(t);return this.element.insertBefore(r,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e0&&(l+="".concat(e,","))})),n+="".concat(i).concat(s,'{content:"').concat(l,'"}').concat("/*!sc*/\n")},a=0;a0?".".concat(t):e},u=l.slice();u.push((function(e){e.type===h&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(mt,r).replace(n,c))})),i.prefix&&u.push(re),u.push(ee);var d=function(e,o,a,s){void 0===o&&(o=""),void 0===a&&(a=""),void 0===s&&(s="&"),t=s,r=o,n=new RegExp("\\".concat(r,"\\b"),"g");var l=e.replace(vt,""),c=ne(a||o?"".concat(a," ").concat(o," { ").concat(l," }"):l);i.namespace&&(c=gt(c,i.namespace));var d,h=[];return Q(c,function(e){var t=T(e);return function(r,n,o,a){for(var i="",s=0;s="A"&&e<="Z"};function Tt(e){for(var t="",r=0;r>>0);if(!t.hasNameForId(this.componentId,a)){var i=r(o,".".concat(a),void 0,this.componentId);t.insertRules(this.componentId,a,i)}n=$e(n,a),this.staticRulesId=a}else{for(var s=Ee(this.baseHash,r.hash),l="",c=0;c>>0);t.hasNameForId(this.componentId,h)||t.insertRules(this.componentId,h,r(l,".".concat(h),void 0,this.componentId)),n=$e(n,h)}}return n},e}(),Nt=a.createContext(void 0);Nt.Consumer;var Lt={};new Set;function It(e,t,r){var o=We(e),i=e,s=!Te(e),l=t.attrs,c=void 0===l?fe:l,u=t.componentId,d=void 0===u?function(e,t){var r="string"!=typeof e?"sc":ye(e);Lt[r]=(Lt[r]||0)+1;var n="".concat(r,"-").concat(ke("6.0.8"+r+Lt[r]));return t?"".concat(t,"-").concat(n):n}(t.displayName,t.parentComponentId):u,h=t.displayName,f=(void 0===h&&function(e){Te(e)?"styled.".concat(e):"Styled(".concat(function(e){return e.displayName||e.name||"Component"}(e),")")}(e),t.displayName&&t.componentId?"".concat(ye(t.displayName),"-").concat(t.componentId):t.componentId||d),p=o&&i.attrs?i.attrs.concat(c).filter(Boolean):c,m=t.shouldForwardProp;if(o&&i.shouldForwardProp){var v=i.shouldForwardProp;if(t.shouldForwardProp){var g=t.shouldForwardProp;m=function(e,t){return v(e,t)&&g(e,t)}}else m=v}var b=new Dt(r,f,o?i.componentStyle:void 0);var y=a.forwardRef((function(e,t){return function(e,t,r){var o=e.attrs,i=e.componentStyle,s=e.defaultProps,l=e.foldedComponentIds,c=e.styledComponentId,u=e.target,d=a.useContext(Nt),h=Ct(),f=e.shouldForwardProp||h.shouldForwardProp,p=function(e,t,r){for(var o,a=n(n({},t),{className:void 0,theme:r}),i=0;i2&&pt.registerId(this.componentId+e),this.removeStyles(e,r),this.createStyles(e,t,r,n)}}();(function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString(),r=st(),n=Ke([r&&'nonce="'.concat(r,'"'),"".concat(ue,'="true"'),"".concat("data-styled-version",'="').concat("6.0.8",'"')].filter(Boolean)," ");return"")},this.getStyleTags=function(){if(e.sealed)throw Ve(2);return e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)throw Ve(2);var r=((t={})[ue]="",t["data-styled-version"]="6.0.8",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),o=st();return o&&(r.nonce=o),[a.createElement("style",n({},r,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new pt({isServer:!0}),this.sealed=!1}e.prototype.collectStyles=function(e){if(this.sealed)throw Ve(2);return a.createElement(Et,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){throw Ve(3)}})(),"__sc-".concat(ue,"__")},7240:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BACKGROUND_IMG:()=>h,Pointer:()=>u,default:()=>p});var n=r(5773),o=r(808),a=r(8573),i=r(6493),s=r(6813),l=r(4760),c=["className","prefixCls","left","top","style","fillProps"],u=e=>{var{className:t,prefixCls:r,left:a,top:i,style:s,fillProps:u}=e,d=(0,o.Z)(e,c),h=(0,n.Z)({},s,{position:"absolute",left:a,top:i}),f=(0,n.Z)({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},null==u?void 0:u.style,{transform:a?"translate(-9px, -1px)":"translate(-1px, -9px)"});return(0,l.jsx)("div",(0,n.Z)({className:r+"-pointer "+(t||""),style:h},d,{children:(0,l.jsx)("div",(0,n.Z)({className:r+"-fill"},u,{style:f}))}))},d=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],h="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",f=a.forwardRef(((e,t)=>{var{prefixCls:r="w-color-alpha",className:a,hsva:c,background:f,bgProps:p={},innerProps:m={},pointerProps:v={},radius:g=0,width:b,height:y=16,direction:x="horizontal",style:w,onChange:S,pointer:C}=e,E=(0,o.Z)(e,d),R=e=>{S&&S((0,n.Z)({},c,{a:"horizontal"===x?e.left:e.top}),e)},k=(0,i.hsvaToHslaString)(Object.assign({},c,{a:1})),T="linear-gradient(to "+("horizontal"===x?"right":"bottom")+", rgba(244, 67, 54, 0) 0%, "+k+" 100%)",P={};"horizontal"===x?P.left=100*c.a+"%":P.top=100*c.a+"%";var _=(0,n.Z)({"--alpha-background-color":"#fff","--alpha-pointer-background-color":"rgb(248, 248, 248)","--alpha-pointer-box-shadow":"rgb(0 0 0 / 37%) 0px 1px 4px 0px",borderRadius:g,background:"url("+h+") left center",backgroundColor:"var(--alpha-background-color)"},w,{position:"relative"},{width:b,height:y}),A=C&&"function"===typeof C?C((0,n.Z)({prefixCls:r},v,P)):(0,l.jsx)(u,(0,n.Z)({},v,{prefixCls:r},P));return(0,l.jsxs)("div",(0,n.Z)({},E,{className:[r,r+"-"+x,a||""].filter(Boolean).join(" "),style:_,ref:t,children:[(0,l.jsx)("div",(0,n.Z)({},p,{style:(0,n.Z)({inset:0,position:"absolute",background:f||T,borderRadius:g},p.style)})),(0,l.jsx)(s.default,(0,n.Z)({},m,{style:(0,n.Z)({},m.style,{inset:0,zIndex:1,position:"absolute"}),onMove:R,onDown:R,children:A}))]}))}));f.displayName="Alpha";const p=f},7961:(e,t,r)=>{"use strict";r.d(t,{Q:()=>o});var n=r(6493),o=e=>{if(!e)return"#ffffff";var t=(0,n.color)(e);return(299*t.rgb.r+587*t.rgb.g+114*t.rgb.b)/1e3>=128?"#000000":"#ffffff"}},6493:(e,t,r)=>{"use strict";r.r(t),r.d(t,{color:()=>I,equalColorObjects:()=>o.zl,equalColorString:()=>o.SJ,equalHex:()=>o.Gp,getContrastingColor:()=>a.Q,hexToHsva:()=>k,hexToRgba:()=>T,hslStringToHsla:()=>f,hslStringToHsva:()=>m,hslaStringToHsva:()=>p,hslaToHsl:()=>O,hslaToHsva:()=>v,hsvStringToHsva:()=>w,hsvaStringToHsva:()=>b,hsvaToHex:()=>D,hsvaToHexa:()=>N,hsvaToHslString:()=>c,hsvaToHsla:()=>g,hsvaToHslaString:()=>h,hsvaToHsv:()=>L,hsvaToHsvString:()=>u,hsvaToHsvaString:()=>d,hsvaToRgbString:()=>_,hsvaToRgba:()=>P,hsvaToRgbaString:()=>A,parseHue:()=>x,rgbStringToHsva:()=>C,rgbaStringToHsva:()=>S,rgbaToHex:()=>E,rgbaToHexa:()=>R,rgbaToHsva:()=>l,rgbaToRgb:()=>j,validHex:()=>o.Ff});var n=r(5773),o=r(5301),a=r(7961),i=255,s=100,l=e=>{var{r:t,g:r,b:n,a:o}=e,a=Math.max(t,r,n),l=a-Math.min(t,r,n),c=l?a===t?(r-n)/l:a===r?2+(n-t)/l:4+(t-r)/l:0;return{h:60*(c<0?c+6:c),s:a?l/a*s:0,v:a/i*s,a:o}},c=e=>{var{h:t,s:r,l:n}=g(e);return"hsl("+t+", "+Math.round(r)+"%, "+Math.round(n)+"%)"},u=e=>{var{h:t,s:r,v:n}=e;return"hsv("+t+", "+r+"%, "+n+"%)"},d=e=>{var{h:t,s:r,v:n,a:o}=e;return"hsva("+t+", "+r+"%, "+n+"%, "+o+")"},h=e=>{var{h:t,s:r,l:n,a:o}=g(e);return"hsla("+t+", "+r+"%, "+n+"%, "+o+")"},f=e=>{var[t,r,n,o]=(e.match(/\d+/g)||[]).map(Number);return{h:t,s:r,l:n,a:o}},p=e=>{var t=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?v({h:x(t[1],t[2]),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)}):{h:0,s:0,v:0,a:1}},m=p,v=e=>{var{h:t,s:r,l:n,a:o}=e;return{h:t,s:(r*=(n<50?n:s-n)/s)>0?2*r/(n+r)*s:0,v:n+r,a:o}},g=e=>{var{h:t,s:r,v:n,a:o}=e,a=(200-r)*n/s;return{h:t,s:a>0&&a<200?r*n/s/(a<=s?a:200-a)*s:0,l:a/2,a:o}},b=e=>{var t=/hsva?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?{h:x(t[1],t[2]),s:Number(t[3]),v:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?s:1)}:{h:0,s:0,v:0,a:1}},y={grad:.9,turn:360,rad:360/(2*Math.PI)},x=function(e,t){return void 0===t&&(t="deg"),Number(e)*(y[t]||1)},w=b,S=e=>{var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?l({r:Number(t[1])/(t[2]?s/i:1),g:Number(t[3])/(t[4]?s/i:1),b:Number(t[5])/(t[6]?s/i:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?s:1)}):{h:0,s:0,v:0,a:1}},C=S,E=e=>{var t,{r:r,g:n,b:o}=e;return"#"+(t=(r<<16|n<<8|o).toString(16),new Array(7-t.length).join("0")+t)},R=e=>{var{r:t,g:r,b:n,a:o}=e,a="number"===typeof o&&(255*o|256).toString(16).slice(1);return""+E({r:t,g:r,b:n,a:o})+(a||"")},k=e=>l(T(e)),T=e=>{var t=e.replace("#","");/^#?/.test(e)&&3===t.length&&(e="#"+t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));var r=new RegExp("[A-Za-z0-9]{2}","g"),[n,o,a=0,s]=e.match(r).map((e=>parseInt(e,16)));return{r:n,g:o,b:a,a:(null!=s?s:255)/i}},P=e=>{var{h:t,s:r,v:o,a:a}=e,l=t/60,c=r/s,u=o/s,d=Math.floor(l)%6,h=l-Math.floor(l),f=i*u*(1-c),p=i*u*(1-c*h),m=i*u*(1-c*(1-h));u*=i;var v={};switch(d){case 0:v.r=u,v.g=m,v.b=f;break;case 1:v.r=p,v.g=u,v.b=f;break;case 2:v.r=f,v.g=u,v.b=m;break;case 3:v.r=f,v.g=p,v.b=u;break;case 4:v.r=m,v.g=f,v.b=u;break;case 5:v.r=u,v.g=f,v.b=p}return v.r=Math.round(v.r),v.g=Math.round(v.g),v.b=Math.round(v.b),(0,n.Z)({},v,{a:a})},_=e=>{var{r:t,g:r,b:n}=P(e);return"rgb("+t+", "+r+", "+n+")"},A=e=>{var{r:t,g:r,b:n,a:o}=P(e);return"rgba("+t+", "+r+", "+n+", "+o+")"},j=e=>{var{r:t,g:r,b:n}=e;return{r:t,g:r,b:n}},O=e=>{var{h:t,s:r,l:n}=e;return{h:t,s:r,l:n}},D=e=>E(P(e)),N=e=>R(P(e)),L=e=>{var{h:t,s:r,v:n}=e;return{h:t,s:r,v:n}},I=e=>{var t,r,n,a,i,s,l,c;return"string"===typeof e&&(0,o.Ff)(e)?(s=k(e),l=e):"string"!==typeof e&&(s=e),s&&(n=L(s),i=g(s),a=P(s),c=R(a),l=D(s),r=O(i),t=j(a)),{rgb:t,hsl:r,hsv:n,rgba:a,hsla:i,hsva:s,hex:l,hexa:c}}},5301:(e,t,r)=>{"use strict";r.d(t,{Ff:()=>s,Gp:()=>i,SJ:()=>a,zl:()=>o});var n=r(6493),o=(e,t)=>{if(e===t)return!0;for(var r in e)if(e[r]!==t[r])return!1;return!0},a=(e,t)=>e.replace(/\s/g,"")===t.replace(/\s/g,""),i=(e,t)=>e.toLowerCase()===t.toLowerCase()||o((0,n.hexToRgba)(e),(0,n.hexToRgba)(t)),s=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e)},3789:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>d});var n=r(5773),o=r(808),a=r(8573),i=r(8702),s=r(6493),l=r(4760),c=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],u=a.forwardRef(((e,t)=>{var{prefixCls:r="w-color-editable-input-rgba",hsva:a,placement:u="bottom",rProps:d={},gProps:h={},bProps:f={},aProps:p={},className:m,style:v,onChange:g}=e,b=(0,o.Z)(e,c),y=a?(0,s.hsvaToRgba)(a):{};function x(e){var t=Number(e.target.value);t&&t>255&&(e.target.value="255"),t&&t<0&&(e.target.value="0")}var w=(e,t,r)=>{"number"===typeof e&&("a"===t&&(e<0&&(e=0),e>100&&(e=100),g&&g((0,s.color)((0,s.rgbaToHsva)((0,n.Z)({},y,{a:e/100}))))),e>255&&(e=255,r.target.value="255"),e<0&&(e=0,r.target.value="0"),"r"===t&&g&&g((0,s.color)((0,s.rgbaToHsva)((0,n.Z)({},y,{r:e})))),"g"===t&&g&&g((0,s.color)((0,s.rgbaToHsva)((0,n.Z)({},y,{g:e})))),"b"===t&&g&&g((0,s.color)((0,s.rgbaToHsva)((0,n.Z)({},y,{b:e})))))};return(0,l.jsxs)("div",(0,n.Z)({ref:t,className:[r,m||""].filter(Boolean).join(" ")},b,{style:(0,n.Z)({fontSize:11,display:"flex"},v),children:[(0,l.jsx)(i.default,(0,n.Z)({label:"R",value:y.r||0,onBlur:x,placement:u,onChange:(e,t)=>w(t,"r",e)},d,{style:(0,n.Z)({},d.style)})),(0,l.jsx)(i.default,(0,n.Z)({label:"G",value:y.g||0,onBlur:x,placement:u,onChange:(e,t)=>w(t,"g",e)},h,{style:(0,n.Z)({marginLeft:5},d.style)})),(0,l.jsx)(i.default,(0,n.Z)({label:"B",value:y.b||0,onBlur:x,placement:u,onChange:(e,t)=>w(t,"b",e)},f,{style:(0,n.Z)({marginLeft:5},f.style)})),p&&(0,l.jsx)(i.default,(0,n.Z)({label:"A",value:y.a?parseInt(String(100*y.a),10):0,onBlur:x,placement:u,onChange:(e,t)=>w(t,"a",e)},p,{style:(0,n.Z)({marginLeft:5},p.style)}))]}))}));u.displayName="EditableInputRGBA";const d=u},8702:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>c});var n=r(5773),o=r(808),a=r(8573),i=r(4760),s=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur"],l=a.forwardRef(((e,t)=>{var{prefixCls:r="w-color-editable-input",placement:l="bottom",label:c,value:u,className:d,style:h,labelStyle:f,inputStyle:p,onChange:m,onBlur:v}=e,g=(0,o.Z)(e,s),[b,y]=(0,a.useState)(u),x=(0,a.useRef)(!1);(0,a.useEffect)((()=>{e.value!==b&&(x.current||y(e.value))}),[e.value]);var w={};"bottom"===l&&(w.flexDirection="column"),"top"===l&&(w.flexDirection="column-reverse"),"left"===l&&(w.flexDirection="row-reverse");var S=(0,n.Z)({"--editable-input-label-color":"rgb(153, 153, 153)","--editable-input-box-shadow":"rgb(204 204 204) 0px 0px 0px 1px inset","--editable-input-color":"#666",position:"relative",alignItems:"center",display:"flex",fontSize:11},w,h),C=(0,n.Z)({width:"100%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,fontSize:11,background:"transparent",boxSizing:"border-box",border:"none",color:"var(--editable-input-color)",boxShadow:"var(--editable-input-box-shadow)"},p);return(0,i.jsxs)("div",{className:[r,d||""].filter(Boolean).join(" "),style:S,children:[(0,i.jsx)("input",(0,n.Z)({ref:t,value:b,onChange:function(e,t){var r=(t||e.target.value).trim().replace(/^#/,"");/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(r)&&m&&m(e,r);var n=(e=>Number(String(e).replace(/%/g,"")))(r);isNaN(n)||m&&m(e,n),y(r)},onBlur:function(t){x.current=!1,y(e.value),v&&v(t)},autoComplete:"off",onFocus:()=>x.current=!0},g,{style:C})),c&&(0,i.jsx)("span",{style:(0,n.Z)({color:"var(--editable-input-label-color)",textTransform:"capitalize"},f),children:c})]})}));l.displayName="EditableInput";const c=l},7864:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});var n=r(5773),o=r(808),a=r(8573),i=r(7240),s=r(4760),l=["prefixCls","className","hue","onChange","direction"],c=a.forwardRef(((e,t)=>{var{prefixCls:r="w-color-hue",className:a,hue:c=0,onChange:u,direction:d="horizontal"}=e,h=(0,o.Z)(e,l);return(0,s.jsx)(i.default,(0,n.Z)({ref:t,className:r+" "+(a||"")},h,{direction:d,background:"linear-gradient(to "+("horizontal"===d?"right":"bottom")+", rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)",hsva:{h:c,s:100,v:100,a:c/360},onChange:(e,t)=>{u&&u({h:"horizontal"===d?360*t.left:360*t.top})}}))}));c.displayName="Hue";const u=c},6319:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>h});var n=r(5773),o=r(808),a=r(8573),i=r(6493),s=r(6813),l=r(4760),c=e=>{var{className:t,color:r,left:n,top:o,prefixCls:i}=e,s={position:"absolute",top:o,left:n},c={"--saturation-pointer-box-shadow":"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",width:6,height:6,transform:"translate(-3px, -3px)",boxShadow:"var(--saturation-pointer-box-shadow)",borderRadius:"50%",backgroundColor:r};return(0,a.useMemo)((()=>(0,l.jsx)("div",{className:i+"-pointer "+(t||""),style:s,children:(0,l.jsx)("div",{className:i+"-fill",style:c})})),[o,n,r,t,i])},u=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],d=a.forwardRef(((e,t)=>{var r,{prefixCls:d="w-color-saturation",radius:h=0,pointer:f,className:p,hue:m=0,style:v,hsva:g,onChange:b}=e,y=(0,o.Z)(e,u),x=(0,n.Z)({width:200,height:200,borderRadius:h},v,{position:"relative"}),w=(e,t)=>{b&&g&&b({h:g.h,s:100*e.left,v:100*(1-e.top),a:g.a})},S=(0,a.useMemo)((()=>{if(!g)return null;var e={top:100-g.v+"%",left:g.s+"%",color:(0,i.hsvaToHslaString)(g)};return f&&"function"===typeof f?f((0,n.Z)({prefixCls:d},e)):(0,l.jsx)(c,(0,n.Z)({prefixCls:d},e))}),[g,f,d]);return(0,l.jsx)(s.default,(0,n.Z)({className:[d,p||""].filter(Boolean).join(" ")},y,{style:(0,n.Z)({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+(null!=(r=null==g?void 0:g.h)?r:m)+", 100%, 50%))"},x),ref:t,onMove:w,onDown:w,children:S}))}));d.displayName="Saturation";const h=d},1507:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var n=r(5773),o=r(808),a=r(8573),i=r(6319),s=r(7240),l=r(8702),c=r(3789),u=r(7864),d=r(5301),h=r(6493),f=r(9887),p=r(4760),m=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],v=["#D0021B","#F5A623","#f8e61b","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],g=e=>(0,p.jsx)("div",{style:{boxShadow:"rgb(0 0 0 / 60%) 0px 0px 2px",width:4,top:1,bottom:1,left:e.left,borderRadius:1,position:"absolute",backgroundColor:"#fff"}}),b=a.forwardRef(((e,t)=>{var{prefixCls:r="w-color-sketch",className:b,onChange:y,width:x=218,presetColors:w=v,color:S,editableDisable:C=!0,disableAlpha:E=!1,style:R}=e,k=(0,o.Z)(e,m),[T,P]=(0,a.useState)({h:209,s:36,v:90,a:1});(0,a.useEffect)((()=>{"string"===typeof S&&(0,d.Ff)(S)&&P((0,h.hexToHsva)(S)),"object"===typeof S&&P(S)}),[S]);var _=e=>{P(e),y&&y((0,h.color)(e))},A=(0,n.Z)({"--sketch-background":"rgb(255, 255, 255)","--sketch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px, rgb(0 0 0 / 15%) 0px 8px 16px","--sketch-swatch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset","--sketch-alpha-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset, rgb(0 0 0 / 25%) 0px 0px 4px inset","--sketch-swatch-border-top":"1px solid rgb(238, 238, 238)",background:"var(--sketch-background)",borderRadius:4,boxShadow:"var(--sketch-box-shadow)",width:x},R),j={borderRadius:2,background:(0,h.hsvaToRgbaString)(T),boxShadow:"var(--sketch-alpha-box-shadow)"};return(0,p.jsxs)("div",(0,n.Z)({},k,{className:r+" "+(b||""),ref:t,style:A,children:[(0,p.jsxs)("div",{style:{padding:"10px 10px 8px"},children:[(0,p.jsx)(i.default,{hsva:T,style:{width:"auto",height:150},onChange:e=>_((0,n.Z)({},T,e,{a:T.a}))}),(0,p.jsxs)("div",{style:{display:"flex",marginTop:4},children:[(0,p.jsxs)("div",{style:{flex:1},children:[(0,p.jsx)(u.default,{width:"auto",height:10,hue:T.h,pointer:g,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:e=>_((0,n.Z)({},T,e))}),!E&&(0,p.jsx)(s.default,{width:"auto",height:10,hsva:T,pointer:g,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:e=>_((0,n.Z)({},T,{a:e.a}))})]}),!E&&(0,p.jsx)(s.default,{width:24,height:24,hsva:T,radius:2,style:{marginLeft:4},bgProps:{style:{background:"transparent"}},innerProps:{style:j},pointer:()=>(0,p.jsx)(a.Fragment,{})})]})]}),C&&(0,p.jsxs)("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[(0,p.jsx)(l.default,{label:"Hex",value:(0,h.hsvaToHex)(T).replace(/^#/,"").toLocaleUpperCase(),onChange:(e,t)=>{var r;"string"===typeof(r=t)&&(0,d.Ff)(r)&&/(3|6)/.test(String(r.length))&&_((0,h.hexToHsva)(r))},style:{minWidth:58}}),(0,p.jsx)(c.default,{hsva:T,style:{marginLeft:6},aProps:!E&&{},onChange:e=>_(e.hsva)})]}),w&&w.length>0&&(0,p.jsx)(f.default,{style:{borderTop:"var(--sketch-swatch-border-top)",paddingTop:10,paddingLeft:10},colors:w,color:(0,h.hsvaToHex)(T),onChange:e=>_(e),rectProps:{style:{marginRight:10,marginBottom:10,borderRadius:3,boxShadow:"var(--sketch-swatch-box-shadow)"}}})]}))}));b.displayName="Sketch";const y=b},9887:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});var n=r(5773),o=r(808),a=r(8573),i=r(6493),s=r(4760),l=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],c=a.forwardRef(((e,t)=>{var{prefixCls:r="w-color-swatch",className:c,color:u,colors:d=[],style:h,rectProps:f={},onChange:p,addonAfter:m,addonBefore:v,rectRender:g}=e,b=(0,o.Z)(e,l),y=(0,n.Z)({"--swatch-background-color":"rgb(144, 19, 254)",background:"var(--swatch-background-color)",height:15,width:15,marginRight:5,marginBottom:5,cursor:"pointer",position:"relative",outline:"none",borderRadius:2},f.style),x=(e,t)=>{p&&p((0,i.hexToHsva)(e),(0,i.color)((0,i.hexToHsva)(e)),t)};return(0,s.jsxs)("div",(0,n.Z)({ref:t},b,{className:[r,c||""].filter(Boolean).join(" "),style:(0,n.Z)({display:"flex",flexWrap:"wrap",position:"relative"},h),children:[v&&a.isValidElement(v)&&v,d&&Array.isArray(d)&&d.map(((e,t)=>{var r="",o="";"string"===typeof e&&(r=e,o=e),"object"===typeof e&&e.color&&(r=e.title||e.color,o=e.color);var i=u&&u.toLocaleLowerCase()===o.toLocaleLowerCase(),l=g&&g({key:t,title:r,color:o,checked:!!i,style:(0,n.Z)({},y,{background:o}),onClick:e=>x(o,e)});if(l)return l;var c=f.children&&a.isValidElement(f.children)?a.cloneElement(f.children,{color:o,checked:i}):null;return(0,s.jsx)("div",(0,n.Z)({tabIndex:0,title:r,onClick:e=>x(o,e)},f,{children:c,style:(0,n.Z)({},y,{background:o})}),t)})),m&&a.isValidElement(m)&&m]}))}));c.displayName="Swatch";const u=c},6813:(e,t,r)=>{"use strict";r.r(t),r.d(t,{clamp:()=>c,default:()=>p,getRelativePosition:()=>u,isTouch:()=>s,preventDefaultMove:()=>l,useEventCallback:()=>i});var n=r(5773),o=r(808),a=r(8573);function i(e){var t=(0,a.useRef)(e);return(0,a.useEffect)((()=>{t.current=e})),(0,a.useCallback)(((e,r)=>t.current&&t.current(e,r)),[])}var s=e=>"touches"in e,l=e=>{!s(e)&&e.preventDefault&&e.preventDefault()},c=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e{var r=e.getBoundingClientRect(),n=s(t)?t.touches[0]:t;return{left:c((n.pageX-(r.left+window.pageXOffset))/r.width),top:c((n.pageY-(r.top+window.pageYOffset))/r.height),width:r.width,height:r.height,x:n.pageX-(r.left+window.pageXOffset),y:n.pageY-(r.top+window.pageYOffset)}},d=r(4760),h=["prefixCls","className","onMove","onDown"],f=a.forwardRef(((e,t)=>{var{prefixCls:r="w-color-interactive",className:c,onMove:f,onDown:p}=e,m=(0,o.Z)(e,h),v=(0,a.useRef)(null),g=(0,a.useRef)(!1),[b,y]=(0,a.useState)(!1),x=i(f),w=i(p),S=(0,a.useCallback)((e=>{l(e),(s(e)?e.touches.length>0:e.buttons>0)&&v.current?x&&x(u(v.current,e),e):y(!1)}),[x]),C=(0,a.useCallback)((()=>y(!1)),[]),E=(0,a.useCallback)((e=>{var t=e?window.addEventListener:window.removeEventListener;t(g.current?"touchmove":"mousemove",S),t(g.current?"touchend":"mouseup",C)}),[]);(0,a.useEffect)((()=>(E(b),()=>{b&&E(!1)})),[b,E]);var R=(0,a.useCallback)((e=>{l(e.nativeEvent),(e=>!(g.current&&!s(e))&&(g.current=s(e),!0))(e.nativeEvent)&&(w&&w(u(v.current,e.nativeEvent),e.nativeEvent),y(!0))}),[w]);return(0,d.jsx)("div",(0,n.Z)({},m,{className:[r,c||""].filter(Boolean).join(" "),style:(0,n.Z)({},m.style,{touchAction:"none"}),ref:v,tabIndex:0,onMouseDown:R,onTouchStart:R}))}));f.displayName="Interactive";const p=f},3231:(e,t,r)=>{var n=r(4040);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},6027:(e,t,r)=>{var n=r(7501).default;e.exports=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},4040:(e,t,r)=>{var n=r(7501).default,o=r(6027);e.exports=function(e){var t=o(e,"string");return"symbol"===n(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},7501:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},5773:(e,t,r)=>{"use strict";function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;tn})},808:(e,t,r)=>{"use strict";function n(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}r.d(t,{Z:()=>n})},669:(e,t,r)=>{"use strict";function n(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}r.d(t,{Z:()=>n})}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}r.m=e,(()=>{var e=[];r.O=(t,n,o,a)=>{if(!n){var i=1/0;for(u=0;u=a)&&Object.keys(r.O).every((e=>r.O[e](n[l])))?n.splice(l--,1):(s=!1,a0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[n,o,a]}})(),r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;r.t=function(n,o){if(1&o&&(n=this(n)),8&o)return n;if("object"===typeof n&&n){if(4&o&&n.__esModule)return n;if(16&o&&"function"===typeof n.then)return n}var a=Object.create(null);r.r(a);var i={};e=e||[null,t({}),t([]),t(t)];for(var s=2&o&&n;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((e=>i[e]=()=>n[e]));return i.default=()=>n,r.d(a,i),a}})(),r.d=(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.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>"static/js/"+(269===e?"refractor-vendor":e)+"."+{2:"e3b9569b",3:"e49a76e3",18:"54b953d4",31:"76c93261",66:"102649ab",94:"4a1e40b4",107:"f8ef98e9",113:"81fe9207",118:"a2829275",221:"898895f7",231:"2acf64c2",269:"764aade8",281:"7701c91b",297:"2999625e",299:"4d04e559",301:"6ef1b1ca",308:"9863b32d",309:"c65600e1",361:"4b34de40",426:"c76c99eb",446:"143df30c",458:"b8eac3d2",466:"3d56ca60",469:"52dcbe0e",494:"09a1ed39",536:"355f6fdb",546:"117e7600",569:"3a3267ac",616:"4b307a7d",620:"d3f8992d",624:"85d8dd56",632:"a2a0ae68",649:"267f3f39",652:"b0572e00",691:"609bb527",721:"33de9a18",756:"d4c97a8a",781:"94394555",785:"e66d3501",852:"dd0a0261",875:"d699f24c",919:"fd6405c6",952:"247c9658",955:"a7b0e6df",982:"a12d661f",995:"2c605ed7",996:"ad604e30"}[e]+".chunk.js",r.miniCssF=e=>"static/css/"+e+"."+{281:"c7b2c18c",616:"ec33dedb"}[e]+".chunk.css",r.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="website:";r.l=(n,o,a,i)=>{if(e[n])e[n].push(o);else{var s,l;if(void 0!==a)for(var c=document.getElementsByTagName("script"),u=0;u{s.onerror=s.onload=null,clearTimeout(f);var o=e[n];if(delete e[n],s.parentNode&&s.parentNode.removeChild(s),o&&o.forEach((e=>e(r))),t)return t(r)},f=setTimeout(h.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=h.bind(null,s.onerror),s.onload=h.bind(null,s.onload),l&&document.head.appendChild(s)}}})(),r.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="./",(()=>{if("undefined"!==typeof document){var e=e=>new Promise(((t,n)=>{var o=r.miniCssF(e),a=r.p+o;if(((e,t)=>{for(var r=document.getElementsByTagName("link"),n=0;n{var a=document.createElement("link");a.rel="stylesheet",a.type="text/css",a.onerror=a.onload=r=>{if(a.onerror=a.onload=null,"load"===r.type)n();else{var i=r&&("load"===r.type?"missing":r.type),s=r&&r.target&&r.target.href||t,l=new Error("Loading CSS chunk "+e+" failed.\n("+s+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=i,l.request=s,a.parentNode&&a.parentNode.removeChild(a),o(l)}},a.href=t,r?r.parentNode.insertBefore(a,r.nextSibling):document.head.appendChild(a)})(e,a,null,t,n)})),t={179:0};r.f.miniCss=(r,n)=>{t[r]?n.push(t[r]):0!==t[r]&&{281:1,616:1}[r]&&n.push(t[r]=e(r).then((()=>{t[r]=0}),(e=>{throw delete t[r],e})))}}})(),(()=>{var e={179:0};r.f.j=(t,n)=>{var o=r.o(e,t)?e[t]:void 0;if(0!==o)if(o)n.push(o[2]);else{var a=new Promise(((r,n)=>o=e[t]=[r,n]));n.push(o[2]=a);var i=r.p+r.u(t),s=new Error;r.l(i,(n=>{if(r.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var a=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+a+": "+i+")",s.name="ChunkLoadError",s.type=a,s.request=i,o[1](s)}}),"chunk-"+t,t)}},r.O.j=t=>0===e[t];var t=(t,n)=>{var o,a,i=n[0],s=n[1],l=n[2],c=0;if(i.some((t=>0!==e[t]))){for(o in s)r.o(s,o)&&(r.m[o]=s[o]);if(l)var u=l(r)}for(t&&t(n);cr(7261)));n=r.O(n)})(); +//# sourceMappingURL=main.b083e6eb.js.map \ No newline at end of file diff --git a/static/js/main.98420307.js.LICENSE.txt b/static/js/main.b083e6eb.js.LICENSE.txt similarity index 100% rename from static/js/main.98420307.js.LICENSE.txt rename to static/js/main.b083e6eb.js.LICENSE.txt diff --git a/static/js/main.98420307.js.map b/static/js/main.b083e6eb.js.map similarity index 99% rename from static/js/main.98420307.js.map rename to static/js/main.b083e6eb.js.map index a65a71838..45291b1f1 100644 --- a/static/js/main.98420307.js.map +++ b/static/js/main.b083e6eb.js.map @@ -1 +1 @@ -{"version":3,"file":"static/js/main.98420307.js","mappings":";2FAGO,MAAMA,EAA+B,CAC1CC,KAAM,CAAEC,EAAG,IAAKC,EAAG,GAAIC,EAAG,GAAIC,EAAG,IAGtBC,EAAUC,EAAAA,cAAkCP,GAOlD,SAASQ,EAAQC,EAAqBC,GAC3C,MAAO,IAAKD,KAAUC,EACxB,8FCFA,MAAMC,EAA0BC,SAASC,cAAc,YACvDF,EAAwBG,UAAY,sqDA8B9B,MAAOC,UAAsBC,YAgBjC,6BAAWC,GACT,MAAO,CAAC,QAAS,UAAW,SAAU,SAAU,QAAS,OAAQ,QAAS,OAAQ,WAAY,MAAO,OAAQ,QAAS,SAAU,YAClI,CACAC,WAAAA,GACEC,QARF,KAAAC,MAAiB,IASfC,KAAKC,OAASD,KAAKE,aAAa,CAAEC,KAAM,SACxCH,KAAKC,OAAOG,YAAYJ,KAAKK,cAAcC,WAAWhB,EAAwBiB,SAAS,IACvFP,KAAKQ,QACP,CACQC,OAAAA,CAAQC,EAAcC,GAC5B,MAAMC,EAAMZ,KAAKC,OAAOY,cAAc,OAClC,SAASC,KAAKJ,EAAKK,qBACrBH,EAAII,iBAAiBC,aAAa,aAAcN,GACvC,eAAeG,KAAKJ,EAAKK,qBACjCH,EAAIM,kBAAwCC,MAAMT,GAAeC,EACzD,qDAAqDG,KAAKJ,EAAKK,qBACxEH,EAAIO,MAAMT,GAAeC,EAEzBC,EAAIK,aAAaP,EAAMC,EAE3B,CACQH,MAAAA,GACL,IAAIR,KAAKoB,oBAAqB,SAASC,SAASX,IAC/C,MAAMC,EAAQX,KAAKsB,aAAaZ,IAASV,KAAKU,IAAuC,GACrFV,KAAKS,QAAQC,EAAMC,EAAM,GAE7B,CACAY,wBAAAA,CAAyBb,EAAcc,EAAkBC,GACnDD,IAAaC,GACfzB,KAAKS,QAAQC,EAAMe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Ul+B,EAAak+B,OAASjiC,EAAMiiC,OAAUpR,GAAiB9sB,EAAak+B,KAAA,CCN9F,IAwIAx4B,GAAe,IAAIvF,IAxIF,CACf,IACA,OACA,UACA,OACA,UACA,QACA,QACA,IACA,OACA,MACA,MACA,MACA,aACA,OACA,KACA,SACA,SACA,UACA,OACA,OACA,MACA,WACA,OACA,WACA,KACA,MACA,UACA,MACA,SACA,MACA,KACA,KACA,KACA,QACA,WACA,aACA,SACA,SACA,OACA,KACA,KACA,KACA,KACA,KACA,KACA,SACA,SACA,KACA,OACA,IACA,SACA,MACA,QACA,MACA,MACA,SACA,QACA,SACA,KACA,OACA,OACA,MACA,OACA,OACA,WACA,OACA,QACA,MACA,WACA,SACA,KACA,WACA,SACA,SACA,IACA,QACA,UACA,MACA,WACA,IACA,KACA,KACA,OACA,IACA,OACA,SACA,UACA,SACA,QACA,SACA,OACA,SACA,QACA,MACA,UACA,MACA,QACA,QACA,KACA,WACA,QACA,KACA,QACA,OACA,KACA,QACA,IACA,KACA,MACA,MACA,QACA,MACA,SACA,WACA,OACA,UACA,gBACA,IACA,QACA,OACA,iBACA,SACA,OACA,OACA,UACA,UACA,WACA,iBACA,OACA,OACA,MACA,OACA,UCrII2xB,GAAc,wCAEdoB,GAAe,WAMG,SAAAV,GAAOv2B,GAC7B,OAAOA,EACJ4D,QAAQiyB,GAAa,KACrBjyB,QAAQqzB,GAAc,ICb3B,IAAMU,GAAgB,WAOhBlB,GAAoB,SAACz2B,GAAiB,OAAA2c,OAAOye,aAAap7B,GAAQA,EAAO,GAAK,GAAK,MAGjE,SAAA83B,GAAuB93B,GAC7C,IACI6wB,EADA9sB,EAAO,GAIX,IAAK8sB,EAAI/vB,KAAKq6B,IAAIn7B,GAAO6wB,EAXP,GAWwBA,EAAKA,EAX7B,GAWgD,EAChE9sB,EAAO0yB,GAAkB5F,EAZT,IAY4B9sB,EAG9C,OAAQ0yB,GAAkB5F,EAfR,IAe2B9sB,GAAMH,QAAQ+zB,GAAe,S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,EAASv0C,GAChBm0C,EAAoBppB,EAAEusB,EAAiBpC,IAAYoC,EAAgBpC,IACrEoC,EAAgBpC,GAAS,KAE1BoC,EAAgBpC,GAAW,EAE5B,OAAOf,EAAoBviB,EAAE/vB,EAAO,EAGjCi2C,EAAqBC,KAA0B,oBAAIA,KAA0B,qBAAK,GACtFD,EAAmBpgD,QAAQggD,EAAqBpxB,KAAK,KAAM,IAC3DwxB,EAAmBx6C,KAAOo6C,EAAqBpxB,KAAK,KAAMwxB,EAAmBx6C,KAAKgpB,KAAKwxB,QCvFvF3D,EAAoB2B,QAAK52C,ECGzB,IAAI84C,EAAsB7D,EAAoBviB,OAAE1yB,EAAW,CAAC,MAAM,IAAOi1C,EAAoB,QAC7F6D,EAAsB7D,EAAoBviB,EAAEomB","sources":["Store.tsx","../../node_modules/@uiw/github-corners/src/index.ts","../../node_modules/@uiw/react-github-corners/esm/index.js","../../node_modules/@remix-run/router/history.ts","../../node_modules/@remix-run/router/utils.ts","../../node_modules/@remix-run/router/router.ts","../../lib/context.ts","../../lib/hooks.tsx","../../lib/components.tsx","../../index.ts","../../dom.ts","../../index.tsx","assets/home.svg","components/Header.tsx","components/Layout.tsx","components/ErrorPage.tsx","router.tsx","components/Fallback.tsx","index.tsx","../../node_modules/@wcj/dark-mode/dist/dark-mode.min.js","../../node_modules/process/browser.js","../../node_modules/scheduler/cjs/scheduler.production.min.js","../../node_modules/scheduler/index.js","../../node_modules/shallowequal/index.js","../../node_modules/tslib/tslib.es6.mjs","../../node_modules/stylis/src/Enum.js","../../node_modules/stylis/src/Utility.js","../../node_modules/stylis/src/Tokenizer.js","../../node_modules/stylis/src/Serializer.js","../../node_modules/stylis/src/Prefixer.js","../../node_modules/stylis/src/Middleware.js","../../node_modules/stylis/src/Parser.js","../../node_modules/@emotion/unitless/dist/emotion-unitless.esm.js","../../src/constants.ts","../../src/utils/empties.ts","../../src/utils/checkDynamicCreation.ts","../../src/utils/determineTheme.ts","../../src/utils/domElements.ts","../../src/utils/escape.ts","../../src/utils/generateAlphabeticName.ts","../../src/utils/hash.ts","../../src/utils/generateComponentId.ts","../../src/utils/isTag.ts","../../src/utils/hoist.ts","../../src/utils/isFunction.ts","../../src/utils/isStyledComponent.ts","../../src/utils/joinStrings.ts","../../src/utils/isPlainObject.ts","../../src/utils/mixinDeep.ts","../../src/utils/setToString.ts","../../src/utils/error.ts","../../src/sheet/GroupedTag.ts","../../src/sheet/GroupIDAllocator.ts","../../src/sheet/Rehydration.ts","../../src/utils/nonce.ts","../../src/sheet/dom.ts","../../src/sheet/Tag.ts","../../src/sheet/Sheet.ts","../../src/utils/stylis.ts","../../src/models/StyleSheetManager.tsx","../../src/models/Keyframes.ts","../../src/utils/hyphenateStyleName.ts","../../src/utils/flatten.ts","../../src/utils/addUnitIfNeeded.ts","../../src/utils/isStatelessFunction.ts","../../src/utils/isStaticRules.ts","../../src/models/ComponentStyle.ts","../../src/models/ThemeProvider.tsx","../../src/models/StyledComponent.ts","../../src/utils/generateDisplayName.ts","../../src/utils/getComponentName.ts","../../src/utils/interleave.ts","../../src/constructors/css.ts","../../src/constructors/constructWithOptions.ts","../../src/constructors/styled.tsx","../../src/models/GlobalStyle.ts","../../src/models/ServerStyleSheet.tsx","../../src/base.ts","../../packages/color-alpha/esm/Pointer.js","../../packages/color-alpha/esm/index.js","../../packages/color-convert/esm/getContrastingColor.js","../../packages/color-convert/esm/index.js","../../packages/color-convert/esm/utils.js","../../packages/color-editable-input-rgba/esm/index.js","../../packages/color-editable-input/esm/index.js","../../packages/color-hue/esm/index.js","../../packages/color-saturation/esm/Pointer.js","../../packages/color-saturation/esm/index.js","../../packages/color-sketch/esm/index.js","../../packages/color-swatch/esm/index.js","../../packages/drag-event-interactive/esm/utils.js","../../packages/drag-event-interactive/esm/index.js","../../node_modules/@babel/runtime/helpers/defineProperty.js","../../node_modules/@babel/runtime/helpers/toPrimitive.js","../../node_modules/@babel/runtime/helpers/toPropertyKey.js","../../node_modules/@babel/runtime/helpers/typeof.js","../../node_modules/@babel/runtime/helpers/esm/extends.js","../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js","../webpack/bootstrap","../webpack/runtime/chunk loaded","../webpack/runtime/compat get default export","../webpack/runtime/create fake namespace object","../webpack/runtime/define property getters","../webpack/runtime/ensure chunk","../webpack/runtime/get javascript chunk filename","../webpack/runtime/get mini-css chunk filename","../webpack/runtime/global","../webpack/runtime/hasOwnProperty shorthand","../webpack/runtime/load script","../webpack/runtime/make namespace object","../webpack/runtime/publicPath","../webpack/runtime/css loading","../webpack/runtime/jsonp chunk loading","../webpack/runtime/nonce","../webpack/startup"],"sourcesContent":["import React from 'react';\nimport { HsvaColor } from '@uiw/react-color';\n\nexport const defaultContext: ContextStore = {\n hsva: { h: 214, s: 43, v: 90, a: 1 },\n};\n\nexport const Context = React.createContext(defaultContext);\n\nexport type ContextStore = {\n hsva: HsvaColor;\n dispatch?: React.Dispatch;\n};\n\nexport function reducer(state: ContextStore, action: ContextStore) {\n return { ...state, ...action };\n}\n","// @ts-ignore\ndeclare global {\n interface HTMLElementTagNameMap {\n 'github-corners': GithubCorners;\n }\n namespace JSX {\n interface IntrinsicElements {\n 'github-corners': Partial | {\n style?: Partial | React.CSSProperties;\n };\n }\n }\n}\n\nconst GITHUB_CORNERS_TEMPLATE = document.createElement(\"template\");\nGITHUB_CORNERS_TEMPLATE.innerHTML = `\n\n\n \n \n \n \n \n \n \n\n`;\n\nexport class GithubCorners extends HTMLElement {\n /** Sets the z-order of a positioned element and its descendants or flex items. */\n 'z-index'?: string;\n height?: string | number;\n width?: string | number;\n href?: string;\n color?: string;\n fill?: string;\n position?: string;\n target?: string;\n top?: string;\n left?: string;\n right?: string = '0';\n bottom?: string;\n transform?: string;\n private shadow: ShadowRoot\n static get observedAttributes(): string[] {\n return ['style', 'z-index', 'target', 'height', 'width', 'href', 'color', 'fill', 'position', 'top', 'left', 'right', 'bottom', 'transform'];\n }\n constructor() {\n super();\n this.shadow = this.attachShadow({ mode: 'open' });\n this.shadow.appendChild(this.ownerDocument.importNode(GITHUB_CORNERS_TEMPLATE.content, true));\n this.update()\n }\n private setAttr(name: string, value: string) {\n const svg = this.shadow.querySelector('svg');\n if (/(href)/.test(name.toLocaleLowerCase())) {\n svg.lastElementChild.setAttribute('xlink:href', value);\n } else if (/(color|fill)/.test(name.toLocaleLowerCase())) {\n (svg.firstElementChild as HTMLAnchorElement).style[name as any] = value;\n } else if (/(z-index|position|top|left|right|bottom|transform)/.test(name.toLocaleLowerCase())) {\n svg.style[name as any] = value;\n } else {\n svg.setAttribute(name, value);\n }\n }\n private update() {\n ;[...this.getAttributeNames(), 'right'].forEach((name) => {\n const value = this.getAttribute(name) || this[name as keyof GithubCorners] as any || '';\n this.setAttr(name, value);\n });\n }\n attributeChangedCallback(name: string, oldValue: string, newValue: string) {\n if (oldValue !== newValue) {\n this.setAttr(name, newValue);\n }\n }\n}\n\ncustomElements.define('github-corners', GithubCorners);","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"size\", \"fixed\", \"bottom\", \"zIndex\", \"className\", \"style\", \"bgColor\", \"color\", \"position\"];\nimport React from 'react';\nimport '@uiw/github-corners';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default function githubCorners(props) {\n var {\n size = 80,\n fixed = false,\n bottom,\n zIndex,\n style,\n bgColor = '#151513',\n color = '#fff',\n position = 'right'\n } = props,\n otherProps = _objectWithoutPropertiesLoose(props, _excluded);\n var styl = position === 'left' ? {\n left: 0,\n right: 'initial',\n transform: 'scale(-1, 1)'\n } : {\n right: 0,\n left: 'initial',\n transform: 'scale(1, 1)'\n };\n if (bottom) {\n styl.bottom = 0;\n styl.top = 'initial';\n styl.transform = position === 'left' ? 'scale(-1, -1)' : 'scale(1, -1)';\n } else {\n styl.bottom = 'initial';\n styl.top = 0;\n }\n return /*#__PURE__*/_jsx(\"github-corners\", _extends({\n target: \"__blank\",\n width: size,\n height: size,\n href: props.href,\n position: fixed ? 'fixed' : 'absolute',\n \"z-index\": zIndex,\n style: style,\n fill: bgColor,\n color: color\n }, styl, otherProps));\n}","////////////////////////////////////////////////////////////////////////////////\n//#region Types and Constants\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Actions represent the type of change to a location value.\n */\nexport enum Action {\n /**\n * A POP indicates a change to an arbitrary index in the history stack, such\n * as a back or forward navigation. It does not describe the direction of the\n * navigation, only that the current index changed.\n *\n * Note: This is the default action for newly created history objects.\n */\n Pop = \"POP\",\n\n /**\n * A PUSH indicates a new entry being added to the history stack, such as when\n * a link is clicked and a new page loads. When this happens, all subsequent\n * entries in the stack are lost.\n */\n Push = \"PUSH\",\n\n /**\n * A REPLACE indicates the entry at the current index in the history stack\n * being replaced by a new one.\n */\n Replace = \"REPLACE\",\n}\n\n/**\n * The pathname, search, and hash values of a URL.\n */\nexport interface Path {\n /**\n * A URL pathname, beginning with a /.\n */\n pathname: string;\n\n /**\n * A URL search string, beginning with a ?.\n */\n search: string;\n\n /**\n * A URL fragment identifier, beginning with a #.\n */\n hash: string;\n}\n\n/**\n * An entry in a history stack. A location contains information about the\n * URL path, as well as possibly some arbitrary state and a key.\n */\nexport interface Location extends Path {\n /**\n * A value of arbitrary data associated with this location.\n */\n state: any;\n\n /**\n * A unique string associated with this location. May be used to safely store\n * and retrieve data in some other storage API, like `localStorage`.\n *\n * Note: This value is always \"default\" on the initial location.\n */\n key: string;\n}\n\n/**\n * A change to the current location.\n */\nexport interface Update {\n /**\n * The action that triggered the change.\n */\n action: Action;\n\n /**\n * The new location.\n */\n location: Location;\n\n /**\n * The delta between this location and the former location in the history stack\n */\n delta: number | null;\n}\n\n/**\n * A function that receives notifications about location changes.\n */\nexport interface Listener {\n (update: Update): void;\n}\n\n/**\n * Describes a location that is the destination of some navigation, either via\n * `history.push` or `history.replace`. May be either a URL or the pieces of a\n * URL path.\n */\nexport type To = string | Partial;\n\n/**\n * A history is an interface to the navigation stack. The history serves as the\n * source of truth for the current location, as well as provides a set of\n * methods that may be used to change it.\n *\n * It is similar to the DOM's `window.history` object, but with a smaller, more\n * focused API.\n */\nexport interface History {\n /**\n * The last action that modified the current location. This will always be\n * Action.Pop when a history instance is first created. This value is mutable.\n */\n readonly action: Action;\n\n /**\n * The current location. This value is mutable.\n */\n readonly location: Location;\n\n /**\n * Returns a valid href for the given `to` value that may be used as\n * the value of an attribute.\n *\n * @param to - The destination URL\n */\n createHref(to: To): string;\n\n /**\n * Returns a URL for the given `to` value\n *\n * @param to - The destination URL\n */\n createURL(to: To): URL;\n\n /**\n * Encode a location the same way window.history would do (no-op for memory\n * history) so we ensure our PUSH/REPLACE navigations for data routers\n * behave the same as POP\n *\n * @param to Unencoded path\n */\n encodeLocation(to: To): Path;\n\n /**\n * Pushes a new location onto the history stack, increasing its length by one.\n * If there were any entries in the stack after the current one, they are\n * lost.\n *\n * @param to - The new URL\n * @param state - Data to associate with the new location\n */\n push(to: To, state?: any): void;\n\n /**\n * Replaces the current location in the history stack with a new one. The\n * location that was replaced will no longer be available.\n *\n * @param to - The new URL\n * @param state - Data to associate with the new location\n */\n replace(to: To, state?: any): void;\n\n /**\n * Navigates `n` entries backward/forward in the history stack relative to the\n * current index. For example, a \"back\" navigation would use go(-1).\n *\n * @param delta - The delta in the stack index\n */\n go(delta: number): void;\n\n /**\n * Sets up a listener that will be called whenever the current location\n * changes.\n *\n * @param listener - A function that will be called when the location changes\n * @returns unlisten - A function that may be used to stop listening\n */\n listen(listener: Listener): () => void;\n}\n\ntype HistoryState = {\n usr: any;\n key?: string;\n idx: number;\n};\n\nconst PopStateEventType = \"popstate\";\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Memory History\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * A user-supplied object that describes a location. Used when providing\n * entries to `createMemoryHistory` via its `initialEntries` option.\n */\nexport type InitialEntry = string | Partial;\n\nexport type MemoryHistoryOptions = {\n initialEntries?: InitialEntry[];\n initialIndex?: number;\n v5Compat?: boolean;\n};\n\n/**\n * A memory history stores locations in memory. This is useful in stateful\n * environments where there is no web browser, such as node tests or React\n * Native.\n */\nexport interface MemoryHistory extends History {\n /**\n * The current index in the history stack.\n */\n readonly index: number;\n}\n\n/**\n * Memory history stores the current location in memory. It is designed for use\n * in stateful non-browser environments like tests and React Native.\n */\nexport function createMemoryHistory(\n options: MemoryHistoryOptions = {}\n): MemoryHistory {\n let { initialEntries = [\"/\"], initialIndex, v5Compat = false } = options;\n let entries: Location[]; // Declare so we can access from createMemoryLocation\n entries = initialEntries.map((entry, index) =>\n createMemoryLocation(\n entry,\n typeof entry === \"string\" ? null : entry.state,\n index === 0 ? \"default\" : undefined\n )\n );\n let index = clampIndex(\n initialIndex == null ? entries.length - 1 : initialIndex\n );\n let action = Action.Pop;\n let listener: Listener | null = null;\n\n function clampIndex(n: number): number {\n return Math.min(Math.max(n, 0), entries.length - 1);\n }\n function getCurrentLocation(): Location {\n return entries[index];\n }\n function createMemoryLocation(\n to: To,\n state: any = null,\n key?: string\n ): Location {\n let location = createLocation(\n entries ? getCurrentLocation().pathname : \"/\",\n to,\n state,\n key\n );\n warning(\n location.pathname.charAt(0) === \"/\",\n `relative pathnames are not supported in memory history: ${JSON.stringify(\n to\n )}`\n );\n return location;\n }\n\n function createHref(to: To) {\n return typeof to === \"string\" ? to : createPath(to);\n }\n\n let history: MemoryHistory = {\n get index() {\n return index;\n },\n get action() {\n return action;\n },\n get location() {\n return getCurrentLocation();\n },\n createHref,\n createURL(to) {\n return new URL(createHref(to), \"http://localhost\");\n },\n encodeLocation(to: To) {\n let path = typeof to === \"string\" ? parsePath(to) : to;\n return {\n pathname: path.pathname || \"\",\n search: path.search || \"\",\n hash: path.hash || \"\",\n };\n },\n push(to, state) {\n action = Action.Push;\n let nextLocation = createMemoryLocation(to, state);\n index += 1;\n entries.splice(index, entries.length, nextLocation);\n if (v5Compat && listener) {\n listener({ action, location: nextLocation, delta: 1 });\n }\n },\n replace(to, state) {\n action = Action.Replace;\n let nextLocation = createMemoryLocation(to, state);\n entries[index] = nextLocation;\n if (v5Compat && listener) {\n listener({ action, location: nextLocation, delta: 0 });\n }\n },\n go(delta) {\n action = Action.Pop;\n let nextIndex = clampIndex(index + delta);\n let nextLocation = entries[nextIndex];\n index = nextIndex;\n if (listener) {\n listener({ action, location: nextLocation, delta });\n }\n },\n listen(fn: Listener) {\n listener = fn;\n return () => {\n listener = null;\n };\n },\n };\n\n return history;\n}\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Browser History\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * A browser history stores the current location in regular URLs in a web\n * browser environment. This is the standard for most web apps and provides the\n * cleanest URLs the browser's address bar.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#browserhistory\n */\nexport interface BrowserHistory extends UrlHistory {}\n\nexport type BrowserHistoryOptions = UrlHistoryOptions;\n\n/**\n * Browser history stores the location in regular URLs. This is the standard for\n * most web apps, but it requires some configuration on the server to ensure you\n * serve the same app at multiple URLs.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory\n */\nexport function createBrowserHistory(\n options: BrowserHistoryOptions = {}\n): BrowserHistory {\n function createBrowserLocation(\n window: Window,\n globalHistory: Window[\"history\"]\n ) {\n let { pathname, search, hash } = window.location;\n return createLocation(\n \"\",\n { pathname, search, hash },\n // state defaults to `null` because `window.history.state` does\n (globalHistory.state && globalHistory.state.usr) || null,\n (globalHistory.state && globalHistory.state.key) || \"default\"\n );\n }\n\n function createBrowserHref(window: Window, to: To) {\n return typeof to === \"string\" ? to : createPath(to);\n }\n\n return getUrlBasedHistory(\n createBrowserLocation,\n createBrowserHref,\n null,\n options\n );\n}\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Hash History\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * A hash history stores the current location in the fragment identifier portion\n * of the URL in a web browser environment.\n *\n * This is ideal for apps that do not control the server for some reason\n * (because the fragment identifier is never sent to the server), including some\n * shared hosting environments that do not provide fine-grained controls over\n * which pages are served at which URLs.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#hashhistory\n */\nexport interface HashHistory extends UrlHistory {}\n\nexport type HashHistoryOptions = UrlHistoryOptions;\n\n/**\n * Hash history stores the location in window.location.hash. This makes it ideal\n * for situations where you don't want to send the location to the server for\n * some reason, either because you do cannot configure it or the URL space is\n * reserved for something else.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory\n */\nexport function createHashHistory(\n options: HashHistoryOptions = {}\n): HashHistory {\n function createHashLocation(\n window: Window,\n globalHistory: Window[\"history\"]\n ) {\n let {\n pathname = \"/\",\n search = \"\",\n hash = \"\",\n } = parsePath(window.location.hash.substr(1));\n return createLocation(\n \"\",\n { pathname, search, hash },\n // state defaults to `null` because `window.history.state` does\n (globalHistory.state && globalHistory.state.usr) || null,\n (globalHistory.state && globalHistory.state.key) || \"default\"\n );\n }\n\n function createHashHref(window: Window, to: To) {\n let base = window.document.querySelector(\"base\");\n let href = \"\";\n\n if (base && base.getAttribute(\"href\")) {\n let url = window.location.href;\n let hashIndex = url.indexOf(\"#\");\n href = hashIndex === -1 ? url : url.slice(0, hashIndex);\n }\n\n return href + \"#\" + (typeof to === \"string\" ? to : createPath(to));\n }\n\n function validateHashLocation(location: Location, to: To) {\n warning(\n location.pathname.charAt(0) === \"/\",\n `relative pathnames are not supported in hash history.push(${JSON.stringify(\n to\n )})`\n );\n }\n\n return getUrlBasedHistory(\n createHashLocation,\n createHashHref,\n validateHashLocation,\n options\n );\n}\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region UTILS\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n */\nexport function invariant(value: boolean, message?: string): asserts value;\nexport function invariant(\n value: T | null | undefined,\n message?: string\n): asserts value is T;\nexport function invariant(value: any, message?: string) {\n if (value === false || value === null || typeof value === \"undefined\") {\n throw new Error(message);\n }\n}\n\nexport function warning(cond: any, message: string) {\n if (!cond) {\n // eslint-disable-next-line no-console\n if (typeof console !== \"undefined\") console.warn(message);\n\n try {\n // Welcome to debugging history!\n //\n // This error is thrown as a convenience so you can more easily\n // find the source for a warning that appears in the console by\n // enabling \"pause on exceptions\" in your JavaScript debugger.\n throw new Error(message);\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n}\n\nfunction createKey() {\n return Math.random().toString(36).substr(2, 8);\n}\n\n/**\n * For browser-based histories, we combine the state and key into an object\n */\nfunction getHistoryState(location: Location, index: number): HistoryState {\n return {\n usr: location.state,\n key: location.key,\n idx: index,\n };\n}\n\n/**\n * Creates a Location object with a unique key from the given Path\n */\nexport function createLocation(\n current: string | Location,\n to: To,\n state: any = null,\n key?: string\n): Readonly {\n let location: Readonly = {\n pathname: typeof current === \"string\" ? current : current.pathname,\n search: \"\",\n hash: \"\",\n ...(typeof to === \"string\" ? parsePath(to) : to),\n state,\n // TODO: This could be cleaned up. push/replace should probably just take\n // full Locations now and avoid the need to run through this flow at all\n // But that's a pretty big refactor to the current test suite so going to\n // keep as is for the time being and just let any incoming keys take precedence\n key: (to && (to as Location).key) || key || createKey(),\n };\n return location;\n}\n\n/**\n * Creates a string URL path from the given pathname, search, and hash components.\n */\nexport function createPath({\n pathname = \"/\",\n search = \"\",\n hash = \"\",\n}: Partial) {\n if (search && search !== \"?\")\n pathname += search.charAt(0) === \"?\" ? search : \"?\" + search;\n if (hash && hash !== \"#\")\n pathname += hash.charAt(0) === \"#\" ? hash : \"#\" + hash;\n return pathname;\n}\n\n/**\n * Parses a string URL path into its separate pathname, search, and hash components.\n */\nexport function parsePath(path: string): Partial {\n let parsedPath: Partial = {};\n\n if (path) {\n let hashIndex = path.indexOf(\"#\");\n if (hashIndex >= 0) {\n parsedPath.hash = path.substr(hashIndex);\n path = path.substr(0, hashIndex);\n }\n\n let searchIndex = path.indexOf(\"?\");\n if (searchIndex >= 0) {\n parsedPath.search = path.substr(searchIndex);\n path = path.substr(0, searchIndex);\n }\n\n if (path) {\n parsedPath.pathname = path;\n }\n }\n\n return parsedPath;\n}\n\nexport interface UrlHistory extends History {}\n\nexport type UrlHistoryOptions = {\n window?: Window;\n v5Compat?: boolean;\n};\n\nfunction getUrlBasedHistory(\n getLocation: (window: Window, globalHistory: Window[\"history\"]) => Location,\n createHref: (window: Window, to: To) => string,\n validateLocation: ((location: Location, to: To) => void) | null,\n options: UrlHistoryOptions = {}\n): UrlHistory {\n let { window = document.defaultView!, v5Compat = false } = options;\n let globalHistory = window.history;\n let action = Action.Pop;\n let listener: Listener | null = null;\n\n let index = getIndex()!;\n // Index should only be null when we initialize. If not, it's because the\n // user called history.pushState or history.replaceState directly, in which\n // case we should log a warning as it will result in bugs.\n if (index == null) {\n index = 0;\n globalHistory.replaceState({ ...globalHistory.state, idx: index }, \"\");\n }\n\n function getIndex(): number {\n let state = globalHistory.state || { idx: null };\n return state.idx;\n }\n\n function handlePop() {\n action = Action.Pop;\n let nextIndex = getIndex();\n let delta = nextIndex == null ? null : nextIndex - index;\n index = nextIndex;\n if (listener) {\n listener({ action, location: history.location, delta });\n }\n }\n\n function push(to: To, state?: any) {\n action = Action.Push;\n let location = createLocation(history.location, to, state);\n if (validateLocation) validateLocation(location, to);\n\n index = getIndex() + 1;\n let historyState = getHistoryState(location, index);\n let url = history.createHref(location);\n\n // try...catch because iOS limits us to 100 pushState calls :/\n try {\n globalHistory.pushState(historyState, \"\", url);\n } catch (error) {\n // If the exception is because `state` can't be serialized, let that throw\n // outwards just like a replace call would so the dev knows the cause\n // https://html.spec.whatwg.org/multipage/nav-history-apis.html#shared-history-push/replace-state-steps\n // https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializeinternal\n if (error instanceof DOMException && error.name === \"DataCloneError\") {\n throw error;\n }\n // They are going to lose state here, but there is no real\n // way to warn them about it since the page will refresh...\n window.location.assign(url);\n }\n\n if (v5Compat && listener) {\n listener({ action, location: history.location, delta: 1 });\n }\n }\n\n function replace(to: To, state?: any) {\n action = Action.Replace;\n let location = createLocation(history.location, to, state);\n if (validateLocation) validateLocation(location, to);\n\n index = getIndex();\n let historyState = getHistoryState(location, index);\n let url = history.createHref(location);\n globalHistory.replaceState(historyState, \"\", url);\n\n if (v5Compat && listener) {\n listener({ action, location: history.location, delta: 0 });\n }\n }\n\n function createURL(to: To): URL {\n // window.location.origin is \"null\" (the literal string value) in Firefox\n // under certain conditions, notably when serving from a local HTML file\n // See https://bugzilla.mozilla.org/show_bug.cgi?id=878297\n let base =\n window.location.origin !== \"null\"\n ? window.location.origin\n : window.location.href;\n\n let href = typeof to === \"string\" ? to : createPath(to);\n invariant(\n base,\n `No window.location.(origin|href) available to create URL for href: ${href}`\n );\n return new URL(href, base);\n }\n\n let history: History = {\n get action() {\n return action;\n },\n get location() {\n return getLocation(window, globalHistory);\n },\n listen(fn: Listener) {\n if (listener) {\n throw new Error(\"A history only accepts one active listener\");\n }\n window.addEventListener(PopStateEventType, handlePop);\n listener = fn;\n\n return () => {\n window.removeEventListener(PopStateEventType, handlePop);\n listener = null;\n };\n },\n createHref(to) {\n return createHref(window, to);\n },\n createURL,\n encodeLocation(to) {\n // Encode a Location the same way window.location would\n let url = createURL(to);\n return {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash,\n };\n },\n push,\n replace,\n go(n) {\n return globalHistory.go(n);\n },\n };\n\n return history;\n}\n\n//#endregion\n","import type { Location, Path, To } from \"./history\";\nimport { warning, invariant, parsePath } from \"./history\";\n\n/**\n * Map of routeId -> data returned from a loader/action/error\n */\nexport interface RouteData {\n [routeId: string]: any;\n}\n\nexport enum ResultType {\n data = \"data\",\n deferred = \"deferred\",\n redirect = \"redirect\",\n error = \"error\",\n}\n\n/**\n * Successful result from a loader or action\n */\nexport interface SuccessResult {\n type: ResultType.data;\n data: any;\n statusCode?: number;\n headers?: Headers;\n}\n\n/**\n * Successful defer() result from a loader or action\n */\nexport interface DeferredResult {\n type: ResultType.deferred;\n deferredData: DeferredData;\n statusCode?: number;\n headers?: Headers;\n}\n\n/**\n * Redirect result from a loader or action\n */\nexport interface RedirectResult {\n type: ResultType.redirect;\n status: number;\n location: string;\n revalidate: boolean;\n}\n\n/**\n * Unsuccessful result from a loader or action\n */\nexport interface ErrorResult {\n type: ResultType.error;\n error: any;\n headers?: Headers;\n}\n\n/**\n * Result from a loader or action - potentially successful or unsuccessful\n */\nexport type DataResult =\n | SuccessResult\n | DeferredResult\n | RedirectResult\n | ErrorResult;\n\ntype LowerCaseFormMethod = \"get\" | \"post\" | \"put\" | \"patch\" | \"delete\";\ntype UpperCaseFormMethod = Uppercase;\n\n/**\n * Users can specify either lowercase or uppercase form methods on
,\n * useSubmit(), , etc.\n */\nexport type HTMLFormMethod = LowerCaseFormMethod | UpperCaseFormMethod;\n\n/**\n * Active navigation/fetcher form methods are exposed in lowercase on the\n * RouterState\n */\nexport type FormMethod = LowerCaseFormMethod;\nexport type MutationFormMethod = Exclude;\n\n/**\n * In v7, active navigation/fetcher form methods are exposed in uppercase on the\n * RouterState. This is to align with the normalization done via fetch().\n */\nexport type V7_FormMethod = UpperCaseFormMethod;\nexport type V7_MutationFormMethod = Exclude;\n\nexport type FormEncType =\n | \"application/x-www-form-urlencoded\"\n | \"multipart/form-data\"\n | \"application/json\"\n | \"text/plain\";\n\n// Thanks https://github.com/sindresorhus/type-fest!\ntype JsonObject = { [Key in string]: JsonValue } & {\n [Key in string]?: JsonValue | undefined;\n};\ntype JsonArray = JsonValue[] | readonly JsonValue[];\ntype JsonPrimitive = string | number | boolean | null;\ntype JsonValue = JsonPrimitive | JsonObject | JsonArray;\n\n/**\n * @private\n * Internal interface to pass around for action submissions, not intended for\n * external consumption\n */\nexport type Submission =\n | {\n formMethod: FormMethod | V7_FormMethod;\n formAction: string;\n formEncType: FormEncType;\n formData: FormData;\n json: undefined;\n text: undefined;\n }\n | {\n formMethod: FormMethod | V7_FormMethod;\n formAction: string;\n formEncType: FormEncType;\n formData: undefined;\n json: JsonValue;\n text: undefined;\n }\n | {\n formMethod: FormMethod | V7_FormMethod;\n formAction: string;\n formEncType: FormEncType;\n formData: undefined;\n json: undefined;\n text: string;\n };\n\n/**\n * @private\n * Arguments passed to route loader/action functions. Same for now but we keep\n * this as a private implementation detail in case they diverge in the future.\n */\ninterface DataFunctionArgs {\n request: Request;\n params: Params;\n context?: any;\n}\n\n/**\n * Arguments passed to loader functions\n */\nexport interface LoaderFunctionArgs extends DataFunctionArgs {}\n\n/**\n * Arguments passed to action functions\n */\nexport interface ActionFunctionArgs extends DataFunctionArgs {}\n\n/**\n * Loaders and actions can return anything except `undefined` (`null` is a\n * valid return value if there is no data to return). Responses are preferred\n * and will ease any future migration to Remix\n */\ntype DataFunctionValue = Response | NonNullable | null;\n\n/**\n * Route loader function signature\n */\nexport interface LoaderFunction {\n (args: LoaderFunctionArgs): Promise | DataFunctionValue;\n}\n\n/**\n * Route action function signature\n */\nexport interface ActionFunction {\n (args: ActionFunctionArgs): Promise | DataFunctionValue;\n}\n\n/**\n * Route shouldRevalidate function signature. This runs after any submission\n * (navigation or fetcher), so we flatten the navigation/fetcher submission\n * onto the arguments. It shouldn't matter whether it came from a navigation\n * or a fetcher, what really matters is the URLs and the formData since loaders\n * have to re-run based on the data models that were potentially mutated.\n */\nexport interface ShouldRevalidateFunction {\n (args: {\n currentUrl: URL;\n currentParams: AgnosticDataRouteMatch[\"params\"];\n nextUrl: URL;\n nextParams: AgnosticDataRouteMatch[\"params\"];\n formMethod?: Submission[\"formMethod\"];\n formAction?: Submission[\"formAction\"];\n formEncType?: Submission[\"formEncType\"];\n text?: Submission[\"text\"];\n formData?: Submission[\"formData\"];\n json?: Submission[\"json\"];\n actionResult?: DataResult;\n defaultShouldRevalidate: boolean;\n }): boolean;\n}\n\n/**\n * Function provided by the framework-aware layers to set `hasErrorBoundary`\n * from the framework-aware `errorElement` prop\n *\n * @deprecated Use `mapRouteProperties` instead\n */\nexport interface DetectErrorBoundaryFunction {\n (route: AgnosticRouteObject): boolean;\n}\n\n/**\n * Function provided by the framework-aware layers to set any framework-specific\n * properties from framework-agnostic properties\n */\nexport interface MapRoutePropertiesFunction {\n (route: AgnosticRouteObject): {\n hasErrorBoundary: boolean;\n } & Record;\n}\n\n/**\n * Keys we cannot change from within a lazy() function. We spread all other keys\n * onto the route. Either they're meaningful to the router, or they'll get\n * ignored.\n */\nexport type ImmutableRouteKey =\n | \"lazy\"\n | \"caseSensitive\"\n | \"path\"\n | \"id\"\n | \"index\"\n | \"children\";\n\nexport const immutableRouteKeys = new Set([\n \"lazy\",\n \"caseSensitive\",\n \"path\",\n \"id\",\n \"index\",\n \"children\",\n]);\n\ntype RequireOne = Exclude<\n {\n [K in keyof T]: K extends Key ? Omit & Required> : never;\n }[keyof T],\n undefined\n>;\n\n/**\n * lazy() function to load a route definition, which can add non-matching\n * related properties to a route\n */\nexport interface LazyRouteFunction {\n (): Promise>>;\n}\n\n/**\n * Base RouteObject with common props shared by all types of routes\n */\ntype AgnosticBaseRouteObject = {\n caseSensitive?: boolean;\n path?: string;\n id?: string;\n loader?: LoaderFunction;\n action?: ActionFunction;\n hasErrorBoundary?: boolean;\n shouldRevalidate?: ShouldRevalidateFunction;\n handle?: any;\n lazy?: LazyRouteFunction;\n};\n\n/**\n * Index routes must not have children\n */\nexport type AgnosticIndexRouteObject = AgnosticBaseRouteObject & {\n children?: undefined;\n index: true;\n};\n\n/**\n * Non-index routes may have children, but cannot have index\n */\nexport type AgnosticNonIndexRouteObject = AgnosticBaseRouteObject & {\n children?: AgnosticRouteObject[];\n index?: false;\n};\n\n/**\n * A route object represents a logical route, with (optionally) its child\n * routes organized in a tree-like structure.\n */\nexport type AgnosticRouteObject =\n | AgnosticIndexRouteObject\n | AgnosticNonIndexRouteObject;\n\nexport type AgnosticDataIndexRouteObject = AgnosticIndexRouteObject & {\n id: string;\n};\n\nexport type AgnosticDataNonIndexRouteObject = AgnosticNonIndexRouteObject & {\n children?: AgnosticDataRouteObject[];\n id: string;\n};\n\n/**\n * A data route object, which is just a RouteObject with a required unique ID\n */\nexport type AgnosticDataRouteObject =\n | AgnosticDataIndexRouteObject\n | AgnosticDataNonIndexRouteObject;\n\nexport type RouteManifest = Record;\n\n// Recursive helper for finding path parameters in the absence of wildcards\ntype _PathParam =\n // split path into individual path segments\n Path extends `${infer L}/${infer R}`\n ? _PathParam | _PathParam\n : // find params after `:`\n Path extends `:${infer Param}`\n ? Param extends `${infer Optional}?`\n ? Optional\n : Param\n : // otherwise, there aren't any params present\n never;\n\n/**\n * Examples:\n * \"/a/b/*\" -> \"*\"\n * \":a\" -> \"a\"\n * \"/a/:b\" -> \"b\"\n * \"/a/blahblahblah:b\" -> \"b\"\n * \"/:a/:b\" -> \"a\" | \"b\"\n * \"/:a/b/:c/*\" -> \"a\" | \"c\" | \"*\"\n */\ntype PathParam =\n // check if path is just a wildcard\n Path extends \"*\" | \"/*\"\n ? \"*\"\n : // look for wildcard at the end of the path\n Path extends `${infer Rest}/*`\n ? \"*\" | _PathParam\n : // look for params in the absence of wildcards\n _PathParam;\n\n// Attempt to parse the given string segment. If it fails, then just return the\n// plain string type as a default fallback. Otherwise return the union of the\n// parsed string literals that were referenced as dynamic segments in the route.\nexport type ParamParseKey =\n // if could not find path params, fallback to `string`\n [PathParam] extends [never] ? string : PathParam;\n\n/**\n * The parameters that were parsed from the URL path.\n */\nexport type Params = {\n readonly [key in Key]: string | undefined;\n};\n\n/**\n * A RouteMatch contains info about how a route matched a URL.\n */\nexport interface AgnosticRouteMatch<\n ParamKey extends string = string,\n RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject\n> {\n /**\n * The names and values of dynamic parameters in the URL.\n */\n params: Params;\n /**\n * The portion of the URL pathname that was matched.\n */\n pathname: string;\n /**\n * The portion of the URL pathname that was matched before child routes.\n */\n pathnameBase: string;\n /**\n * The route object that was used to match.\n */\n route: RouteObjectType;\n}\n\nexport interface AgnosticDataRouteMatch\n extends AgnosticRouteMatch {}\n\nfunction isIndexRoute(\n route: AgnosticRouteObject\n): route is AgnosticIndexRouteObject {\n return route.index === true;\n}\n\n// Walk the route tree generating unique IDs where necessary so we are working\n// solely with AgnosticDataRouteObject's within the Router\nexport function convertRoutesToDataRoutes(\n routes: AgnosticRouteObject[],\n mapRouteProperties: MapRoutePropertiesFunction,\n parentPath: number[] = [],\n manifest: RouteManifest = {}\n): AgnosticDataRouteObject[] {\n return routes.map((route, index) => {\n let treePath = [...parentPath, index];\n let id = typeof route.id === \"string\" ? route.id : treePath.join(\"-\");\n invariant(\n route.index !== true || !route.children,\n `Cannot specify children on an index route`\n );\n invariant(\n !manifest[id],\n `Found a route id collision on id \"${id}\". Route ` +\n \"id's must be globally unique within Data Router usages\"\n );\n\n if (isIndexRoute(route)) {\n let indexRoute: AgnosticDataIndexRouteObject = {\n ...route,\n ...mapRouteProperties(route),\n id,\n };\n manifest[id] = indexRoute;\n return indexRoute;\n } else {\n let pathOrLayoutRoute: AgnosticDataNonIndexRouteObject = {\n ...route,\n ...mapRouteProperties(route),\n id,\n children: undefined,\n };\n manifest[id] = pathOrLayoutRoute;\n\n if (route.children) {\n pathOrLayoutRoute.children = convertRoutesToDataRoutes(\n route.children,\n mapRouteProperties,\n treePath,\n manifest\n );\n }\n\n return pathOrLayoutRoute;\n }\n });\n}\n\n/**\n * Matches the given routes to a location and returns the match data.\n *\n * @see https://reactrouter.com/utils/match-routes\n */\nexport function matchRoutes<\n RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject\n>(\n routes: RouteObjectType[],\n locationArg: Partial | string,\n basename = \"/\"\n): AgnosticRouteMatch[] | null {\n let location =\n typeof locationArg === \"string\" ? parsePath(locationArg) : locationArg;\n\n let pathname = stripBasename(location.pathname || \"/\", basename);\n\n if (pathname == null) {\n return null;\n }\n\n let branches = flattenRoutes(routes);\n rankRouteBranches(branches);\n\n let matches = null;\n for (let i = 0; matches == null && i < branches.length; ++i) {\n matches = matchRouteBranch(\n branches[i],\n // Incoming pathnames are generally encoded from either window.location\n // or from router.navigate, but we want to match against the unencoded\n // paths in the route definitions. Memory router locations won't be\n // encoded here but there also shouldn't be anything to decode so this\n // should be a safe operation. This avoids needing matchRoutes to be\n // history-aware.\n safelyDecodeURI(pathname)\n );\n }\n\n return matches;\n}\n\ninterface RouteMeta<\n RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject\n> {\n relativePath: string;\n caseSensitive: boolean;\n childrenIndex: number;\n route: RouteObjectType;\n}\n\ninterface RouteBranch<\n RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject\n> {\n path: string;\n score: number;\n routesMeta: RouteMeta[];\n}\n\nfunction flattenRoutes<\n RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject\n>(\n routes: RouteObjectType[],\n branches: RouteBranch[] = [],\n parentsMeta: RouteMeta[] = [],\n parentPath = \"\"\n): RouteBranch[] {\n let flattenRoute = (\n route: RouteObjectType,\n index: number,\n relativePath?: string\n ) => {\n let meta: RouteMeta = {\n relativePath:\n relativePath === undefined ? route.path || \"\" : relativePath,\n caseSensitive: route.caseSensitive === true,\n childrenIndex: index,\n route,\n };\n\n if (meta.relativePath.startsWith(\"/\")) {\n invariant(\n meta.relativePath.startsWith(parentPath),\n `Absolute route path \"${meta.relativePath}\" nested under path ` +\n `\"${parentPath}\" is not valid. An absolute child route path ` +\n `must start with the combined path of all its parent routes.`\n );\n\n meta.relativePath = meta.relativePath.slice(parentPath.length);\n }\n\n let path = joinPaths([parentPath, meta.relativePath]);\n let routesMeta = parentsMeta.concat(meta);\n\n // Add the children before adding this route to the array so we traverse the\n // route tree depth-first and child routes appear before their parents in\n // the \"flattened\" version.\n if (route.children && route.children.length > 0) {\n invariant(\n // Our types know better, but runtime JS may not!\n // @ts-expect-error\n route.index !== true,\n `Index routes must not have child routes. Please remove ` +\n `all child routes from route path \"${path}\".`\n );\n\n flattenRoutes(route.children, branches, routesMeta, path);\n }\n\n // Routes without a path shouldn't ever match by themselves unless they are\n // index routes, so don't add them to the list of possible branches.\n if (route.path == null && !route.index) {\n return;\n }\n\n branches.push({\n path,\n score: computeScore(path, route.index),\n routesMeta,\n });\n };\n routes.forEach((route, index) => {\n // coarse-grain check for optional params\n if (route.path === \"\" || !route.path?.includes(\"?\")) {\n flattenRoute(route, index);\n } else {\n for (let exploded of explodeOptionalSegments(route.path)) {\n flattenRoute(route, index, exploded);\n }\n }\n });\n\n return branches;\n}\n\n/**\n * Computes all combinations of optional path segments for a given path,\n * excluding combinations that are ambiguous and of lower priority.\n *\n * For example, `/one/:two?/three/:four?/:five?` explodes to:\n * - `/one/three`\n * - `/one/:two/three`\n * - `/one/three/:four`\n * - `/one/three/:five`\n * - `/one/:two/three/:four`\n * - `/one/:two/three/:five`\n * - `/one/three/:four/:five`\n * - `/one/:two/three/:four/:five`\n */\nfunction explodeOptionalSegments(path: string): string[] {\n let segments = path.split(\"/\");\n if (segments.length === 0) return [];\n\n let [first, ...rest] = segments;\n\n // Optional path segments are denoted by a trailing `?`\n let isOptional = first.endsWith(\"?\");\n // Compute the corresponding required segment: `foo?` -> `foo`\n let required = first.replace(/\\?$/, \"\");\n\n if (rest.length === 0) {\n // Intepret empty string as omitting an optional segment\n // `[\"one\", \"\", \"three\"]` corresponds to omitting `:two` from `/one/:two?/three` -> `/one/three`\n return isOptional ? [required, \"\"] : [required];\n }\n\n let restExploded = explodeOptionalSegments(rest.join(\"/\"));\n\n let result: string[] = [];\n\n // All child paths with the prefix. Do this for all children before the\n // optional version for all children so we get consistent ordering where the\n // parent optional aspect is preferred as required. Otherwise, we can get\n // child sections interspersed where deeper optional segments are higher than\n // parent optional segments, where for example, /:two would explodes _earlier_\n // then /:one. By always including the parent as required _for all children_\n // first, we avoid this issue\n result.push(\n ...restExploded.map((subpath) =>\n subpath === \"\" ? required : [required, subpath].join(\"/\")\n )\n );\n\n // Then if this is an optional value, add all child versions without\n if (isOptional) {\n result.push(...restExploded);\n }\n\n // for absolute paths, ensure `/` instead of empty segment\n return result.map((exploded) =>\n path.startsWith(\"/\") && exploded === \"\" ? \"/\" : exploded\n );\n}\n\nfunction rankRouteBranches(branches: RouteBranch[]): void {\n branches.sort((a, b) =>\n a.score !== b.score\n ? b.score - a.score // Higher score first\n : compareIndexes(\n a.routesMeta.map((meta) => meta.childrenIndex),\n b.routesMeta.map((meta) => meta.childrenIndex)\n )\n );\n}\n\nconst paramRe = /^:\\w+$/;\nconst dynamicSegmentValue = 3;\nconst indexRouteValue = 2;\nconst emptySegmentValue = 1;\nconst staticSegmentValue = 10;\nconst splatPenalty = -2;\nconst isSplat = (s: string) => s === \"*\";\n\nfunction computeScore(path: string, index: boolean | undefined): number {\n let segments = path.split(\"/\");\n let initialScore = segments.length;\n if (segments.some(isSplat)) {\n initialScore += splatPenalty;\n }\n\n if (index) {\n initialScore += indexRouteValue;\n }\n\n return segments\n .filter((s) => !isSplat(s))\n .reduce(\n (score, segment) =>\n score +\n (paramRe.test(segment)\n ? dynamicSegmentValue\n : segment === \"\"\n ? emptySegmentValue\n : staticSegmentValue),\n initialScore\n );\n}\n\nfunction compareIndexes(a: number[], b: number[]): number {\n let siblings =\n a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]);\n\n return siblings\n ? // If two routes are siblings, we should try to match the earlier sibling\n // first. This allows people to have fine-grained control over the matching\n // behavior by simply putting routes with identical paths in the order they\n // want them tried.\n a[a.length - 1] - b[b.length - 1]\n : // Otherwise, it doesn't really make sense to rank non-siblings by index,\n // so they sort equally.\n 0;\n}\n\nfunction matchRouteBranch<\n ParamKey extends string = string,\n RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject\n>(\n branch: RouteBranch,\n pathname: string\n): AgnosticRouteMatch[] | null {\n let { routesMeta } = branch;\n\n let matchedParams = {};\n let matchedPathname = \"/\";\n let matches: AgnosticRouteMatch[] = [];\n for (let i = 0; i < routesMeta.length; ++i) {\n let meta = routesMeta[i];\n let end = i === routesMeta.length - 1;\n let remainingPathname =\n matchedPathname === \"/\"\n ? pathname\n : pathname.slice(matchedPathname.length) || \"/\";\n let match = matchPath(\n { path: meta.relativePath, caseSensitive: meta.caseSensitive, end },\n remainingPathname\n );\n\n if (!match) return null;\n\n Object.assign(matchedParams, match.params);\n\n let route = meta.route;\n\n matches.push({\n // TODO: Can this as be avoided?\n params: matchedParams as Params,\n pathname: joinPaths([matchedPathname, match.pathname]),\n pathnameBase: normalizePathname(\n joinPaths([matchedPathname, match.pathnameBase])\n ),\n route,\n });\n\n if (match.pathnameBase !== \"/\") {\n matchedPathname = joinPaths([matchedPathname, match.pathnameBase]);\n }\n }\n\n return matches;\n}\n\n/**\n * Returns a path with params interpolated.\n *\n * @see https://reactrouter.com/utils/generate-path\n */\nexport function generatePath(\n originalPath: Path,\n params: {\n [key in PathParam]: string | null;\n } = {} as any\n): string {\n let path: string = originalPath;\n if (path.endsWith(\"*\") && path !== \"*\" && !path.endsWith(\"/*\")) {\n warning(\n false,\n `Route path \"${path}\" will be treated as if it were ` +\n `\"${path.replace(/\\*$/, \"/*\")}\" because the \\`*\\` character must ` +\n `always follow a \\`/\\` in the pattern. To get rid of this warning, ` +\n `please change the route path to \"${path.replace(/\\*$/, \"/*\")}\".`\n );\n path = path.replace(/\\*$/, \"/*\") as Path;\n }\n\n // ensure `/` is added at the beginning if the path is absolute\n const prefix = path.startsWith(\"/\") ? \"/\" : \"\";\n\n const stringify = (p: any) =>\n p == null ? \"\" : typeof p === \"string\" ? p : String(p);\n\n const segments = path\n .split(/\\/+/)\n .map((segment, index, array) => {\n const isLastSegment = index === array.length - 1;\n\n // only apply the splat if it's the last segment\n if (isLastSegment && segment === \"*\") {\n const star = \"*\" as PathParam;\n // Apply the splat\n return stringify(params[star]);\n }\n\n const keyMatch = segment.match(/^:(\\w+)(\\??)$/);\n if (keyMatch) {\n const [, key, optional] = keyMatch;\n let param = params[key as PathParam];\n invariant(optional === \"?\" || param != null, `Missing \":${key}\" param`);\n return stringify(param);\n }\n\n // Remove any optional markers from optional static segments\n return segment.replace(/\\?$/g, \"\");\n })\n // Remove empty segments\n .filter((segment) => !!segment);\n\n return prefix + segments.join(\"/\");\n}\n\n/**\n * A PathPattern is used to match on some portion of a URL pathname.\n */\nexport interface PathPattern {\n /**\n * A string to match against a URL pathname. May contain `:id`-style segments\n * to indicate placeholders for dynamic parameters. May also end with `/*` to\n * indicate matching the rest of the URL pathname.\n */\n path: Path;\n /**\n * Should be `true` if the static portions of the `path` should be matched in\n * the same case.\n */\n caseSensitive?: boolean;\n /**\n * Should be `true` if this pattern should match the entire URL pathname.\n */\n end?: boolean;\n}\n\n/**\n * A PathMatch contains info about how a PathPattern matched on a URL pathname.\n */\nexport interface PathMatch {\n /**\n * The names and values of dynamic parameters in the URL.\n */\n params: Params;\n /**\n * The portion of the URL pathname that was matched.\n */\n pathname: string;\n /**\n * The portion of the URL pathname that was matched before child routes.\n */\n pathnameBase: string;\n /**\n * The pattern that was used to match.\n */\n pattern: PathPattern;\n}\n\ntype Mutable = {\n -readonly [P in keyof T]: T[P];\n};\n\n/**\n * Performs pattern matching on a URL pathname and returns information about\n * the match.\n *\n * @see https://reactrouter.com/utils/match-path\n */\nexport function matchPath<\n ParamKey extends ParamParseKey,\n Path extends string\n>(\n pattern: PathPattern | Path,\n pathname: string\n): PathMatch | null {\n if (typeof pattern === \"string\") {\n pattern = { path: pattern, caseSensitive: false, end: true };\n }\n\n let [matcher, paramNames] = compilePath(\n pattern.path,\n pattern.caseSensitive,\n pattern.end\n );\n\n let match = pathname.match(matcher);\n if (!match) return null;\n\n let matchedPathname = match[0];\n let pathnameBase = matchedPathname.replace(/(.)\\/+$/, \"$1\");\n let captureGroups = match.slice(1);\n let params: Params = paramNames.reduce>(\n (memo, paramName, index) => {\n // We need to compute the pathnameBase here using the raw splat value\n // instead of using params[\"*\"] later because it will be decoded then\n if (paramName === \"*\") {\n let splatValue = captureGroups[index] || \"\";\n pathnameBase = matchedPathname\n .slice(0, matchedPathname.length - splatValue.length)\n .replace(/(.)\\/+$/, \"$1\");\n }\n\n memo[paramName] = safelyDecodeURIComponent(\n captureGroups[index] || \"\",\n paramName\n );\n return memo;\n },\n {}\n );\n\n return {\n params,\n pathname: matchedPathname,\n pathnameBase,\n pattern,\n };\n}\n\nfunction compilePath(\n path: string,\n caseSensitive = false,\n end = true\n): [RegExp, string[]] {\n warning(\n path === \"*\" || !path.endsWith(\"*\") || path.endsWith(\"/*\"),\n `Route path \"${path}\" will be treated as if it were ` +\n `\"${path.replace(/\\*$/, \"/*\")}\" because the \\`*\\` character must ` +\n `always follow a \\`/\\` in the pattern. To get rid of this warning, ` +\n `please change the route path to \"${path.replace(/\\*$/, \"/*\")}\".`\n );\n\n let paramNames: string[] = [];\n let regexpSource =\n \"^\" +\n path\n .replace(/\\/*\\*?$/, \"\") // Ignore trailing / and /*, we'll handle it below\n .replace(/^\\/*/, \"/\") // Make sure it has a leading /\n .replace(/[\\\\.*+^$?{}|()[\\]]/g, \"\\\\$&\") // Escape special regex chars\n .replace(/\\/:(\\w+)/g, (_: string, paramName: string) => {\n paramNames.push(paramName);\n return \"/([^\\\\/]+)\";\n });\n\n if (path.endsWith(\"*\")) {\n paramNames.push(\"*\");\n regexpSource +=\n path === \"*\" || path === \"/*\"\n ? \"(.*)$\" // Already matched the initial /, just match the rest\n : \"(?:\\\\/(.+)|\\\\/*)$\"; // Don't include the / in params[\"*\"]\n } else if (end) {\n // When matching to the end, ignore trailing slashes\n regexpSource += \"\\\\/*$\";\n } else if (path !== \"\" && path !== \"/\") {\n // If our path is non-empty and contains anything beyond an initial slash,\n // then we have _some_ form of path in our regex so we should expect to\n // match only if we find the end of this path segment. Look for an optional\n // non-captured trailing slash (to match a portion of the URL) or the end\n // of the path (if we've matched to the end). We used to do this with a\n // word boundary but that gives false positives on routes like\n // /user-preferences since `-` counts as a word boundary.\n regexpSource += \"(?:(?=\\\\/|$))\";\n } else {\n // Nothing to match for \"\" or \"/\"\n }\n\n let matcher = new RegExp(regexpSource, caseSensitive ? undefined : \"i\");\n\n return [matcher, paramNames];\n}\n\nfunction safelyDecodeURI(value: string) {\n try {\n return decodeURI(value);\n } catch (error) {\n warning(\n false,\n `The URL path \"${value}\" could not be decoded because it is is a ` +\n `malformed URL segment. This is probably due to a bad percent ` +\n `encoding (${error}).`\n );\n\n return value;\n }\n}\n\nfunction safelyDecodeURIComponent(value: string, paramName: string) {\n try {\n return decodeURIComponent(value);\n } catch (error) {\n warning(\n false,\n `The value for the URL param \"${paramName}\" will not be decoded because` +\n ` the string \"${value}\" is a malformed URL segment. This is probably` +\n ` due to a bad percent encoding (${error}).`\n );\n\n return value;\n }\n}\n\n/**\n * @private\n */\nexport function stripBasename(\n pathname: string,\n basename: string\n): string | null {\n if (basename === \"/\") return pathname;\n\n if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {\n return null;\n }\n\n // We want to leave trailing slash behavior in the user's control, so if they\n // specify a basename with a trailing slash, we should support it\n let startIndex = basename.endsWith(\"/\")\n ? basename.length - 1\n : basename.length;\n let nextChar = pathname.charAt(startIndex);\n if (nextChar && nextChar !== \"/\") {\n // pathname does not start with basename/\n return null;\n }\n\n return pathname.slice(startIndex) || \"/\";\n}\n\n/**\n * Returns a resolved path object relative to the given pathname.\n *\n * @see https://reactrouter.com/utils/resolve-path\n */\nexport function resolvePath(to: To, fromPathname = \"/\"): Path {\n let {\n pathname: toPathname,\n search = \"\",\n hash = \"\",\n } = typeof to === \"string\" ? parsePath(to) : to;\n\n let pathname = toPathname\n ? toPathname.startsWith(\"/\")\n ? toPathname\n : resolvePathname(toPathname, fromPathname)\n : fromPathname;\n\n return {\n pathname,\n search: normalizeSearch(search),\n hash: normalizeHash(hash),\n };\n}\n\nfunction resolvePathname(relativePath: string, fromPathname: string): string {\n let segments = fromPathname.replace(/\\/+$/, \"\").split(\"/\");\n let relativeSegments = relativePath.split(\"/\");\n\n relativeSegments.forEach((segment) => {\n if (segment === \"..\") {\n // Keep the root \"\" segment so the pathname starts at /\n if (segments.length > 1) segments.pop();\n } else if (segment !== \".\") {\n segments.push(segment);\n }\n });\n\n return segments.length > 1 ? segments.join(\"/\") : \"/\";\n}\n\nfunction getInvalidPathError(\n char: string,\n field: string,\n dest: string,\n path: Partial\n) {\n return (\n `Cannot include a '${char}' character in a manually specified ` +\n `\\`to.${field}\\` field [${JSON.stringify(\n path\n )}]. Please separate it out to the ` +\n `\\`to.${dest}\\` field. Alternatively you may provide the full path as ` +\n `a string in and the router will parse it for you.`\n );\n}\n\n/**\n * @private\n *\n * When processing relative navigation we want to ignore ancestor routes that\n * do not contribute to the path, such that index/pathless layout routes don't\n * interfere.\n *\n * For example, when moving a route element into an index route and/or a\n * pathless layout route, relative link behavior contained within should stay\n * the same. Both of the following examples should link back to the root:\n *\n * \n * \n * \n *\n * \n * \n * }> // <-- Does not contribute\n * // <-- Does not contribute\n * \n * \n */\nexport function getPathContributingMatches<\n T extends AgnosticRouteMatch = AgnosticRouteMatch\n>(matches: T[]) {\n return matches.filter(\n (match, index) =>\n index === 0 || (match.route.path && match.route.path.length > 0)\n );\n}\n\n/**\n * @private\n */\nexport function resolveTo(\n toArg: To,\n routePathnames: string[],\n locationPathname: string,\n isPathRelative = false\n): Path {\n let to: Partial;\n if (typeof toArg === \"string\") {\n to = parsePath(toArg);\n } else {\n to = { ...toArg };\n\n invariant(\n !to.pathname || !to.pathname.includes(\"?\"),\n getInvalidPathError(\"?\", \"pathname\", \"search\", to)\n );\n invariant(\n !to.pathname || !to.pathname.includes(\"#\"),\n getInvalidPathError(\"#\", \"pathname\", \"hash\", to)\n );\n invariant(\n !to.search || !to.search.includes(\"#\"),\n getInvalidPathError(\"#\", \"search\", \"hash\", to)\n );\n }\n\n let isEmptyPath = toArg === \"\" || to.pathname === \"\";\n let toPathname = isEmptyPath ? \"/\" : to.pathname;\n\n let from: string;\n\n // Routing is relative to the current pathname if explicitly requested.\n //\n // If a pathname is explicitly provided in `to`, it should be relative to the\n // route context. This is explained in `Note on `` values` in our\n // migration guide from v5 as a means of disambiguation between `to` values\n // that begin with `/` and those that do not. However, this is problematic for\n // `to` values that do not provide a pathname. `to` can simply be a search or\n // hash string, in which case we should assume that the navigation is relative\n // to the current location's pathname and *not* the route pathname.\n if (isPathRelative || toPathname == null) {\n from = locationPathname;\n } else {\n let routePathnameIndex = routePathnames.length - 1;\n\n if (toPathname.startsWith(\"..\")) {\n let toSegments = toPathname.split(\"/\");\n\n // Each leading .. segment means \"go up one route\" instead of \"go up one\n // URL segment\". This is a key difference from how works and a\n // major reason we call this a \"to\" value instead of a \"href\".\n while (toSegments[0] === \"..\") {\n toSegments.shift();\n routePathnameIndex -= 1;\n }\n\n to.pathname = toSegments.join(\"/\");\n }\n\n // If there are more \"..\" segments than parent routes, resolve relative to\n // the root / URL.\n from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : \"/\";\n }\n\n let path = resolvePath(to, from);\n\n // Ensure the pathname has a trailing slash if the original \"to\" had one\n let hasExplicitTrailingSlash =\n toPathname && toPathname !== \"/\" && toPathname.endsWith(\"/\");\n // Or if this was a link to the current path which has a trailing slash\n let hasCurrentTrailingSlash =\n (isEmptyPath || toPathname === \".\") && locationPathname.endsWith(\"/\");\n if (\n !path.pathname.endsWith(\"/\") &&\n (hasExplicitTrailingSlash || hasCurrentTrailingSlash)\n ) {\n path.pathname += \"/\";\n }\n\n return path;\n}\n\n/**\n * @private\n */\nexport function getToPathname(to: To): string | undefined {\n // Empty strings should be treated the same as / paths\n return to === \"\" || (to as Path).pathname === \"\"\n ? \"/\"\n : typeof to === \"string\"\n ? parsePath(to).pathname\n : to.pathname;\n}\n\n/**\n * @private\n */\nexport const joinPaths = (paths: string[]): string =>\n paths.join(\"/\").replace(/\\/\\/+/g, \"/\");\n\n/**\n * @private\n */\nexport const normalizePathname = (pathname: string): string =>\n pathname.replace(/\\/+$/, \"\").replace(/^\\/*/, \"/\");\n\n/**\n * @private\n */\nexport const normalizeSearch = (search: string): string =>\n !search || search === \"?\"\n ? \"\"\n : search.startsWith(\"?\")\n ? search\n : \"?\" + search;\n\n/**\n * @private\n */\nexport const normalizeHash = (hash: string): string =>\n !hash || hash === \"#\" ? \"\" : hash.startsWith(\"#\") ? hash : \"#\" + hash;\n\nexport type JsonFunction = (\n data: Data,\n init?: number | ResponseInit\n) => Response;\n\n/**\n * This is a shortcut for creating `application/json` responses. Converts `data`\n * to JSON and sets the `Content-Type` header.\n */\nexport const json: JsonFunction = (data, init = {}) => {\n let responseInit = typeof init === \"number\" ? { status: init } : init;\n\n let headers = new Headers(responseInit.headers);\n if (!headers.has(\"Content-Type\")) {\n headers.set(\"Content-Type\", \"application/json; charset=utf-8\");\n }\n\n return new Response(JSON.stringify(data), {\n ...responseInit,\n headers,\n });\n};\n\nexport interface TrackedPromise extends Promise {\n _tracked?: boolean;\n _data?: any;\n _error?: any;\n}\n\nexport class AbortedDeferredError extends Error {}\n\nexport class DeferredData {\n private pendingKeysSet: Set = new Set();\n private controller: AbortController;\n private abortPromise: Promise;\n private unlistenAbortSignal: () => void;\n private subscribers: Set<(aborted: boolean, settledKey?: string) => void> =\n new Set();\n data: Record;\n init?: ResponseInit;\n deferredKeys: string[] = [];\n\n constructor(data: Record, responseInit?: ResponseInit) {\n invariant(\n data && typeof data === \"object\" && !Array.isArray(data),\n \"defer() only accepts plain objects\"\n );\n\n // Set up an AbortController + Promise we can race against to exit early\n // cancellation\n let reject: (e: AbortedDeferredError) => void;\n this.abortPromise = new Promise((_, r) => (reject = r));\n this.controller = new AbortController();\n let onAbort = () =>\n reject(new AbortedDeferredError(\"Deferred data aborted\"));\n this.unlistenAbortSignal = () =>\n this.controller.signal.removeEventListener(\"abort\", onAbort);\n this.controller.signal.addEventListener(\"abort\", onAbort);\n\n this.data = Object.entries(data).reduce(\n (acc, [key, value]) =>\n Object.assign(acc, {\n [key]: this.trackPromise(key, value),\n }),\n {}\n );\n\n if (this.done) {\n // All incoming values were resolved\n this.unlistenAbortSignal();\n }\n\n this.init = responseInit;\n }\n\n private trackPromise(\n key: string,\n value: Promise | unknown\n ): TrackedPromise | unknown {\n if (!(value instanceof Promise)) {\n return value;\n }\n\n this.deferredKeys.push(key);\n this.pendingKeysSet.add(key);\n\n // We store a little wrapper promise that will be extended with\n // _data/_error props upon resolve/reject\n let promise: TrackedPromise = Promise.race([value, this.abortPromise]).then(\n (data) => this.onSettle(promise, key, undefined, data as unknown),\n (error) => this.onSettle(promise, key, error as unknown)\n );\n\n // Register rejection listeners to avoid uncaught promise rejections on\n // errors or aborted deferred values\n promise.catch(() => {});\n\n Object.defineProperty(promise, \"_tracked\", { get: () => true });\n return promise;\n }\n\n private onSettle(\n promise: TrackedPromise,\n key: string,\n error: unknown,\n data?: unknown\n ): unknown {\n if (\n this.controller.signal.aborted &&\n error instanceof AbortedDeferredError\n ) {\n this.unlistenAbortSignal();\n Object.defineProperty(promise, \"_error\", { get: () => error });\n return Promise.reject(error);\n }\n\n this.pendingKeysSet.delete(key);\n\n if (this.done) {\n // Nothing left to abort!\n this.unlistenAbortSignal();\n }\n\n // If the promise was resolved/rejected with undefined, we'll throw an error as you\n // should always resolve with a value or null\n if (error === undefined && data === undefined) {\n let undefinedError = new Error(\n `Deferred data for key \"${key}\" resolved/rejected with \\`undefined\\`, ` +\n `you must resolve/reject with a value or \\`null\\`.`\n );\n Object.defineProperty(promise, \"_error\", { get: () => undefinedError });\n this.emit(false, key);\n return Promise.reject(undefinedError);\n }\n\n if (data === undefined) {\n Object.defineProperty(promise, \"_error\", { get: () => error });\n this.emit(false, key);\n return Promise.reject(error);\n }\n\n Object.defineProperty(promise, \"_data\", { get: () => data });\n this.emit(false, key);\n return data;\n }\n\n private emit(aborted: boolean, settledKey?: string) {\n this.subscribers.forEach((subscriber) => subscriber(aborted, settledKey));\n }\n\n subscribe(fn: (aborted: boolean, settledKey?: string) => void) {\n this.subscribers.add(fn);\n return () => this.subscribers.delete(fn);\n }\n\n cancel() {\n this.controller.abort();\n this.pendingKeysSet.forEach((v, k) => this.pendingKeysSet.delete(k));\n this.emit(true);\n }\n\n async resolveData(signal: AbortSignal) {\n let aborted = false;\n if (!this.done) {\n let onAbort = () => this.cancel();\n signal.addEventListener(\"abort\", onAbort);\n aborted = await new Promise((resolve) => {\n this.subscribe((aborted) => {\n signal.removeEventListener(\"abort\", onAbort);\n if (aborted || this.done) {\n resolve(aborted);\n }\n });\n });\n }\n return aborted;\n }\n\n get done() {\n return this.pendingKeysSet.size === 0;\n }\n\n get unwrappedData() {\n invariant(\n this.data !== null && this.done,\n \"Can only unwrap data on initialized and settled deferreds\"\n );\n\n return Object.entries(this.data).reduce(\n (acc, [key, value]) =>\n Object.assign(acc, {\n [key]: unwrapTrackedPromise(value),\n }),\n {}\n );\n }\n\n get pendingKeys() {\n return Array.from(this.pendingKeysSet);\n }\n}\n\nfunction isTrackedPromise(value: any): value is TrackedPromise {\n return (\n value instanceof Promise && (value as TrackedPromise)._tracked === true\n );\n}\n\nfunction unwrapTrackedPromise(value: any) {\n if (!isTrackedPromise(value)) {\n return value;\n }\n\n if (value._error) {\n throw value._error;\n }\n return value._data;\n}\n\nexport type DeferFunction = (\n data: Record,\n init?: number | ResponseInit\n) => DeferredData;\n\nexport const defer: DeferFunction = (data, init = {}) => {\n let responseInit = typeof init === \"number\" ? { status: init } : init;\n\n return new DeferredData(data, responseInit);\n};\n\nexport type RedirectFunction = (\n url: string,\n init?: number | ResponseInit\n) => Response;\n\n/**\n * A redirect response. Sets the status code and the `Location` header.\n * Defaults to \"302 Found\".\n */\nexport const redirect: RedirectFunction = (url, init = 302) => {\n let responseInit = init;\n if (typeof responseInit === \"number\") {\n responseInit = { status: responseInit };\n } else if (typeof responseInit.status === \"undefined\") {\n responseInit.status = 302;\n }\n\n let headers = new Headers(responseInit.headers);\n headers.set(\"Location\", url);\n\n return new Response(null, {\n ...responseInit,\n headers,\n });\n};\n\n/**\n * @private\n * Utility class we use to hold auto-unwrapped 4xx/5xx Response bodies\n */\nexport class ErrorResponse {\n status: number;\n statusText: string;\n data: any;\n error?: Error;\n internal: boolean;\n\n constructor(\n status: number,\n statusText: string | undefined,\n data: any,\n internal = false\n ) {\n this.status = status;\n this.statusText = statusText || \"\";\n this.internal = internal;\n if (data instanceof Error) {\n this.data = data.toString();\n this.error = data;\n } else {\n this.data = data;\n }\n }\n}\n\n/**\n * Check if the given error is an ErrorResponse generated from a 4xx/5xx\n * Response thrown from an action/loader\n */\nexport function isRouteErrorResponse(error: any): error is ErrorResponse {\n return (\n error != null &&\n typeof error.status === \"number\" &&\n typeof error.statusText === \"string\" &&\n typeof error.internal === \"boolean\" &&\n \"data\" in error\n );\n}\n","import type { History, Location, Path, To } from \"./history\";\nimport {\n Action as HistoryAction,\n createLocation,\n createPath,\n invariant,\n parsePath,\n warning,\n} from \"./history\";\nimport type {\n DataResult,\n DeferredData,\n AgnosticDataRouteMatch,\n AgnosticDataRouteObject,\n DeferredResult,\n ErrorResult,\n FormEncType,\n FormMethod,\n DetectErrorBoundaryFunction,\n RedirectResult,\n RouteData,\n AgnosticRouteObject,\n Submission,\n SuccessResult,\n AgnosticRouteMatch,\n ShouldRevalidateFunction,\n RouteManifest,\n ImmutableRouteKey,\n ActionFunction,\n LoaderFunction,\n V7_MutationFormMethod,\n V7_FormMethod,\n HTMLFormMethod,\n MutationFormMethod,\n MapRoutePropertiesFunction,\n} from \"./utils\";\nimport {\n ErrorResponse,\n ResultType,\n convertRoutesToDataRoutes,\n getPathContributingMatches,\n immutableRouteKeys,\n isRouteErrorResponse,\n joinPaths,\n matchRoutes,\n resolveTo,\n stripBasename,\n} from \"./utils\";\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Types and Constants\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * A Router instance manages all navigation and data loading/mutations\n */\nexport interface Router {\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Return the basename for the router\n */\n get basename(): RouterInit[\"basename\"];\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Return the current state of the router\n */\n get state(): RouterState;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Return the routes for this router instance\n */\n get routes(): AgnosticDataRouteObject[];\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Initialize the router, including adding history listeners and kicking off\n * initial data fetches. Returns a function to cleanup listeners and abort\n * any in-progress loads\n */\n initialize(): Router;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Subscribe to router.state updates\n *\n * @param fn function to call with the new state\n */\n subscribe(fn: RouterSubscriber): () => void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Enable scroll restoration behavior in the router\n *\n * @param savedScrollPositions Object that will manage positions, in case\n * it's being restored from sessionStorage\n * @param getScrollPosition Function to get the active Y scroll position\n * @param getKey Function to get the key to use for restoration\n */\n enableScrollRestoration(\n savedScrollPositions: Record,\n getScrollPosition: GetScrollPositionFunction,\n getKey?: GetScrollRestorationKeyFunction\n ): () => void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Navigate forward/backward in the history stack\n * @param to Delta to move in the history stack\n */\n navigate(to: number): Promise;\n\n /**\n * Navigate to the given path\n * @param to Path to navigate to\n * @param opts Navigation options (method, submission, etc.)\n */\n navigate(to: To | null, opts?: RouterNavigateOptions): Promise;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Trigger a fetcher load/submission\n *\n * @param key Fetcher key\n * @param routeId Route that owns the fetcher\n * @param href href to fetch\n * @param opts Fetcher options, (method, submission, etc.)\n */\n fetch(\n key: string,\n routeId: string,\n href: string | null,\n opts?: RouterFetchOptions\n ): void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Trigger a revalidation of all current route loaders and fetcher loads\n */\n revalidate(): void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Utility function to create an href for the given location\n * @param location\n */\n createHref(location: Location | URL): string;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Utility function to URL encode a destination path according to the internal\n * history implementation\n * @param to\n */\n encodeLocation(to: To): Path;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Get/create a fetcher for the given key\n * @param key\n */\n getFetcher(key?: string): Fetcher;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Delete the fetcher for a given key\n * @param key\n */\n deleteFetcher(key?: string): void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Cleanup listeners and abort any in-progress loads\n */\n dispose(): void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Get a navigation blocker\n * @param key The identifier for the blocker\n * @param fn The blocker function implementation\n */\n getBlocker(key: string, fn: BlockerFunction): Blocker;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Delete a navigation blocker\n * @param key The identifier for the blocker\n */\n deleteBlocker(key: string): void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * HMR needs to pass in-flight route updates to React Router\n * TODO: Replace this with granular route update APIs (addRoute, updateRoute, deleteRoute)\n */\n _internalSetRoutes(routes: AgnosticRouteObject[]): void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Internal fetch AbortControllers accessed by unit tests\n */\n _internalFetchControllers: Map;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Internal pending DeferredData instances accessed by unit tests\n */\n _internalActiveDeferreds: Map;\n}\n\n/**\n * State maintained internally by the router. During a navigation, all states\n * reflect the the \"old\" location unless otherwise noted.\n */\nexport interface RouterState {\n /**\n * The action of the most recent navigation\n */\n historyAction: HistoryAction;\n\n /**\n * The current location reflected by the router\n */\n location: Location;\n\n /**\n * The current set of route matches\n */\n matches: AgnosticDataRouteMatch[];\n\n /**\n * Tracks whether we've completed our initial data load\n */\n initialized: boolean;\n\n /**\n * Current scroll position we should start at for a new view\n * - number -> scroll position to restore to\n * - false -> do not restore scroll at all (used during submissions)\n * - null -> don't have a saved position, scroll to hash or top of page\n */\n restoreScrollPosition: number | false | null;\n\n /**\n * Indicate whether this navigation should skip resetting the scroll position\n * if we are unable to restore the scroll position\n */\n preventScrollReset: boolean;\n\n /**\n * Tracks the state of the current navigation\n */\n navigation: Navigation;\n\n /**\n * Tracks any in-progress revalidations\n */\n revalidation: RevalidationState;\n\n /**\n * Data from the loaders for the current matches\n */\n loaderData: RouteData;\n\n /**\n * Data from the action for the current matches\n */\n actionData: RouteData | null;\n\n /**\n * Errors caught from loaders for the current matches\n */\n errors: RouteData | null;\n\n /**\n * Map of current fetchers\n */\n fetchers: Map;\n\n /**\n * Map of current blockers\n */\n blockers: Map;\n}\n\n/**\n * Data that can be passed into hydrate a Router from SSR\n */\nexport type HydrationState = Partial<\n Pick\n>;\n\n/**\n * Future flags to toggle new feature behavior\n */\nexport interface FutureConfig {\n v7_normalizeFormMethod: boolean;\n v7_prependBasename: boolean;\n}\n\n/**\n * Initialization options for createRouter\n */\nexport interface RouterInit {\n routes: AgnosticRouteObject[];\n history: History;\n basename?: string;\n /**\n * @deprecated Use `mapRouteProperties` instead\n */\n detectErrorBoundary?: DetectErrorBoundaryFunction;\n mapRouteProperties?: MapRoutePropertiesFunction;\n future?: Partial;\n hydrationData?: HydrationState;\n window?: Window;\n}\n\n/**\n * State returned from a server-side query() call\n */\nexport interface StaticHandlerContext {\n basename: Router[\"basename\"];\n location: RouterState[\"location\"];\n matches: RouterState[\"matches\"];\n loaderData: RouterState[\"loaderData\"];\n actionData: RouterState[\"actionData\"];\n errors: RouterState[\"errors\"];\n statusCode: number;\n loaderHeaders: Record;\n actionHeaders: Record;\n activeDeferreds: Record | null;\n _deepestRenderedBoundaryId?: string | null;\n}\n\n/**\n * A StaticHandler instance manages a singular SSR navigation/fetch event\n */\nexport interface StaticHandler {\n dataRoutes: AgnosticDataRouteObject[];\n query(\n request: Request,\n opts?: { requestContext?: unknown }\n ): Promise;\n queryRoute(\n request: Request,\n opts?: { routeId?: string; requestContext?: unknown }\n ): Promise;\n}\n\n/**\n * Subscriber function signature for changes to router state\n */\nexport interface RouterSubscriber {\n (state: RouterState): void;\n}\n\ninterface UseMatchesMatch {\n id: string;\n pathname: string;\n params: AgnosticRouteMatch[\"params\"];\n data: unknown;\n handle: unknown;\n}\n\n/**\n * Function signature for determining the key to be used in scroll restoration\n * for a given location\n */\nexport interface GetScrollRestorationKeyFunction {\n (location: Location, matches: UseMatchesMatch[]): string | null;\n}\n\n/**\n * Function signature for determining the current scroll position\n */\nexport interface GetScrollPositionFunction {\n (): number;\n}\n\nexport type RelativeRoutingType = \"route\" | \"path\";\n\n// Allowed for any navigation or fetch\ntype BaseNavigateOrFetchOptions = {\n preventScrollReset?: boolean;\n relative?: RelativeRoutingType;\n};\n\n// Only allowed for navigations\ntype BaseNavigateOptions = BaseNavigateOrFetchOptions & {\n replace?: boolean;\n state?: any;\n fromRouteId?: string;\n};\n\n// Only allowed for submission navigations\ntype BaseSubmissionOptions = {\n formMethod?: HTMLFormMethod;\n formEncType?: FormEncType;\n} & (\n | { formData: FormData; body?: undefined }\n | { formData?: undefined; body: any }\n);\n\n/**\n * Options for a navigate() call for a normal (non-submission) navigation\n */\ntype LinkNavigateOptions = BaseNavigateOptions;\n\n/**\n * Options for a navigate() call for a submission navigation\n */\ntype SubmissionNavigateOptions = BaseNavigateOptions & BaseSubmissionOptions;\n\n/**\n * Options to pass to navigate() for a navigation\n */\nexport type RouterNavigateOptions =\n | LinkNavigateOptions\n | SubmissionNavigateOptions;\n\n/**\n * Options for a fetch() load\n */\ntype LoadFetchOptions = BaseNavigateOrFetchOptions;\n\n/**\n * Options for a fetch() submission\n */\ntype SubmitFetchOptions = BaseNavigateOrFetchOptions & BaseSubmissionOptions;\n\n/**\n * Options to pass to fetch()\n */\nexport type RouterFetchOptions = LoadFetchOptions | SubmitFetchOptions;\n\n/**\n * Potential states for state.navigation\n */\nexport type NavigationStates = {\n Idle: {\n state: \"idle\";\n location: undefined;\n formMethod: undefined;\n formAction: undefined;\n formEncType: undefined;\n formData: undefined;\n json: undefined;\n text: undefined;\n };\n Loading: {\n state: \"loading\";\n location: Location;\n formMethod: Submission[\"formMethod\"] | undefined;\n formAction: Submission[\"formAction\"] | undefined;\n formEncType: Submission[\"formEncType\"] | undefined;\n formData: Submission[\"formData\"] | undefined;\n json: Submission[\"json\"] | undefined;\n text: Submission[\"text\"] | undefined;\n };\n Submitting: {\n state: \"submitting\";\n location: Location;\n formMethod: Submission[\"formMethod\"];\n formAction: Submission[\"formAction\"];\n formEncType: Submission[\"formEncType\"];\n formData: Submission[\"formData\"];\n json: Submission[\"json\"];\n text: Submission[\"text\"];\n };\n};\n\nexport type Navigation = NavigationStates[keyof NavigationStates];\n\nexport type RevalidationState = \"idle\" | \"loading\";\n\n/**\n * Potential states for fetchers\n */\ntype FetcherStates = {\n Idle: {\n state: \"idle\";\n formMethod: undefined;\n formAction: undefined;\n formEncType: undefined;\n text: undefined;\n formData: undefined;\n json: undefined;\n data: TData | undefined;\n \" _hasFetcherDoneAnything \"?: boolean;\n };\n Loading: {\n state: \"loading\";\n formMethod: Submission[\"formMethod\"] | undefined;\n formAction: Submission[\"formAction\"] | undefined;\n formEncType: Submission[\"formEncType\"] | undefined;\n text: Submission[\"text\"] | undefined;\n formData: Submission[\"formData\"] | undefined;\n json: Submission[\"json\"] | undefined;\n data: TData | undefined;\n \" _hasFetcherDoneAnything \"?: boolean;\n };\n Submitting: {\n state: \"submitting\";\n formMethod: Submission[\"formMethod\"];\n formAction: Submission[\"formAction\"];\n formEncType: Submission[\"formEncType\"];\n text: Submission[\"text\"];\n formData: Submission[\"formData\"];\n json: Submission[\"json\"];\n data: TData | undefined;\n \" _hasFetcherDoneAnything \"?: boolean;\n };\n};\n\nexport type Fetcher =\n FetcherStates[keyof FetcherStates];\n\ninterface BlockerBlocked {\n state: \"blocked\";\n reset(): void;\n proceed(): void;\n location: Location;\n}\n\ninterface BlockerUnblocked {\n state: \"unblocked\";\n reset: undefined;\n proceed: undefined;\n location: undefined;\n}\n\ninterface BlockerProceeding {\n state: \"proceeding\";\n reset: undefined;\n proceed: undefined;\n location: Location;\n}\n\nexport type Blocker = BlockerUnblocked | BlockerBlocked | BlockerProceeding;\n\nexport type BlockerFunction = (args: {\n currentLocation: Location;\n nextLocation: Location;\n historyAction: HistoryAction;\n}) => boolean;\n\ninterface ShortCircuitable {\n /**\n * startNavigation does not need to complete the navigation because we\n * redirected or got interrupted\n */\n shortCircuited?: boolean;\n}\n\ninterface HandleActionResult extends ShortCircuitable {\n /**\n * Error thrown from the current action, keyed by the route containing the\n * error boundary to render the error. To be committed to the state after\n * loaders have completed\n */\n pendingActionError?: RouteData;\n /**\n * Data returned from the current action, keyed by the route owning the action.\n * To be committed to the state after loaders have completed\n */\n pendingActionData?: RouteData;\n}\n\ninterface HandleLoadersResult extends ShortCircuitable {\n /**\n * loaderData returned from the current set of loaders\n */\n loaderData?: RouterState[\"loaderData\"];\n /**\n * errors thrown from the current set of loaders\n */\n errors?: RouterState[\"errors\"];\n}\n\n/**\n * Cached info for active fetcher.load() instances so they can participate\n * in revalidation\n */\ninterface FetchLoadMatch {\n routeId: string;\n path: string;\n}\n\n/**\n * Identified fetcher.load() calls that need to be revalidated\n */\ninterface RevalidatingFetcher extends FetchLoadMatch {\n key: string;\n match: AgnosticDataRouteMatch | null;\n matches: AgnosticDataRouteMatch[] | null;\n controller: AbortController | null;\n}\n\n/**\n * Wrapper object to allow us to throw any response out from callLoaderOrAction\n * for queryRouter while preserving whether or not it was thrown or returned\n * from the loader/action\n */\ninterface QueryRouteResponse {\n type: ResultType.data | ResultType.error;\n response: Response;\n}\n\nconst validMutationMethodsArr: MutationFormMethod[] = [\n \"post\",\n \"put\",\n \"patch\",\n \"delete\",\n];\nconst validMutationMethods = new Set(\n validMutationMethodsArr\n);\n\nconst validRequestMethodsArr: FormMethod[] = [\n \"get\",\n ...validMutationMethodsArr,\n];\nconst validRequestMethods = new Set(validRequestMethodsArr);\n\nconst redirectStatusCodes = new Set([301, 302, 303, 307, 308]);\nconst redirectPreserveMethodStatusCodes = new Set([307, 308]);\n\nexport const IDLE_NAVIGATION: NavigationStates[\"Idle\"] = {\n state: \"idle\",\n location: undefined,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n json: undefined,\n text: undefined,\n};\n\nexport const IDLE_FETCHER: FetcherStates[\"Idle\"] = {\n state: \"idle\",\n data: undefined,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n json: undefined,\n text: undefined,\n};\n\nexport const IDLE_BLOCKER: BlockerUnblocked = {\n state: \"unblocked\",\n proceed: undefined,\n reset: undefined,\n location: undefined,\n};\n\nconst ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i;\n\nconst defaultMapRouteProperties: MapRoutePropertiesFunction = (route) => ({\n hasErrorBoundary: Boolean(route.hasErrorBoundary),\n});\n\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region createRouter\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Create a router and listen to history POP navigations\n */\nexport function createRouter(init: RouterInit): Router {\n const routerWindow = init.window\n ? init.window\n : typeof window !== \"undefined\"\n ? window\n : undefined;\n const isBrowser =\n typeof routerWindow !== \"undefined\" &&\n typeof routerWindow.document !== \"undefined\" &&\n typeof routerWindow.document.createElement !== \"undefined\";\n const isServer = !isBrowser;\n\n invariant(\n init.routes.length > 0,\n \"You must provide a non-empty routes array to createRouter\"\n );\n\n let mapRouteProperties: MapRoutePropertiesFunction;\n if (init.mapRouteProperties) {\n mapRouteProperties = init.mapRouteProperties;\n } else if (init.detectErrorBoundary) {\n // If they are still using the deprecated version, wrap it with the new API\n let detectErrorBoundary = init.detectErrorBoundary;\n mapRouteProperties = (route) => ({\n hasErrorBoundary: detectErrorBoundary(route),\n });\n } else {\n mapRouteProperties = defaultMapRouteProperties;\n }\n\n // Routes keyed by ID\n let manifest: RouteManifest = {};\n // Routes in tree format for matching\n let dataRoutes = convertRoutesToDataRoutes(\n init.routes,\n mapRouteProperties,\n undefined,\n manifest\n );\n let inFlightDataRoutes: AgnosticDataRouteObject[] | undefined;\n let basename = init.basename || \"/\";\n // Config driven behavior flags\n let future: FutureConfig = {\n v7_normalizeFormMethod: false,\n v7_prependBasename: false,\n ...init.future,\n };\n // Cleanup function for history\n let unlistenHistory: (() => void) | null = null;\n // Externally-provided functions to call on all state changes\n let subscribers = new Set();\n // Externally-provided object to hold scroll restoration locations during routing\n let savedScrollPositions: Record | null = null;\n // Externally-provided function to get scroll restoration keys\n let getScrollRestorationKey: GetScrollRestorationKeyFunction | null = null;\n // Externally-provided function to get current scroll position\n let getScrollPosition: GetScrollPositionFunction | null = null;\n // One-time flag to control the initial hydration scroll restoration. Because\n // we don't get the saved positions from until _after_\n // the initial render, we need to manually trigger a separate updateState to\n // send along the restoreScrollPosition\n // Set to true if we have `hydrationData` since we assume we were SSR'd and that\n // SSR did the initial scroll restoration.\n let initialScrollRestored = init.hydrationData != null;\n\n let initialMatches = matchRoutes(dataRoutes, init.history.location, basename);\n let initialErrors: RouteData | null = null;\n\n if (initialMatches == null) {\n // If we do not match a user-provided-route, fall back to the root\n // to allow the error boundary to take over\n let error = getInternalRouterError(404, {\n pathname: init.history.location.pathname,\n });\n let { matches, route } = getShortCircuitMatches(dataRoutes);\n initialMatches = matches;\n initialErrors = { [route.id]: error };\n }\n\n let initialized =\n // All initialMatches need to be loaded before we're ready. If we have lazy\n // functions around still then we'll need to run them in initialize()\n !initialMatches.some((m) => m.route.lazy) &&\n // And we have to either have no loaders or have been provided hydrationData\n (!initialMatches.some((m) => m.route.loader) || init.hydrationData != null);\n\n let router: Router;\n let state: RouterState = {\n historyAction: init.history.action,\n location: init.history.location,\n matches: initialMatches,\n initialized,\n navigation: IDLE_NAVIGATION,\n // Don't restore on initial updateState() if we were SSR'd\n restoreScrollPosition: init.hydrationData != null ? false : null,\n preventScrollReset: false,\n revalidation: \"idle\",\n loaderData: (init.hydrationData && init.hydrationData.loaderData) || {},\n actionData: (init.hydrationData && init.hydrationData.actionData) || null,\n errors: (init.hydrationData && init.hydrationData.errors) || initialErrors,\n fetchers: new Map(),\n blockers: new Map(),\n };\n\n // -- Stateful internal variables to manage navigations --\n // Current navigation in progress (to be committed in completeNavigation)\n let pendingAction: HistoryAction = HistoryAction.Pop;\n\n // Should the current navigation prevent the scroll reset if scroll cannot\n // be restored?\n let pendingPreventScrollReset = false;\n\n // AbortController for the active navigation\n let pendingNavigationController: AbortController | null;\n\n // We use this to avoid touching history in completeNavigation if a\n // revalidation is entirely uninterrupted\n let isUninterruptedRevalidation = false;\n\n // Use this internal flag to force revalidation of all loaders:\n // - submissions (completed or interrupted)\n // - useRevalidator()\n // - X-Remix-Revalidate (from redirect)\n let isRevalidationRequired = false;\n\n // Use this internal array to capture routes that require revalidation due\n // to a cancelled deferred on action submission\n let cancelledDeferredRoutes: string[] = [];\n\n // Use this internal array to capture fetcher loads that were cancelled by an\n // action navigation and require revalidation\n let cancelledFetcherLoads: string[] = [];\n\n // AbortControllers for any in-flight fetchers\n let fetchControllers = new Map();\n\n // Track loads based on the order in which they started\n let incrementingLoadId = 0;\n\n // Track the outstanding pending navigation data load to be compared against\n // the globally incrementing load when a fetcher load lands after a completed\n // navigation\n let pendingNavigationLoadId = -1;\n\n // Fetchers that triggered data reloads as a result of their actions\n let fetchReloadIds = new Map();\n\n // Fetchers that triggered redirect navigations\n let fetchRedirectIds = new Set();\n\n // Most recent href/match for fetcher.load calls for fetchers\n let fetchLoadMatches = new Map();\n\n // Store DeferredData instances for active route matches. When a\n // route loader returns defer() we stick one in here. Then, when a nested\n // promise resolves we update loaderData. If a new navigation starts we\n // cancel active deferreds for eliminated routes.\n let activeDeferreds = new Map();\n\n // Store blocker functions in a separate Map outside of router state since\n // we don't need to update UI state if they change\n let blockerFunctions = new Map();\n\n // Flag to ignore the next history update, so we can revert the URL change on\n // a POP navigation that was blocked by the user without touching router state\n let ignoreNextHistoryUpdate = false;\n\n // Initialize the router, all side effects should be kicked off from here.\n // Implemented as a Fluent API for ease of:\n // let router = createRouter(init).initialize();\n function initialize() {\n // If history informs us of a POP navigation, start the navigation but do not update\n // state. We'll update our own state once the navigation completes\n unlistenHistory = init.history.listen(\n ({ action: historyAction, location, delta }) => {\n // Ignore this event if it was just us resetting the URL from a\n // blocked POP navigation\n if (ignoreNextHistoryUpdate) {\n ignoreNextHistoryUpdate = false;\n return;\n }\n\n warning(\n blockerFunctions.size === 0 || delta != null,\n \"You are trying to use a blocker on a POP navigation to a location \" +\n \"that was not created by @remix-run/router. This will fail silently in \" +\n \"production. This can happen if you are navigating outside the router \" +\n \"via `window.history.pushState`/`window.location.hash` instead of using \" +\n \"router navigation APIs. This can also happen if you are using \" +\n \"createHashRouter and the user manually changes the URL.\"\n );\n\n let blockerKey = shouldBlockNavigation({\n currentLocation: state.location,\n nextLocation: location,\n historyAction,\n });\n\n if (blockerKey && delta != null) {\n // Restore the URL to match the current UI, but don't update router state\n ignoreNextHistoryUpdate = true;\n init.history.go(delta * -1);\n\n // Put the blocker into a blocked state\n updateBlocker(blockerKey, {\n state: \"blocked\",\n location,\n proceed() {\n updateBlocker(blockerKey!, {\n state: \"proceeding\",\n proceed: undefined,\n reset: undefined,\n location,\n });\n // Re-do the same POP navigation we just blocked\n init.history.go(delta);\n },\n reset() {\n let blockers = new Map(state.blockers);\n blockers.set(blockerKey!, IDLE_BLOCKER);\n updateState({ blockers });\n },\n });\n return;\n }\n\n return startNavigation(historyAction, location);\n }\n );\n\n // Kick off initial data load if needed. Use Pop to avoid modifying history\n // Note we don't do any handling of lazy here. For SPA's it'll get handled\n // in the normal navigation flow. For SSR it's expected that lazy modules are\n // resolved prior to router creation since we can't go into a fallbackElement\n // UI for SSR'd apps\n if (!state.initialized) {\n startNavigation(HistoryAction.Pop, state.location);\n }\n\n return router;\n }\n\n // Clean up a router and it's side effects\n function dispose() {\n if (unlistenHistory) {\n unlistenHistory();\n }\n subscribers.clear();\n pendingNavigationController && pendingNavigationController.abort();\n state.fetchers.forEach((_, key) => deleteFetcher(key));\n state.blockers.forEach((_, key) => deleteBlocker(key));\n }\n\n // Subscribe to state updates for the router\n function subscribe(fn: RouterSubscriber) {\n subscribers.add(fn);\n return () => subscribers.delete(fn);\n }\n\n // Update our state and notify the calling context of the change\n function updateState(newState: Partial): void {\n state = {\n ...state,\n ...newState,\n };\n subscribers.forEach((subscriber) => subscriber(state));\n }\n\n // Complete a navigation returning the state.navigation back to the IDLE_NAVIGATION\n // and setting state.[historyAction/location/matches] to the new route.\n // - Location is a required param\n // - Navigation will always be set to IDLE_NAVIGATION\n // - Can pass any other state in newState\n function completeNavigation(\n location: Location,\n newState: Partial>\n ): void {\n // Deduce if we're in a loading/actionReload state:\n // - We have committed actionData in the store\n // - The current navigation was a mutation submission\n // - We're past the submitting state and into the loading state\n // - The location being loaded is not the result of a redirect\n let isActionReload =\n state.actionData != null &&\n state.navigation.formMethod != null &&\n isMutationMethod(state.navigation.formMethod) &&\n state.navigation.state === \"loading\" &&\n location.state?._isRedirect !== true;\n\n let actionData: RouteData | null;\n if (newState.actionData) {\n if (Object.keys(newState.actionData).length > 0) {\n actionData = newState.actionData;\n } else {\n // Empty actionData -> clear prior actionData due to an action error\n actionData = null;\n }\n } else if (isActionReload) {\n // Keep the current data if we're wrapping up the action reload\n actionData = state.actionData;\n } else {\n // Clear actionData on any other completed navigations\n actionData = null;\n }\n\n // Always preserve any existing loaderData from re-used routes\n let loaderData = newState.loaderData\n ? mergeLoaderData(\n state.loaderData,\n newState.loaderData,\n newState.matches || [],\n newState.errors\n )\n : state.loaderData;\n\n // On a successful navigation we can assume we got through all blockers\n // so we can start fresh\n let blockers = state.blockers;\n if (blockers.size > 0) {\n blockers = new Map(blockers);\n blockers.forEach((_, k) => blockers.set(k, IDLE_BLOCKER));\n }\n\n // Always respect the user flag. Otherwise don't reset on mutation\n // submission navigations unless they redirect\n let preventScrollReset =\n pendingPreventScrollReset === true ||\n (state.navigation.formMethod != null &&\n isMutationMethod(state.navigation.formMethod) &&\n location.state?._isRedirect !== true);\n\n if (inFlightDataRoutes) {\n dataRoutes = inFlightDataRoutes;\n inFlightDataRoutes = undefined;\n }\n\n if (isUninterruptedRevalidation) {\n // If this was an uninterrupted revalidation then do not touch history\n } else if (pendingAction === HistoryAction.Pop) {\n // Do nothing for POP - URL has already been updated\n } else if (pendingAction === HistoryAction.Push) {\n init.history.push(location, location.state);\n } else if (pendingAction === HistoryAction.Replace) {\n init.history.replace(location, location.state);\n }\n\n updateState({\n ...newState, // matches, errors, fetchers go through as-is\n actionData,\n loaderData,\n historyAction: pendingAction,\n location,\n initialized: true,\n navigation: IDLE_NAVIGATION,\n revalidation: \"idle\",\n restoreScrollPosition: getSavedScrollPosition(\n location,\n newState.matches || state.matches\n ),\n preventScrollReset,\n blockers,\n });\n\n // Reset stateful navigation vars\n pendingAction = HistoryAction.Pop;\n pendingPreventScrollReset = false;\n isUninterruptedRevalidation = false;\n isRevalidationRequired = false;\n cancelledDeferredRoutes = [];\n cancelledFetcherLoads = [];\n }\n\n // Trigger a navigation event, which can either be a numerical POP or a PUSH\n // replace with an optional submission\n async function navigate(\n to: number | To | null,\n opts?: RouterNavigateOptions\n ): Promise {\n if (typeof to === \"number\") {\n init.history.go(to);\n return;\n }\n\n let normalizedPath = normalizeTo(\n state.location,\n state.matches,\n basename,\n future.v7_prependBasename,\n to,\n opts?.fromRouteId,\n opts?.relative\n );\n let { path, submission, error } = normalizeNavigateOptions(\n future.v7_normalizeFormMethod,\n false,\n normalizedPath,\n opts\n );\n\n let currentLocation = state.location;\n let nextLocation = createLocation(state.location, path, opts && opts.state);\n\n // When using navigate as a PUSH/REPLACE we aren't reading an already-encoded\n // URL from window.location, so we need to encode it here so the behavior\n // remains the same as POP and non-data-router usages. new URL() does all\n // the same encoding we'd get from a history.pushState/window.location read\n // without having to touch history\n nextLocation = {\n ...nextLocation,\n ...init.history.encodeLocation(nextLocation),\n };\n\n let userReplace = opts && opts.replace != null ? opts.replace : undefined;\n\n let historyAction = HistoryAction.Push;\n\n if (userReplace === true) {\n historyAction = HistoryAction.Replace;\n } else if (userReplace === false) {\n // no-op\n } else if (\n submission != null &&\n isMutationMethod(submission.formMethod) &&\n submission.formAction === state.location.pathname + state.location.search\n ) {\n // By default on submissions to the current location we REPLACE so that\n // users don't have to double-click the back button to get to the prior\n // location. If the user redirects to a different location from the\n // action/loader this will be ignored and the redirect will be a PUSH\n historyAction = HistoryAction.Replace;\n }\n\n let preventScrollReset =\n opts && \"preventScrollReset\" in opts\n ? opts.preventScrollReset === true\n : undefined;\n\n let blockerKey = shouldBlockNavigation({\n currentLocation,\n nextLocation,\n historyAction,\n });\n\n if (blockerKey) {\n // Put the blocker into a blocked state\n updateBlocker(blockerKey, {\n state: \"blocked\",\n location: nextLocation,\n proceed() {\n updateBlocker(blockerKey!, {\n state: \"proceeding\",\n proceed: undefined,\n reset: undefined,\n location: nextLocation,\n });\n // Send the same navigation through\n navigate(to, opts);\n },\n reset() {\n let blockers = new Map(state.blockers);\n blockers.set(blockerKey!, IDLE_BLOCKER);\n updateState({ blockers });\n },\n });\n return;\n }\n\n return await startNavigation(historyAction, nextLocation, {\n submission,\n // Send through the formData serialization error if we have one so we can\n // render at the right error boundary after we match routes\n pendingError: error,\n preventScrollReset,\n replace: opts && opts.replace,\n });\n }\n\n // Revalidate all current loaders. If a navigation is in progress or if this\n // is interrupted by a navigation, allow this to \"succeed\" by calling all\n // loaders during the next loader round\n function revalidate() {\n interruptActiveLoads();\n updateState({ revalidation: \"loading\" });\n\n // If we're currently submitting an action, we don't need to start a new\n // navigation, we'll just let the follow up loader execution call all loaders\n if (state.navigation.state === \"submitting\") {\n return;\n }\n\n // If we're currently in an idle state, start a new navigation for the current\n // action/location and mark it as uninterrupted, which will skip the history\n // update in completeNavigation\n if (state.navigation.state === \"idle\") {\n startNavigation(state.historyAction, state.location, {\n startUninterruptedRevalidation: true,\n });\n return;\n }\n\n // Otherwise, if we're currently in a loading state, just start a new\n // navigation to the navigation.location but do not trigger an uninterrupted\n // revalidation so that history correctly updates once the navigation completes\n startNavigation(\n pendingAction || state.historyAction,\n state.navigation.location,\n { overrideNavigation: state.navigation }\n );\n }\n\n // Start a navigation to the given action/location. Can optionally provide a\n // overrideNavigation which will override the normalLoad in the case of a redirect\n // navigation\n async function startNavigation(\n historyAction: HistoryAction,\n location: Location,\n opts?: {\n submission?: Submission;\n fetcherSubmission?: Submission;\n overrideNavigation?: Navigation;\n pendingError?: ErrorResponse;\n startUninterruptedRevalidation?: boolean;\n preventScrollReset?: boolean;\n replace?: boolean;\n }\n ): Promise {\n // Abort any in-progress navigations and start a new one. Unset any ongoing\n // uninterrupted revalidations unless told otherwise, since we want this\n // new navigation to update history normally\n pendingNavigationController && pendingNavigationController.abort();\n pendingNavigationController = null;\n pendingAction = historyAction;\n isUninterruptedRevalidation =\n (opts && opts.startUninterruptedRevalidation) === true;\n\n // Save the current scroll position every time we start a new navigation,\n // and track whether we should reset scroll on completion\n saveScrollPosition(state.location, state.matches);\n pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;\n\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let loadingNavigation = opts && opts.overrideNavigation;\n let matches = matchRoutes(routesToUse, location, basename);\n\n // Short circuit with a 404 on the root error boundary if we match nothing\n if (!matches) {\n let error = getInternalRouterError(404, { pathname: location.pathname });\n let { matches: notFoundMatches, route } =\n getShortCircuitMatches(routesToUse);\n // Cancel all pending deferred on 404s since we don't keep any routes\n cancelActiveDeferreds();\n completeNavigation(location, {\n matches: notFoundMatches,\n loaderData: {},\n errors: {\n [route.id]: error,\n },\n });\n return;\n }\n\n // Short circuit if it's only a hash change and not a revalidation or\n // mutation submission.\n //\n // Ignore on initial page loads because since the initial load will always\n // be \"same hash\". For example, on /page#hash and submit a \n // which will default to a navigation to /page\n if (\n state.initialized &&\n !isRevalidationRequired &&\n isHashChangeOnly(state.location, location) &&\n !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))\n ) {\n completeNavigation(location, { matches });\n return;\n }\n\n // Create a controller/Request for this navigation\n pendingNavigationController = new AbortController();\n let request = createClientSideRequest(\n init.history,\n location,\n pendingNavigationController.signal,\n opts && opts.submission\n );\n let pendingActionData: RouteData | undefined;\n let pendingError: RouteData | undefined;\n\n if (opts && opts.pendingError) {\n // If we have a pendingError, it means the user attempted a GET submission\n // with binary FormData so assign here and skip to handleLoaders. That\n // way we handle calling loaders above the boundary etc. It's not really\n // different from an actionError in that sense.\n pendingError = {\n [findNearestBoundary(matches).route.id]: opts.pendingError,\n };\n } else if (\n opts &&\n opts.submission &&\n isMutationMethod(opts.submission.formMethod)\n ) {\n // Call action if we received an action submission\n let actionOutput = await handleAction(\n request,\n location,\n opts.submission,\n matches,\n { replace: opts.replace }\n );\n\n if (actionOutput.shortCircuited) {\n return;\n }\n\n pendingActionData = actionOutput.pendingActionData;\n pendingError = actionOutput.pendingActionError;\n loadingNavigation = getLoadingNavigation(location, opts.submission);\n\n // Create a GET request for the loaders\n request = new Request(request.url, { signal: request.signal });\n }\n\n // Call loaders\n let { shortCircuited, loaderData, errors } = await handleLoaders(\n request,\n location,\n matches,\n loadingNavigation,\n opts && opts.submission,\n opts && opts.fetcherSubmission,\n opts && opts.replace,\n pendingActionData,\n pendingError\n );\n\n if (shortCircuited) {\n return;\n }\n\n // Clean up now that the action/loaders have completed. Don't clean up if\n // we short circuited because pendingNavigationController will have already\n // been assigned to a new controller for the next navigation\n pendingNavigationController = null;\n\n completeNavigation(location, {\n matches,\n ...(pendingActionData ? { actionData: pendingActionData } : {}),\n loaderData,\n errors,\n });\n }\n\n // Call the action matched by the leaf route for this navigation and handle\n // redirects/errors\n async function handleAction(\n request: Request,\n location: Location,\n submission: Submission,\n matches: AgnosticDataRouteMatch[],\n opts: { replace?: boolean } = {}\n ): Promise {\n interruptActiveLoads();\n\n // Put us in a submitting state\n let navigation = getSubmittingNavigation(location, submission);\n updateState({ navigation });\n\n // Call our action and get the result\n let result: DataResult;\n let actionMatch = getTargetMatch(matches, location);\n\n if (!actionMatch.route.action && !actionMatch.route.lazy) {\n result = {\n type: ResultType.error,\n error: getInternalRouterError(405, {\n method: request.method,\n pathname: location.pathname,\n routeId: actionMatch.route.id,\n }),\n };\n } else {\n result = await callLoaderOrAction(\n \"action\",\n request,\n actionMatch,\n matches,\n manifest,\n mapRouteProperties,\n basename\n );\n\n if (request.signal.aborted) {\n return { shortCircuited: true };\n }\n }\n\n if (isRedirectResult(result)) {\n let replace: boolean;\n if (opts && opts.replace != null) {\n replace = opts.replace;\n } else {\n // If the user didn't explicity indicate replace behavior, replace if\n // we redirected to the exact same location we're currently at to avoid\n // double back-buttons\n replace =\n result.location === state.location.pathname + state.location.search;\n }\n await startRedirectNavigation(state, result, { submission, replace });\n return { shortCircuited: true };\n }\n\n if (isErrorResult(result)) {\n // Store off the pending error - we use it to determine which loaders\n // to call and will commit it when we complete the navigation\n let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id);\n\n // By default, all submissions are REPLACE navigations, but if the\n // action threw an error that'll be rendered in an errorElement, we fall\n // back to PUSH so that the user can use the back button to get back to\n // the pre-submission form location to try again\n if ((opts && opts.replace) !== true) {\n pendingAction = HistoryAction.Push;\n }\n\n return {\n // Send back an empty object we can use to clear out any prior actionData\n pendingActionData: {},\n pendingActionError: { [boundaryMatch.route.id]: result.error },\n };\n }\n\n if (isDeferredResult(result)) {\n throw getInternalRouterError(400, { type: \"defer-action\" });\n }\n\n return {\n pendingActionData: { [actionMatch.route.id]: result.data },\n };\n }\n\n // Call all applicable loaders for the given matches, handling redirects,\n // errors, etc.\n async function handleLoaders(\n request: Request,\n location: Location,\n matches: AgnosticDataRouteMatch[],\n overrideNavigation?: Navigation,\n submission?: Submission,\n fetcherSubmission?: Submission,\n replace?: boolean,\n pendingActionData?: RouteData,\n pendingError?: RouteData\n ): Promise {\n // Figure out the right navigation we want to use for data loading\n let loadingNavigation =\n overrideNavigation || getLoadingNavigation(location, submission);\n\n // If this was a redirect from an action we don't have a \"submission\" but\n // we have it on the loading navigation so use that if available\n let activeSubmission =\n submission ||\n fetcherSubmission ||\n getSubmissionFromNavigation(loadingNavigation);\n\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(\n init.history,\n state,\n matches,\n activeSubmission,\n location,\n isRevalidationRequired,\n cancelledDeferredRoutes,\n cancelledFetcherLoads,\n fetchLoadMatches,\n fetchRedirectIds,\n routesToUse,\n basename,\n pendingActionData,\n pendingError\n );\n\n // Cancel pending deferreds for no-longer-matched routes or routes we're\n // about to reload. Note that if this is an action reload we would have\n // already cancelled all pending deferreds so this would be a no-op\n cancelActiveDeferreds(\n (routeId) =>\n !(matches && matches.some((m) => m.route.id === routeId)) ||\n (matchesToLoad && matchesToLoad.some((m) => m.route.id === routeId))\n );\n\n pendingNavigationLoadId = ++incrementingLoadId;\n\n // Short circuit if we have no loaders to run\n if (matchesToLoad.length === 0 && revalidatingFetchers.length === 0) {\n let updatedFetchers = markFetchRedirectsDone();\n completeNavigation(location, {\n matches,\n loaderData: {},\n // Commit pending error if we're short circuiting\n errors: pendingError || null,\n ...(pendingActionData ? { actionData: pendingActionData } : {}),\n ...(updatedFetchers ? { fetchers: new Map(state.fetchers) } : {}),\n });\n return { shortCircuited: true };\n }\n\n // If this is an uninterrupted revalidation, we remain in our current idle\n // state. If not, we need to switch to our loading state and load data,\n // preserving any new action data or existing action data (in the case of\n // a revalidation interrupting an actionReload)\n if (!isUninterruptedRevalidation) {\n revalidatingFetchers.forEach((rf) => {\n let fetcher = state.fetchers.get(rf.key);\n let revalidatingFetcher = getLoadingFetcher(\n undefined,\n fetcher ? fetcher.data : undefined\n );\n state.fetchers.set(rf.key, revalidatingFetcher);\n });\n let actionData = pendingActionData || state.actionData;\n updateState({\n navigation: loadingNavigation,\n ...(actionData\n ? Object.keys(actionData).length === 0\n ? { actionData: null }\n : { actionData }\n : {}),\n ...(revalidatingFetchers.length > 0\n ? { fetchers: new Map(state.fetchers) }\n : {}),\n });\n }\n\n revalidatingFetchers.forEach((rf) => {\n if (fetchControllers.has(rf.key)) {\n abortFetcher(rf.key);\n }\n if (rf.controller) {\n // Fetchers use an independent AbortController so that aborting a fetcher\n // (via deleteFetcher) does not abort the triggering navigation that\n // triggered the revalidation\n fetchControllers.set(rf.key, rf.controller);\n }\n });\n\n // Proxy navigation abort through to revalidation fetchers\n let abortPendingFetchRevalidations = () =>\n revalidatingFetchers.forEach((f) => abortFetcher(f.key));\n if (pendingNavigationController) {\n pendingNavigationController.signal.addEventListener(\n \"abort\",\n abortPendingFetchRevalidations\n );\n }\n\n let { results, loaderResults, fetcherResults } =\n await callLoadersAndMaybeResolveData(\n state.matches,\n matches,\n matchesToLoad,\n revalidatingFetchers,\n request\n );\n\n if (request.signal.aborted) {\n return { shortCircuited: true };\n }\n\n // Clean up _after_ loaders have completed. Don't clean up if we short\n // circuited because fetchControllers would have been aborted and\n // reassigned to new controllers for the next navigation\n if (pendingNavigationController) {\n pendingNavigationController.signal.removeEventListener(\n \"abort\",\n abortPendingFetchRevalidations\n );\n }\n revalidatingFetchers.forEach((rf) => fetchControllers.delete(rf.key));\n\n // If any loaders returned a redirect Response, start a new REPLACE navigation\n let redirect = findRedirect(results);\n if (redirect) {\n if (redirect.idx >= matchesToLoad.length) {\n // If this redirect came from a fetcher make sure we mark it in\n // fetchRedirectIds so it doesn't get revalidated on the next set of\n // loader executions\n let fetcherKey =\n revalidatingFetchers[redirect.idx - matchesToLoad.length].key;\n fetchRedirectIds.add(fetcherKey);\n }\n await startRedirectNavigation(state, redirect.result, { replace });\n return { shortCircuited: true };\n }\n\n // Process and commit output from loaders\n let { loaderData, errors } = processLoaderData(\n state,\n matches,\n matchesToLoad,\n loaderResults,\n pendingError,\n revalidatingFetchers,\n fetcherResults,\n activeDeferreds\n );\n\n // Wire up subscribers to update loaderData as promises settle\n activeDeferreds.forEach((deferredData, routeId) => {\n deferredData.subscribe((aborted) => {\n // Note: No need to updateState here since the TrackedPromise on\n // loaderData is stable across resolve/reject\n // Remove this instance if we were aborted or if promises have settled\n if (aborted || deferredData.done) {\n activeDeferreds.delete(routeId);\n }\n });\n });\n\n let updatedFetchers = markFetchRedirectsDone();\n let didAbortFetchLoads = abortStaleFetchLoads(pendingNavigationLoadId);\n let shouldUpdateFetchers =\n updatedFetchers || didAbortFetchLoads || revalidatingFetchers.length > 0;\n\n return {\n loaderData,\n errors,\n ...(shouldUpdateFetchers ? { fetchers: new Map(state.fetchers) } : {}),\n };\n }\n\n function getFetcher(key: string): Fetcher {\n return state.fetchers.get(key) || IDLE_FETCHER;\n }\n\n // Trigger a fetcher load/submit for the given fetcher key\n function fetch(\n key: string,\n routeId: string,\n href: string | null,\n opts?: RouterFetchOptions\n ) {\n if (isServer) {\n throw new Error(\n \"router.fetch() was called during the server render, but it shouldn't be. \" +\n \"You are likely calling a useFetcher() method in the body of your component. \" +\n \"Try moving it to a useEffect or a callback.\"\n );\n }\n\n if (fetchControllers.has(key)) abortFetcher(key);\n\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let normalizedPath = normalizeTo(\n state.location,\n state.matches,\n basename,\n future.v7_prependBasename,\n href,\n routeId,\n opts?.relative\n );\n let matches = matchRoutes(routesToUse, normalizedPath, basename);\n\n if (!matches) {\n setFetcherError(\n key,\n routeId,\n getInternalRouterError(404, { pathname: normalizedPath })\n );\n return;\n }\n\n let { path, submission, error } = normalizeNavigateOptions(\n future.v7_normalizeFormMethod,\n true,\n normalizedPath,\n opts\n );\n\n if (error) {\n setFetcherError(key, routeId, error);\n return;\n }\n\n let match = getTargetMatch(matches, path);\n\n pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;\n\n if (submission && isMutationMethod(submission.formMethod)) {\n handleFetcherAction(key, routeId, path, match, matches, submission);\n return;\n }\n\n // Store off the match so we can call it's shouldRevalidate on subsequent\n // revalidations\n fetchLoadMatches.set(key, { routeId, path });\n handleFetcherLoader(key, routeId, path, match, matches, submission);\n }\n\n // Call the action for the matched fetcher.submit(), and then handle redirects,\n // errors, and revalidation\n async function handleFetcherAction(\n key: string,\n routeId: string,\n path: string,\n match: AgnosticDataRouteMatch,\n requestMatches: AgnosticDataRouteMatch[],\n submission: Submission\n ) {\n interruptActiveLoads();\n fetchLoadMatches.delete(key);\n\n if (!match.route.action && !match.route.lazy) {\n let error = getInternalRouterError(405, {\n method: submission.formMethod,\n pathname: path,\n routeId: routeId,\n });\n setFetcherError(key, routeId, error);\n return;\n }\n\n // Put this fetcher into it's submitting state\n let existingFetcher = state.fetchers.get(key);\n let fetcher = getSubmittingFetcher(submission, existingFetcher);\n state.fetchers.set(key, fetcher);\n updateState({ fetchers: new Map(state.fetchers) });\n\n // Call the action for the fetcher\n let abortController = new AbortController();\n let fetchRequest = createClientSideRequest(\n init.history,\n path,\n abortController.signal,\n submission\n );\n fetchControllers.set(key, abortController);\n\n let originatingLoadId = incrementingLoadId;\n let actionResult = await callLoaderOrAction(\n \"action\",\n fetchRequest,\n match,\n requestMatches,\n manifest,\n mapRouteProperties,\n basename\n );\n\n if (fetchRequest.signal.aborted) {\n // We can delete this so long as we weren't aborted by ou our own fetcher\n // re-submit which would have put _new_ controller is in fetchControllers\n if (fetchControllers.get(key) === abortController) {\n fetchControllers.delete(key);\n }\n return;\n }\n\n if (isRedirectResult(actionResult)) {\n fetchControllers.delete(key);\n if (pendingNavigationLoadId > originatingLoadId) {\n // A new navigation was kicked off after our action started, so that\n // should take precedence over this redirect navigation. We already\n // set isRevalidationRequired so all loaders for the new route should\n // fire unless opted out via shouldRevalidate\n let doneFetcher = getDoneFetcher(undefined);\n state.fetchers.set(key, doneFetcher);\n updateState({ fetchers: new Map(state.fetchers) });\n return;\n } else {\n fetchRedirectIds.add(key);\n let loadingFetcher = getLoadingFetcher(submission);\n state.fetchers.set(key, loadingFetcher);\n updateState({ fetchers: new Map(state.fetchers) });\n\n return startRedirectNavigation(state, actionResult, {\n submission,\n isFetchActionRedirect: true,\n });\n }\n }\n\n // Process any non-redirect errors thrown\n if (isErrorResult(actionResult)) {\n setFetcherError(key, routeId, actionResult.error);\n return;\n }\n\n if (isDeferredResult(actionResult)) {\n throw getInternalRouterError(400, { type: \"defer-action\" });\n }\n\n // Start the data load for current matches, or the next location if we're\n // in the middle of a navigation\n let nextLocation = state.navigation.location || state.location;\n let revalidationRequest = createClientSideRequest(\n init.history,\n nextLocation,\n abortController.signal\n );\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let matches =\n state.navigation.state !== \"idle\"\n ? matchRoutes(routesToUse, state.navigation.location, basename)\n : state.matches;\n\n invariant(matches, \"Didn't find any matches after fetcher action\");\n\n let loadId = ++incrementingLoadId;\n fetchReloadIds.set(key, loadId);\n\n let loadFetcher = getLoadingFetcher(submission, actionResult.data);\n state.fetchers.set(key, loadFetcher);\n\n let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(\n init.history,\n state,\n matches,\n submission,\n nextLocation,\n isRevalidationRequired,\n cancelledDeferredRoutes,\n cancelledFetcherLoads,\n fetchLoadMatches,\n fetchRedirectIds,\n routesToUse,\n basename,\n { [match.route.id]: actionResult.data },\n undefined // No need to send through errors since we short circuit above\n );\n\n // Put all revalidating fetchers into the loading state, except for the\n // current fetcher which we want to keep in it's current loading state which\n // contains it's action submission info + action data\n revalidatingFetchers\n .filter((rf) => rf.key !== key)\n .forEach((rf) => {\n let staleKey = rf.key;\n let existingFetcher = state.fetchers.get(staleKey);\n let revalidatingFetcher = getLoadingFetcher(\n undefined,\n existingFetcher ? existingFetcher.data : undefined\n );\n state.fetchers.set(staleKey, revalidatingFetcher);\n if (fetchControllers.has(staleKey)) {\n abortFetcher(staleKey);\n }\n if (rf.controller) {\n fetchControllers.set(staleKey, rf.controller);\n }\n });\n\n updateState({ fetchers: new Map(state.fetchers) });\n\n let abortPendingFetchRevalidations = () =>\n revalidatingFetchers.forEach((rf) => abortFetcher(rf.key));\n\n abortController.signal.addEventListener(\n \"abort\",\n abortPendingFetchRevalidations\n );\n\n let { results, loaderResults, fetcherResults } =\n await callLoadersAndMaybeResolveData(\n state.matches,\n matches,\n matchesToLoad,\n revalidatingFetchers,\n revalidationRequest\n );\n\n if (abortController.signal.aborted) {\n return;\n }\n\n abortController.signal.removeEventListener(\n \"abort\",\n abortPendingFetchRevalidations\n );\n\n fetchReloadIds.delete(key);\n fetchControllers.delete(key);\n revalidatingFetchers.forEach((r) => fetchControllers.delete(r.key));\n\n let redirect = findRedirect(results);\n if (redirect) {\n if (redirect.idx >= matchesToLoad.length) {\n // If this redirect came from a fetcher make sure we mark it in\n // fetchRedirectIds so it doesn't get revalidated on the next set of\n // loader executions\n let fetcherKey =\n revalidatingFetchers[redirect.idx - matchesToLoad.length].key;\n fetchRedirectIds.add(fetcherKey);\n }\n return startRedirectNavigation(state, redirect.result);\n }\n\n // Process and commit output from loaders\n let { loaderData, errors } = processLoaderData(\n state,\n state.matches,\n matchesToLoad,\n loaderResults,\n undefined,\n revalidatingFetchers,\n fetcherResults,\n activeDeferreds\n );\n\n // Since we let revalidations complete even if the submitting fetcher was\n // deleted, only put it back to idle if it hasn't been deleted\n if (state.fetchers.has(key)) {\n let doneFetcher = getDoneFetcher(actionResult.data);\n state.fetchers.set(key, doneFetcher);\n }\n\n let didAbortFetchLoads = abortStaleFetchLoads(loadId);\n\n // If we are currently in a navigation loading state and this fetcher is\n // more recent than the navigation, we want the newer data so abort the\n // navigation and complete it with the fetcher data\n if (\n state.navigation.state === \"loading\" &&\n loadId > pendingNavigationLoadId\n ) {\n invariant(pendingAction, \"Expected pending action\");\n pendingNavigationController && pendingNavigationController.abort();\n\n completeNavigation(state.navigation.location, {\n matches,\n loaderData,\n errors,\n fetchers: new Map(state.fetchers),\n });\n } else {\n // otherwise just update with the fetcher data, preserving any existing\n // loaderData for loaders that did not need to reload. We have to\n // manually merge here since we aren't going through completeNavigation\n updateState({\n errors,\n loaderData: mergeLoaderData(\n state.loaderData,\n loaderData,\n matches,\n errors\n ),\n ...(didAbortFetchLoads || revalidatingFetchers.length > 0\n ? { fetchers: new Map(state.fetchers) }\n : {}),\n });\n isRevalidationRequired = false;\n }\n }\n\n // Call the matched loader for fetcher.load(), handling redirects, errors, etc.\n async function handleFetcherLoader(\n key: string,\n routeId: string,\n path: string,\n match: AgnosticDataRouteMatch,\n matches: AgnosticDataRouteMatch[],\n submission?: Submission\n ) {\n let existingFetcher = state.fetchers.get(key);\n // Put this fetcher into it's loading state\n let loadingFetcher = getLoadingFetcher(\n submission,\n existingFetcher ? existingFetcher.data : undefined\n );\n state.fetchers.set(key, loadingFetcher);\n updateState({ fetchers: new Map(state.fetchers) });\n\n // Call the loader for this fetcher route match\n let abortController = new AbortController();\n let fetchRequest = createClientSideRequest(\n init.history,\n path,\n abortController.signal\n );\n fetchControllers.set(key, abortController);\n\n let originatingLoadId = incrementingLoadId;\n let result: DataResult = await callLoaderOrAction(\n \"loader\",\n fetchRequest,\n match,\n matches,\n manifest,\n mapRouteProperties,\n basename\n );\n\n // Deferred isn't supported for fetcher loads, await everything and treat it\n // as a normal load. resolveDeferredData will return undefined if this\n // fetcher gets aborted, so we just leave result untouched and short circuit\n // below if that happens\n if (isDeferredResult(result)) {\n result =\n (await resolveDeferredData(result, fetchRequest.signal, true)) ||\n result;\n }\n\n // We can delete this so long as we weren't aborted by our our own fetcher\n // re-load which would have put _new_ controller is in fetchControllers\n if (fetchControllers.get(key) === abortController) {\n fetchControllers.delete(key);\n }\n\n if (fetchRequest.signal.aborted) {\n return;\n }\n\n // If the loader threw a redirect Response, start a new REPLACE navigation\n if (isRedirectResult(result)) {\n if (pendingNavigationLoadId > originatingLoadId) {\n // A new navigation was kicked off after our loader started, so that\n // should take precedence over this redirect navigation\n let doneFetcher = getDoneFetcher(undefined);\n state.fetchers.set(key, doneFetcher);\n updateState({ fetchers: new Map(state.fetchers) });\n return;\n } else {\n fetchRedirectIds.add(key);\n await startRedirectNavigation(state, result);\n return;\n }\n }\n\n // Process any non-redirect errors thrown\n if (isErrorResult(result)) {\n let boundaryMatch = findNearestBoundary(state.matches, routeId);\n state.fetchers.delete(key);\n // TODO: In remix, this would reset to IDLE_NAVIGATION if it was a catch -\n // do we need to behave any differently with our non-redirect errors?\n // What if it was a non-redirect Response?\n updateState({\n fetchers: new Map(state.fetchers),\n errors: {\n [boundaryMatch.route.id]: result.error,\n },\n });\n return;\n }\n\n invariant(!isDeferredResult(result), \"Unhandled fetcher deferred data\");\n\n // Put the fetcher back into an idle state\n let doneFetcher = getDoneFetcher(result.data);\n state.fetchers.set(key, doneFetcher);\n updateState({ fetchers: new Map(state.fetchers) });\n }\n\n /**\n * Utility function to handle redirects returned from an action or loader.\n * Normally, a redirect \"replaces\" the navigation that triggered it. So, for\n * example:\n *\n * - user is on /a\n * - user clicks a link to /b\n * - loader for /b redirects to /c\n *\n * In a non-JS app the browser would track the in-flight navigation to /b and\n * then replace it with /c when it encountered the redirect response. In\n * the end it would only ever update the URL bar with /c.\n *\n * In client-side routing using pushState/replaceState, we aim to emulate\n * this behavior and we also do not update history until the end of the\n * navigation (including processed redirects). This means that we never\n * actually touch history until we've processed redirects, so we just use\n * the history action from the original navigation (PUSH or REPLACE).\n */\n async function startRedirectNavigation(\n state: RouterState,\n redirect: RedirectResult,\n {\n submission,\n replace,\n isFetchActionRedirect,\n }: {\n submission?: Submission;\n replace?: boolean;\n isFetchActionRedirect?: boolean;\n } = {}\n ) {\n if (redirect.revalidate) {\n isRevalidationRequired = true;\n }\n\n let redirectLocation = createLocation(\n state.location,\n redirect.location,\n // TODO: This can be removed once we get rid of useTransition in Remix v2\n {\n _isRedirect: true,\n ...(isFetchActionRedirect ? { _isFetchActionRedirect: true } : {}),\n }\n );\n invariant(\n redirectLocation,\n \"Expected a location on the redirect navigation\"\n );\n // Check if this an absolute external redirect that goes to a new origin\n if (ABSOLUTE_URL_REGEX.test(redirect.location) && isBrowser) {\n let url = init.history.createURL(redirect.location);\n let isDifferentBasename = stripBasename(url.pathname, basename) == null;\n\n if (routerWindow.location.origin !== url.origin || isDifferentBasename) {\n if (replace) {\n routerWindow.location.replace(redirect.location);\n } else {\n routerWindow.location.assign(redirect.location);\n }\n return;\n }\n }\n\n // There's no need to abort on redirects, since we don't detect the\n // redirect until the action/loaders have settled\n pendingNavigationController = null;\n\n let redirectHistoryAction =\n replace === true ? HistoryAction.Replace : HistoryAction.Push;\n\n // Use the incoming submission if provided, fallback on the active one in\n // state.navigation\n let activeSubmission =\n submission || getSubmissionFromNavigation(state.navigation);\n\n // If this was a 307/308 submission we want to preserve the HTTP method and\n // re-submit the GET/POST/PUT/PATCH/DELETE as a submission navigation to the\n // redirected location\n if (\n redirectPreserveMethodStatusCodes.has(redirect.status) &&\n activeSubmission &&\n isMutationMethod(activeSubmission.formMethod)\n ) {\n await startNavigation(redirectHistoryAction, redirectLocation, {\n submission: {\n ...activeSubmission,\n formAction: redirect.location,\n },\n // Preserve this flag across redirects\n preventScrollReset: pendingPreventScrollReset,\n });\n } else if (isFetchActionRedirect) {\n // For a fetch action redirect, we kick off a new loading navigation\n // without the fetcher submission, but we send it along for shouldRevalidate\n await startNavigation(redirectHistoryAction, redirectLocation, {\n overrideNavigation: getLoadingNavigation(redirectLocation),\n fetcherSubmission: activeSubmission,\n // Preserve this flag across redirects\n preventScrollReset: pendingPreventScrollReset,\n });\n } else {\n // If we have a submission, we will preserve it through the redirect navigation\n let overrideNavigation = getLoadingNavigation(\n redirectLocation,\n activeSubmission\n );\n await startNavigation(redirectHistoryAction, redirectLocation, {\n overrideNavigation,\n // Preserve this flag across redirects\n preventScrollReset: pendingPreventScrollReset,\n });\n }\n }\n\n async function callLoadersAndMaybeResolveData(\n currentMatches: AgnosticDataRouteMatch[],\n matches: AgnosticDataRouteMatch[],\n matchesToLoad: AgnosticDataRouteMatch[],\n fetchersToLoad: RevalidatingFetcher[],\n request: Request\n ) {\n // Call all navigation loaders and revalidating fetcher loaders in parallel,\n // then slice off the results into separate arrays so we can handle them\n // accordingly\n let results = await Promise.all([\n ...matchesToLoad.map((match) =>\n callLoaderOrAction(\n \"loader\",\n request,\n match,\n matches,\n manifest,\n mapRouteProperties,\n basename\n )\n ),\n ...fetchersToLoad.map((f) => {\n if (f.matches && f.match && f.controller) {\n return callLoaderOrAction(\n \"loader\",\n createClientSideRequest(init.history, f.path, f.controller.signal),\n f.match,\n f.matches,\n manifest,\n mapRouteProperties,\n basename\n );\n } else {\n let error: ErrorResult = {\n type: ResultType.error,\n error: getInternalRouterError(404, { pathname: f.path }),\n };\n return error;\n }\n }),\n ]);\n let loaderResults = results.slice(0, matchesToLoad.length);\n let fetcherResults = results.slice(matchesToLoad.length);\n\n await Promise.all([\n resolveDeferredResults(\n currentMatches,\n matchesToLoad,\n loaderResults,\n loaderResults.map(() => request.signal),\n false,\n state.loaderData\n ),\n resolveDeferredResults(\n currentMatches,\n fetchersToLoad.map((f) => f.match),\n fetcherResults,\n fetchersToLoad.map((f) => (f.controller ? f.controller.signal : null)),\n true\n ),\n ]);\n\n return { results, loaderResults, fetcherResults };\n }\n\n function interruptActiveLoads() {\n // Every interruption triggers a revalidation\n isRevalidationRequired = true;\n\n // Cancel pending route-level deferreds and mark cancelled routes for\n // revalidation\n cancelledDeferredRoutes.push(...cancelActiveDeferreds());\n\n // Abort in-flight fetcher loads\n fetchLoadMatches.forEach((_, key) => {\n if (fetchControllers.has(key)) {\n cancelledFetcherLoads.push(key);\n abortFetcher(key);\n }\n });\n }\n\n function setFetcherError(key: string, routeId: string, error: any) {\n let boundaryMatch = findNearestBoundary(state.matches, routeId);\n deleteFetcher(key);\n updateState({\n errors: {\n [boundaryMatch.route.id]: error,\n },\n fetchers: new Map(state.fetchers),\n });\n }\n\n function deleteFetcher(key: string): void {\n let fetcher = state.fetchers.get(key);\n // Don't abort the controller if this is a deletion of a fetcher.submit()\n // in it's loading phase since - we don't want to abort the corresponding\n // revalidation and want them to complete and land\n if (\n fetchControllers.has(key) &&\n !(fetcher && fetcher.state === \"loading\" && fetchReloadIds.has(key))\n ) {\n abortFetcher(key);\n }\n fetchLoadMatches.delete(key);\n fetchReloadIds.delete(key);\n fetchRedirectIds.delete(key);\n state.fetchers.delete(key);\n }\n\n function abortFetcher(key: string) {\n let controller = fetchControllers.get(key);\n invariant(controller, `Expected fetch controller: ${key}`);\n controller.abort();\n fetchControllers.delete(key);\n }\n\n function markFetchersDone(keys: string[]) {\n for (let key of keys) {\n let fetcher = getFetcher(key);\n let doneFetcher = getDoneFetcher(fetcher.data);\n state.fetchers.set(key, doneFetcher);\n }\n }\n\n function markFetchRedirectsDone(): boolean {\n let doneKeys = [];\n let updatedFetchers = false;\n for (let key of fetchRedirectIds) {\n let fetcher = state.fetchers.get(key);\n invariant(fetcher, `Expected fetcher: ${key}`);\n if (fetcher.state === \"loading\") {\n fetchRedirectIds.delete(key);\n doneKeys.push(key);\n updatedFetchers = true;\n }\n }\n markFetchersDone(doneKeys);\n return updatedFetchers;\n }\n\n function abortStaleFetchLoads(landedId: number): boolean {\n let yeetedKeys = [];\n for (let [key, id] of fetchReloadIds) {\n if (id < landedId) {\n let fetcher = state.fetchers.get(key);\n invariant(fetcher, `Expected fetcher: ${key}`);\n if (fetcher.state === \"loading\") {\n abortFetcher(key);\n fetchReloadIds.delete(key);\n yeetedKeys.push(key);\n }\n }\n }\n markFetchersDone(yeetedKeys);\n return yeetedKeys.length > 0;\n }\n\n function getBlocker(key: string, fn: BlockerFunction) {\n let blocker: Blocker = state.blockers.get(key) || IDLE_BLOCKER;\n\n if (blockerFunctions.get(key) !== fn) {\n blockerFunctions.set(key, fn);\n }\n\n return blocker;\n }\n\n function deleteBlocker(key: string) {\n state.blockers.delete(key);\n blockerFunctions.delete(key);\n }\n\n // Utility function to update blockers, ensuring valid state transitions\n function updateBlocker(key: string, newBlocker: Blocker) {\n let blocker = state.blockers.get(key) || IDLE_BLOCKER;\n\n // Poor mans state machine :)\n // https://mermaid.live/edit#pako:eNqVkc9OwzAMxl8l8nnjAYrEtDIOHEBIgwvKJTReGy3_lDpIqO27k6awMG0XcrLlnz87nwdonESogKXXBuE79rq75XZO3-yHds0RJVuv70YrPlUrCEe2HfrORS3rubqZfuhtpg5C9wk5tZ4VKcRUq88q9Z8RS0-48cE1iHJkL0ugbHuFLus9L6spZy8nX9MP2CNdomVaposqu3fGayT8T8-jJQwhepo_UtpgBQaDEUom04dZhAN1aJBDlUKJBxE1ceB2Smj0Mln-IBW5AFU2dwUiktt_2Qaq2dBfaKdEup85UV7Yd-dKjlnkabl2Pvr0DTkTreM\n invariant(\n (blocker.state === \"unblocked\" && newBlocker.state === \"blocked\") ||\n (blocker.state === \"blocked\" && newBlocker.state === \"blocked\") ||\n (blocker.state === \"blocked\" && newBlocker.state === \"proceeding\") ||\n (blocker.state === \"blocked\" && newBlocker.state === \"unblocked\") ||\n (blocker.state === \"proceeding\" && newBlocker.state === \"unblocked\"),\n `Invalid blocker state transition: ${blocker.state} -> ${newBlocker.state}`\n );\n\n let blockers = new Map(state.blockers);\n blockers.set(key, newBlocker);\n updateState({ blockers });\n }\n\n function shouldBlockNavigation({\n currentLocation,\n nextLocation,\n historyAction,\n }: {\n currentLocation: Location;\n nextLocation: Location;\n historyAction: HistoryAction;\n }): string | undefined {\n if (blockerFunctions.size === 0) {\n return;\n }\n\n // We ony support a single active blocker at the moment since we don't have\n // any compelling use cases for multi-blocker yet\n if (blockerFunctions.size > 1) {\n warning(false, \"A router only supports one blocker at a time\");\n }\n\n let entries = Array.from(blockerFunctions.entries());\n let [blockerKey, blockerFunction] = entries[entries.length - 1];\n let blocker = state.blockers.get(blockerKey);\n\n if (blocker && blocker.state === \"proceeding\") {\n // If the blocker is currently proceeding, we don't need to re-check\n // it and can let this navigation continue\n return;\n }\n\n // At this point, we know we're unblocked/blocked so we need to check the\n // user-provided blocker function\n if (blockerFunction({ currentLocation, nextLocation, historyAction })) {\n return blockerKey;\n }\n }\n\n function cancelActiveDeferreds(\n predicate?: (routeId: string) => boolean\n ): string[] {\n let cancelledRouteIds: string[] = [];\n activeDeferreds.forEach((dfd, routeId) => {\n if (!predicate || predicate(routeId)) {\n // Cancel the deferred - but do not remove from activeDeferreds here -\n // we rely on the subscribers to do that so our tests can assert proper\n // cleanup via _internalActiveDeferreds\n dfd.cancel();\n cancelledRouteIds.push(routeId);\n activeDeferreds.delete(routeId);\n }\n });\n return cancelledRouteIds;\n }\n\n // Opt in to capturing and reporting scroll positions during navigations,\n // used by the component\n function enableScrollRestoration(\n positions: Record,\n getPosition: GetScrollPositionFunction,\n getKey?: GetScrollRestorationKeyFunction\n ) {\n savedScrollPositions = positions;\n getScrollPosition = getPosition;\n getScrollRestorationKey = getKey || null;\n\n // Perform initial hydration scroll restoration, since we miss the boat on\n // the initial updateState() because we've not yet rendered \n // and therefore have no savedScrollPositions available\n if (!initialScrollRestored && state.navigation === IDLE_NAVIGATION) {\n initialScrollRestored = true;\n let y = getSavedScrollPosition(state.location, state.matches);\n if (y != null) {\n updateState({ restoreScrollPosition: y });\n }\n }\n\n return () => {\n savedScrollPositions = null;\n getScrollPosition = null;\n getScrollRestorationKey = null;\n };\n }\n\n function getScrollKey(location: Location, matches: AgnosticDataRouteMatch[]) {\n if (getScrollRestorationKey) {\n let key = getScrollRestorationKey(\n location,\n matches.map((m) => createUseMatchesMatch(m, state.loaderData))\n );\n return key || location.key;\n }\n return location.key;\n }\n\n function saveScrollPosition(\n location: Location,\n matches: AgnosticDataRouteMatch[]\n ): void {\n if (savedScrollPositions && getScrollPosition) {\n let key = getScrollKey(location, matches);\n savedScrollPositions[key] = getScrollPosition();\n }\n }\n\n function getSavedScrollPosition(\n location: Location,\n matches: AgnosticDataRouteMatch[]\n ): number | null {\n if (savedScrollPositions) {\n let key = getScrollKey(location, matches);\n let y = savedScrollPositions[key];\n if (typeof y === \"number\") {\n return y;\n }\n }\n return null;\n }\n\n function _internalSetRoutes(newRoutes: AgnosticDataRouteObject[]) {\n manifest = {};\n inFlightDataRoutes = convertRoutesToDataRoutes(\n newRoutes,\n mapRouteProperties,\n undefined,\n manifest\n );\n }\n\n router = {\n get basename() {\n return basename;\n },\n get state() {\n return state;\n },\n get routes() {\n return dataRoutes;\n },\n initialize,\n subscribe,\n enableScrollRestoration,\n navigate,\n fetch,\n revalidate,\n // Passthrough to history-aware createHref used by useHref so we get proper\n // hash-aware URLs in DOM paths\n createHref: (to: To) => init.history.createHref(to),\n encodeLocation: (to: To) => init.history.encodeLocation(to),\n getFetcher,\n deleteFetcher,\n dispose,\n getBlocker,\n deleteBlocker,\n _internalFetchControllers: fetchControllers,\n _internalActiveDeferreds: activeDeferreds,\n // TODO: Remove setRoutes, it's temporary to avoid dealing with\n // updating the tree while validating the update algorithm.\n _internalSetRoutes,\n };\n\n return router;\n}\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region createStaticHandler\n////////////////////////////////////////////////////////////////////////////////\n\nexport const UNSAFE_DEFERRED_SYMBOL = Symbol(\"deferred\");\n\nexport interface CreateStaticHandlerOptions {\n basename?: string;\n /**\n * @deprecated Use `mapRouteProperties` instead\n */\n detectErrorBoundary?: DetectErrorBoundaryFunction;\n mapRouteProperties?: MapRoutePropertiesFunction;\n}\n\nexport function createStaticHandler(\n routes: AgnosticRouteObject[],\n opts?: CreateStaticHandlerOptions\n): StaticHandler {\n invariant(\n routes.length > 0,\n \"You must provide a non-empty routes array to createStaticHandler\"\n );\n\n let manifest: RouteManifest = {};\n let basename = (opts ? opts.basename : null) || \"/\";\n let mapRouteProperties: MapRoutePropertiesFunction;\n if (opts?.mapRouteProperties) {\n mapRouteProperties = opts.mapRouteProperties;\n } else if (opts?.detectErrorBoundary) {\n // If they are still using the deprecated version, wrap it with the new API\n let detectErrorBoundary = opts.detectErrorBoundary;\n mapRouteProperties = (route) => ({\n hasErrorBoundary: detectErrorBoundary(route),\n });\n } else {\n mapRouteProperties = defaultMapRouteProperties;\n }\n\n let dataRoutes = convertRoutesToDataRoutes(\n routes,\n mapRouteProperties,\n undefined,\n manifest\n );\n\n /**\n * The query() method is intended for document requests, in which we want to\n * call an optional action and potentially multiple loaders for all nested\n * routes. It returns a StaticHandlerContext object, which is very similar\n * to the router state (location, loaderData, actionData, errors, etc.) and\n * also adds SSR-specific information such as the statusCode and headers\n * from action/loaders Responses.\n *\n * It _should_ never throw and should report all errors through the\n * returned context.errors object, properly associating errors to their error\n * boundary. Additionally, it tracks _deepestRenderedBoundaryId which can be\n * used to emulate React error boundaries during SSr by performing a second\n * pass only down to the boundaryId.\n *\n * The one exception where we do not return a StaticHandlerContext is when a\n * redirect response is returned or thrown from any action/loader. We\n * propagate that out and return the raw Response so the HTTP server can\n * return it directly.\n */\n async function query(\n request: Request,\n { requestContext }: { requestContext?: unknown } = {}\n ): Promise {\n let url = new URL(request.url);\n let method = request.method;\n let location = createLocation(\"\", createPath(url), null, \"default\");\n let matches = matchRoutes(dataRoutes, location, basename);\n\n // SSR supports HEAD requests while SPA doesn't\n if (!isValidMethod(method) && method !== \"HEAD\") {\n let error = getInternalRouterError(405, { method });\n let { matches: methodNotAllowedMatches, route } =\n getShortCircuitMatches(dataRoutes);\n return {\n basename,\n location,\n matches: methodNotAllowedMatches,\n loaderData: {},\n actionData: null,\n errors: {\n [route.id]: error,\n },\n statusCode: error.status,\n loaderHeaders: {},\n actionHeaders: {},\n activeDeferreds: null,\n };\n } else if (!matches) {\n let error = getInternalRouterError(404, { pathname: location.pathname });\n let { matches: notFoundMatches, route } =\n getShortCircuitMatches(dataRoutes);\n return {\n basename,\n location,\n matches: notFoundMatches,\n loaderData: {},\n actionData: null,\n errors: {\n [route.id]: error,\n },\n statusCode: error.status,\n loaderHeaders: {},\n actionHeaders: {},\n activeDeferreds: null,\n };\n }\n\n let result = await queryImpl(request, location, matches, requestContext);\n if (isResponse(result)) {\n return result;\n }\n\n // When returning StaticHandlerContext, we patch back in the location here\n // since we need it for React Context. But this helps keep our submit and\n // loadRouteData operating on a Request instead of a Location\n return { location, basename, ...result };\n }\n\n /**\n * The queryRoute() method is intended for targeted route requests, either\n * for fetch ?_data requests or resource route requests. In this case, we\n * are only ever calling a single action or loader, and we are returning the\n * returned value directly. In most cases, this will be a Response returned\n * from the action/loader, but it may be a primitive or other value as well -\n * and in such cases the calling context should handle that accordingly.\n *\n * We do respect the throw/return differentiation, so if an action/loader\n * throws, then this method will throw the value. This is important so we\n * can do proper boundary identification in Remix where a thrown Response\n * must go to the Catch Boundary but a returned Response is happy-path.\n *\n * One thing to note is that any Router-initiated Errors that make sense\n * to associate with a status code will be thrown as an ErrorResponse\n * instance which include the raw Error, such that the calling context can\n * serialize the error as they see fit while including the proper response\n * code. Examples here are 404 and 405 errors that occur prior to reaching\n * any user-defined loaders.\n */\n async function queryRoute(\n request: Request,\n {\n routeId,\n requestContext,\n }: { requestContext?: unknown; routeId?: string } = {}\n ): Promise {\n let url = new URL(request.url);\n let method = request.method;\n let location = createLocation(\"\", createPath(url), null, \"default\");\n let matches = matchRoutes(dataRoutes, location, basename);\n\n // SSR supports HEAD requests while SPA doesn't\n if (!isValidMethod(method) && method !== \"HEAD\" && method !== \"OPTIONS\") {\n throw getInternalRouterError(405, { method });\n } else if (!matches) {\n throw getInternalRouterError(404, { pathname: location.pathname });\n }\n\n let match = routeId\n ? matches.find((m) => m.route.id === routeId)\n : getTargetMatch(matches, location);\n\n if (routeId && !match) {\n throw getInternalRouterError(403, {\n pathname: location.pathname,\n routeId,\n });\n } else if (!match) {\n // This should never hit I don't think?\n throw getInternalRouterError(404, { pathname: location.pathname });\n }\n\n let result = await queryImpl(\n request,\n location,\n matches,\n requestContext,\n match\n );\n if (isResponse(result)) {\n return result;\n }\n\n let error = result.errors ? Object.values(result.errors)[0] : undefined;\n if (error !== undefined) {\n // If we got back result.errors, that means the loader/action threw\n // _something_ that wasn't a Response, but it's not guaranteed/required\n // to be an `instanceof Error` either, so we have to use throw here to\n // preserve the \"error\" state outside of queryImpl.\n throw error;\n }\n\n // Pick off the right state value to return\n if (result.actionData) {\n return Object.values(result.actionData)[0];\n }\n\n if (result.loaderData) {\n let data = Object.values(result.loaderData)[0];\n if (result.activeDeferreds?.[match.route.id]) {\n data[UNSAFE_DEFERRED_SYMBOL] = result.activeDeferreds[match.route.id];\n }\n return data;\n }\n\n return undefined;\n }\n\n async function queryImpl(\n request: Request,\n location: Location,\n matches: AgnosticDataRouteMatch[],\n requestContext: unknown,\n routeMatch?: AgnosticDataRouteMatch\n ): Promise | Response> {\n invariant(\n request.signal,\n \"query()/queryRoute() requests must contain an AbortController signal\"\n );\n\n try {\n if (isMutationMethod(request.method.toLowerCase())) {\n let result = await submit(\n request,\n matches,\n routeMatch || getTargetMatch(matches, location),\n requestContext,\n routeMatch != null\n );\n return result;\n }\n\n let result = await loadRouteData(\n request,\n matches,\n requestContext,\n routeMatch\n );\n return isResponse(result)\n ? result\n : {\n ...result,\n actionData: null,\n actionHeaders: {},\n };\n } catch (e) {\n // If the user threw/returned a Response in callLoaderOrAction, we throw\n // it to bail out and then return or throw here based on whether the user\n // returned or threw\n if (isQueryRouteResponse(e)) {\n if (e.type === ResultType.error && !isRedirectResponse(e.response)) {\n throw e.response;\n }\n return e.response;\n }\n // Redirects are always returned since they don't propagate to catch\n // boundaries\n if (isRedirectResponse(e)) {\n return e;\n }\n throw e;\n }\n }\n\n async function submit(\n request: Request,\n matches: AgnosticDataRouteMatch[],\n actionMatch: AgnosticDataRouteMatch,\n requestContext: unknown,\n isRouteRequest: boolean\n ): Promise | Response> {\n let result: DataResult;\n\n if (!actionMatch.route.action && !actionMatch.route.lazy) {\n let error = getInternalRouterError(405, {\n method: request.method,\n pathname: new URL(request.url).pathname,\n routeId: actionMatch.route.id,\n });\n if (isRouteRequest) {\n throw error;\n }\n result = {\n type: ResultType.error,\n error,\n };\n } else {\n result = await callLoaderOrAction(\n \"action\",\n request,\n actionMatch,\n matches,\n manifest,\n mapRouteProperties,\n basename,\n { isStaticRequest: true, isRouteRequest, requestContext }\n );\n\n if (request.signal.aborted) {\n let method = isRouteRequest ? \"queryRoute\" : \"query\";\n throw new Error(`${method}() call aborted`);\n }\n }\n\n if (isRedirectResult(result)) {\n // Uhhhh - this should never happen, we should always throw these from\n // callLoaderOrAction, but the type narrowing here keeps TS happy and we\n // can get back on the \"throw all redirect responses\" train here should\n // this ever happen :/\n throw new Response(null, {\n status: result.status,\n headers: {\n Location: result.location,\n },\n });\n }\n\n if (isDeferredResult(result)) {\n let error = getInternalRouterError(400, { type: \"defer-action\" });\n if (isRouteRequest) {\n throw error;\n }\n result = {\n type: ResultType.error,\n error,\n };\n }\n\n if (isRouteRequest) {\n // Note: This should only be non-Response values if we get here, since\n // isRouteRequest should throw any Response received in callLoaderOrAction\n if (isErrorResult(result)) {\n throw result.error;\n }\n\n return {\n matches: [actionMatch],\n loaderData: {},\n actionData: { [actionMatch.route.id]: result.data },\n errors: null,\n // Note: statusCode + headers are unused here since queryRoute will\n // return the raw Response or value\n statusCode: 200,\n loaderHeaders: {},\n actionHeaders: {},\n activeDeferreds: null,\n };\n }\n\n if (isErrorResult(result)) {\n // Store off the pending error - we use it to determine which loaders\n // to call and will commit it when we complete the navigation\n let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id);\n let context = await loadRouteData(\n request,\n matches,\n requestContext,\n undefined,\n {\n [boundaryMatch.route.id]: result.error,\n }\n );\n\n // action status codes take precedence over loader status codes\n return {\n ...context,\n statusCode: isRouteErrorResponse(result.error)\n ? result.error.status\n : 500,\n actionData: null,\n actionHeaders: {\n ...(result.headers ? { [actionMatch.route.id]: result.headers } : {}),\n },\n };\n }\n\n // Create a GET request for the loaders\n let loaderRequest = new Request(request.url, {\n headers: request.headers,\n redirect: request.redirect,\n signal: request.signal,\n });\n let context = await loadRouteData(loaderRequest, matches, requestContext);\n\n return {\n ...context,\n // action status codes take precedence over loader status codes\n ...(result.statusCode ? { statusCode: result.statusCode } : {}),\n actionData: {\n [actionMatch.route.id]: result.data,\n },\n actionHeaders: {\n ...(result.headers ? { [actionMatch.route.id]: result.headers } : {}),\n },\n };\n }\n\n async function loadRouteData(\n request: Request,\n matches: AgnosticDataRouteMatch[],\n requestContext: unknown,\n routeMatch?: AgnosticDataRouteMatch,\n pendingActionError?: RouteData\n ): Promise<\n | Omit<\n StaticHandlerContext,\n \"location\" | \"basename\" | \"actionData\" | \"actionHeaders\"\n >\n | Response\n > {\n let isRouteRequest = routeMatch != null;\n\n // Short circuit if we have no loaders to run (queryRoute())\n if (\n isRouteRequest &&\n !routeMatch?.route.loader &&\n !routeMatch?.route.lazy\n ) {\n throw getInternalRouterError(400, {\n method: request.method,\n pathname: new URL(request.url).pathname,\n routeId: routeMatch?.route.id,\n });\n }\n\n let requestMatches = routeMatch\n ? [routeMatch]\n : getLoaderMatchesUntilBoundary(\n matches,\n Object.keys(pendingActionError || {})[0]\n );\n let matchesToLoad = requestMatches.filter(\n (m) => m.route.loader || m.route.lazy\n );\n\n // Short circuit if we have no loaders to run (query())\n if (matchesToLoad.length === 0) {\n return {\n matches,\n // Add a null for all matched routes for proper revalidation on the client\n loaderData: matches.reduce(\n (acc, m) => Object.assign(acc, { [m.route.id]: null }),\n {}\n ),\n errors: pendingActionError || null,\n statusCode: 200,\n loaderHeaders: {},\n activeDeferreds: null,\n };\n }\n\n let results = await Promise.all([\n ...matchesToLoad.map((match) =>\n callLoaderOrAction(\n \"loader\",\n request,\n match,\n matches,\n manifest,\n mapRouteProperties,\n basename,\n { isStaticRequest: true, isRouteRequest, requestContext }\n )\n ),\n ]);\n\n if (request.signal.aborted) {\n let method = isRouteRequest ? \"queryRoute\" : \"query\";\n throw new Error(`${method}() call aborted`);\n }\n\n // Process and commit output from loaders\n let activeDeferreds = new Map();\n let context = processRouteLoaderData(\n matches,\n matchesToLoad,\n results,\n pendingActionError,\n activeDeferreds\n );\n\n // Add a null for any non-loader matches for proper revalidation on the client\n let executedLoaders = new Set(\n matchesToLoad.map((match) => match.route.id)\n );\n matches.forEach((match) => {\n if (!executedLoaders.has(match.route.id)) {\n context.loaderData[match.route.id] = null;\n }\n });\n\n return {\n ...context,\n matches,\n activeDeferreds:\n activeDeferreds.size > 0\n ? Object.fromEntries(activeDeferreds.entries())\n : null,\n };\n }\n\n return {\n dataRoutes,\n query,\n queryRoute,\n };\n}\n\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Helpers\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Given an existing StaticHandlerContext and an error thrown at render time,\n * provide an updated StaticHandlerContext suitable for a second SSR render\n */\nexport function getStaticContextFromError(\n routes: AgnosticDataRouteObject[],\n context: StaticHandlerContext,\n error: any\n) {\n let newContext: StaticHandlerContext = {\n ...context,\n statusCode: 500,\n errors: {\n [context._deepestRenderedBoundaryId || routes[0].id]: error,\n },\n };\n return newContext;\n}\n\nfunction isSubmissionNavigation(\n opts: RouterNavigateOptions\n): opts is SubmissionNavigateOptions {\n return (\n opts != null &&\n ((\"formData\" in opts && opts.formData != null) ||\n (\"body\" in opts && opts.body !== undefined))\n );\n}\n\nfunction normalizeTo(\n location: Path,\n matches: AgnosticDataRouteMatch[],\n basename: string,\n prependBasename: boolean,\n to: To | null,\n fromRouteId?: string,\n relative?: RelativeRoutingType\n) {\n let contextualMatches: AgnosticDataRouteMatch[];\n let activeRouteMatch: AgnosticDataRouteMatch | undefined;\n if (fromRouteId != null && relative !== \"path\") {\n // Grab matches up to the calling route so our route-relative logic is\n // relative to the correct source route. When using relative:path,\n // fromRouteId is ignored since that is always relative to the current\n // location path\n contextualMatches = [];\n for (let match of matches) {\n contextualMatches.push(match);\n if (match.route.id === fromRouteId) {\n activeRouteMatch = match;\n break;\n }\n }\n } else {\n contextualMatches = matches;\n activeRouteMatch = matches[matches.length - 1];\n }\n\n // Resolve the relative path\n let path = resolveTo(\n to ? to : \".\",\n getPathContributingMatches(contextualMatches).map((m) => m.pathnameBase),\n stripBasename(location.pathname, basename) || location.pathname,\n relative === \"path\"\n );\n\n // When `to` is not specified we inherit search/hash from the current\n // location, unlike when to=\".\" and we just inherit the path.\n // See https://github.com/remix-run/remix/issues/927\n if (to == null) {\n path.search = location.search;\n path.hash = location.hash;\n }\n\n // Add an ?index param for matched index routes if we don't already have one\n if (\n (to == null || to === \"\" || to === \".\") &&\n activeRouteMatch &&\n activeRouteMatch.route.index &&\n !hasNakedIndexQuery(path.search)\n ) {\n path.search = path.search\n ? path.search.replace(/^\\?/, \"?index&\")\n : \"?index\";\n }\n\n // If we're operating within a basename, prepend it to the pathname. If\n // this is a root navigation, then just use the raw basename which allows\n // the basename to have full control over the presence of a trailing slash\n // on root actions\n if (prependBasename && basename !== \"/\") {\n path.pathname =\n path.pathname === \"/\" ? basename : joinPaths([basename, path.pathname]);\n }\n\n return createPath(path);\n}\n\n// Normalize navigation options by converting formMethod=GET formData objects to\n// URLSearchParams so they behave identically to links with query params\nfunction normalizeNavigateOptions(\n normalizeFormMethod: boolean,\n isFetcher: boolean,\n path: string,\n opts?: RouterNavigateOptions\n): {\n path: string;\n submission?: Submission;\n error?: ErrorResponse;\n} {\n // Return location verbatim on non-submission navigations\n if (!opts || !isSubmissionNavigation(opts)) {\n return { path };\n }\n\n if (opts.formMethod && !isValidMethod(opts.formMethod)) {\n return {\n path,\n error: getInternalRouterError(405, { method: opts.formMethod }),\n };\n }\n\n let getInvalidBodyError = () => ({\n path,\n error: getInternalRouterError(400, { type: \"invalid-body\" }),\n });\n\n // Create a Submission on non-GET navigations\n let rawFormMethod = opts.formMethod || \"get\";\n let formMethod = normalizeFormMethod\n ? (rawFormMethod.toUpperCase() as V7_FormMethod)\n : (rawFormMethod.toLowerCase() as FormMethod);\n let formAction = stripHashFromPath(path);\n\n if (opts.body !== undefined) {\n if (opts.formEncType === \"text/plain\") {\n // text only support POST/PUT/PATCH/DELETE submissions\n if (!isMutationMethod(formMethod)) {\n return getInvalidBodyError();\n }\n\n let text =\n typeof opts.body === \"string\"\n ? opts.body\n : opts.body instanceof FormData ||\n opts.body instanceof URLSearchParams\n ? // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#plain-text-form-data\n Array.from(opts.body.entries()).reduce(\n (acc, [name, value]) => `${acc}${name}=${value}\\n`,\n \"\"\n )\n : String(opts.body);\n\n return {\n path,\n submission: {\n formMethod,\n formAction,\n formEncType: opts.formEncType,\n formData: undefined,\n json: undefined,\n text,\n },\n };\n } else if (opts.formEncType === \"application/json\") {\n // json only supports POST/PUT/PATCH/DELETE submissions\n if (!isMutationMethod(formMethod)) {\n return getInvalidBodyError();\n }\n\n try {\n let json =\n typeof opts.body === \"string\" ? JSON.parse(opts.body) : opts.body;\n\n return {\n path,\n submission: {\n formMethod,\n formAction,\n formEncType: opts.formEncType,\n formData: undefined,\n json,\n text: undefined,\n },\n };\n } catch (e) {\n return getInvalidBodyError();\n }\n }\n }\n\n invariant(\n typeof FormData === \"function\",\n \"FormData is not available in this environment\"\n );\n\n let searchParams: URLSearchParams;\n let formData: FormData;\n\n if (opts.formData) {\n searchParams = convertFormDataToSearchParams(opts.formData);\n formData = opts.formData;\n } else if (opts.body instanceof FormData) {\n searchParams = convertFormDataToSearchParams(opts.body);\n formData = opts.body;\n } else if (opts.body instanceof URLSearchParams) {\n searchParams = opts.body;\n formData = convertSearchParamsToFormData(searchParams);\n } else if (opts.body == null) {\n searchParams = new URLSearchParams();\n formData = new FormData();\n } else {\n try {\n searchParams = new URLSearchParams(opts.body);\n formData = convertSearchParamsToFormData(searchParams);\n } catch (e) {\n return getInvalidBodyError();\n }\n }\n\n let submission: Submission = {\n formMethod,\n formAction,\n formEncType:\n (opts && opts.formEncType) || \"application/x-www-form-urlencoded\",\n formData,\n json: undefined,\n text: undefined,\n };\n\n if (isMutationMethod(submission.formMethod)) {\n return { path, submission };\n }\n\n // Flatten submission onto URLSearchParams for GET submissions\n let parsedPath = parsePath(path);\n // On GET navigation submissions we can drop the ?index param from the\n // resulting location since all loaders will run. But fetcher GET submissions\n // only run a single loader so we need to preserve any incoming ?index params\n if (isFetcher && parsedPath.search && hasNakedIndexQuery(parsedPath.search)) {\n searchParams.append(\"index\", \"\");\n }\n parsedPath.search = `?${searchParams}`;\n\n return { path: createPath(parsedPath), submission };\n}\n\n// Filter out all routes below any caught error as they aren't going to\n// render so we don't need to load them\nfunction getLoaderMatchesUntilBoundary(\n matches: AgnosticDataRouteMatch[],\n boundaryId?: string\n) {\n let boundaryMatches = matches;\n if (boundaryId) {\n let index = matches.findIndex((m) => m.route.id === boundaryId);\n if (index >= 0) {\n boundaryMatches = matches.slice(0, index);\n }\n }\n return boundaryMatches;\n}\n\nfunction getMatchesToLoad(\n history: History,\n state: RouterState,\n matches: AgnosticDataRouteMatch[],\n submission: Submission | undefined,\n location: Location,\n isRevalidationRequired: boolean,\n cancelledDeferredRoutes: string[],\n cancelledFetcherLoads: string[],\n fetchLoadMatches: Map,\n fetchRedirectIds: Set,\n routesToUse: AgnosticDataRouteObject[],\n basename: string | undefined,\n pendingActionData?: RouteData,\n pendingError?: RouteData\n): [AgnosticDataRouteMatch[], RevalidatingFetcher[]] {\n let actionResult = pendingError\n ? Object.values(pendingError)[0]\n : pendingActionData\n ? Object.values(pendingActionData)[0]\n : undefined;\n\n let currentUrl = history.createURL(state.location);\n let nextUrl = history.createURL(location);\n\n // Pick navigation matches that are net-new or qualify for revalidation\n let boundaryId = pendingError ? Object.keys(pendingError)[0] : undefined;\n let boundaryMatches = getLoaderMatchesUntilBoundary(matches, boundaryId);\n\n let navigationMatches = boundaryMatches.filter((match, index) => {\n if (match.route.lazy) {\n // We haven't loaded this route yet so we don't know if it's got a loader!\n return true;\n }\n if (match.route.loader == null) {\n return false;\n }\n\n // Always call the loader on new route instances and pending defer cancellations\n if (\n isNewLoader(state.loaderData, state.matches[index], match) ||\n cancelledDeferredRoutes.some((id) => id === match.route.id)\n ) {\n return true;\n }\n\n // This is the default implementation for when we revalidate. If the route\n // provides it's own implementation, then we give them full control but\n // provide this value so they can leverage it if needed after they check\n // their own specific use cases\n let currentRouteMatch = state.matches[index];\n let nextRouteMatch = match;\n\n return shouldRevalidateLoader(match, {\n currentUrl,\n currentParams: currentRouteMatch.params,\n nextUrl,\n nextParams: nextRouteMatch.params,\n ...submission,\n actionResult,\n defaultShouldRevalidate:\n // Forced revalidation due to submission, useRevalidator, or X-Remix-Revalidate\n isRevalidationRequired ||\n // Clicked the same link, resubmitted a GET form\n currentUrl.pathname + currentUrl.search ===\n nextUrl.pathname + nextUrl.search ||\n // Search params affect all loaders\n currentUrl.search !== nextUrl.search ||\n isNewRouteInstance(currentRouteMatch, nextRouteMatch),\n });\n });\n\n // Pick fetcher.loads that need to be revalidated\n let revalidatingFetchers: RevalidatingFetcher[] = [];\n fetchLoadMatches.forEach((f, key) => {\n // Don't revalidate if fetcher won't be present in the subsequent render\n if (!matches.some((m) => m.route.id === f.routeId)) {\n return;\n }\n\n let fetcherMatches = matchRoutes(routesToUse, f.path, basename);\n\n // If the fetcher path no longer matches, push it in with null matches so\n // we can trigger a 404 in callLoadersAndMaybeResolveData. Note this is\n // currently only a use-case for Remix HMR where the route tree can change\n // at runtime and remove a route previously loaded via a fetcher\n if (!fetcherMatches) {\n revalidatingFetchers.push({\n key,\n routeId: f.routeId,\n path: f.path,\n matches: null,\n match: null,\n controller: null,\n });\n return;\n }\n\n // Revalidating fetchers are decoupled from the route matches since they\n // load from a static href. They revalidate based on explicit revalidation\n // (submission, useRevalidator, or X-Remix-Revalidate)\n let fetcher = state.fetchers.get(key);\n let fetcherMatch = getTargetMatch(fetcherMatches, f.path);\n\n let shouldRevalidate = false;\n if (fetchRedirectIds.has(key)) {\n // Never trigger a revalidation of an actively redirecting fetcher\n shouldRevalidate = false;\n } else if (cancelledFetcherLoads.includes(key)) {\n // Always revalidate if the fetcher was cancelled\n shouldRevalidate = true;\n } else if (\n fetcher &&\n fetcher.state !== \"idle\" &&\n fetcher.data === undefined\n ) {\n // If the fetcher hasn't ever completed loading yet, then this isn't a\n // revalidation, it would just be a brand new load if an explicit\n // revalidation is required\n shouldRevalidate = isRevalidationRequired;\n } else {\n // Otherwise fall back on any user-defined shouldRevalidate, defaulting\n // to explicit revalidations only\n shouldRevalidate = shouldRevalidateLoader(fetcherMatch, {\n currentUrl,\n currentParams: state.matches[state.matches.length - 1].params,\n nextUrl,\n nextParams: matches[matches.length - 1].params,\n ...submission,\n actionResult,\n defaultShouldRevalidate: isRevalidationRequired,\n });\n }\n\n if (shouldRevalidate) {\n revalidatingFetchers.push({\n key,\n routeId: f.routeId,\n path: f.path,\n matches: fetcherMatches,\n match: fetcherMatch,\n controller: new AbortController(),\n });\n }\n });\n\n return [navigationMatches, revalidatingFetchers];\n}\n\nfunction isNewLoader(\n currentLoaderData: RouteData,\n currentMatch: AgnosticDataRouteMatch,\n match: AgnosticDataRouteMatch\n) {\n let isNew =\n // [a] -> [a, b]\n !currentMatch ||\n // [a, b] -> [a, c]\n match.route.id !== currentMatch.route.id;\n\n // Handle the case that we don't have data for a re-used route, potentially\n // from a prior error or from a cancelled pending deferred\n let isMissingData = currentLoaderData[match.route.id] === undefined;\n\n // Always load if this is a net-new route or we don't yet have data\n return isNew || isMissingData;\n}\n\nfunction isNewRouteInstance(\n currentMatch: AgnosticDataRouteMatch,\n match: AgnosticDataRouteMatch\n) {\n let currentPath = currentMatch.route.path;\n return (\n // param change for this match, /users/123 -> /users/456\n currentMatch.pathname !== match.pathname ||\n // splat param changed, which is not present in match.path\n // e.g. /files/images/avatar.jpg -> files/finances.xls\n (currentPath != null &&\n currentPath.endsWith(\"*\") &&\n currentMatch.params[\"*\"] !== match.params[\"*\"])\n );\n}\n\nfunction shouldRevalidateLoader(\n loaderMatch: AgnosticDataRouteMatch,\n arg: Parameters[0]\n) {\n if (loaderMatch.route.shouldRevalidate) {\n let routeChoice = loaderMatch.route.shouldRevalidate(arg);\n if (typeof routeChoice === \"boolean\") {\n return routeChoice;\n }\n }\n\n return arg.defaultShouldRevalidate;\n}\n\n/**\n * Execute route.lazy() methods to lazily load route modules (loader, action,\n * shouldRevalidate) and update the routeManifest in place which shares objects\n * with dataRoutes so those get updated as well.\n */\nasync function loadLazyRouteModule(\n route: AgnosticDataRouteObject,\n mapRouteProperties: MapRoutePropertiesFunction,\n manifest: RouteManifest\n) {\n if (!route.lazy) {\n return;\n }\n\n let lazyRoute = await route.lazy();\n\n // If the lazy route function was executed and removed by another parallel\n // call then we can return - first lazy() to finish wins because the return\n // value of lazy is expected to be static\n if (!route.lazy) {\n return;\n }\n\n let routeToUpdate = manifest[route.id];\n invariant(routeToUpdate, \"No route found in manifest\");\n\n // Update the route in place. This should be safe because there's no way\n // we could yet be sitting on this route as we can't get there without\n // resolving lazy() first.\n //\n // This is different than the HMR \"update\" use-case where we may actively be\n // on the route being updated. The main concern boils down to \"does this\n // mutation affect any ongoing navigations or any current state.matches\n // values?\". If not, it should be safe to update in place.\n let routeUpdates: Record = {};\n for (let lazyRouteProperty in lazyRoute) {\n let staticRouteValue =\n routeToUpdate[lazyRouteProperty as keyof typeof routeToUpdate];\n\n let isPropertyStaticallyDefined =\n staticRouteValue !== undefined &&\n // This property isn't static since it should always be updated based\n // on the route updates\n lazyRouteProperty !== \"hasErrorBoundary\";\n\n warning(\n !isPropertyStaticallyDefined,\n `Route \"${routeToUpdate.id}\" has a static property \"${lazyRouteProperty}\" ` +\n `defined but its lazy function is also returning a value for this property. ` +\n `The lazy route property \"${lazyRouteProperty}\" will be ignored.`\n );\n\n if (\n !isPropertyStaticallyDefined &&\n !immutableRouteKeys.has(lazyRouteProperty as ImmutableRouteKey)\n ) {\n routeUpdates[lazyRouteProperty] =\n lazyRoute[lazyRouteProperty as keyof typeof lazyRoute];\n }\n }\n\n // Mutate the route with the provided updates. Do this first so we pass\n // the updated version to mapRouteProperties\n Object.assign(routeToUpdate, routeUpdates);\n\n // Mutate the `hasErrorBoundary` property on the route based on the route\n // updates and remove the `lazy` function so we don't resolve the lazy\n // route again.\n Object.assign(routeToUpdate, {\n // To keep things framework agnostic, we use the provided\n // `mapRouteProperties` (or wrapped `detectErrorBoundary`) function to\n // set the framework-aware properties (`element`/`hasErrorBoundary`) since\n // the logic will differ between frameworks.\n ...mapRouteProperties(routeToUpdate),\n lazy: undefined,\n });\n}\n\nasync function callLoaderOrAction(\n type: \"loader\" | \"action\",\n request: Request,\n match: AgnosticDataRouteMatch,\n matches: AgnosticDataRouteMatch[],\n manifest: RouteManifest,\n mapRouteProperties: MapRoutePropertiesFunction,\n basename: string,\n opts: {\n isStaticRequest?: boolean;\n isRouteRequest?: boolean;\n requestContext?: unknown;\n } = {}\n): Promise {\n let resultType;\n let result;\n let onReject: (() => void) | undefined;\n\n let runHandler = (handler: ActionFunction | LoaderFunction) => {\n // Setup a promise we can race against so that abort signals short circuit\n let reject: () => void;\n let abortPromise = new Promise((_, r) => (reject = r));\n onReject = () => reject();\n request.signal.addEventListener(\"abort\", onReject);\n return Promise.race([\n handler({\n request,\n params: match.params,\n context: opts.requestContext,\n }),\n abortPromise,\n ]);\n };\n\n try {\n let handler = match.route[type];\n\n if (match.route.lazy) {\n if (handler) {\n // Run statically defined handler in parallel with lazy()\n let values = await Promise.all([\n runHandler(handler),\n loadLazyRouteModule(match.route, mapRouteProperties, manifest),\n ]);\n result = values[0];\n } else {\n // Load lazy route module, then run any returned handler\n await loadLazyRouteModule(match.route, mapRouteProperties, manifest);\n\n handler = match.route[type];\n if (handler) {\n // Handler still run even if we got interrupted to maintain consistency\n // with un-abortable behavior of handler execution on non-lazy or\n // previously-lazy-loaded routes\n result = await runHandler(handler);\n } else if (type === \"action\") {\n let url = new URL(request.url);\n let pathname = url.pathname + url.search;\n throw getInternalRouterError(405, {\n method: request.method,\n pathname,\n routeId: match.route.id,\n });\n } else {\n // lazy() route has no loader to run. Short circuit here so we don't\n // hit the invariant below that errors on returning undefined.\n return { type: ResultType.data, data: undefined };\n }\n }\n } else if (!handler) {\n let url = new URL(request.url);\n let pathname = url.pathname + url.search;\n throw getInternalRouterError(404, {\n pathname,\n });\n } else {\n result = await runHandler(handler);\n }\n\n invariant(\n result !== undefined,\n `You defined ${type === \"action\" ? \"an action\" : \"a loader\"} for route ` +\n `\"${match.route.id}\" but didn't return anything from your \\`${type}\\` ` +\n `function. Please return a value or \\`null\\`.`\n );\n } catch (e) {\n resultType = ResultType.error;\n result = e;\n } finally {\n if (onReject) {\n request.signal.removeEventListener(\"abort\", onReject);\n }\n }\n\n if (isResponse(result)) {\n let status = result.status;\n\n // Process redirects\n if (redirectStatusCodes.has(status)) {\n let location = result.headers.get(\"Location\");\n invariant(\n location,\n \"Redirects returned/thrown from loaders/actions must have a Location header\"\n );\n\n // Support relative routing in internal redirects\n if (!ABSOLUTE_URL_REGEX.test(location)) {\n location = normalizeTo(\n new URL(request.url),\n matches.slice(0, matches.indexOf(match) + 1),\n basename,\n true,\n location\n );\n } else if (!opts.isStaticRequest) {\n // Strip off the protocol+origin for same-origin + same-basename absolute\n // redirects. If this is a static request, we can let it go back to the\n // browser as-is\n let currentUrl = new URL(request.url);\n let url = location.startsWith(\"//\")\n ? new URL(currentUrl.protocol + location)\n : new URL(location);\n let isSameBasename = stripBasename(url.pathname, basename) != null;\n if (url.origin === currentUrl.origin && isSameBasename) {\n location = url.pathname + url.search + url.hash;\n }\n }\n\n // Don't process redirects in the router during static requests requests.\n // Instead, throw the Response and let the server handle it with an HTTP\n // redirect. We also update the Location header in place in this flow so\n // basename and relative routing is taken into account\n if (opts.isStaticRequest) {\n result.headers.set(\"Location\", location);\n throw result;\n }\n\n return {\n type: ResultType.redirect,\n status,\n location,\n revalidate: result.headers.get(\"X-Remix-Revalidate\") !== null,\n };\n }\n\n // For SSR single-route requests, we want to hand Responses back directly\n // without unwrapping. We do this with the QueryRouteResponse wrapper\n // interface so we can know whether it was returned or thrown\n if (opts.isRouteRequest) {\n // eslint-disable-next-line no-throw-literal\n throw {\n type: resultType || ResultType.data,\n response: result,\n };\n }\n\n let data: any;\n let contentType = result.headers.get(\"Content-Type\");\n // Check between word boundaries instead of startsWith() due to the last\n // paragraph of https://httpwg.org/specs/rfc9110.html#field.content-type\n if (contentType && /\\bapplication\\/json\\b/.test(contentType)) {\n data = await result.json();\n } else {\n data = await result.text();\n }\n\n if (resultType === ResultType.error) {\n return {\n type: resultType,\n error: new ErrorResponse(status, result.statusText, data),\n headers: result.headers,\n };\n }\n\n return {\n type: ResultType.data,\n data,\n statusCode: result.status,\n headers: result.headers,\n };\n }\n\n if (resultType === ResultType.error) {\n return { type: resultType, error: result };\n }\n\n if (isDeferredData(result)) {\n return {\n type: ResultType.deferred,\n deferredData: result,\n statusCode: result.init?.status,\n headers: result.init?.headers && new Headers(result.init.headers),\n };\n }\n\n return { type: ResultType.data, data: result };\n}\n\n// Utility method for creating the Request instances for loaders/actions during\n// client-side navigations and fetches. During SSR we will always have a\n// Request instance from the static handler (query/queryRoute)\nfunction createClientSideRequest(\n history: History,\n location: string | Location,\n signal: AbortSignal,\n submission?: Submission\n): Request {\n let url = history.createURL(stripHashFromPath(location)).toString();\n let init: RequestInit = { signal };\n\n if (submission && isMutationMethod(submission.formMethod)) {\n let { formMethod, formEncType } = submission;\n // Didn't think we needed this but it turns out unlike other methods, patch\n // won't be properly normalized to uppercase and results in a 405 error.\n // See: https://fetch.spec.whatwg.org/#concept-method\n init.method = formMethod.toUpperCase();\n\n if (formEncType === \"application/json\") {\n init.headers = new Headers({ \"Content-Type\": formEncType });\n init.body = JSON.stringify(submission.json);\n } else if (formEncType === \"text/plain\") {\n // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request)\n init.body = submission.text;\n } else if (\n formEncType === \"application/x-www-form-urlencoded\" &&\n submission.formData\n ) {\n // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request)\n init.body = convertFormDataToSearchParams(submission.formData);\n } else {\n // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request)\n init.body = submission.formData;\n }\n }\n\n return new Request(url, init);\n}\n\nfunction convertFormDataToSearchParams(formData: FormData): URLSearchParams {\n let searchParams = new URLSearchParams();\n\n for (let [key, value] of formData.entries()) {\n // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#converting-an-entry-list-to-a-list-of-name-value-pairs\n searchParams.append(key, typeof value === \"string\" ? value : value.name);\n }\n\n return searchParams;\n}\n\nfunction convertSearchParamsToFormData(\n searchParams: URLSearchParams\n): FormData {\n let formData = new FormData();\n for (let [key, value] of searchParams.entries()) {\n formData.append(key, value);\n }\n return formData;\n}\n\nfunction processRouteLoaderData(\n matches: AgnosticDataRouteMatch[],\n matchesToLoad: AgnosticDataRouteMatch[],\n results: DataResult[],\n pendingError: RouteData | undefined,\n activeDeferreds: Map\n): {\n loaderData: RouterState[\"loaderData\"];\n errors: RouterState[\"errors\"] | null;\n statusCode: number;\n loaderHeaders: Record;\n} {\n // Fill in loaderData/errors from our loaders\n let loaderData: RouterState[\"loaderData\"] = {};\n let errors: RouterState[\"errors\"] | null = null;\n let statusCode: number | undefined;\n let foundError = false;\n let loaderHeaders: Record = {};\n\n // Process loader results into state.loaderData/state.errors\n results.forEach((result, index) => {\n let id = matchesToLoad[index].route.id;\n invariant(\n !isRedirectResult(result),\n \"Cannot handle redirect results in processLoaderData\"\n );\n if (isErrorResult(result)) {\n // Look upwards from the matched route for the closest ancestor\n // error boundary, defaulting to the root match\n let boundaryMatch = findNearestBoundary(matches, id);\n let error = result.error;\n // If we have a pending action error, we report it at the highest-route\n // that throws a loader error, and then clear it out to indicate that\n // it was consumed\n if (pendingError) {\n error = Object.values(pendingError)[0];\n pendingError = undefined;\n }\n\n errors = errors || {};\n\n // Prefer higher error values if lower errors bubble to the same boundary\n if (errors[boundaryMatch.route.id] == null) {\n errors[boundaryMatch.route.id] = error;\n }\n\n // Clear our any prior loaderData for the throwing route\n loaderData[id] = undefined;\n\n // Once we find our first (highest) error, we set the status code and\n // prevent deeper status codes from overriding\n if (!foundError) {\n foundError = true;\n statusCode = isRouteErrorResponse(result.error)\n ? result.error.status\n : 500;\n }\n if (result.headers) {\n loaderHeaders[id] = result.headers;\n }\n } else {\n if (isDeferredResult(result)) {\n activeDeferreds.set(id, result.deferredData);\n loaderData[id] = result.deferredData.data;\n } else {\n loaderData[id] = result.data;\n }\n\n // Error status codes always override success status codes, but if all\n // loaders are successful we take the deepest status code.\n if (\n result.statusCode != null &&\n result.statusCode !== 200 &&\n !foundError\n ) {\n statusCode = result.statusCode;\n }\n if (result.headers) {\n loaderHeaders[id] = result.headers;\n }\n }\n });\n\n // If we didn't consume the pending action error (i.e., all loaders\n // resolved), then consume it here. Also clear out any loaderData for the\n // throwing route\n if (pendingError) {\n errors = pendingError;\n loaderData[Object.keys(pendingError)[0]] = undefined;\n }\n\n return {\n loaderData,\n errors,\n statusCode: statusCode || 200,\n loaderHeaders,\n };\n}\n\nfunction processLoaderData(\n state: RouterState,\n matches: AgnosticDataRouteMatch[],\n matchesToLoad: AgnosticDataRouteMatch[],\n results: DataResult[],\n pendingError: RouteData | undefined,\n revalidatingFetchers: RevalidatingFetcher[],\n fetcherResults: DataResult[],\n activeDeferreds: Map\n): {\n loaderData: RouterState[\"loaderData\"];\n errors?: RouterState[\"errors\"];\n} {\n let { loaderData, errors } = processRouteLoaderData(\n matches,\n matchesToLoad,\n results,\n pendingError,\n activeDeferreds\n );\n\n // Process results from our revalidating fetchers\n for (let index = 0; index < revalidatingFetchers.length; index++) {\n let { key, match, controller } = revalidatingFetchers[index];\n invariant(\n fetcherResults !== undefined && fetcherResults[index] !== undefined,\n \"Did not find corresponding fetcher result\"\n );\n let result = fetcherResults[index];\n\n // Process fetcher non-redirect errors\n if (controller && controller.signal.aborted) {\n // Nothing to do for aborted fetchers\n continue;\n } else if (isErrorResult(result)) {\n let boundaryMatch = findNearestBoundary(state.matches, match?.route.id);\n if (!(errors && errors[boundaryMatch.route.id])) {\n errors = {\n ...errors,\n [boundaryMatch.route.id]: result.error,\n };\n }\n state.fetchers.delete(key);\n } else if (isRedirectResult(result)) {\n // Should never get here, redirects should get processed above, but we\n // keep this to type narrow to a success result in the else\n invariant(false, \"Unhandled fetcher revalidation redirect\");\n } else if (isDeferredResult(result)) {\n // Should never get here, deferred data should be awaited for fetchers\n // in resolveDeferredResults\n invariant(false, \"Unhandled fetcher deferred data\");\n } else {\n let doneFetcher = getDoneFetcher(result.data);\n state.fetchers.set(key, doneFetcher);\n }\n }\n\n return { loaderData, errors };\n}\n\nfunction mergeLoaderData(\n loaderData: RouteData,\n newLoaderData: RouteData,\n matches: AgnosticDataRouteMatch[],\n errors: RouteData | null | undefined\n): RouteData {\n let mergedLoaderData = { ...newLoaderData };\n for (let match of matches) {\n let id = match.route.id;\n if (newLoaderData.hasOwnProperty(id)) {\n if (newLoaderData[id] !== undefined) {\n mergedLoaderData[id] = newLoaderData[id];\n } else {\n // No-op - this is so we ignore existing data if we have a key in the\n // incoming object with an undefined value, which is how we unset a prior\n // loaderData if we encounter a loader error\n }\n } else if (loaderData[id] !== undefined && match.route.loader) {\n // Preserve existing keys not included in newLoaderData and where a loader\n // wasn't removed by HMR\n mergedLoaderData[id] = loaderData[id];\n }\n\n if (errors && errors.hasOwnProperty(id)) {\n // Don't keep any loader data below the boundary\n break;\n }\n }\n return mergedLoaderData;\n}\n\n// Find the nearest error boundary, looking upwards from the leaf route (or the\n// route specified by routeId) for the closest ancestor error boundary,\n// defaulting to the root match\nfunction findNearestBoundary(\n matches: AgnosticDataRouteMatch[],\n routeId?: string\n): AgnosticDataRouteMatch {\n let eligibleMatches = routeId\n ? matches.slice(0, matches.findIndex((m) => m.route.id === routeId) + 1)\n : [...matches];\n return (\n eligibleMatches.reverse().find((m) => m.route.hasErrorBoundary === true) ||\n matches[0]\n );\n}\n\nfunction getShortCircuitMatches(routes: AgnosticDataRouteObject[]): {\n matches: AgnosticDataRouteMatch[];\n route: AgnosticDataRouteObject;\n} {\n // Prefer a root layout route if present, otherwise shim in a route object\n let route = routes.find((r) => r.index || !r.path || r.path === \"/\") || {\n id: `__shim-error-route__`,\n };\n\n return {\n matches: [\n {\n params: {},\n pathname: \"\",\n pathnameBase: \"\",\n route,\n },\n ],\n route,\n };\n}\n\nfunction getInternalRouterError(\n status: number,\n {\n pathname,\n routeId,\n method,\n type,\n }: {\n pathname?: string;\n routeId?: string;\n method?: string;\n type?: \"defer-action\" | \"invalid-body\";\n } = {}\n) {\n let statusText = \"Unknown Server Error\";\n let errorMessage = \"Unknown @remix-run/router error\";\n\n if (status === 400) {\n statusText = \"Bad Request\";\n if (method && pathname && routeId) {\n errorMessage =\n `You made a ${method} request to \"${pathname}\" but ` +\n `did not provide a \\`loader\\` for route \"${routeId}\", ` +\n `so there is no way to handle the request.`;\n } else if (type === \"defer-action\") {\n errorMessage = \"defer() is not supported in actions\";\n } else if (type === \"invalid-body\") {\n errorMessage = \"Unable to encode submission body\";\n }\n } else if (status === 403) {\n statusText = \"Forbidden\";\n errorMessage = `Route \"${routeId}\" does not match URL \"${pathname}\"`;\n } else if (status === 404) {\n statusText = \"Not Found\";\n errorMessage = `No route matches URL \"${pathname}\"`;\n } else if (status === 405) {\n statusText = \"Method Not Allowed\";\n if (method && pathname && routeId) {\n errorMessage =\n `You made a ${method.toUpperCase()} request to \"${pathname}\" but ` +\n `did not provide an \\`action\\` for route \"${routeId}\", ` +\n `so there is no way to handle the request.`;\n } else if (method) {\n errorMessage = `Invalid request method \"${method.toUpperCase()}\"`;\n }\n }\n\n return new ErrorResponse(\n status || 500,\n statusText,\n new Error(errorMessage),\n true\n );\n}\n\n// Find any returned redirect errors, starting from the lowest match\nfunction findRedirect(\n results: DataResult[]\n): { result: RedirectResult; idx: number } | undefined {\n for (let i = results.length - 1; i >= 0; i--) {\n let result = results[i];\n if (isRedirectResult(result)) {\n return { result, idx: i };\n }\n }\n}\n\nfunction stripHashFromPath(path: To) {\n let parsedPath = typeof path === \"string\" ? parsePath(path) : path;\n return createPath({ ...parsedPath, hash: \"\" });\n}\n\nfunction isHashChangeOnly(a: Location, b: Location): boolean {\n if (a.pathname !== b.pathname || a.search !== b.search) {\n return false;\n }\n\n if (a.hash === \"\") {\n // /page -> /page#hash\n return b.hash !== \"\";\n } else if (a.hash === b.hash) {\n // /page#hash -> /page#hash\n return true;\n } else if (b.hash !== \"\") {\n // /page#hash -> /page#other\n return true;\n }\n\n // If the hash is removed the browser will re-perform a request to the server\n // /page#hash -> /page\n return false;\n}\n\nfunction isDeferredResult(result: DataResult): result is DeferredResult {\n return result.type === ResultType.deferred;\n}\n\nfunction isErrorResult(result: DataResult): result is ErrorResult {\n return result.type === ResultType.error;\n}\n\nfunction isRedirectResult(result?: DataResult): result is RedirectResult {\n return (result && result.type) === ResultType.redirect;\n}\n\nexport function isDeferredData(value: any): value is DeferredData {\n let deferred: DeferredData = value;\n return (\n deferred &&\n typeof deferred === \"object\" &&\n typeof deferred.data === \"object\" &&\n typeof deferred.subscribe === \"function\" &&\n typeof deferred.cancel === \"function\" &&\n typeof deferred.resolveData === \"function\"\n );\n}\n\nfunction isResponse(value: any): value is Response {\n return (\n value != null &&\n typeof value.status === \"number\" &&\n typeof value.statusText === \"string\" &&\n typeof value.headers === \"object\" &&\n typeof value.body !== \"undefined\"\n );\n}\n\nfunction isRedirectResponse(result: any): result is Response {\n if (!isResponse(result)) {\n return false;\n }\n\n let status = result.status;\n let location = result.headers.get(\"Location\");\n return status >= 300 && status <= 399 && location != null;\n}\n\nfunction isQueryRouteResponse(obj: any): obj is QueryRouteResponse {\n return (\n obj &&\n isResponse(obj.response) &&\n (obj.type === ResultType.data || ResultType.error)\n );\n}\n\nfunction isValidMethod(method: string): method is FormMethod | V7_FormMethod {\n return validRequestMethods.has(method.toLowerCase() as FormMethod);\n}\n\nfunction isMutationMethod(\n method: string\n): method is MutationFormMethod | V7_MutationFormMethod {\n return validMutationMethods.has(method.toLowerCase() as MutationFormMethod);\n}\n\nasync function resolveDeferredResults(\n currentMatches: AgnosticDataRouteMatch[],\n matchesToLoad: (AgnosticDataRouteMatch | null)[],\n results: DataResult[],\n signals: (AbortSignal | null)[],\n isFetcher: boolean,\n currentLoaderData?: RouteData\n) {\n for (let index = 0; index < results.length; index++) {\n let result = results[index];\n let match = matchesToLoad[index];\n // If we don't have a match, then we can have a deferred result to do\n // anything with. This is for revalidating fetchers where the route was\n // removed during HMR\n if (!match) {\n continue;\n }\n\n let currentMatch = currentMatches.find(\n (m) => m.route.id === match!.route.id\n );\n let isRevalidatingLoader =\n currentMatch != null &&\n !isNewRouteInstance(currentMatch, match) &&\n (currentLoaderData && currentLoaderData[match.route.id]) !== undefined;\n\n if (isDeferredResult(result) && (isFetcher || isRevalidatingLoader)) {\n // Note: we do not have to touch activeDeferreds here since we race them\n // against the signal in resolveDeferredData and they'll get aborted\n // there if needed\n let signal = signals[index];\n invariant(\n signal,\n \"Expected an AbortSignal for revalidating fetcher deferred result\"\n );\n await resolveDeferredData(result, signal, isFetcher).then((result) => {\n if (result) {\n results[index] = result || results[index];\n }\n });\n }\n }\n}\n\nasync function resolveDeferredData(\n result: DeferredResult,\n signal: AbortSignal,\n unwrap = false\n): Promise {\n let aborted = await result.deferredData.resolveData(signal);\n if (aborted) {\n return;\n }\n\n if (unwrap) {\n try {\n return {\n type: ResultType.data,\n data: result.deferredData.unwrappedData,\n };\n } catch (e) {\n // Handle any TrackedPromise._error values encountered while unwrapping\n return {\n type: ResultType.error,\n error: e,\n };\n }\n }\n\n return {\n type: ResultType.data,\n data: result.deferredData.data,\n };\n}\n\nfunction hasNakedIndexQuery(search: string): boolean {\n return new URLSearchParams(search).getAll(\"index\").some((v) => v === \"\");\n}\n\n// Note: This should match the format exported by useMatches, so if you change\n// this please also change that :) Eventually we'll DRY this up\nfunction createUseMatchesMatch(\n match: AgnosticDataRouteMatch,\n loaderData: RouteData\n): UseMatchesMatch {\n let { route, pathname, params } = match;\n return {\n id: route.id,\n pathname,\n params,\n data: loaderData[route.id] as unknown,\n handle: route.handle as unknown,\n };\n}\n\nfunction getTargetMatch(\n matches: AgnosticDataRouteMatch[],\n location: Location | string\n) {\n let search =\n typeof location === \"string\" ? parsePath(location).search : location.search;\n if (\n matches[matches.length - 1].route.index &&\n hasNakedIndexQuery(search || \"\")\n ) {\n // Return the leaf index route when index is present\n return matches[matches.length - 1];\n }\n // Otherwise grab the deepest \"path contributing\" match (ignoring index and\n // pathless layout routes)\n let pathMatches = getPathContributingMatches(matches);\n return pathMatches[pathMatches.length - 1];\n}\n\nfunction getSubmissionFromNavigation(\n navigation: Navigation\n): Submission | undefined {\n let { formMethod, formAction, formEncType, text, formData, json } =\n navigation;\n if (!formMethod || !formAction || !formEncType) {\n return;\n }\n\n if (text != null) {\n return {\n formMethod,\n formAction,\n formEncType,\n formData: undefined,\n json: undefined,\n text,\n };\n } else if (formData != null) {\n return {\n formMethod,\n formAction,\n formEncType,\n formData,\n json: undefined,\n text: undefined,\n };\n } else if (json !== undefined) {\n return {\n formMethod,\n formAction,\n formEncType,\n formData: undefined,\n json,\n text: undefined,\n };\n }\n}\n\nfunction getLoadingNavigation(\n location: Location,\n submission?: Submission\n): NavigationStates[\"Loading\"] {\n if (submission) {\n let navigation: NavigationStates[\"Loading\"] = {\n state: \"loading\",\n location,\n formMethod: submission.formMethod,\n formAction: submission.formAction,\n formEncType: submission.formEncType,\n formData: submission.formData,\n json: submission.json,\n text: submission.text,\n };\n return navigation;\n } else {\n let navigation: NavigationStates[\"Loading\"] = {\n state: \"loading\",\n location,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n json: undefined,\n text: undefined,\n };\n return navigation;\n }\n}\n\nfunction getSubmittingNavigation(\n location: Location,\n submission: Submission\n): NavigationStates[\"Submitting\"] {\n let navigation: NavigationStates[\"Submitting\"] = {\n state: \"submitting\",\n location,\n formMethod: submission.formMethod,\n formAction: submission.formAction,\n formEncType: submission.formEncType,\n formData: submission.formData,\n json: submission.json,\n text: submission.text,\n };\n return navigation;\n}\n\nfunction getLoadingFetcher(\n submission?: Submission,\n data?: Fetcher[\"data\"]\n): FetcherStates[\"Loading\"] {\n if (submission) {\n let fetcher: FetcherStates[\"Loading\"] = {\n state: \"loading\",\n formMethod: submission.formMethod,\n formAction: submission.formAction,\n formEncType: submission.formEncType,\n formData: submission.formData,\n json: submission.json,\n text: submission.text,\n data,\n \" _hasFetcherDoneAnything \": true,\n };\n return fetcher;\n } else {\n let fetcher: FetcherStates[\"Loading\"] = {\n state: \"loading\",\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n json: undefined,\n text: undefined,\n data,\n \" _hasFetcherDoneAnything \": true,\n };\n return fetcher;\n }\n}\n\nfunction getSubmittingFetcher(\n submission: Submission,\n existingFetcher?: Fetcher\n): FetcherStates[\"Submitting\"] {\n let fetcher: FetcherStates[\"Submitting\"] = {\n state: \"submitting\",\n formMethod: submission.formMethod,\n formAction: submission.formAction,\n formEncType: submission.formEncType,\n formData: submission.formData,\n json: submission.json,\n text: submission.text,\n data: existingFetcher ? existingFetcher.data : undefined,\n \" _hasFetcherDoneAnything \": true,\n };\n return fetcher;\n}\n\nfunction getDoneFetcher(data: Fetcher[\"data\"]): FetcherStates[\"Idle\"] {\n let fetcher: FetcherStates[\"Idle\"] = {\n state: \"idle\",\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n json: undefined,\n text: undefined,\n data,\n \" _hasFetcherDoneAnything \": true,\n };\n return fetcher;\n}\n//#endregion\n","import * as React from \"react\";\nimport type {\n AgnosticRouteMatch,\n AgnosticIndexRouteObject,\n AgnosticNonIndexRouteObject,\n History,\n Location,\n RelativeRoutingType,\n Router,\n StaticHandlerContext,\n To,\n TrackedPromise,\n LazyRouteFunction,\n} from \"@remix-run/router\";\nimport type { Action as NavigationType } from \"@remix-run/router\";\n\n// Create react-specific types from the agnostic types in @remix-run/router to\n// export from react-router\nexport interface IndexRouteObject {\n caseSensitive?: AgnosticIndexRouteObject[\"caseSensitive\"];\n path?: AgnosticIndexRouteObject[\"path\"];\n id?: AgnosticIndexRouteObject[\"id\"];\n loader?: AgnosticIndexRouteObject[\"loader\"];\n action?: AgnosticIndexRouteObject[\"action\"];\n hasErrorBoundary?: AgnosticIndexRouteObject[\"hasErrorBoundary\"];\n shouldRevalidate?: AgnosticIndexRouteObject[\"shouldRevalidate\"];\n handle?: AgnosticIndexRouteObject[\"handle\"];\n index: true;\n children?: undefined;\n element?: React.ReactNode | null;\n errorElement?: React.ReactNode | null;\n Component?: React.ComponentType | null;\n ErrorBoundary?: React.ComponentType | null;\n lazy?: LazyRouteFunction;\n}\n\nexport interface NonIndexRouteObject {\n caseSensitive?: AgnosticNonIndexRouteObject[\"caseSensitive\"];\n path?: AgnosticNonIndexRouteObject[\"path\"];\n id?: AgnosticNonIndexRouteObject[\"id\"];\n loader?: AgnosticNonIndexRouteObject[\"loader\"];\n action?: AgnosticNonIndexRouteObject[\"action\"];\n hasErrorBoundary?: AgnosticNonIndexRouteObject[\"hasErrorBoundary\"];\n shouldRevalidate?: AgnosticNonIndexRouteObject[\"shouldRevalidate\"];\n handle?: AgnosticNonIndexRouteObject[\"handle\"];\n index?: false;\n children?: RouteObject[];\n element?: React.ReactNode | null;\n errorElement?: React.ReactNode | null;\n Component?: React.ComponentType | null;\n ErrorBoundary?: React.ComponentType | null;\n lazy?: LazyRouteFunction;\n}\n\nexport type RouteObject = IndexRouteObject | NonIndexRouteObject;\n\nexport type DataRouteObject = RouteObject & {\n children?: DataRouteObject[];\n id: string;\n};\n\nexport interface RouteMatch<\n ParamKey extends string = string,\n RouteObjectType extends RouteObject = RouteObject\n> extends AgnosticRouteMatch {}\n\nexport interface DataRouteMatch extends RouteMatch {}\n\nexport interface DataRouterContextObject extends NavigationContextObject {\n router: Router;\n staticContext?: StaticHandlerContext;\n}\n\nexport const DataRouterContext =\n React.createContext(null);\nif (__DEV__) {\n DataRouterContext.displayName = \"DataRouter\";\n}\n\nexport const DataRouterStateContext = React.createContext<\n Router[\"state\"] | null\n>(null);\nif (__DEV__) {\n DataRouterStateContext.displayName = \"DataRouterState\";\n}\n\nexport const AwaitContext = React.createContext(null);\nif (__DEV__) {\n AwaitContext.displayName = \"Await\";\n}\n\nexport interface NavigateOptions {\n replace?: boolean;\n state?: any;\n preventScrollReset?: boolean;\n relative?: RelativeRoutingType;\n}\n\n/**\n * A Navigator is a \"location changer\"; it's how you get to different locations.\n *\n * Every history instance conforms to the Navigator interface, but the\n * distinction is useful primarily when it comes to the low-level API\n * where both the location and a navigator must be provided separately in order\n * to avoid \"tearing\" that may occur in a suspense-enabled app if the action\n * and/or location were to be read directly from the history instance.\n */\nexport interface Navigator {\n createHref: History[\"createHref\"];\n // Optional for backwards-compat with Router/HistoryRouter usage (edge case)\n encodeLocation?: History[\"encodeLocation\"];\n go: History[\"go\"];\n push(to: To, state?: any, opts?: NavigateOptions): void;\n replace(to: To, state?: any, opts?: NavigateOptions): void;\n}\n\ninterface NavigationContextObject {\n basename: string;\n navigator: Navigator;\n static: boolean;\n}\n\nexport const NavigationContext = React.createContext(\n null!\n);\n\nif (__DEV__) {\n NavigationContext.displayName = \"Navigation\";\n}\n\ninterface LocationContextObject {\n location: Location;\n navigationType: NavigationType;\n}\n\nexport const LocationContext = React.createContext(\n null!\n);\n\nif (__DEV__) {\n LocationContext.displayName = \"Location\";\n}\n\nexport interface RouteContextObject {\n outlet: React.ReactElement | null;\n matches: RouteMatch[];\n isDataRoute: boolean;\n}\n\nexport const RouteContext = React.createContext({\n outlet: null,\n matches: [],\n isDataRoute: false,\n});\n\nif (__DEV__) {\n RouteContext.displayName = \"Route\";\n}\n\nexport const RouteErrorContext = React.createContext(null);\n\nif (__DEV__) {\n RouteErrorContext.displayName = \"RouteError\";\n}\n","import * as React from \"react\";\nimport type {\n Blocker,\n BlockerFunction,\n Location,\n ParamParseKey,\n Params,\n Path,\n PathMatch,\n PathPattern,\n RelativeRoutingType,\n Router as RemixRouter,\n RevalidationState,\n To,\n} from \"@remix-run/router\";\nimport {\n Action as NavigationType,\n UNSAFE_invariant as invariant,\n isRouteErrorResponse,\n joinPaths,\n matchPath,\n matchRoutes,\n parsePath,\n resolveTo,\n stripBasename,\n IDLE_BLOCKER,\n UNSAFE_getPathContributingMatches as getPathContributingMatches,\n UNSAFE_warning as warning,\n} from \"@remix-run/router\";\n\nimport type {\n NavigateOptions,\n RouteContextObject,\n RouteMatch,\n RouteObject,\n DataRouteMatch,\n} from \"./context\";\nimport {\n DataRouterContext,\n DataRouterStateContext,\n LocationContext,\n NavigationContext,\n RouteContext,\n RouteErrorContext,\n AwaitContext,\n} from \"./context\";\n\n/**\n * Returns the full href for the given \"to\" value. This is useful for building\n * custom links that are also accessible and preserve right-click behavior.\n *\n * @see https://reactrouter.com/hooks/use-href\n */\nexport function useHref(\n to: To,\n { relative }: { relative?: RelativeRoutingType } = {}\n): string {\n invariant(\n useInRouterContext(),\n // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n `useHref() may be used only in the context of a component.`\n );\n\n let { basename, navigator } = React.useContext(NavigationContext);\n let { hash, pathname, search } = useResolvedPath(to, { relative });\n\n let joinedPathname = pathname;\n\n // If we're operating within a basename, prepend it to the pathname prior\n // to creating the href. If this is a root navigation, then just use the raw\n // basename which allows the basename to have full control over the presence\n // of a trailing slash on root links\n if (basename !== \"/\") {\n joinedPathname =\n pathname === \"/\" ? basename : joinPaths([basename, pathname]);\n }\n\n return navigator.createHref({ pathname: joinedPathname, search, hash });\n}\n\n/**\n * Returns true if this component is a descendant of a .\n *\n * @see https://reactrouter.com/hooks/use-in-router-context\n */\nexport function useInRouterContext(): boolean {\n return React.useContext(LocationContext) != null;\n}\n\n/**\n * Returns the current location object, which represents the current URL in web\n * browsers.\n *\n * Note: If you're using this it may mean you're doing some of your own\n * \"routing\" in your app, and we'd like to know what your use case is. We may\n * be able to provide something higher-level to better suit your needs.\n *\n * @see https://reactrouter.com/hooks/use-location\n */\nexport function useLocation(): Location {\n invariant(\n useInRouterContext(),\n // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n `useLocation() may be used only in the context of a component.`\n );\n\n return React.useContext(LocationContext).location;\n}\n\n/**\n * Returns the current navigation action which describes how the router came to\n * the current location, either by a pop, push, or replace on the history stack.\n *\n * @see https://reactrouter.com/hooks/use-navigation-type\n */\nexport function useNavigationType(): NavigationType {\n return React.useContext(LocationContext).navigationType;\n}\n\n/**\n * Returns a PathMatch object if the given pattern matches the current URL.\n * This is useful for components that need to know \"active\" state, e.g.\n * .\n *\n * @see https://reactrouter.com/hooks/use-match\n */\nexport function useMatch<\n ParamKey extends ParamParseKey,\n Path extends string\n>(pattern: PathPattern | Path): PathMatch | null {\n invariant(\n useInRouterContext(),\n // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n `useMatch() may be used only in the context of a component.`\n );\n\n let { pathname } = useLocation();\n return React.useMemo(\n () => matchPath(pattern, pathname),\n [pathname, pattern]\n );\n}\n\n/**\n * The interface for the navigate() function returned from useNavigate().\n */\nexport interface NavigateFunction {\n (to: To, options?: NavigateOptions): void;\n (delta: number): void;\n}\n\nconst navigateEffectWarning =\n `You should call navigate() in a React.useEffect(), not when ` +\n `your component is first rendered.`;\n\n// Mute warnings for calls to useNavigate in SSR environments\nfunction useIsomorphicLayoutEffect(\n cb: Parameters[0]\n) {\n let isStatic = React.useContext(NavigationContext).static;\n if (!isStatic) {\n // We should be able to get rid of this once react 18.3 is released\n // See: https://github.com/facebook/react/pull/26395\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useLayoutEffect(cb);\n }\n}\n\n/**\n * Returns an imperative method for changing the location. Used by s, but\n * may also be used by other elements to change the location.\n *\n * @see https://reactrouter.com/hooks/use-navigate\n */\nexport function useNavigate(): NavigateFunction {\n let { isDataRoute } = React.useContext(RouteContext);\n // Conditional usage is OK here because the usage of a data router is static\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return isDataRoute ? useNavigateStable() : useNavigateUnstable();\n}\n\nfunction useNavigateUnstable(): NavigateFunction {\n invariant(\n useInRouterContext(),\n // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n `useNavigate() may be used only in the context of a component.`\n );\n\n let dataRouterContext = React.useContext(DataRouterContext);\n let { basename, navigator } = React.useContext(NavigationContext);\n let { matches } = React.useContext(RouteContext);\n let { pathname: locationPathname } = useLocation();\n\n let routePathnamesJson = JSON.stringify(\n getPathContributingMatches(matches).map((match) => match.pathnameBase)\n );\n\n let activeRef = React.useRef(false);\n useIsomorphicLayoutEffect(() => {\n activeRef.current = true;\n });\n\n let navigate: NavigateFunction = React.useCallback(\n (to: To | number, options: NavigateOptions = {}) => {\n warning(activeRef.current, navigateEffectWarning);\n\n // Short circuit here since if this happens on first render the navigate\n // is useless because we haven't wired up our history listener yet\n if (!activeRef.current) return;\n\n if (typeof to === \"number\") {\n navigator.go(to);\n return;\n }\n\n let path = resolveTo(\n to,\n JSON.parse(routePathnamesJson),\n locationPathname,\n options.relative === \"path\"\n );\n\n // If we're operating within a basename, prepend it to the pathname prior\n // to handing off to history (but only if we're not in a data router,\n // otherwise it'll prepend the basename inside of the router).\n // If this is a root navigation, then we navigate to the raw basename\n // which allows the basename to have full control over the presence of a\n // trailing slash on root links\n if (dataRouterContext == null && basename !== \"/\") {\n path.pathname =\n path.pathname === \"/\"\n ? basename\n : joinPaths([basename, path.pathname]);\n }\n\n (!!options.replace ? navigator.replace : navigator.push)(\n path,\n options.state,\n options\n );\n },\n [\n basename,\n navigator,\n routePathnamesJson,\n locationPathname,\n dataRouterContext,\n ]\n );\n\n return navigate;\n}\n\nconst OutletContext = React.createContext(null);\n\n/**\n * Returns the context (if provided) for the child route at this level of the route\n * hierarchy.\n * @see https://reactrouter.com/hooks/use-outlet-context\n */\nexport function useOutletContext(): Context {\n return React.useContext(OutletContext) as Context;\n}\n\n/**\n * Returns the element for the child route at this level of the route\n * hierarchy. Used internally by to render child routes.\n *\n * @see https://reactrouter.com/hooks/use-outlet\n */\nexport function useOutlet(context?: unknown): React.ReactElement | null {\n let outlet = React.useContext(RouteContext).outlet;\n if (outlet) {\n return (\n {outlet}\n );\n }\n return outlet;\n}\n\n/**\n * Returns an object of key/value pairs of the dynamic params from the current\n * URL that were matched by the route path.\n *\n * @see https://reactrouter.com/hooks/use-params\n */\nexport function useParams<\n ParamsOrKey extends string | Record = string\n>(): Readonly<\n [ParamsOrKey] extends [string] ? Params : Partial\n> {\n let { matches } = React.useContext(RouteContext);\n let routeMatch = matches[matches.length - 1];\n return routeMatch ? (routeMatch.params as any) : {};\n}\n\n/**\n * Resolves the pathname of the given `to` value against the current location.\n *\n * @see https://reactrouter.com/hooks/use-resolved-path\n */\nexport function useResolvedPath(\n to: To,\n { relative }: { relative?: RelativeRoutingType } = {}\n): Path {\n let { matches } = React.useContext(RouteContext);\n let { pathname: locationPathname } = useLocation();\n\n let routePathnamesJson = JSON.stringify(\n getPathContributingMatches(matches).map((match) => match.pathnameBase)\n );\n\n return React.useMemo(\n () =>\n resolveTo(\n to,\n JSON.parse(routePathnamesJson),\n locationPathname,\n relative === \"path\"\n ),\n [to, routePathnamesJson, locationPathname, relative]\n );\n}\n\n/**\n * Returns the element of the route that matched the current location, prepared\n * with the correct context to render the remainder of the route tree. Route\n * elements in the tree must render an to render their child route's\n * element.\n *\n * @see https://reactrouter.com/hooks/use-routes\n */\nexport function useRoutes(\n routes: RouteObject[],\n locationArg?: Partial | string\n): React.ReactElement | null {\n return useRoutesImpl(routes, locationArg);\n}\n\n// Internal implementation with accept optional param for RouterProvider usage\nexport function useRoutesImpl(\n routes: RouteObject[],\n locationArg?: Partial | string,\n dataRouterState?: RemixRouter[\"state\"]\n): React.ReactElement | null {\n invariant(\n useInRouterContext(),\n // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n `useRoutes() may be used only in the context of a component.`\n );\n\n let { navigator } = React.useContext(NavigationContext);\n let { matches: parentMatches } = React.useContext(RouteContext);\n let routeMatch = parentMatches[parentMatches.length - 1];\n let parentParams = routeMatch ? routeMatch.params : {};\n let parentPathname = routeMatch ? routeMatch.pathname : \"/\";\n let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : \"/\";\n let parentRoute = routeMatch && routeMatch.route;\n\n if (__DEV__) {\n // You won't get a warning about 2 different under a \n // without a trailing *, but this is a best-effort warning anyway since we\n // cannot even give the warning unless they land at the parent route.\n //\n // Example:\n //\n // \n // {/* This route path MUST end with /* because otherwise\n // it will never match /blog/post/123 */}\n // } />\n // } />\n // \n //\n // function Blog() {\n // return (\n // \n // } />\n // \n // );\n // }\n let parentPath = (parentRoute && parentRoute.path) || \"\";\n warningOnce(\n parentPathname,\n !parentRoute || parentPath.endsWith(\"*\"),\n `You rendered descendant (or called \\`useRoutes()\\`) at ` +\n `\"${parentPathname}\" (under ) but the ` +\n `parent route path has no trailing \"*\". This means if you navigate ` +\n `deeper, the parent won't match anymore and therefore the child ` +\n `routes will never render.\\n\\n` +\n `Please change the parent to .`\n );\n }\n\n let locationFromContext = useLocation();\n\n let location;\n if (locationArg) {\n let parsedLocationArg =\n typeof locationArg === \"string\" ? parsePath(locationArg) : locationArg;\n\n invariant(\n parentPathnameBase === \"/\" ||\n parsedLocationArg.pathname?.startsWith(parentPathnameBase),\n `When overriding the location using \\`\\` or \\`useRoutes(routes, location)\\`, ` +\n `the location pathname must begin with the portion of the URL pathname that was ` +\n `matched by all parent routes. The current pathname base is \"${parentPathnameBase}\" ` +\n `but pathname \"${parsedLocationArg.pathname}\" was given in the \\`location\\` prop.`\n );\n\n location = parsedLocationArg;\n } else {\n location = locationFromContext;\n }\n\n let pathname = location.pathname || \"/\";\n let remainingPathname =\n parentPathnameBase === \"/\"\n ? pathname\n : pathname.slice(parentPathnameBase.length) || \"/\";\n\n let matches = matchRoutes(routes, { pathname: remainingPathname });\n\n if (__DEV__) {\n warning(\n parentRoute || matches != null,\n `No routes matched location \"${location.pathname}${location.search}${location.hash}\" `\n );\n\n warning(\n matches == null ||\n matches[matches.length - 1].route.element !== undefined ||\n matches[matches.length - 1].route.Component !== undefined,\n `Matched leaf route at location \"${location.pathname}${location.search}${location.hash}\" ` +\n `does not have an element or Component. This means it will render an with a ` +\n `null value by default resulting in an \"empty\" page.`\n );\n }\n\n let renderedMatches = _renderMatches(\n matches &&\n matches.map((match) =>\n Object.assign({}, match, {\n params: Object.assign({}, parentParams, match.params),\n pathname: joinPaths([\n parentPathnameBase,\n // Re-encode pathnames that were decoded inside matchRoutes\n navigator.encodeLocation\n ? navigator.encodeLocation(match.pathname).pathname\n : match.pathname,\n ]),\n pathnameBase:\n match.pathnameBase === \"/\"\n ? parentPathnameBase\n : joinPaths([\n parentPathnameBase,\n // Re-encode pathnames that were decoded inside matchRoutes\n navigator.encodeLocation\n ? navigator.encodeLocation(match.pathnameBase).pathname\n : match.pathnameBase,\n ]),\n })\n ),\n parentMatches,\n dataRouterState\n );\n\n // When a user passes in a `locationArg`, the associated routes need to\n // be wrapped in a new `LocationContext.Provider` in order for `useLocation`\n // to use the scoped location instead of the global location.\n if (locationArg && renderedMatches) {\n return (\n \n {renderedMatches}\n \n );\n }\n\n return renderedMatches;\n}\n\nfunction DefaultErrorComponent() {\n let error = useRouteError();\n let message = isRouteErrorResponse(error)\n ? `${error.status} ${error.statusText}`\n : error instanceof Error\n ? error.message\n : JSON.stringify(error);\n let stack = error instanceof Error ? error.stack : null;\n let lightgrey = \"rgba(200,200,200, 0.5)\";\n let preStyles = { padding: \"0.5rem\", backgroundColor: lightgrey };\n let codeStyles = { padding: \"2px 4px\", backgroundColor: lightgrey };\n\n let devInfo = null;\n if (__DEV__) {\n console.error(\n \"Error handled by React Router default ErrorBoundary:\",\n error\n );\n\n devInfo = (\n <>\n

💿 Hey developer 👋

\n

\n You can provide a way better UX than this when your app throws errors\n by providing your own ErrorBoundary or{\" \"}\n errorElement prop on your route.\n

\n \n );\n }\n\n return (\n <>\n

Unexpected Application Error!

\n

{message}

\n {stack ?
{stack}
: null}\n {devInfo}\n \n );\n}\n\nconst defaultErrorElement = ;\n\ntype RenderErrorBoundaryProps = React.PropsWithChildren<{\n location: Location;\n revalidation: RevalidationState;\n error: any;\n component: React.ReactNode;\n routeContext: RouteContextObject;\n}>;\n\ntype RenderErrorBoundaryState = {\n location: Location;\n revalidation: RevalidationState;\n error: any;\n};\n\nexport class RenderErrorBoundary extends React.Component<\n RenderErrorBoundaryProps,\n RenderErrorBoundaryState\n> {\n constructor(props: RenderErrorBoundaryProps) {\n super(props);\n this.state = {\n location: props.location,\n revalidation: props.revalidation,\n error: props.error,\n };\n }\n\n static getDerivedStateFromError(error: any) {\n return { error: error };\n }\n\n static getDerivedStateFromProps(\n props: RenderErrorBoundaryProps,\n state: RenderErrorBoundaryState\n ) {\n // When we get into an error state, the user will likely click \"back\" to the\n // previous page that didn't have an error. Because this wraps the entire\n // application, that will have no effect--the error page continues to display.\n // This gives us a mechanism to recover from the error when the location changes.\n //\n // Whether we're in an error state or not, we update the location in state\n // so that when we are in an error state, it gets reset when a new location\n // comes in and the user recovers from the error.\n if (\n state.location !== props.location ||\n (state.revalidation !== \"idle\" && props.revalidation === \"idle\")\n ) {\n return {\n error: props.error,\n location: props.location,\n revalidation: props.revalidation,\n };\n }\n\n // If we're not changing locations, preserve the location but still surface\n // any new errors that may come through. We retain the existing error, we do\n // this because the error provided from the app state may be cleared without\n // the location changing.\n return {\n error: props.error || state.error,\n location: state.location,\n revalidation: props.revalidation || state.revalidation,\n };\n }\n\n componentDidCatch(error: any, errorInfo: any) {\n console.error(\n \"React Router caught the following error during render\",\n error,\n errorInfo\n );\n }\n\n render() {\n return this.state.error ? (\n \n \n \n ) : (\n this.props.children\n );\n }\n}\n\ninterface RenderedRouteProps {\n routeContext: RouteContextObject;\n match: RouteMatch;\n children: React.ReactNode | null;\n}\n\nfunction RenderedRoute({ routeContext, match, children }: RenderedRouteProps) {\n let dataRouterContext = React.useContext(DataRouterContext);\n\n // Track how deep we got in our render pass to emulate SSR componentDidCatch\n // in a DataStaticRouter\n if (\n dataRouterContext &&\n dataRouterContext.static &&\n dataRouterContext.staticContext &&\n (match.route.errorElement || match.route.ErrorBoundary)\n ) {\n dataRouterContext.staticContext._deepestRenderedBoundaryId = match.route.id;\n }\n\n return (\n \n {children}\n \n );\n}\n\nexport function _renderMatches(\n matches: RouteMatch[] | null,\n parentMatches: RouteMatch[] = [],\n dataRouterState: RemixRouter[\"state\"] | null = null\n): React.ReactElement | null {\n if (matches == null) {\n if (dataRouterState?.errors) {\n // Don't bail if we have data router errors so we can render them in the\n // boundary. Use the pre-matched (or shimmed) matches\n matches = dataRouterState.matches as DataRouteMatch[];\n } else {\n return null;\n }\n }\n\n let renderedMatches = matches;\n\n // If we have data errors, trim matches to the highest error boundary\n let errors = dataRouterState?.errors;\n if (errors != null) {\n let errorIndex = renderedMatches.findIndex(\n (m) => m.route.id && errors?.[m.route.id]\n );\n invariant(\n errorIndex >= 0,\n `Could not find a matching route for errors on route IDs: ${Object.keys(\n errors\n ).join(\",\")}`\n );\n renderedMatches = renderedMatches.slice(\n 0,\n Math.min(renderedMatches.length, errorIndex + 1)\n );\n }\n\n return renderedMatches.reduceRight((outlet, match, index) => {\n let error = match.route.id ? errors?.[match.route.id] : null;\n // Only data routers handle errors\n let errorElement: React.ReactNode | null = null;\n if (dataRouterState) {\n errorElement = match.route.errorElement || defaultErrorElement;\n }\n let matches = parentMatches.concat(renderedMatches.slice(0, index + 1));\n let getChildren = () => {\n let children: React.ReactNode;\n if (error) {\n children = errorElement;\n } else if (match.route.Component) {\n // Note: This is a de-optimized path since React won't re-use the\n // ReactElement since it's identity changes with each new\n // React.createElement call. We keep this so folks can use\n // `` in `` but generally `Component`\n // usage is only advised in `RouterProvider` when we can convert it to\n // `element` ahead of time.\n children = ;\n } else if (match.route.element) {\n children = match.route.element;\n } else {\n children = outlet;\n }\n return (\n \n );\n };\n // Only wrap in an error boundary within data router usages when we have an\n // ErrorBoundary/errorElement on this route. Otherwise let it bubble up to\n // an ancestor ErrorBoundary/errorElement\n return dataRouterState &&\n (match.route.ErrorBoundary || match.route.errorElement || index === 0) ? (\n \n ) : (\n getChildren()\n );\n }, null as React.ReactElement | null);\n}\n\nenum DataRouterHook {\n UseBlocker = \"useBlocker\",\n UseRevalidator = \"useRevalidator\",\n UseNavigateStable = \"useNavigate\",\n}\n\nenum DataRouterStateHook {\n UseBlocker = \"useBlocker\",\n UseLoaderData = \"useLoaderData\",\n UseActionData = \"useActionData\",\n UseRouteError = \"useRouteError\",\n UseNavigation = \"useNavigation\",\n UseRouteLoaderData = \"useRouteLoaderData\",\n UseMatches = \"useMatches\",\n UseRevalidator = \"useRevalidator\",\n UseNavigateStable = \"useNavigate\",\n UseRouteId = \"useRouteId\",\n}\n\nfunction getDataRouterConsoleError(\n hookName: DataRouterHook | DataRouterStateHook\n) {\n return `${hookName} must be used within a data router. See https://reactrouter.com/routers/picking-a-router.`;\n}\n\nfunction useDataRouterContext(hookName: DataRouterHook) {\n let ctx = React.useContext(DataRouterContext);\n invariant(ctx, getDataRouterConsoleError(hookName));\n return ctx;\n}\n\nfunction useDataRouterState(hookName: DataRouterStateHook) {\n let state = React.useContext(DataRouterStateContext);\n invariant(state, getDataRouterConsoleError(hookName));\n return state;\n}\n\nfunction useRouteContext(hookName: DataRouterStateHook) {\n let route = React.useContext(RouteContext);\n invariant(route, getDataRouterConsoleError(hookName));\n return route;\n}\n\n// Internal version with hookName-aware debugging\nfunction useCurrentRouteId(hookName: DataRouterStateHook) {\n let route = useRouteContext(hookName);\n let thisRoute = route.matches[route.matches.length - 1];\n invariant(\n thisRoute.route.id,\n `${hookName} can only be used on routes that contain a unique \"id\"`\n );\n return thisRoute.route.id;\n}\n\n/**\n * Returns the ID for the nearest contextual route\n */\nexport function useRouteId() {\n return useCurrentRouteId(DataRouterStateHook.UseRouteId);\n}\n\n/**\n * Returns the current navigation, defaulting to an \"idle\" navigation when\n * no navigation is in progress\n */\nexport function useNavigation() {\n let state = useDataRouterState(DataRouterStateHook.UseNavigation);\n return state.navigation;\n}\n\n/**\n * Returns a revalidate function for manually triggering revalidation, as well\n * as the current state of any manual revalidations\n */\nexport function useRevalidator() {\n let dataRouterContext = useDataRouterContext(DataRouterHook.UseRevalidator);\n let state = useDataRouterState(DataRouterStateHook.UseRevalidator);\n return {\n revalidate: dataRouterContext.router.revalidate,\n state: state.revalidation,\n };\n}\n\n/**\n * Returns the active route matches, useful for accessing loaderData for\n * parent/child routes or the route \"handle\" property\n */\nexport function useMatches() {\n let { matches, loaderData } = useDataRouterState(\n DataRouterStateHook.UseMatches\n );\n return React.useMemo(\n () =>\n matches.map((match) => {\n let { pathname, params } = match;\n // Note: This structure matches that created by createUseMatchesMatch\n // in the @remix-run/router , so if you change this please also change\n // that :) Eventually we'll DRY this up\n return {\n id: match.route.id,\n pathname,\n params,\n data: loaderData[match.route.id] as unknown,\n handle: match.route.handle as unknown,\n };\n }),\n [matches, loaderData]\n );\n}\n\n/**\n * Returns the loader data for the nearest ancestor Route loader\n */\nexport function useLoaderData(): unknown {\n let state = useDataRouterState(DataRouterStateHook.UseLoaderData);\n let routeId = useCurrentRouteId(DataRouterStateHook.UseLoaderData);\n\n if (state.errors && state.errors[routeId] != null) {\n console.error(\n `You cannot \\`useLoaderData\\` in an errorElement (routeId: ${routeId})`\n );\n return undefined;\n }\n return state.loaderData[routeId];\n}\n\n/**\n * Returns the loaderData for the given routeId\n */\nexport function useRouteLoaderData(routeId: string): unknown {\n let state = useDataRouterState(DataRouterStateHook.UseRouteLoaderData);\n return state.loaderData[routeId];\n}\n\n/**\n * Returns the action data for the nearest ancestor Route action\n */\nexport function useActionData(): unknown {\n let state = useDataRouterState(DataRouterStateHook.UseActionData);\n\n let route = React.useContext(RouteContext);\n invariant(route, `useActionData must be used inside a RouteContext`);\n\n return Object.values(state?.actionData || {})[0];\n}\n\n/**\n * Returns the nearest ancestor Route error, which could be a loader/action\n * error or a render error. This is intended to be called from your\n * ErrorBoundary/errorElement to display a proper error message.\n */\nexport function useRouteError(): unknown {\n let error = React.useContext(RouteErrorContext);\n let state = useDataRouterState(DataRouterStateHook.UseRouteError);\n let routeId = useCurrentRouteId(DataRouterStateHook.UseRouteError);\n\n // If this was a render error, we put it in a RouteError context inside\n // of RenderErrorBoundary\n if (error) {\n return error;\n }\n\n // Otherwise look for errors from our data router state\n return state.errors?.[routeId];\n}\n\n/**\n * Returns the happy-path data from the nearest ancestor value\n */\nexport function useAsyncValue(): unknown {\n let value = React.useContext(AwaitContext);\n return value?._data;\n}\n\n/**\n * Returns the error from the nearest ancestor value\n */\nexport function useAsyncError(): unknown {\n let value = React.useContext(AwaitContext);\n return value?._error;\n}\n\nlet blockerId = 0;\n\n/**\n * Allow the application to block navigations within the SPA and present the\n * user a confirmation dialog to confirm the navigation. Mostly used to avoid\n * using half-filled form data. This does not handle hard-reloads or\n * cross-origin navigations.\n */\nexport function useBlocker(shouldBlock: boolean | BlockerFunction): Blocker {\n let { router, basename } = useDataRouterContext(DataRouterHook.UseBlocker);\n let state = useDataRouterState(DataRouterStateHook.UseBlocker);\n\n let [blockerKey, setBlockerKey] = React.useState(\"\");\n let blockerFunction = React.useCallback(\n (arg) => {\n if (typeof shouldBlock !== \"function\") {\n return !!shouldBlock;\n }\n if (basename === \"/\") {\n return shouldBlock(arg);\n }\n\n // If they provided us a function and we've got an active basename, strip\n // it from the locations we expose to the user to match the behavior of\n // useLocation\n let { currentLocation, nextLocation, historyAction } = arg;\n return shouldBlock({\n currentLocation: {\n ...currentLocation,\n pathname:\n stripBasename(currentLocation.pathname, basename) ||\n currentLocation.pathname,\n },\n nextLocation: {\n ...nextLocation,\n pathname:\n stripBasename(nextLocation.pathname, basename) ||\n nextLocation.pathname,\n },\n historyAction,\n });\n },\n [basename, shouldBlock]\n );\n\n // This effect is in charge of blocker key assignment and deletion (which is\n // tightly coupled to the key)\n React.useEffect(() => {\n let key = String(++blockerId);\n setBlockerKey(key);\n return () => router.deleteBlocker(key);\n }, [router]);\n\n // This effect handles assigning the blockerFunction. This is to handle\n // unstable blocker function identities, and happens only after the prior\n // effect so we don't get an orphaned blockerFunction in the router with a\n // key of \"\". Until then we just have the IDLE_BLOCKER.\n React.useEffect(() => {\n if (blockerKey !== \"\") {\n router.getBlocker(blockerKey, blockerFunction);\n }\n }, [router, blockerKey, blockerFunction]);\n\n // Prefer the blocker from `state` not `router.state` since DataRouterContext\n // is memoized so this ensures we update on blocker state updates\n return blockerKey && state.blockers.has(blockerKey)\n ? state.blockers.get(blockerKey)!\n : IDLE_BLOCKER;\n}\n\n/**\n * Stable version of useNavigate that is used when we are in the context of\n * a RouterProvider.\n */\nfunction useNavigateStable(): NavigateFunction {\n let { router } = useDataRouterContext(DataRouterHook.UseNavigateStable);\n let id = useCurrentRouteId(DataRouterStateHook.UseNavigateStable);\n\n let activeRef = React.useRef(false);\n useIsomorphicLayoutEffect(() => {\n activeRef.current = true;\n });\n\n let navigate: NavigateFunction = React.useCallback(\n (to: To | number, options: NavigateOptions = {}) => {\n warning(activeRef.current, navigateEffectWarning);\n\n // Short circuit here since if this happens on first render the navigate\n // is useless because we haven't wired up our router subscriber yet\n if (!activeRef.current) return;\n\n if (typeof to === \"number\") {\n router.navigate(to);\n } else {\n router.navigate(to, { fromRouteId: id, ...options });\n }\n },\n [router, id]\n );\n\n return navigate;\n}\n\nconst alreadyWarned: Record = {};\n\nfunction warningOnce(key: string, cond: boolean, message: string) {\n if (!cond && !alreadyWarned[key]) {\n alreadyWarned[key] = true;\n warning(false, message);\n }\n}\n","import * as React from \"react\";\nimport type {\n TrackedPromise,\n InitialEntry,\n Location,\n MemoryHistory,\n Router as RemixRouter,\n To,\n LazyRouteFunction,\n RelativeRoutingType,\n RouterState,\n} from \"@remix-run/router\";\nimport {\n Action as NavigationType,\n AbortedDeferredError,\n createMemoryHistory,\n UNSAFE_invariant as invariant,\n parsePath,\n resolveTo,\n stripBasename,\n UNSAFE_warning as warning,\n UNSAFE_getPathContributingMatches as getPathContributingMatches,\n} from \"@remix-run/router\";\n\nimport type {\n DataRouteObject,\n IndexRouteObject,\n RouteMatch,\n RouteObject,\n Navigator,\n NonIndexRouteObject,\n} from \"./context\";\nimport {\n LocationContext,\n NavigationContext,\n DataRouterContext,\n DataRouterStateContext,\n AwaitContext,\n RouteContext,\n} from \"./context\";\nimport {\n useAsyncValue,\n useInRouterContext,\n useNavigate,\n useOutlet,\n useRoutes,\n _renderMatches,\n useRoutesImpl,\n useLocation,\n} from \"./hooks\";\n\nexport interface FutureConfig {\n v7_startTransition: boolean;\n}\n\nexport interface RouterProviderProps {\n fallbackElement?: React.ReactNode;\n router: RemixRouter;\n future?: FutureConfig;\n}\n\n/**\n Webpack + React 17 fails to compile on any of the following because webpack\n complains that `startTransition` doesn't exist in `React`:\n * import { startTransition } from \"react\"\n * import * as React from from \"react\";\n \"startTransition\" in React ? React.startTransition(() => setState()) : setState()\n * import * as React from from \"react\";\n \"startTransition\" in React ? React[\"startTransition\"](() => setState()) : setState()\n\n Moving it to a constant such as the following solves the Webpack/React 17 issue:\n * import * as React from from \"react\";\n const START_TRANSITION = \"startTransition\";\n START_TRANSITION in React ? React[START_TRANSITION](() => setState()) : setState()\n\n However, that introduces webpack/terser minification issues in production builds\n in React 18 where minification/obfuscation ends up removing the call of\n React.startTransition entirely from the first half of the ternary. Grabbing\n this exported reference once up front resolves that issue.\n\n See https://github.com/remix-run/react-router/issues/10579\n*/\nconst START_TRANSITION = \"startTransition\";\nconst startTransitionImpl = React[START_TRANSITION];\n\n/**\n * Given a Remix Router instance, render the appropriate UI\n */\nexport function RouterProvider({\n fallbackElement,\n router,\n future,\n}: RouterProviderProps): React.ReactElement {\n // Need to use a layout effect here so we are subscribed early enough to\n // pick up on any render-driven redirects/navigations (useEffect/)\n let [state, setStateImpl] = React.useState(router.state);\n let { v7_startTransition } = future || {};\n let setState = React.useCallback(\n (newState: RouterState) => {\n v7_startTransition && startTransitionImpl\n ? startTransitionImpl(() => setStateImpl(newState))\n : setStateImpl(newState);\n },\n [setStateImpl, v7_startTransition]\n );\n React.useLayoutEffect(() => router.subscribe(setState), [router, setState]);\n\n let navigator = React.useMemo((): Navigator => {\n return {\n createHref: router.createHref,\n encodeLocation: router.encodeLocation,\n go: (n) => router.navigate(n),\n push: (to, state, opts) =>\n router.navigate(to, {\n state,\n preventScrollReset: opts?.preventScrollReset,\n }),\n replace: (to, state, opts) =>\n router.navigate(to, {\n replace: true,\n state,\n preventScrollReset: opts?.preventScrollReset,\n }),\n };\n }, [router]);\n\n let basename = router.basename || \"/\";\n\n let dataRouterContext = React.useMemo(\n () => ({\n router,\n navigator,\n static: false,\n basename,\n }),\n [router, navigator, basename]\n );\n\n // The fragment and {null} here are important! We need them to keep React 18's\n // useId happy when we are server-rendering since we may have a