@qratilabs/qrati-connect 2.6.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/element/B8jogRzT.js +4 -0
  3. package/element/{wHbQZdly.js → BiQECCnr.js} +1 -1
  4. package/element/{B4-Qw59P.js → BjbDXTeP.js} +3 -3
  5. package/element/{DPOkh0eJ.js → COUnPxHl.js} +1 -1
  6. package/element/{DODG2TX4.js → CkfXzc1_.js} +1 -1
  7. package/element/{B28y50Bi.js → DGeYAYfl.js} +1 -1
  8. package/element/{CUOOhGTj.js → DXPR6JWg.js} +1 -1
  9. package/element/{D4xTzxjA.js → DqOnDVHH.js} +1 -1
  10. package/element/ThtSVXLE.js +32 -0
  11. package/element/{CH2f_afH.js → gajcOMzQ.js} +1 -1
  12. package/element/{Cf1QDu0i.js → ojjN3KY4.js} +1 -1
  13. package/element/web.es.js +192 -183
  14. package/element/xqhGemdL.js +16 -0
  15. package/package.json +1 -1
  16. package/react/{C4TTO8j2.js → B0pbGxj0.js} +1 -1
  17. package/react/B57jvRJw.js +1 -0
  18. package/react/{B8FlrdhF.js → B74JcfT2.js} +1 -1
  19. package/react/{Cs3wia2w.js → BBaYBpSS.js} +1 -1
  20. package/react/{pIx9IeV5.js → BUm8-ZtV.js} +1 -1
  21. package/react/Bran9aUe.js +32 -0
  22. package/react/{BaT1o9UO.js → CDAGXOJa.js} +1 -1
  23. package/react/{aragUG-J.js → CMUYyO6F.js} +1 -1
  24. package/react/CPs8NoX7.js +1 -0
  25. package/react/{DOw70z3P.js → CdZcv5CJ.js} +1 -1
  26. package/react/Ce4GGag_.js +1 -0
  27. package/react/CnRdB6_J.js +16 -0
  28. package/react/{e8YBtYhk.js → CzNVO0Zz.js} +1 -1
  29. package/react/{D7c4q3kj.js → D6h9tRAZ.js} +1 -1
  30. package/react/{DLf4fPpy.js → DCjmEjZr.js} +1 -1
  31. package/react/{BXiO9Rt2.js → DJ-3Sziz.js} +1 -1
  32. package/react/{DB3DJWUI.js → DKvJBrWM.js} +3 -3
  33. package/react/DSAOtDOg.js +4 -0
  34. package/react/{DEIcfk-y.js → DaQR1Bft.js} +1 -1
  35. package/react/{CT_Cvh8-.js → Dbq_PyC6.js} +1 -1
  36. package/react/{sxfIEK17.js → DdmNkEML.js} +1 -1
  37. package/react/{CNAEfadS.js → buiUjKpV.js} +1 -1
  38. package/react/{Czrz88CD.js → dLaHt9rf.js} +1 -1
  39. package/react/index.cjs +1 -1
  40. package/react/index.mjs +419 -410
  41. package/react/{Dljj3ToS.js → zrUJi_8F.js} +1 -1
  42. package/umd/web.umd.js +1 -1
  43. package/element/BKzoEuEi.js +0 -4
  44. package/element/B_TauT26.js +0 -1
  45. package/element/CudAoK3L.js +0 -32
  46. package/element/DHTkVJH6.js +0 -1
  47. package/element/Dc7DVn3n.js +0 -16
  48. package/react/BD2gDjZu.js +0 -1
  49. package/react/BUcttdEL.js +0 -1
  50. package/react/BXe4I1MJ.js +0 -32
  51. package/react/B_TauT26.js +0 -1
  52. package/react/BhU5cdLs.js +0 -1
  53. package/react/C1A9nC-v.js +0 -16
  54. package/react/DDbNaN3e.js +0 -4
  55. package/react/DHTkVJH6.js +0 -1
  56. package/react/DV6DJ1Br.js +0 -1
  57. package/react/QPXxc9eb.js +0 -1
  58. /package/element/{DMDEuqn7.js → BppxGns9.js} +0 -0
  59. /package/element/{Ccwm5LwS.js → C2ydm0ZD.js} +0 -0
  60. /package/element/{DSjmSa7l.js → CjmNvKgB.js} +0 -0
  61. /package/element/{ZShDCNL_.js → CziefUVo.js} +0 -0
  62. /package/element/{DD-DUfz5.js → DUlbZyIi.js} +0 -0
  63. /package/react/{CCCbXwws.js → BT55gXKs.js} +0 -0
  64. /package/react/{CEEUMvOM.js → Bxitmzur.js} +0 -0
  65. /package/react/{Bqe_56Ho.js → CO70kETi.js} +0 -0
  66. /package/react/{CssqM9iA.js → CR2MwRBM.js} +0 -0
  67. /package/react/{DV8H8PH6.js → CtCRzhKd.js} +0 -0
  68. /package/react/{BxS4S1Bm.js → CvLw8owR.js} +0 -0
  69. /package/react/{bYucjLbl.js → D5puLxf7.js} +0 -0
  70. /package/react/{BqRDSbh4.js → DtvJNH06.js} +0 -0
  71. /package/react/{DvZVbBR7.js → LDusNFdQ.js} +0 -0
  72. /package/react/{DYyT8DeU.js → zyOknCLQ.js} +0 -0
@@ -1 +1 @@
1
- const e=require("./D4geS7mP.js"),t=require("./DV6DJ1Br.js");let n=require("react");n=e.__toESM(n);var r="popstate";function a(e){return"object"==typeof e&&null!=e&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function o(e,t){if(!1===e||null==e)throw new Error(t)}function i(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(n){}}}function l(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function s(e,t,n=null,r,a){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?c(t):t,state:n,key:t&&t.key||r||Math.random().toString(36).substring(2,10),unstable_mask:a}}function u({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 c(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 h(e,t,n="/"){return function(e,t,n){let r=S(("string"==typeof t?c(t):t).pathname||"/",n);if(null==r)return null;let a=p(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every((e,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)))}(a);let o=null;for(let i=0;null==o&&i<a.length;++i){let e=C(r);o=E(a[i],e,false)}return o}(e,t,n)}function p(e,t=[],n=[],r="",a=!1){let i=(e,i,l=a,s)=>{let u={relativePath:void 0===s?e.path||"":s,caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};if(u.relativePath.startsWith("/")){if(!u.relativePath.startsWith(r)&&l)return;o(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 c=L([r,u.relativePath]),h=n.concat(u);e.children&&e.children.length>0&&(o(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),p(e.children,t,h,c,l)),(null!=e.path||e.index)&&t.push({path:c,score:x(c,e.index),routesMeta:h})};return e.forEach((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let n of d(e.path))i(e,t,!0,n);else i(e,t)}),t}function d(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=d(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)}var m=/^:[\w-]+$/,f=3,g=2,v=1,y=10,b=-2,w=e=>"*"===e;function x(e,t){let n=e.split("/"),r=n.length;return n.some(w)&&(r+=b),t&&(r+=g),n.filter(e=>!w(e)).reduce((e,t)=>e+(m.test(t)?f:""===t?v:y),r)}function E(e,t,n=!1){let{routesMeta:r}=e,a={},o="/",i=[];for(let l=0;l<r.length;++l){let e=r[l],s=l===r.length-1,u="/"===o?t:t.slice(o.length)||"/",c=R({path:e.relativePath,caseSensitive:e.caseSensitive,end:s},u),h=e.route;if(!c&&s&&n&&!r[r.length-1].route.index&&(c=R({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},u)),!c)return null;Object.assign(a,c.params),i.push({params:a,pathname:L([o,c.pathname]),pathnameBase:M(L([o,c.pathnameBase])),route:h}),"/"!==c.pathnameBase&&(o=L([o,c.pathnameBase]))}return i}function R(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t=!1,n=!0){i("*"===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]}(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let o=a[0],l=o.replace(/(.)\/+$/,"$1"),s=a.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if("*"===t){let e=s[r]||"";l=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const a=s[r];return e[t]=n&&!a?void 0:(a||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:l,pattern:e}}function C(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return i(!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}}function S(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)||"/"}var P=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function $(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}function k(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 O(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 T(e,t,n,r=!1){let a;"string"==typeof e?a=c(e):(a={...e},o(!a.pathname||!a.pathname.includes("?"),k("?","pathname","search",a)),o(!a.pathname||!a.pathname.includes("#"),k("#","pathname","hash",a)),o(!a.search||!a.search.includes("#"),k("#","search","hash",a)));let i,l=""===e||""===a.pathname,s=l?"/":a.pathname;if(null==s)i=n;else{let e=t.length-1;if(!r&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}i=e>=0?t[e]:"/"}let u=function(e,t="/"){let n,{pathname:r,search:a="",hash:o=""}="string"==typeof e?c(e):e;return r?(r=r.replace(/\/\/+/g,"/"),n=r.startsWith("/")?$(r.substring(1),"/"):$(r,t)):n=t,{pathname:n,search:_(a),hash:N(o)}}(a,i),h=s&&"/"!==s&&s.endsWith("/"),p=(l||"."===s)&&n.endsWith("/");return u.pathname.endsWith("/")||!h&&!p||(u.pathname+="/"),u}var L=e=>e.join("/").replace(/\/\/+/g,"/"),M=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),_=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",N=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",j=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 A(e){return e.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var D="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function U(e,t){let n=e;if("string"!=typeof n||!P.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(D)try{let e=new URL(window.location.href),r=n.startsWith("//")?new URL(e.protocol+n):new URL(n),o=S(r.pathname,t);r.origin===e.origin&&null!=o?n=o+r.search+r.hash:a=!0}catch(o){i(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:a,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var F=["POST","PUT","PATCH","DELETE"],W=(new Set(F),["GET",...F]),I=(new Set(W),n.createContext(null));I.displayName="DataRouter";var B=n.createContext(null);B.displayName="DataRouterState";var H=n.createContext(!1),z=n.createContext({isTransitioning:!1});z.displayName="ViewTransition",n.createContext(new Map).displayName="Fetchers",n.createContext(null).displayName="Await";var J=n.createContext(null);J.displayName="Navigation";var Y=n.createContext(null);Y.displayName="Location";var V=n.createContext({outlet:null,matches:[],isDataRoute:!1});V.displayName="Route";var q=n.createContext(null);q.displayName="RouteError";var K="REACT_ROUTER_ERROR";function X(){return null!=n.useContext(Y)}function G(){return o(X(),"useLocation() may be used only in the context of a <Router> component."),n.useContext(Y).location}var Q="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Z(e){n.useContext(J).static||n.useLayoutEffect(e)}function ee(){let{isDataRoute:e}=n.useContext(V);return e?function(){let{router:e}=function(){let e=n.useContext(I);return o(e,he("useNavigate")),e}(),t=pe("useNavigate"),r=n.useRef(!1);return Z(()=>{r.current=!0}),n.useCallback(async(n,a={})=>{i(r.current,Q),r.current&&("number"==typeof n?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...a}))},[e,t])}():function(){o(X(),"useNavigate() may be used only in the context of a <Router> component.");let e=n.useContext(I),{basename:t,navigator:r}=n.useContext(J),{matches:a}=n.useContext(V),{pathname:l}=G(),s=JSON.stringify(O(a)),u=n.useRef(!1);return Z(()=>{u.current=!0}),n.useCallback((n,a={})=>{if(i(u.current,Q),!u.current)return;if("number"==typeof n)return void r.go(n);let o=T(n,JSON.parse(s),l,"path"===a.relative);null==e&&"/"!==t&&(o.pathname="/"===o.pathname?t:L([t,o.pathname])),(a.replace?r.replace:r.push)(o,a.state,a)},[t,r,s,l,e])}()}var te=n.createContext(null);function ne(){let{matches:e}=n.useContext(V),t=e[e.length-1];return t?t.params:{}}function re(e,{relative:t}={}){let{matches:r}=n.useContext(V),{pathname:a}=G(),o=JSON.stringify(O(r));return n.useMemo(()=>T(e,JSON.parse(o),a,"path"===t),[e,o,a,t])}function ae(e,t,r){o(X(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=n.useContext(J),{matches:l}=n.useContext(V),s=l[l.length-1],u=s?s.params:{},p=s?s.pathname:"/",d=s?s.pathnameBase:"/",m=s&&s.route;{let e=m&&m.path||"";me(p,!m||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (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 f,g=G();if(t){let e="string"==typeof t?c(t):t;o("/"===d||e.pathname?.startsWith(d),`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 "${d}" but pathname "${e.pathname}" was given in the \`location\` prop.`),f=e}else f=g;let v=f.pathname||"/",y=v;if("/"!==d){let e=d.replace(/^\//,"").split("/");y="/"+v.replace(/^\//,"").split("/").slice(e.length).join("/")}let b=h(e,{pathname:y});i(m||null!=b,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),i(null==b||void 0!==b[b.length-1].route.element||void 0!==b[b.length-1].route.Component||void 0!==b[b.length-1].route.lazy,`Matched leaf route at location "${f.pathname}${f.search}${f.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 w=function(e,t=[],r){let a=r?.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 i=e,l=a?.errors;if(null!=l){let e=i.findIndex(e=>e.route.id&&void 0!==l?.[e.route.id]);o(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),i=i.slice(0,Math.min(i.length,e+1))}let s=!1,u=-1;if(r&&a){s=a.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(u=e),t.route.id){let{loaderData:e,errors:n}=a,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!n||void 0===n[t.route.id]);if(t.route.lazy||o){r.isStatic&&(s=!0),i=u>=0?i.slice(0,u+1):[i[0]];break}}}}let c=r?.onError,h=a&&c?(e,t)=>{c(e,{location:a.location,params:a.matches?.[0]?.params??{},unstable_pattern:A(a.matches),errorInfo:t})}:void 0;return i.reduceRight((e,r,o)=>{let c,p=!1,d=null,m=null;a&&(c=l&&r.route.id?l[r.route.id]:void 0,d=r.route.errorElement||ie,s&&(u<0&&0===o?(me("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),p=!0,m=null):u===o&&(p=!0,m=r.route.hydrateFallbackElement||null)));let f=t.concat(i.slice(0,o+1)),g=()=>{let t;return t=c?d:p?m:r.route.Component?n.createElement(r.route.Component,null):r.route.element?r.route.element:e,n.createElement(ce,{match:r,routeContext:{outlet:e,matches:f,isDataRoute:null!=a},children:t})};return a&&(r.route.ErrorBoundary||r.route.errorElement||0===o)?n.createElement(le,{location:a.location,revalidation:a.revalidation,component:d,error:c,children:g(),routeContext:{outlet:null,matches:f,isDataRoute:!0},onError:h}):g()},null)}(b&&b.map(e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:L([d,a.encodeLocation?a.encodeLocation(e.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:L([d,a.encodeLocation?a.encodeLocation(e.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathnameBase])})),l,r);return t&&w?n.createElement(Y.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...f},navigationType:"POP"}},w):w}function oe(){let e=function(){let e=n.useContext(q),t=function(e){let t=n.useContext(B);return o(t,he(e)),t}("useRouteError"),r=pe("useRouteError");return void 0!==e?e:t.errors?.[r]}(),t=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:a},l={padding:"2px 4px",backgroundColor:a},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=n.createElement(n.Fragment,null,n.createElement("p",null,"💿 Hey developer 👋"),n.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",n.createElement("code",{style:l},"ErrorBoundary")," or"," ",n.createElement("code",{style:l},"errorElement")," prop on your route.")),n.createElement(n.Fragment,null,n.createElement("h2",null,"Unexpected Application Error!"),n.createElement("h3",{style:{fontStyle:"italic"}},t),r?n.createElement("pre",{style:i},r):null,s)}var ie=n.createElement(oe,null),le=class extends n.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){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(`${K}: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 j(t.status,t.statusText,t.data)}catch{}}(e.digest);t&&(e=t)}let t=void 0!==e?n.createElement(V.Provider,{value:this.props.routeContext},n.createElement(q.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?n.createElement(ue,{error:e},t):t}};le.contextType=H;var se=new WeakMap;function ue({children:e,error:t}){let{basename:r}=n.useContext(J);if("object"==typeof t&&t&&"digest"in t&&"string"==typeof t.digest){let e=function(e){if(e.startsWith(`${K}: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=se.get(t);if(a)throw a;let o=U(e.location,r);if(D&&!se.get(t)){if(!o.isExternal&&!e.reloadDocument){const n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:e.replace}));throw se.set(t,n),n}window.location.href=o.absoluteURL||o.to}return n.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function ce({routeContext:e,match:t,children:r}){let a=n.useContext(I);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),n.createElement(V.Provider,{value:e},r)}function he(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function pe(e){let t=function(e){let t=n.useContext(V);return o(t,he(e)),t}(e),r=t.matches[t.matches.length-1];return o(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}var de={};function me(e,t,n){t||de[e]||(de[e]=!0,i(!1,n))}function fe({basename:e,children:t,initialEntries:r,initialIndex:o,unstable_useTransitions:l}){let h=n.useRef();null==h.current&&(h.current=function(e={}){let t,{initialEntries:n=["/"],initialIndex:r,v5Compat:o=!1}=e;t=n.map((e,t)=>f(e,"string"==typeof e?null:e.state,0===t?"default":void 0,"string"==typeof e?void 0:e.unstable_mask));let l=d(null==r?t.length-1:r),h="POP",p=null;function d(e){return Math.min(Math.max(e,0),t.length-1)}function m(){return t[l]}function f(e,n=null,r,a){let o=s(t?m().pathname:"/",e,n,r,a);return i("/"===o.pathname.charAt(0),`relative pathnames are not supported in memory history: ${JSON.stringify(e)}`),o}function g(e){return"string"==typeof e?e:u(e)}return{get index(){return l},get action(){return h},get location(){return m()},createHref:g,createURL:e=>new URL(g(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?c(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,n){h="PUSH";let r=a(e)?e:f(e,n);l+=1,t.splice(l,t.length,r),o&&p&&p({action:h,location:r,delta:1})},replace(e,n){h="REPLACE";let r=a(e)?e:f(e,n);t[l]=r,o&&p&&p({action:h,location:r,delta:0})},go(e){h="POP";let n=d(l+e),r=t[n];l=n,p&&p({action:h,location:r,delta:e})},listen:e=>(p=e,()=>{p=null})}}({initialEntries:r,initialIndex:o,v5Compat:!0}));let p=h.current,[d,m]=n.useState({action:p.action,location:p.location}),f=n.useCallback(e=>{!1===l?m(e):n.startTransition(()=>m(e))},[l]);return n.useLayoutEffect(()=>p.listen(f),[p,f]),n.createElement(be,{basename:e,children:t,location:d.location,navigationType:d.action,navigator:p,unstable_useTransitions:l})}function ge({to:e,replace:t,state:r,relative:a}){o(X(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=n.useContext(J);i(!l,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=n.useContext(V),{pathname:u}=G(),c=ee(),h=T(e,O(s),u,"path"===a),p=JSON.stringify(h);return n.useEffect(()=>{c(JSON.parse(p),{replace:t,state:r,relative:a})},[c,p,a,t,r]),null}function ve(e){return function(e){let t=n.useContext(V).outlet;return n.useMemo(()=>t&&n.createElement(te.Provider,{value:e},t),[t,e])}(e.context)}function ye(e){o(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function be({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:l,static:s=!1,unstable_useTransitions:u}){o(!X(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let h=e.replace(/^\/*/,"/"),p=n.useMemo(()=>({basename:h,navigator:l,static:s,unstable_useTransitions:u,future:{}}),[h,l,s,u]);"string"==typeof r&&(r=c(r));let{pathname:d="/",search:m="",hash:f="",state:g=null,key:v="default",unstable_mask:y}=r,b=n.useMemo(()=>{let e=S(d,h);return null==e?null:{location:{pathname:e,search:m,hash:f,state:g,key:v,unstable_mask:y},navigationType:a}},[h,d,m,f,g,v,a,y]);return i(null!=b,`<Router basename="${h}"> is not able to match the URL "${d}${m}${f}" because it does not start with the basename, so the <Router> won't render anything.`),null==b?null:n.createElement(J.Provider,{value:p},n.createElement(Y.Provider,{children:t,value:b}))}function we({children:e,location:t}){return ae(xe(e),t)}function xe(e,t=[]){let r=[];return n.Children.forEach(e,(e,a)=>{if(!n.isValidElement(e))return;let i=[...t,a];if(e.type===n.Fragment)return void r.push.apply(r,xe(e.props.children,i));o(e.type===ye,`[${"string"==typeof e.type?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),o(!e.props.index||!e.props.children,"An index route cannot have child routes.");let l={id:e.props.id||i.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:!0===e.props.hasErrorBoundary||null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(l.children=xe(e.props.children,i)),r.push(l)}),r}n.useOptimistic,n.memo(function({routes:e,future:t,state:n,isStatic:r,onError:a}){return ae(e,void 0,{state:n,isStatic:r,onError:a,future:t})});var Ee="get",Re="application/x-www-form-urlencoded";function Ce(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement}var Se=null,Pe=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function $e(e){return null==e||Pe.has(e)?e:(i(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Re}"`),null)}function ke(e,t){if(!1===e||null==e)throw new Error(t)}function Oe(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 Te(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 s=r.routes[t.route.id];if(!s||!s.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 Le(){let e=n.useContext(I);return ke(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Me=n.createContext(void 0);function _e(){let e=n.useContext(Me);return ke(e,"You must render this element inside a <HydratedRouter> element"),e}function Ne(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function je({page:e,...t}){let{router:r}=Le(),a=n.useMemo(()=>h(r.routes,e,r.basename),[r.routes,e,r.basename]);return a?n.createElement(Ae,{page:e,matches:a,...t}):null}function Ae({page:e,matches:t,...r}){let a=G(),{future:o,manifest:i,routeModules:l}=_e(),{basename:s}=Le(),{loaderData:u,matches:c}=function(){let e=n.useContext(B);return ke(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}(),h=n.useMemo(()=>Te(e,t,c,i,a,"data"),[e,t,c,i,a]),p=n.useMemo(()=>Te(e,t,c,i,a,"assets"),[e,t,c,i,a]),d=n.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&&(!h.some(t=>t.route.id===e.route.id)&&e.route.id in u&&l[e.route.id]?.shouldRevalidate||t.hasClientLoader?r=!0:n.add(e.route.id))}),0===n.size)return[];let c=function(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&&"/"===S(a.pathname,t)?a.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a}(e,s,o.unstable_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]},[s,o.unstable_trailingSlashAwareDataRequests,u,a,i,h,t,e,l]),m=n.useMemo(()=>function(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}(p,i),[p,i]),f=function(e){let{manifest:t,routeModules:r}=_e(),[a,o]=n.useState([]);return n.useEffect(()=>{let n=!1;return async function(e,t,n){return function(e,t){let n=new Set;return new Set(t),e.reduce((e,t)=>{let r=JSON.stringify(function(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}(t));return n.has(r)||(n.add(r),e.push({key:r,link:t})),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(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Oe).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"}))}(e,t,r).then(e=>{n||o(e)}),()=>{n=!0}},[e,t,r]),a}(p);return n.createElement(n.Fragment,null,d.map(e=>n.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...r})),m.map(e=>n.createElement("link",{key:e,rel:"modulepreload",href:e,...r})),f.map(({key:e,link:t})=>n.createElement("link",{key:e,nonce:r.nonce,...t,crossOrigin:t.crossOrigin??r.crossOrigin})))}function De(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}Me.displayName="FrameworkContext";var Ue="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{Ue&&(window.__reactRouterVersion="7.13.1")}catch(yt){}function Fe({basename:e,children:t,unstable_useTransitions:h,window:p}){let d=n.useRef();null==d.current&&(d.current=function(e={}){return function(e,t,n,i={}){let{window:c=document.defaultView,v5Compat:h=!1}=i,p=c.history,d="POP",m=null,f=g();function g(){return(p.state||{idx:null}).idx}function v(){d="POP";let e=g(),t=null==e?null:e-f;f=e,m&&m({action:d,location:b.location,delta:t})}function y(e){return function(e,t=!1){let n="http://localhost";"undefined"!=typeof window&&(n="null"!==window.location.origin?window.location.origin:window.location.href),o(n,"No window.location.(origin|href) available to create URL");let r="string"==typeof e?e:u(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}(e)}null==f&&(f=0,p.replaceState({...p.state,idx:f},""));let b={get action(){return d},get location(){return e(c,p)},listen(e){if(m)throw new Error("A history only accepts one active listener");return c.addEventListener(r,v),m=e,()=>{c.removeEventListener(r,v),m=null}},createHref:e=>t(c,e),createURL:y,encodeLocation(e){let t=y(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){d="PUSH";let r=a(e)?e:s(b.location,e,t);n&&n(r,e),f=g()+1;let o=l(r,f),i=b.createHref(r.unstable_mask||r);try{p.pushState(o,"",i)}catch(u){if(u instanceof DOMException&&"DataCloneError"===u.name)throw u;c.location.assign(i)}h&&m&&m({action:d,location:b.location,delta:1})},replace:function(e,t){d="REPLACE";let r=a(e)?e:s(b.location,e,t);n&&n(r,e),f=g();let o=l(r,f),i=b.createHref(r.unstable_mask||r);p.replaceState(o,"",i),h&&m&&m({action:d,location:b.location,delta:0})},go:e=>p.go(e)};return b}(function(e,t){let{pathname:n="/",search:r="",hash:a=""}=c(e.location.hash.substring(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),s("",{pathname:n,search:r,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"==typeof t?t:u(t))},function(e,t){i("/"===e.pathname.charAt(0),`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)},e)}({window:p,v5Compat:!0}));let m=d.current,[f,g]=n.useState({action:m.action,location:m.location}),v=n.useCallback(e=>{!1===h?g(e):n.startTransition(()=>g(e))},[h]);return n.useLayoutEffect(()=>m.listen(v),[m,v]),n.createElement(be,{basename:e,children:t,location:f.location,navigationType:f.action,navigator:m,unstable_useTransitions:h})}var We=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ie=n.forwardRef(function({onClick:e,discover:t="render",prefetch:r="none",relative:a,reloadDocument:i,replace:l,unstable_mask:s,state:c,target:h,to:p,preventScrollReset:d,viewTransition:m,unstable_defaultShouldRevalidate:f,...g},v){let{basename:y,navigator:b,unstable_useTransitions:w}=n.useContext(J),x="string"==typeof p&&We.test(p),E=U(p,y),R=function(e,{relative:t}={}){o(X(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=n.useContext(J),{hash:i,pathname:l,search:s}=re(e,{relative:t}),u=l;return"/"!==r&&(u="/"===l?r:L([r,l])),a.createHref({pathname:u,search:s,hash:i})}(p=E.to,{relative:a}),C=G(),S=null;if(s){let e=T(s,[],C.unstable_mask?C.unstable_mask.pathname:"/",!0);"/"!==y&&(e.pathname="/"===e.pathname?y:L([y,e.pathname])),S=b.createHref(e)}let[P,$,k]=function(e,t){let r=n.useContext(Me),[a,o]=n.useState(!1),[i,l]=n.useState(!1),{onFocus:s,onBlur:u,onMouseEnter:c,onMouseLeave:h,onTouchStart:p}=t,d=n.useRef(null);n.useEffect(()=>{if("render"===e&&l(!0),"viewport"===e){let e=new IntersectionObserver(e=>{e.forEach(e=>{l(e.isIntersecting)})},{threshold:.5});return d.current&&e.observe(d.current),()=>{e.disconnect()}}},[e]),n.useEffect(()=>{if(a){let e=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(e)}}},[a]);let m=()=>{o(!0)},f=()=>{o(!1),l(!1)};return r?"intent"!==e?[i,d,{}]:[i,d,{onFocus:Ne(s,m),onBlur:Ne(u,f),onMouseEnter:Ne(c,m),onMouseLeave:Ne(h,f),onTouchStart:Ne(p,m)}]:[!1,d,{}]}(r,g),O=function(e,{target:t,replace:r,unstable_mask:a,state:o,preventScrollReset:i,relative:l,viewTransition:s,unstable_defaultShouldRevalidate:c,unstable_useTransitions:h}={}){let p=ee(),d=G(),m=re(e,{relative:l});return n.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!==r?r:u(d)===u(m),g=()=>p(e,{replace:t,unstable_mask:a,state:o,preventScrollReset:i,relative:l,viewTransition:s,unstable_defaultShouldRevalidate:c});h?n.startTransition(()=>g()):g()}},[d,p,m,r,a,o,t,e,i,l,s,c,h])}(p,{replace:l,unstable_mask:s,state:c,target:h,preventScrollReset:d,relative:a,viewTransition:m,unstable_defaultShouldRevalidate:f,unstable_useTransitions:w}),M=!(E.isExternal||i),_=n.createElement("a",{...g,...k,href:(M?S:void 0)||E.absoluteURL||R,onClick:M?function(t){e&&e(t),t.defaultPrevented||O(t)}:e,ref:De(v,$),target:h,"data-discover":x||"render"!==t?void 0:"true"});return P&&!x?n.createElement(n.Fragment,null,_,n.createElement(je,{page:R})):_});Ie.displayName="Link";var Be=n.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:r="",end:a=!1,style:i,to:l,viewTransition:s,children:u,...c},h){let p=re(l,{relative:c.relative}),d=G(),m=n.useContext(B),{navigator:f,basename:g}=n.useContext(J),v=null!=m&&function(e,{relative:t}={}){let r=n.useContext(z);o(null!=r,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=ze("useViewTransitionState"),i=re(e,{relative:t});if(!r.isTransitioning)return!1;let l=S(r.currentLocation.pathname,a)||r.currentLocation.pathname,s=S(r.nextLocation.pathname,a)||r.nextLocation.pathname;return null!=R(i.pathname,s)||null!=R(i.pathname,l)}(p)&&!0===s,y=f.encodeLocation?f.encodeLocation(p).pathname:p.pathname,b=d.pathname,w=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;t||(b=b.toLowerCase(),w=w?w.toLowerCase():null,y=y.toLowerCase()),w&&g&&(w=S(w,g)||w);const x="/"!==y&&y.endsWith("/")?y.length-1:y.length;let E,C=b===y||!a&&b.startsWith(y)&&"/"===b.charAt(x),P=null!=w&&(w===y||!a&&w.startsWith(y)&&"/"===w.charAt(y.length)),$={isActive:C,isPending:P,isTransitioning:v},k=C?e:void 0;E="function"==typeof r?r($):[r,C?"active":null,P?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let O="function"==typeof i?i($):i;return n.createElement(Ie,{...c,"aria-current":k,className:E,ref:h,style:O,to:l,viewTransition:s},"function"==typeof u?u($):u)});Be.displayName="NavLink";var He=n.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:i,state:l,method:s=Ee,action:c,onSubmit:h,relative:p,preventScrollReset:d,viewTransition:m,unstable_defaultShouldRevalidate:f,...g},v)=>{let{unstable_useTransitions:y}=n.useContext(J),b=function(){let{router:e}=ze("useSubmit"),{basename:t}=n.useContext(J),r=pe("useRouteId"),a=e.fetch,o=e.navigate;return n.useCallback(async(e,n={})=>{let{action:i,method:l,encType:s,formData:u,body:c}=function(e,t){let n,r,a,o,i;if(Ce(l=e)&&"form"===l.tagName.toLowerCase()){let i=e.getAttribute("action");r=i?S(i,t):null,n=e.getAttribute("method")||Ee,a=$e(e.getAttribute("enctype"))||Re,o=new FormData(e)}else if(function(e){return Ce(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Ce(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?S(l,t):null,n=e.getAttribute("formmethod")||i.getAttribute("method")||Ee,a=$e(e.getAttribute("formenctype"))||$e(i.getAttribute("enctype"))||Re,o=new FormData(i,e),!function(){if(null===Se)try{new FormData(document.createElement("form"),0),Se=!1}catch(yt){Se=!0}return Se}()){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(Ce(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Ee,r=null,a=Re,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);!1===n.navigate?await a(n.fetcherKey||Ye(),r,n.action||i,{unstable_defaultShouldRevalidate:n.unstable_defaultShouldRevalidate,preventScrollReset:n.preventScrollReset,formData:u,body:c,formMethod:n.method||l,formEncType:n.encType||s,flushSync:n.flushSync}):await o(n.action||i,{unstable_defaultShouldRevalidate:n.unstable_defaultShouldRevalidate,preventScrollReset:n.preventScrollReset,formData:u,body:c,formMethod:n.method||l,formEncType:n.encType||s,replace:n.replace,state:n.state,fromRouteId:r,flushSync:n.flushSync,viewTransition:n.viewTransition})},[a,o,t,r])}(),w=function(e,{relative:t}={}){let{basename:r}=n.useContext(J),a=n.useContext(V);o(a,"useFormAction must be used inside a RouteContext");let[i]=a.matches.slice(-1),l={...re(e||".",{relative:t})},s=G();if(null==e){l.search=s.search;let e=new URLSearchParams(l.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();l.search=n?`?${n}`:""}}return e&&"."!==e||!i.route.index||(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),"/"!==r&&(l.pathname="/"===l.pathname?r:L([r,l.pathname])),u(l)}(c,{relative:p}),x="get"===s.toLowerCase()?"get":"post",E="string"==typeof c&&We.test(c);return n.createElement("form",{ref:v,method:x,action:w,onSubmit:a?h:e=>{if(h&&h(e),e.defaultPrevented)return;e.preventDefault();let a=e.nativeEvent.submitter,o=a?.getAttribute("formmethod")||s,u=()=>b(a||e.currentTarget,{fetcherKey:t,method:o,navigate:r,replace:i,state:l,relative:p,preventScrollReset:d,viewTransition:m,unstable_defaultShouldRevalidate:f});y&&!1!==r?n.startTransition(()=>u()):u()},...g,"data-discover":E||"render"!==e?void 0:"true"})});function ze(e){let t=n.useContext(I);return o(t,function(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}(e)),t}He.displayName="Form";var Je=0,Ye=()=>`__${String(++Je)}__`,Ve=({as:e="div",className:n,threshold:r=.5,rootMargin:a="0px",triggerOnce:o,onChange:i,onClick:l,children:s})=>{const u=t.A(null),c=t.A(!1);return t.y(()=>{const e=u.current;if(!e)return;const t=new IntersectionObserver(e=>{e.forEach(e=>{o&&c.current||(e.isIntersecting&&(c.current=!0),i?.(e.isIntersecting))})},{threshold:r,rootMargin:a});return t.observe(e),()=>t.disconnect()},[r,a,i,o]),t.u(e,{ref:u,className:n,onClick:l,children:s})},qe=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],Ke=e=>{let t=0;for(let n=0;n<e.length;n++){let r=e[n];t=83*t+qe.indexOf(r)}return t},Xe=e=>{let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Ge=e=>{let t=Math.max(0,Math.min(1,e));return t<=.0031308?Math.trunc(12.92*t*255+.5):Math.trunc(255*(1.055*Math.pow(t,.4166666666666667)-.055)+.5)},Qe=(e,t)=>(e=>e<0?-1:1)(e)*Math.pow(Math.abs(e),t),Ze=class extends Error{constructor(e){super(e),this.name="ValidationError",this.message=e}},et=e=>{let t=e>>8&255,n=255&e;return[Xe(e>>16),Xe(t),Xe(n)]},tt=(e,t)=>{let n=Math.floor(e/361),r=Math.floor(e/19)%19,a=e%19;return[Qe((n-9)/9,2)*t,Qe((r-9)/9,2)*t,Qe((a-9)/9,2)*t]},nt=(e,t,n,r)=>{(e=>{if(!e||e.length<6)throw new Ze("The blurhash string must be at least 6 characters");let t=Ke(e[0]),n=Math.floor(t/9)+1,r=t%9+1;if(e.length!==4+2*r*n)throw new Ze(`blurhash length mismatch: length is ${e.length} but it should be ${4+2*r*n}`)})(e),r|=1;let a=Ke(e[0]),o=Math.floor(a/9)+1,i=a%9+1,l=(Ke(e[1])+1)/166,s=new Array(i*o);for(let h=0;h<s.length;h++)s[h]=0===h?et(Ke(e.substring(2,6))):tt(Ke(e.substring(4+2*h,6+2*h)),l*r);let u=4*t,c=new Uint8ClampedArray(u*n);for(let h=0;h<n;h++)for(let e=0;e<t;e++){let r=0,a=0,l=0;for(let u=0;u<o;u++)for(let o=0;o<i;o++){let c=Math.cos(Math.PI*e*o/t)*Math.cos(Math.PI*h*u/n),p=s[o+u*i];r+=p[0]*c,a+=p[1]*c,l+=p[2]*c}let p=Ge(r),d=Ge(a),m=Ge(l);c[4*e+0+h*u]=p,c[4*e+1+h*u]=d,c[4*e+2+h*u]=m,c[4*e+3+h*u]=255}return c},rt=Object.defineProperty,at=Object.defineProperties,ot=Object.getOwnPropertyDescriptors,it=Object.getOwnPropertySymbols,lt=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable,ut=(e,t,n)=>t in e?rt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ct=(e,t)=>{for(var n in t||(t={}))lt.call(t,n)&&ut(e,n,t[n]);if(it)for(var n of it(t))st.call(t,n)&&ut(e,n,t[n]);return e},ht=(e,t)=>at(e,ot(t)),pt=(e,t)=>{var n={};for(var r in e)lt.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&it)for(var r of it(e))t.indexOf(r)<0&&st.call(e,r)&&(n[r]=e[r]);return n},dt=class extends n.PureComponent{constructor(){super(...arguments),this.canvas=null,this.handleRef=e=>{this.canvas=e,this.draw()},this.draw=()=>{let{hash:e,height:t,punch:n,width:r}=this.props;if(this.canvas){let a=nt(e,r,t,n),o=this.canvas.getContext("2d"),i=o.createImageData(r,t);i.data.set(a),o.putImageData(i,0,0)}}}componentDidUpdate(){this.draw()}render(){let e=this.props,{hash:t,height:r,width:a}=e,o=pt(e,["hash","height","width"]);return n.createElement("canvas",ht(ct({},o),{height:r,width:a,ref:this.handleRef}))}};dt.defaultProps={height:128,width:128};var mt={position:"absolute",top:0,bottom:0,left:0,right:0,width:"100%",height:"100%"},ft=class extends n.PureComponent{componentDidUpdate(){if(this.props.resolutionX<=0)throw new Error("resolutionX must be larger than zero");if(this.props.resolutionY<=0)throw new Error("resolutionY must be larger than zero")}render(){let e=this.props,{hash:t,height:r,width:a,punch:o,resolutionX:i,resolutionY:l,style:s}=e,u=pt(e,["hash","height","width","punch","resolutionX","resolutionY","style"]);return n.createElement("div",ht(ct({},u),{style:ht(ct({display:"inline-block",height:r,width:a},s),{position:"relative"})}),n.createElement(dt,{hash:t,height:l,width:i,punch:o,style:mt}))}};ft.defaultProps={height:128,width:128,resolutionX:32,resolutionY:32};var gt=dt,vt=({src:e,alt:n,threshold:r=.1,rootMargin:a="200px 0px",blurhash:o,containerClassName:i="size-full",wrapperClassName:l,imgClassName:s="",sizeMode:u="cover",position:c="center",delayMs:h=100,delayTime:p,onClick:d})=>{const m=o&&o.length>=6?o:"LEHV6nWB2yk8pyo0adR*.7kCMdnj",[f,g]=t.d(!1),[v,y]=t.d(!1),[b,w]=t.d(!1),x=t.A(null),E="number"==typeof p?p:h,R=l??i;t.y(()=>{if(!f)return b?x.current=window.setTimeout(()=>{y(!0)},E):x.current&&(clearTimeout(x.current),x.current=null),()=>{x.current&&clearTimeout(x.current)}},[b,f,E]);const C=v&&b||f;return t.u(Ve,{as:"div",className:t.cn(R,"relative overflow-hidden"),threshold:r,rootMargin:a,onChange:e=>w(e),children:[!f&&t.u(gt,{className:"size-full blur-2xl",hash:m}),C&&e&&t.u("img",{alt:n,src:e,onLoad:()=>g(!0),className:t.cn("absolute top-0 left-0 size-full object-center transition-all duration-300",f?"scale-100 opacity-100":"scale-95 opacity-0","contain"===u?"object-contain":"object-cover","top"===c?"object-top":"bottom"===c?"object-bottom":"object-center",s),onClick:e=>d?.(e)})]})};Object.defineProperty(exports,"HashRouter",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,"InView",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,"LazyLoadImage",{enumerable:!0,get:function(){return vt}}),Object.defineProperty(exports,"Link",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"MemoryRouter",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(exports,"NavLink",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"Navigate",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,"Outlet",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,"Route",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(exports,"Routes",{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(exports,"useLocation",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"useNavigate",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,"useParams",{enumerable:!0,get:function(){return ne}});
1
+ const e=require("./D4geS7mP.js"),t=require("./CPs8NoX7.js");let n=require("react");n=e.__toESM(n);var r="popstate";function a(e){return"object"==typeof e&&null!=e&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function o(e,t){if(!1===e||null==e)throw new Error(t)}function i(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(n){}}}function l(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function s(e,t,n=null,r,a){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?c(t):t,state:n,key:t&&t.key||r||Math.random().toString(36).substring(2,10),unstable_mask:a}}function u({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 c(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 h(e,t,n="/"){return function(e,t,n){let r=S(("string"==typeof t?c(t):t).pathname||"/",n);if(null==r)return null;let a=p(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every((e,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)))}(a);let o=null;for(let i=0;null==o&&i<a.length;++i){let e=C(r);o=E(a[i],e,false)}return o}(e,t,n)}function p(e,t=[],n=[],r="",a=!1){let i=(e,i,l=a,s)=>{let u={relativePath:void 0===s?e.path||"":s,caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};if(u.relativePath.startsWith("/")){if(!u.relativePath.startsWith(r)&&l)return;o(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 c=L([r,u.relativePath]),h=n.concat(u);e.children&&e.children.length>0&&(o(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),p(e.children,t,h,c,l)),(null!=e.path||e.index)&&t.push({path:c,score:x(c,e.index),routesMeta:h})};return e.forEach((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let n of d(e.path))i(e,t,!0,n);else i(e,t)}),t}function d(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=d(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)}var m=/^:[\w-]+$/,f=3,g=2,v=1,y=10,b=-2,w=e=>"*"===e;function x(e,t){let n=e.split("/"),r=n.length;return n.some(w)&&(r+=b),t&&(r+=g),n.filter(e=>!w(e)).reduce((e,t)=>e+(m.test(t)?f:""===t?v:y),r)}function E(e,t,n=!1){let{routesMeta:r}=e,a={},o="/",i=[];for(let l=0;l<r.length;++l){let e=r[l],s=l===r.length-1,u="/"===o?t:t.slice(o.length)||"/",c=R({path:e.relativePath,caseSensitive:e.caseSensitive,end:s},u),h=e.route;if(!c&&s&&n&&!r[r.length-1].route.index&&(c=R({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},u)),!c)return null;Object.assign(a,c.params),i.push({params:a,pathname:L([o,c.pathname]),pathnameBase:M(L([o,c.pathnameBase])),route:h}),"/"!==c.pathnameBase&&(o=L([o,c.pathnameBase]))}return i}function R(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t=!1,n=!0){i("*"===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]}(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let o=a[0],l=o.replace(/(.)\/+$/,"$1"),s=a.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if("*"===t){let e=s[r]||"";l=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const a=s[r];return e[t]=n&&!a?void 0:(a||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:l,pattern:e}}function C(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return i(!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}}function S(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)||"/"}var P=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function $(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}function k(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 O(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 T(e,t,n,r=!1){let a;"string"==typeof e?a=c(e):(a={...e},o(!a.pathname||!a.pathname.includes("?"),k("?","pathname","search",a)),o(!a.pathname||!a.pathname.includes("#"),k("#","pathname","hash",a)),o(!a.search||!a.search.includes("#"),k("#","search","hash",a)));let i,l=""===e||""===a.pathname,s=l?"/":a.pathname;if(null==s)i=n;else{let e=t.length-1;if(!r&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}i=e>=0?t[e]:"/"}let u=function(e,t="/"){let n,{pathname:r,search:a="",hash:o=""}="string"==typeof e?c(e):e;return r?(r=r.replace(/\/\/+/g,"/"),n=r.startsWith("/")?$(r.substring(1),"/"):$(r,t)):n=t,{pathname:n,search:_(a),hash:N(o)}}(a,i),h=s&&"/"!==s&&s.endsWith("/"),p=(l||"."===s)&&n.endsWith("/");return u.pathname.endsWith("/")||!h&&!p||(u.pathname+="/"),u}var L=e=>e.join("/").replace(/\/\/+/g,"/"),M=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),_=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",N=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",j=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 A(e){return e.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var D="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function U(e,t){let n=e;if("string"!=typeof n||!P.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(D)try{let e=new URL(window.location.href),r=n.startsWith("//")?new URL(e.protocol+n):new URL(n),o=S(r.pathname,t);r.origin===e.origin&&null!=o?n=o+r.search+r.hash:a=!0}catch(o){i(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:a,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var F=["POST","PUT","PATCH","DELETE"],W=(new Set(F),["GET",...F]),I=(new Set(W),n.createContext(null));I.displayName="DataRouter";var B=n.createContext(null);B.displayName="DataRouterState";var H=n.createContext(!1),z=n.createContext({isTransitioning:!1});z.displayName="ViewTransition",n.createContext(new Map).displayName="Fetchers",n.createContext(null).displayName="Await";var J=n.createContext(null);J.displayName="Navigation";var Y=n.createContext(null);Y.displayName="Location";var V=n.createContext({outlet:null,matches:[],isDataRoute:!1});V.displayName="Route";var q=n.createContext(null);q.displayName="RouteError";var K="REACT_ROUTER_ERROR";function X(){return null!=n.useContext(Y)}function G(){return o(X(),"useLocation() may be used only in the context of a <Router> component."),n.useContext(Y).location}var Q="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Z(e){n.useContext(J).static||n.useLayoutEffect(e)}function ee(){let{isDataRoute:e}=n.useContext(V);return e?function(){let{router:e}=function(){let e=n.useContext(I);return o(e,he("useNavigate")),e}(),t=pe("useNavigate"),r=n.useRef(!1);return Z(()=>{r.current=!0}),n.useCallback(async(n,a={})=>{i(r.current,Q),r.current&&("number"==typeof n?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...a}))},[e,t])}():function(){o(X(),"useNavigate() may be used only in the context of a <Router> component.");let e=n.useContext(I),{basename:t,navigator:r}=n.useContext(J),{matches:a}=n.useContext(V),{pathname:l}=G(),s=JSON.stringify(O(a)),u=n.useRef(!1);return Z(()=>{u.current=!0}),n.useCallback((n,a={})=>{if(i(u.current,Q),!u.current)return;if("number"==typeof n)return void r.go(n);let o=T(n,JSON.parse(s),l,"path"===a.relative);null==e&&"/"!==t&&(o.pathname="/"===o.pathname?t:L([t,o.pathname])),(a.replace?r.replace:r.push)(o,a.state,a)},[t,r,s,l,e])}()}var te=n.createContext(null);function ne(){let{matches:e}=n.useContext(V),t=e[e.length-1];return t?t.params:{}}function re(e,{relative:t}={}){let{matches:r}=n.useContext(V),{pathname:a}=G(),o=JSON.stringify(O(r));return n.useMemo(()=>T(e,JSON.parse(o),a,"path"===t),[e,o,a,t])}function ae(e,t,r){o(X(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=n.useContext(J),{matches:l}=n.useContext(V),s=l[l.length-1],u=s?s.params:{},p=s?s.pathname:"/",d=s?s.pathnameBase:"/",m=s&&s.route;{let e=m&&m.path||"";me(p,!m||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (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 f,g=G();if(t){let e="string"==typeof t?c(t):t;o("/"===d||e.pathname?.startsWith(d),`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 "${d}" but pathname "${e.pathname}" was given in the \`location\` prop.`),f=e}else f=g;let v=f.pathname||"/",y=v;if("/"!==d){let e=d.replace(/^\//,"").split("/");y="/"+v.replace(/^\//,"").split("/").slice(e.length).join("/")}let b=h(e,{pathname:y});i(m||null!=b,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),i(null==b||void 0!==b[b.length-1].route.element||void 0!==b[b.length-1].route.Component||void 0!==b[b.length-1].route.lazy,`Matched leaf route at location "${f.pathname}${f.search}${f.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 w=function(e,t=[],r){let a=r?.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 i=e,l=a?.errors;if(null!=l){let e=i.findIndex(e=>e.route.id&&void 0!==l?.[e.route.id]);o(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),i=i.slice(0,Math.min(i.length,e+1))}let s=!1,u=-1;if(r&&a){s=a.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(u=e),t.route.id){let{loaderData:e,errors:n}=a,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!n||void 0===n[t.route.id]);if(t.route.lazy||o){r.isStatic&&(s=!0),i=u>=0?i.slice(0,u+1):[i[0]];break}}}}let c=r?.onError,h=a&&c?(e,t)=>{c(e,{location:a.location,params:a.matches?.[0]?.params??{},unstable_pattern:A(a.matches),errorInfo:t})}:void 0;return i.reduceRight((e,r,o)=>{let c,p=!1,d=null,m=null;a&&(c=l&&r.route.id?l[r.route.id]:void 0,d=r.route.errorElement||ie,s&&(u<0&&0===o?(me("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),p=!0,m=null):u===o&&(p=!0,m=r.route.hydrateFallbackElement||null)));let f=t.concat(i.slice(0,o+1)),g=()=>{let t;return t=c?d:p?m:r.route.Component?n.createElement(r.route.Component,null):r.route.element?r.route.element:e,n.createElement(ce,{match:r,routeContext:{outlet:e,matches:f,isDataRoute:null!=a},children:t})};return a&&(r.route.ErrorBoundary||r.route.errorElement||0===o)?n.createElement(le,{location:a.location,revalidation:a.revalidation,component:d,error:c,children:g(),routeContext:{outlet:null,matches:f,isDataRoute:!0},onError:h}):g()},null)}(b&&b.map(e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:L([d,a.encodeLocation?a.encodeLocation(e.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:L([d,a.encodeLocation?a.encodeLocation(e.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathnameBase])})),l,r);return t&&w?n.createElement(Y.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...f},navigationType:"POP"}},w):w}function oe(){let e=function(){let e=n.useContext(q),t=function(e){let t=n.useContext(B);return o(t,he(e)),t}("useRouteError"),r=pe("useRouteError");return void 0!==e?e:t.errors?.[r]}(),t=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:a},l={padding:"2px 4px",backgroundColor:a},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=n.createElement(n.Fragment,null,n.createElement("p",null,"💿 Hey developer 👋"),n.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",n.createElement("code",{style:l},"ErrorBoundary")," or"," ",n.createElement("code",{style:l},"errorElement")," prop on your route.")),n.createElement(n.Fragment,null,n.createElement("h2",null,"Unexpected Application Error!"),n.createElement("h3",{style:{fontStyle:"italic"}},t),r?n.createElement("pre",{style:i},r):null,s)}var ie=n.createElement(oe,null),le=class extends n.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){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(`${K}: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 j(t.status,t.statusText,t.data)}catch{}}(e.digest);t&&(e=t)}let t=void 0!==e?n.createElement(V.Provider,{value:this.props.routeContext},n.createElement(q.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?n.createElement(ue,{error:e},t):t}};le.contextType=H;var se=new WeakMap;function ue({children:e,error:t}){let{basename:r}=n.useContext(J);if("object"==typeof t&&t&&"digest"in t&&"string"==typeof t.digest){let e=function(e){if(e.startsWith(`${K}: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=se.get(t);if(a)throw a;let o=U(e.location,r);if(D&&!se.get(t)){if(!o.isExternal&&!e.reloadDocument){const n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:e.replace}));throw se.set(t,n),n}window.location.href=o.absoluteURL||o.to}return n.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function ce({routeContext:e,match:t,children:r}){let a=n.useContext(I);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),n.createElement(V.Provider,{value:e},r)}function he(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function pe(e){let t=function(e){let t=n.useContext(V);return o(t,he(e)),t}(e),r=t.matches[t.matches.length-1];return o(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}var de={};function me(e,t,n){t||de[e]||(de[e]=!0,i(!1,n))}function fe({basename:e,children:t,initialEntries:r,initialIndex:o,unstable_useTransitions:l}){let h=n.useRef();null==h.current&&(h.current=function(e={}){let t,{initialEntries:n=["/"],initialIndex:r,v5Compat:o=!1}=e;t=n.map((e,t)=>f(e,"string"==typeof e?null:e.state,0===t?"default":void 0,"string"==typeof e?void 0:e.unstable_mask));let l=d(null==r?t.length-1:r),h="POP",p=null;function d(e){return Math.min(Math.max(e,0),t.length-1)}function m(){return t[l]}function f(e,n=null,r,a){let o=s(t?m().pathname:"/",e,n,r,a);return i("/"===o.pathname.charAt(0),`relative pathnames are not supported in memory history: ${JSON.stringify(e)}`),o}function g(e){return"string"==typeof e?e:u(e)}return{get index(){return l},get action(){return h},get location(){return m()},createHref:g,createURL:e=>new URL(g(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?c(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,n){h="PUSH";let r=a(e)?e:f(e,n);l+=1,t.splice(l,t.length,r),o&&p&&p({action:h,location:r,delta:1})},replace(e,n){h="REPLACE";let r=a(e)?e:f(e,n);t[l]=r,o&&p&&p({action:h,location:r,delta:0})},go(e){h="POP";let n=d(l+e),r=t[n];l=n,p&&p({action:h,location:r,delta:e})},listen:e=>(p=e,()=>{p=null})}}({initialEntries:r,initialIndex:o,v5Compat:!0}));let p=h.current,[d,m]=n.useState({action:p.action,location:p.location}),f=n.useCallback(e=>{!1===l?m(e):n.startTransition(()=>m(e))},[l]);return n.useLayoutEffect(()=>p.listen(f),[p,f]),n.createElement(be,{basename:e,children:t,location:d.location,navigationType:d.action,navigator:p,unstable_useTransitions:l})}function ge({to:e,replace:t,state:r,relative:a}){o(X(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=n.useContext(J);i(!l,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=n.useContext(V),{pathname:u}=G(),c=ee(),h=T(e,O(s),u,"path"===a),p=JSON.stringify(h);return n.useEffect(()=>{c(JSON.parse(p),{replace:t,state:r,relative:a})},[c,p,a,t,r]),null}function ve(e){return function(e){let t=n.useContext(V).outlet;return n.useMemo(()=>t&&n.createElement(te.Provider,{value:e},t),[t,e])}(e.context)}function ye(e){o(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function be({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:l,static:s=!1,unstable_useTransitions:u}){o(!X(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let h=e.replace(/^\/*/,"/"),p=n.useMemo(()=>({basename:h,navigator:l,static:s,unstable_useTransitions:u,future:{}}),[h,l,s,u]);"string"==typeof r&&(r=c(r));let{pathname:d="/",search:m="",hash:f="",state:g=null,key:v="default",unstable_mask:y}=r,b=n.useMemo(()=>{let e=S(d,h);return null==e?null:{location:{pathname:e,search:m,hash:f,state:g,key:v,unstable_mask:y},navigationType:a}},[h,d,m,f,g,v,a,y]);return i(null!=b,`<Router basename="${h}"> is not able to match the URL "${d}${m}${f}" because it does not start with the basename, so the <Router> won't render anything.`),null==b?null:n.createElement(J.Provider,{value:p},n.createElement(Y.Provider,{children:t,value:b}))}function we({children:e,location:t}){return ae(xe(e),t)}function xe(e,t=[]){let r=[];return n.Children.forEach(e,(e,a)=>{if(!n.isValidElement(e))return;let i=[...t,a];if(e.type===n.Fragment)return void r.push.apply(r,xe(e.props.children,i));o(e.type===ye,`[${"string"==typeof e.type?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),o(!e.props.index||!e.props.children,"An index route cannot have child routes.");let l={id:e.props.id||i.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:!0===e.props.hasErrorBoundary||null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(l.children=xe(e.props.children,i)),r.push(l)}),r}n.useOptimistic,n.memo(function({routes:e,future:t,state:n,isStatic:r,onError:a}){return ae(e,void 0,{state:n,isStatic:r,onError:a,future:t})});var Ee="get",Re="application/x-www-form-urlencoded";function Ce(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement}var Se=null,Pe=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function $e(e){return null==e||Pe.has(e)?e:(i(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Re}"`),null)}function ke(e,t){if(!1===e||null==e)throw new Error(t)}function Oe(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 Te(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 s=r.routes[t.route.id];if(!s||!s.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 Le(){let e=n.useContext(I);return ke(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Me=n.createContext(void 0);function _e(){let e=n.useContext(Me);return ke(e,"You must render this element inside a <HydratedRouter> element"),e}function Ne(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function je({page:e,...t}){let{router:r}=Le(),a=n.useMemo(()=>h(r.routes,e,r.basename),[r.routes,e,r.basename]);return a?n.createElement(Ae,{page:e,matches:a,...t}):null}function Ae({page:e,matches:t,...r}){let a=G(),{future:o,manifest:i,routeModules:l}=_e(),{basename:s}=Le(),{loaderData:u,matches:c}=function(){let e=n.useContext(B);return ke(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}(),h=n.useMemo(()=>Te(e,t,c,i,a,"data"),[e,t,c,i,a]),p=n.useMemo(()=>Te(e,t,c,i,a,"assets"),[e,t,c,i,a]),d=n.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&&(!h.some(t=>t.route.id===e.route.id)&&e.route.id in u&&l[e.route.id]?.shouldRevalidate||t.hasClientLoader?r=!0:n.add(e.route.id))}),0===n.size)return[];let c=function(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&&"/"===S(a.pathname,t)?a.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a}(e,s,o.unstable_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]},[s,o.unstable_trailingSlashAwareDataRequests,u,a,i,h,t,e,l]),m=n.useMemo(()=>function(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}(p,i),[p,i]),f=function(e){let{manifest:t,routeModules:r}=_e(),[a,o]=n.useState([]);return n.useEffect(()=>{let n=!1;return async function(e,t,n){return function(e,t){let n=new Set;return new Set(t),e.reduce((e,t)=>{let r=JSON.stringify(function(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}(t));return n.has(r)||(n.add(r),e.push({key:r,link:t})),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(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Oe).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"}))}(e,t,r).then(e=>{n||o(e)}),()=>{n=!0}},[e,t,r]),a}(p);return n.createElement(n.Fragment,null,d.map(e=>n.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...r})),m.map(e=>n.createElement("link",{key:e,rel:"modulepreload",href:e,...r})),f.map(({key:e,link:t})=>n.createElement("link",{key:e,nonce:r.nonce,...t,crossOrigin:t.crossOrigin??r.crossOrigin})))}function De(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}Me.displayName="FrameworkContext";var Ue="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{Ue&&(window.__reactRouterVersion="7.13.1")}catch(yt){}function Fe({basename:e,children:t,unstable_useTransitions:h,window:p}){let d=n.useRef();null==d.current&&(d.current=function(e={}){return function(e,t,n,i={}){let{window:c=document.defaultView,v5Compat:h=!1}=i,p=c.history,d="POP",m=null,f=g();function g(){return(p.state||{idx:null}).idx}function v(){d="POP";let e=g(),t=null==e?null:e-f;f=e,m&&m({action:d,location:b.location,delta:t})}function y(e){return function(e,t=!1){let n="http://localhost";"undefined"!=typeof window&&(n="null"!==window.location.origin?window.location.origin:window.location.href),o(n,"No window.location.(origin|href) available to create URL");let r="string"==typeof e?e:u(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}(e)}null==f&&(f=0,p.replaceState({...p.state,idx:f},""));let b={get action(){return d},get location(){return e(c,p)},listen(e){if(m)throw new Error("A history only accepts one active listener");return c.addEventListener(r,v),m=e,()=>{c.removeEventListener(r,v),m=null}},createHref:e=>t(c,e),createURL:y,encodeLocation(e){let t=y(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){d="PUSH";let r=a(e)?e:s(b.location,e,t);n&&n(r,e),f=g()+1;let o=l(r,f),i=b.createHref(r.unstable_mask||r);try{p.pushState(o,"",i)}catch(u){if(u instanceof DOMException&&"DataCloneError"===u.name)throw u;c.location.assign(i)}h&&m&&m({action:d,location:b.location,delta:1})},replace:function(e,t){d="REPLACE";let r=a(e)?e:s(b.location,e,t);n&&n(r,e),f=g();let o=l(r,f),i=b.createHref(r.unstable_mask||r);p.replaceState(o,"",i),h&&m&&m({action:d,location:b.location,delta:0})},go:e=>p.go(e)};return b}(function(e,t){let{pathname:n="/",search:r="",hash:a=""}=c(e.location.hash.substring(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),s("",{pathname:n,search:r,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"==typeof t?t:u(t))},function(e,t){i("/"===e.pathname.charAt(0),`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)},e)}({window:p,v5Compat:!0}));let m=d.current,[f,g]=n.useState({action:m.action,location:m.location}),v=n.useCallback(e=>{!1===h?g(e):n.startTransition(()=>g(e))},[h]);return n.useLayoutEffect(()=>m.listen(v),[m,v]),n.createElement(be,{basename:e,children:t,location:f.location,navigationType:f.action,navigator:m,unstable_useTransitions:h})}var We=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ie=n.forwardRef(function({onClick:e,discover:t="render",prefetch:r="none",relative:a,reloadDocument:i,replace:l,unstable_mask:s,state:c,target:h,to:p,preventScrollReset:d,viewTransition:m,unstable_defaultShouldRevalidate:f,...g},v){let{basename:y,navigator:b,unstable_useTransitions:w}=n.useContext(J),x="string"==typeof p&&We.test(p),E=U(p,y),R=function(e,{relative:t}={}){o(X(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=n.useContext(J),{hash:i,pathname:l,search:s}=re(e,{relative:t}),u=l;return"/"!==r&&(u="/"===l?r:L([r,l])),a.createHref({pathname:u,search:s,hash:i})}(p=E.to,{relative:a}),C=G(),S=null;if(s){let e=T(s,[],C.unstable_mask?C.unstable_mask.pathname:"/",!0);"/"!==y&&(e.pathname="/"===e.pathname?y:L([y,e.pathname])),S=b.createHref(e)}let[P,$,k]=function(e,t){let r=n.useContext(Me),[a,o]=n.useState(!1),[i,l]=n.useState(!1),{onFocus:s,onBlur:u,onMouseEnter:c,onMouseLeave:h,onTouchStart:p}=t,d=n.useRef(null);n.useEffect(()=>{if("render"===e&&l(!0),"viewport"===e){let e=new IntersectionObserver(e=>{e.forEach(e=>{l(e.isIntersecting)})},{threshold:.5});return d.current&&e.observe(d.current),()=>{e.disconnect()}}},[e]),n.useEffect(()=>{if(a){let e=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(e)}}},[a]);let m=()=>{o(!0)},f=()=>{o(!1),l(!1)};return r?"intent"!==e?[i,d,{}]:[i,d,{onFocus:Ne(s,m),onBlur:Ne(u,f),onMouseEnter:Ne(c,m),onMouseLeave:Ne(h,f),onTouchStart:Ne(p,m)}]:[!1,d,{}]}(r,g),O=function(e,{target:t,replace:r,unstable_mask:a,state:o,preventScrollReset:i,relative:l,viewTransition:s,unstable_defaultShouldRevalidate:c,unstable_useTransitions:h}={}){let p=ee(),d=G(),m=re(e,{relative:l});return n.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!==r?r:u(d)===u(m),g=()=>p(e,{replace:t,unstable_mask:a,state:o,preventScrollReset:i,relative:l,viewTransition:s,unstable_defaultShouldRevalidate:c});h?n.startTransition(()=>g()):g()}},[d,p,m,r,a,o,t,e,i,l,s,c,h])}(p,{replace:l,unstable_mask:s,state:c,target:h,preventScrollReset:d,relative:a,viewTransition:m,unstable_defaultShouldRevalidate:f,unstable_useTransitions:w}),M=!(E.isExternal||i),_=n.createElement("a",{...g,...k,href:(M?S:void 0)||E.absoluteURL||R,onClick:M?function(t){e&&e(t),t.defaultPrevented||O(t)}:e,ref:De(v,$),target:h,"data-discover":x||"render"!==t?void 0:"true"});return P&&!x?n.createElement(n.Fragment,null,_,n.createElement(je,{page:R})):_});Ie.displayName="Link";var Be=n.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:r="",end:a=!1,style:i,to:l,viewTransition:s,children:u,...c},h){let p=re(l,{relative:c.relative}),d=G(),m=n.useContext(B),{navigator:f,basename:g}=n.useContext(J),v=null!=m&&function(e,{relative:t}={}){let r=n.useContext(z);o(null!=r,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=ze("useViewTransitionState"),i=re(e,{relative:t});if(!r.isTransitioning)return!1;let l=S(r.currentLocation.pathname,a)||r.currentLocation.pathname,s=S(r.nextLocation.pathname,a)||r.nextLocation.pathname;return null!=R(i.pathname,s)||null!=R(i.pathname,l)}(p)&&!0===s,y=f.encodeLocation?f.encodeLocation(p).pathname:p.pathname,b=d.pathname,w=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;t||(b=b.toLowerCase(),w=w?w.toLowerCase():null,y=y.toLowerCase()),w&&g&&(w=S(w,g)||w);const x="/"!==y&&y.endsWith("/")?y.length-1:y.length;let E,C=b===y||!a&&b.startsWith(y)&&"/"===b.charAt(x),P=null!=w&&(w===y||!a&&w.startsWith(y)&&"/"===w.charAt(y.length)),$={isActive:C,isPending:P,isTransitioning:v},k=C?e:void 0;E="function"==typeof r?r($):[r,C?"active":null,P?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let O="function"==typeof i?i($):i;return n.createElement(Ie,{...c,"aria-current":k,className:E,ref:h,style:O,to:l,viewTransition:s},"function"==typeof u?u($):u)});Be.displayName="NavLink";var He=n.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:i,state:l,method:s=Ee,action:c,onSubmit:h,relative:p,preventScrollReset:d,viewTransition:m,unstable_defaultShouldRevalidate:f,...g},v)=>{let{unstable_useTransitions:y}=n.useContext(J),b=function(){let{router:e}=ze("useSubmit"),{basename:t}=n.useContext(J),r=pe("useRouteId"),a=e.fetch,o=e.navigate;return n.useCallback(async(e,n={})=>{let{action:i,method:l,encType:s,formData:u,body:c}=function(e,t){let n,r,a,o,i;if(Ce(l=e)&&"form"===l.tagName.toLowerCase()){let i=e.getAttribute("action");r=i?S(i,t):null,n=e.getAttribute("method")||Ee,a=$e(e.getAttribute("enctype"))||Re,o=new FormData(e)}else if(function(e){return Ce(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Ce(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?S(l,t):null,n=e.getAttribute("formmethod")||i.getAttribute("method")||Ee,a=$e(e.getAttribute("formenctype"))||$e(i.getAttribute("enctype"))||Re,o=new FormData(i,e),!function(){if(null===Se)try{new FormData(document.createElement("form"),0),Se=!1}catch(yt){Se=!0}return Se}()){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(Ce(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Ee,r=null,a=Re,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);!1===n.navigate?await a(n.fetcherKey||Ye(),r,n.action||i,{unstable_defaultShouldRevalidate:n.unstable_defaultShouldRevalidate,preventScrollReset:n.preventScrollReset,formData:u,body:c,formMethod:n.method||l,formEncType:n.encType||s,flushSync:n.flushSync}):await o(n.action||i,{unstable_defaultShouldRevalidate:n.unstable_defaultShouldRevalidate,preventScrollReset:n.preventScrollReset,formData:u,body:c,formMethod:n.method||l,formEncType:n.encType||s,replace:n.replace,state:n.state,fromRouteId:r,flushSync:n.flushSync,viewTransition:n.viewTransition})},[a,o,t,r])}(),w=function(e,{relative:t}={}){let{basename:r}=n.useContext(J),a=n.useContext(V);o(a,"useFormAction must be used inside a RouteContext");let[i]=a.matches.slice(-1),l={...re(e||".",{relative:t})},s=G();if(null==e){l.search=s.search;let e=new URLSearchParams(l.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();l.search=n?`?${n}`:""}}return e&&"."!==e||!i.route.index||(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),"/"!==r&&(l.pathname="/"===l.pathname?r:L([r,l.pathname])),u(l)}(c,{relative:p}),x="get"===s.toLowerCase()?"get":"post",E="string"==typeof c&&We.test(c);return n.createElement("form",{ref:v,method:x,action:w,onSubmit:a?h:e=>{if(h&&h(e),e.defaultPrevented)return;e.preventDefault();let a=e.nativeEvent.submitter,o=a?.getAttribute("formmethod")||s,u=()=>b(a||e.currentTarget,{fetcherKey:t,method:o,navigate:r,replace:i,state:l,relative:p,preventScrollReset:d,viewTransition:m,unstable_defaultShouldRevalidate:f});y&&!1!==r?n.startTransition(()=>u()):u()},...g,"data-discover":E||"render"!==e?void 0:"true"})});function ze(e){let t=n.useContext(I);return o(t,function(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}(e)),t}He.displayName="Form";var Je=0,Ye=()=>`__${String(++Je)}__`,Ve=({as:e="div",className:n,threshold:r=.5,rootMargin:a="0px",triggerOnce:o,onChange:i,onClick:l,children:s})=>{const u=t.A(null),c=t.A(!1);return t.y(()=>{const e=u.current;if(!e)return;const t=new IntersectionObserver(e=>{e.forEach(e=>{o&&c.current||(e.isIntersecting&&(c.current=!0),i?.(e.isIntersecting))})},{threshold:r,rootMargin:a});return t.observe(e),()=>t.disconnect()},[r,a,i,o]),t.u(e,{ref:u,className:n,onClick:l,children:s})},qe=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],Ke=e=>{let t=0;for(let n=0;n<e.length;n++){let r=e[n];t=83*t+qe.indexOf(r)}return t},Xe=e=>{let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Ge=e=>{let t=Math.max(0,Math.min(1,e));return t<=.0031308?Math.trunc(12.92*t*255+.5):Math.trunc(255*(1.055*Math.pow(t,.4166666666666667)-.055)+.5)},Qe=(e,t)=>(e=>e<0?-1:1)(e)*Math.pow(Math.abs(e),t),Ze=class extends Error{constructor(e){super(e),this.name="ValidationError",this.message=e}},et=e=>{let t=e>>8&255,n=255&e;return[Xe(e>>16),Xe(t),Xe(n)]},tt=(e,t)=>{let n=Math.floor(e/361),r=Math.floor(e/19)%19,a=e%19;return[Qe((n-9)/9,2)*t,Qe((r-9)/9,2)*t,Qe((a-9)/9,2)*t]},nt=(e,t,n,r)=>{(e=>{if(!e||e.length<6)throw new Ze("The blurhash string must be at least 6 characters");let t=Ke(e[0]),n=Math.floor(t/9)+1,r=t%9+1;if(e.length!==4+2*r*n)throw new Ze(`blurhash length mismatch: length is ${e.length} but it should be ${4+2*r*n}`)})(e),r|=1;let a=Ke(e[0]),o=Math.floor(a/9)+1,i=a%9+1,l=(Ke(e[1])+1)/166,s=new Array(i*o);for(let h=0;h<s.length;h++)s[h]=0===h?et(Ke(e.substring(2,6))):tt(Ke(e.substring(4+2*h,6+2*h)),l*r);let u=4*t,c=new Uint8ClampedArray(u*n);for(let h=0;h<n;h++)for(let e=0;e<t;e++){let r=0,a=0,l=0;for(let u=0;u<o;u++)for(let o=0;o<i;o++){let c=Math.cos(Math.PI*e*o/t)*Math.cos(Math.PI*h*u/n),p=s[o+u*i];r+=p[0]*c,a+=p[1]*c,l+=p[2]*c}let p=Ge(r),d=Ge(a),m=Ge(l);c[4*e+0+h*u]=p,c[4*e+1+h*u]=d,c[4*e+2+h*u]=m,c[4*e+3+h*u]=255}return c},rt=Object.defineProperty,at=Object.defineProperties,ot=Object.getOwnPropertyDescriptors,it=Object.getOwnPropertySymbols,lt=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable,ut=(e,t,n)=>t in e?rt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ct=(e,t)=>{for(var n in t||(t={}))lt.call(t,n)&&ut(e,n,t[n]);if(it)for(var n of it(t))st.call(t,n)&&ut(e,n,t[n]);return e},ht=(e,t)=>at(e,ot(t)),pt=(e,t)=>{var n={};for(var r in e)lt.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&it)for(var r of it(e))t.indexOf(r)<0&&st.call(e,r)&&(n[r]=e[r]);return n},dt=class extends n.PureComponent{constructor(){super(...arguments),this.canvas=null,this.handleRef=e=>{this.canvas=e,this.draw()},this.draw=()=>{let{hash:e,height:t,punch:n,width:r}=this.props;if(this.canvas){let a=nt(e,r,t,n),o=this.canvas.getContext("2d"),i=o.createImageData(r,t);i.data.set(a),o.putImageData(i,0,0)}}}componentDidUpdate(){this.draw()}render(){let e=this.props,{hash:t,height:r,width:a}=e,o=pt(e,["hash","height","width"]);return n.createElement("canvas",ht(ct({},o),{height:r,width:a,ref:this.handleRef}))}};dt.defaultProps={height:128,width:128};var mt={position:"absolute",top:0,bottom:0,left:0,right:0,width:"100%",height:"100%"},ft=class extends n.PureComponent{componentDidUpdate(){if(this.props.resolutionX<=0)throw new Error("resolutionX must be larger than zero");if(this.props.resolutionY<=0)throw new Error("resolutionY must be larger than zero")}render(){let e=this.props,{hash:t,height:r,width:a,punch:o,resolutionX:i,resolutionY:l,style:s}=e,u=pt(e,["hash","height","width","punch","resolutionX","resolutionY","style"]);return n.createElement("div",ht(ct({},u),{style:ht(ct({display:"inline-block",height:r,width:a},s),{position:"relative"})}),n.createElement(dt,{hash:t,height:l,width:i,punch:o,style:mt}))}};ft.defaultProps={height:128,width:128,resolutionX:32,resolutionY:32};var gt=dt,vt=({src:e,alt:n,threshold:r=.1,rootMargin:a="200px 0px",blurhash:o,containerClassName:i="size-full",wrapperClassName:l,imgClassName:s="",sizeMode:u="cover",position:c="center",delayMs:h=100,delayTime:p,onClick:d})=>{const m=o&&o.length>=6?o:"LEHV6nWB2yk8pyo0adR*.7kCMdnj",[f,g]=t.d(!1),[v,y]=t.d(!1),[b,w]=t.d(!1),x=t.A(null),E="number"==typeof p?p:h,R=l??i;t.y(()=>{if(!f)return b?x.current=window.setTimeout(()=>{y(!0)},E):x.current&&(clearTimeout(x.current),x.current=null),()=>{x.current&&clearTimeout(x.current)}},[b,f,E]);const C=v&&b||f;return t.u(Ve,{as:"div",className:t.cn(R,"relative overflow-hidden"),threshold:r,rootMargin:a,onChange:e=>w(e),children:[!f&&t.u(gt,{className:"size-full blur-2xl",hash:m}),C&&e&&t.u("img",{alt:n,src:e,onLoad:()=>g(!0),className:t.cn("absolute top-0 left-0 size-full object-center transition-all duration-300",f?"scale-100 opacity-100":"scale-95 opacity-0","contain"===u?"object-contain":"object-cover","top"===c?"object-top":"bottom"===c?"object-bottom":"object-center",s),onClick:e=>d?.(e)})]})};Object.defineProperty(exports,"HashRouter",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,"InView",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,"LazyLoadImage",{enumerable:!0,get:function(){return vt}}),Object.defineProperty(exports,"Link",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"MemoryRouter",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(exports,"NavLink",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"Navigate",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,"Outlet",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,"Route",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(exports,"Routes",{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(exports,"useLocation",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"useNavigate",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,"useParams",{enumerable:!0,get:function(){return ne}});
@@ -1 +1 @@
1
- import{n as t}from"./DqRj45SJ.js";import{M as o,_t as r,a as n,ut as e,vt as a}from"./QPXxc9eb.js";import{t as i}from"./aragUG-J.js";import{o as s}from"./CNAEfadS.js";import{t as c}from"./CT_Cvh8-.js";var l=new i,p=(t,r)=>{a(/* @__PURE__ */n(o,{client:l,children:/* @__PURE__ */n(s,{children:/* @__PURE__ */n(c,{event:t})})}),r)},m=({events:o})=>{const a=e(null),i=e(null);return r(()=>{if(!a.current||i.current)return;let r;return(async()=>{const n=await import("./CEEUMvOM.js").then(o=>/* @__PURE__ */t(o.default,1));if(await Promise.resolve({ }),!a.current)return;const e=n.map(a.current,{center:[20,0],zoom:2,zoomControl:!0,worldCopyJump:!0});n.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"&copy; OpenStreetMap contributors",maxZoom:19}).addTo(e),i.current=e;const s=o.filter(t=>"number"==typeof t.location?.x&&"number"==typeof t.location?.y);if(s.length>0){const t=n.latLngBounds([]);for(const o of s){const r=o.location.x,a=o.location.y;t.extend([a,r]);const i=n.divIcon({className:"qrati-leaflet-marker-wrapper",html:'\n <div style="\n width: 28px;\n height: 28px;\n cursor: pointer;\n background: var(--color-primary, #6366f1);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n "></div>\n ',iconSize:[28,28],iconAnchor:[14,28],popupAnchor:[0,-28]}),s=n.marker([a,r],{icon:i}).addTo(e),c=document.createElement("div");p(o,c),s.bindPopup(c,{closeButton:!0,maxWidth:220})}t.isValid()&&e.fitBounds(t,{padding:[60,60],maxZoom:14})}r=()=>{e.remove(),i.current=null}})(),()=>{r?.()}},[o]),/* @__PURE__ */n("div",{ref:a,class:"size-full"})};export{m as default};
1
+ import{n as t}from"./DqRj45SJ.js";import{M as o,_t as r,a as n,ut as e,vt as a}from"./Ce4GGag_.js";import{t as i}from"./CMUYyO6F.js";import{o as s}from"./buiUjKpV.js";import{t as c}from"./Dbq_PyC6.js";var l=new i,p=(t,r)=>{a(/* @__PURE__ */n(o,{client:l,children:/* @__PURE__ */n(s,{children:/* @__PURE__ */n(c,{event:t})})}),r)},m=({events:o})=>{const a=e(null),i=e(null);return r(()=>{if(!a.current||i.current)return;let r;return(async()=>{const n=await import("./Bxitmzur.js").then(o=>/* @__PURE__ */t(o.default,1));if(await Promise.resolve({ }),!a.current)return;const e=n.map(a.current,{center:[20,0],zoom:2,zoomControl:!0,worldCopyJump:!0});n.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"&copy; OpenStreetMap contributors",maxZoom:19}).addTo(e),i.current=e;const s=o.filter(t=>"number"==typeof t.location?.x&&"number"==typeof t.location?.y);if(s.length>0){const t=n.latLngBounds([]);for(const o of s){const r=o.location.x,a=o.location.y;t.extend([a,r]);const i=n.divIcon({className:"qrati-leaflet-marker-wrapper",html:'\n <div style="\n width: 28px;\n height: 28px;\n cursor: pointer;\n background: var(--color-primary, #6366f1);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n "></div>\n ',iconSize:[28,28],iconAnchor:[14,28],popupAnchor:[0,-28]}),s=n.marker([a,r],{icon:i}).addTo(e),c=document.createElement("div");p(o,c),s.bindPopup(c,{closeButton:!0,maxWidth:220})}t.isValid()&&e.fitBounds(t,{padding:[60,60],maxZoom:14})}r=()=>{e.remove(),i.current=null}})(),()=>{r?.()}},[o]),/* @__PURE__ */n("div",{ref:a,class:"size-full"})};export{m as default};
@@ -0,0 +1,32 @@
1
+ import{B as e,C as t,Ct as r,D as o,F as n,N as s,Q as i,St as a,Tt as l,V as c,Y as u,_t as h,a as d,ct as f,dt as p,et as m,gt as y,i as g,it as w,lt as b,n as _,nt as v,ot as R,pt as S,rt as T,st as x,t as E,tt as A,u as C,vt as I,wt as O,xt as P,yt as k,z as q}from"./Ce4GGag_.js";import*as N from"react";import{jsx as D}from"react/jsx-runtime";var U=class extends b{constructor(t,r){super(),this.options=r,this.#e=t,this.#t=null,this.#r=e(),this.bindMethods(),this.setOptions(r)}#e;#o=void 0;#n=void 0;#s=void 0;#i;#a;#r;#t;#l;#c;#u;#h;#d;#f;#p=/* @__PURE__ */new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#o.addObserver(this),L(this.#o,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return M(this.#o,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return M(this.#o,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=/* @__PURE__ */new Set,this.#g(),this.#w(),this.#o.removeObserver(this)}setOptions(e){const t=this.options,r=this.#o;if(this.options=this.#e.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof A(this.options.enabled,this.#o))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#b(),this.#o.setOptions(this.options),t._defaulted&&!T(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#o,observer:this});const o=this.hasListeners();o&&j(this.#o,r,this.options,t)&&this.#m(),this.updateResult(),!o||this.#o===r&&A(this.options.enabled,this.#o)===A(t.enabled,this.#o)&&v(this.options.staleTime,this.#o)===v(t.staleTime,this.#o)||this.#_();const n=this.#v();!o||this.#o===r&&A(this.options.enabled,this.#o)===A(t.enabled,this.#o)&&n===this.#f||this.#R(n)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(t,e);var o;return o=r,T(this.getCurrentResult(),o)||(this.#s=r,this.#a=this.options,this.#i=this.#o.state),r}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#r.status||this.#r.reject(/* @__PURE__ */new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#o}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#m(e){this.#b();let t=this.#o.fetch(this.options,e);return e?.throwOnError||(t=t.catch(i)),t}#_(){this.#g();const e=v(this.options.staleTime,this.#o);if(c.isServer()||this.#s.isStale||!u(e))return;const t=R(this.#s.dataUpdatedAt,e)+1;this.#h=x.setTimeout(()=>{this.#s.isStale||this.updateResult()},t)}#v(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#o):this.options.refetchInterval)??!1}#R(e){this.#w(),this.#f=e,!c.isServer()&&!1!==A(this.options.enabled,this.#o)&&u(this.#f)&&0!==this.#f&&(this.#d=x.setInterval(()=>{(this.options.refetchIntervalInBackground||f.isFocused())&&this.#m()},this.#f))}#y(){this.#_(),this.#R(this.#v())}#g(){this.#h&&(x.clearTimeout(this.#h),this.#h=void 0)}#w(){this.#d&&(x.clearInterval(this.#d),this.#d=void 0)}createResult(t,r){const o=this.#o,s=this.options,i=this.#s,a=this.#i,l=this.#a,c=t!==o?t.state:this.#n,{state:u}=t;let h,d={...u},f=!1;if(r._optimisticResults){const e=this.hasListeners(),i=!e&&L(t,r),a=e&&j(t,o,r,s);(i||a)&&(d={...d,...n(u.data,t.options)}),"isRestoring"===r._optimisticResults&&(d.fetchStatus="idle")}let{error:p,errorUpdatedAt:y,status:g}=d;h=d.data;let w=!1;if(void 0!==r.placeholderData&&void 0===h&&"pending"===g){let e;i?.isPlaceholderData&&r.placeholderData===l?.placeholderData?(e=i.data,w=!0):e="function"==typeof r.placeholderData?r.placeholderData(this.#u?.state.data,this.#u):r.placeholderData,void 0!==e&&(g="success",h=m(i?.data,e,r),f=!0)}if(r.select&&void 0!==h&&!w)if(i&&h===a?.data&&r.select===this.#l)h=this.#c;else try{this.#l=r.select,h=r.select(h),h=m(i?.data,h,r),this.#c=h,this.#t=null}catch(x){this.#t=x}this.#t&&(p=this.#t,h=this.#c,y=Date.now(),g="error");const b="fetching"===d.fetchStatus,_="pending"===g,v="error"===g,R=_&&b,S=void 0!==h,T={status:g,fetchStatus:d.fetchStatus,isPending:_,isSuccess:"success"===g,isError:v,isInitialLoading:R,isLoading:R,data:h,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:y,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!_,isLoadingError:v&&!S,isPaused:"paused"===d.fetchStatus,isPlaceholderData:f,isRefetchError:v&&S,isStale:Q(t,r),refetch:this.refetch,promise:this.#r,isEnabled:!1!==A(r.enabled,t)};if(this.options.experimental_prefetchInRender){const r=void 0!==T.data,n="error"===T.status&&!r,s=e=>{n?e.reject(T.error):r&&e.resolve(T.data)},i=()=>{s(this.#r=T.promise=e())},a=this.#r;switch(a.status){case"pending":t.queryHash===o.queryHash&&s(a);break;case"fulfilled":(n||T.data!==a.value)&&i();break;case"rejected":n&&T.error===a.reason||i()}}return T}updateResult(){const e=this.#s,t=this.createResult(this.#o,this.options);this.#i=this.#o.state,this.#a=this.options,void 0!==this.#i.data&&(this.#u=this.#o),T(t,e)||(this.#s=t,this.#S({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#p.size)return!0;const o=new Set(r??this.#p);return this.options.throwOnError&&o.add("error"),Object.keys(this.#s).some(t=>{const r=t;return this.#s[r]!==e[r]&&o.has(r)})})()}))}#b(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#o)return;const t=this.#o;this.#o=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#S(e){q.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#s)}),this.#e.getQueryCache().notify({query:this.#o,type:"observerResultsUpdated"})})}};function L(e,t){return function(e,t){return!1!==A(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&M(e,t,t.refetchOnMount)}function M(e,t,r){if(!1!==A(t.enabled,e)&&"static"!==v(t.staleTime,e)){const o="function"==typeof r?r(e):r;return"always"===o||!1!==o&&Q(e,t)}return!1}function j(e,t,r,o){return(e!==t||!1===A(o.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&Q(e,r)}function Q(e,t){return!1!==A(t.enabled,e)&&e.isStaleByTime(v(t.staleTime,e))}var F=N.createContext(!1);F.Provider;var z=N.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),H=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function B(e,t,r){if("production"!==process.env.NODE_ENV&&("object"!=typeof e||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const o=N.useContext(F),n=N.useContext(z),a=s(r),l=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const u=a.getQueryCache().get(l.queryHash);"production"!==process.env.NODE_ENV&&(l.queryFn||console.error(`[${l.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),l._optimisticResults=o?"isRestoring":"optimistic",(e=>{if(e.suspense){const t=1e3,r=e=>"static"===e?e:Math.max(e??t,t),o=e.staleTime;e.staleTime="function"==typeof o?(...e)=>r(o(...e)):r(o),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}})(l),((e,t,r)=>{const o=r?.state.error&&"function"==typeof e.throwOnError?w(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||o)&&(t.isReset()||(e.retryOnMount=!1))})(l,n,u),(e=>{N.useEffect(()=>{e.clearReset()},[e])})(n);const h=!a.getQueryCache().get(l.queryHash),[d]=N.useState(()=>new t(a,l)),f=d.getOptimisticResult(l),p=!o&&!1!==e.subscribed;if(N.useSyncExternalStore(N.useCallback(e=>{const t=p?d.subscribe(q.batchCalls(e)):i;return d.updateResult(),t},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),N.useEffect(()=>{d.setOptions(l)},[l,d]),((e,t)=>e?.suspense&&t.isPending)(l,f))throw H(l,d,n);if((({result:e,errorResetBoundary:t,throwOnError:r,query:o,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&o&&(n&&void 0===e.data||w(r,[e.error,o])))({result:f,errorResetBoundary:n,throwOnError:l.throwOnError,query:u,suspense:l.suspense}))throw f.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(l,f),l.experimental_prefetchInRender&&!c.isServer()&&((e,t)=>e.isLoading&&e.isFetching&&!t)(f,o)&&(h?H(l,d,n):u?.promise)?.catch(i).finally(()=>{d.updateResult()}),l.notifyOnChangeProps?f:d.trackResult(f)}function W(e,t){return B(e,U,t)}function V(e,t){for(var r in e)if("__source"!==r&&!(r in t))return!0;for(var o in t)if("__source"!==o&&e[o]!==t[o])return!0;return!1}function Z(e,t){this.props=e,this.context=t}(Z.prototype=new l).isPureReactComponent=!0,Z.prototype.shouldComponentUpdate=function(e,t){return V(this.props,e)||V(this.state,t)};var $=O.__b;O.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),$&&$(e)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var G=O.__e;O.__e=function(e,t,r,o){if(e.then)for(var n,s=t;s=s.__;)if((n=s.__c)&&n.__c)return t.__e??(t.__e=r.__e,t.__k=r.__k),n.__c(e,t);G(e,t,r,o)};var J=O.unmount;function Y(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=function(e,t){for(var r in t)e[r]=t[r];return e}({},e)).__c&&(e.__c.__P===r&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return Y(e,t,r)})),e}function K(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return K(e,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function X(){this.__u=0,this.o=null,this.__b=null}function ee(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function te(e){var t,r,o,n=null;function s(s){if(t||(t=e()).then(function(e){e&&(n=e.default||e),o=!0},function(e){r=e,o=!0}),r)throw r;if(!o)throw t;return n?a(n,s):null}return s.displayName="Lazy",s.__f=!0,s}function re(){this.i=null,this.l=null}O.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),J&&J(e)},(X.prototype=new l).__c=function(e,t){var r=t.__c,o=this;o.o??=[],o.o.push(r);var n=ee(o.__v),s=!1,i=function(){s||o.__z||(s=!0,r.__R=null,n?n(l):l())};r.__R=i;var a=r.__P;r.__P=null;var l=function(){if(! --o.__u){if(o.state.__a){var e=o.state.__a;o.__v.__k[0]=K(e,e.__c.__P,e.__c.__O)}var t;for(o.setState({__a:o.__b=null});t=o.o.pop();)t.__P=a,t.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(i,i)},X.prototype.componentWillUnmount=function(){this.o=[]},X.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var o=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=Y(this.__b,o,n.__O=n.__P)}this.__b=null}var s=t.__a&&a(r,null,e.fallback);return s&&(s.__u&=-33),[a(r,null,t.__a?null:e.children),s]};var oe=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};function ne(e){return this.getChildContext=function(){return e.context},e.children}function se(e){var t=this,r=e.h;if(t.componentWillUnmount=function(){I(null,t.v),t.v=null,t.h=null},t.h&&t.h!==r&&t.componentWillUnmount(),!t.v){for(var o=t.__v;null!==o&&!o.__m&&null!==o.__;)o=o.__;t.h=r,t.v={nodeType:1,parentNode:r,childNodes:[],__k:{__m:o.__m},contains:function(){return!0},namespaceURI:r.namespaceURI,insertBefore:function(e,r){this.childNodes.push(e),t.h.insertBefore(e,r)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}I(a(ne,{context:t.context},e.__v),t.v)}function ie(e,t){var r=a(se,{__v:e,h:t});return r.containerInfo=t,r}(re.prototype=new l).__a=function(e){var t=this,r=ee(t.__v),o=t.l.get(e);return o[0]++,function(n){var s=function(){t.props.revealOrder?(o.push(n),oe(t,e,o)):n()};r?r(s):s()}},re.prototype.render=function(e){this.i=null,this.l=/* @__PURE__ */new Map;var t=k(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},re.prototype.componentDidUpdate=re.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){oe(e,r,t)})};var ae="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,le=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,ce=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,ue=/[A-Z0-9]/g,he="undefined"!=typeof document,de=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};l.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(l.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var fe=O.event;O.event=function(e){return fe&&(e=fe(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var pe={configurable:!0,get:function(){return this.class}},me=O.vnode;O.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,r=e.type,o={},n=-1==r.indexOf("-");for(var s in t){var i=t[s];if(!("value"===s&&"defaultValue"in t&&null==i||he&&"children"===s&&"noscript"===r||"class"===s||"className"===s)){var a=s.toLowerCase();"defaultValue"===s&&"value"in t&&null==t.value?s="value":"download"===s&&!0===i?i="":"translate"===a&&"no"===i?i=!1:"o"===a[0]&&"n"===a[1]?"ondoubleclick"===a?s="ondblclick":"onchange"!==a||"input"!==r&&"textarea"!==r||de(t.type)?"onfocus"===a?s="onfocusin":"onblur"===a?s="onfocusout":ce.test(s)&&(s=a):a=s="oninput":n&&le.test(s)?s=s.replace(ue,"-$&").toLowerCase():null===i&&(i=void 0),"oninput"===a&&o[s=a]&&(s="oninputCapture"),o[s]=i}}"select"==r&&(o.multiple&&Array.isArray(o.value)&&(o.value=k(t.children).forEach(function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)})),null!=o.defaultValue&&(o.value=k(t.children).forEach(function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value}))),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",pe)):t.className&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=ae,me&&me(e)};var ye=O.__r;O.__r=function(e){ye&&ye(e),e.__c};var ge=O.diffed;O.diffed=function(e){ge&&ge(e);var t=e.props,r=e.__e;null!=r&&"textarea"===e.type&&"value"in t&&t.value!==r.value&&(r.value=null==t.value?"":t.value)};var we=class extends Error{response;request;options;constructor(e,t,r){const o=`${e.status||0===e.status?e.status:""} ${e.statusText??""}`.trim();super(`Request failed with ${o?`status code ${o}`:"an unknown error"}: ${t.method} ${t.url}`),this.name="HTTPError",this.response=e,this.request=t,this.options=r}},be=class extends Error{name="NonError";value;constructor(e){let t="Non-error value was thrown";try{"string"==typeof e?t=e:e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message&&(t=e.message)}catch{}super(t),this.value=e}},_e=class extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(e){const t=e?.cause?e.cause instanceof Error?e.cause:new be(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",t?{cause:t}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}},ve=(()=>{let e=!1,t=!1;const r="function"==typeof globalThis.ReadableStream,o="function"==typeof globalThis.Request;if(r&&o)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(n){if(n instanceof Error&&"unsupported BodyInit type"===n.message)return!1;throw n}return e&&!t})(),Re="function"==typeof globalThis.AbortController,Se="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,Te="function"==typeof globalThis.ReadableStream,xe="function"==typeof globalThis.FormData,Ee=["get","post","put","patch","head","delete"],Ae={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},Ce=(new TextEncoder).encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,Ie=Symbol("stop"),Oe=class{options;constructor(e){this.options=e}},Pe=e=>new Oe(e),ke={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},qe={next:!0},Ne={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},De=(e,t,r)=>{let o,n=0;return e.pipeThrough(new TransformStream({transform(e,s){if(s.enqueue(e),o){n+=o.byteLength;let e=0===t?0:n/t;e>=1&&(e=1-Number.EPSILON),r?.({percent:e,totalBytes:Math.max(t,n),transferredBytes:n},o)}o=e},flush(){o&&(n+=o.byteLength,r?.({percent:1,totalBytes:Math.max(t,n),transferredBytes:n},o))}}))},Ue=e=>null!==e&&"object"==typeof e,Le=(...e)=>{for(const t of e)if((!Ue(t)||Array.isArray(t))&&void 0!==t)throw new TypeError("The `options` argument must be an object");return ze({},...e)},Me=(e={},t={})=>{const r=new globalThis.Headers(e),o=t instanceof globalThis.Headers,n=new globalThis.Headers(t);for(const[s,i]of n.entries())o&&"undefined"===i||void 0===i?r.delete(s):r.set(s,i);return r};function je(e,t,r){return Object.hasOwn(t,r)&&void 0===t[r]?[]:ze(e[r]??[],t[r]??[])}var Qe=(e={},t={})=>({beforeRequest:je(e,t,"beforeRequest"),beforeRetry:je(e,t,"beforeRetry"),afterResponse:je(e,t,"afterResponse"),beforeError:je(e,t,"beforeError")}),Fe=(e,t)=>{const r=new URLSearchParams;for(const o of[e,t])if(void 0!==o)if(o instanceof URLSearchParams)for(const[e,t]of o.entries())r.append(e,t);else if(Array.isArray(o))for(const e of o){if(!Array.isArray(e)||2!==e.length)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(e[0]),String(e[1]))}else if(Ue(o))for(const[e,t]of Object.entries(o))void 0!==t&&r.append(e,String(t));else{const e=new URLSearchParams(o);for(const[t,o]of e.entries())r.append(t,o)}return r},ze=(...e)=>{let t,r={},o={},n={};const s=[];for(const i of e)if(Array.isArray(i))Array.isArray(r)||(r=[]),r=[...r,...i];else if(Ue(i)){for(let[e,o]of Object.entries(i))if("signal"===e&&o instanceof globalThis.AbortSignal)s.push(o);else if("context"!==e)"searchParams"!==e?(Ue(o)&&e in r&&(o=ze(r[e],o)),r={...r,[e]:o}):t=null==o?void 0:void 0===t?o:Fe(t,o);else{if(null!=o&&(!Ue(o)||Array.isArray(o)))throw new TypeError("The `context` option must be an object");r={...r,context:null==o?{}:{...r.context,...o}}}Ue(i.hooks)&&(n=Qe(n,i.hooks),r.hooks=n),Ue(i.headers)&&(o=Me(o,i.headers),r.headers=o)}return void 0!==t&&(r.searchParams=t),s.length>0&&(1===s.length?r.signal=s[0]:r.signal=Se?AbortSignal.any(s):s.at(-1)),r},He=e=>Ee.includes(e)?e.toUpperCase():e,Be={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},We=(e={})=>{if("number"==typeof e)return{...Be,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.methods&&=e.methods.map(e=>e.toLowerCase()),e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");const t=Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e));return{...Be,...t}},Ve=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}},Ze=class e{static create(t,r){const o=new e(t,r),n=o.#T(async()=>{if("number"==typeof o.#x.timeout&&o.#x.timeout>2147483647)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let e=await o.#E();for(const r of o.#x.hooks.afterResponse){const n=o.#A(e.clone());let s;try{s=await r(o.request,o.#C(),n,{retryCount:o.#I})}catch(t){throw o.#O(n),o.#O(e),t}if(s instanceof Oe)throw o.#O(n),o.#O(e),new _e(s.options);const i=s instanceof globalThis.Response?s:e;n!==i&&o.#O(n),e!==i&&o.#O(e),e=i}if(o.#A(e),!e.ok&&("function"==typeof o.#x.throwHttpErrors?o.#x.throwHttpErrors(e.status):o.#x.throwHttpErrors)){let t=new we(e,o.request,o.#C());for(const e of o.#x.hooks.beforeError)t=await e(t,{retryCount:o.#I});throw t}if(o.#x.onDownloadProgress){if("function"!=typeof o.#x.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!Te)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const t=e.clone();return o.#O(e),((e,t)=>{if(!e.body)return e;if(204===e.status)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});const r=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(De(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})})(t,o.#x.onDownloadProgress)}return e}).finally(()=>{const e=o.#P;o.#k(e?.body??void 0),o.#k(o.request.body??void 0)});for(const[e,s]of Object.entries(Ae))"bytes"===e&&"function"!=typeof globalThis.Response?.prototype?.bytes||(n[e]=async()=>{o.request.headers.set("accept",o.request.headers.get("accept")||s);const t=await n;if("json"===e){if(204===t.status)return"";const e=await t.text();return""===e?"":r.parseJson?r.parseJson(e):JSON.parse(e)}return t[e]()});return n}static#q(e){return!e||"object"!=typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}request;#N;#I=0;#D;#x;#P;#U;#L;constructor(t,r={}){if(this.#D=t,this.#x={...r,headers:Me(this.#D.headers,r.headers),hooks:Qe({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:He(r.method??this.#D.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:We(r.retry),throwHttpErrors:r.throwHttpErrors??!0,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis),context:r.context??{}},"string"!=typeof this.#D&&!(this.#D instanceof URL||this.#D instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#x.prefixUrl&&"string"==typeof this.#D){if(this.#D.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#x.prefixUrl.endsWith("/")||(this.#x.prefixUrl+="/"),this.#D=this.#x.prefixUrl+this.#D}Re&&Se&&(this.#U=this.#x.signal??this.#D.signal,this.#N=new globalThis.AbortController,this.#x.signal=this.#U?AbortSignal.any([this.#U,this.#N.signal]):this.#N.signal),ve&&(this.#x.duplex="half"),void 0!==this.#x.json&&(this.#x.body=this.#x.stringifyJson?.(this.#x.json)??JSON.stringify(this.#x.json),this.#x.headers.set("content-type",this.#x.headers.get("content-type")??"application/json"));const o=r.headers&&new globalThis.Headers(r.headers).has("content-type");if(this.#D instanceof globalThis.Request&&(xe&&this.#x.body instanceof globalThis.FormData||this.#x.body instanceof URLSearchParams)&&!o&&this.#x.headers.delete("content-type"),this.request=new globalThis.Request(this.#D,this.#x),void 0!==(n=this.#x.searchParams)&&(Array.isArray(n)?n.length>0:n instanceof URLSearchParams?n.size>0:"object"==typeof n?Object.keys(n).length>0:"string"==typeof n?n.trim().length>0:Boolean(n))){const t="?"+("string"==typeof this.#x.searchParams?this.#x.searchParams.replace(/^\?/,""):new URLSearchParams(e.#q(this.#x.searchParams)).toString()),r=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,t);this.request=new globalThis.Request(r,this.#x)}var n;if(this.#x.onUploadProgress){if("function"!=typeof this.#x.onUploadProgress)throw new TypeError("The `onUploadProgress` option must be a function");if(!ve)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#M(this.request,this.#x.body??void 0)}}#j(){const e=this.#x.retry.delay(this.#I);let t=e;!0===this.#x.retry.jitter?t=Math.random()*e:"function"==typeof this.#x.retry.jitter&&(t=this.#x.retry.jitter(e),(!Number.isFinite(t)||t<0)&&(t=e));const r=this.#x.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(r,t)}async#Q(e){if(this.#I++,this.#I>this.#x.retry.limit)throw e;const t=e instanceof Error?e:new be(e);if(t instanceof _e)return t.customDelay??this.#j();if(!this.#x.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(void 0!==this.#x.retry.shouldRetry){const r=await this.#x.retry.shouldRetry({error:t,retryCount:this.#I});if(!1===r)throw e;if(!0===r)return this.#j()}if(function(e){return e instanceof Ve||e?.name===Ve.name}(e)&&!this.#x.retry.retryOnTimeout)throw e;if(function(e){return e instanceof we||e?.name===we.name}(e)){if(!this.#x.retry.statusCodes.includes(e.response.status))throw e;const t=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(t&&this.#x.retry.afterStatusCodes.includes(e.response.status)){let e=1e3*Number(t);Number.isNaN(e)?e=Date.parse(t)-Date.now():e>=Date.parse("2024-01-01")&&(e-=Date.now());const r=this.#x.retry.maxRetryAfter??e;return e<r?e:r}if(413===e.response.status)throw e}return this.#j()}#A(e){return this.#x.parseJson&&(e.json=async()=>this.#x.parseJson(await e.text())),e}#k(e){e&&e.cancel().catch(()=>{})}#O(e){this.#k(e.body??void 0)}async#T(e){try{return await e()}catch(t){const r=Math.min(await this.#Q(t),2147483647);if(this.#I<1)throw t;if(await async function(e,{signal:t}){return new Promise((r,o)=>{function n(){clearTimeout(s),o(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",n,{once:!0}));const s=setTimeout(()=>{t?.removeEventListener("abort",n),r()},e)})}(r,this.#U?{signal:this.#U}:{}),t instanceof _e&&t.customRequest){const e=this.#x.signal?new globalThis.Request(t.customRequest,{signal:this.#x.signal}):new globalThis.Request(t.customRequest);this.#F(e)}for(const e of this.#x.hooks.beforeRetry){const r=await e({request:this.request,options:this.#C(),error:t,retryCount:this.#I});if(r instanceof globalThis.Request){this.#F(r);break}if(r instanceof globalThis.Response)return r;if(r===Ie)return}return this.#T(e)}}async#E(){this.#N?.signal.aborted&&(this.#N=new globalThis.AbortController,this.#x.signal=this.#U?AbortSignal.any([this.#U,this.#N.signal]):this.#N.signal,this.request=new globalThis.Request(this.request,{signal:this.#x.signal}));for(const t of this.#x.hooks.beforeRequest){const e=await t(this.request,this.#C(),{retryCount:this.#I});if(e instanceof Response)return e;if(e instanceof globalThis.Request){this.#F(e);break}}const e=((e,t)=>{const r={};for(const o in t)Object.hasOwn(t,o)&&(o in Ne||o in ke||o in e&&!(o in qe)||(r[o]=t[o]));return r})(this.request,this.#x);return this.#P=this.request,this.request=this.#P.clone(),!1===this.#x.timeout?this.#x.fetch(this.#P,e):async function(e,t,r,o){return new Promise((n,s)=>{const i=setTimeout(()=>{r&&r.abort(),s(new Ve(e))},o.timeout);o.fetch(e,t).then(n).catch(s).then(()=>{clearTimeout(i)})})}(this.#P,e,this.#N,this.#x)}#C(){if(!this.#L){const{hooks:e,...t}=this.#x;this.#L=Object.freeze(t)}return this.#L}#F(e){this.#L=void 0,this.request=this.#M(e)}#M(e,t){return this.#x.onUploadProgress&&e.body?((e,t,r)=>{if(!e.body)return e;const o=(e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[r,o]of e)t+=Ce,t+=(new TextEncoder).encode(`Content-Disposition: form-data; name="${r}"`).length,t+="string"==typeof o?(new TextEncoder).encode(o).length:o.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if("string"==typeof e)return(new TextEncoder).encode(e).length;if(e instanceof URLSearchParams)return(new TextEncoder).encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if("object"==typeof e&&null!==e)try{const t=JSON.stringify(e);return(new TextEncoder).encode(t).length}catch{return 0}return 0})(r??e.body);return new Request(e,{duplex:"half",body:De(e.body,o,t)})})(e,this.#x.onUploadProgress,t??this.#x.body??void 0):e}},$e=e=>{const t=(t,r)=>Ze.create(t,Le(e,r));for(const r of Ee)t[r]=(t,o)=>Ze.create(t,Le(e,o,{method:r}));return t.create=e=>$e(Le(e)),t.extend=t=>("function"==typeof t&&(t=t(e??{})),$e(Le(e,t))),t.stop=Ie,t.retry=Pe,t},Ge=$e();function Je({title:e,children:t}){/* @__PURE__ */
2
+ return d("div",{className:"mx-auto mt-24 w-fit max-w-xl space-y-8",children:[/* @__PURE__ */d("svg",{xmlns:"http://www.w3.org/2000/svg",className:"mx-auto h-64 w-fit",width:"800",height:"469.317",viewBox:"0 0 800 469.317",role:"img","aria-label":"Error illustration",children:/* @__PURE__ */d("g",{transform:"translate(-443.142 -257.876)",children:[
3
+ /* @__PURE__ */d("path",{d:"M898.247,664.1H371.155a30.276,30.276,0,0,1-30.241-30.241V352.525a30.276,30.276,0,0,1,30.241-30.241H898.247a30.276,30.276,0,0,1,30.241,30.241V633.862A30.276,30.276,0,0,1,898.247,664.1Z",transform:"translate(308.867 25.517)",fill:"#fff"}),
4
+ /* @__PURE__ */d("path",{d:"M557.334,341.82H30.241A30.276,30.276,0,0,1,0,311.578V30.241A30.276,30.276,0,0,1,30.241,0H557.334a30.276,30.276,0,0,1,30.241,30.241V311.578A30.276,30.276,0,0,1,557.334,341.82ZM30.241,1.833A28.441,28.441,0,0,0,1.833,30.241V311.578a28.441,28.441,0,0,0,28.409,28.409H557.334a28.441,28.441,0,0,0,28.409-28.409V30.241A28.441,28.441,0,0,0,557.334,1.833Z",transform:"matrix(0.999, -0.035, 0.035, 0.999, 643.995, 358.158)",fill:"#d6d6e3"}),
5
+ /* @__PURE__ */d("path",{d:"M754.171,630.2l-509.5-135.058a30.276,30.276,0,0,1-21.483-36.981L295.28,186.212a30.276,30.276,0,0,1,36.981-21.483l509.5,135.058a30.276,30.276,0,0,1,21.483,36.981L791.152,608.712A30.276,30.276,0,0,1,754.171,630.2Z",transform:"translate(220.958 94.156)",fill:"#f2f2f2"}),
6
+ /* @__PURE__ */d("path",{d:"M775.247,705.1H248.155a30.276,30.276,0,0,1-30.241-30.241V393.525a30.276,30.276,0,0,1,30.241-30.241H775.247a30.276,30.276,0,0,1,30.241,30.242V674.862A30.275,30.275,0,0,1,775.247,705.1Z",transform:"translate(319.149 22.09)",fill:"#fff"}),
7
+ /* @__PURE__ */d("path",{d:"M638.653,701.841H298.272c-.426,0-.852-.009-1.272-.033l160.985-90.663c3.065-1.762,9.943-2.382,15.361-1.385a13.912,13.912,0,0,1,4.26,1.385l108.041,60.842,5.176,2.911Z",transform:"translate(312.538 1.526)",fill:"#e6e6e6"}),
8
+ /* @__PURE__ */d("path",{d:"M760.145,704.279h-294.4l57.049-26.943L526.9,675.4l74.341-35.111c4.874-2.3,16.6-2.445,22.328-.434q.577.206,1.071.434Z",transform:"translate(298.432 -0.912)",fill:"#e6e6e6"}),
9
+ /* @__PURE__ */d("path",{d:"M248.322,365.284a28.441,28.441,0,0,0-28.409,28.409V675.03a28.441,28.441,0,0,0,28.409,28.409H775.415a28.441,28.441,0,0,0,28.409-28.409V393.693a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(318.982 21.923)",fill:"#3f3d56"}),
10
+ /* @__PURE__ */d("path",{d:"M777.254,685.116H250.161a8.257,8.257,0,0,1-8.248-8.248V395.532a8.257,8.257,0,0,1,8.248-8.248H777.254a8.257,8.257,0,0,1,8.248,8.248V676.869a8.257,8.257,0,0,1-8.248,8.248Zm-527.092-296a6.422,6.422,0,0,0-6.415,6.415V676.869a6.422,6.422,0,0,0,6.415,6.415H777.254a6.422,6.422,0,0,0,6.415-6.415V395.532a6.422,6.422,0,0,0-6.415-6.415Z",transform:"translate(317.143 20.083)",fill:"#ccc"}),
11
+ /* @__PURE__ */d("ellipse",{cx:"71.849",cy:"89.934",rx:"71.849",ry:"89.934",transform:"translate(928.82 428.806)",fill:"#f2f2f2"}),
12
+ /* @__PURE__ */d("path",{d:"M505.77,325.365h.2l3.553,203.7h-7.5Z",transform:"translate(495.097 175.29)",fill:"#ccc"}),
13
+ /* @__PURE__ */d("path",{d:"M736.239,636.154h0a1.776,1.776,0,0,1-.744,2.4l-10.3,5.425-1.655-3.144,10.3-5.425A1.776,1.776,0,0,1,736.239,636.154Z",transform:"translate(276.882 -0.641)",fill:"#ccc"}),
14
+ /* @__PURE__ */d("ellipse",{cx:"71.849",cy:"89.934",rx:"71.849",ry:"89.934",transform:"translate(722.256 428.806)",fill:"#f2f2f2"}),
15
+ /* @__PURE__ */d("path",{d:"M510.532,627.307h0a1.777,1.777,0,0,0-2.4-.744l-7.194,3.788-2.464-141.27h-.2l-3.75,203.7h7.5l-1.02-58.456,8.78-4.622A1.777,1.777,0,0,0,510.532,627.307Z",transform:"translate(296.026 11.574)",fill:"#ccc"}),
16
+ /* @__PURE__ */d("path",{d:"M626.318,603.854a2.25,2.25,0,0,0-3.04-.943l-9.116,4.8-3.122-179h-.25l-4.752,258.115h9.5l-1.292-74.07,11.125-5.857a2.251,2.251,0,0,0,.943-3.04Z",transform:"translate(286.704 16.621)",fill:"#3f3d56"}),
17
+ /* @__PURE__ */d("path",{d:"M777.247,703.1H250.155a30.276,30.276,0,0,1-30.241-30.241V391.525a30.276,30.276,0,0,1,30.241-30.241H777.247a30.276,30.276,0,0,1,30.241,30.241V672.862A30.276,30.276,0,0,1,777.247,703.1Z",transform:"translate(318.982 22.257)",fill:"#fff"}),
18
+ /* @__PURE__ */d("path",{d:"M671.188,708.113h-370.8c-.464,0-.928-.01-1.386-.036l175.372-98.766c3.339-1.919,10.831-2.595,16.734-1.509a15.16,15.16,0,0,1,4.641,1.509l117.7,66.28,5.639,3.172Z",transform:"translate(288.046 16.168)",fill:"#f2f2f2"}),
19
+ /* @__PURE__ */d("path",{d:"M788.457,708.163H467.743l62.148-29.351,4.472-2.114,80.984-38.25c5.309-2.507,18.082-2.663,24.324-.473q.629.224,1.166.473Z",transform:"translate(287.761 16.118)",fill:"#f2f2f2"}),
20
+ /* @__PURE__ */d("path",{d:"M777.247,703.1H250.155a30.276,30.276,0,0,1-30.241-30.241V391.525a30.276,30.276,0,0,1,30.241-30.241H777.247a30.276,30.276,0,0,1,30.241,30.241V672.862A30.276,30.276,0,0,1,777.247,703.1ZM250.155,363.117a28.441,28.441,0,0,0-28.409,28.409V672.862a28.441,28.441,0,0,0,28.409,28.409H777.247a28.441,28.441,0,0,0,28.409-28.409V391.525a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(318.982 22.257)",fill:"#3f3d56"}),
21
+ /* @__PURE__ */d("g",{transform:"translate(696.754 297.373)",children:[
22
+ /* @__PURE__ */d("ellipse",{cx:"61.798",cy:"61.798",rx:"61.798",ry:"61.798",transform:"translate(215.662 36.955)",fill:"#ff6584"}),
23
+ /* @__PURE__ */d("ellipse",{cx:"78.271",cy:"97.971",rx:"78.271",ry:"97.971",transform:"translate(225.025 127.808)",fill:"#e6e6e6"}),
24
+ /* @__PURE__ */d("path",{d:"M508.105,323.365h.215l3.87,221.909h-8.171Z",transform:"translate(-204.593 -117.286)",fill:"#ccc"}),
25
+ /* @__PURE__ */d("path",{d:"M739.374,634.239h0a1.935,1.935,0,0,1-.811,2.614l-11.226,5.91-1.8-3.425,11.226-5.91A1.935,1.935,0,0,1,739.374,634.239Z",transform:"translate(-422.513 -281.249)",fill:"#ccc"}),
26
+ /* @__PURE__ */d("ellipse",{cx:"78.271",cy:"97.971",rx:"78.271",ry:"97.971",transform:"translate(0 127.808)",fill:"#e6e6e6"}),
27
+ /* @__PURE__ */d("path",{d:"M513.962,637.661h0a1.936,1.936,0,0,0-2.614-.811l-7.837,4.126-2.684-153.9h-.215l-4.085,221.91H504.7l-1.111-63.68,9.565-5.036A1.936,1.936,0,0,0,513.962,637.661Z",transform:"translate(-422.126 -281.002)",fill:"#ccc"}),
28
+ /* @__PURE__ */d("path",{d:"M612.666,280.653c54.774,0,99.294,103.207,99.294,171.768s-44.4,124.14-99.177,124.14-99.177-55.579-99.177-124.14S557.892,280.653,612.666,280.653Z",transform:"translate(-422.155 -280.653)",fill:"currentColor"}),
29
+ /* @__PURE__ */d("path",{d:"M630.131,617.508a2.452,2.452,0,0,0-3.312-1.027l-9.931,5.228-3.4-195h-.272L608.039,707.89h10.353l-1.408-80.69,12.119-6.38A2.452,2.452,0,0,0,630.131,617.508Z",transform:"translate(-422.315 -280.9)",fill:"#3f3d56"})]})]})}),/* @__PURE__ */d("div",{className:"space-y-4",children:[/* @__PURE__ */d("h4",{className:"text-foreground text-center text-lg font-semibold",children:e}),/* @__PURE__ */d("p",{className:"text-muted-foreground text-center",children:t})]})]})}function Ye({organizationId:e,errorType:r}){/* @__PURE__ */
30
+ return d(Je,"custom-auth-invalid"===r?{title:"Invalid input",children:"Custom auth mode requires uid, fname, lname. For more details please contact Qrati support."}:{title:"page-not-registered"===r?"Page not registered":"Something went wrong",children:["If you are an admin of this organization, please add the current page URL in Allowed URLs under"," ",
31
+ /* @__PURE__ */d("a",{className:"font-medium text-blue-500",href:t.ORGANIZATION_SETTINGS(e),target:"_blank",rel:"noreferrer",children:"Organization Settings"})," ","⇨"," ",
32
+ /* @__PURE__ */d("a",{className:"font-medium text-blue-500",href:t.ORGANIZATION_SETTINGS_INTEGRATION(e),target:"_blank",rel:"noreferrer",children:"Integration Settings"}),". For more details please contact Qrati support."]})}var Ke=e=>({google:"Google",apple:"Apple"}[e]||e.charAt(0).toUpperCase()+e.slice(1)),Xe=(e,t=0)=>{let r=t^e.length,o=0;const n=e.length;for(;o+3<n;){let t=255&e.charCodeAt(o)|(255&e.charCodeAt(o+1))<<8|(255&e.charCodeAt(o+2))<<16|(255&e.charCodeAt(o+3))<<24;t=Math.imul(t,3432918353),t=t<<15|t>>>17,t=Math.imul(t,461845907),r^=t,r=r<<13|r>>>19,r=Math.imul(r,5)+3864292196,o+=4}let s=0;switch(n-o){case 3:s^=(255&e.charCodeAt(o+2))<<16;case 2:s^=(255&e.charCodeAt(o+1))<<8;case 1:s^=255&e.charCodeAt(o),s=Math.imul(s,3432918353),s=s<<15|s>>>17,s=Math.imul(s,461845907),r^=s}return r^=r>>>16,r=Math.imul(r,2246822507),r^=r>>>13,r=Math.imul(r,3266489909),r^=r>>>16,r>>>=0,r.toString(16).padStart(8,"0")},et=async e=>{try{return await e()}catch{return null}},tt=e=>{if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(tt).join(",")}]`;const t=Object.keys(e).sort(),r=[];for(const o of t){const t=e[o];void 0!==t&&r.push(`${tt(o)}:${tt(t)}`)}return`{${r.join(",")}}`},rt=async({debug:e=!1}={})=>{const t=await et(()=>at()),r=await et(()=>new Intl.NumberFormat(window.navigator.languages?.[0]||"en").resolvedOptions().numberingSystem),o=window.navigator.languages?Array.from(window.navigator.languages).join(","):window.navigator.language||null,n=Intl.DateTimeFormat().resolvedOptions().timeZone,s=/* @__PURE__ */(new Date).getTimezoneOffset(),i=window.matchMedia("(prefers-reduced-motion: reduce)").matches?"reduce":"no-preference",a=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",l=window.matchMedia("(forced-colors: active)").matches?"active":null,{pixelDepth:c,colorDepth:u}=window.screen,h="ontouchstart"in window||window.navigator.maxTouchPoints>0,d=await et(()=>ot(e)),f=await et(()=>nt()),p=await et(()=>st(e)),m=await et(()=>it(e)),y=window.screen.width&&window.screen.height?(window.screen.width/window.screen.height).toFixed(4):null,g={vendor:window.navigator.vendor||null,platform:window.navigator.platform||null,fonts:t,numberingSystem:r,languages:o,timezone:n,timezoneOffset:s,reducedMotion:i,colorScheme:a,hardwareConcurrency:window.navigator.hardwareConcurrency||null,deviceMemory:window.navigator.deviceMemory||null,forcedColors:l,pixelDepth:c,colorDepth:u,touchSupport:h,canvasID:d,webglID:f,webgpuID:p,audioID:m},w={aspectRatio:y,width:window.screen.width,height:window.screen.height,maxTouchPoints:window.navigator.maxTouchPoints};return(!0===navigator.userAgentData?.mobile||/Mobi|Android|iPhone|iPad|iPod|webOS|BlackBerry|Windows Phone/i.test(navigator.userAgent)||navigator.maxTouchPoints>0&&matchMedia("(pointer:coarse)").matches&&innerWidth<=1024)&&Object.assign(g,w),{fingerprint:Xe(tt(g)),...g}},ot=async e=>{const t=document.createElement("canvas");t.width=280,t.height=100;const r=t.getContext("2d"),o=r.createLinearGradient(0,0,280,100);return o.addColorStop(0,"#f60"),o.addColorStop(.4,"#09f"),o.addColorStop(.7,"#f09"),o.addColorStop(1,"#0f9"),r.fillStyle=o,r.fillRect(0,0,280,100),r.font='18px "Arial","Helvetica","DejaVu Sans",sans-serif',r.fillStyle="#000",r.textBaseline="alphabetic",r.fillText("Fingerprint ¼½¾™©®∆π∑€¶§",12,45),r.font='bold 22px "Georgia","Times New Roman",serif',r.fillStyle="#222",r.fillText("🦊🐱🚀 2026",12,78),r.globalAlpha=.7,r.fillStyle="rgba(255, 80, 0, 0.35)",r.fillRect(180,20,80,60),r.beginPath(),r.arc(220,50,32,0,2*Math.PI),r.strokeStyle="#fff",r.lineWidth=4,r.stroke(),r.beginPath(),r.moveTo(30,85),r.quadraticCurveTo(140,20,240,85),r.strokeStyle="#00f",r.lineWidth=3,r.stroke(),e&&(t.style.border="1px solid #444",document.body.appendChild(t)),Xe(t.toDataURL("image/png"))},nt=()=>{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl"),r=t.getExtension("WEBGL_debug_renderer_info");return Xe(tt({vendor:r?t.getParameter(r.UNMASKED_VENDOR_WEBGL):t.getParameter(t.VENDOR),renderer:r?t.getParameter(r.UNMASKED_RENDERER_WEBGL):t.getParameter(t.RENDERER)}))},st=async e=>{const t=await navigator.gpu.requestAdapter({powerPreference:"high-performance"}),r={vendor:t.info?.vendor??"",architecture:t.info?.architecture??"",description:t.info?.description??"",features:Array.from(t.features).sort(),limits:Array.from(t.limits).sort()};if(e){const e=document.createElement("pre");e.style.margin="10px 0",e.style.padding="10px",e.style.border="1px solid #444",e.style.background="#111",e.style.color="#0f8",e.style.fontFamily="monospace",e.textContent=`WebGPU:\n${JSON.stringify(r,null,2)}`,document.body.appendChild(e)}return Xe(tt(r))},it=async e=>{const t=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,6e3,44100),r=t.createOscillator();r.type="sawtooth",r.frequency.value=8800;const o=t.createDynamicsCompressor();o.threshold.value=-48,o.knee.value=30,o.ratio.value=14,o.attack.value=0,o.release.value=.3;const n=t.createGain();n.gain.value=.4,r.connect(o),o.connect(n),n.connect(t.destination),r.start(0);const s=(await t.startRendering()).getChannelData(0);let i=0,a=0;for(let c=3e3;c<5800;c+=2){const e=s[c];i=31*i+Math.floor(1e5*(e+1))|0,a=Math.imul(a^Math.floor(98765*e),2246822519)}const l=i>>>0^a>>>0;if(e){const e=document.createElement("canvas");e.width=500,e.height=120,e.style.border="1px solid #444",e.style.margin="10px 0",e.title="Audio buffer snippet (4500–5000 samples)";const t=e.getContext("2d");t.fillStyle="#111",t.fillRect(0,0,e.width,e.height),t.font="14px monospace",t.fillStyle="#0f8",t.textAlign="left",t.fillText("AudioID",10,20),t.strokeStyle="#0f8",t.lineWidth=1.5,t.beginPath();const r=Array.from(s.slice(4500,5e3)),o=e.width/r.length;for(let n=0;n<r.length;n++){const s=n*o,i=(r[n]+1)/2*e.height;0===n?t.moveTo(s,i):t.lineTo(s,i)}t.stroke(),document.body.appendChild(e)}return Xe(l.toString(16))},at=()=>{const e=["monospace","serif","sans-serif"],t=["Arial","Helvetica","Verdana","Trebuchet MS","Comic Sans MS","Georgia","Times New Roman","Courier New","Segoe UI","Roboto","Open Sans","Noto Sans","system-ui","-apple-system","BlinkMacSystemFont"],r=document.createElement("span");r.style.fontSize="72px",r.style.position="absolute",r.style.visibility="hidden",r.style.whiteSpace="nowrap",r.textContent="mmmmmmmmmwwwwwww",document.body.appendChild(r);const o={};for(const s of e)r.style.fontFamily=s,o[s]=r.offsetWidth;const n=[];for(const s of t){let t=!1;for(const i of e)if(r.style.fontFamily=`"${s}", ${i}`,r.offsetWidth!==o[i]){n.push(s),t=!0;break}t||(r.style.fontFamily=`"${s}"`,r.offsetWidth!==o.monospace&&r.offsetWidth!==o.serif&&n.push(s))}return document.body.removeChild(r),n.length?n.sort().join(","):null};"undefined"!=typeof window&&(window.getBrowserFingerprint=rt);var lt=async(e,t)=>{if(e instanceof we){try{const t=await e.response.json();if(t?.error)return t.error;if(t?.message)return t.message;if("INVALID_EMAIL_OR_PASSWORD"===t?.code)return"Invalid email or password"}catch{return t||e.message}return t||e.message}return e instanceof Error?t||e.message:t||String(e)},ct=P(void 0),ut=({props:e={},children:t})=>{const{organizationId:r,uid:n,fname:s,lname:i,theme:a="light"}=e,[l,c]=S(()=>{if("undefined"==typeof window)return null;if(n||s||i)return null;const e=localStorage.getItem("qrati_token");return e?{token:e}:null}),{isLoading:u,data:f,error:m}=W({queryKey:[o.QRATI_CONNECT_SESSION,r,n??null,s??null,i??null],queryFn:async()=>{const e=await(async()=>{const e=await rt();return"string"==typeof e?e:e?.fingerprint})();return(await Ge.post(C.INITIALIZE_SESSION,{json:{uid:n,fname:s,lname:i,browserFingerprint:e},headers:{"x-org-id":r,Authorization:n||s||i||!localStorage.getItem("qrati_token")?void 0:`Bearer ${localStorage.getItem("qrati_token")}`}}).json()).data},enabled:!!r});h(()=>{const e=f?.authSession?.session?.token,t=f?.authSession?.user;t&&e?(c({...t,token:e}),f?.organization?.customAuth||localStorage.setItem("qrati_token",e)):f?.organization?.customAuth&&n&&s&&i&&c(e=>e??{uid:n,name:`${s} ${i}`,fname:s,lname:i})},[f]);const y=p(()=>g(f?.organization?.integrationSettings,f?.organization?.customFontUrl),[f?.organization?.integrationSettings,f?.organization?.customFontUrl]),w=async e=>{try{const t=await((e,t,r)=>new Promise((o,n)=>{if(!e)return void n(/* @__PURE__ */new Error("Provider is required"));if(!t)return void n(/* @__PURE__ */new Error("Organization ID is required"));const s=new URL(`${r}/qc-social-auth`);s.searchParams.set("provider",e),s.searchParams.set("organizationId",t),s.searchParams.set("origin",window.location.origin);const i=(window.screen.width-500)/2,a=(window.screen.height-600)/2,l=window.open(s.toString(),"qrati_social_auth",`width=500,height=600,left=${i},top=${a},scrollbars=yes,resizable=yes,status=yes`);if(!l)return void n(/* @__PURE__ */new Error("Failed to open popup window. Please allow popups and try again."));const c=()=>{clearInterval(h),clearTimeout(d),window.removeEventListener("message",u)},u=e=>{try{const t=new URL(r).origin;if(e.origin!==t)return void console.warn("Origin mismatch:",e.origin,"expected:",t)}catch(h){console.warn("Could not parse origin for verification")}const{type:s,data:i,error:a,organizationId:u}=e.data||{};if(u===t)switch(s){case"QRATI_SOCIAL_AUTH_SUCCESS":c(),l.close(),o({user:i.user,session:i.session,token:i.token});break;case"QRATI_SOCIAL_AUTH_ERROR":console.error("Authentication error:",a),c(),l.close(),n(new Error(a||"Social authentication failed"));break;case"QRATI_SOCIAL_AUTH_CANCELLED":c(),l.close(),n(/* @__PURE__ */new Error("Authentication was cancelled"))}else console.warn("Organization ID mismatch:",u,"expected:",t)},h=setInterval(()=>{try{l.closed&&(c(),n(/* @__PURE__ */new Error("Authentication was cancelled")))}catch(e){}},1e3);window.addEventListener("message",u);const d=setTimeout(()=>{c(),l.closed||l.close(),n(/* @__PURE__ */new Error("Authentication timeout. Please try again."))},3e5)}))(e,r??"","https://qrati.com");return t?.user&&t?.token&&(c({...t.user,token:t.token}),localStorage.setItem("qrati_token",t.token)),t}catch(m){throw console.error("Social login error:",m),m}};return m?/* @__PURE__ */d(X,{fallback:null,children:/* @__PURE__ */d(Ye,{organizationId:r??"",errorType:401===m?.response?.status?"page-not-registered":"generic-error"})}):!f?.organization?.customAuth||n&&s&&i?/* @__PURE__ */d(ct.Provider,{value:{props:e,initializing:u,sessionId:f?.sessionId,organization:f?.organization,folders:f?.folders,loadingUser:u,user:l,updateUser:async e=>{c(t=>{const r={...t,...e};return r?.token&&localStorage.setItem("qrati_token",r.token),r})},registerUsingEmail:async(e,t,o,n)=>{try{const s=await Ge.post(C.REGISTER,{json:{email:e,password:t,fname:o,lname:n},headers:{"x-org-id":r}}).json();return s.error?{error:s.error}:(c({...s.user,token:s.token}),localStorage.setItem("qrati_token",s.token),s)}catch(m){return{error:await lt(m,"Registration failed")}}},loginWithGoogle:async()=>{try{return await w("google")}catch(m){throw console.error("Google login error:",m),m}},loginWithApple:async()=>{try{return await w("apple")}catch(m){throw console.error("Apple login error:",m),m}},loginUsingEmail:async(e,t)=>{try{const o=await Ge.post(C.LOGIN,{json:{email:e,password:t},headers:{"x-org-id":r}}).json();return o.error?{error:o.error}:(c({...o.user,token:o.token}),localStorage.setItem("qrati_token",o.token),o)}catch(m){return{error:await lt(m,"Invalid email or password")}}},sendPasswordResetCode:async e=>{try{const t=await Ge.post(C.SEND_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase()},headers:{"x-org-id":r}}).json();return t.error?{error:t.error}:t}catch(m){return{error:await lt(m,"Failed to send password reset code")}}},verifyPasswordResetCode:async(e,t)=>{try{const o=await Ge.post(C.VERIFY_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase(),code:t},headers:{"x-org-id":r}}).json();return o.error?{error:o.error}:o}catch(m){return{error:await lt(m,"Invalid code, please check your email")}}},resetPassword:async(e,t)=>{try{const o=await Ge.post(C.RESET_PASSWORD,{json:{passwordResetCodeId:e,newPassword:t},headers:{"x-org-id":r}}).json();return o.error?{error:o.error}:o}catch(m){return{error:m?.message}}},signout:async()=>{try{const e=await Ge.post(C.LOGOUT,{headers:{"x-org-id":r,Authorization:`Bearer ${l?.token}`}}).json();return e.error?{error:e.error}:(localStorage.removeItem("qrati_token"),c(null),e)}catch(m){return console.error(m),{error:m?.message}}},error:m},children:/* @__PURE__ */d("div",{id:"qrati-connect-container",style:{..._(f?.organization,a),fontFamily:"var(--font-family)"},className:E("bg-background text-foreground relative min-h-[80vh]"),children:[y?/* @__PURE__ */d("style",{children:y}):null,t]})}):/* @__PURE__ */d(X,{fallback:null,children:/* @__PURE__ */d(Ye,{organizationId:r??"",errorType:"custom-auth-invalid"})})},ht=()=>{const e=y(ct);if(void 0===e)throw new Error("useSession must be used within SessionProvider");return e};export{Ge as a,te as c,U as d,Ke as i,W as l,ht as n,ie as o,rt as r,X as s,ut as t,B as u};
@@ -1 +1 @@
1
- const t=require("./DV6DJ1Br.js");function e(e){return{onFetch:(a,n)=>{const r=a.options,o=a.fetchOptions?.meta?.fetchMore?.direction,u=a.state.data?.pages||[],h=a.state.data?.pageParams||[];let c={pages:[],pageParams:[]},l=0;const y=async()=>{let n=!1;const y=t.ensureQueryFn(a.options,a.fetchOptions),d=async(e,s,i)=>{if(n)return Promise.reject();if(null==s&&e.pages.length)return Promise.resolve(e);const r=await y((()=>{const e={client:a.client,queryKey:a.queryKey,pageParam:s,direction:i?"backward":"forward",meta:a.options.meta};var r;return r=e,t.addConsumeAwareSignal(r,()=>a.signal,()=>n=!0),e})()),{maxPages:o}=a.options,u=i?t.addToStart:t.addToEnd;return{pages:u(e.pages,r,o),pageParams:u(e.pageParams,s,o)}};if(o&&u.length){const t="backward"===o,e=t?i:s,a={pages:u,pageParams:h};c=await d(a,e(r,a),t)}else{const t=e??u.length;do{const t=0===l?h[0]??r.initialPageParam:s(r,c);if(l>0&&null==t)break;c=await d(c,t),l++}while(l<t)}return c};a.options.persister?a.fetchFn=()=>a.options.persister?.(y,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},n):a.fetchFn=y}}}function s(t,{pages:e,pageParams:s}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}function i(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}function a(t,e){return!!e&&null!=s(t,e)}function n(t,e){return!(!e||!t.getPreviousPageParam)&&null!=i(t,e)}var r=class extends t.Removable{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const s=()=>{this.#a({type:"continue"})},i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=t.createRetryer({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(new Error("No mutationFn found")),onFail:(t,e)=>{this.#a({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#a({type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const a="pending"===this.state.status,n=!this.#i.canStart();try{if(a)s();else{this.#a({type:"pending",variables:e,isPaused:n}),this.#s.config.onMutate&&await this.#s.config.onMutate(e,this,i);const t=await(this.options.onMutate?.(e,i));t!==this.state.context&&this.#a({type:"pending",context:t,variables:e,isPaused:n})}const t=await this.#i.start();return await(this.#s.config.onSuccess?.(t,e,this.state.context,this,i)),await(this.options.onSuccess?.(t,e,this.state.context,i)),await(this.#s.config.onSettled?.(t,null,this.state.variables,this.state.context,this,i)),await(this.options.onSettled?.(t,null,e,this.state.context,i)),this.#a({type:"success",data:t}),t}catch(r){try{await(this.#s.config.onError?.(r,e,this.state.context,this,i))}catch(o){Promise.reject(o)}try{await(this.options.onError?.(r,e,this.state.context,i))}catch(o){Promise.reject(o)}try{await(this.#s.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this,i))}catch(o){Promise.reject(o)}try{await(this.options.onSettled?.(void 0,r,e,this.state.context,i))}catch(o){Promise.reject(o)}throw this.#a({type:"error",error:r}),r}finally{this.#s.runNext(this)}}#a(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),t.notifyManager.batch(()=>{this.#e.forEach(t=>{t.onMutationUpdate(e)}),this.#s.notify({mutation:this,type:"updated",action:e})})}},o=class extends t.Subscribable{constructor(t={}){super(),this.config=t,this.#n=new Set,this.#r=new Map,this.#o=0}#n;#r;#o;build(t,e,s){const i=new r({client:t,mutationCache:this,mutationId:++this.#o,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#n.add(t);const e=u(t);if("string"==typeof e){const s=this.#r.get(e);s?s.push(t):this.#r.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#n.delete(t)){const e=u(t);if("string"==typeof e){const s=this.#r.get(e);if(s)if(s.length>1){const e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#r.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=u(t);if("string"==typeof e){const s=this.#r.get(e)?.find(t=>"pending"===t.state.status);return!s||s===t}return!0}runNext(t){const e=u(t);return"string"==typeof e?(this.#r.get(e)?.find(e=>e!==t&&e.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){t.notifyManager.batch(()=>{this.#n.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#n.clear(),this.#r.clear()})}getAll(){return Array.from(this.#n)}find(e){const s={exact:!0,...e};return this.getAll().find(e=>t.matchMutation(s,e))}findAll(e={}){return this.getAll().filter(s=>t.matchMutation(e,s))}notify(e){t.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return t.notifyManager.batch(()=>Promise.all(e.map(e=>e.continue().catch(t.noop))))}};function u(t){return t.options.scope?.id}var h=class extends t.Subscribable{constructor(t={}){super(),this.config=t,this.#u=new Map}#u;build(e,s,i){const a=s.queryKey,n=s.queryHash??t.hashQueryKeyByOptions(a,s);let r=this.get(n);return r||(r=new t.Query({client:e,queryKey:a,queryHash:n,options:e.defaultQueryOptions(s),state:i,defaultOptions:e.getQueryDefaults(a)}),this.add(r)),r}add(t){this.#u.has(t.queryHash)||(this.#u.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#u.get(t.queryHash);e&&(t.destroy(),e===t&&this.#u.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){t.notifyManager.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#u.get(t)}getAll(){return[...this.#u.values()]}find(e){const s={exact:!0,...e};return this.getAll().find(e=>t.matchQuery(s,e))}findAll(e={}){const s=this.getAll();return Object.keys(e).length>0?s.filter(s=>t.matchQuery(e,s)):s}notify(e){t.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){t.notifyManager.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){t.notifyManager.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},c=class{#h;#s;#c;#l;#y;#d;#f;#p;constructor(t={}){this.#h=t.queryCache||new h,this.#s=t.mutationCache||new o,this.#c=t.defaultOptions||{},this.#l=new Map,this.#y=new Map,this.#d=0}mount(){this.#d++,1===this.#d&&(this.#f=t.focusManager.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#h.onFocus())}),this.#p=t.onlineManager.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#h.onOnline())}))}unmount(){this.#d--,0===this.#d&&(this.#f?.(),this.#f=void 0,this.#p?.(),this.#p=void 0)}isFetching(t){return this.#h.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#s.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#h.get(e.queryHash)?.state.data}ensureQueryData(e){const s=this.defaultQueryOptions(e),i=this.#h.build(this,s),a=i.state.data;return void 0===a?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(t.resolveStaleTime(s.staleTime,i))&&this.prefetchQuery(s),Promise.resolve(a))}getQueriesData(t){return this.#h.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(e,s,i){const a=this.defaultQueryOptions({queryKey:e}),n=this.#h.get(a.queryHash)?.state.data,r=t.functionalUpdate(s,n);if(void 0!==r)return this.#h.build(this,a).setData(r,{...i,manual:!0})}setQueriesData(e,s,i){return t.notifyManager.batch(()=>this.#h.findAll(e).map(({queryKey:t})=>[t,this.setQueryData(t,s,i)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#h.get(e.queryHash)?.state}removeQueries(e){const s=this.#h;t.notifyManager.batch(()=>{s.findAll(e).forEach(t=>{s.remove(t)})})}resetQueries(e,s){const i=this.#h;return t.notifyManager.batch(()=>(i.findAll(e).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...e},s)))}cancelQueries(e,s={}){const i={revert:!0,...s},a=t.notifyManager.batch(()=>this.#h.findAll(e).map(t=>t.cancel(i)));return Promise.all(a).then(t.noop).catch(t.noop)}invalidateQueries(e,s={}){return t.notifyManager.batch(()=>(this.#h.findAll(e).forEach(t=>{t.invalidate()}),"none"===e?.refetchType?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},s)))}refetchQueries(e,s={}){const i={...s,cancelRefetch:s.cancelRefetch??!0},a=t.notifyManager.batch(()=>this.#h.findAll(e).filter(t=>!t.isDisabled()&&!t.isStatic()).map(e=>{let s=e.fetch(void 0,i);return i.throwOnError||(s=s.catch(t.noop)),"paused"===e.state.fetchStatus?Promise.resolve():s}));return Promise.all(a).then(t.noop)}fetchQuery(e){const s=this.defaultQueryOptions(e);void 0===s.retry&&(s.retry=!1);const i=this.#h.build(this,s);return i.isStaleByTime(t.resolveStaleTime(s.staleTime,i))?i.fetch(s):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(t.noop).catch(t.noop)}fetchInfiniteQuery(t){return t.behavior=e(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(t.noop).catch(t.noop)}ensureInfiniteQueryData(t){return t.behavior=e(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return t.onlineManager.isOnline()?this.#s.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#h}getMutationCache(){return this.#s}getDefaultOptions(){return this.#c}setDefaultOptions(t){this.#c=t}setQueryDefaults(e,s){this.#l.set(t.hashKey(e),{queryKey:e,defaultOptions:s})}getQueryDefaults(e){const s=[...this.#l.values()],i={};return s.forEach(s=>{t.partialMatchKey(e,s.queryKey)&&Object.assign(i,s.defaultOptions)}),i}setMutationDefaults(e,s){this.#y.set(t.hashKey(e),{mutationKey:e,defaultOptions:s})}getMutationDefaults(e){const s=[...this.#y.values()],i={};return s.forEach(s=>{t.partialMatchKey(e,s.mutationKey)&&Object.assign(i,s.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const s={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return s.queryHash||(s.queryHash=t.hashQueryKeyByOptions(s.queryKey,s)),void 0===s.refetchOnReconnect&&(s.refetchOnReconnect="always"!==s.networkMode),void 0===s.throwOnError&&(s.throwOnError=!!s.suspense),!s.networkMode&&s.persister&&(s.networkMode="offlineFirst"),s.queryFn===t.skipToken&&(s.enabled=!1),s}defaultMutationOptions(t){return t?._defaulted?t:{...this.#c.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#h.clear(),this.#s.clear()}};Object.defineProperty(exports,"QueryClient",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"hasNextPage",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"hasPreviousPage",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"infiniteQueryBehavior",{enumerable:!0,get:function(){return e}});
1
+ const t=require("./CPs8NoX7.js");function e(e){return{onFetch:(a,n)=>{const r=a.options,o=a.fetchOptions?.meta?.fetchMore?.direction,u=a.state.data?.pages||[],h=a.state.data?.pageParams||[];let c={pages:[],pageParams:[]},l=0;const y=async()=>{let n=!1;const y=t.ensureQueryFn(a.options,a.fetchOptions),d=async(e,s,i)=>{if(n)return Promise.reject();if(null==s&&e.pages.length)return Promise.resolve(e);const r=await y((()=>{const e={client:a.client,queryKey:a.queryKey,pageParam:s,direction:i?"backward":"forward",meta:a.options.meta};var r;return r=e,t.addConsumeAwareSignal(r,()=>a.signal,()=>n=!0),e})()),{maxPages:o}=a.options,u=i?t.addToStart:t.addToEnd;return{pages:u(e.pages,r,o),pageParams:u(e.pageParams,s,o)}};if(o&&u.length){const t="backward"===o,e=t?i:s,a={pages:u,pageParams:h};c=await d(a,e(r,a),t)}else{const t=e??u.length;do{const t=0===l?h[0]??r.initialPageParam:s(r,c);if(l>0&&null==t)break;c=await d(c,t),l++}while(l<t)}return c};a.options.persister?a.fetchFn=()=>a.options.persister?.(y,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},n):a.fetchFn=y}}}function s(t,{pages:e,pageParams:s}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}function i(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}function a(t,e){return!!e&&null!=s(t,e)}function n(t,e){return!(!e||!t.getPreviousPageParam)&&null!=i(t,e)}var r=class extends t.Removable{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const s=()=>{this.#a({type:"continue"})},i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=t.createRetryer({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(new Error("No mutationFn found")),onFail:(t,e)=>{this.#a({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#a({type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const a="pending"===this.state.status,n=!this.#i.canStart();try{if(a)s();else{this.#a({type:"pending",variables:e,isPaused:n}),this.#s.config.onMutate&&await this.#s.config.onMutate(e,this,i);const t=await(this.options.onMutate?.(e,i));t!==this.state.context&&this.#a({type:"pending",context:t,variables:e,isPaused:n})}const t=await this.#i.start();return await(this.#s.config.onSuccess?.(t,e,this.state.context,this,i)),await(this.options.onSuccess?.(t,e,this.state.context,i)),await(this.#s.config.onSettled?.(t,null,this.state.variables,this.state.context,this,i)),await(this.options.onSettled?.(t,null,e,this.state.context,i)),this.#a({type:"success",data:t}),t}catch(r){try{await(this.#s.config.onError?.(r,e,this.state.context,this,i))}catch(o){Promise.reject(o)}try{await(this.options.onError?.(r,e,this.state.context,i))}catch(o){Promise.reject(o)}try{await(this.#s.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this,i))}catch(o){Promise.reject(o)}try{await(this.options.onSettled?.(void 0,r,e,this.state.context,i))}catch(o){Promise.reject(o)}throw this.#a({type:"error",error:r}),r}finally{this.#s.runNext(this)}}#a(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),t.notifyManager.batch(()=>{this.#e.forEach(t=>{t.onMutationUpdate(e)}),this.#s.notify({mutation:this,type:"updated",action:e})})}},o=class extends t.Subscribable{constructor(t={}){super(),this.config=t,this.#n=new Set,this.#r=new Map,this.#o=0}#n;#r;#o;build(t,e,s){const i=new r({client:t,mutationCache:this,mutationId:++this.#o,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#n.add(t);const e=u(t);if("string"==typeof e){const s=this.#r.get(e);s?s.push(t):this.#r.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#n.delete(t)){const e=u(t);if("string"==typeof e){const s=this.#r.get(e);if(s)if(s.length>1){const e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#r.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=u(t);if("string"==typeof e){const s=this.#r.get(e)?.find(t=>"pending"===t.state.status);return!s||s===t}return!0}runNext(t){const e=u(t);return"string"==typeof e?(this.#r.get(e)?.find(e=>e!==t&&e.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){t.notifyManager.batch(()=>{this.#n.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#n.clear(),this.#r.clear()})}getAll(){return Array.from(this.#n)}find(e){const s={exact:!0,...e};return this.getAll().find(e=>t.matchMutation(s,e))}findAll(e={}){return this.getAll().filter(s=>t.matchMutation(e,s))}notify(e){t.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return t.notifyManager.batch(()=>Promise.all(e.map(e=>e.continue().catch(t.noop))))}};function u(t){return t.options.scope?.id}var h=class extends t.Subscribable{constructor(t={}){super(),this.config=t,this.#u=new Map}#u;build(e,s,i){const a=s.queryKey,n=s.queryHash??t.hashQueryKeyByOptions(a,s);let r=this.get(n);return r||(r=new t.Query({client:e,queryKey:a,queryHash:n,options:e.defaultQueryOptions(s),state:i,defaultOptions:e.getQueryDefaults(a)}),this.add(r)),r}add(t){this.#u.has(t.queryHash)||(this.#u.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#u.get(t.queryHash);e&&(t.destroy(),e===t&&this.#u.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){t.notifyManager.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#u.get(t)}getAll(){return[...this.#u.values()]}find(e){const s={exact:!0,...e};return this.getAll().find(e=>t.matchQuery(s,e))}findAll(e={}){const s=this.getAll();return Object.keys(e).length>0?s.filter(s=>t.matchQuery(e,s)):s}notify(e){t.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){t.notifyManager.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){t.notifyManager.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},c=class{#h;#s;#c;#l;#y;#d;#f;#p;constructor(t={}){this.#h=t.queryCache||new h,this.#s=t.mutationCache||new o,this.#c=t.defaultOptions||{},this.#l=new Map,this.#y=new Map,this.#d=0}mount(){this.#d++,1===this.#d&&(this.#f=t.focusManager.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#h.onFocus())}),this.#p=t.onlineManager.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#h.onOnline())}))}unmount(){this.#d--,0===this.#d&&(this.#f?.(),this.#f=void 0,this.#p?.(),this.#p=void 0)}isFetching(t){return this.#h.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#s.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#h.get(e.queryHash)?.state.data}ensureQueryData(e){const s=this.defaultQueryOptions(e),i=this.#h.build(this,s),a=i.state.data;return void 0===a?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(t.resolveStaleTime(s.staleTime,i))&&this.prefetchQuery(s),Promise.resolve(a))}getQueriesData(t){return this.#h.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(e,s,i){const a=this.defaultQueryOptions({queryKey:e}),n=this.#h.get(a.queryHash)?.state.data,r=t.functionalUpdate(s,n);if(void 0!==r)return this.#h.build(this,a).setData(r,{...i,manual:!0})}setQueriesData(e,s,i){return t.notifyManager.batch(()=>this.#h.findAll(e).map(({queryKey:t})=>[t,this.setQueryData(t,s,i)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#h.get(e.queryHash)?.state}removeQueries(e){const s=this.#h;t.notifyManager.batch(()=>{s.findAll(e).forEach(t=>{s.remove(t)})})}resetQueries(e,s){const i=this.#h;return t.notifyManager.batch(()=>(i.findAll(e).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...e},s)))}cancelQueries(e,s={}){const i={revert:!0,...s},a=t.notifyManager.batch(()=>this.#h.findAll(e).map(t=>t.cancel(i)));return Promise.all(a).then(t.noop).catch(t.noop)}invalidateQueries(e,s={}){return t.notifyManager.batch(()=>(this.#h.findAll(e).forEach(t=>{t.invalidate()}),"none"===e?.refetchType?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},s)))}refetchQueries(e,s={}){const i={...s,cancelRefetch:s.cancelRefetch??!0},a=t.notifyManager.batch(()=>this.#h.findAll(e).filter(t=>!t.isDisabled()&&!t.isStatic()).map(e=>{let s=e.fetch(void 0,i);return i.throwOnError||(s=s.catch(t.noop)),"paused"===e.state.fetchStatus?Promise.resolve():s}));return Promise.all(a).then(t.noop)}fetchQuery(e){const s=this.defaultQueryOptions(e);void 0===s.retry&&(s.retry=!1);const i=this.#h.build(this,s);return i.isStaleByTime(t.resolveStaleTime(s.staleTime,i))?i.fetch(s):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(t.noop).catch(t.noop)}fetchInfiniteQuery(t){return t.behavior=e(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(t.noop).catch(t.noop)}ensureInfiniteQueryData(t){return t.behavior=e(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return t.onlineManager.isOnline()?this.#s.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#h}getMutationCache(){return this.#s}getDefaultOptions(){return this.#c}setDefaultOptions(t){this.#c=t}setQueryDefaults(e,s){this.#l.set(t.hashKey(e),{queryKey:e,defaultOptions:s})}getQueryDefaults(e){const s=[...this.#l.values()],i={};return s.forEach(s=>{t.partialMatchKey(e,s.queryKey)&&Object.assign(i,s.defaultOptions)}),i}setMutationDefaults(e,s){this.#y.set(t.hashKey(e),{mutationKey:e,defaultOptions:s})}getMutationDefaults(e){const s=[...this.#y.values()],i={};return s.forEach(s=>{t.partialMatchKey(e,s.mutationKey)&&Object.assign(i,s.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const s={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return s.queryHash||(s.queryHash=t.hashQueryKeyByOptions(s.queryKey,s)),void 0===s.refetchOnReconnect&&(s.refetchOnReconnect="always"!==s.networkMode),void 0===s.throwOnError&&(s.throwOnError=!!s.suspense),!s.networkMode&&s.persister&&(s.networkMode="offlineFirst"),s.queryFn===t.skipToken&&(s.enabled=!1),s}defaultMutationOptions(t){return t?._defaulted?t:{...this.#c.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#h.clear(),this.#s.clear()}};Object.defineProperty(exports,"QueryClient",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"hasNextPage",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"hasPreviousPage",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"infiniteQueryBehavior",{enumerable:!0,get:function(){return e}});
@@ -1 +1 @@
1
- import{$ as t,G as e,H as s,I as i,J as a,K as n,L as r,P as o,Q as u,R as h,U as c,W as l,X as d,Z as f,at as y,ct as p,lt as m,nt as g,q as v,z as b}from"./QPXxc9eb.js";function q(t){return{onFetch:(i,a)=>{const n=i.options,r=i.fetchOptions?.meta?.fetchMore?.direction,o=i.state.data?.pages||[],u=i.state.data?.pageParams||[];let h={pages:[],pageParams:[]},d=0;const f=async()=>{let a=!1;const f=e(i.options,i.fetchOptions),y=async(t,e,n)=>{if(a)return Promise.reject();if(null==e&&t.pages.length)return Promise.resolve(t);const r=await f((()=>{const t={client:i.client,queryKey:i.queryKey,pageParam:e,direction:n?"backward":"forward",meta:i.options.meta};return s(t,()=>i.signal,()=>a=!0),t})()),{maxPages:o}=i.options,u=n?l:c;return{pages:u(t.pages,r,o),pageParams:u(t.pageParams,e,o)}};if(r&&o.length){const t="backward"===r,e=t?P:C,s={pages:o,pageParams:u};h=await y(s,e(n,s),t)}else{const e=t??o.length;do{const t=0===d?u[0]??n.initialPageParam:C(n,h);if(d>0&&null==t)break;h=await y(h,t),d++}while(d<e)}return h};i.options.persister?i.fetchFn=()=>i.options.persister?.(f,{client:i.client,queryKey:i.queryKey,meta:i.options.meta,signal:i.signal},a):i.fetchFn=f}}}function C(t,{pages:e,pageParams:s}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}function P(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}function O(t,e){return!!e&&null!=C(t,e)}function w(t,e){return!(!e||!t.getPreviousPageParam)&&null!=P(t,e)}var Q=class extends i{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#a({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=r({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(/* @__PURE__ */new Error("No mutationFn found")),onFail:(t,e)=>{this.#a({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#a({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const i="pending"===this.state.status,a=!this.#i.canStart();try{if(i)e();else{this.#a({type:"pending",variables:t,isPaused:a}),this.#s.config.onMutate&&await this.#s.config.onMutate(t,this,s);const e=await(this.options.onMutate?.(t,s));e!==this.state.context&&this.#a({type:"pending",context:e,variables:t,isPaused:a})}const n=await this.#i.start();return await(this.#s.config.onSuccess?.(n,t,this.state.context,this,s)),await(this.options.onSuccess?.(n,t,this.state.context,s)),await(this.#s.config.onSettled?.(n,null,this.state.variables,this.state.context,this,s)),await(this.options.onSettled?.(n,null,t,this.state.context,s)),this.#a({type:"success",data:n}),n}catch(n){try{await(this.#s.config.onError?.(n,t,this.state.context,this,s))}catch(o){Promise.reject(o)}try{await(this.options.onError?.(n,t,this.state.context,s))}catch(o){Promise.reject(o)}try{await(this.#s.config.onSettled?.(void 0,n,this.state.variables,this.state.context,this,s))}catch(o){Promise.reject(o)}try{await(this.options.onSettled?.(void 0,n,t,this.state.context,s))}catch(o){Promise.reject(o)}throw this.#a({type:"error",error:n}),n}finally{this.#s.runNext(this)}}#a(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),b.batch(()=>{this.#e.forEach(e=>{e.onMutationUpdate(t)}),this.#s.notify({mutation:this,type:"updated",action:t})})}},D=class extends m{constructor(t={}){super(),this.config=t,this.#n=/* @__PURE__ */new Set,this.#r=/* @__PURE__ */new Map,this.#o=0}#n;#r;#o;build(t,e,s){const i=new Q({client:t,mutationCache:this,mutationId:++this.#o,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#n.add(t);const e=x(t);if("string"==typeof e){const s=this.#r.get(e);s?s.push(t):this.#r.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#n.delete(t)){const e=x(t);if("string"==typeof e){const s=this.#r.get(e);if(s)if(s.length>1){const e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#r.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=x(t);if("string"==typeof e){const s=this.#r.get(e)?.find(t=>"pending"===t.state.status);return!s||s===t}return!0}runNext(t){const e=x(t);return"string"==typeof e?(this.#r.get(e)?.find(e=>e!==t&&e.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){b.batch(()=>{this.#n.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#n.clear(),this.#r.clear()})}getAll(){return Array.from(this.#n)}find(t){const e={exact:!0,...t};return this.getAll().find(t=>d(e,t))}findAll(t={}){return this.getAll().filter(e=>d(t,e))}notify(t){b.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(t=>t.state.isPaused);return b.batch(()=>Promise.all(t.map(t=>t.continue().catch(u))))}};function x(t){return t.options.scope?.id}var M=class extends m{constructor(t={}){super(),this.config=t,this.#u=/* @__PURE__ */new Map}#u;build(t,e,s){const i=e.queryKey,n=e.queryHash??a(i,e);let r=this.get(n);return r||(r=new o({client:t,queryKey:i,queryHash:n,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(i)}),this.add(r)),r}add(t){this.#u.has(t.queryHash)||(this.#u.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#u.get(t.queryHash);e&&(t.destroy(),e===t&&this.#u.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){b.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#u.get(t)}getAll(){return[...this.#u.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(t=>f(e,t))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(e=>f(t,e)):e}notify(t){b.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){b.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){b.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},A=class{#h;#s;#c;#l;#d;#f;#y;#p;constructor(t={}){this.#h=t.queryCache||new M,this.#s=t.mutationCache||new D,this.#c=t.defaultOptions||{},this.#l=/* @__PURE__ */new Map,this.#d=/* @__PURE__ */new Map,this.#f=0}mount(){this.#f++,1===this.#f&&(this.#y=p.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#h.onFocus())}),this.#p=h.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#h.onOnline())}))}unmount(){this.#f--,0===this.#f&&(this.#y?.(),this.#y=void 0,this.#p?.(),this.#p=void 0)}isFetching(t){return this.#h.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#s.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#h.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=this.#h.build(this,e),i=s.state.data;return void 0===i?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(g(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#h.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){const i=this.defaultQueryOptions({queryKey:t}),a=this.#h.get(i.queryHash)?.state.data,r=n(e,a);if(void 0!==r)return this.#h.build(this,i).setData(r,{...s,manual:!0})}setQueriesData(t,e,s){return b.batch(()=>this.#h.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,s)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#h.get(e.queryHash)?.state}removeQueries(t){const e=this.#h;b.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){const s=this.#h;return b.batch(()=>(s.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const s={revert:!0,...e},i=b.batch(()=>this.#h.findAll(t).map(t=>t.cancel(s)));return Promise.all(i).then(u).catch(u)}invalidateQueries(t,e={}){return b.batch(()=>(this.#h.findAll(t).forEach(t=>{t.invalidate()}),"none"===t?.refetchType?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},i=b.batch(()=>this.#h.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,s);return s.throwOnError||(e=e.catch(u)),"paused"===t.state.fetchStatus?Promise.resolve():e}));return Promise.all(i).then(u)}fetchQuery(t){const e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);const s=this.#h.build(this,e);return s.isStaleByTime(g(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(u).catch(u)}fetchInfiniteQuery(t){return t.behavior=q(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(u).catch(u)}ensureInfiniteQueryData(t){return t.behavior=q(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return h.isOnline()?this.#s.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#h}getMutationCache(){return this.#s}getDefaultOptions(){return this.#c}setDefaultOptions(t){this.#c=t}setQueryDefaults(t,e){this.#l.set(v(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(e){const s=[...this.#l.values()],i={};return s.forEach(s=>{t(e,s.queryKey)&&Object.assign(i,s.defaultOptions)}),i}setMutationDefaults(t,e){this.#d.set(v(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(e){const s=[...this.#d.values()],i={};return s.forEach(s=>{t(e,s.mutationKey)&&Object.assign(i,s.defaultOptions)}),i}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#c.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=a(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===y&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#c.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#h.clear(),this.#s.clear()}};export{q as i,O as n,w as r,A as t};
1
+ import{$ as t,G as e,H as s,I as i,J as a,K as n,L as r,P as o,Q as u,R as h,U as c,W as l,X as d,Z as f,at as y,ct as p,lt as m,nt as g,q as v,z as b}from"./Ce4GGag_.js";function q(t){return{onFetch:(i,a)=>{const n=i.options,r=i.fetchOptions?.meta?.fetchMore?.direction,o=i.state.data?.pages||[],u=i.state.data?.pageParams||[];let h={pages:[],pageParams:[]},d=0;const f=async()=>{let a=!1;const f=e(i.options,i.fetchOptions),y=async(t,e,n)=>{if(a)return Promise.reject();if(null==e&&t.pages.length)return Promise.resolve(t);const r=await f((()=>{const t={client:i.client,queryKey:i.queryKey,pageParam:e,direction:n?"backward":"forward",meta:i.options.meta};return s(t,()=>i.signal,()=>a=!0),t})()),{maxPages:o}=i.options,u=n?l:c;return{pages:u(t.pages,r,o),pageParams:u(t.pageParams,e,o)}};if(r&&o.length){const t="backward"===r,e=t?P:C,s={pages:o,pageParams:u};h=await y(s,e(n,s),t)}else{const e=t??o.length;do{const t=0===d?u[0]??n.initialPageParam:C(n,h);if(d>0&&null==t)break;h=await y(h,t),d++}while(d<e)}return h};i.options.persister?i.fetchFn=()=>i.options.persister?.(f,{client:i.client,queryKey:i.queryKey,meta:i.options.meta,signal:i.signal},a):i.fetchFn=f}}}function C(t,{pages:e,pageParams:s}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}function P(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}function O(t,e){return!!e&&null!=C(t,e)}function w(t,e){return!(!e||!t.getPreviousPageParam)&&null!=P(t,e)}var Q=class extends i{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#a({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=r({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(/* @__PURE__ */new Error("No mutationFn found")),onFail:(t,e)=>{this.#a({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#a({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const i="pending"===this.state.status,a=!this.#i.canStart();try{if(i)e();else{this.#a({type:"pending",variables:t,isPaused:a}),this.#s.config.onMutate&&await this.#s.config.onMutate(t,this,s);const e=await(this.options.onMutate?.(t,s));e!==this.state.context&&this.#a({type:"pending",context:e,variables:t,isPaused:a})}const n=await this.#i.start();return await(this.#s.config.onSuccess?.(n,t,this.state.context,this,s)),await(this.options.onSuccess?.(n,t,this.state.context,s)),await(this.#s.config.onSettled?.(n,null,this.state.variables,this.state.context,this,s)),await(this.options.onSettled?.(n,null,t,this.state.context,s)),this.#a({type:"success",data:n}),n}catch(n){try{await(this.#s.config.onError?.(n,t,this.state.context,this,s))}catch(o){Promise.reject(o)}try{await(this.options.onError?.(n,t,this.state.context,s))}catch(o){Promise.reject(o)}try{await(this.#s.config.onSettled?.(void 0,n,this.state.variables,this.state.context,this,s))}catch(o){Promise.reject(o)}try{await(this.options.onSettled?.(void 0,n,t,this.state.context,s))}catch(o){Promise.reject(o)}throw this.#a({type:"error",error:n}),n}finally{this.#s.runNext(this)}}#a(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),b.batch(()=>{this.#e.forEach(e=>{e.onMutationUpdate(t)}),this.#s.notify({mutation:this,type:"updated",action:t})})}},D=class extends m{constructor(t={}){super(),this.config=t,this.#n=/* @__PURE__ */new Set,this.#r=/* @__PURE__ */new Map,this.#o=0}#n;#r;#o;build(t,e,s){const i=new Q({client:t,mutationCache:this,mutationId:++this.#o,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#n.add(t);const e=x(t);if("string"==typeof e){const s=this.#r.get(e);s?s.push(t):this.#r.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#n.delete(t)){const e=x(t);if("string"==typeof e){const s=this.#r.get(e);if(s)if(s.length>1){const e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#r.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=x(t);if("string"==typeof e){const s=this.#r.get(e)?.find(t=>"pending"===t.state.status);return!s||s===t}return!0}runNext(t){const e=x(t);return"string"==typeof e?(this.#r.get(e)?.find(e=>e!==t&&e.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){b.batch(()=>{this.#n.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#n.clear(),this.#r.clear()})}getAll(){return Array.from(this.#n)}find(t){const e={exact:!0,...t};return this.getAll().find(t=>d(e,t))}findAll(t={}){return this.getAll().filter(e=>d(t,e))}notify(t){b.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(t=>t.state.isPaused);return b.batch(()=>Promise.all(t.map(t=>t.continue().catch(u))))}};function x(t){return t.options.scope?.id}var M=class extends m{constructor(t={}){super(),this.config=t,this.#u=/* @__PURE__ */new Map}#u;build(t,e,s){const i=e.queryKey,n=e.queryHash??a(i,e);let r=this.get(n);return r||(r=new o({client:t,queryKey:i,queryHash:n,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(i)}),this.add(r)),r}add(t){this.#u.has(t.queryHash)||(this.#u.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#u.get(t.queryHash);e&&(t.destroy(),e===t&&this.#u.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){b.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#u.get(t)}getAll(){return[...this.#u.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(t=>f(e,t))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(e=>f(t,e)):e}notify(t){b.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){b.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){b.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},A=class{#h;#s;#c;#l;#d;#f;#y;#p;constructor(t={}){this.#h=t.queryCache||new M,this.#s=t.mutationCache||new D,this.#c=t.defaultOptions||{},this.#l=/* @__PURE__ */new Map,this.#d=/* @__PURE__ */new Map,this.#f=0}mount(){this.#f++,1===this.#f&&(this.#y=p.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#h.onFocus())}),this.#p=h.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#h.onOnline())}))}unmount(){this.#f--,0===this.#f&&(this.#y?.(),this.#y=void 0,this.#p?.(),this.#p=void 0)}isFetching(t){return this.#h.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#s.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#h.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=this.#h.build(this,e),i=s.state.data;return void 0===i?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(g(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#h.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){const i=this.defaultQueryOptions({queryKey:t}),a=this.#h.get(i.queryHash)?.state.data,r=n(e,a);if(void 0!==r)return this.#h.build(this,i).setData(r,{...s,manual:!0})}setQueriesData(t,e,s){return b.batch(()=>this.#h.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,s)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#h.get(e.queryHash)?.state}removeQueries(t){const e=this.#h;b.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){const s=this.#h;return b.batch(()=>(s.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const s={revert:!0,...e},i=b.batch(()=>this.#h.findAll(t).map(t=>t.cancel(s)));return Promise.all(i).then(u).catch(u)}invalidateQueries(t,e={}){return b.batch(()=>(this.#h.findAll(t).forEach(t=>{t.invalidate()}),"none"===t?.refetchType?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},i=b.batch(()=>this.#h.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,s);return s.throwOnError||(e=e.catch(u)),"paused"===t.state.fetchStatus?Promise.resolve():e}));return Promise.all(i).then(u)}fetchQuery(t){const e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);const s=this.#h.build(this,e);return s.isStaleByTime(g(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(u).catch(u)}fetchInfiniteQuery(t){return t.behavior=q(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(u).catch(u)}ensureInfiniteQueryData(t){return t.behavior=q(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return h.isOnline()?this.#s.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#h}getMutationCache(){return this.#s}getDefaultOptions(){return this.#c}setDefaultOptions(t){this.#c=t}setQueryDefaults(t,e){this.#l.set(v(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(e){const s=[...this.#l.values()],i={};return s.forEach(s=>{t(e,s.queryKey)&&Object.assign(i,s.defaultOptions)}),i}setMutationDefaults(t,e){this.#d.set(v(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(e){const s=[...this.#d.values()],i={};return s.forEach(s=>{t(e,s.mutationKey)&&Object.assign(i,s.defaultOptions)}),i}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#c.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=a(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===y&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#c.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#h.clear(),this.#s.clear()}};export{q as i,O as n,w as r,A as t};