← Back
Editing: use-query-params.js
(()=>{var e={235(e,t,n){"use strict";function r(e,t,n=!0){return{...e,default:t,decode:(...r)=>{const a=e.decode(...r);return void 0===a||n&&null===a?t:a}}}function a(e,t){if(null==e)return e;if(0===e.length&&(!t||t&&""!==e))return null;const n=e instanceof Array?e[0]:e;return null==n||t||""!==n?n:null}function o(e){if(null==e)return e;const t=e.getFullYear(),n=e.getMonth()+1,r=e.getDate();return`${t}-${n<10?`0${n}`:n}-${r<10?`0${r}`:r}`}function i(e){const t=a(e);if(null==t)return t;const n=t.split("-");null!=n[1]?n[1]-=1:(n[1]=0,n[2]=1);const r=new Date(...n);return isNaN(r.getTime())?null:r}function l(e){return null==e?e:e.toISOString()}function u(e){const t=a(e);if(null==t)return t;const n=new Date(t);return isNaN(n.getTime())?null:n}function s(e){return null==e?e:e?"1":"0"}function c(e){const t=a(e);return null==t?t:"1"===t||"0"!==t&&null}function d(e){return null==e?e:String(e)}function h(e){const t=a(e);return null==t?t:""===t?null:+t}function p(e){return null==e?e:String(e)}function m(e){const t=a(e,!0);return null==t?t:String(t)}function f(e,t){const n=m(e);return null==n||t.includes(n)?n:void 0}function g(e,t){const n=S(e);return null==n||n.length&&n.every(e=>null!=e&&t.includes(e))?n:void 0}function y(e,t,n="_"){if(null==e||!Array.isArray(e)||e.length)return g(x(e,n),t)}function v(e){return null==e?e:JSON.stringify(e)}function w(e){const t=a(e);if(null==t)return t;let n=null;try{n=JSON.parse(t)}catch(e){}return n}function b(e){return e??e}function S(e){const t=function(e){return null==e||e instanceof Array?e:""===e?[]:[e]}(e);return t??t}function P(e){return null==e?e:e.map(String)}function E(e){const t=S(e);return null==t?t:t.map(e=>""===e||null==e?null:+e)}function R(e,t="_"){return null==e?e:e.join(t)}function x(e,t="_"){const n=a(e,!0);return null==n?n:""===n?[]:n.split(t)}n.d(t,{xn:()=>U,sJ:()=>Q,K1:()=>B,LT:()=>J,My:()=>H,VA:()=>q,W:()=>F,hc:()=>L,Sh:()=>W,ey:()=>I,X4:()=>_,fr:()=>A,wG:()=>M,tw:()=>D,Z8:()=>N,k$:()=>S,bx:()=>g,J2:()=>c,Hq:()=>i,_d:()=>u,bo:()=>x,eb:()=>y,_x:()=>O,u9:()=>f,xO:()=>w,w2:()=>h,Nd:()=>E,NM:()=>j,gv:()=>$,Zr:()=>ee,sc:()=>m,u8:()=>b,ZY:()=>s,d5:()=>o,CJ:()=>l,bs:()=>R,in:()=>C,Pr:()=>v,_v:()=>d,Vd:()=>P,F_:()=>k,CG:()=>T,Vl:()=>X,aj:()=>p,oO:()=>K,eR:()=>te,ao:()=>V,st:()=>G,Nt:()=>Z,IQ:()=>r});const C=R;function O(e,t="_"){const n=x(e,t);return null==n?n:n.map(e=>""===e||null==e?null:+e)}function T(e,t="-",n="_"){return null==e?e:Object.keys(e).length?Object.keys(e).map(n=>`${n}${t}${e[n]}`).join(n):""}function $(e,t="-",n="_"){const r=a(e,!0);if(null==r)return r;if(""===r)return{};const o={},i=new RegExp(`${t}(.*)`);return r.split(n).forEach(e=>{const[t,n]=e.split(i);o[t]=n}),o}const k=T;function j(e,t="-",n="_"){const r=$(e,t,n);if(null==r)return r;const a={};for(const e of Object.keys(r))a[e]=h(r[e]);return a}const A={encode:p,decode:m},N=e=>({encode:p,decode:t=>f(t,e)}),M=e=>({encode:e=>b(null==e||Array.isArray(e)?e:[e]),decode:t=>g(t,e)}),D=(e,t="_")=>({encode:e=>R(null==e||Array.isArray(e)?e:[e],t),decode:n=>y(n,e,t)}),L={encode:d,decode:h},_={encode:T,decode:$},U={encode:b,decode:S},W={encode:P,decode:E},F={encode:v,decode:w},B={encode:o,decode:i,equals:(e,t)=>e===t||(null==e||null==t?e===t:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())},J={encode:l,decode:u,equals:(e,t)=>e===t||(null==e||null==t?e===t:e.valueOf()===t.valueOf())},Q={encode:s,decode:c},I={encode:k,decode:j},H={encode:R,decode:x},q={encode:C,decode:O};function K(e){const t=new URLSearchParams,n=Object.entries(e);for(const[e,r]of n)if(null!=r)if(Array.isArray(r))for(const n of r)t.append(e,null!=n?n:"");else t.append(e,r);return t.toString()}const z='{}[],":'.split("").map(e=>[e,encodeURIComponent(e)]);function Y(e,t){let n=t;if(e.href)try{const r=new URL(e.href);n=`${r.origin}${r.pathname}${t}`}catch(e){n=""}return n}function V(e){let t=e;for(let[e,n]of z)t=t.replace(new RegExp("\\"+n,"g"),e);return t}function Z(e,t,n=K){let r=n(e);const a=r.length?`?${r}`:"";return{...t,key:`${Date.now()}`,href:Y(t,a),search:a,query:e}}function G(e,t,n=K,r=te){return Z({...r(t.search),...e},t,n)}function X(e,t){const n={},r=Object.keys(t);for(const a of r){const r=t[a];e[a]?n[a]=e[a].encode(t[a]):n[a]=null==r?r:String(r)}return n}function ee(e,t){const n={},r=Object.keys(e);for(const n of Object.keys(t))null==e[n]&&r.push(n);for(const a of r){const r=t[a];e[a]?n[a]=e[a].decode(r):(console.warn(`Passing through parameter ${a} during decoding since it was not configured.`),n[a]=r)}return n}function te(e){const t=new URLSearchParams(e),n={};for(let[e,r]of t)Object.prototype.hasOwnProperty.call(n,e)?Array.isArray(n[e])?n[e].push(r):n[e]=[n[e],r]:n[e]=r;return n}},972(e,t,n){"use strict";var r=n(609),a=n(725);n.d(t,["S",0,({children:e})=>{var t;const{navigator:n}=(0,r.useContext)(a.jb),o=(0,a.Zp)(),i=null==(t=(0,r.useContext)(a.sp))?void 0:t.router,l=(0,a.zy)();return e({replace(e){o(e.search||"?",{replace:!0,state:e.state})},push(e){o(e.search||"?",{replace:!1,state:e.state})},get location(){var e,t,r;return null!=(r=null!=(t=null==(e=null==i?void 0:i.state)?void 0:e.location)?t:null==n?void 0:n.location)?r:l}})}])},839(e,t,n){"use strict";n.d(t,{HX:()=>s,MJ:()=>l});var r=n(609),a=n(165);const o={adapter:{},options:a.K},i=r.createContext(o);function l(){const e=r.useContext(i);if(void 0===e||e===o)throw new Error("useQueryParams must be used within a QueryParamProvider");return e}function u({children:e,adapter:t,options:n}){const{adapter:o,options:l}=r.useContext(i),u=r.useMemo(()=>({adapter:null!=t?t:o,options:(0,a.l)(l,n)}),[t,n,o,l]);return r.createElement(i.Provider,{value:u},e)}function s({children:e,adapter:t,options:n}){const a=t;return a?r.createElement(a,null,t=>r.createElement(u,{adapter:t,options:n},e)):r.createElement(u,{options:n},e)}},689(e,t,n){"use strict";var r=n(659);n.d(t,["z",0,({config:e,children:t})=>{const[n,a]=(0,r.A)(e);return t({query:n,setQuery:a})}])},223(e,t,n){"use strict";n.r(t),n.d(t,{ArrayParam:()=>r.xn,BooleanParam:()=>r.sJ,DateParam:()=>r.K1,DateTimeParam:()=>r.LT,DelimitedArrayParam:()=>r.My,DelimitedNumericArrayParam:()=>r.VA,JsonParam:()=>r.W,NumberParam:()=>r.hc,NumericArrayParam:()=>r.Sh,NumericObjectParam:()=>r.ey,ObjectParam:()=>r.X4,QueryParamProvider:()=>c.HX,QueryParams:()=>s.z,StringParam:()=>r.fr,createEnumArrayParam:()=>r.wG,createEnumDelimitedArrayParam:()=>r.tw,createEnumParam:()=>r.Z8,decodeArray:()=>r.k$,decodeArrayEnum:()=>r.bx,decodeBoolean:()=>r.J2,decodeDate:()=>r.Hq,decodeDateTime:()=>r._d,decodeDelimitedArray:()=>r.bo,decodeDelimitedArrayEnum:()=>r.eb,decodeDelimitedNumericArray:()=>r._x,decodeEnum:()=>r.u9,decodeJson:()=>r.xO,decodeNumber:()=>r.w2,decodeNumericArray:()=>r.Nd,decodeNumericObject:()=>r.NM,decodeObject:()=>r.gv,decodeQueryParams:()=>r.Zr,decodeString:()=>r.sc,encodeArray:()=>r.u8,encodeBoolean:()=>r.ZY,encodeDate:()=>r.d5,encodeDateTime:()=>r.CJ,encodeDelimitedArray:()=>r.bs,encodeDelimitedNumericArray:()=>r.in,encodeJson:()=>r.Pr,encodeNumber:()=>r._v,encodeNumericArray:()=>r.Vd,encodeNumericObject:()=>r.F_,encodeObject:()=>r.CG,encodeQueryParams:()=>r.Vl,encodeString:()=>r.aj,objectToSearchString:()=>r.oO,searchStringToObject:()=>r.eR,transformSearchStringJsonSafe:()=>r.ao,updateInLocation:()=>r.st,updateLocation:()=>r.Nt,useQueryParam:()=>i.p,useQueryParams:()=>l.s,withDefault:()=>r.IQ,withQueryParams:()=>u.zf,withQueryParamsMapped:()=>u._3});var r=n(235),a=n(430),o={};for(const e in a)["QueryParamProvider","QueryParams","useQueryParam","useQueryParams","withQueryParams","withQueryParamsMapped","default","ArrayParam","BooleanParam","DateParam","DateTimeParam","DelimitedArrayParam","DelimitedNumericArrayParam","JsonParam","NumberParam","NumericArrayParam","NumericObjectParam","ObjectParam","StringParam","createEnumArrayParam","createEnumDelimitedArrayParam","createEnumParam","decodeArray","decodeArrayEnum","decodeBoolean","decodeDate","decodeDateTime","decodeDelimitedArray","decodeDelimitedArrayEnum","decodeDelimitedNumericArray","decodeEnum","decodeJson","decodeNumber","decodeNumericArray","decodeNumericObject","decodeObject","decodeQueryParams","decodeString","encodeArray","encodeBoolean","encodeDate","encodeDateTime","encodeDelimitedArray","encodeDelimitedNumericArray","encodeJson","encodeNumber","encodeNumericArray","encodeNumericObject","encodeObject","encodeQueryParams","encodeString","objectToSearchString","searchStringToObject","transformSearchStringJsonSafe","updateInLocation","updateLocation","withDefault"].indexOf(e)<0&&(o[e]=()=>a[e]);n.d(t,o);var i=n(141),l=n(659),u=n(905),s=n(689),c=n(839)},165(e,t,n){"use strict";n.d(t,{l:()=>o});var r=n(235);const a={searchStringToObject:r.eR,objectToSearchString:r.oO,updateType:"pushIn",includeKnownParams:void 0,includeAllParams:!1,removeDefaultsFromUrl:!1,enableBatching:!1,skipUpdateWhenNoChange:!0};function o(e,t){null==t&&(t={});const n={...e,...t};return t.params&&e.params&&(n.params={...e.params,...t.params}),n}n.d(t,["K",0,a])},430(){},141(e,t,n){"use strict";var r=n(609),a=n(659);n.d(t,["p",0,(e,t,n)=>{const o=(0,r.useMemo)(()=>({[e]:null!=t?t:"inherit"}),[e,t]),[i,l]=(0,a.A)(o,n);return[i[e],(0,r.useCallback)((t,n)=>l("function"==typeof t?n=>{const r=t(n[e]);return{[e]:r}}:{[e]:t},n),[e,l])]}])},659(e,t,n){"use strict";n.d(t,{A:()=>R,s:()=>E});var r=n(609),a=n(235);const o=new class{constructor(){this.paramsMap=new Map,this.registeredParams=new Map}set(e,t,n,r){this.paramsMap.set(e,{stringified:t,decoded:n,decode:r})}has(e,t,n){if(!this.paramsMap.has(e))return!1;const r=this.paramsMap.get(e);return!!r&&r.stringified===t&&(null==n||r.decode===n)}get(e){var t;if(this.paramsMap.has(e))return null==(t=this.paramsMap.get(e))?void 0:t.decoded}registerParams(e){for(const t of e){const e=this.registeredParams.get(t)||0;this.registeredParams.set(t,e+1)}}unregisterParams(e){for(const t of e){const e=(this.registeredParams.get(t)||0)-1;e<=0?(this.registeredParams.delete(t),this.paramsMap.has(t)&&this.paramsMap.delete(t)):this.registeredParams.set(t,e)}}clear(){this.paramsMap.clear(),this.registeredParams.clear()}};function i(e,t,n,r){var a;if(!n||!t.length)return e;let o={...e},i=!1;for(const e of t)Object.prototype.hasOwnProperty.call(o,e)||(o[e]=null!=(a=n[e])?a:r,i=!0);return i?o:e}const l=Object.prototype.hasOwnProperty;function u(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function s(e,t,n){var r,a;if(u(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!1;for(let i=0;i<o.length;i++){const s=null!=(a=null==(r=null==n?void 0:n[o[i]])?void 0:r.equals)?a:u;if(!l.call(t,o[i])||!s(e[o[i]],t[o[i]]))return!1}return!0}function c(e,t,n){const r={},a=Object.keys(t);for(const o of a){const a=t[o],i=e[o];let l;if(n.has(o,i,a.decode))l=n.get(o);else{if(l=a.decode(i),a.equals&&n.has(o,i)){const e=n.get(o);a.equals(l,e)&&(l=e)}void 0!==l&&n.set(o,i,l,a.decode)}void 0===l&&void 0!==a.default&&(l=a.default),r[o]=l}return r}function d(){let e;return function(t,n,r){const a=c(t,n,r);return null!=e&&s(e,a)?e:(e=a,a)}}let h,p,m,f={};const g=(e,t,n)=>{if(h===t&&m===e&&p===n)return f;h=t,m=e;const r=e(null!=t?t:"");p=n;const a=function(e){if(e)return Object.fromEntries(e.split("\n").map(e=>e.split("\0")))}(n);for(let[e,t]of Object.entries(r)){(null==a?void 0:a[e])&&(delete r[e],e=a[e],r[e]=t);const n=f[e];s(t,n)&&(r[e]=n)}return f=r,r};var y=n(165),v=n(839);function w({changes:e,updateType:t,currentSearchString:n,paramConfigMap:r,options:l}){const{searchStringToObject:u,objectToSearchString:s}=l;let d;null==t&&(t=l.updateType);const h=g(u,n),p=i(r,Object.keys(e),l.params);let m,f;return m="function"==typeof e?e(c(h,p,o)):e,d=(0,a.Vl)(p,m),l.removeDefaultsFromUrl&&function(e,t){var n;for(const r in e)void 0!==(null==(n=t[r])?void 0:n.default)&&void 0!==e[r]&&t[r].encode(t[r].default)===e[r]&&(e[r]=void 0)}(d,p),d=function(e,t){var n;let r={};for(const a in e)null!=(null==(n=t[a])?void 0:n.urlName)?r[t[a].urlName]=e[a]:r[a]=e[a];return r}(d,p),f=s("push"===t||"replace"===t?d:{...h,...d}),(null==f?void 0:f.length)&&"?"!==f[0]&&(f=`?${f}`),null!=f?f:""}const b=e=>e(),S=e=>setTimeout(()=>e(),0),P=[];function E(e,t){const{adapter:n,options:l}=(0,v.MJ)(),[u]=(0,r.useState)(d),{paramConfigMap:s,options:c}=function(e,t){let n,r;return void 0===e?(n={},r=t):Array.isArray(e)?(n=Object.fromEntries(e.map(e=>[e,"inherit"])),r=t):(n=e,r=t),{paramConfigMap:n,options:r}}(e,t),h=(0,r.useMemo)(()=>(0,y.l)(l,c),[l,c]);let p=function(e,t){var n,r,o;const i={};let l=!1;const u=Object.keys(e);let s=u;if(t.includeKnownParams||!1!==t.includeKnownParams&&0===u.length){const e=Object.keys(null!=(n=t.params)?n:{});s.push(...e)}for(const n of s){const u=e[n];null==u||"object"!=typeof u?(l=!0,i[n]=null!=(o=null==(r=t.params)?void 0:r[n])?o:a.fr):i[n]=u}return l?i:e}(s,h);const m=g(h.searchStringToObject,n.location.search,function(e){let t;for(const n in e)if(e[n].urlName){const r=`${e[n].urlName}\0${n}`;t?t.push(r):t=[r]}return t?t.join("\n"):void 0}(p));h.includeAllParams&&(p=i(p,Object.keys(m),h.params,a.fr));const f=u(m,p,o),E=Object.keys(p).join("\0");(0,r.useEffect)(()=>{const e=E.split("\0");return o.registerParams(e),()=>{o.unregisterParams(e)}},[E]);const R={adapter:n,paramConfigMap:p,options:h},x=(0,r.useRef)(R);null==x.current&&(x.current=R),(0,r.useEffect)(()=>{x.current.adapter=n,x.current.paramConfigMap=p,x.current.options=h},[n,p,h]);const[C]=(0,r.useState)(()=>(e,t)=>{const{adapter:n,paramConfigMap:r,options:a}=x.current;null==t&&(t=a.updateType),function(e,{immediate:t}={}){P.push(e);let n=t?b:S;1===P.length&&n(()=>{const t=P.slice();P.length=0;const n=t[0].currentSearchString;let r;for(let e=0;e<t.length;++e)r=w(0===e?t[e]:{...t[e],currentSearchString:r});e.options.skipUpdateWhenNoChange&&r===n||function({searchString:e,adapter:t,navigate:n,updateType:r}){const a={...t.location,search:e};n&&("string"==typeof r&&r.startsWith("replace")?t.replace(a):t.push(a))}({searchString:null!=r?r:"",adapter:t[t.length-1].adapter,navigate:!0,updateType:t[t.length-1].updateType})})}({changes:e,updateType:t,currentSearchString:n.location.search,paramConfigMap:r,options:a,adapter:n},{immediate:!a.enableBatching})});return[f,C]}var R=E},905(e,t,n){"use strict";n.d(t,{_3:()=>i,zf:()=>o});var r=n(609),a=n(659);function o(e,t){const n=n=>{const[o,i]=(0,a.A)(e);return r.createElement(t,{query:o,setQuery:i,...n})};return n.displayName=`withQueryParams(${t.displayName||t.name||"Component"})`,n}function i(e,t,n){const o=o=>{const[i,l]=(0,a.A)(e),u=t(i,l,o);return r.createElement(n,{...u,...o})};return o.displayName=`withQueryParams(${n.displayName||n.name||"Component"})`,o}},609(e){"use strict";e.exports=window.React},725(e,t,n){"use strict";n.d(t,{Kd:()=>Je,sp:()=>q,jb:()=>Z,zy:()=>re,Zp:()=>ie});var r=n(609),a=n.t(r,2),o=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,i=/^[\\/]{2}/;var l="popstate";function u(e){return"object"==typeof e&&null!=e&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function s(e={}){return function(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:o=!1}=r,s=a.history,d="POP",f=null,g=y();function y(){return(s.state||{idx:null}).idx}function v(){d="POP";let e=y(),t=null==e?null:e-g;g=e,f&&f({action:d,location:b.location,delta:t})}function w(e){return function(e,t,n=!1){let r="http://localhost";e&&(r="null"!==e.location.origin?e.location.origin:e.location.href),c(r,"No window.location.(origin|href) available to create URL");let a="string"==typeof t?t:m(t);return a=a.replace(/ $/,"%20"),!n&&i.test(a)&&(a=r+a),new URL(a,r)}(a,e)}null==g&&(g=0,s.replaceState({...s.state,idx:g},""));let b={get action(){return d},get location(){return e(a,s)},listen(e){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(l,v),f=e,()=>{a.removeEventListener(l,v),f=null}},createHref:e=>t(a,e),createURL:w,encodeLocation(e){let t=w(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){d="PUSH";let r=u(e)?e:p(b.location,e,t);n&&n(r,e),g=y()+1;let i=h(r,g),l=b.createHref(r.mask||r);try{s.pushState(i,"",l)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;a.location.assign(l)}o&&f&&f({action:d,location:b.location,delta:1})},replace:function(e,t){d="REPLACE";let r=u(e)?e:p(b.location,e,t);n&&n(r,e),g=y();let a=h(r,g),i=b.createHref(r.mask||r);s.replaceState(a,"",i),o&&f&&f({action:d,location:b.location,delta:0})},go:e=>s.go(e)};return b}(function(e,t){let n=t.state?.masked,{pathname:r,search:a,hash:o}=n||e.location;return p("",{pathname:r,search:a,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default",n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)},function(e,t){return"string"==typeof t?t:m(t)},null,e)}function c(e,t){if(!1===e||null==e)throw new Error(t)}function d(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function h(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function p(e,t,n=null,r,a){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?f(t):t,state:n,key:t&&t.key||r||Math.random().toString(36).substring(2,10),mask:a}}function m({pathname:e="/",search:t="",hash:n=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),n&&"#"!==n&&(e+="#"===n.charAt(0)?n:"#"+n),e}function f(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function g(e,t,n="/"){return y(e,t,n,!1)}function y(e,t,n,r,a){let o=O(("string"==typeof t?f(t):t).pathname||"/",n);if(null==o)return null;let i=a??function(e){let t=v(e);return function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(t),t}(e),l=null,u=function(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return d(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}(o);for(let e=0;null==l&&e<i.length;++e)l=E(i[e],u,r);return l}function v(e,t=[],n=[],r="",a=!1){let o=(e,o,i=a,l)=>{let u={relativePath:void 0===l?e.path||"":l,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};if(u.relativePath.startsWith("/")){if(!u.relativePath.startsWith(r)&&i)return;c(u.relativePath.startsWith(r),`Absolute route path "${u.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),u.relativePath=u.relativePath.slice(r.length)}let s=N([r,u.relativePath]),d=n.concat(u);e.children&&e.children.length>0&&(c(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${s}".`),v(e.children,t,d,s,i)),(null!=e.path||e.index)&&t.push({path:s,score:P(s,e.index),routesMeta:d.map((e,t)=>{let[n,r]=C(e.relativePath,e.caseSensitive,t===d.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let n of w(e.path))o(e,t,!0,n);else o(e,t)}),t}function w(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,a=n.endsWith("?"),o=n.replace(/\?$/,"");if(0===r.length)return a?[o,""]:[o];let i=w(r.join("/")),l=[];return l.push(...i.map(e=>""===e?o:[o,e].join("/"))),a&&l.push(...i),l.map(t=>e.startsWith("/")&&""===t?"/":t)}new WeakMap;var b=/^:[\w-]+$/,S=e=>"*"===e;function P(e,t){let n=e.split("/"),r=n.length;return n.some(S)&&(r+=-2),t&&(r+=2),n.filter(e=>!S(e)).reduce((e,t)=>e+(b.test(t)?3:""===t?1:10),r)}function E(e,t,n=!1){let{routesMeta:r}=e,a={},o="/",i=[];for(let e=0;e<r.length;++e){let l=r[e],u=e===r.length-1,s="/"===o?t:t.slice(o.length)||"/",c={path:l.relativePath,caseSensitive:l.caseSensitive,end:u},d=l.matcher&&l.compiledParams?x(c,s,l.matcher,l.compiledParams):R(c,s),h=l.route;if(!d&&u&&n&&!r[r.length-1].route.index&&(d=R({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},s)),!d)return null;Object.assign(a,d.params),i.push({params:a,pathname:N([o,d.pathname]),pathnameBase:D(N([o,d.pathnameBase])),route:h}),"/"!==d.pathnameBase&&(o=N([o,d.pathnameBase]))}return i}function R(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=C(e.path,e.caseSensitive,e.end);return x(e,t,n,r)}function x(e,t,n,r){let a=t.match(n);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if("*"===t){let e=l[r]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const a=l[r];return e[t]=n&&!a?void 0:(a||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:i,pattern:e}}function C(e,t=!1,n=!0){d("*"===e||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,n,a,o)=>{if(r.push({paramName:t,isOptional:null!=n}),n){let t=o.charAt(a+e.length);return t&&"/"!==t?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function O(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function T(e,t){let n=M(t).split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}function $(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function k(e){let t=function(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function j(e,t,n,r=!1){let a;"string"==typeof e?a=f(e):(a={...e},c(!a.pathname||!a.pathname.includes("?"),$("?","pathname","search",a)),c(!a.pathname||!a.pathname.includes("#"),$("#","pathname","hash",a)),c(!a.search||!a.search.includes("#"),$("#","search","hash",a)));let o,i=""===e||""===a.pathname,l=i?"/":a.pathname;if(null==l)o=n;else{let e=t.length-1;if(!r&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}o=e>=0?t[e]:"/"}let u=function(e,t="/"){let n,{pathname:r,search:a="",hash:o=""}="string"==typeof e?f(e):e;return r?(r=A(r),n=r.startsWith("/")?T(r.substring(1),"/"):T(r,t)):n=t,{pathname:n,search:L(a),hash:_(o)}}(a,o),s=l&&"/"!==l&&l.endsWith("/"),d=(i||"."===l)&&n.endsWith("/");return u.pathname.endsWith("/")||!s&&!d||(u.pathname+="/"),u}var A=e=>e.replace(/[\\/]{2,}/g,"/"),N=e=>A(e.join("/")),M=e=>e.replace(/\/+$/,""),D=e=>M(e).replace(/^\/*/,"/"),L=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",_=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",U=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function W(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}function F(e){let t=e.map(e=>e.route.path).filter(Boolean);return N(t)||"/"}var B="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function J(e,t){let n=e;if("string"!=typeof n||!o.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(B)try{let e=new URL(window.location.href),r=i.test(n)?new URL((l=n,e.protocol+l.replace(/\\/g,"/"))):new URL(n),o=O(r.pathname,t);r.origin===e.origin&&null!=o?n=o+r.search+r.hash:a=!0}catch(e){d(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}var l;return{absoluteURL:r,isExternal:a,to:n}}Symbol("Uninstrumented"),Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Q=["POST","PUT","PATCH","DELETE"],I=(new Set(Q),["GET",...Q]);new Set(I),Symbol("ResetLoaderData"),new WeakMap,new WeakMap,new WeakMap,new WeakMap;var H=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];var q=r.createContext(null);q.displayName="DataRouter";var K=r.createContext(null);K.displayName="DataRouterState";var z=r.createContext(!1);function Y(){return r.useContext(z)}var V=r.createContext({isTransitioning:!1});V.displayName="ViewTransition",r.createContext(new Map).displayName="Fetchers",r.createContext(null).displayName="Await";var Z=r.createContext(null);Z.displayName="Navigation";var G=r.createContext(null);G.displayName="Location";var X=r.createContext({outlet:null,matches:[],isDataRoute:!1});X.displayName="Route";var ee=r.createContext(null);ee.displayName="RouteError";var te="REACT_ROUTER_ERROR";function ne(){return null!=r.useContext(G)}function re(){return c(ne(),"useLocation() may be used only in the context of a <Router> component."),r.useContext(G).location}var ae="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function oe(e){r.useContext(Z).static||r.useLayoutEffect(e)}function ie(){let{isDataRoute:e}=r.useContext(X);return e?function(){let{router:e}=function(e){let t=r.useContext(q);return c(t,fe(e)),t}("useNavigate"),t=ge("useNavigate"),n=r.useRef(!1);return oe(()=>{n.current=!0}),r.useCallback(async(r,a={})=>{d(n.current,ae),n.current&&("number"==typeof r?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...a}))},[e,t])}():function(){c(ne(),"useNavigate() may be used only in the context of a <Router> component.");let e=r.useContext(q),{basename:t,navigator:n}=r.useContext(Z),{matches:a}=r.useContext(X),{pathname:o}=re(),i=JSON.stringify(k(a)),l=r.useRef(!1);return oe(()=>{l.current=!0}),r.useCallback((r,a={})=>{if(d(l.current,ae),!l.current)return;if("number"==typeof r)return void n.go(r);let u=j(r,JSON.parse(i),o,"path"===a.relative);null==e&&"/"!==t&&(u.pathname="/"===u.pathname?t:N([t,u.pathname])),(a.replace?n.replace:n.push)(u,a.state,a)},[t,n,i,o,e])}()}function le(e,{relative:t}={}){let{matches:n}=r.useContext(X),{pathname:a}=re(),o=JSON.stringify(k(n));return r.useMemo(()=>j(e,JSON.parse(o),a,"path"===t),[e,o,a,t])}function ue(e,t,n){c(ne(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=r.useContext(Z),{matches:o}=r.useContext(X),i=o[o.length-1],l=i?i.params:{},u=i?i.pathname:"/",s=i?i.pathnameBase:"/",h=i&&i.route;{let e=h&&h.path||"";ve(u,!h||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}let p,m=re();if(t){let e="string"==typeof t?f(t):t;c("/"===s||e.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${e.pathname}" was given in the \`location\` prop.`),p=e}else p=m;let y=p.pathname||"/",v=y;if("/"!==s){let e=s.replace(/^\//,"").split("/");v="/"+y.replace(/^\//,"").split("/").slice(e.length).join("/")}let w=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):g(e,{pathname:v});d(h||null!=w,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),d(null==w||void 0!==w[w.length-1].route.element||void 0!==w[w.length-1].route.Component||void 0!==w[w.length-1].route.lazy,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let b=function(e,t=[],n){let a=n?.state;if(null==e){if(!a)return null;if(a.errors)e=a.matches;else{if(0!==t.length||a.initialized||!(a.matches.length>0))return null;e=a.matches}}let o=e,i=a?.errors;if(null!=i){let e=o.findIndex(e=>e.route.id&&void 0!==i?.[e.route.id]);c(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,e+1))}let l=!1,u=-1;if(n&&a){l=a.renderFallback;for(let e=0;e<o.length;e++){let t=o[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(u=e),t.route.id){let{loaderData:e,errors:r}=a,i=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!r||void 0===r[t.route.id]);if(t.route.lazy||i){n.isStatic&&(l=!0),o=u>=0?o.slice(0,u+1):[o[0]];break}}}}let s=n?.onError,d=a&&s?(e,t)=>{s(e,{location:a.location,params:a.matches?.[0]?.params??{},pattern:F(a.matches),errorInfo:t})}:void 0;return o.reduceRight((e,n,s)=>{let c,h=!1,p=null,m=null;a&&(c=i&&n.route.id?i[n.route.id]:void 0,p=n.route.errorElement||ce,l&&(u<0&&0===s?(ve("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),h=!0,m=null):u===s&&(h=!0,m=n.route.hydrateFallbackElement||null)));let f=t.concat(o.slice(0,s+1)),g=()=>{let t;return t=c?p:h?m:n.route.Component?r.createElement(n.route.Component,null):n.route.element?n.route.element:e,r.createElement(me,{match:n,routeContext:{outlet:e,matches:f,isDataRoute:null!=a},children:t})};return a&&(n.route.ErrorBoundary||n.route.errorElement||0===s)?r.createElement(de,{location:a.location,revalidation:a.revalidation,component:p,error:c,children:g(),routeContext:{outlet:null,matches:f,isDataRoute:!0},onError:d}):g()},null)}(w&&w.map(e=>Object.assign({},e,{params:Object.assign({},l,e.params),pathname:N([s,a.encodeLocation?a.encodeLocation(e.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?s:N([s,a.encodeLocation?a.encodeLocation(e.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathnameBase])})),o,n);return t&&b?r.createElement(G.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...p},navigationType:"POP"}},b):b}function se(){let e=function(){let e=r.useContext(ee),t=function(e){let t=r.useContext(K);return c(t,fe(e)),t}("useRouteError"),n=ge("useRouteError");return void 0!==e?e:t.errors?.[n]}(),t=W(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:a},i={padding:"2px 4px",backgroundColor:a},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=r.createElement(r.Fragment,null,r.createElement("p",null,"💿 Hey developer 👋"),r.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",r.createElement("code",{style:i},"ErrorBoundary")," or"," ",r.createElement("code",{style:i},"errorElement")," prop on your route.")),r.createElement(r.Fragment,null,r.createElement("h2",null,"Unexpected Application Error!"),r.createElement("h3",{style:{fontStyle:"italic"}},t),n?r.createElement("pre",{style:o},n):null,l)}r.createContext(null);var ce=r.createElement(se,null),de=class extends r.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&"object"==typeof e&&e&&"digest"in e&&"string"==typeof e.digest){const t=function(e){if(e.startsWith(`${te}:ROUTE_ERROR_RESPONSE:{`))try{let t=JSON.parse(e.slice(40));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText)return new U(t.status,t.statusText,t.data)}catch{}}(e.digest);t&&(e=t)}let t=void 0!==e?r.createElement(X.Provider,{value:this.props.routeContext},r.createElement(ee.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?r.createElement(pe,{error:e},t):t}};de.contextType=z;var he=new WeakMap;function pe({children:e,error:t}){let{basename:n}=r.useContext(Z);if("object"==typeof t&&t&&"digest"in t&&"string"==typeof t.digest){let e=function(e){if(e.startsWith(`${te}:REDIRECT:{`))try{let t=JSON.parse(e.slice(28));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"string"==typeof t.location&&"boolean"==typeof t.reloadDocument&&"boolean"==typeof t.replace)return t}catch{}}(t.digest);if(e){let a=he.get(t);if(a)throw a;let o=J(e.location,n),i=o.absoluteURL||o.to;if(function(e){try{return H.includes(new URL(e).protocol)}catch{return!1}}(i))throw new Error("Invalid redirect location");if(B&&!he.get(t)){if(!o.isExternal&&!e.reloadDocument){const n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:e.replace}));throw he.set(t,n),n}window.location.href=i}return r.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i}`})}}return e}function me({routeContext:e,match:t,children:n}){let a=r.useContext(q);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),r.createElement(X.Provider,{value:e},n)}function fe(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ge(e){let t=function(e){let t=r.useContext(X);return c(t,fe(e)),t}(e),n=t.matches[t.matches.length-1];return c(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}var ye={};function ve(e,t,n){t||ye[e]||(ye[e]=!0,d(!1,n))}function we({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:o,static:i=!1,useTransitions:l}){c(!ne(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),s=r.useMemo(()=>({basename:u,navigator:o,static:i,useTransitions:l,future:{}}),[u,o,i,l]);"string"==typeof n&&(n=f(n));let{pathname:h="/",search:p="",hash:m="",state:g=null,key:y="default",mask:v}=n,w=r.useMemo(()=>{let e=O(h,u);return null==e?null:{location:{pathname:e,search:p,hash:m,state:g,key:y,mask:v},navigationType:a}},[u,h,p,m,g,y,a,v]);return d(null!=w,`<Router basename="${u}"> is not able to match the URL "${h}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),null==w?null:r.createElement(Z.Provider,{value:s},r.createElement(G.Provider,{children:t,value:w}))}a.useOptimistic,r.memo(function({routes:e,manifest:t,future:n,state:r,isStatic:a,onError:o}){return ue(e,void 0,{manifest:t,state:r,isStatic:a,onError:o,future:n})}),r.Component;var be="get",Se="application/x-www-form-urlencoded";function Pe(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement}var Ee=null,Re=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function xe(e){return null==e||Re.has(e)?e:(d(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Se}"`),null)}function Ce(e,t){if(!1===e||null==e)throw new Error(t)}Object.getOwnPropertyNames(Object.prototype).sort().join("\0"),Symbol("SingleFetchRedirect");function Oe(e,t,n,r){let a="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${r}`:a.pathname=`${a.pathname}.${r}`:"/"===a.pathname?a.pathname=`_root.${r}`:t&&"/"===O(a.pathname,t)?a.pathname=`${M(t)}/_root.${r}`:a.pathname=`${M(a.pathname)}.${r}`,a}function Te(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}function $e(e,t,n,r,a,o){let i=(e,t)=>!n[t]||e.route.id!==n[t].route.id,l=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith("*")&&n[t].params["*"]!==e.params["*"];return"assets"===o?t.filter((e,t)=>i(e,t)||l(e,t)):"data"===o?t.filter((t,o)=>{let u=r.routes[t.route.id];if(!u||!u.hasLoader)return!1;if(i(t,o)||l(t,o))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof r)return r}return!0}):[]}function ke(e,t,{includeHydrateFallback:n}={}){return r=e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let a=[r.module];return r.clientActionModule&&(a=a.concat(r.clientActionModule)),r.clientLoaderModule&&(a=a.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(a=a.concat(r.hydrateFallbackModule)),r.imports&&(a=a.concat(r.imports)),a}).flat(1),[...new Set(r)];var r}function je(){let e=r.useContext(q);return Ce(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Ae(){let e=r.useContext(K);return Ce(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Ne=r.createContext(void 0);function Me(){let e=r.useContext(Ne);return Ce(e,"You must render this element inside a <HydratedRouter> element"),e}function De(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Le({page:e,...t}){let n=Y(),{nonce:a}=Me(),{router:o}=je(),i=r.useMemo(()=>g(o.routes,e,o.basename),[o.routes,e,o.basename]);return i?(null==t.nonce&&a&&(t={...t,nonce:a}),n?r.createElement(Ue,{page:e,matches:i,...t}):r.createElement(We,{page:e,matches:i,...t})):null}function _e(e){let{manifest:t,routeModules:n}=Me(),[a,o]=r.useState([]);return r.useEffect(()=>{let r=!1;return async function(e,t,n){return function(e,t){let n=new Set,r=new Set(t);return e.reduce((e,a)=>{if(t&&(null==(o=a)||"string"!=typeof o.page)&&"script"===a.as&&a.href&&r.has(a.href))return e;var o;let i=JSON.stringify(function(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}(a));return n.has(i)||(n.add(i),e.push({key:i,link:a})),e},[])}((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await async function(e,t){if(e.id in t)return t[e.id];try{let n=await(import(e.module));return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Te).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"}))}(e,t,n).then(e=>{r||o(e)}),()=>{r=!0}},[e,t,n]),a}function Ue({page:e,matches:t,...n}){let a=re(),{future:o}=Me(),{basename:i}=je(),l=r.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let n=Oe(e,i,o.v8_trailingSlashAwareDataRequests,"rsc"),r=!1,l=[];for(let e of t)"function"==typeof e.route.shouldRevalidate?r=!0:l.push(e.route.id);return r&&l.length>0&&n.searchParams.set("_routes",l.join(",")),[n.pathname+n.search]},[i,o.v8_trailingSlashAwareDataRequests,e,a,t]);return r.createElement(r.Fragment,null,l.map(e=>r.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...n})))}function We({page:e,matches:t,...n}){let a=re(),{future:o,manifest:i,routeModules:l}=Me(),{basename:u}=je(),{loaderData:s,matches:c}=Ae(),d=r.useMemo(()=>$e(e,t,c,i,a,"data"),[e,t,c,i,a]),h=r.useMemo(()=>$e(e,t,c,i,a,"assets"),[e,t,c,i,a]),p=r.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let n=new Set,r=!1;if(t.forEach(e=>{let t=i.routes[e.route.id];t&&t.hasLoader&&(!d.some(t=>t.route.id===e.route.id)&&e.route.id in s&&l[e.route.id]?.shouldRevalidate||t.hasClientLoader?r=!0:n.add(e.route.id))}),0===n.size)return[];let c=Oe(e,u,o.v8_trailingSlashAwareDataRequests,"data");return r&&n.size>0&&c.searchParams.set("_routes",t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(",")),[c.pathname+c.search]},[u,o.v8_trailingSlashAwareDataRequests,s,a,i,d,t,e,l]),m=r.useMemo(()=>ke(h,i),[h,i]),f=_e(h);return r.createElement(r.Fragment,null,p.map(e=>r.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...n})),m.map(e=>r.createElement("link",{key:e,rel:"modulepreload",href:e,...n})),f.map(({key:e,link:t})=>r.createElement("link",{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}Ne.displayName="FrameworkContext";function Fe(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}r.Component;var Be="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{Be&&(window.__reactRouterVersion="7.18.0")}catch(e){}function Je({basename:e,children:t,useTransitions:n,window:a}){let o=r.useRef();null==o.current&&(o.current=s({window:a,v5Compat:!0}));let i=o.current,[l,u]=r.useState({action:i.action,location:i.location}),c=r.useCallback(e=>{!1===n?u(e):r.startTransition(()=>u(e))},[n]);return r.useLayoutEffect(()=>i.listen(c),[i,c]),r.createElement(we,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:i,useTransitions:n})}var Qe=r.forwardRef(function({onClick:e,discover:t="render",prefetch:n="none",relative:a,reloadDocument:i,replace:l,mask:u,state:s,target:d,to:h,preventScrollReset:p,viewTransition:f,defaultShouldRevalidate:g,...y},v){let{basename:w,navigator:b,useTransitions:S}=r.useContext(Z),P="string"==typeof h&&o.test(h),E=J(h,w),R=function(e,{relative:t}={}){c(ne(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=r.useContext(Z),{hash:o,pathname:i,search:l}=le(e,{relative:t}),u=i;return"/"!==n&&(u="/"===i?n:N([n,i])),a.createHref({pathname:u,search:l,hash:o})}(h=E.to,{relative:a}),x=re(),C=null;if(u){let e=j(u,[],x.mask?x.mask.pathname:"/",!0);"/"!==w&&(e.pathname="/"===e.pathname?w:N([w,e.pathname])),C=b.createHref(e)}let[O,T,$]=function(e,t){let n=r.useContext(Ne),[a,o]=r.useState(!1),[i,l]=r.useState(!1),{onFocus:u,onBlur:s,onMouseEnter:c,onMouseLeave:d,onTouchStart:h}=t,p=r.useRef(null);r.useEffect(()=>{if("render"===e&&l(!0),"viewport"===e){let e=new IntersectionObserver(e=>{e.forEach(e=>{l(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),r.useEffect(()=>{if(a){let e=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(e)}}},[a]);let m=()=>{o(!0)},f=()=>{o(!1),l(!1)};return n?"intent"!==e?[i,p,{}]:[i,p,{onFocus:De(u,m),onBlur:De(s,f),onMouseEnter:De(c,m),onMouseLeave:De(d,f),onTouchStart:De(h,m)}]:[!1,p,{}]}(n,y),k=function(e,{target:t,replace:n,mask:a,state:o,preventScrollReset:i,relative:l,viewTransition:u,defaultShouldRevalidate:s,useTransitions:c}={}){let d=ie(),h=re(),p=le(e,{relative:l});return r.useCallback(f=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(f,t)){f.preventDefault();let t=void 0!==n?n:m(h)===m(p),g=()=>d(e,{replace:t,mask:a,state:o,preventScrollReset:i,relative:l,viewTransition:u,defaultShouldRevalidate:s});c?r.startTransition(()=>g()):g()}},[h,d,p,n,a,o,t,e,i,l,u,s,c])}(h,{replace:l,mask:u,state:s,target:d,preventScrollReset:p,relative:a,viewTransition:f,defaultShouldRevalidate:g,useTransitions:S}),A=!(E.isExternal||i),M=r.createElement("a",{...y,...$,href:(A?C:void 0)||E.absoluteURL||R,onClick:A?function(t){e&&e(t),t.defaultPrevented||k(t)}:e,ref:Fe(v,T),target:d,"data-discover":P||"render"!==t?void 0:"true"});return O&&!P?r.createElement(r.Fragment,null,M,r.createElement(Le,{page:R})):M});function Ie(e){let t=r.useContext(q);return c(t,function(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}(e)),t}Qe.displayName="Link",r.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:n="",end:a=!1,style:o,to:i,viewTransition:l,children:u,...s},d){let h=le(i,{relative:s.relative}),p=re(),m=r.useContext(K),{navigator:f,basename:g}=r.useContext(Z),y=null!=m&&function(e,{relative:t}={}){let n=r.useContext(V);c(null!=n,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Ie("useViewTransitionState"),o=le(e,{relative:t});if(!n.isTransitioning)return!1;let i=O(n.currentLocation.pathname,a)||n.currentLocation.pathname,l=O(n.nextLocation.pathname,a)||n.nextLocation.pathname;return null!=R(o.pathname,l)||null!=R(o.pathname,i)}(h)&&!0===l,v=f.encodeLocation?f.encodeLocation(h).pathname:h.pathname,w=p.pathname,b=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;t||(w=w.toLowerCase(),b=b?b.toLowerCase():null,v=v.toLowerCase()),b&&g&&(b=O(b,g)||b);const S="/"!==v&&v.endsWith("/")?v.length-1:v.length;let P,E=w===v||!a&&w.startsWith(v)&&"/"===w.charAt(S),x=null!=b&&(b===v||!a&&b.startsWith(v)&&"/"===b.charAt(v.length)),C={isActive:E,isPending:x,isTransitioning:y},T=E?e:void 0;P="function"==typeof n?n(C):[n,E?"active":null,x?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let $="function"==typeof o?o(C):o;return r.createElement(Qe,{...s,"aria-current":T,className:P,ref:d,style:$,to:i,viewTransition:l},"function"==typeof u?u(C):u)}).displayName="NavLink",r.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:i,state:l,method:u=be,action:s,onSubmit:d,relative:h,preventScrollReset:p,viewTransition:f,defaultShouldRevalidate:g,...y},v)=>{let{useTransitions:w}=r.useContext(Z),b=function(){let{router:e}=Ie("useSubmit"),{basename:t}=r.useContext(Z),n=ge("useRouteId"),a=e.fetch,o=e.navigate;return r.useCallback(async(e,r={})=>{let{action:i,method:l,encType:u,formData:s,body:c}=function(e,t){let n,r,a,o,i;if(Pe(l=e)&&"form"===l.tagName.toLowerCase()){let i=e.getAttribute("action");r=i?O(i,t):null,n=e.getAttribute("method")||be,a=xe(e.getAttribute("enctype"))||Se,o=new FormData(e)}else if(function(e){return Pe(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Pe(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||i.getAttribute("action");if(r=l?O(l,t):null,n=e.getAttribute("formmethod")||i.getAttribute("method")||be,a=xe(e.getAttribute("formenctype"))||xe(i.getAttribute("enctype"))||Se,o=new FormData(i,e),!function(){if(null===Ee)try{new FormData(document.createElement("form"),0),Ee=!1}catch(e){Ee=!0}return Ee}()){let{name:t,type:n,value:r}=e;if("image"===n){let e=t?`${t}.`:"";o.append(`${e}x`,"0"),o.append(`${e}y`,"0")}else t&&o.append(t,r)}}else{if(Pe(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=be,r=null,a=Se,i=e}var l;return o&&"text/plain"===a&&(i=o,o=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:o,body:i}}(e,t);if(!1===r.navigate){let e=r.fetcherKey||`__${String(++He)}__`;await a(e,n,r.action||i,{defaultShouldRevalidate:r.defaultShouldRevalidate,preventScrollReset:r.preventScrollReset,formData:s,body:c,formMethod:r.method||l,formEncType:r.encType||u,flushSync:r.flushSync})}else await o(r.action||i,{defaultShouldRevalidate:r.defaultShouldRevalidate,preventScrollReset:r.preventScrollReset,formData:s,body:c,formMethod:r.method||l,formEncType:r.encType||u,replace:r.replace,state:r.state,fromRouteId:n,flushSync:r.flushSync,viewTransition:r.viewTransition})},[a,o,t,n])}(),S=function(e,{relative:t}={}){let{basename:n}=r.useContext(Z),a=r.useContext(X);c(a,"useFormAction must be used inside a RouteContext");let[o]=a.matches.slice(-1),i={...le(e||".",{relative:t})},l=re();if(null==e){i.search=l.search;let e=new URLSearchParams(i.search),t=e.getAll("index");if(t.some(e=>""===e)){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let n=e.toString();i.search=n?`?${n}`:""}}return e&&"."!==e||!o.route.index||(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),"/"!==n&&(i.pathname="/"===i.pathname?n:N([n,i.pathname])),m(i)}(s,{relative:h}),P="get"===u.toLowerCase()?"get":"post",E="string"==typeof s&&o.test(s);return r.createElement("form",{ref:v,method:P,action:S,onSubmit:a?d:e=>{if(d&&d(e),e.defaultPrevented)return;e.preventDefault();let a=e.nativeEvent.submitter,o=a?.getAttribute("formmethod")||u,s=()=>b(a||e.currentTarget,{fetcherKey:t,method:o,navigate:n,replace:i,state:l,relative:h,preventScrollReset:p,viewTransition:f,defaultShouldRevalidate:g});w&&!1!==n?r.startTransition(()=>s()):s()},...y,"data-discover":E||"render"!==e?void 0:"true"})}).displayName="Form";var He=0;new TextEncoder,r.Component,a.use,window.ReactDOM}};const t={};function n(r){const a=t[r];if(void 0!==a)return a.exports;const o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},(()=>{const e=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;let t;n.t=function(r,a){if(1&a&&(r=this(r)),8&a)return r;if("object"==typeof r&&r){if(4&a&&r.__esModule)return r;if(16&a&&"function"==typeof r.then)return r}const o=Object.create(null);n.r(o);const i={};t=t||[null,e({}),e([]),e(e)];for(var l=2&a&&r;("object"==typeof l||"function"==typeof l)&&!~t.indexOf(l);l=e(l))Object.getOwnPropertyNames(l).forEach(e=>i[e]=()=>r[e]);return i.default=()=>r,n.d(o,i),o}})(),n.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var a=t[r++],o=t[r++];n.o(e,a)?0===o&&r++:0===o?Object.defineProperty(e,a,{enumerable:!0,value:t[r++]}):Object.defineProperty(e,a,{enumerable:!0,get:o})}else for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.hasOwn(e,t),n.r=e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.cjs=e=>{const t={exports:{}};return e.call(t.exports,t,t.exports),t.exports};let r={};(()=>{"use strict";n.r(r),n.d(r,{BrowserRouter:()=>o.Kd,ReactRouter6Adapter:()=>a.S});var e=n(223),t={};for(const n in e)["ReactRouter6Adapter","BrowserRouter","default"].indexOf(n)<0&&(t[n]=()=>e[n]);n.d(r,t),n(235);var a=n(972),o=n(725)})(),(window.popupMaker=window.popupMaker||{}).useQueryParams=r})();
Save File
Cancel